diff --git a/.github/workflows/CreateRelease.yml b/.github/workflows/CreateRelease.yml
index 7ac246277..7ab53abd3 100644
--- a/.github/workflows/CreateRelease.yml
+++ b/.github/workflows/CreateRelease.yml
@@ -1,4 +1,4 @@
-name: BuildAndRelease
+name: CreateRelease
on:
#[push, pull_request] #just for test release scripts
@@ -8,9 +8,7 @@ on:
description: 'New MeshLab Version'
required: true
default: 'YYYY.MM'
- #schedule:
- # - cron: '0 1 1 * *' #every first day of the month at 1am
-
+
jobs:
update_ml_version:
@@ -19,12 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
- fetch-depth: 2
submodules: true
- #- name: Setup env variables
- # id: envs
- # run: |
- # echo ::set-output name=date::"$(date +%Y.%m)"
- name: Update MeshLab version
run : |
echo ${{ github.event.inputs.version }} | tr -d '\n'> ML_VERSION
@@ -34,15 +27,15 @@ jobs:
/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
+ sed "s%MESHLAB_VERSION%$(cat ML_VERSION)%g" scripts/Linux/resources/snap/snap_noversion.yaml > snapcraft.yaml
- name: commit ML_VERSION, snapcraft.yaml and Info.plist change
uses: stefanzweifel/git-auto-commit-action@v4.1.1
with:
commit_message: Apply automatic ML_VERSION, snapcraft.yaml and Info.plist change
- ubuntu_build_appimage:
+ linux_build:
needs: [update_ml_version]
- name: Build MeshLab (Ubuntu - AppImage)
+ name: Build MeshLab (Linux)
runs-on: ubuntu-16.04 #in order to deploy, need to use oldest supported version
steps:
@@ -50,47 +43,34 @@ jobs:
with:
ref: master
submodules: true
- - name: Install Qt
- uses: jurplel/install-qt-action@v2
- with:
- modules: xmlpatterns
- name: Install dependencies
run: |
- sudo apt-get install -y mesa-common-dev libglu1-mesa-dev libglew-dev libeigen3-dev libgmp-dev
- sudo apt-get install -y libxkbcommon-x11-0 patchelf
+ sh scripts/${{ runner.os }}/0_setup_env_ubuntu.sh
- name: Setup env variables
id: envs
run: |
echo ::set-output name=date::"$(cat ML_VERSION)"
- - name: Build MeshLab
+ - name: Configure and Build
run: |
- sh install/linux/linux_build.sh
- - name: Make MeshLab Bundle
+ sh scripts/${{ runner.os }}/1_build.sh
+ - name: Deploy
run: |
- sh install/linux/linux_make_bundle.sh
- - name: Deploy MeshLab and MeshLabServer
+ sh scripts/${{ runner.os }}/2_deploy.sh
+ - name: Build MeshLab AppImage
run : |
- sh install/linux/linux_deploy.sh
- - name: Build MeshLab and MeshLabServer AppImages
- run : |
- sh install/linux/linux_appimages.sh
+ sh scripts/${{ runner.os }}/3_appimage.sh
- name: Upload Meshlab Portable
uses: actions/upload-artifact@v1
with:
name: meshlab_linux_portable
- path: distrib/
- - name: Upload MeshlabServer AppImage
- uses: actions/upload-artifact@v1
- with:
- name: meshlabserver_linux_appimage
- path: MeshLabServer${{steps.envs.outputs.date}}-linux.AppImage
+ path: src/install/
- name: Upload Meshlab AppImage
uses: actions/upload-artifact@v1
with:
name: meshlab_linux_appimage
- path: MeshLab${{steps.envs.outputs.date}}-linux.AppImage
+ path: src/MeshLab${{steps.envs.outputs.date}}-linux.AppImage
- ubuntu_build_snap:
+ linux_build_snap:
needs: [update_ml_version]
name: Build MeshLab (Ubuntu - Snap)
runs-on: ubuntu-latest
@@ -145,21 +125,21 @@ jobs:
shell: bash
run: |
echo ::set-output name=date::"$(cat ML_VERSION)"
- - name: Build MeshLab
+ - name: Configure and Build
run: |
- sh install/macos/macos_build.sh
- - name: Deploy MeshLab
+ sh scripts/${{ runner.os }}/1_build.sh
+ - name: Deploy
run: |
- sh install/macos/macos_deploy.sh
+ sh scripts/${{ runner.os }}/2_deploy.sh
- name: Create DMG
run: |
- sh install/macos/macos_dmg.sh
- mv distrib/MeshLab${{steps.envs.outputs.date}}.dmg distrib/MeshLab${{steps.envs.outputs.date}}-macos.dmg
+ sh scripts/${{ runner.os }}/3_dmg.sh
+ mv src/install/MeshLab${{steps.envs.outputs.date}}.dmg src/install/MeshLab${{steps.envs.outputs.date}}-macos.dmg
- name: Upload DMG
uses: actions/upload-artifact@v1
with:
name: meshlab_macos_dmg
- path: distrib/MeshLab${{steps.envs.outputs.date}}-macos.dmg
+ path: src/install/MeshLab${{steps.envs.outputs.date}}-macos.dmg
windows_build:
needs: [update_ml_version]
@@ -177,57 +157,55 @@ jobs:
New-Item -Name "jom" -ItemType "directory"
Expand-Archive -Path jom_1_1_3.zip -DestinationPath .\jom
echo "::add-path::$(Get-Location)\jom"
- - name: Setup env variables
- id: envs
- run: |
- echo "VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC" >> $GITHUB_ENV
- #echo '::set-env name=VCINSTALLDIR::C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC'
- echo "::set-output name=date::$(type ML_VERSION)"
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
modules: xmlpatterns
- - name: Build MeshLab
+ - name: Setup env variables
+ id: envs
run: |
- .\install\windows\windows_build.ps1
- - name: Deploy MeshLab
+ echo "::set-output name=date::$(type ML_VERSION)"
+ - name: Configure and Build
+ shell: bash
run: |
- .\install\windows\windows_deploy.ps1
+ sh scripts/${{ runner.os }}/1_build.sh
+ - name: Deploy
+ shell: bash
+ run: |
+ sh scripts/${{ runner.os }}/2_deploy.sh
- name: NSIS script
+ shell: bash
run: |
- .\install\windows\resources\windows_nsis_script.ps1
+ sh scripts/${{ runner.os }}/resources/nsis_script.sh
- name: Create Installer
uses: joncloud/makensis-action@v1
with:
- script-file: "install/windows/resources/meshlab_final.nsi"
+ script-file: "src/install/meshlab_final.nsi"
- name: Rename Installer
+ shell: bash
run: |
- Rename-Item -Path install\windows\resources\MeshLab${{steps.envs.outputs.date}}.exe -NewName MeshLab${{steps.envs.outputs.date}}-windows.exe
- - name: Upload Meshlab Portable
+ mv src/install/MeshLab${{steps.envs.outputs.date}}.exe src/MeshLab${{steps.envs.outputs.date}}-windows.exe
+ - name: Uploading MeshLab Portable
uses: actions/upload-artifact@v1
with:
name: meshlab_windows_portable
- path: distrib
+ path: src/install
- name: Upload Meshlab Installer
uses: actions/upload-artifact@v1
with:
name: meshlab_windows_installer
- path: install/windows/resources/MeshLab${{steps.envs.outputs.date}}-windows.exe
+ path: src/MeshLab${{steps.envs.outputs.date}}-windows.exe
-#after building MeshLab for the three platforms, we create a release in github
+ #after building MeshLab for the three platforms, we create a release in github
create_release:
name: Create Release
- needs: [ubuntu_build_appimage, ubuntu_build_snap, macos_build, windows_build]
+ needs: [linux_build, linux_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)"
- #Linux Release
+ #Download Linux Packages
- name: Download Linux ZIP
uses: actions/download-artifact@v1
with:
@@ -236,10 +214,6 @@ jobs:
uses: actions/download-artifact@v1
with:
name: meshlab_linux_appimage
- - name: Download Linux MeshLabServer AppImage
- uses: actions/download-artifact@v1
- with:
- name: meshlabserver_linux_appimage
- name: Download Linux Snap
uses: actions/download-artifact@v1
with:
@@ -250,20 +224,19 @@ jobs:
chmod +x meshlab_linux_portable/usr/bin/meshlabserver
chmod +x meshlab_linux_portable/AppRun
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${{ github.event.inputs.version }}-linux.tar.gz meshlab_linux_portable/
-
- #MacOS Release
+
+ #Download MacOS Package
- name: Download MacOS DMG
uses: actions/download-artifact@v1
with:
name: meshlab_macos_dmg
-
- #Windows Release
+
+ #Download Windows Packages
- name: Download Windows ZIP
uses: actions/download-artifact@v1
with:
@@ -275,8 +248,8 @@ jobs:
- name: Create MeshLab Portable Windows Archive
run: |
zip -r MeshLab${{ github.event.inputs.version }}-windows.zip meshlab_windows_portable/
-
-
+
+
#Create release and upload
- name: Publish Release
id: create_release
@@ -309,16 +282,6 @@ jobs:
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
- uses: actions/upload-release-asset@v1.0.1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }}
- 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
uses: actions/upload-release-asset@v1.0.1
diff --git a/.github/workflows/Linux.yml b/.github/workflows/Linux.yml
index 6bbb8751b..90112e95a 100644
--- a/.github/workflows/Linux.yml
+++ b/.github/workflows/Linux.yml
@@ -4,76 +4,37 @@ on:
[push, pull_request]
jobs:
- ubuntu_build_appimage:
- name: Build MeshLab (Ubuntu - AppImage)
+ linux_build:
+ name: Build MeshLab (Linux)
runs-on: ubuntu-16.04 #in order to deploy, need to use oldest supported version
steps:
- uses: actions/checkout@v2
with:
submodules: true
- - name: Install Qt
- uses: jurplel/install-qt-action@v2
- with:
- modules: xmlpatterns
- name: Install dependencies
run: |
- sudo apt-get install -y mesa-common-dev libglu1-mesa-dev libglew-dev libeigen3-dev libgmp-dev
- sudo apt-get install -y libxkbcommon-x11-0 patchelf
+ sh scripts/${{ runner.os }}/0_setup_env_ubuntu.sh
- name: Setup env variables
id: envs
run: |
echo ::set-output name=date::"$(cat ML_VERSION)"
- - name: Build MeshLab
+ - name: Configure and Build
run: |
- sh install/linux/linux_build.sh
- - name: Make MeshLab Bundle
+ sh scripts/${{ runner.os }}/1_build.sh
+ - name: Deploy
run: |
- sh install/linux/linux_make_bundle.sh
- - name: Deploy MeshLab and MeshLabServer
+ sh scripts/${{ runner.os }}/2_deploy.sh
+ - name: Build MeshLab AppImage
run : |
- sh install/linux/linux_deploy.sh
- - name: Build MeshLab and MeshLabServer AppImages
- run : |
- sh install/linux/linux_appimages.sh
+ sh scripts/${{ runner.os }}/3_appimage.sh
- name: Upload Meshlab Portable
uses: actions/upload-artifact@v1
with:
name: meshlab_linux_portable
- path: distrib/
- - name: Upload MeshlabServer AppImage
- uses: actions/upload-artifact@v1
- with:
- name: meshlabserver_linux_appimage
- path: MeshLabServer${{steps.envs.outputs.date}}-linux.AppImage
+ path: src/install/
- name: Upload Meshlab AppImage
uses: actions/upload-artifact@v1
with:
name: meshlab_linux_appimage
- path: MeshLab${{steps.envs.outputs.date}}-linux.AppImage
-
- ubuntu_build_cmake:
- name: Build MeshLab (Ubuntu - CMake)
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v2
- with:
- submodules: true
- - name: Install dependencies
- run: |
- sh install/linux/linux_setup_env_ubuntu.sh
- sudo apt-get install cmake ninja-build
- - name: Setup env variables
- id: envs
- run: |
- echo ::set-output name=date::"$(cat ML_VERSION)"
- - name: Configure
- run: |
- cmake src/ -G Ninja
- - name: Build MeshLab
- run: |
- ninja -C .
- - name: Install Meshlab
- run: sudo ninja -C . install
-
+ path: src/MeshLab${{steps.envs.outputs.date}}-linux.AppImage
diff --git a/.github/workflows/LinuxSnap.yml b/.github/workflows/LinuxSnap.yml
index e554f0b3a..c03a08c80 100644
--- a/.github/workflows/LinuxSnap.yml
+++ b/.github/workflows/LinuxSnap.yml
@@ -2,10 +2,10 @@ name: LinuxSnap
on:
workflow_dispatch
-
+
jobs:
- ubuntu_build_snap:
- name: Build MeshLab (Ubuntu - Snap)
+ linux_build_snap:
+ name: Build MeshLab (Linux - Snap)
runs-on: ubuntu-latest
steps:
diff --git a/.github/workflows/MacOS.yml b/.github/workflows/MacOS.yml
index bab5bb5af..70a8aebec 100644
--- a/.github/workflows/MacOS.yml
+++ b/.github/workflows/MacOS.yml
@@ -24,25 +24,19 @@ jobs:
id: envs
shell: bash
run: |
- #sh install/macos/macos_setup_env.sh
- #necessary here on github actions:
- #echo '::set-env name=QTDIR::/usr/local/opt/qt'
- #echo '::add-path::/usr/local/opt/qt/bin'
- #echo '::set-env name=LD_LIBRARY_PATH::/usr/local/opt/qt/lib:${{env.LD_LIBRARY_PATH}}'
- #echo '::set-env name=PKG_CONFIG_PATH::/usr/local/opt/qt/lib:${{env.PKG_CONFIG_PATH}}'
echo ::set-output name=date::"$(cat ML_VERSION)"
- - name: Build MeshLab
+ - name: Configure and Build
run: |
- sh install/macos/macos_build.sh
- - name: Deploy MeshLab
+ sh scripts/${{ runner.os }}/1_build.sh
+ - name: Deploy
run: |
- sh install/macos/macos_deploy.sh
+ sh scripts/${{ runner.os }}/2_deploy.sh
- name: Create DMG
run: |
- sh install/macos/macos_dmg.sh
- mv distrib/MeshLab${{steps.envs.outputs.date}}.dmg distrib/MeshLab${{steps.envs.outputs.date}}-macos.dmg
+ sh scripts/${{ runner.os }}/3_dmg.sh
+ mv src/install/MeshLab${{steps.envs.outputs.date}}.dmg src/install/MeshLab${{steps.envs.outputs.date}}-macos.dmg
- name: Upload DMG
uses: actions/upload-artifact@v1
with:
name: meshlab_macos_dmg
- path: distrib/MeshLab${{steps.envs.outputs.date}}-macos.dmg
+ path: src/install/MeshLab${{steps.envs.outputs.date}}-macos.dmg
diff --git a/.github/workflows/QmakeBuilds.yml b/.github/workflows/QmakeBuilds.yml
new file mode 100644
index 000000000..4df4ed9e4
--- /dev/null
+++ b/.github/workflows/QmakeBuilds.yml
@@ -0,0 +1,142 @@
+name: Qmake builds
+
+on: [push, pull_request]
+
+jobs:
+ ubuntu_build:
+ name: Build MeshLab (Ubuntu - QMake)
+ runs-on: ubuntu-16.04 #in order to deploy, need to use oldest supported version
+
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ - name: Install Qt
+ uses: jurplel/install-qt-action@v2
+ with:
+ modules: xmlpatterns
+ - name: Install dependencies
+ run: |
+ sudo apt-get install -y mesa-common-dev libglu1-mesa-dev libglew-dev libeigen3-dev libgmp-dev
+ sudo apt-get install -y libxkbcommon-x11-0 patchelf
+ - name: Setup env variables
+ id: envs
+ run: |
+ echo ::set-output name=date::"$(cat ML_VERSION)"
+ - name: Build MeshLab
+ run: |
+ sh scripts/${{ runner.os }}/qmake/linux_build.sh
+ - name: Make MeshLab Bundle
+ run: |
+ sh scripts/${{ runner.os }}/qmake/linux_make_bundle.sh
+ - name: Deploy MeshLab and MeshLabServer
+ run : |
+ sh scripts/${{ runner.os }}/qmake/linux_deploy.sh
+ - name: Build MeshLab and MeshLabServer AppImages
+ run : |
+ sh scripts/${{ runner.os }}/qmake/linux_appimages.sh
+ - name: Upload Meshlab Portable
+ uses: actions/upload-artifact@v1
+ with:
+ name: meshlab_linux_portable
+ path: distrib/
+ - name: Upload MeshlabServer AppImage
+ uses: actions/upload-artifact@v1
+ with:
+ name: meshlabserver_linux_appimage
+ path: MeshLabServer${{steps.envs.outputs.date}}-linux.AppImage
+ - name: Upload Meshlab AppImage
+ uses: actions/upload-artifact@v1
+ with:
+ name: meshlab_linux_appimage
+ path: MeshLab${{steps.envs.outputs.date}}-linux.AppImage
+
+ macos_build_qmake:
+ name: Build MeshLab (MacOS - QMake)
+ runs-on: macos-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ - name: Install dependencies
+ run: |
+ brew install libomp
+ npm install -g appdmg
+ - name: Install Qt
+ uses: jurplel/install-qt-action@v2
+ with:
+ modules: xmlpatterns
+ - name: Setup env variables
+ id: envs
+ shell: bash
+ run: |
+ echo ::set-output name=date::"$(cat ML_VERSION)"
+ - name: Build MeshLab
+ run: |
+ sh scripts/${{ runner.os }}/qmake/macos_build.sh
+ - name: Deploy MeshLab
+ run: |
+ sh scripts/${{ runner.os }}/qmake/macos_deploy.sh
+ - name: Create DMG
+ run: |
+ sh scripts/${{ runner.os }}/qmake/macos_dmg.sh
+ mv distrib/MeshLab${{steps.envs.outputs.date}}.dmg distrib/MeshLab${{steps.envs.outputs.date}}-macos.dmg
+ - name: Upload DMG
+ uses: actions/upload-artifact@v1
+ with:
+ name: meshlab_macos_dmg
+ path: distrib/MeshLab${{steps.envs.outputs.date}}-macos.dmg
+
+ windows_build_qmake:
+ name: Build MeshLab (Windows - QMake)
+ runs-on: windows-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ 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"
+ New-Item -Name "jom" -ItemType "directory"
+ Expand-Archive -Path jom_1_1_3.zip -DestinationPath .\jom
+ echo "::add-path::$(Get-Location)\jom"
+ - name: Setup env variables
+ id: envs
+ run: |
+ echo "VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC" >> $GITHUB_ENV
+ #echo '::set-env name=VCINSTALLDIR::C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC'
+ echo "::set-output name=date::$(type ML_VERSION)"
+ - name: Setup MSVC
+ uses: ilammy/msvc-dev-cmd@v1
+ - name: Install Qt
+ uses: jurplel/install-qt-action@v2
+ with:
+ modules: xmlpatterns
+ - name: Build MeshLab
+ run: |
+ .\scripts\${{ runner.os }}\qmake\windows_build.ps1
+ - name: Deploy MeshLab
+ run: |
+ .\scripts\${{ runner.os }}\qmake\windows_deploy.ps1
+ - name: NSIS script
+ run: |
+ .\scripts\${{ runner.os }}\resources\windows_nsis_script.ps1
+ - name: Create Installer
+ uses: joncloud/makensis-action@v1
+ with:
+ script-file: "scripts/windows/resources/meshlab_final.nsi"
+ - name: Rename Installer
+ run: |
+ Rename-Item -Path scripts\windows\resources\MeshLab${{steps.envs.outputs.date}}.exe -NewName MeshLab${{steps.envs.outputs.date}}-windows.exe
+ - name: Upload Meshlab Portable
+ uses: actions/upload-artifact@v1
+ with:
+ name: meshlab_windows_portable
+ path: distrib
+ - name: Upload Meshlab Installer
+ uses: actions/upload-artifact@v1
+ with:
+ name: meshlab_windows_installer
+ path: scripts/windows/resources/MeshLab${{steps.envs.outputs.date}}-windows.exe
diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml
index 4cb456b9a..65297218e 100644
--- a/.github/workflows/Windows.yml
+++ b/.github/workflows/Windows.yml
@@ -17,75 +17,43 @@ jobs:
New-Item -Name "jom" -ItemType "directory"
Expand-Archive -Path jom_1_1_3.zip -DestinationPath .\jom
echo "::add-path::$(Get-Location)\jom"
- - name: Setup env variables
- id: envs
- run: |
- echo "VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC" >> $GITHUB_ENV
- #echo '::set-env name=VCINSTALLDIR::C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC'
- echo "::set-output name=date::$(type ML_VERSION)"
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
modules: xmlpatterns
- #mirror: 'http://mirrors.ocf.berkeley.edu/qt/'
- - name: Build MeshLab
+ - name: Setup env variables
+ id: envs
run: |
- .\install\windows\windows_build.ps1
- - name: Deploy MeshLab
+ echo "::set-output name=date::$(type ML_VERSION)"
+ - name: Configure and Build
+ shell: bash
run: |
- .\install\windows\windows_deploy.ps1
+ sh scripts/${{ runner.os }}/1_build.sh
+ - name: Deploy
+ shell: bash
+ run: |
+ sh scripts/${{ runner.os }}/2_deploy.sh
- name: NSIS script
+ shell: bash
run: |
- .\install\windows\resources\windows_nsis_script.ps1
+ sh scripts/${{ runner.os }}/resources/nsis_script.sh
- name: Create Installer
uses: joncloud/makensis-action@v1
with:
- script-file: "install/windows/resources/meshlab_final.nsi"
+ script-file: "src/install/meshlab_final.nsi"
- name: Rename Installer
+ shell: bash
run: |
- Rename-Item -Path install\windows\resources\MeshLab${{steps.envs.outputs.date}}.exe -NewName MeshLab${{steps.envs.outputs.date}}-windows.exe
- - name: Upload Meshlab Portable
+ mv src/install/MeshLab${{steps.envs.outputs.date}}.exe src/MeshLab${{steps.envs.outputs.date}}-windows.exe
+ - name: Uploading MeshLab Portable
uses: actions/upload-artifact@v1
with:
name: meshlab_windows_portable
- path: distrib
+ path: src/install
- name: Upload Meshlab Installer
uses: actions/upload-artifact@v1
with:
name: meshlab_windows_installer
- path: install/windows/resources/MeshLab${{steps.envs.outputs.date}}-windows.exe
-
- windows_build_cmake:
- name: Build MeshLab (Windows, CMake)
- runs-on: windows-latest
-
- steps:
- - uses: actions/checkout@v2
- with:
- submodules: true
- - name: Setup MSVC
- uses: ilammy/msvc-dev-cmd@v1
- - name: Install Qt
- uses: jurplel/install-qt-action@v2
- with:
- modules: xmlpatterns
- #mirror: 'http://mirrors.ocf.berkeley.edu/qt/'
- - name: Setup env variables
- id: envs
- run: |
- echo "::set-output name=date::$(type ML_VERSION)"
- - name: Configure
- run: |
- cmake -S ./src -B ./build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
- # -DBUILD_MINI=ON
- - name: Build MeshLab
- run: |
- cmake --build $env:GITHUB_WORKSPACE/build --config RelWithDebInfo -j 4
- cmake --build $env:GITHUB_WORKSPACE/build --config RelWithDebInfo --target INSTALL
-# - name: Uploading MeshLab Portable
-# uses: actions/upload-artifact@v1
-# with:
-# name: meshlab_portable_windows_cmake
-# path: install
+ path: src/MeshLab${{steps.envs.outputs.date}}-windows.exe
diff --git a/.gitignore b/.gitignore
index 1a8913002..2c01706c6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,6 +18,7 @@
*.AppImage
.DS_Store
distrib*
+src/install/*
install/macos/resources/meshlab_dmg_final.json
install/windows/resources/meshlab_final.nsi
install/windows/resources/MeshLab*.exe
diff --git a/.gitmodules b/.gitmodules
index 0a24c6de6..90e29d2f6 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,4 +1,4 @@
-[submodule "vcglib"]
- path = vcglib
+[submodule "src/vcglib"]
+ path = src/vcglib
url = https://github.com/cnr-isti-vclab/vcglib
branch = devel
diff --git a/README.md b/README.md
index e6d53b82a..abc325d41 100644
--- a/README.md
+++ b/README.md
@@ -5,9 +5,9 @@


-This is the official repository for the source and the binaries of [MeshLab](https://www.MeshLab.net).
+This is the official repository for the source and the binaries of [MeshLab](https://www.MeshLab.net).
-MeshLab is an open source, portable, and extensible system for the processing and editing of unstructured large 3D triangular meshes. It is aimed to help the processing of the typical not-so-small unstructured models arising in 3D scanning, providing a set of tools for editing, cleaning, healing, inspecting, rendering and converting this kind of meshes. These tools include MeshLab proper, a versatile program with a graphical user interface, and [meshlabserver](https://github.com/cnr-isti-vclab/meshlab/blob/master/src/meshlabserver/README.md), a program that can perform mesh processing tasks in batch mode, without a GUI.
+MeshLab is an open source, portable, and extensible system for the processing and editing of unstructured large 3D triangular meshes. It is aimed to help the processing of the typical not-so-small unstructured models arising in 3D scanning, providing a set of tools for editing, cleaning, healing, inspecting, rendering and converting this kind of meshes. These tools include MeshLab proper, a versatile program with a graphical user interface, and [meshlabserver](https://github.com/cnr-isti-vclab/meshlab/blob/master/src/meshlabserver/README.md), a program that can perform mesh processing tasks in batch mode, without a GUI.
MeshLab is mostly based on the open source C++ mesh processing library [VCGlib](http://www.vcglib.net) developed at the [Visual Computing Lab](http://vcg.isti.cnr.it) of [ISTI - CNR](http://www.isti.cnr.it). VCG can be used as a stand-alone large-scale automated mesh processing pipeline, while MeshLab makes it easy to experiment with its algorithms interactively.
@@ -15,32 +15,29 @@ MeshLab is available for Windows, MacOS, and Linux.
# Releases
-You can find the last MeshLab release in the [Releases Tab](https://github.com/cnr-isti-vclab/meshlab/releases) for your favourite platform. [Github Actions](https://github.com/cnr-isti-vclab/meshlab/actions) is scheduled to release a new beta version of MeshLab the first day of every month.
+You can find the last MeshLab release in the [Releases Tab](https://github.com/cnr-isti-vclab/meshlab/releases) for your favourite platform.
You can also test a built version of MeshLab generated by the last commit pushed in this repository, by downloading the artifacts of the last [Github Actions](https://github.com/cnr-isti-vclab/meshlab/actions) workflow.
-### Note for Windows
-The portable version of MeshLab won't start if doesn't find a Visual C++ Compiler installed. If you get the error "MSVCP140.dll not found" or related, please install Visual C++ Redist by executing the `vc_redist.exe` file contained in the MeshLab portable archive. Alternatively, you can download Visual C++ Redist [here](https://support.microsoft.com/it-it/help/2977003/the-latest-supported-visual-c-downloads).
-
# Build instructions
-We provide a set of scripts that build and deploy MeshLab automatically. All the scripts can be found in the [install](https://github.com/cnr-isti-vclab/meshlab/tree/master/install) folder.
+We provide a set of scripts that build and deploy MeshLab automatically. All the scripts can be found in the [scripts](https://github.com/cnr-isti-vclab/meshlab/tree/master/scripts) folder.
For specific build instructions see the [src](https://github.com/cnr-isti-vclab/meshlab/blob/master/src/README.md) folder.
# Structure of the Repository
The MeshLab repository is organized as follows:
-* `distrib`: this folder contains a set of prebuilt libraries, shaders and plugins that will be used by MeshLab once it is compiled. Binaries and plugins will be placed in this folder after MeshLab is built, or a copy of this folder will be placed in the chosen shadow build directory. For more details, check the readme [here](https://github.com/cnr-isti-vclab/meshlab/tree/master/distrib/README.md);
+* `distrib`: this folder contains a set of prebuilt libraries and shaders that will be used by MeshLab once it is compiled. For more details, check the readme [here](https://github.com/cnr-isti-vclab/meshlab/tree/master/distrib/README.md);
* `docs`: doxygen scripts for generating MeshLab documentation. For more details, check the readme [here](https://github.com/cnr-isti-vclab/meshlab/tree/master/docs);
-* `install`: in this folder there are a set of platform-dependent script to build and deploy MeshLab. For more details, check the readme [here](https://github.com/cnr-isti-vclab/meshlab/tree/master/install/README.md);
-* `sample`: a set of files (meshes, images) used for tests;
-* `src`: this folder contains all the source code of MeshLab, its plugins and the external libraries that it requires. For more details, check the readme [here](https://github.com/cnr-isti-vclab/meshlab/blob/master/src/README.md);
-* `vcglib`: submodule of [VCGLib](https://github.com/cnr-isti-vclab/vcglib).
-
+* `sample` and `textures`: a set of files (meshes, images) used for tests;
+* `scripts`: in this folder there is a set of platform-dependent scripts to build and deploy MeshLab. For more details, check the readme [here](https://github.com/cnr-isti-vclab/meshlab/tree/master/scripts/README.md);
+* `src`: this folder contains all the source code of MeshLab, its plugins and the external libraries that it requires. For more details, check the readme [here](https://github.com/cnr-isti-vclab/meshlab/blob/master/src/README.md);
+* `unsupported`: this folder contains a set of old and unsupported MeshLab plugins that are no longer included and built under MeshLab.
+
# License
The Meshlab source is released under the [GPL License](LICENSE.txt).
-
+
# Copyright
```
diff --git a/distrib/README.md b/distrib/README.md
index eaedaa45d..def256882 100644
--- a/distrib/README.md
+++ b/distrib/README.md
@@ -1,8 +1,3 @@
# distrib folder
-The distrib folder contains a set of pre-built libraries, plugins and shaders that MeshLab needs to properly run.
-
-Running `qmake && make` from the [src](https://github.com/cnr-isti-vclab/meshlab/tree/master/src) folder of the repo, MeshLab binaries, plugins and libraries will be placed automatically in this folder.
-If instead a shadow build is set, the `distrib` folder will be automatically copied inside the selected build directory, and it will contain also binaries, plugins and libraries.
-
-After building MeshLab, the `distrib` directory will **not** contain a portable version of MeshLab, since it won't contain all the Qt's libraries needed by MeshLab. In order to deploy MeshLab, see the [install](https://github.com/cnr-isti-vclab/meshlab/tree/master/install) directory.
\ No newline at end of file
+The distrib folder contains a set of pre-built libraries and shaders that MeshLab needs to properly run, plus some other txt files and icons.
\ No newline at end of file
diff --git a/distrib/lib/readme.txt b/distrib/lib/readme.txt
index 9a89d1ddb..be7c8915f 100644
--- a/distrib/lib/readme.txt
+++ b/distrib/lib/readme.txt
@@ -1,10 +1,7 @@
-copy here the lib compiled for the system with the name specified in the directory name according to the QT system configuration names
-
-
Some compilation notes
------ libgmp ------
-For mac osx 10.6 with meshlab 32 bitÉ
+For mac osx 10.6 with meshlab 32 bit
After extracting the archive
./configure CFLAGS="-mmacosx-version-min=10.5 -arch i386" LDFLAGS="-mmacosx-version-min=10.5 -arch i386" ABI=32 --enable-cxx --enable-static --with-pic
@@ -13,9 +10,9 @@ make
cp .libs/*.a ../../external/lib/macx/
---- using mpir instead GMP ---
-Exactly the same steps as aboveÉ
-For mac osx 10.6 with meshlab 32 bitÉ
+--- using mpir instead GMP ---
+Exactly the same steps as above�
+For mac osx 10.6 with meshlab 32 bit�
After extracting the archive
./configure CFLAGS="-mmacosx-version-min=10.5 -arch i386" LDFLAGS="-mmacosx-version-min=10.5 -arch i386" ABI=32 --enable-cxx --enable-static --with-pic
diff --git a/install/README.md b/install/README.md
deleted file mode 100644
index 73831ec08..000000000
--- a/install/README.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# install folder
-
-**Work in Progress**
-
-This folder contains a series of platform-dependent scripts to build and deploy meshlab.
-
-Every platform folder contains:
-
-* `$platform$-build.[sh/ps1]`: a script that builds MeshLab. Requires a Qt environment properly set, with `qmake` accessible. Binaries will be placed inside `$1/distrib`, where `$1` is the argument that represents the build directory, or in the [distrib](https://github.com/cnr-isti-vclab/meshlab/tree/master/distrib) folder if arguments were not provided.
-* `$platform$-deploy.[sh/ps1]`: a script that deploys MeshLab, making sure that the folder will be a self-contained MeshLab, without Qt library dependencies. Requires a properly built MeshLab in the directory passed as an argument, or in the [distrib](https://github.com/cnr-isti-vclab/meshlab/tree/master/distrib) folder if arguments were not provided.
-* `$platform$-$installer$.[sh/ps1]`: a script that computes a self-contained package/installer of MeshLab. Requires a properly deployed MeshLab in the directory passed as an argument, or in the [distrib](https://github.com/cnr-isti-vclab/meshlab/tree/master/distrib) folder if arguments were not provided. The result will be saved in the same directory.
-* `$platform$-make_it.[sh/ps1]`: a script that computes all the three previous scripts: starting from the source code, it will produce a self-contained package/installer of MeshLab.
-* various other files used by the scripts listed above.
-
-See in each platform subfolder for details and other platform-dependent requirements:
-
-- [Linux](https://github.com/cnr-isti-vclab/meshlab/tree/master/install/linux)
-- [MaxOS](https://github.com/cnr-isti-vclab/meshlab/tree/master/install/macos)
-- [Windows](https://github.com/cnr-isti-vclab/meshlab/tree/master/install/windows)
\ No newline at end of file
diff --git a/install/Release Notes.txt b/install/Release Notes.txt
deleted file mode 100644
index 410573507..000000000
--- a/install/Release Notes.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-MeshLab Release Note
-
-** Every Time you commit something significant add a few lines here.
-** Be Descriptive please.
-
-
-2014 04 08 Corrected Selection Bug.
-Old and low-end graphics cards (like the integrated intel ones) do not support OpenGL selection modes. Re-implemented all the selection using a internal pipeline that is actually faster.
-
-2014 04 18 New MeshLabServer version has been committed
-MeshLabServer is now able to properly manage the MeshLab Project files. MeshLabServer has been completely rewritten in order (hopefully) to enhance the robustness and usability of the tool
-
-2014 04 25 Improved on screen Help.
-Now it reports the trick for quick visibility toggling in the Layer window.
-
-2014 04 28 Corrected Missing Preview Bug
-The preview check box disappeared from many filters that were changing just the geometry of the mesh (like all the smoothing filters) without any serious reason.
-
-2014 05 13 Added support for xml filters in the old fashioned scripting system=======
-The preview check box disappeared from many filters that were changing just the geometry of the mesh (like all the smoothing filters) without any serious reason.
-
-2014 04 30 Improved selection-by-quality filters
-Now they consistently works also for point clouds.
-
-2014 04 30 Improved Computation of normals for point clouds
-In the case of working with point clouds generated with the well known Bundler, we added the options to reorient the vertex normals to comply with the cameras in Bundler datasets that have a camera attribute
-
-2014 05 06 Obj File Export.
-Added support of polygonal meshes in OBJ output. Now meshes with faux edges set are correctly exported as polygonal meshes (and not tris)
-
-2014 05 07 OFF File Import
-Corrected bug in the faux edge setting when loading polygonal meshes.
-
-2014 05 07 Faux Edge Decorator
-Added control of width of the drawn line.
-
-2014 05 13 MeshLab core
-Added support for xml filters in the old fashioned scripting system
-
-2014 05 15 Create Sphere Cap
-Added another basic shape (tessellated spherical cap).
-
-2014 05 15 Invert Face Filter
-Corrected bug in filter inverting faces that messed the faux bit flag.
-
-2014 05 23 Sampling Filter
-Improved Montecarlo, added weighted montecarlo
-Improved Poisson weighting scheme (now it is coherent with the montecarlo one)
-Combined the variable disk and standard poisson disk sampling
-Added option for obtaining an exact number of samples (very useful when you want to get a very low number of samples)
-
-2014 05 23 Added Point Cloud Simplification Filter
-Easy to use filter for uniformly simplifying point clouds.
-
-2014 05 23 Improved normal computation for polygonal face.
-
-2014 05 23 Quality for face
-Added two new measures for measuring the planarity of polygonal faces.
-
-2014 05 23 Compute Measures
-Improved quality of the results formatting and report more useful info (edge Length sum)
-Improved support of polygonal meshes
-
-2014 06 17 Decorators and Interface
-Added possibility of choosing the color of the text, useful when showing info, histograms and such on white backgrounds.
-Exposed color of NonFaux Edges
-
-2014 06 17 Colorize by face color
-Corrected small bug in the percentile filtering
-
-2014 06 17 Filter Change: Create->Random Sphere now is Create->Point on a Sphere
-It allows the creation of points randomly generated using a Poisson Disk distribution or using the Dave Rusin's disco ball algorithm for the regular placement of points on a sphere.
-
-2014 06 17 New Filter: Build a Polyline with NonFaux Edges
-Create a new Layer with an edge mesh composed only by the non faux edges of the current mesh
-
-2014 06 17 Removed Filter: Voronoi Clustering. substituted by the voronoi sampling filter.
-
-2014 08 26 Boundary Decorator
-Now works also with edgemesh showing endpoints.
-
-2014 10 20 Screened Poisson Surface Reconstruction
-The latest version of the very powerful surface reconstruction algorithm.
-
-2014 11 13 Histogram computation
-Added area weighting counting to for vertex/face quality Histogram dumping filters
-
diff --git a/install/linux/README.md b/install/linux/README.md
deleted file mode 100644
index 68256934d..000000000
--- a/install/linux/README.md
+++ /dev/null
@@ -1,41 +0,0 @@
-# Linux Scripts
-
-This folder contains a series of scripts to build and deploy MeshLab under a Linux environment.
-
-The following scripts are provided:
-
-* `linux_setup_env_ubuntu.sh`: this script installs all the required dependencies that are necessary to build MeshLab in an Ubuntu distro (tested in 16.04, 18.04). If you never installed Qt and other libraries, you should run it before any other script;
-* `linux_build.sh`: this script compiles MeshLab in a Linux environment:
- * it requires a properly set Qt environment (see `linux_setup_env_ubuntu.sh`);
- * without given arguments, all the binaries will be placed in the `meshlab/distrib` folder. You can give as argument the `BUILD_PATH`, and meshlab binaries will be then placed inside `BUILD_PATH/distrib`;
-* `linux_build_meshlab_mini.sh`: this script compiles MeshLab mini in a Linux environment. Works in the same way as the `linux_build.sh` script;
-* `linux_deploy.sh`: makes the `distrib` folder a portable version of MeshLab (no Qt and other libraries dependencies):
- * it requires a properly built meshlab `distrib` directory (see `linux_build.sh`);
- * without given arguments, the folder that will be deployed is `meshlab/distrib`. You can give as argument the `DISTRIB_PATH`;
-* `linux_appimages.sh`: this script makes the `distrib` folder a portable version of MeshLab (no Qt and other libraries dependencies), and generates an [AppImage](https://appimage.org/) that can be run in a Linux Environment without dependencies;
- * it requires a properly built meshlab `distrib` directory (see `linux_build.sh`);
- * without given arguments, the folder that will be deployed is `meshlab/distrib`. You can give as argument the `DISTRIB_PATH`.
-* `linux_meshlabserver_appimage.sh`: this script generates an [AppImage](https://appimage.org/) of [MeshLabServer](https://github.com/cnr-isti-vclab/meshlab/blob/master/src/meshlabserver/README.md) that can be run in a Linux Environment without dependencies;
- * it requires a properly built meshlab `distrib` directory (see `linux_build.sh`);
- * without given arguments, the folder that will be deployed is `meshlab/distrib`. You can give as argument the `DISTRIB_PATH`.
-* `linux_make_it.sh`: this script builds, deploys and generates an [AppImage](https://appimage.org/) that can be run in a Linux Environment without dependencies;
- * it requires a properly set Qt environment (see `linux_setup_env_ubuntu.sh`);
- * without given arguments, all the binaries will be placed in the `meshlab/distrib` folder. You can give as argument the `BUILD_PATH`, and meshlab binaries and the AppImage will be then placed inside `BUILD_PATH/distrib`;
-
-__NOTE__: `linux_deploy.sh`, `linux_appimage.sh` and `linux_make_it.sh` use [LinuxDeployQt](https://github.com/probonopd/linuxdeployqt), which allows to deploy applications only running the oldest supported linux distro (see [this](https://github.com/probonopd/linuxdeployqt/issues/340)) in order to guarantee the largest support possible. Therefore, before running these scripts, be sure that your Linux distribution is the oldest supported one.
-
-## Examples
-
-Building meshlab on a clean Linux environment (compiled MeshLab in `meshlab/distrib`):
-
- git clone --recursive https://github.com/cnr-isti-vclab/meshlab
- bash meshlab/install/linux/linux_setup_env_ubuntu.sh
- bash meshlab/install/linux/linux_build.sh
-
-Building and generating AppImage on a clean Ubuntu 16.04 (last supported distro) environment, build directory in `~/build_meshlab`:
-
- git clone --recursive https://github.com/cnr-isti-vclab/meshlab
- bash meshlab/install/linux/linux_setup_env_ubuntu.sh
- bash meshlab/install/linux/linux_make_it.sh ~/build_meshlab
-
-Meshlab*.AppImage can be found in `~/build_meshlab/distrib/`.
diff --git a/install/linux/linux_setup_env_ubuntu.sh b/install/linux/linux_setup_env_ubuntu.sh
deleted file mode 100644
index 546398b88..000000000
--- a/install/linux/linux_setup_env_ubuntu.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-# this is a script shell sets up an ubuntu (16.04, 18.04) environment where
-# MeshLab can be compiled.
-#
-# Run this script if you never installed any of the MeshLab dependencies.
-
-sudo apt-get update
-sudo apt-get install -y qt5-default qttools5-dev-tools qtdeclarative5-dev libqt5xmlpatterns5-dev mesa-common-dev libglu1-mesa-dev lib3ds-dev libglew-dev libeigen3-dev libopenctm-dev libgmp-dev libqhull-dev patchelf #libmuparser-dev
diff --git a/install/macos/README.md b/install/macos/README.md
deleted file mode 100644
index 70b6fb776..000000000
--- a/install/macos/README.md
+++ /dev/null
@@ -1,36 +0,0 @@
-# MacOS Scripts
-
-This folder contains a series of scripts to build and deploy MeshLab under a MacOS environment.
-
-The following scripts are provided:
-
-* `macos_setup_env.sh`: this script installs all the required dependencies that are necessary to build MeshLab and create its DMG in a MacOS machine (tested in 10.15 Catalina). It requires [homebrew](https://brew.sh/) installed.
-* `macos_build.sh`: this script compiles MeshLab in a MacOS environment:
- * it requires a properly set Qt environment (see `macos_setup_env.sh`);
- * without given arguments, all the binaries will be placed in the `meshlab/distrib` folder. You can give as argument the `BUILD_PATH`, and meshlab binaries will be then placed inside `BUILD_PATH/distrib`;
-* `macos_build_meshlab_mini.sh`: this script compiles MeshLab mini in a MacOS environment. Works in the same way as the `macos_build.sh` script;
-* `macos_deploy.sh`: makes the `distrib/meshlab.app` app a portable version of MeshLab (no Qt and other libraries dependencies):
- * it requires a properly built meshlab `distrib` directory (see `macos_build.sh`);
- * without given arguments, the meshlab.app that will be deployed should be inside `meshlab/distrib`. You can give as argument the `DISTRIB_PATH`;
-* `macos_dmg.sh`: this script generates a [DMG](https://en.wikipedia.org/wiki/Apple_Disk_Image) that can be used to install MeshLab;
- * it requires a properly deployed meshlab `meshlab.app` directory (see `macos_deploy.sh`), a properly set Qt environment, and `appdmg` installed (see `macos_setup_env.sh`);
- * without given arguments, the meshlab.app that will be used should be inside `meshlab/distrib`. You can give as argument the `DISTRIB_PATH`.
-* `macos_make_it.sh`: this script builds, deploys and generates a [DMG](https://en.wikipedia.org/wiki/Apple_Disk_Image) that can be used to install MeshLab;
- * it requires a properly set Qt environment and `appdmg` installed (see `macos_setup_env.sh`);
- * without given arguments, all the binaries will be placed in the `meshlab/distrib` folder. You can give as argument the `BUILD_PATH`, and meshlab binaries and the DMG will be then placed inside `BUILD_PATH/distrib`;
-
-## Examples
-
-Building meshlab on a clean MacOS environment (compiled MeshLab in `meshlab/distrib`):
-
- git clone --recursive https://github.com/cnr-isti-vclab/meshlab
- sh meshlab/install/macos/macos_setup_env.sh
- sh meshlab/install/macos/macos_build.sh
-
-Building and generating DMG on a clean MacOS environment, build directory in `~/build_meshlab`:
-
- git clone --recursive https://github.com/cnr-isti-vclab/meshlab
- sh meshlab/install/macos/macos_setup_env.sh
- sh meshlab/install/macos/macos_make_it.sh ~/build_meshlab
-
-Meshlab*.dmg can be found in `~/build_meshlab/distrib/`.
\ No newline at end of file
diff --git a/install/windows/README.md b/install/windows/README.md
deleted file mode 100644
index bd24e7417..000000000
--- a/install/windows/README.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# Windows Scripts
-
-**WORK IN PROGRESS**
-
-This folder contains a series of scripts to build and deploy MeshLab under a Windows environment.
-
-The following scripts are provided:
-
-* `windows_build.ps1`: this script compiles MeshLab in a Windows environment:
- * it requires a properly set Visual Studio (>=2015) and MSVC compiler;
- * it requires a properly set Qt (>= 5.9) environment;
- * without given arguments, all the binaries will be placed in the `meshlab/distrib` folder. You can give as argument the `BUILD_PATH`, and meshlab binaries will be then placed inside `BUILD_PATH/distrib`;
-* `windows_build_meshlab_mini.ps1`: this script compiles MeshLab mini in a Windows environment. Works in the same way as the `windows_build.ps1` script;
-* `windows_deploy.ps1`: makes the `distrib` folder a portable version of MeshLab (no Qt and other libraries dependencies):
- * it requires a properly built meshlab `distrib` directory (see `windows_build.ps1`);
- * `windeployqt.exe` directly accessible by powershell and `VCINSTALLDIR` set to the VC Visual Studio;
- * without given arguments, the folder that will be deployed is `meshlab/distrib`. You can give as argument the `DISTRIB_PATH`;
-* `windows_nsis_installer.ps1`: this script generates an installer for MeshLab:
- * it requires a properly built and deployed meshlab `distrib` directory (see `windows_deploy.ps1`);
- * `makensis.exe` directly accessible by powershell;
- * without given arguments, the folder used for creating the installer is `meshlab/distrib`. You can give as argument the `DISTRIB_PATH`;
\ No newline at end of file
diff --git a/scripts/Linux/0_setup_env_ubuntu.sh b/scripts/Linux/0_setup_env_ubuntu.sh
new file mode 100644
index 000000000..02489fb93
--- /dev/null
+++ b/scripts/Linux/0_setup_env_ubuntu.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# this is a script shell sets up an ubuntu (16.04, 18.04, 20.04) environment where
+# MeshLab can be compiled.
+#
+# Run this script if you never installed any of the MeshLab dependencies.
+
+sudo apt-get update
+sudo apt-get install -y qt5-default qttools5-dev-tools qtdeclarative5-dev libqt5xmlpatterns5-dev
+sudo apt-get install -y mesa-common-dev libglu1-mesa-dev libglew-dev lib3ds-dev libeigen3-dev
+sudo apt-get install -y libopenctm-dev libgmp-dev libqhull-dev patchelf cmake
diff --git a/scripts/Linux/1_build.sh b/scripts/Linux/1_build.sh
new file mode 100644
index 000000000..c41f55d85
--- /dev/null
+++ b/scripts/Linux/1_build.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+# this is a script shell for compiling meshlab in a Linux environment.
+# Requires a Qt environment which is set-up properly, and an accessible
+# cmake binary.
+#
+# Without given arguments, MeshLab will be built in the meshlab/src/build
+# directory, and installed in $BUILD_PATH/../install.
+#
+# You can give as argument the BUILD_PATH and the INSTALL_PATH in the
+# following way:
+# sh linux_build.sh --build_path=/path/to/build --install_path=/path/to/install
+# -b and -i arguments are also supported.
+
+#default paths wrt the script folder
+SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
+SOURCE_PATH=$SCRIPTS_PATH/../../src
+BUILD_PATH=$SOURCE_PATH/build
+INSTALL_PATH=$SOURCE_PATH/install/usr/
+CORES="-j4"
+
+#check parameters
+for i in "$@"
+do
+case $i in
+ -b=*|--build_path=*)
+ BUILD_PATH="${i#*=}"
+ shift # past argument=value
+ ;;
+ -i=*|--install_path=*)
+ INSTALL_PATH="${i#*=}"/usr/
+ shift # past argument=value
+ ;;
+ -j*)
+ CORES=$i
+ shift # past argument=value
+ ;;
+ *)
+ # unknown option
+ ;;
+esac
+done
+
+#create build path if necessary
+if ! [ -d $BUILD_PATH ]
+then
+ mkdir -p $BUILD_PATH
+fi
+
+#create install path if necessary
+if ! [ -d $INSTALL_PATH ]
+then
+ mkdir -p $INSTALL_PATH
+fi
+
+BUILD_PATH=$(realpath $BUILD_PATH)
+INSTALL_PATH=$(realpath $INSTALL_PATH)
+
+cd $BUILD_PATH
+cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH $SOURCE_PATH
+make $CORES
+make install
diff --git a/scripts/Linux/2_deploy.sh b/scripts/Linux/2_deploy.sh
new file mode 100644
index 000000000..685307e7f
--- /dev/null
+++ b/scripts/Linux/2_deploy.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+# This is a script shell for deploying a meshlab-portable folder.
+# Requires a properly built MeshLab (see 1_build.sh).
+#
+# This script can be run only in the oldest supported linux distro
+# due to linuxdeployqt tool choice (see https://github.com/probonopd/linuxdeployqt/issues/340).
+#
+# Without given arguments, the folder that will be deployed is meshlab/src/install, which
+# should be the path where MeshLab has been installed (default output of 1_build.sh).
+#
+# You can give as argument the path where you installed MeshLab.
+
+SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
+
+#checking for parameters
+if [ "$#" -eq 0 ]
+then
+ BUNDLE_PATH=$SCRIPTS_PATH/../../src/install
+else
+ BUNDLE_PATH=$(realpath $1)
+fi
+
+bash $SCRIPTS_PATH/resources/make_bundle.sh $BUNDLE_PATH
+
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$BUNDLE_PATH/usr/lib/meshlab
+$SCRIPTS_PATH/resources/linuxdeployqt $BUNDLE_PATH/usr/share/applications/meshlab.desktop -bundle-non-qt-libs
+
+chmod +x $BUNDLE_PATH/usr/bin/meshlab
+rm $BUNDLE_PATH/AppRun
+
+cp $SCRIPTS_PATH/resources/AppRunMeshLab $BUNDLE_PATH/
+mv $BUNDLE_PATH/AppRunMeshLab $BUNDLE_PATH/AppRun
+chmod +x $BUNDLE_PATH/AppRun
+
+#at this point, distrib folder contains all the files necessary to execute meshlab
+echo "$BUNDLE_PATH is now a self contained meshlab application"
diff --git a/scripts/Linux/3_appimage.sh b/scripts/Linux/3_appimage.sh
new file mode 100644
index 000000000..7c9820543
--- /dev/null
+++ b/scripts/Linux/3_appimage.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+# This is a script shell for setting up the AppImage bundle for linux
+# Requires a properly built meshlab, boundled and deployed (see linux_deploy.sh)
+# inside the directory given as argument
+#
+# Without given arguments, MeshLab AppImage will be placed in the src
+# directory.
+#
+# You can give as argument the path of the bundle (default is src/install),
+# and the AppImage will be placed in the parent directory (src)
+
+SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
+
+#checking for parameters
+if [ "$#" -eq 0 ]
+then
+ BUNDLE_PATH=$SCRIPTS_PATH/../../src/install
+else
+ BUNDLE_PATH=$(realpath $1)
+fi
+
+PARENT_NAME="$(dirname $BUNDLE_PATH)"
+
+export VERSION=$(cat $SCRIPTS_PATH/../../ML_VERSION)
+
+$SCRIPTS_PATH/resources/appimagetool $BUNDLE_PATH
+mv MeshLab-$VERSION*.AppImage $PARENT_NAME/MeshLab$VERSION-linux.AppImage
+
+#at this point, distrib folder contains all the files necessary to execute meshlab
+echo MeshLab$VERSION-linux.AppImage generated
diff --git a/scripts/Linux/README.md b/scripts/Linux/README.md
new file mode 100644
index 000000000..62a8f3fc0
--- /dev/null
+++ b/scripts/Linux/README.md
@@ -0,0 +1,34 @@
+# Linux Scripts
+
+This folder contains a series of scripts to build and deploy MeshLab under a Linux environment (tested on Ubuntu 16.04, 18.04 and 20.04).
+
+* `0_setup_env_ubuntu.sh`: this script installs all the required dependencies that are necessary to build MeshLab in an Ubuntu distro (tested in 16.04, 18.04 and 20.04). If you never installed Qt and other libraries, you should run it before any other script;
+* `1_build.sh`: this script builds MeshLab in a Linux environment:
+ * it requires a properly set Qt environment (see `0_setup_env_ubuntu.sh`);
+ * takes as arguments:
+ * the build directory (default: `src/build`): `--build_path=path/to/build`
+ * the install directory (default: `src/install`): `--install_path=path/to/install`
+ * the number of cores used to build MeshLab (default: `-j4`)`
+* `2_deploy.sh`: this script makes the given path a portable version of MeshLab. Takes as argument the path where the output install path of the `1_build.sh` script is placed (default: `src/install`);
+* `3_appimage.sh`: this script computes, starting from the portable folder of MeshLab, an [AppImage](https://appimage.org/) that can be run in a Linux Environment without dependencies. Takes as argument the path where the output install path of the `2_deploy.sh` script is placed (default: `src/install`);
+* `make_it.sh`: this script builds, deploys and generates an [AppImage](https://appimage.org/) that can be run in a Linux Environment without dependencies. Arguments are the same of the `1_build.sh` script.
+
+__NOTE__: `linux_deploy.sh`and `linux_make_it.sh` use [LinuxDeployQt](https://github.com/probonopd/linuxdeployqt), which allows to deploy applications **only running the oldest supported linux distro** (see [this](https://github.com/probonopd/linuxdeployqt/issues/340)) in order to guarantee the largest support possible. Therefore, before running these scripts, be sure that your Linux distribution is the oldest supported one.
+
+## Examples
+
+Building MeshLab on a clean Linux environment (build placed in `meshlab/src/build`):
+
+ git clone --recursive https://github.com/cnr-isti-vclab/meshlab
+ bash meshlab/scripts/Linux/0_setup_env_ubuntu.sh
+ bash meshlab/scripts/Linux/1_build.sh
+
+Building and generating AppImage on a clean Ubuntu 16.04 (last supported distro) environment:
+* build directory: `./meshlab-build`
+* install directory: `./meshlab-install`
+* AppImage path: `./`
+
+
+ git clone --recursive https://github.com/cnr-isti-vclab/meshlab
+ bash meshlab/scripts/Linux/0_setup_env_ubuntu.sh
+ bash meshlab/scripts/Linux/make_it.sh --build_path="./meshlab-build" --install_path="./meshlab-install"
diff --git a/scripts/Linux/make_it.sh b/scripts/Linux/make_it.sh
new file mode 100644
index 000000000..c1af8df49
--- /dev/null
+++ b/scripts/Linux/make_it.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+# This is a script shell for compiling and deploying MeshLab in a Linux environment.
+#
+# This script can be run only in the oldest supported linux distro
+# due to linuxdeployqt tool choice (see https://github.com/probonopd/linuxdeployqt/issues/340).
+#
+# Requires a Qt environment which is set-up properly, and an accessible
+# cmake binary.
+#
+# Without given arguments, MeshLab will be built in the meshlab/src/build,
+# the folder meshlab/src/install will be a portable version of MeshLab and
+# the AppImage will be placed in meshlab/src.
+#
+# You can give as argument the build path, the install path (that will contain
+# the portable version of MeshLab), and the number of cores to use to build MeshLab
+# (default: 4).
+# The AppImage will be placed in the parent directory of the install path.
+#
+# Example of call:
+# bash make_it.sh --build_path=path/to/build --install_path=path/to/install -j8
+
+SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
+SOURCE_PATH=$SCRIPTS_PATH/../../src
+BUILD_PATH=$SOURCE_PATH/build
+INSTALL_PATH=$SOURCE_PATH/install
+CORES="-j4"
+
+#check parameters
+for i in "$@"
+do
+case $i in
+ -b=*|--build_path=*)
+ BUILD_PATH="${i#*=}"
+ shift # past argument=value
+ ;;
+ -i=*|--install_path=*)
+ INSTALL_PATH="${i#*=}"/usr/
+ shift # past argument=value
+ ;;
+ -j*)
+ CORES=$i
+ shift # past argument=value
+ ;;
+ *)
+ # unknown option
+ ;;
+esac
+done
+
+sh $SCRIPTS_PATH/1_build.sh -b=$BUILD_PATH -i=$INSTALL_PATH $CORES
+sh $SCRIPTS_PATH/2_deploy.sh $INSTALL_PATH
+sh $SCRIPTS_PATH/3_appimages.sh $INSTALL_PATH
diff --git a/install/linux/linux_appimages.sh b/scripts/Linux/qmake/linux_appimages.sh
similarity index 96%
rename from install/linux/linux_appimages.sh
rename to scripts/Linux/qmake/linux_appimages.sh
index 67c96b3e4..795f52c62 100644
--- a/install/linux/linux_appimages.sh
+++ b/scripts/Linux/qmake/linux_appimages.sh
@@ -11,13 +11,13 @@
#checking for parameters
if [ "$#" -eq 0 ]
then
- DISTRIB_PATH="../../distrib"
+ DISTRIB_PATH="../../../distrib"
else
DISTRIB_PATH=$(realpath $1)
fi
cd "$(dirname "$(realpath "$0")")"; #move to script directory
-INSTALL_PATH=$(pwd)
+INSTALL_PATH=$(pwd)/../
cd $DISTRIB_PATH
PARENT_NAME="$(basename $DISTRIB_PATH)"
diff --git a/install/linux/linux_build.sh b/scripts/Linux/qmake/linux_build.sh
similarity index 92%
rename from install/linux/linux_build.sh
rename to scripts/Linux/qmake/linux_build.sh
index 802aec96b..a4196bb45 100644
--- a/install/linux/linux_build.sh
+++ b/scripts/Linux/qmake/linux_build.sh
@@ -12,7 +12,7 @@
#checking for parameters
if [ "$#" -eq 0 ]
then
- BUILD_PATH="../../src"
+ BUILD_PATH="../../../src"
else
BUILD_PATH=$(realpath $1)
fi
@@ -25,7 +25,7 @@ then
fi
echo "Build path is: " $BUILD_PATH
-SOURCE_PATH=$PWD/../../src
+SOURCE_PATH=$PWD/../../../src
cd $BUILD_PATH
qmake $SOURCE_PATH/meshlab.pro
diff --git a/install/linux/linux_build_debug.sh b/scripts/Linux/qmake/linux_build_debug.sh
similarity index 92%
rename from install/linux/linux_build_debug.sh
rename to scripts/Linux/qmake/linux_build_debug.sh
index 3f6b76acf..678ef6155 100644
--- a/install/linux/linux_build_debug.sh
+++ b/scripts/Linux/qmake/linux_build_debug.sh
@@ -12,7 +12,7 @@
#checking for parameters
if [ "$#" -eq 0 ]
then
- BUILD_PATH="../../src"
+ BUILD_PATH="../../../src"
else
BUILD_PATH=$(realpath $1)
fi
@@ -25,7 +25,7 @@ then
fi
echo "Build path is: " $BUILD_PATH
-SOURCE_PATH=$PWD/../../src
+SOURCE_PATH=$PWD/../../../src
cd $BUILD_PATH
qmake $SOURCE_PATH/meshlab.pro CONFIG+=debug
diff --git a/install/linux/linux_build_meshlab_mini.sh b/scripts/Linux/qmake/linux_build_meshlab_mini.sh
similarity index 92%
rename from install/linux/linux_build_meshlab_mini.sh
rename to scripts/Linux/qmake/linux_build_meshlab_mini.sh
index 923e90dfa..83afbc2ca 100644
--- a/install/linux/linux_build_meshlab_mini.sh
+++ b/scripts/Linux/qmake/linux_build_meshlab_mini.sh
@@ -12,7 +12,7 @@
#checking for parameters
if [ "$#" -eq 0 ]
then
- BUILD_PATH="../../src"
+ BUILD_PATH="../../../src"
else
BUILD_PATH=$(realpath $1)
fi
@@ -25,7 +25,7 @@ then
fi
echo "Build path is: " $BUILD_PATH
-SOURCE_PATH=$PWD/../../src
+SOURCE_PATH=$PWD/../../../src
cd $BUILD_PATH
qmake $SOURCE_PATH/meshlab.pro "CONFIG+=meshlab_mini"
diff --git a/install/linux/linux_deploy.sh b/scripts/Linux/qmake/linux_deploy.sh
similarity index 95%
rename from install/linux/linux_deploy.sh
rename to scripts/Linux/qmake/linux_deploy.sh
index 0944429ea..80c416de2 100644
--- a/install/linux/linux_deploy.sh
+++ b/scripts/Linux/qmake/linux_deploy.sh
@@ -12,13 +12,13 @@
#checking for parameters
if [ "$#" -eq 0 ]
then
- DISTRIB_PATH="../../distrib"
+ DISTRIB_PATH="../../../distrib"
else
DISTRIB_PATH=$(realpath $1)
fi
cd "$(dirname "$(realpath "$0")")"; #move to script directory
-INSTALL_PATH=$(pwd)
+INSTALL_PATH=$(pwd)/../
cd $DISTRIB_PATH
diff --git a/install/linux/linux_make_bundle.sh b/scripts/Linux/qmake/linux_make_bundle.sh
similarity index 94%
rename from install/linux/linux_make_bundle.sh
rename to scripts/Linux/qmake/linux_make_bundle.sh
index 2db2c8fc5..73f30fd8a 100644
--- a/install/linux/linux_make_bundle.sh
+++ b/scripts/Linux/qmake/linux_make_bundle.sh
@@ -10,16 +10,16 @@
#checking for parameters
if [ "$#" -eq 0 ]
then
- DISTRIB_PATH="../../distrib"
+ DISTRIB_PATH="../../../distrib"
else
DISTRIB_PATH=$(realpath $1)
fi
cd "$(dirname "$(realpath "$0")")"; #move to script directory
-SOURCE_PATH=$PWD/../../src
+SOURCE_PATH=$PWD/../../../src
-INSTALL_PATH=$(pwd)
+INSTALL_PATH=$(pwd)/../
cd $DISTRIB_PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)
diff --git a/install/linux/linux_make_it.sh b/scripts/Linux/qmake/linux_make_it.sh
similarity index 93%
rename from install/linux/linux_make_it.sh
rename to scripts/Linux/qmake/linux_make_it.sh
index 39f6df8de..5be497153 100644
--- a/install/linux/linux_make_it.sh
+++ b/scripts/Linux/qmake/linux_make_it.sh
@@ -16,8 +16,8 @@
#checking for parameters
if [ "$#" -eq 0 ]
then
- BUILD_PATH="../../src"
- DISTRIB_PATH="../../distrib"
+ BUILD_PATH="../../../src"
+ DISTRIB_PATH="../../../distrib"
else
BUILD_PATH=$(realpath $1)
BUILD_PATH=$BUILD_PATH/distrib
diff --git a/install/linux/resources/AppRunMeshLab b/scripts/Linux/resources/AppRunMeshLab
similarity index 100%
rename from install/linux/resources/AppRunMeshLab
rename to scripts/Linux/resources/AppRunMeshLab
diff --git a/install/linux/resources/AppRunMeshLabServer b/scripts/Linux/resources/AppRunMeshLabServer
similarity index 100%
rename from install/linux/resources/AppRunMeshLabServer
rename to scripts/Linux/resources/AppRunMeshLabServer
diff --git a/install/linux/resources/appimagetool b/scripts/Linux/resources/appimagetool
similarity index 100%
rename from install/linux/resources/appimagetool
rename to scripts/Linux/resources/appimagetool
diff --git a/install/linux/resources/linuxdeployqt b/scripts/Linux/resources/linuxdeployqt
similarity index 100%
rename from install/linux/resources/linuxdeployqt
rename to scripts/Linux/resources/linuxdeployqt
diff --git a/scripts/Linux/resources/make_bundle.sh b/scripts/Linux/resources/make_bundle.sh
new file mode 100644
index 000000000..7dafa6980
--- /dev/null
+++ b/scripts/Linux/resources/make_bundle.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# this is a script shell for setting up the application bundle for linux
+# Requires a properly built meshlab.
+#
+# Without given arguments, the application boundle will be placed in the meshlab/src/install
+# directory.
+#
+# You can give as argument the path were meshlab has been installed.
+
+SCRIPTS_PATH="$(dirname "$(realpath "$0")")"/../
+SOURCE_PATH=$SCRIPTS_PATH/../../src
+DISTRIB_PATH=$SCRIPTS_PATH/../../distrib
+
+
+#checking for parameters
+if [ "$#" -eq 0 ]
+then
+ INSTALL_PATH=$SOURCE_PATH/install
+else
+ INSTALL_PATH=$(realpath $1)
+fi
+
+LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INSTALL_PATH
+
+#check if we have an exec in distrib
+if ! [ -f $INSTALL_PATH/usr/bin/meshlab ]
+then
+ echo "ERROR: meshlab bin not found inside $INSTALL_PATH/usr/bin/"
+ exit 1
+fi
+
+mkdir -p $INSTALL_PATH/usr/share/doc/meshlab
+mkdir -p $INSTALL_PATH/usr/share/icons/hicolor/512x512/apps/
+mkdir -p $INSTALL_PATH/usr/share/icons/Yaru/512x512/apps/
+
+cp $SCRIPTS_PATH/resources/meshlab_appimage.desktop $INSTALL_PATH/usr/share/applications/meshlab.desktop
+cp $DISTRIB_PATH/meshlab.png $INSTALL_PATH/usr/share/icons/hicolor/512x512/apps/meshlab.png
+cp $DISTRIB_PATH/meshlab.png $INSTALL_PATH/usr/share/icons/Yaru/512x512/apps/meshlab.png
+cp $DISTRIB_PATH/LICENSE.txt $INSTALL_PATH/usr/share/doc/meshlab/
+cp $DISTRIB_PATH/privacy.txt $INSTALL_PATH/usr/share/doc/meshlab/
+cp $DISTRIB_PATH/readme.txt $INSTALL_PATH/usr/share/doc/meshlab/
+
+for filename in $INSTALL_PATH/usr/lib/meshlab/plugins/*.so; do
+ patchelf --set-rpath '$ORIGIN/../' $filename
+done
diff --git a/install/linux/resources/meshlab.desktop b/scripts/Linux/resources/meshlab.desktop
similarity index 100%
rename from install/linux/resources/meshlab.desktop
rename to scripts/Linux/resources/meshlab.desktop
diff --git a/install/linux/resources/meshlab_appimage.desktop b/scripts/Linux/resources/meshlab_appimage.desktop
similarity index 100%
rename from install/linux/resources/meshlab_appimage.desktop
rename to scripts/Linux/resources/meshlab_appimage.desktop
diff --git a/install/linux/resources/meshlab_server_appimage.desktop b/scripts/Linux/resources/meshlab_server_appimage.desktop
similarity index 100%
rename from install/linux/resources/meshlab_server_appimage.desktop
rename to scripts/Linux/resources/meshlab_server_appimage.desktop
diff --git a/install/linux/resources/snap/README.md b/scripts/Linux/resources/snap/README.md
similarity index 100%
rename from install/linux/resources/snap/README.md
rename to scripts/Linux/resources/snap/README.md
diff --git a/install/linux/resources/snap/meshlab.desktop b/scripts/Linux/resources/snap/meshlab.desktop
similarity index 100%
rename from install/linux/resources/snap/meshlab.desktop
rename to scripts/Linux/resources/snap/meshlab.desktop
diff --git a/install/linux/resources/snap/snap_noversion.yaml b/scripts/Linux/resources/snap/snap_noversion.yaml
similarity index 74%
rename from install/linux/resources/snap/snap_noversion.yaml
rename to scripts/Linux/resources/snap/snap_noversion.yaml
index 016efdffa..e7950b226 100644
--- a/install/linux/resources/snap/snap_noversion.yaml
+++ b/scripts/Linux/resources/snap/snap_noversion.yaml
@@ -1,4 +1,4 @@
-# Known to build in Ubuntu 18.04
+# Known to build in Ubuntu 18.04, 20.04
name: meshlab
base: core18
version: 'MESHLAB_VERSION'
@@ -19,9 +19,6 @@ apps:
command: desktop-launch $SNAP/AppRun
plugs: [home, x11, mir, opengl, removable-media]
desktop: usr/share/applications/meshlab.desktop
- meshlabserver:
- command: desktop-launch meshlabserver
- plugs: [home, x11, opengl, removable-media]
parts:
@@ -44,6 +41,7 @@ parts:
- gnome-themes-standard
- shared-mime-info
- libqt5gui5
+ - libqt5qml5
- libgdk-pixbuf2.0-0
- libqt5svg5
- try:
@@ -65,9 +63,9 @@ parts:
- libglu1-mesa-dev
- lib3ds-dev
- libglew-dev
- - libeigen3-dev
- - libopenctm-dev
- - libgmp-dev
+ - libeigen3-dev
+ - libopenctm-dev
+ - libgmp-dev
- libqhull-dev
- chrpath
stage-packages:
@@ -77,19 +75,17 @@ parts:
- libqhull7
- libglew-dev
- libqt5opengl5-dev
+ - qtdeclarative5-dev
- libqt5xmlpatterns5-dev
- libqt5gui5
- override-build: |
- qmake src/meshlab.pro "CONFIG+= system_eigen3 system_glew system_bzip2 system_openctm system_lib3ds"
- make -j4
-
- sh install/linux/linux_make_boundle.sh distrib/
-
- rsync -av distrib/* $SNAPCRAFT_PART_INSTALL/
-
- rm $SNAPCRAFT_PART_INSTALL/usr/share/applications/meshlab_server.desktop
+ override-build: |
+ sh scripts/Linux/1_build.sh
+ sh scripts/Linux/resources/make_bundle.sh
+
+ rsync -av src/install/* $SNAPCRAFT_PART_INSTALL/
+
rm $SNAPCRAFT_PART_INSTALL/usr/share/applications/meshlab.desktop
- cp install/linux/resources/snap/meshlab.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications/
- cp install/linux/resources/AppRunMeshLab $SNAPCRAFT_PART_INSTALL/
+ cp scripts/Linux/resources/snap/meshlab.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications/
+ cp scripts/Linux/resources/AppRunMeshLab $SNAPCRAFT_PART_INSTALL/
mv $SNAPCRAFT_PART_INSTALL/AppRunMeshLab $SNAPCRAFT_PART_INSTALL/AppRun
chmod +x $SNAPCRAFT_PART_INSTALL/AppRun
diff --git a/scripts/README.md b/scripts/README.md
new file mode 100644
index 000000000..c7b8226de
--- /dev/null
+++ b/scripts/README.md
@@ -0,0 +1,16 @@
+#scripts folder
+
+This folder contains a series of platform-dependent scripts to build and deploy MeshLab.
+
+Every platform folder contains:
+
+* `1_build.sh`: a script that builds MeshLab. Requires a Qt environment properly set, with `cmake` accessible. Takes as inputh the build directory (default: `src/build`), the install directory (default: `src/install`) and the number of cores used to build MeshLab (default: `-j4`). Example of call: `bash 1_build.sh --build_path=path/to/build --install_path=path/to/install -j8`
+* `2_deploy.sh`: a script that deploys MeshLab, making sure that the folder will be a self-contained MeshLab, without Qt library dependencies. Requires a properly built MeshLab in the directory passed as an argument (default: `src/install`). Example of call: `bash 2_deploy.sh path/to/deploy`
+* `3_$installer$.sh`: a script that computes a platform-dependent self-contained package/installer of MeshLab. Requires a properly deployed MeshLab in the directory passed as an argument (default: `src/install`). The result will be saved in the parent directory of the given argument.
+* `make_it.sh`: a script that computes all the three previous scripts: starting from the source code, it will produce a self-contained package/installer of MeshLab (arguments are the same of `1_build.sh`). Example of call: `bash makeit.sh --build_path=path/to/build --install_path=path/to/install -j8`
+
+Note for Windows: scripts are written in bash, therefore they should be run in a linux subsystem environment.
+See in each platform subfolder for details and other platform-dependent requirements:
+- [Linux](https://github.com/cnr-isti-vclab/meshlab/tree/master/scripts/Linux)
+- [MaxOS](https://github.com/cnr-isti-vclab/meshlab/tree/master/scripts/macOS)
+- [Windows](https://github.com/cnr-isti-vclab/meshlab/tree/master/scripts/Windows)
diff --git a/scripts/Windows/1_build.sh b/scripts/Windows/1_build.sh
new file mode 100644
index 000000000..a1cd3f8d7
--- /dev/null
+++ b/scripts/Windows/1_build.sh
@@ -0,0 +1,68 @@
+#!/bin/bash
+# this is a script shell for compiling meshlab in a windows environment.
+# Requires a VS >= 2017 and Qt environments which are set-up properly,
+# and an accessible cmake binary.
+#
+# Without given arguments, MeshLab will be built in the meshlab/src/build
+# directory, and installed in $BUILD_PATH/../install.
+#
+# You can give as argument the BUILD_PATH and the INSTALL_PATH in the
+# following way:
+# sh linux_build.sh --build_path=/path/to/build --install_path=/path/to/install
+# -b and -i arguments are also supported.
+
+#default paths wrt the script folder
+SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
+SOURCE_PATH=$SCRIPTS_PATH/../../src
+BUILD_PATH=$SOURCE_PATH/build
+INSTALL_PATH=$SOURCE_PATH/install
+CORES="-j4"
+
+#check parameters
+for i in "$@"
+do
+case $i in
+ -b=*|--build_path=*)
+ BUILD_PATH="${i#*=}"
+ shift # past argument=value
+ ;;
+ -i=*|--install_path=*)
+ INSTALL_PATH="${i#*=}"
+ shift # past argument=value
+ ;;
+ -j*)
+ CORES=$i
+ shift # past argument=value
+ ;;
+ *)
+ # unknown option
+ ;;
+esac
+done
+
+#create build path if necessary
+if ! [ -d $BUILD_PATH ]
+then
+ mkdir -p $BUILD_PATH
+fi
+
+#create install path if necessary
+if ! [ -d $INSTALL_PATH ]
+then
+ mkdir -p $INSTALL_PATH
+fi
+
+BUILD_PATH=$(realpath $BUILD_PATH)
+INSTALL_PATH=$(realpath $INSTALL_PATH)
+
+echo "BUILD PATH: "$BUILD_PATH
+echo "INSTALL PATH: "$INSTALL_PATH
+echo "SCRIPTS PATH: "$SCRIPTS_PATH
+
+cd $BUILD_PATH
+cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH $SOURCE_PATH
+echo "-----"
+ls -l
+echo "-----"
+jom $CORES #Qt nmake for parallel build
+nmake install
diff --git a/scripts/Windows/2_deploy.sh b/scripts/Windows/2_deploy.sh
new file mode 100644
index 000000000..dad839289
--- /dev/null
+++ b/scripts/Windows/2_deploy.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+# This is a script shell for deploying a meshlab-portable folder.
+# Requires a properly built meshlab (see windows_build.sh).
+#
+# Without given arguments, the folder that will be deployed is meshlab/src/install.
+#
+# You can give as argument the path where meshlab is installed.
+
+SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
+DISTRIB_PATH=$SCRIPTS_PATH/../../distrib
+
+#checking for parameters
+if [ "$#" -eq 0 ]
+then
+ BUNDLE_PATH=$SCRIPTS_PATH/../../src/install
+else
+ BUNDLE_PATH=$(realpath $1)
+fi
+
+windeployqt $BUNDLE_PATH/meshlab.exe
+
+mv $BUNDLE_PATH/lib/meshlab/IFX* $BUNDLE_PATH
+cp $BUNDLE_PATH/IFXCoreStatic.lib $BUNDLE_PATH/lib/meshlab/
+cp $DISTRIB_PATH/LICENSE.txt $BUNDLE_PATH/
+cp $DISTRIB_PATH/privacy.txt $BUNDLE_PATH/
+
+#at this point, distrib folder contains all the files necessary to execute meshlab
+echo "$BUNDLE_PATH is now a self contained meshlab application"
diff --git a/scripts/Windows/3_installer.sh b/scripts/Windows/3_installer.sh
new file mode 100644
index 000000000..6b3073928
--- /dev/null
+++ b/scripts/Windows/3_installer.sh
@@ -0,0 +1,26 @@
+# This is a powershell script for computing an installer for MeshLab.
+# Requires:
+# - a properly deployed meshlab (see windows_deploy.ps1);
+# - the env variable PATH containing the NSIS folder (makensis.exe must be directly accessible)
+#
+# Without given arguments, the folder that will be deployed is meshlab/distrib.
+#
+# You can give as argument the DISTRIB_PATH.
+#
+# After running this script, the installer can be found inside the resources folder.
+
+SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
+
+#checking for parameters
+if [ "$#" -eq 0 ]
+then
+ BUNDLE_PATH=$SCRIPTS_PATH/../../src/install
+else
+ BUNDLE_PATH=$(realpath $1)
+fi
+
+sh $SCRIPTS_PATH/resources/nsis_script.sh $BUNDLE_PATH
+
+makensis.exe $SCRIPTS_PATH/resources/meshlab_final.nsi
+
+rm $SCRIPTS_PATH/resources/meshlab_final.nsi
diff --git a/scripts/Windows/README.md b/scripts/Windows/README.md
new file mode 100644
index 000000000..0289b4f7f
--- /dev/null
+++ b/scripts/Windows/README.md
@@ -0,0 +1,26 @@
+# Windows Scripts
+
+**WORK IN PROGRESS**
+
+This folder contains a series of scripts to build and deploy MeshLab under a Windows environment.
+**Note**: scripts are written in bash, therefore they should be run in a linux subsystem environment.
+
+* `1_build.sh`: this script builds MeshLab in a Windows environment:
+ * it requires a properly set Visual Studio (>=2015) and MSVC compiler;
+ * it requires a properly set Qt environment;
+ * `cmake` in the PATH env variable;
+ * takes as arguments:
+ * the build directory (default: `src/build`): `--build_path=path/to/build`
+ * the install directory (default: `src/install`): `--install_path=path/to/install`
+ * the number of cores used to build MeshLab (default: `-j4`)`
+* `2_deploy.sh`: this script makes the given path a portable version of MeshLab. Takes as argument the path where the output install path of the `1_build.sh` script is placed (default: `src/install`);
+* `3_installer.sh`: this script computes, starting from the portable folder of MeshLab, an NSIS installer. Takes as argument the path where the output install path of the `2_deploy.sh` script is placed (default: `src/install`);
+ * it requires `makensis.exe` in the PATH env variable.
+
+
+## Examples
+
+Building MeshLab on Windows, having VisualStudio, MSVC and Qt installed, cmake in the PATH (build placed in `meshlab/src/build`):
+
+ git clone --recursive https://github.com/cnr-isti-vclab/meshlab
+ sh meshlab/scripts/Windows/1_build.sh
\ No newline at end of file
diff --git a/install/windows/windows_build.ps1 b/scripts/Windows/qmake/windows_build.ps1
similarity index 91%
rename from install/windows/windows_build.ps1
rename to scripts/Windows/qmake/windows_build.ps1
index 1116dea81..ea6eec7c3 100644
--- a/install/windows/windows_build.ps1
+++ b/scripts/Windows/qmake/windows_build.ps1
@@ -14,8 +14,7 @@
write-host "N of arguments: $($args.count)"
$DIR = Get-Location
-$INSTALL_PATH = $PSScriptRoot
-$SOURCE_PATH = Join-Path $PSScriptRoot ..\..\src
+$SOURCE_PATH = Join-Path $PSScriptRoot ..\..\..\src
if ($args.Count -gt 0){
$BUILD_PATH = Resolve-Path -Path $args[0]
diff --git a/install/windows/windows_build_debug.ps1 b/scripts/Windows/qmake/windows_build_debug.ps1
similarity index 91%
rename from install/windows/windows_build_debug.ps1
rename to scripts/Windows/qmake/windows_build_debug.ps1
index 188304c40..b391293fb 100644
--- a/install/windows/windows_build_debug.ps1
+++ b/scripts/Windows/qmake/windows_build_debug.ps1
@@ -14,8 +14,7 @@
write-host "N of arguments: $($args.count)"
$DIR = Get-Location
-$INSTALL_PATH = $PSScriptRoot
-$SOURCE_PATH = Join-Path $PSScriptRoot ..\..\src
+$SOURCE_PATH = Join-Path $PSScriptRoot ..\..\..\src
if ($args.Count -gt 0){
$BUILD_PATH = Resolve-Path -Path $args[0]
diff --git a/install/windows/windows_deploy.ps1 b/scripts/Windows/qmake/windows_deploy.ps1
similarity index 82%
rename from install/windows/windows_deploy.ps1
rename to scripts/Windows/qmake/windows_deploy.ps1
index 9b0e2e97c..a76742244 100644
--- a/install/windows/windows_deploy.ps1
+++ b/scripts/Windows/qmake/windows_deploy.ps1
@@ -18,24 +18,21 @@
write-host "N of arguments: $($args.count)"
$DIR = Get-Location
-$INSTALL_PATH = $PSScriptRoot
-$SOURCE_PATH = Join-Path $PSScriptRoot ..\..\src
+$SOURCE_PATH = Join-Path $PSScriptRoot ..\..\..\src
if ($args.Count -gt 0){
$DISTRIB_PATH = $args[0]
} else {
- $DISTRIB_PATH = Join-Path $PSScriptRoot ..\..\distrib #default distrib
+ $DISTRIB_PATH = Join-Path $PSScriptRoot ..\..\..\distrib #default distrib
}
cd $DISTRIB_PATH
if(! (Test-Path meshlab.exe)){ #meshlab.exe not found inside $DISTRIB_PATH
cd $DIR
- throw 'meshlab.exe not found in ' + ($DISTRIB_PATH) + '. Exiting.'
+ throw 'meshlab.exe not found in ' + ($DISTRIB_PATH) + '. Exiting.'
}
-#Copy-Item (Join-Path $INSTALL_PATH ..\meshlab.png) .
-
windeployqt --no-translations meshlab.exe
Move-Item .\lib\meshlab\IFX* .
diff --git a/install/windows/windows_nsis_installer.ps1 b/scripts/Windows/qmake/windows_nsis_installer.ps1
similarity index 68%
rename from install/windows/windows_nsis_installer.ps1
rename to scripts/Windows/qmake/windows_nsis_installer.ps1
index b9177229f..222b99512 100644
--- a/install/windows/windows_nsis_installer.ps1
+++ b/scripts/Windows/qmake/windows_nsis_installer.ps1
@@ -12,21 +12,21 @@
#saving location where script has been run
$DIR = Get-Location
-$INSTALL_PATH = $PSScriptRoot
+$SCRIPTS_PATH = Join-Path $PSScriptRoot ..\
if ($args.Count -gt 0){
$DISTRIB_PATH = $args[0]
} else {
- $DISTRIB_PATH = Join-Path $PSScriptRoot ..\..\distrib #default distrib
+ $DISTRIB_PATH = Join-Path $PSScriptRoot ..\..\..\distrib #default distrib
}
-.\resources\windows_nsis_script.ps1 $DISTRIB_PATH
+.\..\resources\windows_nsis_script.ps1 $DISTRIB_PATH
-cd $INSTALL_PATH
+cd $SCRIPTS_PATH
-makensis.exe .\resources\meshlab_final.nsi
+makensis.exe .\..\resources\meshlab_final.nsi
-Remove-Item .\resources\meshlab_final.nsi
+Remove-Item .\..\resources\meshlab_final.nsi
#going back to original location
cd $DIR
diff --git a/install/windows/resources/ExecWaitJob.nsh b/scripts/Windows/resources/ExecWaitJob.nsh
similarity index 100%
rename from install/windows/resources/ExecWaitJob.nsh
rename to scripts/Windows/resources/ExecWaitJob.nsh
diff --git a/install/windows/resources/FileAssociation.nsh b/scripts/Windows/resources/FileAssociation.nsh
similarity index 100%
rename from install/windows/resources/FileAssociation.nsh
rename to scripts/Windows/resources/FileAssociation.nsh
diff --git a/install/windows/resources/meshlab.nsi b/scripts/Windows/resources/meshlab.nsi
similarity index 100%
rename from install/windows/resources/meshlab.nsi
rename to scripts/Windows/resources/meshlab.nsi
diff --git a/scripts/Windows/resources/nsis_script.sh b/scripts/Windows/resources/nsis_script.sh
new file mode 100644
index 000000000..ea6ec5c22
--- /dev/null
+++ b/scripts/Windows/resources/nsis_script.sh
@@ -0,0 +1,35 @@
+# This is a powershell script for computing the meshlab_final.nsi script.
+# Requires:
+# - a properly deployed meshlab (see windows_deploy.ps1);
+#
+# Without given arguments, the folder that will be deployed is meshlab/distrib.
+#
+# You can give as argument the DISTRIB_PATH.
+#
+# After running this script, a meshlab_final.script can be found in the resources folder.
+# This script is ready to be run by makensis.exe
+
+SCRIPTS_PATH="$(dirname "$(realpath "$0")")"/..
+SOURCE_PATH=$SCRIPTS_PATH/../../src
+
+#checking for parameters
+if [ "$#" -eq 0 ]
+then
+ BUNDLE_PATH=$SOURCE_PATH/install
+else
+ BUNDLE_PATH=$(realpath $1)
+fi
+
+#if(! (Test-Path meshlab.exe)){ #meshlab.exe not found inside $DISTRIB_PATH
+# cd $DIR
+# throw 'meshlab.exe not found in ' + ($BUNDLE_PATH) + '. Exiting.'
+#}
+
+VERSION=$(cat $SOURCE_PATH/../ML_VERSION)
+
+sed "s%MESHLAB_VERSION%$VERSION%g" $SCRIPTS_PATH/resources/meshlab.nsi > $SCRIPTS_PATH/resources/meshlab_final.nsi
+sed -i "s%DISTRIB_PATH%.%g" $SCRIPTS_PATH/resources/meshlab_final.nsi
+
+mv $SCRIPTS_PATH/resources/meshlab_final.nsi $BUNDLE_PATH/
+cp $SCRIPTS_PATH/resources/ExecWaitJob.nsh $BUNDLE_PATH/
+cp $SCRIPTS_PATH/resources/FileAssociation.nsh $BUNDLE_PATH/
diff --git a/install/windows/resources/windows_nsis_script.ps1 b/scripts/Windows/resources/windows_nsis_script.ps1
similarity index 100%
rename from install/windows/resources/windows_nsis_script.ps1
rename to scripts/Windows/resources/windows_nsis_script.ps1
diff --git a/install/macos/macos_setup_env.sh b/scripts/macOS/0_setup_env.sh
similarity index 100%
rename from install/macos/macos_setup_env.sh
rename to scripts/macOS/0_setup_env.sh
diff --git a/scripts/macOS/1_build.sh b/scripts/macOS/1_build.sh
new file mode 100644
index 000000000..21f290234
--- /dev/null
+++ b/scripts/macOS/1_build.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+# this is a script shell for compiling meshlab in a MacOS environment.
+# Requires a Qt environment which is set-up properly, and an accessible
+# cmake binary.
+#
+# Without given arguments, MeshLab will be built in the meshlab/src/build
+# directory, and installed in $BUILD_PATH/../install.
+#
+# You can give as argument the BUILD_PATH and the INSTALL_PATH in the
+# following way:
+# sh macos_build.sh --build_path=/path/to/build --install_path=/path/to/install
+# -b and -i arguments are also supported.
+
+#realpath function
+#realpath() {
+# [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
+#}
+
+#default paths wrt the script folder
+SCRIPTS_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+SOURCE_PATH=$SCRIPTS_PATH/../../src
+BUILD_PATH=$SOURCE_PATH/build
+INSTALL_PATH=$SOURCE_PATH/install
+CORES="-j4"
+
+#check parameters
+for i in "$@"
+do
+case $i in
+ -b=*|--build_path=*)
+ BUILD_PATH="${i#*=}"
+ shift # past argument=value
+ ;;
+ -i=*|--install_path=*)
+ INSTALL_PATH="${i#*=}"
+ shift # past argument=value
+ ;;
+ -j*)
+ CORES=$i
+ shift # past argument=value
+ ;;
+ *)
+ # unknown option
+ ;;
+esac
+done
+
+#create build path if necessary
+if ! [ -d $BUILD_PATH ]
+then
+ mkdir -p $BUILD_PATH
+fi
+
+#create install path if necessary
+if ! [ -d $INSTALL_PATH ]
+then
+ mkdir -p $INSTALL_PATH
+fi
+
+cd $BUILD_PATH
+cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH $SOURCE_PATH
+make $CORES
+make install
diff --git a/scripts/macOS/2_deploy.sh b/scripts/macOS/2_deploy.sh
new file mode 100755
index 000000000..ef1cbb754
--- /dev/null
+++ b/scripts/macOS/2_deploy.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+# this is a script shell for deploying a meshlab-portable app.
+# Requires a properly built meshlab.
+#
+# Without given arguments, the folder that will be deployed is meshlab/distrib.
+#
+# You can give as argument the DISTRIB_PATH.
+#
+# After running this script, $DISTRIB_PATH/meshlab.app will be a portable meshlab application.
+
+#realpath function
+realpath() {
+ [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
+}
+
+SCRIPTS_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+
+#checking for parameters
+if [ "$#" -eq 0 ]
+then
+ INSTALL_PATH=$SCRIPTS_PATH/../../src/install
+else
+ INSTALL_PATH=$(realpath $1)
+fi
+
+APPNAME="meshlab.app"
+
+echo "Hopefully I should find " $INSTALL_PATH/$APPNAME
+
+if ! [ -e $INSTALL_PATH/$APPNAME -a -d $INSTALL_PATH/$APPNAME ]
+then
+ echo "Started in the wrong dir: I have not found the meshlab.app"
+ exit -1
+fi
+
+#copy libIFX libraries and change rpath u3d plugin
+#cp -a $DISTRIB_PATH/lib/meshlab/libIFX* $DISTRIB_PATH/$APPNAME/Contents/Frameworks
+#rm $DISTRIB_PATH/$APPNAME/Contents/Frameworks/libIFXCoreStatic.a
+#install_name_tool -change libIFXCore.1.so @rpath/libIFXCore.1.so $DISTRIB_PATH/$APPNAME/Contents/PlugIns/libio_u3d.dylib
+#install_name_tool -change libIFXExporting.1.so @rpath/libIFXExporting.1.so $DISTRIB_PATH/$APPNAME/Contents/PlugIns/libio_u3d.dylib
+#install_name_tool -change libIFXScheduling.1.so @rpath/libIFXScheduling.1.so $DISTRIB_PATH/$APPNAME/Contents/PlugIns/libio_u3d.dylib
+
+if [ -e $QTDIR/bin/macdeployqt ]
+then
+ $QTDIR/bin/macdeployqt $INSTALL_PATH/$APPNAME
+else
+ macdeployqt $INSTALL_PATH/$APPNAME
+fi
diff --git a/scripts/macOS/3_dmg.sh b/scripts/macOS/3_dmg.sh
new file mode 100755
index 000000000..e941f4ec3
--- /dev/null
+++ b/scripts/macOS/3_dmg.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+# this is a script shell for setting up the application DMG for MacOS.
+# Requires a properly built and deployed meshlab (requires to run the
+# macos_deploy.sh script first).
+#
+# Without given arguments, meshlab.app will be looked for in meshlab/distrib
+# folder. MeshLab DMG will be placed in the same directory of meshlab.app.
+#
+# You can give as argument the DISTRIB_PATH containing meshlab.app.
+
+#realpath function
+realpath() {
+ [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
+}
+
+SCRIPTS_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+
+#checking for parameters
+if [ "$#" -eq 0 ]
+then
+ INSTALL_PATH=$SCRIPTS_PATH/../../src/install
+else
+ INSTALL_PATH=$( realpath $1 )
+fi
+
+if ! [ -e $INSTALL_PATH/meshlab.app -a -d $INSTALL_PATH/meshlab.app ]
+then
+ echo "Started in the wrong dir: I have not found the meshlab.app"
+ exit -1
+fi
+
+SOURCE_PATH=$SCRIPTS_PATH/../../src
+
+# final step create the dmg using appdmg
+# appdmg is installed with 'npm install -g appdmg'",
+sed "s%DISTRIB_PATH%$INSTALL_PATH%g" $SCRIPTS_PATH/resources/meshlab_dmg_latest.json > $SCRIPTS_PATH/resources/meshlab_dmg_final.json
+sed -i '' "s%SOURCE_PATH%$SOURCE_PATH%g" $SCRIPTS_PATH/resources/meshlab_dmg_final.json
+
+rm -f $INSTALL_PATH/*.dmg
+
+echo "Running appdmg"
+appdmg $SCRIPTS_PATH/resources/meshlab_dmg_final.json $INSTALL_PATH/MeshLab$(cat $SCRIPTS_PATH/../../ML_VERSION).dmg
+
+rm $SCRIPTS_PATH/resources/meshlab_dmg_final.json
+
+#at this point, distrib folder contains a DMG MeshLab file
+echo "distrib folder now contains a DMG file"
diff --git a/scripts/macOS/README.md b/scripts/macOS/README.md
new file mode 100644
index 000000000..9c28dc5fa
--- /dev/null
+++ b/scripts/macOS/README.md
@@ -0,0 +1,32 @@
+# MacOS Scripts
+
+This folder contains a series of scripts to build and deploy MeshLab under a MacOS environment.
+
+* `0_setup_env.sh`: this script installs all the required dependencies that are necessary to build MeshLab and to create its DMG in a MacOS machine (tested in 10.15 Catalina). It requires [homebrew](https://brew.sh/) installed;
+* `1_build.sh`: this script builds MeshLab in a MacOS environment:
+ * it requires a properly set Qt environment (see `0_setup_env.sh`);
+ * takes as arguments:
+ * the build directory (default: `src/build`): `--build_path=path/to/build`
+ * the install directory (default: `src/install`): `--install_path=path/to/install`
+ * the number of cores used to build MeshLab (default: `-j4`)`
+* `2_deploy.sh`: this script makes portable a `meshlab.app` appdir. Takes as argument the path where the output install path of the `1_build.sh` script is placed (default: `src/install`);
+* `3_dmg.sh`: this script generates a [DMG](https://en.wikipedia.org/wiki/Apple_Disk_Image) that can be used to install MeshLab. Takes as argument the path where the install path of the `2_deploy.sh` script is placed (default: `src/install`);
+* `make_it.sh`: this script builds, deploys and generates a [DMG](https://en.wikipedia.org/wiki/Apple_Disk_Image) that can be used to install MeshLab. Arguments are the same of the `1_build.sh` script.
+
+## Examples
+
+Building MeshLab on a clean MacOS environment (build placed in `meshlab/src/build`):
+
+ git clone --recursive https://github.com/cnr-isti-vclab/meshlab
+ sh meshlab/scripts/macOS/0_setup_env.sh
+ sh meshlab/scripts/macOS/1_build.sh
+
+Building and generating a DMG on a clean MacOS environment:
+* build directory: `./meshlab-build`
+* install directory: `./meshlab-install`
+* DMG path: `./`
+
+
+ git clone --recursive https://github.com/cnr-isti-vclab/meshlab
+ sh meshlab/scripts/macOS/0_setup_env.sh
+ sh meshlab/scripts/macOS/make_it.sh --build_path="./meshlab-build" --install_path="./meshlab-install"
\ No newline at end of file
diff --git a/install/macos/macos_build.sh b/scripts/macOS/qmake/macos_build.sh
similarity index 93%
rename from install/macos/macos_build.sh
rename to scripts/macOS/qmake/macos_build.sh
index 777d4a154..1e1560566 100644
--- a/install/macos/macos_build.sh
+++ b/scripts/macOS/qmake/macos_build.sh
@@ -17,7 +17,7 @@ realpath() {
#checking for parameters
if [ "$#" -eq 0 ]
then
- BUILD_PATH="../../src"
+ BUILD_PATH="../../../src"
else
BUILD_PATH=$( realpath $1 )
fi
@@ -31,7 +31,7 @@ then
fi
echo "Build path is: " $(realpath $BUILD_PATH)
-SOURCE_PATH=$PWD/../../src
+SOURCE_PATH=$PWD/../../../src
cd $BUILD_PATH
qmake $SOURCE_PATH/meshlab.pro
diff --git a/install/macos/macos_build_debug.sh b/scripts/macOS/qmake/macos_build_debug.sh
similarity index 93%
rename from install/macos/macos_build_debug.sh
rename to scripts/macOS/qmake/macos_build_debug.sh
index 11ab595c1..8e0aa622c 100644
--- a/install/macos/macos_build_debug.sh
+++ b/scripts/macOS/qmake/macos_build_debug.sh
@@ -17,7 +17,7 @@ realpath() {
#checking for parameters
if [ "$#" -eq 0 ]
then
- BUILD_PATH="../../src"
+ BUILD_PATH="../../../src"
else
BUILD_PATH=$( realpath $1 )
fi
@@ -31,7 +31,7 @@ then
fi
echo "Build path is: " $(realpath $BUILD_PATH)
-SOURCE_PATH=$PWD/../../src
+SOURCE_PATH=$PWD/../../../src
cd $BUILD_PATH
qmake $SOURCE_PATH/meshlab.pro CONFIG+=debug
diff --git a/install/macos/macos_build_meshlab_mini.sh b/scripts/macOS/qmake/macos_build_meshlab_mini.sh
similarity index 93%
rename from install/macos/macos_build_meshlab_mini.sh
rename to scripts/macOS/qmake/macos_build_meshlab_mini.sh
index c585cc763..8e4f89c0f 100644
--- a/install/macos/macos_build_meshlab_mini.sh
+++ b/scripts/macOS/qmake/macos_build_meshlab_mini.sh
@@ -17,7 +17,7 @@ realpath() {
#checking for parameters
if [ "$#" -eq 0 ]
then
- BUILD_PATH="../../src"
+ BUILD_PATH="../../../src"
else
BUILD_PATH=$( realpath $1 )
fi
@@ -31,7 +31,7 @@ then
fi
echo "Build path is: " $(realpath $BUILD_PATH)
-SOURCE_PATH=$PWD/../../src
+SOURCE_PATH=$PWD/../../../src
cd $BUILD_PATH
qmake $SOURCE_PATH/meshlab.pro "CONFIG+=meshlab_mini"
diff --git a/install/macos/macos_deploy.sh b/scripts/macOS/qmake/macos_deploy.sh
similarity index 97%
rename from install/macos/macos_deploy.sh
rename to scripts/macOS/qmake/macos_deploy.sh
index 39ed3a9fd..1306a1389 100755
--- a/install/macos/macos_deploy.sh
+++ b/scripts/macOS/qmake/macos_deploy.sh
@@ -16,7 +16,7 @@ realpath() {
#checking for parameters
if [ "$#" -eq 0 ]
then
- DISTRIB_PATH="../../distrib"
+ DISTRIB_PATH="../../../distrib"
else
DISTRIB_PATH=$( realpath $1 )
fi
@@ -24,7 +24,7 @@ fi
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd $DIR #move to script directory
-SOURCE_PATH=$PWD/../../src
+SOURCE_PATH=$PWD/../../../src
APPNAME="meshlab.app"
diff --git a/install/macos/macos_dmg.sh b/scripts/macOS/qmake/macos_dmg.sh
similarity index 76%
rename from install/macos/macos_dmg.sh
rename to scripts/macOS/qmake/macos_dmg.sh
index aab374592..e59d97fb2 100755
--- a/install/macos/macos_dmg.sh
+++ b/scripts/macOS/qmake/macos_dmg.sh
@@ -16,7 +16,7 @@ realpath() {
#checking for parameters
if [ "$#" -eq 0 ]
then
- DISTRIB_PATH="../../distrib"
+ DISTRIB_PATH="../../../distrib"
else
DISTRIB_PATH=$( realpath $1 )
fi
@@ -32,17 +32,17 @@ then
exit -1
fi
-SOURCE_PATH=$DIR/../../src
+SOURCE_PATH=$DIR/../../../src
# final step create the dmg using appdmg
# appdmg is installed with 'npm install -g appdmg'",
-sed "s%DISTRIB_PATH%$DISTRIB_PATH%g" resources/meshlab_dmg_latest.json > resources/meshlab_dmg_final.json
-sed -i '' "s%SOURCE_PATH%$SOURCE_PATH%g" resources/meshlab_dmg_final.json
+sed "s%DISTRIB_PATH%$DISTRIB_PATH%g" ../resources/meshlab_dmg_latest.json > ../resources/meshlab_dmg_final.json
+sed -i '' "s%SOURCE_PATH%$SOURCE_PATH%g" ../resources/meshlab_dmg_final.json
rm -f $DISTRIB_PATH/*.dmg
echo "Running appdmg"
-appdmg resources/meshlab_dmg_final.json $DISTRIB_PATH/MeshLab$(cat ../../ML_VERSION).dmg
+appdmg ../resources/meshlab_dmg_final.json $DISTRIB_PATH/MeshLab$(cat ../../../ML_VERSION).dmg
#at this point, distrib folder contains a DMG MeshLab file
echo "distrib folder now contains a DMG file"
diff --git a/install/macos/macos_make_it.sh b/scripts/macOS/qmake/macos_make_it.sh
similarity index 92%
rename from install/macos/macos_make_it.sh
rename to scripts/macOS/qmake/macos_make_it.sh
index 5c0b257b4..6d5814bdd 100644
--- a/install/macos/macos_make_it.sh
+++ b/scripts/macOS/qmake/macos_make_it.sh
@@ -18,8 +18,8 @@ realpath() {
#checking for parameters
if [ "$#" -eq 0 ]
then
- BUILD_PATH="../../src"
- DISTRIB_PATH="../../distrib"
+ BUILD_PATH="../../../src"
+ DISTRIB_PATH="../../../distrib"
else
BUILD_PATH=$( realpath $1 )
DISTRIB_PATH=$BUILD_PATH/distrib
diff --git a/install/macos/resources/LICENSE.txt b/scripts/macOS/resources/LICENSE.txt
similarity index 100%
rename from install/macos/resources/LICENSE.txt
rename to scripts/macOS/resources/LICENSE.txt
diff --git a/install/macos/resources/dmg-background.svg b/scripts/macOS/resources/dmg-background.svg
similarity index 100%
rename from install/macos/resources/dmg-background.svg
rename to scripts/macOS/resources/dmg-background.svg
diff --git a/install/macos/resources/meshlab_dmg_background.png b/scripts/macOS/resources/meshlab_dmg_background.png
similarity index 100%
rename from install/macos/resources/meshlab_dmg_background.png
rename to scripts/macOS/resources/meshlab_dmg_background.png
diff --git a/install/macos/resources/meshlab_dmg_background@2x.png b/scripts/macOS/resources/meshlab_dmg_background@2x.png
similarity index 100%
rename from install/macos/resources/meshlab_dmg_background@2x.png
rename to scripts/macOS/resources/meshlab_dmg_background@2x.png
diff --git a/install/macos/resources/meshlab_dmg_latest.json b/scripts/macOS/resources/meshlab_dmg_latest.json
similarity index 100%
rename from install/macos/resources/meshlab_dmg_latest.json
rename to scripts/macOS/resources/meshlab_dmg_latest.json
diff --git a/install/macos/resources/readme.txt b/scripts/macOS/resources/readme.txt
similarity index 100%
rename from install/macos/resources/readme.txt
rename to scripts/macOS/resources/readme.txt
diff --git a/install/meshlab.png b/scripts/meshlab.png
similarity index 100%
rename from install/meshlab.png
rename to scripts/meshlab.png
diff --git a/install/qt.conf b/scripts/qt.conf
similarity index 100%
rename from install/qt.conf
rename to scripts/qt.conf
diff --git a/snapcraft.yaml b/snapcraft.yaml
index 5dbf2676d..f4b2aae41 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -19,9 +19,6 @@ apps:
command: desktop-launch $SNAP/AppRun
plugs: [home, x11, mir, opengl, removable-media]
desktop: usr/share/applications/meshlab.desktop
- meshlabserver:
- command: desktop-launch meshlabserver
- plugs: [home, x11, opengl, removable-media]
parts:
@@ -44,6 +41,7 @@ parts:
- gnome-themes-standard
- shared-mime-info
- libqt5gui5
+ - libqt5qml5
- libgdk-pixbuf2.0-0
- libqt5svg5
- try:
@@ -65,9 +63,9 @@ parts:
- libglu1-mesa-dev
- lib3ds-dev
- libglew-dev
- - libeigen3-dev
- - libopenctm-dev
- - libgmp-dev
+ - libeigen3-dev
+ - libopenctm-dev
+ - libgmp-dev
- libqhull-dev
- chrpath
stage-packages:
@@ -77,19 +75,17 @@ parts:
- libqhull7
- libglew-dev
- libqt5opengl5-dev
+ - qtdeclarative5-dev
- libqt5xmlpatterns5-dev
- libqt5gui5
- override-build: |
- qmake src/meshlab.pro "CONFIG+= system_eigen3 system_glew system_bzip2 system_openctm system_lib3ds"
- make -j4
-
- sh install/linux/linux_make_boundle.sh distrib/
-
- rsync -av distrib/* $SNAPCRAFT_PART_INSTALL/
-
- rm $SNAPCRAFT_PART_INSTALL/usr/share/applications/meshlab_server.desktop
+ override-build: |
+ sh scripts/Linux/1_build.sh
+ sh scripts/Linux/resources/make_bundle.sh
+
+ rsync -av src/install/* $SNAPCRAFT_PART_INSTALL/
+
rm $SNAPCRAFT_PART_INSTALL/usr/share/applications/meshlab.desktop
- cp install/linux/resources/snap/meshlab.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications/
- cp install/linux/resources/AppRunMeshLab $SNAPCRAFT_PART_INSTALL/
+ cp scripts/Linux/resources/snap/meshlab.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications/
+ cp scripts/Linux/resources/AppRunMeshLab $SNAPCRAFT_PART_INSTALL/
mv $SNAPCRAFT_PART_INSTALL/AppRunMeshLab $SNAPCRAFT_PART_INSTALL/AppRun
chmod +x $SNAPCRAFT_PART_INSTALL/AppRun
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2c7108235..caa645fdc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -6,58 +6,30 @@ project(MeshLab)
# Prefer GLVND
if(POLICY CMP0072)
- cmake_policy(SET CMP0072 NEW)
+ cmake_policy(SET CMP0072 NEW)
endif()
### vcglib
if(NOT VCGDIR)
- get_filename_component(VCGDIR "${CMAKE_CURRENT_SOURCE_DIR}/../vcglib" ABSOLUTE)
- if(NOT EXISTS ${VCGDIR})
- set(VCGDIR NOTFOUND)
- endif()
+ get_filename_component(VCGDIR "${CMAKE_CURRENT_SOURCE_DIR}/vcglib" ABSOLUTE)
+ if(NOT EXISTS ${VCGDIR})
+ set(VCGDIR NOTFOUND)
+ endif()
endif()
set(VCGDIR
- "${VCGDIR}"
- CACHE PATH "The location of the vcglib source tree - defaults to sibling of meshlab directory.")
+ "${VCGDIR}")
if(NOT VCGDIR)
- message(
- FATAL_ERROR
- "vcglib is required to build MeshLab. Please get the source and set VCGDIR to its location: default location is as a sibling to the meshlab directory above this directory."
- )
+ message(
+ FATAL_ERROR
+ "vcglib is required to build MeshLab. Please get the source and set VCGDIR to its location: default location is as a sibling to the meshlab directory above this directory."
+ )
endif()
### Build options
option(BUILD_MINI "Build only a minimal set of plugins" OFF)
option(BUILD_STRICT "Strictly enforce resolution of all symbols" ON)
-set(BUILD_ADDITIONAL_PLUGINS
- ${BUILD_ADDITIONAL_PLUGINS}
- CACHE
- STRING
- "A list of other plugin subdirectories to recurse into (e.g. select experimental or unsupported plugins) - relative to meshlab/src"
-)
-
-option(ALLOW_BUNDLED_EIGEN "Allow use of bundled Eigen source" ON)
-option(ALLOW_BUNDLED_GLEW "Allow use of bundled GLEW source" ON)
-option(ALLOW_BUNDLED_NEWUOA "Allow use of bundled newuoa source" ON)
-option(ALLOW_BUNDLED_LEVMAR "Allow use of bundled levmar source" ON)
-option(ALLOW_BUNDLED_LIB3DS "Allow use of bundled lib3ds source" ON)
-# option(ALLOW_BUNDLED_MPIR "Allow use of bundled MPIR binaries" ON) # TODO
-option(ALLOW_BUNDLED_MUPARSER "Allow use of bundled muparser source" ON)
-option(ALLOW_BUNDLED_OPENCTM "Allow use of bundled OpenCTM source" ON)
-option(ALLOW_BUNDLED_SSYNTH "Allow use of bundled structure-synth source" ON)
-option(ALLOW_BUNDLED_QHULL "Allow use of bundled Qhull source" ON)
-option(ALLOW_BUNDLED_U3D "Allow use of bundled u3d source" ON)
-option(ALLOW_BUNDLED_OPENGR "Allow use of bundled OpenGR source" ON)
-
-option(ALLOW_SYSTEM_EIGEN "Allow use of system-provided Eigen" ON)
-option(ALLOW_SYSTEM_GLEW "Allow use of system-provided GLEW" ON)
-option(ALLOW_SYSTEM_LIB3DS "Allow use of system-provided lib3ds" ON)
-option(ALLOW_SYSTEM_GMP "Allow use of system-provided GMP" ON)
-option(ALLOW_SYSTEM_MUPARSER "Allow use of system-provided muparser" ON)
-option(ALLOW_SYSTEM_OPENCTM "Allow use of system-provided OpenCTM" ON)
-option(ALLOW_SYSTEM_QHULL "Allow use of system-provided QHull" ON)
### Dependencies
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@@ -68,9 +40,9 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
find_package(
- Qt5
- COMPONENTS OpenGL Xml XmlPatterns
- REQUIRED)
+ Qt5
+ COMPONENTS OpenGL Xml XmlPatterns
+ REQUIRED)
message(STATUS "Searching for required components with bundled fallback")
find_package(GLEW)
@@ -85,55 +57,50 @@ find_package(OpenCTM)
find_package(Qhull COMPONENTS libqhull)
find_package(OpenMP)
-if(WIN32)
- option(INSTALL_TO_UNIX_LAYOUT
- "Should the files be installed to a unix layout? If false, they will be installed more like the build tree."
- OFF)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
- get_target_property(Qt5_qmake_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
- get_filename_component(Qt5_BIN_DIR "${Qt5_qmake_EXECUTABLE}" DIRECTORY)
- find_program(
- Qt5_windeployqt_EXECUTABLE
- NAMES windeployqt
- HINTS ${Qt5_BIN_DIR})
- if(Qt5_windeployqt_EXECUTABLE)
- option(BUILD_WITH_WINDEPLOYQT_POST_BUILD
- "Should we run windeployqt after the build to copy the qt parts to the build tree?" ON)
- endif()
+if(WIN32 OR APPLE)
+ option(INSTALL_TO_UNIX_LAYOUT
+ "Should the files be installed to a unix layout? If false, they will be installed more like the build tree."
+ OFF)
else()
- set(INSTALL_TO_UNIX_LAYOUT ON)
+ set(INSTALL_TO_UNIX_LAYOUT ON)
endif()
option(INSTALL_SAMPLE_MESHES
- "Should the sample meshes in src/distrib/samples be installed? It will increase the installed size by 14 MiB."
- OFF)
+ "Should the sample meshes in src/distrib/samples be installed? It will increase the installed size by 14 MiB."
+ OFF)
option(
- INSTALL_SAMPLE_RANGEMAPS
- "Should the sample rangemaps in src/distrib/samples/rangemaps be installed? It will increase the installed size by 67 MiB."
- OFF)
+ INSTALL_SAMPLE_RANGEMAPS
+ "Should the sample rangemaps in src/distrib/samples/rangemaps be installed? It will increase the installed size by 67 MiB."
+ OFF)
### Settings needed for both "external" and internal code
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
-### Bundled dependencies in the "external" directory
-set(EXTERNAL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external)
-include("${CMAKE_CURRENT_SOURCE_DIR}/external.cmake")
-
### Install directories and build/staging directories
+MESSAGE( STATUS "CMAKE_INSTALL_PREFIX: " ${CMAKE_INSTALL_PREFIX} )
include(GNUInstallDirs)
if(INSTALL_TO_UNIX_LAYOUT)
- set(MESHLAB_BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR})
- set(MESHLAB_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/meshlab)
- set(MESHLAB_PLUGIN_INSTALL_DIR ${MESHLAB_LIB_INSTALL_DIR}/plugins)
- set(MESHLAB_SHADER_INSTALL_DIR ${CMAKE_INSTALL_DATAROOTDIR}/meshlab/shaders)
- set(MESHLAB_SAMPLE_INSTALL_DIR ${CMAKE_INSTALL_DATAROOTDIR}/meshlab)
+ set(MESHLAB_BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR})
+ set(MESHLAB_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/meshlab)
+ set(MESHLAB_PLUGIN_INSTALL_DIR ${MESHLAB_LIB_INSTALL_DIR}/plugins)
+ set(MESHLAB_SHADER_INSTALL_DIR ${CMAKE_INSTALL_DATAROOTDIR}/meshlab/shaders)
+ set(MESHLAB_SAMPLE_INSTALL_DIR ${CMAKE_INSTALL_DATAROOTDIR}/meshlab)
+elseif(APPLE)
+ set(MESHLAB_BIN_INSTALL_DIR .)
+ set(MESHLAB_LIB_INSTALL_DIR meshlab.app/Contents/Frameworks)
+ set(MESHLAB_PLUGIN_INSTALL_DIR meshlab.app/Contents/PlugIns)
+ set(MESHLAB_SHADER_INSTALL_DIR meshlab.app/Contents/shaders)
+ set(MESHLAB_SAMPLE_INSTALL_DIR .)
else()
- set(MESHLAB_BIN_INSTALL_DIR .)
- set(MESHLAB_LIB_INSTALL_DIR .)
- set(MESHLAB_PLUGIN_INSTALL_DIR plugins)
- set(MESHLAB_SHADER_INSTALL_DIR shaders)
- set(MESHLAB_SAMPLE_INSTALL_DIR .)
+ set(MESHLAB_BIN_INSTALL_DIR .)
+ set(MESHLAB_LIB_INSTALL_DIR .)
+ set(MESHLAB_PLUGIN_INSTALL_DIR plugins)
+ set(MESHLAB_SHADER_INSTALL_DIR shaders)
+ set(MESHLAB_SAMPLE_INSTALL_DIR .)
endif()
set(MESHLAB_BUILD_DISTRIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/distrib)
@@ -143,6 +110,10 @@ set(MESHLAB_SAMPLE_OUTPUT_DIR ${MESHLAB_BUILD_DISTRIB_DIR}/sample)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${MESHLAB_BUILD_DISTRIB_DIR})
+### Bundled dependencies in the "external" directory
+set(EXTERNAL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external)
+include(${EXTERNAL_DIR}/external.cmake)
+
### Common build settings for internal code
include_directories(${VCGDIR} ${CMAKE_CURRENT_SOURCE_DIR})
@@ -151,146 +122,143 @@ include_directories(${EIGEN_INCLUDE_DIRS})
add_definitions(-DMESHLAB_SCALAR=float)
-if(BUILD_STRICT AND NOT MSVC)
- # Make sure that our shared libraries were appropriately linked
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
- set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
+if(BUILD_STRICT AND NOT MSVC AND NOT APPLE)
+ # Make sure that our shared libraries were appropriately linked
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
+ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
+endif()
+
+if (BUILD_STRICT AND APPLE)
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,error")
+ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-undefined,error")
endif()
if(WIN32)
- add_definitions(-DNOMINMAX)
- if(MSVC)
- add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
- endif()
+ add_definitions(-DNOMINMAX)
+ if(MSVC)
+ add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
+ endif()
endif()
### Enter subdirectories
add_subdirectory(common)
-set(CMAKE_INSTALL_RPATH $ORIGIN/../${MESHLAB_LIB_INSTALL_DIR};$ORIGIN/../${CMAKE_INSTALL_LIBDIR})
+if (NOT APPLE)
+ set(CMAKE_INSTALL_RPATH $ORIGIN/../${MESHLAB_LIB_INSTALL_DIR};$ORIGIN/../${CMAKE_INSTALL_LIBDIR})
+else()
+ SET(CMAKE_INSTALL_RPATH $ORIGIN/../Frameworks)
+endif()
add_subdirectory(meshlab)
add_subdirectory(meshlabserver)
-if (WIN32)
- add_subdirectory(use_cpu_opengl)
-endif()
set(CMAKE_INSTALL_RPATH)
+if (WIN32)
+ add_subdirectory(use_cpu_opengl)
+endif()
### Plugin subdirectories
if(BUILD_MINI)
- # mini
- set(POSSIBLE_PLUGINS
- meshlabplugins/io_base
- meshlabplugins/filter_meshing
- meshlabplugins/decorate_base
- meshlabplugins/filter_measure)
+ # mini
+ set(POSSIBLE_PLUGINS
+ meshlabplugins/io_base
+ meshlabplugins/filter_meshing
+ meshlabplugins/decorate_base
+ meshlabplugins/filter_measure)
else()
- # full
+ # full
- set(POSSIBLE_PLUGINS
- # IO plugins
- meshlabplugins/io_3ds
- meshlabplugins/io_base
- meshlabplugins/io_bre
- meshlabplugins/io_collada
- meshlabplugins/io_ctm
- meshlabplugins/io_expe
- meshlabplugins/io_json
- meshlabplugins/io_pdb
- meshlabplugins/io_tri
- meshlabplugins/io_txt
- meshlabplugins/io_u3d
- meshlabplugins/io_x3d
+ set(POSSIBLE_PLUGINS
+ # IO plugins
+ meshlabplugins/io_3ds
+ meshlabplugins/io_base
+ meshlabplugins/io_bre
+ meshlabplugins/io_collada
+ meshlabplugins/io_ctm
+ meshlabplugins/io_expe
+ meshlabplugins/io_json
+ meshlabplugins/io_pdb
+ meshlabplugins/io_tri
+ meshlabplugins/io_txt
+ meshlabplugins/io_u3d
+ meshlabplugins/io_x3d
- # Filter plugins
- # meshlabplugins/filter_aging # not in qmake file?
- # meshlabplugins/filter_bnpts # not in qmake file?
- meshlabplugins/filter_ao
- meshlabplugins/filter_camera
- meshlabplugins/filter_clean
- meshlabplugins/filter_color_projection
- meshlabplugins/filter_colorproc
- meshlabplugins/filter_create
- meshlabplugins/filter_csg
- meshlabplugins/filter_dirt
- meshlabplugins/filter_fractal
- meshlabplugins/filter_func
- meshlabplugins/filter_globalregistration
- meshlabplugins/filter_img_patch_param
- meshlabplugins/filter_isoparametrization
- meshlabplugins/filter_layer
- meshlabplugins/filter_measure
- meshlabplugins/filter_meshing
- meshlabplugins/filter_mls
- meshlabplugins/filter_mutualglobal
- meshlabplugins/filter_mutualinfo
- meshlabplugins/filter_plymc
- meshlabplugins/filter_qhull
- meshlabplugins/filter_quality
- meshlabplugins/filter_sampling
- meshlabplugins/filter_screened_poisson
- meshlabplugins/filter_sdfgpu
- meshlabplugins/filter_select
- meshlabplugins/filter_sketchfab
- meshlabplugins/filter_ssynth
- meshlabplugins/filter_texture
- meshlabplugins/filter_trioptimize
- meshlabplugins/filter_unsharp
- meshlabplugins/filter_voronoi
+ # Filter plugins
+ # meshlabplugins/filter_aging # not in qmake file?
+ # meshlabplugins/filter_bnpts # not in qmake file?
+ meshlabplugins/filter_ao
+ meshlabplugins/filter_camera
+ meshlabplugins/filter_clean
+ meshlabplugins/filter_color_projection
+ meshlabplugins/filter_colorproc
+ meshlabplugins/filter_create
+ meshlabplugins/filter_csg
+ meshlabplugins/filter_dirt
+ meshlabplugins/filter_fractal
+ meshlabplugins/filter_func
+ meshlabplugins/filter_globalregistration
+ meshlabplugins/filter_img_patch_param
+ meshlabplugins/filter_isoparametrization
+ meshlabplugins/filter_layer
+ meshlabplugins/filter_measure
+ meshlabplugins/filter_meshing
+ meshlabplugins/filter_mls
+ meshlabplugins/filter_mutualglobal
+ meshlabplugins/filter_mutualinfo
+ meshlabplugins/filter_plymc
+ meshlabplugins/filter_qhull
+ meshlabplugins/filter_quality
+ meshlabplugins/filter_sampling
+ meshlabplugins/filter_screened_poisson
+ meshlabplugins/filter_sdfgpu
+ meshlabplugins/filter_select
+ meshlabplugins/filter_sketchfab
+ meshlabplugins/filter_ssynth
+ meshlabplugins/filter_texture
+ meshlabplugins/filter_trioptimize
+ meshlabplugins/filter_unsharp
+ meshlabplugins/filter_voronoi
- # Rendering and Decoration Plugins
- meshlabplugins/render_gdp
- meshlabplugins/render_radiance_scaling
- meshlabplugins/decorate_base
- meshlabplugins/decorate_background
- meshlabplugins/decorate_raster_proj
- meshlabplugins/decorate_shadow
+ # Rendering and Decoration Plugins
+ meshlabplugins/render_gdp
+ meshlabplugins/render_radiance_scaling
+ meshlabplugins/decorate_base
+ meshlabplugins/decorate_background
+ meshlabplugins/decorate_raster_proj
+ meshlabplugins/decorate_shadow
- # Edit Plugins
- meshlabplugins/edit_align
- # meshlabplugins/edit_hole # not in qmake file?
- meshlabplugins/edit_manipulators
- meshlabplugins/edit_measure
- meshlabplugins/edit_mutualcorrs
- meshlabplugins/edit_paint
- meshlabplugins/edit_pickpoints
- meshlabplugins/edit_point
- meshlabplugins/edit_referencing
- meshlabplugins/edit_quality
- meshlabplugins/edit_select
- # meshlabplugins/edit_slice # not in qmake file?
- # meshlabplugins/edit_texture # not in qmake file?
+ # Edit Plugins
+ meshlabplugins/edit_align
+ # meshlabplugins/edit_hole # not in qmake file?
+ meshlabplugins/edit_manipulators
+ meshlabplugins/edit_measure
+ meshlabplugins/edit_mutualcorrs
+ meshlabplugins/edit_paint
+ meshlabplugins/edit_pickpoints
+ meshlabplugins/edit_point
+ meshlabplugins/edit_referencing
+ meshlabplugins/edit_quality
+ meshlabplugins/edit_select
+ # meshlabplugins/edit_slice # not in qmake file?
+ # meshlabplugins/edit_texture # not in qmake file?
- # Sample Plugins
- meshlabplugins/edit_sample
- meshlabplugins/filter_sample
- meshlabplugins/filter_sample_dyn
- meshlabplugins/filter_createiso
- meshlabplugins/filter_geodesic
- meshlabplugins/filter_sample_gpu)
+ # Sample Plugins
+ meshlabplugins/edit_sample
+ meshlabplugins/filter_sample
+ meshlabplugins/filter_sample_dyn
+ meshlabplugins/filter_createiso
+ meshlabplugins/filter_geodesic
+ meshlabplugins/filter_sample_gpu)
endif()
message(STATUS "\nConfiguring plugins")
foreach(PLUGIN ${POSSIBLE_PLUGINS})
- if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${PLUGIN}/CMakeLists.txt)
- message(STATUS "- ${PLUGIN}")
- add_subdirectory(${PLUGIN})
- else()
- message(STATUS " - ${PLUGIN} - Skipping, plugin or build system not found.")
- endif()
-endforeach()
-if(BUILD_ADDITIONAL_PLUGINS)
- message(STATUS "\nConfiguring plugins specified in BUILD_ADDITIONAL_PLUGINS")
-endif()
-foreach(PLUGIN ${BUILD_ADDITIONAL_PLUGINS})
- get_filename_component(PLUGIN_DIR ${PLUGIN} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
- if(EXISTS ${PLUGIN_DIR}/CMakeLists.txt)
- message(STATUS "- ${PLUGIN}")
- add_subdirectory(${PLUGIN_DIR})
- else()
- message(FATAL_ERROR "${PLUGIN} - Additional plugin specified in BUILD_ADDITIONAL_PLUGINS but not found.")
- endif()
+ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${PLUGIN}/CMakeLists.txt)
+ message(STATUS "- ${PLUGIN}")
+ add_subdirectory(${PLUGIN})
+ else()
+ message(STATUS " - ${PLUGIN} - Skipping, plugin or build system not found.")
+ endif()
endforeach()
### Copy/install other files
@@ -301,24 +269,24 @@ set(COPIED_FILES)
# shaders
# TODO subdirs?
file(
- GLOB SHADERS
- LIST_DIRECTORIES false
- "${CMAKE_CURRENT_SOURCE_DIR}/../distrib/shaders/*.vert" "${CMAKE_CURRENT_SOURCE_DIR}/../distrib/shaders/*.frag"
- "${CMAKE_CURRENT_SOURCE_DIR}/../distrib/shaders/*.gdp")
+ GLOB SHADERS
+ LIST_DIRECTORIES false
+ "${CMAKE_CURRENT_SOURCE_DIR}/../distrib/shaders/*.vert" "${CMAKE_CURRENT_SOURCE_DIR}/../distrib/shaders/*.frag"
+ "${CMAKE_CURRENT_SOURCE_DIR}/../distrib/shaders/*.gdp")
foreach(FN ${SHADERS})
- get_filename_component(NAME_ONLY ${FN} NAME)
- set(OUTFN ${MESHLAB_SHADER_OUTPUT_DIR}/${NAME_ONLY})
- add_custom_command(
- OUTPUT ${OUTFN}
- COMMAND ${CMAKE_COMMAND} -E make_directory "${MESHLAB_SHADER_OUTPUT_DIR}"
- COMMAND ${CMAKE_COMMAND} -E copy_if_different "${FN}" "${OUTFN}"
- COMMENT "Copying ${NAME_ONLY} to shader build directory"
- VERBATIM)
- install(
- FILES ${FN}
- DESTINATION ${MESHLAB_SHADER_INSTALL_DIR}
- COMPONENT Shaders)
- list(APPEND COPIED_FILES "${OUTFN}")
+ get_filename_component(NAME_ONLY ${FN} NAME)
+ set(OUTFN ${MESHLAB_SHADER_OUTPUT_DIR}/${NAME_ONLY})
+ add_custom_command(
+ OUTPUT ${OUTFN}
+ COMMAND ${CMAKE_COMMAND} -E make_directory "${MESHLAB_SHADER_OUTPUT_DIR}"
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different "${FN}" "${OUTFN}"
+ COMMENT "Copying ${NAME_ONLY} to shader build directory"
+ VERBATIM)
+ install(
+ FILES ${FN}
+ DESTINATION ${MESHLAB_SHADER_INSTALL_DIR}
+ COMPONENT Shaders)
+ list(APPEND COPIED_FILES "${OUTFN}")
endforeach()
# Custom target - to trigger the execution of the custom commands above.
@@ -326,26 +294,22 @@ add_custom_target(copy-distrib-files ALL DEPENDS ${COPIED_FILES})
set_property(TARGET copy-distrib-files PROPERTY FOLDER Core)
if(INSTALL_SAMPLE_MESHES)
- # Install sample files from distrib/sample directory (except for the rangemaps)
- install(
- DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../sample
- DESTINATION ${MESHLAB_SAMPLE_INSTALL_DIR}
- COMPONENT Samples
- PATTERN "*/rangemaps" EXCLUDE)
+ # Install sample files from distrib/sample directory (except for the rangemaps)
+ install(
+ DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../sample
+ DESTINATION ${MESHLAB_SAMPLE_INSTALL_DIR}
+ COMPONENT Samples
+ PATTERN "*/rangemaps" EXCLUDE)
endif()
if(INSTALL_SAMPLE_RANGEMAPS)
- # Install sample rangemaps
- install(
- DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../sample/rangemaps
- DESTINATION ${MESHLAB_SAMPLE_INSTALL_DIR}/sample
- COMPONENT Samples)
+ # Install sample rangemaps
+ install(
+ DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../sample/rangemaps
+ DESTINATION ${MESHLAB_SAMPLE_INSTALL_DIR}/sample
+ COMPONENT Samples)
endif()
if(NOT WIN32 AND NOT APPLE)
- install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../install/linux/resources/meshlab.desktop" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
- install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../install/meshlab.png" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps)
-endif()
-
-if(Qt5_windeployqt_EXECUTABLE AND BUILD_WITH_WINDEPLOYQT_POST_BUILD)
- install(CODE "execute_process(COMMAND \"${Qt5_windeployqt_EXECUTABLE}\" --no-translations meshlab.exe WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX})")
+ install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/Linux/resources/meshlab.desktop" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+ install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/meshlab.png" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps)
endif()
diff --git a/src/README.md b/src/README.md
index 7a76d51b9..e102808ef 100644
--- a/src/README.md
+++ b/src/README.md
@@ -1,76 +1,52 @@
# MeshLab Source Code structure
-In the `src` folder there are several folders containing all the source code and configuration files that allows to compile MeshLab.
+In the `src` directory there are several folders containing all the source code and configuration files that allows to build MeshLab.
-The source code of MeshLab is structured in the following folders:
+The source code of MeshLab is structured in the following directories:
- * [external](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/external): it contains a series of external libraries needed by several plugins. Some of these libraries are compiled before the compilation of meshlab, if a corresponding system library is not found and then linked; some other libraries are just included by some plugins.
- * [common](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/common): a series of utility functions used by MeshLab and its plugins.
+ * [external](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/external): it contains a series of external libraries needed by several plugins. Some of these libraries are compiled before the compilation of meshlab, if a corresponding system library is not found and then linked; other are header-only libraries that are just included.
+ * [common](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/common): a series of utility classes and functions used by MeshLab and its plugins.
* [meshlab](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/meshlab): GUI and core of MeshLab.
* [meshlabserver](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/meshlabserver): a tool that allows to compute mesh operations through command line
* [meshlabplugins](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/meshlabplugins): all the plugins that can be added to MeshLab.
-
+ * [use_cpu_opengl](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/use_cpu_opengl): a tool compiled only under windows that allows to use non-GPU accelerated OpenGL calls;
+ * [vcglib](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/vcglib): submodule containing the vcglib.
+
The following folders are used by `cmake`:
-
+
* cmake;
* templates.
-
-There are also two folders that contains MeshLab plugins that are no longer supported or are experimental, and these plugins are not compiled in any of MeshLab configurations:
-
- * plugins_experimental;
- * plugins_unsupported.
-
-## Compiling MeshLab
-MeshLab compiles with the three major compilers: `gcc`, `clang`, and `msvc`.
+## Build MeshLab
-MeshLab requires [Qt](https://www.qt.io/) >= 5.9, with `xmlpatterns` as additional package.
+MeshLab builds with the three major compilers: `gcc`, `clang`, and `msvc`. It requires [Qt](https://www.qt.io/) >= 5.12, with `xmlpatterns` as additional package.
After setting up the Qt environment:
git clone --recursive https://github.com/cnr-isti-vclab/meshlab
- cd meshlab/src
- qmake
- make
-
-Then, a meshlab executable can be found inside the `distrib` folder.
+ mkdir meshlab/src/build
+ cd meshlab/src/build
+ cmake ..
+ make
-You can also use `cmake`:
-
- git clone --recursive https://github.com/cnr-isti-vclab/meshlab
- cd meshlab
- cmake src/
- make
You can also use [QtCreator](https://www.qt.io/product) to build meshlab:
-1. Install QtCreator and Qt >= 5.9 with `xmlpatterns` as additional package;
-2. Open `meshlab.pro` inside `src`;
+1. Install QtCreator and Qt >= 5.12 with `xmlpatterns` as additional package;
+2. Open `CMakeLists.txt` inside `src`;
3. Select your favourite shadow build directory;
-4. Before the build, deactivate the `QtQuickCompiler` option from the qmake call in the project options;
-5. Build meshlab.
+4. Build meshlab.
-MeshLab has a plugin architecture and therefore all the plugins are compiled separately; some of them are harder to be compiled. Don't worry, if a plugin fails to compile just remove it and you lose just that functionality. As a first step you should try to compile MeshLab with the configuration "meshlab_mini":
-
- qmake "CONFIG+=meshlab_mini"
- make
-
-This configuration contains the info for building meshlab with a minimal set of plugins.
-
-Some plugins of MeshLab need external libraries. All the required libraries are included in the `meshlab/src/external` folder, that are automatically compiled before MeshLab in all its configurations.
+MeshLab has a plugin architecture and therefore all the plugins are compiled separately; some of them are harder to be compiled. Don't worry: if a plugin fails to compile, just remove it and you lose just that functionality.
### Platform specific notes
-On __osx__ some plugins exploit openmp parallelism (screened poisson, isoparametrization) so you need a compiler supporting it and the clang provided by xcode does not support openmp. Qmake is configured in order to look for the `clang` compiler that is automatically installed by `homebrew`, calling:
+On __osx__ some plugins exploit openmp parallelism (screened poisson, isoparametrization) so you need a compiler supporting it and the clang provided by xcode does not support openmp. You can install all the required libraries by running the following command in a terminal:
brew install llvm libomp
-On __Linux__, you may optionally choose to use your system installs of some libraries rather than the bundled versions.
-The library name, argument to add to all `qmake` calls (e.g. by adding to `QMAKE_FLAGS` in the example below), and Debian package name are listed below:
+On __Windows__, we suggest to build meshlab using QtCreator. Before trying to build, you should:
-* Eigen3 (at least 3.2) - `CONFIG+=system_eigen3` - package `libeigen3-dev`
-* GLEW (version 2 or newer) - `CONFIG+=system_glew` - package `libglew-dev`
-* lib3ds - `CONFIG+=system_lib3ds` - package `lib3ds-dev`
-* OpenCTM - `CONFIG+=system_openctm` - package `libopenctm-dev`
-* BZip2 - `CONFIG+=system_bzip2` - package `libbz2-dev`
+ * install VisualStudio >= 2017 with the C++ developement package;
+ * install Qt >= 5.12 and QtCreator.
-The versions found in Debian Buster are all new enough to meet these requirements.
+then, open the CMakeLists.txt file and try to build MeshLab.
\ No newline at end of file
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 1a8da3eea..3ad885a95 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -1,83 +1,76 @@
-# Copyright 2019-2020, Collabora, Ltd.
-# SPDX-License-Identifier: BSL-1.0
-
-### Generated file! Edit the templates in src/templates,
-### specifically src/templates/common.cmake (custom for this directory),
-### then re-run ./make-cmake.py
-
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../ML_VERSION")
- file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../../ML_VERSION" MESHLAB_VERSION)
- add_definitions(-DMESHLAB_VERSION=${MESHLAB_VERSION})
+ file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../../ML_VERSION" MESHLAB_VERSION)
+ add_definitions(-DMESHLAB_VERSION=${MESHLAB_VERSION})
endif()
set(SOURCES
- filter_parameter/rich_parameter.cpp
- filter_parameter/rich_parameter_list.cpp
- filter_parameter/value.cpp
- interfaces/decorate_plugin_interface.cpp
- interfaces/filter_plugin_interface.cpp
- interfaces/plugin_interface.cpp
- GLExtensionsManager.cpp
- GLLogStream.cpp
- filterscript.cpp
- meshlabdocumentbundler.cpp
- meshlabdocumentxml.cpp
- meshmodel.cpp
- ml_selection_buffers.cpp
- ml_shared_data_context.cpp
- ml_thread_safe_memory_info.cpp
- mlapplication.cpp
- pluginmanager.cpp
- searcher.cpp
- ${EXTERNAL_DIR}/easyexif/exif.cpp)
+ filter_parameter/rich_parameter.cpp
+ filter_parameter/rich_parameter_list.cpp
+ filter_parameter/value.cpp
+ interfaces/decorate_plugin_interface.cpp
+ interfaces/filter_plugin_interface.cpp
+ interfaces/plugin_interface.cpp
+ GLExtensionsManager.cpp
+ GLLogStream.cpp
+ filterscript.cpp
+ meshlabdocumentbundler.cpp
+ meshlabdocumentxml.cpp
+ meshmodel.cpp
+ ml_selection_buffers.cpp
+ ml_shared_data_context.cpp
+ ml_thread_safe_memory_info.cpp
+ mlapplication.cpp
+ pluginmanager.cpp
+ searcher.cpp
+ ${EXTERNAL_DIR}/easyexif/exif.cpp)
set(HEADERS
- filter_parameter/rich_parameter.h
- filter_parameter/rich_parameter_list.h
- filter_parameter/value.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
- GLExtensionsManager.h
- GLLogStream.h
- filterscript.h
- meshlabdocumentbundler.h
- meshlabdocumentxml.h
- meshmodel.h
- ml_mesh_type.h
- ml_selection_buffers.h
- ml_shared_data_context.h
- ml_thread_safe_memory_info.h
- mlapplication.h
- mlexception.h
- pluginmanager.h
- searcher.h)
-
-set(RESOURCES common.qrc)
+ filter_parameter/rich_parameter.h
+ filter_parameter/rich_parameter_list.h
+ filter_parameter/value.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
+ GLExtensionsManager.h
+ GLLogStream.h
+ filterscript.h
+ meshlabdocumentbundler.h
+ meshlabdocumentxml.h
+ meshmodel.h
+ ml_mesh_type.h
+ ml_selection_buffers.h
+ ml_shared_data_context.h
+ ml_thread_safe_memory_info.h
+ mlapplication.h
+ mlexception.h
+ pluginmanager.h
+ searcher.h)
set(TARGET_TYPE SHARED)
-if(WIN32)
- set(TARGET_TYPE STATIC)
+if(WIN32 OR APPLE)
+ set(TARGET_TYPE STATIC)
endif()
add_library(common ${TARGET_TYPE} ${SOURCES} ${HEADERS} ${RESOURCES})
set_target_properties(common PROPERTIES OUTPUT_NAME meshlab-common)
target_include_directories(common PRIVATE ${EXTERNAL_DIR}/easyexif/)
target_link_libraries(
- common
- PUBLIC Qt5::Core
- Qt5::OpenGL
- Qt5::Widgets
- Qt5::Xml
- Qt5::XmlPatterns
- external-glew)
+ common
+ PUBLIC
+ Qt5::Core
+ Qt5::OpenGL
+ Qt5::Widgets
+ Qt5::Xml
+ Qt5::XmlPatterns
+ external-glew
+)
set_property(TARGET common PROPERTY FOLDER Core)
if(NOT WIN32)
- install(TARGETS common DESTINATION ${MESHLAB_LIB_INSTALL_DIR})
+ install(TARGETS common DESTINATION ${MESHLAB_LIB_INSTALL_DIR})
endif()
diff --git a/src/common/common.qrc b/src/common/common.qrc
deleted file mode 100644
index 6b2cf4c60..000000000
--- a/src/common/common.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- script_system/meshlabfilterXMLspecificationformat.xsd
- script_system/math.js
-
-
\ No newline at end of file
diff --git a/src/common/pluginmanager.cpp b/src/common/pluginmanager.cpp
index 477e47256..884c466d8 100644
--- a/src/common/pluginmanager.cpp
+++ b/src/common/pluginmanager.cpp
@@ -7,38 +7,35 @@
#include "mlexception.h"
-
-
-static QString DLLExtension() {
+static QStringList fileNamePluginDLLs() {
+ QStringList l;
#if defined(Q_OS_WIN)
- return QString("dll");
+ l.push_back("*.dll");
+ return l;
#elif defined(Q_OS_MAC)
- return QString("dylib");
-#else
- return QString("so");
+ l.push_back("*.dylib");
+ l.push_back("*.so");
+ return l;
+#else //linux
+ l.push_back("*.so");
+ return l;
#endif
- assert(0 && "Unknown Operative System. Please Define the appropriate dynamic library extension");
- return QString();
}
-static QString DLLFileNamePreamble() {
+static QString fileNamePrefixPluginDLLs() {
#if defined(Q_OS_WIN)
- return QString("");
-#elif defined(Q_OS_MAC)
- return QString("lib");
-#else
- return QString("lib");
+ return QString("");
+#else //macos and linux
+ return QString("lib");
#endif
- assert(0 && "Unknown Operative System. Please Define the appropriate dynamic library preamble");
- return QString();
}
PluginManager::PluginManager()
{
- //pluginsDir=QDir(getPluginDirPath());
- // without adding the correct library path in the mac the loading of jpg (done via qt plugins) fails
- //qApp->addLibraryPath(getPluginDirPath());
- //qApp->addLibraryPath(getBaseDirPath());
+ //pluginsDir=QDir(getPluginDirPath());
+ // without adding the correct library path in the mac the loading of jpg (done via qt plugins) fails
+ //qApp->addLibraryPath(getPluginDirPath());
+ //qApp->addLibraryPath(getBaseDirPath());
}
PluginManager::~PluginManager()
@@ -50,7 +47,7 @@ PluginManager::~PluginManager()
for (PluginInterface* plugin : ownerPlug)
delete plugin;
ownerPlug.clear();
-
+
for (int ii = 0; ii < meshEditInterfacePlug.size(); ++ii)
delete meshEditInterfacePlug[ii];
meshEditInterfacePlug.clear();
@@ -69,13 +66,11 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl
// without adding the correct library path in the mac the loading of jpg (done via qt plugins) fails
qApp->addLibraryPath(getDefaultPluginDirPath());
qApp->addLibraryPath(getBaseDirPath());
- QStringList pluginfilters;
-
- pluginfilters << QString("*." + DLLExtension());
-
+ QStringList nameFiltersPlugins = fileNamePluginDLLs();
+
//only the file with extension pluginfilters will be listed by function entryList()
- pluginsDir.setNameFilters(pluginfilters);
-
+ pluginsDir.setNameFilters(nameFiltersPlugins);
+
qDebug("Current Plugins Dir is: %s ", qUtf8Printable(pluginsDir.absolutePath()));
for(QString fileName : pluginsDir.entryList(QDir::Files))
{
@@ -116,7 +111,7 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl
iCommon = iIO;
meshIOPlug.push_back(iIO);
}
-
+
DecoratePluginInterface *iDecorator = qobject_cast(plugin);
if (iDecorator)
{
@@ -128,14 +123,14 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl
iDecorator->initGlobalParameterList(decoratorAction, defaultGlobal);
}
}
-
+
RenderPluginInterface *iRender = qobject_cast(plugin);
if (iRender)
{
iCommon = iRender;
meshRenderPlug.push_back(iRender);
}
-
+
EditPluginInterfaceFactory *iEditFactory = qobject_cast(plugin);
if (iEditFactory)
{
@@ -164,13 +159,13 @@ int PluginManager::numberIOPlugins() const
// Search among all the decorator plugins the one that contains a decoration with the given name
DecoratePluginInterface *PluginManager::getDecoratorInterfaceByName(const QString& name)
{
- foreach(DecoratePluginInterface *tt, this->meshDecoratePlugins())
- {
- foreach( QAction *ac, tt->actions())
- if( name == tt->decorationName(ac) ) return tt;
- }
- assert(0);
- return 0;
+ foreach(DecoratePluginInterface *tt, this->meshDecoratePlugins())
+ {
+ foreach( QAction *ac, tt->actions())
+ if( name == tt->decorationName(ac) ) return tt;
+ }
+ assert(0);
+ return 0;
}
/*
@@ -188,7 +183,7 @@ QMap PluginManager::generateFilterParameterMap()
for (ai = this->actionFilterMap.begin(); ai != this->actionFilterMap.end(); ++ai)
{
QString filterName = ai.key();// ->filterName();
- //QAction act(filterName,NULL);
+ //QAction act(filterName,NULL);
RichParameterList rp;
stringFilterMap[filterName]->initParameterList(ai.value(), md, rp);
FPM[filterName] = rp;
@@ -196,31 +191,26 @@ QMap PluginManager::generateFilterParameterMap()
return FPM;
}
-QString PluginManager::osDependentFileBaseName(const QString &plname)
-{
- return (DLLFileNamePreamble() + plname + "." + DLLExtension());
-}
-
QString PluginManager::getBaseDirPath()
{
QDir baseDir(qApp->applicationDirPath());
-
+
#if defined(Q_OS_WIN)
// Windows:
// during development with visual studio binary could be in the debug/release subdir.
// once deployed plugins dir is in the application directory, so
if (baseDir.dirName() == "debug" || baseDir.dirName() == "release") baseDir.cdUp();
#endif
-
+
#if defined(Q_OS_MAC)
- // Mac: during developmentwith xcode and well deployed the binary is well buried.
- for(int i=0;i<6;++i){
- if(baseDir.exists("plugins")) break;
- baseDir.cdUp();
- }
- qDebug("The base dir is %s", qUtf8Printable(baseDir.absolutePath()));
+ // Mac: during developmentwith xcode and well deployed the binary is well buried.
+ for(int i=0;i<6;++i){
+ if(baseDir.exists("plugins")) break;
+ baseDir.cdUp();
+ }
+ qDebug("The base dir is %s", qUtf8Printable(baseDir.absolutePath()));
#endif
- return baseDir.absolutePath();
+ return baseDir.absolutePath();
}
QString PluginManager::getDefaultPluginDirPath()
@@ -230,7 +220,7 @@ QString PluginManager::getDefaultPluginDirPath()
QString d = pluginsDir.dirName();
QString dLower = d.toLower();
if (dLower == "release" || dLower == "relwithdebinfo" || dLower == "debug" ||
- dLower == "minsizerel") {
+ dLower == "minsizerel") {
// This is a configuration directory for MS Visual Studio.
pluginsDir.cdUp();
} else {
@@ -239,18 +229,18 @@ QString PluginManager::getDefaultPluginDirPath()
#endif
if (pluginsDir.exists("plugins")) {
pluginsDir.cd("plugins");
-
+
#if defined(Q_OS_WIN)
// Re-apply the configuration dir, if any.
if (!d.isEmpty() && pluginsDir.exists(d)) {
pluginsDir.cd(d);
}
#endif
-
+
return pluginsDir.absolutePath();
}
#if !defined(Q_OS_MAC) && !defined(Q_OS_WIN)
- else if (pluginsDir.dirName() == "bin") {
+ else if (pluginsDir.dirName() == "bin") {
pluginsDir.cdUp();
pluginsDir.cd("lib");
pluginsDir.cd("meshlab");
@@ -293,9 +283,9 @@ void PluginManager::knownIOFormats()
for (QList::iterator itf = format.begin(); itf != format.end(); ++itf)
{
IOPluginInterface::Format currentFormat = *itf;
-
+
QString currentFilterEntry = currentFormat.description + " (";
-
+
//a particular file format could be associated with more than one file extension
QStringListIterator itExtension(currentFormat.extensions);
while (itExtension.hasNext())
@@ -313,7 +303,7 @@ void PluginManager::knownIOFormats()
currentFilterEntry.append(')');
formatFilters->append(currentFilterEntry);
}
-
+
}
allKnownFormatsFilter.append(')');
if (formatFilters != NULL)
@@ -325,7 +315,7 @@ QString PluginManager::osIndependentPluginName(const QString& plname)
{
QFileInfo fi(plname);
QString res = fi.baseName();
- QString pref = DLLFileNamePreamble();
+ QString pref = fileNamePrefixPluginDLLs();
return res.remove(0, pref.size());
}
diff --git a/src/common/pluginmanager.h b/src/common/pluginmanager.h
index f10982470..fc5fb60bc 100644
--- a/src/common/pluginmanager.h
+++ b/src/common/pluginmanager.h
@@ -82,7 +82,6 @@ public:
QStringList pluginsLoaded;
- static QString osDependentFileBaseName(const QString& plname);
static QString osIndependentPluginName(const QString& plname);
private:
diff --git a/src/common/script_system/math.js b/src/common/script_system/math.js
deleted file mode 100644
index 478bb5a73..000000000
--- a/src/common/script_system/math.js
+++ /dev/null
@@ -1,4323 +0,0 @@
-
-/**
- * @fileOverview Math
- */
-
-/**
- * The SpiderGL.Math namespace.
- *
- * @namespace The SpiderGL.Math namespace.
- */
-SpiderGL = {};
-SpiderGL.Math = { };
-
-// constants
-/*---------------------------------------------------------*/
-
-/**
- * Scale factor for degrees to radians conversion.
- * It is equal to PI / 180.
- *
- * @constant
- *
- * @type number
- */
-SpiderGL.Math.DEG_TO_RAD = (Math.PI / 180.0);
-
-/**
- * Alias for Math.E.
- *
- * @constant
- *
- * @type number
- */
-SpiderGL.Math.E = Math.E;
-
-/**
- * Alias for Math.LN2.
- *
- * @constant
- *
- * @type number
- */
-SpiderGL.Math.LN2 = Math.LN2;
-
-/**
- * Alias for Math.LN10.
- *
- * @constant
- *
- * @type number
- */
-SpiderGL.Math.LN10 = Math.LN10;
-
-/**
- * Alias for Math.LOG2E.
- *
- * @constant
- *
- * @type number
- */
-SpiderGL.Math.LOG2E = Math.LOG2E;
-
-/**
- * Alias for Math.LOG10E.
- *
- * @constant
- *
- * @type number
- */
-SpiderGL.Math.LOG10E = Math.LOG10E;
-
-/**
- * Alias for Math.PI.
- *
- * @constant
- *
- * @type number
- */
-SpiderGL.Math.PI = Math.PI;
-
-/**
- * Scale factor for radians to degrees conversion.
- * It is equal to 180 / PI.
- *
- * @constant
- *
- * @type number
- */
-SpiderGL.Math.RAD_TO_DEG = (180.0 / Math.PI);
-
-/**
- * Alias for Math.SQRT2.
- *
- * @constant
- *
- * @type number
- */
-SpiderGL.Math.SQRT2 = Math.SQRT2;
-
-
-/**
- * Alias for Number.MAX_VALUE.
- *
- * @constant
- *
- * @type number
- */
-SpiderGL.Math.MAX_VALUE = Number.MAX_VALUE;
-
-/**
- * Alias for Number.MIN_VALUE.
- *
- * @constant
- *
- * @type number
- */
-SpiderGL.Math.MIN_VALUE = Number.MIN_VALUE;
-
-/**
- * Alias for SpiderGL.Math.MAX_VALUE.
- *
- * @constant
- *
- * @type number
- */
-SpiderGL.Math.MAX_NUMBER = SpiderGL.Math.MAX_VALUE;
-
-/**
- * Alias for -SpiderGL.Math.MAX_VALUE.
- *
- * @constant
- *
- * @type number
- */
-SpiderGL.Math.MIN_NUMBER = -SpiderGL.Math.MAX_VALUE;
-
-/**
- * Alias for Number.NaN.
- *
- * @constant
- *
- * @type number
- */
-SpiderGL.Math.NAN = Number.NaN;
-
-/**
- * Alias for global Infinity.
- *
- * @constant
- *
- * @type number
- */
-SpiderGL.Math.INFINITY = Infinity;
-
-/*---------------------------------------------------------*/
-
-
-
-// functions on scalars
-/*---------------------------------------------------------*/
-
-/**
- * Alias for Math.abs.
- *
- * @param {number} x A number.
- *
- * @returns {number} The absolute value of x.
- */
-SpiderGL.Math.abs = function (x) {
- return Math.abs(x);
-}
-
-/**
- * Alias for Math.acos.
- *
- * @param {number} x The input cosine.
- *
- * @returns {number} The arccosine of x, in radians.
- */
-SpiderGL.Math.acos = function (x) {
- return Math.acos(x);
-}
-
-/**
- * Alias for Math.asin.
- *
- * @param {number} x The input sine.
- *
- * @returns {number} The arcsine of x, in radians.
- */
-SpiderGL.Math.asin = function (x) {
- return Math.asin(x);
-}
-
-/**
- * Alias for Math.atan2.
- *
- * @param {number} x The input number.
- *
- * @returns {number} The arctangent of x as a numeric value between -PI/2 and PI/2 radians.
- */
-SpiderGL.Math.atan = function (x) {
- return Math.atan(x);
-}
-
-/**
- * Alias for Math.atan2.
- *
- * @param {number} y A number.
- * @param {number} x A number.
- *
- * @returns {number} The the arctangent of the quotient of its arguments as a numeric value between PI and -PI.
- */
-SpiderGL.Math.atan2 = function (y, x) {
- return Math.atan2(y, x);
-}
-
-/**
- * Alias for Math.ceil.
- *
- * @param {number} x The input number.
- *
- * @returns {number} x rounded upwards to the nearest integer.
- */
-SpiderGL.Math.ceil = function (x) {
- return Math.ceil(x);
-}
-
-/**
- * Clamps a number over a range.
- *
- * @param {number} x The number to clamp.
- * @param {number} min The lower bound.
- * @param {number} max The upper bound.
- *
- * @returns {number} min if x < min, max if x > max, x otherwise.
- */
-SpiderGL.Math.clamp = function (x, min, max) {
- return ((x <= min) ? (min) : ((x >= max) ? (max) : (x)));
-}
-
-/**
- * Alias for Math.cos.
- *
- * @param {number} x The input angle, in radians.
- *
- * @returns {number} The cosine of x.
- */
-SpiderGL.Math.cos = function (x) {
- return Math.cos(x);
-}
-
-/**
- * Converts degrees to radians.
- *
- * @param {number} x The input angle, in degrees.
- *
- * @returns {number} x in radians.
- */
-SpiderGL.Math.degToRad = function (x) {
- return (x * SpiderGL.Math.DEG_TO_RAD);
-}
-
-/**
- * Alias for Math.exp.
- *
- * @param {number} x The input number.
- *
- * @returns {number} E raised to x.
- */
-SpiderGL.Math.exp = function (x) {
- return Math.exp(x);
-}
-
-/**
- * Alias for Math.floor.
- *
- * @param {number} x The input number.
- *
- * @returns {number} x rounded downwards to the nearest integer.
- */
-SpiderGL.Math.floor = function (x) {
- return Math.floor(x);
-}
-
-/**
- * Linear interpolation between two numbers.
- *
- * @param {number} x The start interpolation bound.
- * @param {number} y The stop interpolation bound.
- * @param {number} t The interpolation factor, between 0 and 1..
- *
- * @returns {number} The interpolated value (1-t)*x + t*y.
- */
-SpiderGL.Math.lerp = function (x, y, t) {
- return x + t * (y - x);
-}
-
-/**
- * Alias for Math.log.
- * Same as {@link SpiderGL.Math.log}.
- *
- * @param {number} x The input number.
- *
- * @returns {number} The natural logarithm (base E) of x.
- */
-SpiderGL.Math.ln = function (x) {
- return Math.log(x);
-}
-
-/**
- * Alias for Math.log.
- *
- * @param {number} x The input number.
- *
- * @returns {number} The natural logarithm (base E) of x.
- */
-SpiderGL.Math.log = function (x) {
- return Math.log(x);
-}
-
-/**
- * Logarithm base 2.
- *
- * @param {number} x The input number.
- *
- * @returns {number} The base 2 logarithm of x.
- */
-SpiderGL.Math.log2 = function (x) {
- return (SpiderGL.Math.log(x) / SpiderGL.Math.LN2);
-}
-
-/**
- * Logarithm base 10.
- *
- * @param {number} x The input number.
- *
- * @returns {number} The base 10 logarithm of x.
- */
-SpiderGL.Math.log10 = function (x) {
- return (SpiderGL.Math.log(x) / SpiderGL.Math.LN10);
-}
-
-/**
- * Alias for Math.max.
- *
- * @param {number} args Variable number of arguments
- *
- * @returns {number} The number with the highest value.
- *
- * @example
- * var x = SpiderGL.Math.max(3, 1.56, 2.1); // x == 3
- */
-SpiderGL.Math.max = function (args) {
- return Math.max.apply(Math, arguments);
-}
-
-/**
- * Alias for Math.min.
- *
- * @param {number} args Variable number of arguments
- *
- * @returns {number} The number with the lowest value.
- *
- * @example
- * var x = SpiderGL.Math.min(3, 1.56, 2.1); // x == 1.56
- */
-SpiderGL.Math.min = function (args) {
- return Math.min.apply(Math, arguments);
-}
-
-/**
- * Alias for Math.pow.
- *
- * @param {number} x The base number.
- * @param {number} x The exponent number.
- *
- * @returns {number} The value of x to the power of y.
- */
-SpiderGL.Math.pow = function (x, y) {
- return Math.pow(x, y);
-}
-
-/**
- * Converts radians to degrees.
- *
- * @param {number} x The input angle, in radians.
- *
- * @returns {number} x in degrees.
- */
-SpiderGL.Math.radToDeg = function (x) {
- return (x * SpiderGL.Math.RAD_TO_DEG);
-}
-
-/**
- * Alias for Math.random.
- *
- * @returns {number} A random number between 0.0 and 1.0, inclusive.
- */
-SpiderGL.Math.random = function () {
- return Math.random();
-}
-
-/**
- * Alias for SpiderGL.Math.random.
- *
- * @returns {number} A random number between 0.0 and 1.0, inclusive.
- */
-SpiderGL.Math.random01 = function () {
- return SpiderGL.Math.random();
-}
-
-/**
- * Generates a random number between -1.0 and 1.0.
- *
- * @returns {number} A random number between -1.0 and 1.0, inclusive.
- */
-SpiderGL.Math.random11 = function () {
- return (SpiderGL.Math.random() * 2 - 1);
-}
-
-/**
- * Generates a random number between a and b.
- *
- * @param {number} min The range low end-point.
- * @param {number} max The range high end-point.
- *
- * @returns {number} A random number between min and max, inclusive.
- */
-SpiderGL.Math.randomRange = function (min, max) {
- return (min + SpiderGL.Math.random() * (max - min));
-}
-
-/**
- * Alias for Math.round.
- *
- * @param {number} x The input number.
- *
- * @returns {number} x rounded to the nearest integer.
- *
- * @example
- * var a = SpiderGL.Math.round( 3); // a == 3
- * var b = SpiderGL.Math.round( -4); // b == -4
- * var c = SpiderGL.Math.round( 7.21); // c == 7
- * var d = SpiderGL.Math.round( 7.56); // d == 8
- * var e = SpiderGL.Math.round(-7.56); // e == -8
- * var f = SpiderGL.Math.round(-7.21); // f == -7
- */
-SpiderGL.Math.round = function (x) {
- return Math.sqrt(x);
-}
-
-/**
- * Alias for Math.sin.
- *
- * @param {number} x The input angle, in radians.
- *
- * @returns {number} The sine of x.
- */
-SpiderGL.Math.sin = function (x) {
- return Math.sin(x);
-}
-
-/**
- * Alias for Math.sqrt.
- *
- * @param {number} x The input number.
- *
- * @returns {number} The square root of x.
- */
-SpiderGL.Math.sqrt = function (x) {
- return Math.sqrt(x);
-}
-
-/**
- * Alias for Math.tan.
- *
- * @param {number} x The input angle, in radians.
- *
- * @returns {number} The tangent of x.
- */
-SpiderGL.Math.tan = function (x) {
- return Math.tan(x);
-}
-
-/*---------------------------------------------------------*/
-
-
-
-// 2-dimensional vector
-/*---------------------------------------------------------*/
-
-/**
- * The SpiderGL.Math.Vec2 namespace.
- * The provided functions operate on 2-dimensional vectors, represented as standard JavaScript arrays of length 2.
- * In general, vectors are considered as column vectors.
- *
- * @namespace The SpiderGL.Math.Vec2 namespace defines operations on 2-dimensional vectors.
- */
-SpiderGL.Math.Vec2 = { };
-
-/**
- * Duplicates the input 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = v[i] (same as v.slice(0, 2)).
- */
-SpiderGL.Math.Vec2.dup = function (v) {
- return v.slice(0, 2);
-}
-
-/**
- * Creates a 2-dimensional vector initialized with a scalar.
- *
- * @param {number} s The input scalar.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = s.
- */
-SpiderGL.Math.Vec2.scalar = function (s) {
- return [s, s];
-}
-
-/**
- * Creates a 2-dimensional vector initialized with zero.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = 0.
- */
-SpiderGL.Math.Vec2.zero = function () {
- return [0, 0];
-}
-
-/**
- * Creates a 2-dimensional vector initialized with one.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = 1.0.
- */
-SpiderGL.Math.Vec2.one = function () {
- return [1, 1];
-}
-
-/**
- * Creates a 2-dimensional vector initialized with SpiderGL.Math.MAX_NUMBER.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = SpiderGL.Math.MAX_NUMBER.
- */
-SpiderGL.Math.Vec2.maxNumber = function () {
- return [SpiderGL.Math.MAX_NUMBER, SpiderGL.Math.MAX_NUMBER];
-}
-
-/**
- * Creates a 2-dimensional vector initialized with SpiderGL.Math.MIN_NUMBER.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = SpiderGL.Math.MIN_NUMBER.
- */
-SpiderGL.Math.Vec2.minNumber = function () {
- return [SpiderGL.Math.MIN_NUMBER, SpiderGL.Math.MIN_NUMBER];
-}
-
-/**
- * Creates a 3-dimensional vector from a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- * @param {number} [z=0.0] The 3th component.
- *
- * @returns {array} A 4-dimensional vector r equal to v extended with z as 3rd component.
- */
-SpiderGL.Math.Vec2.to3 = function (v, z) {
- return [v[0], v[1], (z != undefined) ? z : 0];
-}
-
-/**
- * Creates a 4-dimensional vector from a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- * @param {number} [z=0.0] The 3th component.
- * @param {number} [w=1.0] The 4th component.
- *
- * @returns {array} A 4-dimensional vector r equal to v extended with z as 3rd component and w as 4th component.
- */
-SpiderGL.Math.Vec2.to4 = function (v, z, w) {
- return [v[0], v[1], v[2], (z != undefined) ? z : 0, (w != undefined) ? w : 1];
-}
-
-/**
- * Component-wise negation of a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensionals vector r, where r[i] = -v[i].
- */
-SpiderGL.Math.Vec2.neg = function (v) {
- return [-v[0], -v[1]];
-}
-
-/**
- * Component-wise addition of two 2-dimensional vectors.
- *
- * @param {array} u The first addition operand.
- * @param {array} v The second addition operand.
- *
- * @returns {array} A 2-dimensionals vector r, where r[i] = u[i] + v[i].
- */
-SpiderGL.Math.Vec2.add = function (u, v) {
- return [u[0]+v[0], u[1]+v[1]];
-}
-
-/**
- * Component-wise addition of a 2-dimensional vector and a scalar.
- *
- * @param {array} v The vector addition operand.
- * @param {number} s The scalar addition operand.
- *
- * @returns {array} A 2-dimensionals vector r, where r[i] = v[i] + s.
- */
-SpiderGL.Math.Vec2.adds = function (v, s) {
- return [v[0]+s, v[1]+s];
-}
-
-/**
- * Component-wise subtraction of two 2-dimensional vectors.
- *
- * @param {array} u The first subtraction operand.
- * @param {array} v The second subtraction operand.
- *
- * @returns {array} A 2-dimensionals vector r, where r[i] = u[i] - v[i].
- */
-SpiderGL.Math.Vec2.sub = function (u, v) {
- return [u[0]-v[0], u[1]-v[1]];
-}
-
-/**
- * Component-wise subtraction of a 2-dimensional vector and a scalar.
- *
- * @param {array} v The vector subtraction operand.
- * @param {number} s The scalar subtraction operand.
- *
- * @returns {array} A 2-dimensionals vector r, where r[i] = v[i] - s.
- */
-SpiderGL.Math.Vec2.subs = function (v, s) {
- return [v[0]-s, v[1]-s];
-}
-
-/**
- * Component-wise subtraction of a scalar and a 2-dimensional.
- *
- * @param {number} s The scalar subtraction operand.
- * @param {array} v The vector subtraction operand.
- *
- * @returns {array} A 2-dimensionals vector r, where r[i] = s - v[i].
- */
-SpiderGL.Math.Vec2.ssub = function (s, v) {
- return [s-v[0], s-v[1]];
-}
-
-/**
- * Component-wise multiplication of two 2-dimensional vectors.
- *
- * @param {array} u The first multiplication operand.
- * @param {array} v The second multiplication operand.
- *
- * @returns {array} A 2-dimensionals vector r, where r[i] = u[i] * v[i].
- */
-SpiderGL.Math.Vec2.mul = function (u, v) {
- return [u[0]*v[0], u[1]*v[1]];
-}
-
-/**
- * Component-wise multiplication of a 2-dimensional vector and a scalar.
- *
- * @param {array} v The vector multiplication operand.
- * @param {number} s The scalar multiplication operand.
- *
- * @returns {array} A 2-dimensionals vector r, where r[i] = v[i] * s.
- */
-SpiderGL.Math.Vec2.muls = function (v, s) {
- return [v[0]*s, v[1]*s];
-}
-
-/**
- * Component-wise division of two 2-dimensional vectors.
- *
- * @param {array} u The numerator vector.
- * @param {array} v The denominator vector.
- *
- * @returns {array} A 2-dimensionals vector r, where r[i] = u[i] / v[i].
- */
-SpiderGL.Math.Vec2.div = function (u, v) {
- return [u[0]/v[0], u[1]/v[1]];
-}
-
-/**
- * Component-wise division of a 2-dimensional vector by a scalar.
- *
- * @param {array} v The numerator vector.
- * @param {number} s The scalar denominator.
- *
- * @returns {array} A 2-dimensionals vector r, where r[i] = v[i] / s.
- */
-SpiderGL.Math.Vec2.divs = function (v, s) {
- return [v[0]/s, v[1]/s];
-}
-
-/**
- * Component-wise division of a scalar by a 2-dimensional vector.
- *
- * @param {number} s The denominator scalar.
- * @param {array} v The numerator vector.
- *
- * @returns {array} A 2-dimensionals vector r, where r[i] = s / v[i].
- */
-SpiderGL.Math.Vec2.sdiv = function (s, v) {
- return [s/v[0], s/v[1]];
-}
-
-/**
- * Component-wise reciprocal of a 2-dimensional vector.
- *
- * @param {array} v The input (denominator) vector.
- *
- * @returns {array} A 2-dimensionals vector r, where r[i] = 1.0 / v[i].
- */
-SpiderGL.Math.Vec2.rcp = function (v) {
- return [1.0/v[0], 1.0/v[1]];
-}
-
-/**
- * Dot product of two 2-dimensional vectors.
- *
- * @param {array} u The first vector operand.
- * @param {array} v The second vector operand.
- *
- * @returns {number} The dot product of u and v.
- */
-SpiderGL.Math.Vec2.dot = function (u, v) {
- return (u[0]*v[0] + u[1]*v[1]);
-}
-
-/**
- * Cross product of two 2-dimensional vectors.
- *
- * @param {array} u The first vector operand.
- * @param {array} v The second vector operand.
- *
- * @returns {array} A 2-dimensional vector equal to the cross product of u and v.
- */
-SpiderGL.Math.Vec2.cross = function (u, v) {
- return (u[0]*v[1] - u[1]*v[0]);
-}
-
-/**
- * Perp operation.
- * Returns a 2-dimensional vector which is orthogonal to the input vector and lies in the right halfspace.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r, where r = [v[1], -v[0]].
- */
-SpiderGL.Math.Vec2.perp = function (v) {
- return [v[1], -v[0]];
-}
-
-/**
- * Squared length of a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {number} The squared length of v, same as the dot product of v with itself.
- */
-SpiderGL.Math.Vec2.sqLength = function (v) {
- return SpiderGL.Math.Vec2.dot(v, v);
-}
-
-/**
- * Length of a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {number} The length of v.
- */
-SpiderGL.Math.Vec2.length = function (v) {
- return SpiderGL.Math.sqrt(SpiderGL.Math.Vec2.sqLength(v));
-}
-
-/**
- * Creates a normalized 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r representing the normalized v, where r[i] = v[i] / {@link SpiderGL.Math.Vec2.length}(v).
- */
-SpiderGL.Math.Vec2.normalize = function (v) {
- var f = 1.0 / SpiderGL.Math.Vec2.length(v);
- return SpiderGL.Math.Vec2.muls(v, f);
-}
-
-/**
- * Component-wise absolute value of a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.abs}(v[i]).
- */
-SpiderGL.Math.Vec2.abs = function (v) {
- return [SpiderGL.Math.abs(v[0]), SpiderGL.Math.abs(v[1])];
-}
-
-/**
- * Component-wise arccosine of a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.acos}(v[i]), in radians.
- */
-SpiderGL.Math.Vec2.acos = function (v) {
- return [SpiderGL.Math.acos(v[0]), SpiderGL.Math.acos(v[1])];
-}
-
-/**
- * Component-wise arcsine of a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.asin}(v[i]), in radians.
- */
-SpiderGL.Math.Vec2.asin = function (v) {
- return [SpiderGL.Math.asin(v[0]), SpiderGL.Math.asin(v[1])];
-}
-
-/**
- * Component-wise arctangent of a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.atan}(v[i]), between -PI/2 and PI/2 radians.
- */
-SpiderGL.Math.Vec2.atan = function (v) {
- return [SpiderGL.Math.atan(v[0]), SpiderGL.Math.atan(v[1])];
-}
-
-/**
- * Component-wise arctangent of the quotient of two 2-dimensional vectors.
- *
- * @param {array} y The numerator vector.
- * @param {array} x The denominator vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.atan2}(y[i], x[i]), between PI and -PI radians.
- */
-SpiderGL.Math.Vec2.atan2 = function (y, x) {
- return [SpiderGL.Math.atan2(y[0], x[0]), SpiderGL.Math.atan2(y[1], x[1])];
-}
-
-/**
- * Component-wise ceil of a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.ceil}(v[i]).
- */
-SpiderGL.Math.Vec2.ceil = function (v) {
- return [SpiderGL.Math.ceil(v[0]), SpiderGL.Math.ceil(v[1])];
-}
-
-/**
- * Component-wise clamp of a 2-dimensional vector with vector bounds.
- *
- * @param {array} v The input vector.
- * @param {array} min The lower 2-dimensional bound.
- * @param {array} max The upper 2-dimensional bound.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.clamp}(v[i], min[i], max[i]).
- */
-SpiderGL.Math.Vec2.clamp = function (v, min, max) {
- return [SpiderGL.Math.clamp(v[0], min[0], max[0]), SpiderGL.Math.clamp(v[1], min[1], max[1])];
-}
-
-/**
- * Component-wise cosine of a 2-dimensional vector.
- *
- * @param {array} v The input vector, in radians.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.cos}(v[i]).
- */
-SpiderGL.Math.Vec2.cos = function (v) {
- return [SpiderGL.Math.cos(v[0]), SpiderGL.Math.cos(v[1])];
-}
-
-/**
- * Component-wise conversion of a 2-dimensional vector from degrees to radians.
- *
- * @param {array} v The input vector, in radians.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.degToRad}(v[i]).
- */
-SpiderGL.Math.Vec2.degToRad = function (v) {
- return [SpiderGL.Math.degToRad(v[0]), SpiderGL.Math.degToRad(v[1])];
-}
-
-/**
- * Component-wise exponential of a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.exp}(v[i]).
- */
-SpiderGL.Math.Vec2.exp = function (v) {
- return [SpiderGL.Math.exp(v[0]), SpiderGL.Math.exp(v[1])];
-}
-
-/**
- * Component-wise floor of a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.floor}(v[i]).
- */
-SpiderGL.Math.Vec2.floor = function (v) {
- return [SpiderGL.Math.floor(v[0]), SpiderGL.Math.floor(v[1])];
-}
-
-/**
- * Linear interpolation between two 2-dimensional vectors.
- *
- * @param {array} u The start interpolation bound.
- * @param {array} v The stop interpolation bound.
- * @param {number} t The interpolation factor, between 0 and 1.
- *
- * @returns {array} The interpolated vector r, where r[i] = (1-t)*u[i] + t*v[i].
- */
-SpiderGL.Math.Vec2.lerp = function (u, v, t) {
- return [
- SpiderGL.Math.lerp(u[0], v[0], t),
- SpiderGL.Math.lerp(u[1], v[1], t)
- ];
-}
-
-/**
- * Component-wise natural (base E) logarithm of a 2-dimensional vector.
- * Same as {@link SpiderGL.Math.Vec2.log}.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.ln}(v[i]).
- */
-SpiderGL.Math.Vec2.ln = function (v) {
- return [SpiderGL.Math.ln(v[0]), SpiderGL.Math.ln(v[1])];
-}
-
-/**
- * Component-wise natural (base E) logarithm of a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.log}(v[i]).
- */
-SpiderGL.Math.Vec2.log = function (v) {
- return [SpiderGL.Math.log(v[0]), SpiderGL.Math.log(v[1])];
-}
-
-/**
- * Component-wise base 2 logarithm of a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.log2}(v[i]).
- */
-SpiderGL.Math.Vec2.log2 = function (v) {
- return [SpiderGL.Math.log2(v[0]), SpiderGL.Math.log2(v[1])];
-}
-
-/**
- * Component-wise base 10 logarithm of a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.log10}(v[i]).
- */
-SpiderGL.Math.Vec2.log10 = function (v) {
- return [SpiderGL.Math.log10(v[0]), SpiderGL.Math.log10(v[1])];
-}
-
-/**
- * Component-wise maximum of two 2-dimensional vectors.
- *
- * @param {array} u The first vector.
- * @param {array} v The second vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.max}(u[i], v[i]).
- */
-SpiderGL.Math.Vec2.max = function (u, v) {
- return [SpiderGL.Math.max(u[0], v[0]), SpiderGL.Math.max(u[1], v[1])];
-}
-
-/**
- * Component-wise minimum of two 2-dimensional vectors.
- *
- * @param {array} u The first vector.
- * @param {array} v The second vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.min}(u[i], v[i]).
- */
-SpiderGL.Math.Vec2.min = function (u, v) {
- return [SpiderGL.Math.min(u[0], v[0]), SpiderGL.Math.min(u[1], v[1])];
-}
-
-/**
- * Component-wise power of two 2-dimensional vectors.
- *
- * @param {array} u The base vector.
- * @param {array} v The exponent vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.pow}(u[i], v[i]).
- */
-SpiderGL.Math.Vec2.pow = function (u, v) {
- return [SpiderGL.Math.pow(u[0], v[0]), SpiderGL.Math.pow(u[1], v[1])];
-}
-
-/**
- * Component-wise conversion of a 2-dimensional vector from radians to degrees.
- *
- * @param {array} v The input vector, in degrees.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.pow}(v[i]).
- */
-SpiderGL.Math.Vec2.radToDeg = function (v) {
- return [SpiderGL.Math.radToDeg(v[0]), SpiderGL.Math.radToDeg(v[1])];
-}
-
-/**
- * Creates a random 2-dimensional vector between 0 and 1.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.random}().
- */
-SpiderGL.Math.Vec2.random = function () {
- return [SpiderGL.Math.random(), SpiderGL.Math.random()];
-}
-
-/**
- * Creates a random 2-dimensional vector between 0 and 1.
- * Same as {@link SpiderGL.Math.Vec2.random}.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.random01}().
- */
-SpiderGL.Math.Vec2.random01 = function () {
- return [SpiderGL.Math.random01(), SpiderGL.Math.random01()];
-}
-
-/**
- * Creates a random 2-dimensional vector between -1 and 1.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.random11}().
- */
-SpiderGL.Math.Vec2.random11 = function () {
- return [SpiderGL.Math.random11(), SpiderGL.Math.random11()];
-}
-
-/**
- * Creates a random 2-dimensional vector inside a range.
- *
- * @param {array} min The range vector lower bound.
- * @param {array} max The range vector upper bound.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.randomRange}(min[i], max[i]).
- */
-SpiderGL.Math.Vec2.randomRange = function (min, max) {
- return [SpiderGL.Math.randomRange(min[0], max[0]), SpiderGL.Math.randomRange(min[1], max[1])];
-}
-
-/**
- * Component-wise round of a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.round}(v[i]).
- */
-SpiderGL.Math.Vec2.round = function (v) {
- return [SpiderGL.Math.round(v[0]), SpiderGL.Math.round(v[1])];
-}
-
-/**
- * Component-wise sine of a 2-dimensional vector.
- *
- * @param {array} v The input vector, in radians.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.sin}(v[i]).
- */
-SpiderGL.Math.Vec2.sin = function (v) {
- return [SpiderGL.Math.sin(v[0]), SpiderGL.Math.sin(v[1])];
-}
-
-/**
- * Component-wise square root of a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.sqrt}(v[i]).
- */
-SpiderGL.Math.Vec2.sqrt = function (v) {
- return [SpiderGL.Math.sqrt(v[0]), SpiderGL.Math.sqrt(v[1])];
-}
-
-/**
- * Component-wise tangent root of a 2-dimensional vector.
- *
- * @param {array} v The input vector, in radians.
- *
- * @returns {array} A 2-dimensional vector r, where r[i] = {@link SpiderGL.Math.tan}(v[i]).
- */
-SpiderGL.Math.Vec2.tan = function (v) {
- return [SpiderGL.Math.tan(v[0]), SpiderGL.Math.tan(v[1])];
-}
-
-/**
- * In-place component-wise copy of two 2-dimensional vectors.
- *
- * @param {array} u The destination vector.
- * @param {array} v The source vector.
- *
- * @returns {array} The destination vector u, where u[i] = v[i].
- */
-SpiderGL.Math.Vec2.copy$ = function (u, v) {
- u[0] = v[0];
- u[1] = v[1];
- return u;
-}
-
-/**
- * In-place component-wise negation of a 2-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} The input vector v, where v[i] = -v[i].
- */
-SpiderGL.Math.Vec2.neg$ = function (v) {
- v[0] = -v[0];
- v[1] = -v[1];
- return v;
-}
-
-/**
- * In-place component-wise addition of two 2-dimensional vectors.
- *
- * @param {array} u The first addition operand.
- * @param {array} v The second addition operand
- *
- * @returns {array} The input vector u, where u[i] = u[i] + v[i].
- */
-SpiderGL.Math.Vec2.add$ = function (u, v) {
- u[0] += v[0];
- u[1] += v[1];
- return u;
-}
-
-/**
- * In-place component-wise addition of a 2-dimensional vector and a scalar.
- *
- * @param {array} v The vector addition operand.
- * @param {number} s The scalar addition operand
- *
- * @returns {array} The input vector v, where v[i] = v[i] + s.
- */
-SpiderGL.Math.Vec2.adds$ = function (v, s) {
- v[0] += s;
- v[1] += s;
- return v;
-}
-
-/**
- * In-place component-wise subtraction of two 2-dimensional vectors.
- *
- * @param {array} u The first addition operand.
- * @param {array} v The second addition operand
- *
- * @returns {array} The input vector u, where u[i] = u[i] - v[i].
- */
-SpiderGL.Math.Vec2.sub$ = function (u, v) {
- u[0] -= v[0];
- u[1] -= v[1];
- return u;
-}
-
-/**
- * In-place component-wise subtraction of a 2-dimensional vector and a scalar.
- *
- * @param {array} v The vector subtraction operand.
- * @param {number} s The scalar subtraction operand
- *
- * @returns {array} The input vector v, where v[i] = v[i] - s.
- */
-SpiderGL.Math.Vec2.subs$ = function (v, s) {
- v[0] -= s;
- v[1] -= s;
- return v;
-}
-
-/**
- * In-place component-wise subtraction of a scalar and a 2-dimensional vector.
- *
- * @param {number} s The scalar subtraction operand
- * @param {array} v The vector subtraction operand.
- *
- * @returns {array} The input vector v, where v[i] = s - v[i].
- */
-SpiderGL.Math.Vec2.ssub$ = function (s, v) {
- v[0] = s - v[0];
- v[1] = s - v[1];
- return v;
-}
-
-/**
- * In-place component-wise multiplication of two 2-dimensional vectors.
- *
- * @param {array} u The first multiplication operand.
- * @param {array} v The second multiplication operand
- *
- * @returns {array} The input vector u, where u[i] = u[i] * v[i].
- */
-SpiderGL.Math.Vec2.mul$ = function (u, v) {
- u[0] *= v[0];
- u[1] *= v[1];
- return u;
-}
-
-/**
- * In-place component-wise multiplication of a 2-dimensional vector and a scalar.
- *
- * @param {array} v The first multiplication operand.
- * @param {number} s The second multiplication operand
- *
- * @returns {array} The input vector v, where v[i] = v[i] * s.
- */
-SpiderGL.Math.Vec2.muls$ = function (v, s) {
- v[0] *= s;
- v[1] *= s;
- return v;
-}
-
-/**
- * In-place component-wise division of two 2-dimensional vectors.
- *
- * @param {array} u The numerator vector.
- * @param {array} v The denominator vector.
- *
- * @returns {array} The input vector u, where u[i] = u[i] / v[i].
- */
-SpiderGL.Math.Vec2.div$ = function (u, v) {
- u[0] /= v[0];
- u[1] /= v[1];
- return u;
-}
-
-/**
- * In-place component-wise division of a 2-dimensional vector by a scalar.
- *
- * @param {array} v The numerator vector.
- * @param {number} s The scalar denominator.
- *
- * @returns {array} The input vector v, where v[i] = v[i] / s.
- */
-SpiderGL.Math.Vec2.divs$ = function (v, s) {
- v[0] /= s;
- v[1] /= s;
- return v;
-}
-
-/**
- * In-place component-wise division of a scalar by a 2-dimensional.
- *
- * @param {number} s The scalar numerator.
- * @param {array} v The denominator vector.
- *
- * @returns {array} The input vector v, where v[i] = s / v[i].
- */
-SpiderGL.Math.Vec2.sdiv$ = function (v, s) {
- v[0] = s / v[0];
- v[1] = s / v[1];
- return v;
-}
-
-/**
- * In-place perp operation.
- * Returns a 2-dimensional vector which is orthogonal to the input vector and lies in the right halfspace.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} The input vector v, where v = [v[1], -v[0]].
- */
-SpiderGL.Math.Vec2.perp$ = function (v) {
- var v0 = v[0];
- v[0] = v[1];
- v[1] = -v0;
- return v;
-}
-
-/**
- * In-place 2-dimensional vector normalization.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} The input vector v, where v[i] = v[i] / {@link SpiderGL.Math.Vec2.length}(v).
- */
-SpiderGL.Math.Vec2.normalize$ = function (v) {
- var f = 1.0 / SpiderGL.Math.Vec2.length(v);
- return SpiderGL.Math.Vec2.muls$(v, f);
-}
-
-/*---------------------------------------------------------*/
-
-
-
-// 3-dimensional vector
-/*---------------------------------------------------------*/
-
-/**
- * The SpiderGL.Math.Vec3 namespace.
- * The provided functions operate on 3-dimensional vectors, represented as standard JavaScript arrays of length 3.
- * In general, vectors are considered as column vectors.
- *
- * @namespace The SpiderGL.Math.Vec3 namespace defines operations on 3-dimensional vectors.
- */
-SpiderGL.Math.Vec3 = { };
-
-/**
- * Duplicates the input 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = v[i] (same as v.slice(0, 3)).
- */
-SpiderGL.Math.Vec3.dup = function (v) {
- return v.slice(0, 3);
-}
-
-/**
- * Creates a 3-dimensional vector initialized with a scalar.
- *
- * @param {number} s The input scalar.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = s.
- */
-SpiderGL.Math.Vec3.scalar = function (s) {
- return [s, s, s];
-}
-
-/**
- * Creates a 3-dimensional vector initialized with zero.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = 0.
- */
-SpiderGL.Math.Vec3.zero = function () {
- return [0, 0, 0];
-}
-
-/**
- * Creates a 3-dimensional vector initialized with one.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = 1.0.
- */
-SpiderGL.Math.Vec3.one = function () {
- return [1, 1, 1];
-}
-
-/**
- * Creates a 3-dimensional vector initialized with SpiderGL.Math.MAX_NUMBER.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = SpiderGL.Math.MAX_NUMBER.
- */
-SpiderGL.Math.Vec3.maxNumber = function () {
- return [SpiderGL.Math.MAX_NUMBER, SpiderGL.Math.MAX_NUMBER, SpiderGL.Math.MAX_NUMBER];
-}
-
-/**
- * Creates a 3-dimensional vector initialized with SpiderGL.Math.MIN_NUMBER.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = SpiderGL.Math.MIN_NUMBER.
- */
-SpiderGL.Math.Vec3.minNumber = function () {
- return [SpiderGL.Math.MIN_NUMBER, SpiderGL.Math.MIN_NUMBER, SpiderGL.Math.MIN_NUMBER];
-}
-
-/**
- * Creates a 2-dimensional vector from a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r equal to v with the 3rd component dropped.
- */
-SpiderGL.Math.Vec3.to2 = function (v) {
- return [v[0], v[1]];
-}
-
-/**
- * Creates a 4-dimensional vector from a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- * @param {number} [w=1.0] The 4th component.
- *
- * @returns {array} A 4-dimensional vector r equal to v extended with w as 4th component.
- */
-SpiderGL.Math.Vec3.to4 = function (v, w) {
- return [v[0], v[1], v[2], (w != undefined) ? w : 1];
-}
-
-/**
- * Component-wise negation of a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 3-dimensionals vector r, where r[i] = -v[i].
- */
-SpiderGL.Math.Vec3.neg = function (v) {
- return [-v[0], -v[1], -v[2]];
-}
-
-/**
- * Component-wise addition of two 3-dimensional vectors.
- *
- * @param {array} u The first addition operand.
- * @param {array} v The second addition operand.
- *
- * @returns {array} A 3-dimensionals vector r, where r[i] = u[i] + v[i].
- */
-SpiderGL.Math.Vec3.add = function (u, v) {
- return [u[0]+v[0], u[1]+v[1], u[2]+v[2]];
-}
-
-/**
- * Component-wise addition of a 3-dimensional vector and a scalar.
- *
- * @param {array} v The vector addition operand.
- * @param {number} s The scalar addition operand.
- *
- * @returns {array} A 3-dimensionals vector r, where r[i] = v[i] + s.
- */
-SpiderGL.Math.Vec3.adds = function (v, s) {
- return [v[0]+s, v[1]+s, v[2]+s];
-}
-
-/**
- * Component-wise subtraction of two 3-dimensional vectors.
- *
- * @param {array} u The first subtraction operand.
- * @param {array} v The second subtraction operand.
- *
- * @returns {array} A 3-dimensionals vector r, where r[i] = u[i] - v[i].
- */
-SpiderGL.Math.Vec3.sub = function (u, v) {
- return [u[0]-v[0], u[1]-v[1], u[2]-v[2]];
-}
-
-/**
- * Component-wise subtraction of a 3-dimensional vector and a scalar.
- *
- * @param {array} v The vector subtraction operand.
- * @param {number} s The scalar subtraction operand.
- *
- * @returns {array} A 3-dimensionals vector r, where r[i] = v[i] - s.
- */
-SpiderGL.Math.Vec3.subs = function (v, s) {
- return [v[0]-s, v[1]-s, v[2]-s];
-}
-
-/**
- * Component-wise subtraction of a scalar and a 3-dimensional.
- *
- * @param {number} s The scalar subtraction operand.
- * @param {array} v The vector subtraction operand.
- *
- * @returns {array} A 3-dimensionals vector r, where r[i] = s - v[i].
- */
-SpiderGL.Math.Vec3.ssub = function (s, v) {
- return [s-v[0], s-v[1], s-v[2]];
-}
-
-/**
- * Component-wise multiplication of two 3-dimensional vectors.
- *
- * @param {array} u The first multiplication operand.
- * @param {array} v The second multiplication operand.
- *
- * @returns {array} A 3-dimensionals vector r, where r[i] = u[i] * v[i].
- */
-SpiderGL.Math.Vec3.mul = function (u, v) {
- return [u[0]*v[0], u[1]*v[1], u[2]*v[2]];
-}
-
-/**
- * Component-wise multiplication of a 3-dimensional vector and a scalar.
- *
- * @param {array} v The vector multiplication operand.
- * @param {number} s The scalar multiplication operand.
- *
- * @returns {array} A 3-dimensionals vector r, where r[i] = v[i] * s.
- */
-SpiderGL.Math.Vec3.muls = function (v, s) {
- return [v[0]*s, v[1]*s, v[2]*s];
-}
-
-/**
- * Component-wise division of two 3-dimensional vectors.
- *
- * @param {array} u The numerator vector.
- * @param {array} v The denominator vector.
- *
- * @returns {array} A 3-dimensionals vector r, where r[i] = u[i] / v[i].
- */
-SpiderGL.Math.Vec3.div = function (u, v) {
- return [u[0]/v[0], u[1]/v[1], u[2]/v[2]];
-}
-
-/**
- * Component-wise division of a 3-dimensional vector by a scalar.
- *
- * @param {array} v The numerator vector.
- * @param {number} s The scalar denominator.
- *
- * @returns {array} A 3-dimensionals vector r, where r[i] = v[i] / s.
- */
-SpiderGL.Math.Vec3.divs = function (v, s) {
- return [v[0]/s, v[1]/s, v[2]/s];
-}
-
-/**
- * Component-wise division of a scalar by a 3-dimensional vector.
- *
- * @param {number} s The denominator scalar.
- * @param {array} v The numerator vector.
- *
- * @returns {array} A 3-dimensionals vector r, where r[i] = s / v[i].
- */
-SpiderGL.Math.Vec3.sdiv = function (s, v) {
- return [s/v[0], s/v[1], s/v[2]];
-}
-
-/**
- * Component-wise reciprocal of a 3-dimensional vector.
- *
- * @param {array} v The input (denominator) vector.
- *
- * @returns {array} A 3-dimensionals vector r, where r[i] = 1.0 / v[i].
- */
-SpiderGL.Math.Vec3.rcp = function (v) {
- return [1.0/v[0], 1.0/v[1], 1.0/v[2]];
-}
-
-/**
- * Dot product of two 3-dimensional vectors.
- *
- * @param {array} u The first vector operand.
- * @param {array} v The second vector operand.
- *
- * @returns {number} The dot product of u and v.
- */
-SpiderGL.Math.Vec3.dot = function (u, v) {
- return (u[0]*v[0] + u[1]*v[1] + u[2]*v[2]);
-}
-
-/**
- * Cross product of two 3-dimensional vectors.
- *
- * @param {array} u The first vector operand.
- * @param {array} v The second vector operand.
- *
- * @returns {array} A 3-dimensional vector equal to the cross product of u and v.
- */
-SpiderGL.Math.Vec3.cross = function (u, v) {
- return [u[1]*v[2] - u[2]*v[1], u[2]*v[0] - u[0]*v[2], u[0]*v[1] - u[1]*v[0]];
-}
-
-/**
- * Squared length of a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {number} The squared length of v, same as the dot product of v with itself.
- */
-SpiderGL.Math.Vec3.sqLength = function (v) {
- return SpiderGL.Math.Vec3.dot(v, v);
-}
-
-/**
- * Length of a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {number} The length of v.
- */
-SpiderGL.Math.Vec3.length = function (v) {
- return SpiderGL.Math.sqrt(SpiderGL.Math.Vec3.sqLength(v));
-}
-
-/**
- * Creates a normalized 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 3-dimensional vector r representing the normalized v, where r[i] = v[i] / {@link SpiderGL.Math.Vec3.length}(v).
- */
-SpiderGL.Math.Vec3.normalize = function (v) {
- var f = 1.0 / SpiderGL.Math.Vec3.length(v);
- return SpiderGL.Math.Vec3.muls(v, f);
-}
-
-/**
- * Component-wise absolute value of a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.abs}(v[i]).
- */
-SpiderGL.Math.Vec3.abs = function (v) {
- return [SpiderGL.Math.abs(v[0]), SpiderGL.Math.abs(v[1]), SpiderGL.Math.abs(v[2])];
-}
-
-/**
- * Component-wise arccosine of a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.acos}(v[i]), in radians.
- */
-SpiderGL.Math.Vec3.acos = function (v) {
- return [SpiderGL.Math.acos(v[0]), SpiderGL.Math.acos(v[1]), SpiderGL.Math.acos(v[2])];
-}
-
-/**
- * Component-wise arcsine of a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.asin}(v[i]), in radians.
- */
-SpiderGL.Math.Vec3.asin = function (v) {
- return [SpiderGL.Math.asin(v[0]), SpiderGL.Math.asin(v[1]), SpiderGL.Math.asin(v[2])];
-}
-
-/**
- * Component-wise arctangent of a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.atan}(v[i]), between -PI/2 and PI/2 radians.
- */
-SpiderGL.Math.Vec3.atan = function (v) {
- return [SpiderGL.Math.atan(v[0]), SpiderGL.Math.atan(v[1]), SpiderGL.Math.atan(v[2])];
-}
-
-/**
- * Component-wise arctangent of the quotient of two 3-dimensional vectors.
- *
- * @param {array} y The numerator vector.
- * @param {array} x The denominator vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.atan2}(y[i], x[i]), between PI and -PI radians.
- */
-SpiderGL.Math.Vec3.atan2 = function (y, x) {
- return [SpiderGL.Math.atan2(y[0], x[0]), SpiderGL.Math.atan2(y[1], x[1]), SpiderGL.Math.atan2(y[2], x[2])];
-}
-
-/**
- * Component-wise ceil of a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.ceil}(v[i]).
- */
-SpiderGL.Math.Vec3.ceil = function (v) {
- return [SpiderGL.Math.ceil(v[0]), SpiderGL.Math.ceil(v[1]), SpiderGL.Math.ceil(v[2])];
-}
-
-/**
- * Component-wise clamp of a 3-dimensional vector with vector bounds.
- *
- * @param {array} v The input vector.
- * @param {array} min The lower 3-dimensional bound.
- * @param {array} max The upper 3-dimensional bound.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.clamp}(v[i], min[i], max[i]).
- */
-SpiderGL.Math.Vec3.clamp = function (v, min, max) {
- return [SpiderGL.Math.clamp(v[0], min[0], max[0]), SpiderGL.Math.clamp(v[1], min[1], max[1]), SpiderGL.Math.clamp(v[2], min[2], max[2])];
-}
-
-/**
- * Component-wise cosine of a 3-dimensional vector.
- *
- * @param {array} v The input vector, in radians.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.cos}(v[i]).
- */
-SpiderGL.Math.Vec3.cos = function (v) {
- return [SpiderGL.Math.cos(v[0]), SpiderGL.Math.cos(v[1]), SpiderGL.Math.cos(v[2])];
-}
-
-/**
- * Component-wise conversion of a 3-dimensional vector from degrees to radians.
- *
- * @param {array} v The input vector, in radians.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.degToRad}(v[i]).
- */
-SpiderGL.Math.Vec3.degToRad = function (v) {
- return [SpiderGL.Math.degToRad(v[0]), SpiderGL.Math.degToRad(v[1]), SpiderGL.Math.degToRad(v[2])];
-}
-
-/**
- * Component-wise exponential of a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.exp}(v[i]).
- */
-SpiderGL.Math.Vec3.exp = function (v) {
- return [SpiderGL.Math.exp(v[0]), SpiderGL.Math.exp(v[1]), SpiderGL.Math.exp(v[2])];
-}
-
-/**
- * Component-wise floor of a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.floor}(v[i]).
- */
-SpiderGL.Math.Vec3.floor = function (v) {
- return [SpiderGL.Math.floor(v[0]), SpiderGL.Math.floor(v[1]), SpiderGL.Math.floor(v[2])];
-}
-
-/**
- * Linear interpolation between two 3-dimensional vectors.
- *
- * @param {array} u The start interpolation bound.
- * @param {array} v The stop interpolation bound.
- * @param {number} t The interpolation factor, between 0 and 1.
- *
- * @returns {array} The interpolated vector r, where r[i] = (1-t)*u[i] + t*v[i].
- */
-SpiderGL.Math.Vec3.lerp = function (u, v, t) {
- return [
- SpiderGL.Math.lerp(u[0], v[0], t),
- SpiderGL.Math.lerp(u[1], v[1], t),
- SpiderGL.Math.lerp(u[2], v[2], t)
- ];
-}
-
-/**
- * Component-wise natural (base E) logarithm of a 3-dimensional vector.
- * Same as {@link SpiderGL.Math.Vec3.log}.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.ln}(v[i]).
- */
-SpiderGL.Math.Vec3.ln = function (v) {
- return [SpiderGL.Math.ln(v[0]), SpiderGL.Math.ln(v[1]), SpiderGL.Math.ln(v[2])];
-}
-
-/**
- * Component-wise natural (base E) logarithm of a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.log}(v[i]).
- */
-SpiderGL.Math.Vec3.log = function (v) {
- return [SpiderGL.Math.log(v[0]), SpiderGL.Math.log(v[1]), SpiderGL.Math.log(v[2])];
-}
-
-/**
- * Component-wise base 2 logarithm of a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.log2}(v[i]).
- */
-SpiderGL.Math.Vec3.log2 = function (v) {
- return [SpiderGL.Math.log2(v[0]), SpiderGL.Math.log2(v[1]), SpiderGL.Math.log2(v[2])];
-}
-
-/**
- * Component-wise base 10 logarithm of a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.log10}(v[i]).
- */
-SpiderGL.Math.Vec3.log10 = function (v) {
- return [SpiderGL.Math.log10(v[0]), SpiderGL.Math.log10(v[1]), SpiderGL.Math.log10(v[2])];
-}
-
-/**
- * Component-wise maximum of two 3-dimensional vectors.
- *
- * @param {array} u The first vector.
- * @param {array} v The second vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.max}(u[i], v[i]).
- */
-SpiderGL.Math.Vec3.max = function (u, v) {
- return [SpiderGL.Math.max(u[0], v[0]), SpiderGL.Math.max(u[1], v[1]), SpiderGL.Math.max(u[2], v[2])];
-}
-
-/**
- * Component-wise minimum of two 3-dimensional vectors.
- *
- * @param {array} u The first vector.
- * @param {array} v The second vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.min}(u[i], v[i]).
- */
-SpiderGL.Math.Vec3.min = function (u, v) {
- return [SpiderGL.Math.min(u[0], v[0]), SpiderGL.Math.min(u[1], v[1]), SpiderGL.Math.min(u[2], v[2])];
-}
-
-/**
- * Component-wise power of two 3-dimensional vectors.
- *
- * @param {array} u The base vector.
- * @param {array} v The exponent vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.pow}(u[i], v[i]).
- */
-SpiderGL.Math.Vec3.pow = function (u, v) {
- return [SpiderGL.Math.pow(u[0], v[0]), SpiderGL.Math.pow(u[1], v[1]), SpiderGL.Math.pow(u[2], v[2])];
-}
-
-/**
- * Component-wise conversion of a 3-dimensional vector from radians to degrees.
- *
- * @param {array} v The input vector, in degrees.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.pow}(v[i]).
- */
-SpiderGL.Math.Vec3.radToDeg = function (v) {
- return [SpiderGL.Math.radToDeg(v[0]), SpiderGL.Math.radToDeg(v[1]), SpiderGL.Math.radToDeg(v[2])];
-}
-
-/**
- * Creates a random 3-dimensional vector between 0 and 1.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.random}().
- */
-SpiderGL.Math.Vec3.random = function () {
- return [SpiderGL.Math.random(), SpiderGL.Math.random(), SpiderGL.Math.random()];
-}
-
-/**
- * Creates a random 3-dimensional vector between 0 and 1.
- * Same as {@link SpiderGL.Math.Vec3.random}.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.random01}().
- */
-SpiderGL.Math.Vec3.random01 = function () {
- return [SpiderGL.Math.random01(), SpiderGL.Math.random01(), SpiderGL.Math.random01()];
-}
-
-/**
- * Creates a random 3-dimensional vector between -1 and 1.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.random11}().
- */
-SpiderGL.Math.Vec3.random11 = function () {
- return [SpiderGL.Math.random11(), SpiderGL.Math.random11(), SpiderGL.Math.random11()];
-}
-
-/**
- * Creates a random 3-dimensional vector inside a range.
- *
- * @param {array} min The range vector lower bound.
- * @param {array} max The range vector upper bound.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.randomRange}(min[i], max[i]).
- */
-SpiderGL.Math.Vec3.randomRange = function (min, max) {
- return [SpiderGL.Math.randomRange(min[0], max[0]), SpiderGL.Math.randomRange(min[1], max[1]), SpiderGL.Math.randomRange(min[2], max[2])];
-}
-
-/**
- * Component-wise round of a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.round}(v[i]).
- */
-SpiderGL.Math.Vec3.round = function (v) {
- return [SpiderGL.Math.round(v[0]), SpiderGL.Math.round(v[1]), SpiderGL.Math.round(v[2])];
-}
-
-/**
- * Component-wise sine of a 3-dimensional vector.
- *
- * @param {array} v The input vector, in radians.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.sin}(v[i]).
- */
-SpiderGL.Math.Vec3.sin = function (v) {
- return [SpiderGL.Math.sin(v[0]), SpiderGL.Math.sin(v[1]), SpiderGL.Math.sin(v[2])];
-}
-
-/**
- * Component-wise square root of a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.sqrt}(v[i]).
- */
-SpiderGL.Math.Vec3.sqrt = function (v) {
- return [SpiderGL.Math.sqrt(v[0]), SpiderGL.Math.sqrt(v[1]), SpiderGL.Math.sqrt(v[2])];
-}
-
-/**
- * Component-wise tangent root of a 3-dimensional vector.
- *
- * @param {array} v The input vector, in radians.
- *
- * @returns {array} A 3-dimensional vector r, where r[i] = {@link SpiderGL.Math.tan}(v[i]).
- */
-SpiderGL.Math.Vec3.tan = function (v) {
- return [SpiderGL.Math.tan(v[0]), SpiderGL.Math.tan(v[1]), SpiderGL.Math.tan(v[2])];
-}
-
-/**
- * In-place component-wise copy of two 3-dimensional vectors.
- *
- * @param {array} u The destination vector.
- * @param {array} v The source vector.
- *
- * @returns {array} The destination vector u, where u[i] = v[i].
- */
-SpiderGL.Math.Vec3.copy$ = function (u, v) {
- u[0] = v[0];
- u[1] = v[1];
- u[2] = v[2];
- return u;
-}
-
-/**
- * In-place component-wise negation of a 3-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} The input vector v, where v[i] = -v[i].
- */
-SpiderGL.Math.Vec3.neg$ = function (v) {
- v[0] = -v[0];
- v[1] = -v[1];
- v[2] = -v[2];
- return v;
-}
-
-/**
- * In-place component-wise addition of two 3-dimensional vectors.
- *
- * @param {array} u The first addition operand.
- * @param {array} v The second addition operand
- *
- * @returns {array} The input vector u, where u[i] = u[i] + v[i].
- */
-SpiderGL.Math.Vec3.add$ = function (u, v) {
- u[0] += v[0];
- u[1] += v[1];
- u[2] += v[2];
- return u;
-}
-
-/**
- * In-place component-wise addition of a 3-dimensional vector and a scalar.
- *
- * @param {array} v The vector addition operand.
- * @param {number} s The scalar addition operand
- *
- * @returns {array} The input vector v, where v[i] = v[i] + s.
- */
-SpiderGL.Math.Vec3.adds$ = function (v, s) {
- v[0] += s;
- v[1] += s;
- v[2] += s;
- return v;
-}
-
-/**
- * In-place component-wise subtraction of two 3-dimensional vectors.
- *
- * @param {array} u The first addition operand.
- * @param {array} v The second addition operand
- *
- * @returns {array} The input vector u, where u[i] = u[i] - v[i].
- */
-SpiderGL.Math.Vec3.sub$ = function (u, v) {
- u[0] -= v[0];
- u[1] -= v[1];
- u[2] -= v[2];
- return u;
-}
-
-/**
- * In-place component-wise subtraction of a 3-dimensional vector and a scalar.
- *
- * @param {array} v The vector subtraction operand.
- * @param {number} s The scalar subtraction operand
- *
- * @returns {array} The input vector v, where v[i] = v[i] - s.
- */
-SpiderGL.Math.Vec3.subs$ = function (v, s) {
- v[0] -= s;
- v[1] -= s;
- v[2] -= s;
- return v;
-}
-
-/**
- * In-place component-wise subtraction of a scalar and a 3-dimensional vector.
- *
- * @param {number} s The scalar subtraction operand
- * @param {array} v The vector subtraction operand.
- *
- * @returns {array} The input vector v, where v[i] = s - v[i].
- */
-SpiderGL.Math.Vec3.ssub$ = function (s, v) {
- v[0] = s - v[0];
- v[1] = s - v[1];
- v[2] = s - v[2];
- return v;
-}
-
-/**
- * In-place component-wise multiplication of two 3-dimensional vectors.
- *
- * @param {array} u The first multiplication operand.
- * @param {array} v The second multiplication operand
- *
- * @returns {array} The input vector u, where u[i] = u[i] * v[i].
- */
-SpiderGL.Math.Vec3.mul$ = function (u, v) {
- u[0] *= v[0];
- u[1] *= v[1];
- u[2] *= v[2];
- return u;
-}
-
-/**
- * In-place component-wise multiplication of a 3-dimensional vector and a scalar.
- *
- * @param {array} v The first multiplication operand.
- * @param {number} s The second multiplication operand
- *
- * @returns {array} The input vector v, where v[i] = v[i] * s.
- */
-SpiderGL.Math.Vec3.muls$ = function (v, s) {
- v[0] *= s;
- v[1] *= s;
- v[2] *= s;
- return v;
-}
-
-/**
- * In-place component-wise division of two 3-dimensional vectors.
- *
- * @param {array} u The numerator vector.
- * @param {array} v The denominator vector.
- *
- * @returns {array} The input vector u, where u[i] = u[i] / v[i].
- */
-SpiderGL.Math.Vec3.div$ = function (u, v) {
- u[0] /= v[0];
- u[1] /= v[1];
- u[2] /= v[2];
- return u;
-}
-
-/**
- * In-place component-wise division of a 3-dimensional vector by a scalar.
- *
- * @param {array} v The numerator vector.
- * @param {number} s The scalar denominator.
- *
- * @returns {array} The input vector v, where v[i] = v[i] / s.
- */
-SpiderGL.Math.Vec3.divs$ = function (v, s) {
- v[0] /= s;
- v[1] /= s;
- v[2] /= s;
- return v;
-}
-
-/**
- * In-place component-wise division of a scalar by a 3-dimensional.
- *
- * @param {number} s The scalar numerator.
- * @param {array} v The denominator vector.
- *
- * @returns {array} The input vector v, where v[i] = s / v[i].
- */
-SpiderGL.Math.Vec3.sdiv$ = function (v, s) {
- v[0] = s / v[0];
- v[1] = s / v[1];
- v[2] = s / v[2];
- return v;
-}
-
-/**
- * In-place 3-dimensional vector normalization.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} The input vector v, where v[i] = v[i] / {@link SpiderGL.Math.Vec3.length}(v)
- */
-SpiderGL.Math.Vec3.normalize$ = function (v) {
- var f = 1.0 / SpiderGL.Math.Vec3.length(v);
- return SpiderGL.Math.Vec3.muls$(v, f);
-}
-
-/*---------------------------------------------------------*/
-
-
-
-// 4-dimensional vector
-/*---------------------------------------------------------*/
-
-/**
- * The SpiderGL.Math.Vec4 namespace.
- * The provided functions operate on 4-dimensional vectors, represented as standard JavaScript arrays of length 4.
- * In general, vectors are considered as column vectors.
- *
- * @namespace The SpiderGL.Math.Vec4 namespace defines operations on 4-dimensional vectors.
- */
-SpiderGL.Math.Vec4 = { };
-
-/**
- * Duplicates the input 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = v[i] (same as v.slice(0, 4)).
- */
-SpiderGL.Math.Vec4.dup = function (v) {
- return v.slice(0, 4);
-}
-
-/**
- * Creates a 4-dimensional vector initialized with a scalar.
- *
- * @param {number} s The input scalar.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = s.
- */
-SpiderGL.Math.Vec4.scalar = function (s) {
- return [s, s, s, s];
-}
-
-/**
- * Creates a 4-dimensional vector initialized with zero.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = 0.
- */
-SpiderGL.Math.Vec4.zero = function () {
- return [0, 0, 0, 0];
-}
-
-/**
- * Creates a 4-dimensional vector initialized with one.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = 1.0.
- */
-SpiderGL.Math.Vec4.one = function () {
- return [1, 1, 1, 1];
-}
-
-/**
- * Creates a 4-dimensional vector initialized with SpiderGL.Math.MAX_NUMBER.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = SpiderGL.Math.MAX_NUMBER.
- */
-SpiderGL.Math.Vec4.maxNumber = function () {
- return [SpiderGL.Math.MAX_NUMBER, SpiderGL.Math.MAX_NUMBER, SpiderGL.Math.MAX_NUMBER, SpiderGL.Math.MAX_NUMBER];
-}
-
-/**
- * Creates a 4-dimensional vector initialized with SpiderGL.Math.MIN_NUMBER.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = SpiderGL.Math.MIN_NUMBER.
- */
-SpiderGL.Math.Vec4.minNumber = function () {
- return [SpiderGL.Math.MIN_NUMBER, SpiderGL.Math.MIN_NUMBER, SpiderGL.Math.MIN_NUMBER, SpiderGL.Math.MIN_NUMBER];
-}
-
-/**
- * Creates a 2-dimensional vector from a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 2-dimensional vector r equal to v with the 3rd and 4th components dropped.
- */
-SpiderGL.Math.Vec4.to2 = function (v) {
- return [v[0], v[1]];
-}
-
-/**
- * Creates a 3-dimensional vector from a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 3-dimensional vector r equal to v with the 4th component dropped.
- */
-SpiderGL.Math.Vec4.to3 = function (v) {
- return [v[0], v[1], v[2]];
-}
-
-/**
- * Component-wise negation of a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 4-dimensionals vector r, where r[i] = -v[i].
- */
-SpiderGL.Math.Vec4.neg = function (v) {
- return [-v[0], -v[1], -v[2], -v[3]];
-}
-
-/**
- * Component-wise addition of two 4-dimensional vectors.
- *
- * @param {array} u The first addition operand.
- * @param {array} v The second addition operand.
- *
- * @returns {array} A 4-dimensionals vector r, where r[i] = u[i] + v[i].
- */
-SpiderGL.Math.Vec4.add = function (u, v) {
- return [u[0]+v[0], u[1]+v[1], u[2]+v[2], u[3]+v[3]];
-}
-
-/**
- * Component-wise addition of a 4-dimensional vector and a scalar.
- *
- * @param {array} v The vector addition operand.
- * @param {number} s The scalar addition operand.
- *
- * @returns {array} A 4-dimensionals vector r, where r[i] = v[i] + s.
- */
-SpiderGL.Math.Vec4.adds = function (v, s) {
- return [v[0]+s, v[1]+s, v[2]+s, v[3]+s];
-}
-
-/**
- * Component-wise subtraction of two 4-dimensional vectors.
- *
- * @param {array} u The first subtraction operand.
- * @param {array} v The second subtraction operand.
- *
- * @returns {array} A 4-dimensionals vector r, where r[i] = u[i] - v[i].
- */
-SpiderGL.Math.Vec4.sub = function (u, v) {
- return [u[0]-v[0], u[1]-v[1], u[2]-v[2], u[3]-v[3]];
-}
-
-/**
- * Component-wise subtraction of a 4-dimensional vector and a scalar.
- *
- * @param {array} v The vector subtraction operand.
- * @param {number} s The scalar subtraction operand.
- *
- * @returns {array} A 4-dimensionals vector r, where r[i] = v[i] - s.
- */
-SpiderGL.Math.Vec4.subs = function (v, s) {
- return [v[0]-s, v[1]-s, v[2]-s, v[3]-s];
-}
-
-/**
- * Component-wise subtraction of a scalar and a 4-dimensional.
- *
- * @param {number} s The scalar subtraction operand.
- * @param {array} v The vector subtraction operand.
- *
- * @returns {array} A 4-dimensionals vector r, where r[i] = s - v[i].
- */
-SpiderGL.Math.Vec4.ssub = function (s, v) {
- return [s-v[0], s-v[1], s-v[2], s-v[3]];
-}
-
-/**
- * Component-wise multiplication of two 4-dimensional vectors.
- *
- * @param {array} u The first multiplication operand.
- * @param {array} v The second multiplication operand.
- *
- * @returns {array} A 4-dimensionals vector r, where r[i] = u[i] * v[i].
- */
-SpiderGL.Math.Vec4.mul = function (u, v) {
- return [u[0]*v[0], u[1]*v[1], u[2]*v[2], u[3]*v[3]];
-}
-
-/**
- * Component-wise multiplication of a 4-dimensional vector and a scalar.
- *
- * @param {array} v The vector multiplication operand.
- * @param {number} s The scalar multiplication operand.
- *
- * @returns {array} A 4-dimensionals vector r, where r[i] = v[i] * s.
- */
-SpiderGL.Math.Vec4.muls = function (v, s) {
- return [v[0]*s, v[1]*s, v[2]*s, v[3]*s];
-}
-
-/**
- * Component-wise division of two 4-dimensional vectors.
- *
- * @param {array} u The numerator vector.
- * @param {array} v The denominator vector.
- *
- * @returns {array} A 4-dimensionals vector r, where r[i] = u[i] / v[i].
- */
-SpiderGL.Math.Vec4.div = function (u, v) {
- return [u[0]/v[0], u[1]/v[1], u[2]/v[2], u[3]/v[3]];
-}
-
-/**
- * Component-wise division of a 4-dimensional vector by a scalar.
- *
- * @param {array} v The numerator vector.
- * @param {number} s The scalar denominator.
- *
- * @returns {array} A 4-dimensionals vector r, where r[i] = v[i] / s.
- */
-SpiderGL.Math.Vec4.divs = function (v, s) {
- return [v[0]/s, v[1]/s, v[2]/s, v[3]/s];
-}
-
-/**
- * Component-wise division of a scalar by a 4-dimensional vector.
- *
- * @param {number} s The denominator scalar.
- * @param {array} v The numerator vector.
- *
- * @returns {array} A 4-dimensionals vector r, where r[i] = s / v[i].
- */
-SpiderGL.Math.Vec4.sdiv = function (s, v) {
- return [s/v[0], s/v[1], s/v[2], s/v[3]];
-}
-
-/**
- * Component-wise reciprocal of a 4-dimensional vector.
- *
- * @param {array} v The input (denominator) vector.
- *
- * @returns {array} A 4-dimensionals vector r, where r[i] = 1.0 / v[i].
- */
-SpiderGL.Math.Vec4.rcp = function (v) {
- return [1.0/v[0], 1.0/v[1], 1.0/v[2], 1.0/v[3]];
-}
-
-/**
- * Dot product of two 4-dimensional vectors.
- *
- * @param {array} u The first vector operand.
- * @param {array} v The second vector operand.
- *
- * @returns {number} The dot product of u and v.
- */
-SpiderGL.Math.Vec4.dot = function (u, v) {
- return (u[0]*v[0] + u[1]*v[1] + u[2]*v[2] + u[3]*v[3]);
-}
-
-/**
- * Cross product of three 4-dimensional vectors.
- *
- * @param {array} u The first vector operand.
- * @param {array} v The second vector operand.
- * @param {array} w The third vector operand.
- *
- * @returns {array} A 4-dimensional vector equal to the cross product of u, v and w.
- */
-SpiderGL.Math.Vec4.cross = function (u, v, w) {
- var a = v[0]*w[1] - v[1]*w[0];
- var b = v[0]*w[2] - v[2]*w[0];
- var c = v[0]*w[3] - v[3]*w[0];
- var d = v[1]*w[2] - v[2]*w[1];
- var e = v[1]*w[3] - v[3]*w[1];
- var f = v[2]*w[3] - v[3]*w[2];
-
- return [
- u[1]*f - u[2]*e + u[3]*d,
- u[0]*f + u[2]*c - u[3]*b,
- u[0]*e - u[1]*c + u[3]*a,
- u[0]*d + u[1]*b - u[2]*a
- ];
-}
-
-/**
- * Squared length of a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {number} The squared length of v, same as the dot product of v with itself.
- */
-SpiderGL.Math.Vec4.sqLength = function (v) {
- return SpiderGL.Math.Vec4.dot(v, v);
-}
-
-/**
- * Length of a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {number} The length of v.
- */
-SpiderGL.Math.Vec4.length = function (v) {
- return SpiderGL.Math.sqrt(SpiderGL.Math.Vec4.sqLength(v));
-}
-
-/**
- * Creates a normalized 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 4-dimensional vector r representing the normalized v, where r[i] = v[i] / {@link SpiderGL.Math.Vec4.length}(v).
- */
-SpiderGL.Math.Vec4.normalize = function (v) {
- var f = 1.0 / SpiderGL.Math.Vec4.length(v);
- return SpiderGL.Math.Vec4.muls(v, f);
-}
-
-/**
- * Projects a homogeneous 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = v[i] / v[3].
- */
-SpiderGL.Math.Vec4.project = function (v) {
- var f = 1.0 / v[3];
- return [v[0]*f, v[1]*f, v[2]*f, 1.0];
-}
-
-/**
- * Component-wise absolute value of a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.abs}(v[i]).
- */
-SpiderGL.Math.Vec4.abs = function (v) {
- return [SpiderGL.Math.abs(v[0]), SpiderGL.Math.abs(v[1]), SpiderGL.Math.abs(v[2]), SpiderGL.Math.abs(v[3])];
-}
-
-/**
- * Component-wise arccosine of a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.acos}(v[i]), in radians.
- */
-SpiderGL.Math.Vec4.acos = function (v) {
- return [SpiderGL.Math.acos(v[0]), SpiderGL.Math.acos(v[1]), SpiderGL.Math.acos(v[2]), SpiderGL.Math.acos(v[3])];
-}
-
-/**
- * Component-wise arcsine of a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.asin}(v[i]), in radians.
- */
-SpiderGL.Math.Vec4.asin = function (v) {
- return [SpiderGL.Math.asin(v[0]), SpiderGL.Math.asin(v[1]), SpiderGL.Math.asin(v[2]), SpiderGL.Math.asin(v[3])];
-}
-
-/**
- * Component-wise arctangent of a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.atan}(v[i]), between -PI/2 and PI/2 radians.
- */
-SpiderGL.Math.Vec4.atan = function (v) {
- return [SpiderGL.Math.atan(v[0]), SpiderGL.Math.atan(v[1]), SpiderGL.Math.atan(v[2]), SpiderGL.Math.atan(v[3])];
-}
-
-/**
- * Component-wise arctangent of the quotient of two 4-dimensional vectors.
- *
- * @param {array} y The numerator vector.
- * @param {array} x The denominator vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.atan2}(y[i], x[i]), between PI and -PI radians.
- */
-SpiderGL.Math.Vec4.atan2 = function (y, x) {
- return [SpiderGL.Math.atan2(y[0], x[0]), SpiderGL.Math.atan2(y[1], x[1]), SpiderGL.Math.atan2(y[2], x[2]), SpiderGL.Math.atan2(y[3], x[3])];
-}
-
-/**
- * Component-wise ceil of a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.ceil}(v[i]).
- */
-SpiderGL.Math.Vec4.ceil = function (v) {
- return [SpiderGL.Math.ceil(v[0]), SpiderGL.Math.ceil(v[1]), SpiderGL.Math.ceil(v[2]), SpiderGL.Math.ceil(v[3])];
-}
-
-/**
- * Component-wise clamp of a 4-dimensional vector with vector bounds.
- *
- * @param {array} v The input vector.
- * @param {array} min The lower 4-dimensional bound.
- * @param {array} max The upper 4-dimensional bound.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.clamp}(v[i], min[i], max[i]).
- */
-SpiderGL.Math.Vec4.clamp = function (v, min, max) {
- return [SpiderGL.Math.clamp(v[0], min[0], max[0]), SpiderGL.Math.clamp(v[1], min[1], max[1]), SpiderGL.Math.clamp(v[2], min[2], max[2]), SpiderGL.Math.clamp(v[3], min[3], max[3])];
-}
-
-/**
- * Component-wise cosine of a 4-dimensional vector.
- *
- * @param {array} v The input vector, in radians.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.cos}(v[i]).
- */
-SpiderGL.Math.Vec4.cos = function (v) {
- return [SpiderGL.Math.cos(v[0]), SpiderGL.Math.cos(v[1]), SpiderGL.Math.cos(v[2]), SpiderGL.Math.cos(v[3])];
-}
-
-/**
- * Component-wise conversion of a 4-dimensional vector from degrees to radians.
- *
- * @param {array} v The input vector, in radians.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.degToRad}(v[i]).
- */
-SpiderGL.Math.Vec4.degToRad = function (v) {
- return [SpiderGL.Math.degToRad(v[0]), SpiderGL.Math.degToRad(v[1]), SpiderGL.Math.degToRad(v[2]), SpiderGL.Math.degToRad(v[3])];
-}
-
-/**
- * Component-wise exponential of a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.exp}(v[i]).
- */
-SpiderGL.Math.Vec4.exp = function (v) {
- return [SpiderGL.Math.exp(v[0]), SpiderGL.Math.exp(v[1]), SpiderGL.Math.exp(v[2]), SpiderGL.Math.exp(v[3])];
-}
-
-/**
- * Component-wise floor of a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.floor}(v[i]).
- */
-SpiderGL.Math.Vec4.floor = function (v) {
- return [SpiderGL.Math.floor(v[0]), SpiderGL.Math.floor(v[1]), SpiderGL.Math.floor(v[2]), SpiderGL.Math.floor(v[3])];
-}
-
-/**
- * Linear interpolation between two 4-dimensional vectors.
- *
- * @param {array} u The start interpolation bound.
- * @param {array} v The stop interpolation bound.
- * @param {number} t The interpolation factor, between 0 and 1.
- *
- * @returns {array} The interpolated vector r, where r[i] = (1-t)*u[i] + t*v[i].
- */
-SpiderGL.Math.Vec4.lerp = function (u, v, t) {
- return [
- SpiderGL.Math.lerp(u[0], v[0], t),
- SpiderGL.Math.lerp(u[1], v[1], t),
- SpiderGL.Math.lerp(u[2], v[2], t),
- SpiderGL.Math.lerp(u[3], v[3], t)
- ];
-}
-
-/**
- * Component-wise natural (base E) logarithm of a 4-dimensional vector.
- * Same as {@link SpiderGL.Math.Vec4.log}.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.ln}(v[i]).
- */
-SpiderGL.Math.Vec4.ln = function (v) {
- return [SpiderGL.Math.ln(v[0]), SpiderGL.Math.ln(v[1]), SpiderGL.Math.ln(v[2]), SpiderGL.Math.ln(v[3])];
-}
-
-/**
- * Component-wise natural (base E) logarithm of a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.log}(v[i]).
- */
-SpiderGL.Math.Vec4.log = function (v) {
- return [SpiderGL.Math.log(v[0]), SpiderGL.Math.log(v[1]), SpiderGL.Math.log(v[2]), SpiderGL.Math.log(v[3])];
-}
-
-/**
- * Component-wise base 2 logarithm of a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.log2}(v[i]).
- */
-SpiderGL.Math.Vec4.log2 = function (v) {
- return [SpiderGL.Math.log2(v[0]), SpiderGL.Math.log2(v[1]), SpiderGL.Math.log2(v[2]), SpiderGL.Math.log2(v[3])];
-}
-
-/**
- * Component-wise base 10 logarithm of a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.log10}(v[i]).
- */
-SpiderGL.Math.Vec4.log10 = function (v) {
- return [SpiderGL.Math.log10(v[0]), SpiderGL.Math.log10(v[1]), SpiderGL.Math.log10(v[2]), SpiderGL.Math.log10(v[3])];
-}
-
-/**
- * Component-wise maximum of two 4-dimensional vectors.
- *
- * @param {array} u The first vector.
- * @param {array} v The second vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.max}(u[i], v[i]).
- */
-SpiderGL.Math.Vec4.max = function (u, v) {
- return [SpiderGL.Math.max(u[0], v[0]), SpiderGL.Math.max(u[1], v[1]), SpiderGL.Math.max(u[2], v[2]), SpiderGL.Math.max(u[3], v[3])];
-}
-
-/**
- * Component-wise minimum of two 4-dimensional vectors.
- *
- * @param {array} u The first vector.
- * @param {array} v The second vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.min}(u[i], v[i]).
- */
-SpiderGL.Math.Vec4.min = function (u, v) {
- return [SpiderGL.Math.min(u[0], v[0]), SpiderGL.Math.min(u[1], v[1]), SpiderGL.Math.min(u[2], v[2]), SpiderGL.Math.min(u[3], v[3])];
-}
-
-/**
- * Component-wise power of two 4-dimensional vectors.
- *
- * @param {array} u The base vector.
- * @param {array} v The exponent vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.pow}(u[i], v[i]).
- */
-SpiderGL.Math.Vec4.pow = function (u, v) {
- return [SpiderGL.Math.pow(u[0], v[0]), SpiderGL.Math.pow(u[1], v[1]), SpiderGL.Math.pow(u[2], v[2]), SpiderGL.Math.pow(u[3], v[3])];
-}
-
-/**
- * Component-wise conversion of a 4-dimensional vector from radians to degrees.
- *
- * @param {array} v The input vector, in degrees.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.pow}(v[i]).
- */
-SpiderGL.Math.Vec4.radToDeg = function (v) {
- return [SpiderGL.Math.radToDeg(v[0]), SpiderGL.Math.radToDeg(v[1]), SpiderGL.Math.radToDeg(v[2]), SpiderGL.Math.radToDeg(v[3])];
-}
-
-/**
- * Creates a random 4-dimensional vector between 0 and 1.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.random}().
- */
-SpiderGL.Math.Vec4.random = function () {
- return [SpiderGL.Math.random(), SpiderGL.Math.random(), SpiderGL.Math.random(), SpiderGL.Math.random()];
-}
-
-/**
- * Creates a random 4-dimensional vector between 0 and 1.
- * Same as {@link SpiderGL.Math.Vec4.random}.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.random01}().
- */
-SpiderGL.Math.Vec4.random01 = function () {
- return [SpiderGL.Math.random01(), SpiderGL.Math.random01(), SpiderGL.Math.random01(), SpiderGL.Math.random01()];
-}
-
-/**
- * Creates a random 4-dimensional vector between -1 and 1.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.random11}().
- */
-SpiderGL.Math.Vec4.random11 = function () {
- return [SpiderGL.Math.random11(), SpiderGL.Math.random11(), SpiderGL.Math.random11(), SpiderGL.Math.random11()];
-}
-
-/**
- * Creates a random 4-dimensional vector inside a range.
- *
- * @param {array} min The range vector lower bound.
- * @param {array} max The range vector upper bound.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.randomRange}(min[i], max[i]).
- */
-SpiderGL.Math.Vec4.randomRange = function (min, max) {
- return [SpiderGL.Math.randomRange(min[0], max[0]), SpiderGL.Math.randomRange(min[1], max[1]), SpiderGL.Math.randomRange(min[2], max[2]), SpiderGL.Math.randomRange(min[3], max[3])];
-}
-
-/**
- * Component-wise round of a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.round}(v[i]).
- */
-SpiderGL.Math.Vec4.round = function (v) {
- return [SpiderGL.Math.round(v[0]), SpiderGL.Math.round(v[1]), SpiderGL.Math.round(v[2]), SpiderGL.Math.round(v[3])];
-}
-
-/**
- * Component-wise sine of a 4-dimensional vector.
- *
- * @param {array} v The input vector, in radians.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.sin}(v[i]).
- */
-SpiderGL.Math.Vec4.sin = function (v) {
- return [SpiderGL.Math.sin(v[0]), SpiderGL.Math.sin(v[1]), SpiderGL.Math.sin(v[2]), SpiderGL.Math.sin(v[3])];
-}
-
-/**
- * Component-wise square root of a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.sqrt}(v[i]).
- */
-SpiderGL.Math.Vec4.sqrt = function (v) {
- return [SpiderGL.Math.sqrt(v[0]), SpiderGL.Math.sqrt(v[1]), SpiderGL.Math.sqrt(v[2]), SpiderGL.Math.sqrt(v[3])];
-}
-
-/**
- * Component-wise tangent root of a 4-dimensional vector.
- *
- * @param {array} v The input vector, in radians.
- *
- * @returns {array} A 4-dimensional vector r, where r[i] = {@link SpiderGL.Math.tan}(v[i]).
- */
-SpiderGL.Math.Vec4.tan = function (v) {
- return [SpiderGL.Math.tan(v[0]), SpiderGL.Math.tan(v[1]), SpiderGL.Math.tan(v[2]), SpiderGL.Math.tan(v[3])];
-}
-
-/**
- * In-place component-wise copy of two 4-dimensional vectors.
- *
- * @param {array} u The destination vector.
- * @param {array} v The source vector.
- *
- * @returns {array} The destination vector u, where u[i] = v[i].
- */
-SpiderGL.Math.Vec4.copy$ = function (u, v) {
- u[0] = v[0];
- u[1] = v[1];
- u[2] = v[2];
- u[3] = v[3];
- return u;
-}
-
-/**
- * In-place component-wise negation of a 4-dimensional vector.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} The input vector v, where v[i] = -v[i].
- */
-SpiderGL.Math.Vec4.neg$ = function (v) {
- v[0] = -v[0];
- v[1] = -v[1];
- v[2] = -v[2];
- v[3] = -v[3];
- return v;
-}
-
-/**
- * In-place component-wise addition of two 4-dimensional vectors.
- *
- * @param {array} u The first addition operand.
- * @param {array} v The second addition operand
- *
- * @returns {array} The input vector u, where u[i] = u[i] + v[i].
- */
-SpiderGL.Math.Vec4.add$ = function (u, v) {
- u[0] += v[0];
- u[1] += v[1];
- u[2] += v[2];
- u[3] += v[3];
- return u;
-}
-
-/**
- * In-place component-wise addition of a 4-dimensional vector and a scalar.
- *
- * @param {array} v The vector addition operand.
- * @param {number} s The scalar addition operand
- *
- * @returns {array} The input vector v, where v[i] = v[i] + s.
- */
-SpiderGL.Math.Vec4.adds$ = function (v, s) {
- v[0] += s;
- v[1] += s;
- v[2] += s;
- v[3] += s;
- return v;
-}
-
-/**
- * In-place component-wise subtraction of two 4-dimensional vectors.
- *
- * @param {array} u The first addition operand.
- * @param {array} v The second addition operand
- *
- * @returns {array} The input vector u, where u[i] = u[i] - v[i].
- */
-SpiderGL.Math.Vec4.sub$ = function (u, v) {
- u[0] -= v[0];
- u[1] -= v[1];
- u[2] -= v[2];
- u[3] -= v[3];
- return u;
-}
-
-/**
- * In-place component-wise subtraction of a 4-dimensional vector and a scalar.
- *
- * @param {array} v The vector subtraction operand.
- * @param {number} s The scalar subtraction operand
- *
- * @returns {array} The input vector v, where v[i] = v[i] - s.
- */
-SpiderGL.Math.Vec4.subs$ = function (v, s) {
- v[0] -= s;
- v[1] -= s;
- v[2] -= s;
- v[3] -= s;
- return v;
-}
-
-/**
- * In-place component-wise subtraction of a scalar and a 4-dimensional vector.
- *
- * @param {number} s The scalar subtraction operand
- * @param {array} v The vector subtraction operand.
- *
- * @returns {array} The input vector v, where v[i] = s - v[i].
- */
-SpiderGL.Math.Vec4.ssub$ = function (s, v) {
- v[0] = s - v[0];
- v[1] = s - v[1];
- v[2] = s - v[2];
- v[3] = s - v[3];
- return v;
-}
-
-/**
- * In-place component-wise multiplication of two 4-dimensional vectors.
- *
- * @param {array} u The first multiplication operand.
- * @param {array} v The second multiplication operand
- *
- * @returns {array} The input vector u, where u[i] = u[i] * v[i].
- */
-SpiderGL.Math.Vec4.mul$ = function (u, v) {
- u[0] *= v[0];
- u[1] *= v[1];
- u[2] *= v[2];
- u[3] *= v[3];
- return u;
-}
-
-/**
- * In-place component-wise multiplication of a 4-dimensional vector and a scalar.
- *
- * @param {array} v The first multiplication operand.
- * @param {number} s The second multiplication operand
- *
- * @returns {array} The input vector v, where v[i] = v[i] * s.
- */
-SpiderGL.Math.Vec4.muls$ = function (v, s) {
- v[0] *= s;
- v[1] *= s;
- v[2] *= s;
- v[3] *= s;
- return v;
-}
-
-/**
- * In-place component-wise division of two 4-dimensional vectors.
- *
- * @param {array} u The numerator vector.
- * @param {array} v The denominator vector.
- *
- * @returns {array} The input vector u, where u[i] = u[i] / v[i].
- */
-SpiderGL.Math.Vec4.div$ = function (u, v) {
- u[0] /= v[0];
- u[1] /= v[1];
- u[2] /= v[2];
- u[3] /= v[3];
- return u;
-}
-
-/**
- * In-place component-wise division of a 4-dimensional vector by a scalar.
- *
- * @param {array} v The numerator vector.
- * @param {number} s The scalar denominator.
- *
- * @returns {array} The input vector v, where v[i] = v[i] / s.
- */
-SpiderGL.Math.Vec4.divs$ = function (v, s) {
- v[0] /= s;
- v[1] /= s;
- v[2] /= s;
- v[3] /= s;
- return v;
-}
-
-/**
- * In-place component-wise division of a scalar by a 4-dimensional.
- *
- * @param {number} s The scalar numerator.
- * @param {array} v The denominator vector.
- *
- * @returns {array} The input vector v, where v[i] = s / v[i].
- */
-SpiderGL.Math.Vec4.sdiv$ = function (v, s) {
- v[0] = s / v[0];
- v[1] = s / v[1];
- v[2] = s / v[2];
- v[3] = s / v[3];
- return v;
-}
-
-/**
- * In-place 4-dimensional vector normalization.
- *
- * @param {array} v The input vector.
- *
- * @returns {array} The input vector v, where v[i] = v[i] / {@link SpiderGL.Math.Vec4.length}(v)
- */
-SpiderGL.Math.Vec4.normalize$ = function (v) {
- var f = 1.0 / SpiderGL.Math.Vec4.length(v);
- return SpiderGL.Math.Vec4.muls$(v, f);
-}
-
-/*---------------------------------------------------------*/
-
-
-
-// 3x3 matrix
-/*---------------------------------------------------------*/
-
-/**
- * The SpiderGL.Math.Mat3 namespace.
- * The provided functions operate on 3x3 matrices, represented as standard JavaScript arrays of length 9.
- * In general, matrices are considered in column-major format.
- *
- * @namespace The SpiderGL.Math.Mat3 namespace defines operations on 3x3 matrices.
- */
-SpiderGL.Math.Mat3 = { };
-
-/**
- * Duplicates the input 3x3 matrix.
- *
- * @param {array} n The input matrix.
- *
- * @returns {array} A 9-component array r, where r[i] = m[i] (same as m.slice(0, 9)).
- */
-SpiderGL.Math.Mat3.dup = function (m) {
- return m.slice(0, 9);
-}
-
-/**
- * Creates a 3x3 matrix initialized with a scalar.
- *
- * @param {number} s The input scalar.
- *
- * @returns {array} A 9-component array r, where r[i] = s.
- */
-SpiderGL.Math.Mat3.scalar = function (s) {
- return [
- s, s, s,
- s, s, s,
- s, s, s
- ];
-}
-
-/**
- * Creates a 3x3 matrix initialized with zero.
- *
- * @returns {array} A 9-component array r, where r[i] = 0.
- */
-SpiderGL.Math.Mat3.zero = function () {
- return [
- 0, 0, 0,
- 0, 0, 0,
- 0, 0, 0
- ];
-}
-
-/**
- * Creates a 3x3 matrix initialized with one.
- *
- * @returns {array} A 9-component array r, where r[i] = 1.
- */
-SpiderGL.Math.Mat3.one = function () {
- return [
- 1, 1, 1,
- 1, 1, 1,
- 1, 1, 1
- ];
-}
-
-/**
- * Creates a diagonal 3x3 matrix.
- *
- * @param {array} d A 3-dimensional vector
- *
- * @returns {array} A 9-component array representing a 3x3 matrix with diagonal elements set to d.
- */
-SpiderGL.Math.Mat3.diag = function (d) {
- return [
- d[0], 0, 0,
- 0, d[0], 0,
- 0, 0, d[0]
- ];
-}
-
-/**
- * Creates an identity 3x3 matrix.
- *
- * @returns {array} A 9-component array representing an identity 3x3 matrix.
- */
-SpiderGL.Math.Mat3.identity = function () {
- return [
- 1, 0, 0,
- 0, 1, 0,
- 0, 0, 1
- ];
-}
-
-/**
- * Extends a 3x3 matrix to a 4x4 matrix.
- *
- * @param {array} m The input matrix.
- *
- * @returns {array} A 16-component array representing a 4x4 matrix r, with the input 3x3 matrix as tue upper-left 3x3 region with [0, 0, 0, 1] as last row and column.
- */
-SpiderGL.Math.Mat3.to44 = function (m) {
- return [
- m[0], m[1], m[2], 0,
- m[3], m[4], m[5], 0,
- m[6], m[7], m[8], 0,
- 0, 0, 0, 1
- ];
-}
-
-/**
- * Pre-multiplies a 2-dimensional vector by a column-major 3x3 matrix.
- *
- * @param {array} m The input column-major 3x3 matrix.
- * @param {array} v The input 2-dimensional vector.
- * @param {number} [z=0] The 3rd component of the input 2-dimensional vector.
- *
- * @return {array} A 2-dimensional vector r, where r = m * v.
- */
-SpiderGL.Math.Mat3.mul2 = function (m, v, z) {
- z = (z == undefined) ? (0) : (z);
- return [
- m[0]*v[0] + m[3]*v[1] + m[6]*z,
- m[1]*v[0] + m[4]*v[1] + m[7]*z /* ,
- m[2]*v[0] + m[5]*v[1] + m[8]*z */
- ];
-}
-
-/**
- * Pre-multiplies a 3-dimensional vector by a column-major 3x3 matrix.
- *
- * @param {array} m The input column-major 3x3 matrix.
- * @param {array} v The input 3-dimensional vector.
- *
- * @return {array} A 3-dimensional vector r, where r = m * v.
- */
-SpiderGL.Math.Mat3.mul3 = function (m, v) {
- return [
- m[0]*v[0] + m[3]*v[1] + m[6]*v[2],
- m[1]*v[0] + m[4]*v[1] + m[7]*v[2],
- m[2]*v[0] + m[5]*v[1] + m[8]*v[2]
- ];
-}
-/*---------------------------------------------------------*/
-
-
-
-// 4x4 matrix
-/*---------------------------------------------------------*/
-
-/**
- * The SpiderGL.Math.Mat4 namespace.
- * The provided functions operate on 4x4 matrices, represented as standard JavaScript arrays of length 16.
- * In general, matrices are considered in column-major format.
- *
- * @namespace The SpiderGL.Math.Mat4 namespace defines operations on 4x4 matrices.
- */
-SpiderGL.Math.Mat4 = { };
-
-/**
- * Duplicates the input 4x4 matrix.
- *
- * @param {array} n The input matrix.
- *
- * @returns {array} A 16-component array r, where r[i] = m[i] (same as m.slice(0, 16)).
- */
-SpiderGL.Math.Mat4.dup = function (m) {
- return m.slice(0, 16);
-}
-
-/**
- * Creates a 4x4 matrix initialized with a scalar.
- *
- * @param {number} s The input scalar.
- *
- * @returns {array} A 16-component array r, where r[i] = s.
- */
-SpiderGL.Math.Mat4.scalar = function (s) {
- return [
- s, s, s, s,
- s, s, s, s,
- s, s, s, s,
- s, s, s, s
- ];
-}
-
-/**
- * Creates a 4x4 matrix initialized with zero.
- *
- * @returns {array} A 16-component array r, where r[i] = 0.
- */
-SpiderGL.Math.Mat4.zero = function () {
- return [
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0
- ];
-}
-
-/**
- * Creates a 4x4 matrix initialized with one.
- *
- * @returns {array} A 16-component array r, where r[i] = 1.
- */
-SpiderGL.Math.Mat4.one = function () {
- return [
- 1, 1, 1, 1,
- 1, 1, 1, 1,
- 1, 1, 1, 1,
- 1, 1, 1, 1
- ];
-}
-
-/**
- * Creates a diagonal 4x4 matrix.
- *
- * @param {array} d A 4-dimensional vector
- *
- * @returns {array} A 16-component array representing a 4x4 matrix with diagonal elements set to d.
- */
-SpiderGL.Math.Mat4.diag = function (d) {
- return [
- d[0], 0, 0, 0,
- 0, d[0], 0, 0,
- 0, 0, d[0], 0,
- 0, 0, 0, d[0]
- ];
-}
-
-/**
- * Creates an identity 4x4 matrix.
- *
- * @returns {array} A 16-component array representing an identity 4x4 matrix.
- */
-SpiderGL.Math.Mat4.identity = function () {
- return [
- 1, 0, 0, 0,
- 0, 1, 0, 0,
- 0, 0, 1, 0,
- 0, 0, 0, 1
- ];
-}
-
-/**
- * Extracts the upper-left 3x3 matrix from a 4x4 matrix.
- *
- * @param {array} m The input matrix.
- *
- * @returns {array} A 9-component array representing the upper-left 3x3 matrix.
- */
-SpiderGL.Math.Mat4.to33 = function (m) {
- return [
- m[ 0], m[ 1], m[ 2],
- m[ 4], m[ 5], m[ 6],
- m[ 8], m[ 9], m[10]
- ];
-}
-
-/**
- * Gets an element of a 4x4 matrix.
- *
- * @param {array} m The input matrix.
- * @param {number} row The element row index.
- * @param {number} col The element column index.
- *
- * @returns {number} The value of the (i-th, j-th) element of m.
- */
-SpiderGL.Math.Mat4.elem = function (m, row, col) {
- return m[row+col*4];
-}
-
-/**
- * Sets an element of a 4x4 matrix.
- *
- * @param {array} m The input matrix.
- * @param {number} row The element row index.
- * @param {number} col The element column index.
- * @param {number} value The element value to set.
- */
-SpiderGL.Math.Mat4.elem$ = function (m, row, col, value) {
- m[row+col*4] = value;
-}
-
-/**
- * Gets a row of a 4x4 matrix.
- *
- * @param {array} m The input matrix.
- * @param {number} row The row index.
- *
- * @returns {array} A 4-component array representing the row-th row of m.
- */
-SpiderGL.Math.Mat4.row = function (m, row) {
- return [m[row+0], m[row+4], m[row+8], m[row+12]];
-}
-
-/**
- * Sets a row of a 4x4 matrix.
- *
- * @param {array} m The input matrix.
- * @param {number} row The row index.
- * @param {array} v A 4-component array that will be copied to the row-th row of m.
- */
-SpiderGL.Math.Mat4.row$ = function (m, row, v) {
- m[row+ 0] = v[0];
- m[row+ 4] = v[1];
- m[row+ 8] = v[2];
- m[row+12] = v[3];
-}
-
-/**
- * Gets a column of a 4x4 matrix.
- *
- * @param {array} m The input matrix.
- * @param {number} col The column index.
- *
- * @returns {array} A 4-component array representing the col-th column of m.
- */
-SpiderGL.Math.Mat4.col = function (m, col) {
- var i = col * 4;
- return [m[i+0], m[i+1], m[i+2], m[i+3]];
-}
-
-/**
- * Sets a column of a 4x4 matrix.
- *
- * @param {array} m The input matrix.
- * @param {number} col The column index.
- * @param {array} v A 4-component array that will be copied to the col-th column of m.
- */
-SpiderGL.Math.Mat4.col$ = function (m, col, v) {
- var i = col * 4;
- m[i+0] = v[0];
- m[i+1] = v[1];
- m[i+2] = v[2];
- m[i+3] = v[3];
-}
-
-/**
- * Tests whether a 4x4 matrix is the identity matrix.
- *
- * @param {array} m The input matrix.
- *
- * @return {bool} True if the input matrix is the identity matrix, false otherwise.
- */
-SpiderGL.Math.Mat4.isIdentity = function (m) {
- return ((m[ 0] === 1) && (m[ 1] === 0) && (m[ 2] === 0) && (m[ 3] === 0) &&
- (m[ 4] === 0) && (m[ 5] === 1) && (m[ 6] === 0) && (m[ 7] === 0) &&
- (m[ 8] === 0) && (m[ 9] === 0) && (m[10] === 1) && (m[11] === 0) &&
- (m[12] === 0) && (m[13] === 0) && (m[14] === 0) && (m[15] === 1));
-}
-
-/**
- * Component-wise negation of a 4x4 matrix.
- *
- * @param {array} m The input matrix.
- *
- * @return {array} A 4x4 matrix r, where r[i] = -m[i].
- */
-SpiderGL.Math.Mat4.neg = function (m) {
- return [
- -m[ 0], -m[ 1], -m[ 2], -m[ 3],
- -m[ 4], -m[ 5], -m[ 6], -m[ 7],
- -m[ 8], -m[ 9], -m[10], -m[11],
- -m[12], -m[13], -m[14], -m[15]
- ];
-}
-
-/**
- * Component-wise addition of two 4x4 matrices.
- *
- * @param {array} a The first input matrix.
- * @param {array} b The first input matrix.
- *
- * @return {array} A 4x4 matrix r, where r[i] = a[i] + b[i].
- */
-SpiderGL.Math.Mat4.add = function (a, b) {
- return [
- a[ 0]+b[ 0], a[ 1]+b[ 1], a[ 2]+b[ 2], a[ 3]+b[ 3],
- a[ 4]+b[ 4], a[ 5]+b[ 5], a[ 6]+b[ 6], a[ 7]+b[ 7],
- a[ 8]+b[ 8], a[ 9]+b[ 9], a[10]+b[10], a[11]+b[11],
- a[12]+b[12], a[13]+b[13], a[14]+b[14], a[15]+b[15]
- ];
-}
-
-/**
- * Component-wise addition of two 4x4 matrices.
- *
- * @param {array} a The first input matrix.
- * @param {array} b The first input matrix.
- *
- * @return {array} A 4x4 matrix r, where r[i] = a[i] - b[i].
- */
-SpiderGL.Math.Mat4.sub = function (a, b) {
- return [
- a[ 0]-b[ 0], a[ 1]-b[ 1], a[ 2]-b[ 2], a[ 3]-b[ 3],
- a[ 4]-b[ 4], a[ 5]-b[ 5], a[ 6]-b[ 6], a[ 7]-b[ 7],
- a[ 8]-b[ 8], a[ 9]-b[ 9], a[10]-b[10], a[11]-b[11],
- a[12]-b[12], a[13]-b[13], a[14]-b[14], a[15]-b[15]
- ];
-}
-
-/**
- * Multiplies of two column-major 4x4 matrices.
- *
- * @param {array} a The first input matrix.
- * @param {array} b The first input matrix.
- *
- * @return {array} A 4x4 matrix r, result of matrix multiplication r = a * b.
- */
-SpiderGL.Math.Mat4.mul = function (a, b) {
- var a0 = a[ 0], a1 = a[ 1], a2 = a[ 2], a3 = a[ 3],
- a4 = a[ 4], a5 = a[ 5], a6 = a[ 6], a7 = a[ 7],
- a8 = a[ 8], a9 = a[ 9], a10 = a[10], a11 = a[11],
- a12 = a[12], a13 = a[13], a14 = a[14], a15 = a[15],
-
- b0 = b[ 0], b1 = b[ 1], b2 = b[ 2], b3 = b[ 3],
- b4 = b[ 4], b5 = b[ 5], b6 = b[ 6], b7 = b[ 7],
- b8 = b[ 8], b9 = b[ 9], b10 = b[10], b11 = b[11],
- b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15];
-
- return [
- a0*b0 + a4*b1 + a8*b2 + a12*b3,
- a1*b0 + a5*b1 + a9*b2 + a13*b3,
- a2*b0 + a6*b1 + a10*b2 + a14*b3,
- a3*b0 + a7*b1 + a11*b2 + a15*b3,
-
- a0*b4 + a4*b5 + a8*b6 + a12*b7,
- a1*b4 + a5*b5 + a9*b6 + a13*b7,
- a2*b4 + a6*b5 + a10*b6 + a14*b7,
- a3*b4 + a7*b5 + a11*b6 + a15*b7,
-
- a0*b8 + a4*b9 + a8*b10 + a12*b11,
- a1*b8 + a5*b9 + a9*b10 + a13*b11,
- a2*b8 + a6*b9 + a10*b10 + a14*b11,
- a3*b8 + a7*b9 + a11*b10 + a15*b11,
-
- a0*b12 + a4*b13 + a8*b14 + a12*b15,
- a1*b12 + a5*b13 + a9*b14 + a13*b15,
- a2*b12 + a6*b13 + a10*b14 + a14*b15,
- a3*b12 + a7*b13 + a11*b14 + a15*b15
- ];
-}
-
-/**
- * Component-wise multiplication of a 4x4 matrix and a scalar.
- *
- * @param {array} m The matrix operand.
- * @param {number} s The scalar operand.
- *
- * @returns {array} A 4x4 matrix r, where r[i] = m[i] * s.
- */
-SpiderGL.Math.Mat4.muls = function (m, s) {
- return [
- m[ 0]*s, m[ 1]*s, m[ 2]*s, m[ 3]*s,
- m[ 4]*s, m[ 5]*s, m[ 6]*s, m[ 7]*s,
- m[ 8]*s, m[ 9]*s, m[10]*s, m[11]*s,
- m[12]*s, m[13]*s, m[14]*s, m[15]*s
- ];
-}
-
-/**
- * Pre-multiplies a 3-dimensional vector by a column-major 4x4 matrix.
- *
- * @param {array} m The input column-major 4x4 matrix.
- * @param {array} v The input 3-dimensional vector.
- * @param {number} [w=1] The 4th component of the input 3-dimensional vector.
- *
- * @return {array} A 3-dimensional vector r, where r = m * v.
- */
-SpiderGL.Math.Mat4.mul3 = function (m, v, w) {
- w = (w == undefined) ? (1) : (w);
- return [
- m[ 0]*v[0] + m[ 4]*v[1] + m[ 8]*v[2] + m[12]*w,
- m[ 1]*v[0] + m[ 5]*v[1] + m[ 9]*v[2] + m[13]*w,
- m[ 2]*v[0] + m[ 6]*v[1] + m[10]*v[2] + m[14]*w /* ,
- m[ 3]*v[0] + m[ 7]*v[1] + m[11]*v[2] + m[15]*w */
- ];
-}
-
-/**
- * Pre-multiplies a 4-dimensional vector by a column-major 4x4 matrix.
- *
- * @param {array} m The input column-major 4x4 matrix.
- * @param {array} v The input 4-dimensional vector.
- *
- * @return {array} A 4-dimensional vector r, where r = m * v.
- */
-SpiderGL.Math.Mat4.mul4 = function (m, v) {
- return [
- m[ 0]*v[0] + m[ 4]*v[1] + m[ 8]*v[2] + m[12]*v[3],
- m[ 1]*v[0] + m[ 5]*v[1] + m[ 9]*v[2] + m[13]*v[3],
- m[ 2]*v[0] + m[ 6]*v[1] + m[10]*v[2] + m[14]*v[3],
- m[ 3]*v[0] + m[ 7]*v[1] + m[11]*v[2] + m[15]*v[3]
- ];
-}
-
-/**
- * Component-wise reciprocal of a 4x4 matrix.
- *
- * @param {array} m The input matrix.
- *
- * @returns {array} A 4x4 matrix r, where r[i] = 1 / m[i].
- */
-SpiderGL.Math.Mat4.rcp = function (m) {
- return [
- 1/m[ 0], 1/m[ 1], 1/m[ 2], 1/m[ 3],
- 1/m[ 4], 1/m[ 5], 1/m[ 6], 1/m[ 7],
- 1/m[ 8], 1/m[ 9], 1/m[10], 1/m[11],
- 1/m[12], 1/m[13], 1/m[14], 1/m[15]
- ];
-}
-
-/**
- * Component-wise multiplication of two 4x4 matrices.
- *
- * @param {array} a The first matrix.
- * @param {array} b The second matrix.
- *
- * @returns {array} A 4x4 matrix r, where r[i] = a[i] * b[i].
- */
-SpiderGL.Math.Mat4.compMul = function (a, b) {
- return [
- a[ 0]*b[ 0], a[ 1]*b[ 1], a[ 2]*b[ 2], a[ 3]*b[ 3],
- a[ 4]*b[ 4], a[ 5]*b[ 5], a[ 6]*b[ 6], a[ 7]*b[ 7],
- a[ 8]*b[ 8], a[ 9]*b[ 9], a[10]*b[10], a[11]*b[11],
- a[12]*b[12], a[13]*b[13], a[14]*b[14], a[15]*b[15]
- ];
-}
-
-/**
- * Component-wise division of two 4x4 matrices.
- *
- * @param {array} a The first matrix.
- * @param {array} b The second matrix.
- *
- * @returns {array} A 4x4 matrix r, where r[i] = a[i] / b[i].
- */
-SpiderGL.Math.Mat4.compDiv = function (a, b) {
- return [
- a[ 0]/b[ 0], a[ 1]/b[ 1], a[ 2]/b[ 2], a[ 3]/b[ 3],
- a[ 4]/b[ 4], a[ 5]/b[ 5], a[ 6]/b[ 6], a[ 7]/b[ 7],
- a[ 8]/b[ 8], a[ 9]/b[ 9], a[10]/b[10], a[11]/b[11],
- a[12]/b[12], a[13]/b[13], a[14]/b[14], a[15]/b[15]
- ];
-}
-
-/**
- * Creates the transpose of a 4x4 matrix.
- *
- * @param {array} m The input matrix.
- *
- * @returns {array} A 4x4 matrix representing the transpose of m.
- */
-SpiderGL.Math.Mat4.transpose = function (m) {
- return [
- m[ 0], m[ 4], m[ 8], m[12],
- m[ 1], m[ 5], m[ 9], m[13],
- m[ 2], m[ 6], m[10], m[14],
- m[ 3], m[ 7], m[11], m[15]
- ];
-}
-
-/**
- * Calculates the determinant of a 4x4 matrix.
- *
- * @param {array} m The input matrix.
- *
- * @returns {number} The determinant of m.
- */
-SpiderGL.Math.Mat4.determinant = function (m) {
- var m0 = m[ 0], m1 = m[ 1], m2 = m[ 2], m3 = m[ 3],
- m4 = m[ 4], m5 = m[ 5], m6 = m[ 6], m7 = m[ 7],
- m8 = m[ 8], m9 = m[ 9], m10 = m[10], m11 = m[11],
- m12 = m[12], m13 = m[13], m14 = m[14], m15 = m[15];
-
- return (m12 * m9 * m6 * m3 - m8 * m13 * m6 * m3 - m12 * m5 * m10 * m3 + m4 * m13 * m10 * m3 +
- m8 * m5 * m14 * m3 - m4 * m9 * m14 * m3 - m12 * m9 * m2 * m7 + m8 * m13 * m2 * m7 +
- m12 * m1 * m10 * m7 - m0 * m13 * m10 * m7 - m8 * m1 * m14 * m7 + m0 * m9 * m14 * m7 +
- m12 * m5 * m2 * m11 - m4 * m13 * m2 * m11 - m12 * m1 * m6 * m11 + m0 * m13 * m6 * m11 +
- m4 * m1 * m14 * m11 - m0 * m5 * m14 * m11 - m8 * m5 * m2 * m15 + m4 * m9 * m2 * m15 +
- m8 * m1 * m6 * m15 - m0 * m9 * m6 * m15 - m4 * m1 * m10 * m15 + m0 * m5 * m10 * m15);
-}
-
-/**
- * Calculates the inverse of a 4x4 matrix.
- *
- * @param {array} m The input matrix.
- *
- * @returns {array} A 4x4 matrix representing the inverse of m.
- */
-SpiderGL.Math.Mat4.inverse = function (m) {
- var m0 = m[ 0], m1 = m[ 1], m2 = m[ 2], m3 = m[ 3],
- m4 = m[ 4], m5 = m[ 5], m6 = m[ 6], m7 = m[ 7],
- m8 = m[ 8], m9 = m[ 9], m10 = m[10], m11 = m[11],
- m12 = m[12], m13 = m[13], m14 = m[14], m15 = m[15];
-
- var d = 1 / (
- m12 * m9 * m6 * m3 - m8 * m13 * m6 * m3 - m12 * m5 * m10 * m3 + m4 * m13 * m10 * m3 +
- m8 * m5 * m14 * m3 - m4 * m9 * m14 * m3 - m12 * m9 * m2 * m7 + m8 * m13 * m2 * m7 +
- m12 * m1 * m10 * m7 - m0 * m13 * m10 * m7 - m8 * m1 * m14 * m7 + m0 * m9 * m14 * m7 +
- m12 * m5 * m2 * m11 - m4 * m13 * m2 * m11 - m12 * m1 * m6 * m11 + m0 * m13 * m6 * m11 +
- m4 * m1 * m14 * m11 - m0 * m5 * m14 * m11 - m8 * m5 * m2 * m15 + m4 * m9 * m2 * m15 +
- m8 * m1 * m6 * m15 - m0 * m9 * m6 * m15 - m4 * m1 * m10 * m15 + m0 * m5 * m10 * m15);
-
- return [
- d * (m9*m14*m7-m13*m10*m7+m13*m6*m11-m5*m14*m11-m9*m6*m15+m5*m10*m15),
- d * (m13*m10*m3-m9*m14*m3-m13*m2*m11+m1*m14*m11+m9*m2*m15-m1*m10*m15),
- d * (m5*m14*m3-m13*m6*m3+m13*m2*m7-m1*m14*m7-m5*m2*m15+m1*m6*m15),
- d * (m9*m6*m3-m5*m10*m3-m9*m2*m7+m1*m10*m7+m5*m2*m11-m1*m6*m11),
-
- d * (m12*m10*m7-m8*m14*m7-m12*m6*m11+m4*m14*m11+m8*m6*m15-m4*m10*m15),
- d * (m8*m14*m3-m12*m10*m3+m12*m2*m11-m0*m14*m11-m8*m2*m15+m0*m10*m15),
- d * (m12*m6*m3-m4*m14*m3-m12*m2*m7+m0*m14*m7+m4*m2*m15-m0*m6*m15),
- d * (m4*m10*m3-m8*m6*m3+m8*m2*m7-m0*m10*m7-m4*m2*m11+m0*m6*m11),
-
- d * (m8*m13*m7-m12*m9*m7+m12*m5*m11-m4*m13*m11-m8*m5*m15+m4*m9*m15),
- d * (m12*m9*m3-m8*m13*m3-m12*m1*m11+m0*m13*m11+m8*m1*m15-m0*m9*m15),
- d * (m4*m13*m3-m12*m5*m3+m12*m1*m7-m0*m13*m7-m4*m1*m15+m0*m5*m15),
- d * (m8*m5*m3-m4*m9*m3-m8*m1*m7+m0*m9*m7+m4*m1*m11-m0*m5*m11),
-
- d * (m12*m9*m6-m8*m13*m6-m12*m5*m10+m4*m13*m10+m8*m5*m14-m4*m9*m14),
- d * (m8*m13*m2-m12*m9*m2+m12*m1*m10-m0*m13*m10-m8*m1*m14+m0*m9*m14),
- d * (m12*m5*m2-m4*m13*m2-m12*m1*m6+m0*m13*m6+m4*m1*m14-m0*m5*m14),
- d * (m4*m9*m2-m8*m5*m2+m8*m1*m6-m0*m9*m6-m4*m1*m10+m0*m5*m10)
- ];
-}
-
-/**
- * Calculates the inverse transpose of the upper-left 3x3 matrix of a 4x4 matrix.
- *
- * @param {array} m The input matrix.
- *
- * @returns {array} A 3x3 matrix representing the inverse transpose of the upper-left 3x3 matrix of m.
- */
-SpiderGL.Math.Mat4.inverseTranspose33 = function (m) {
- var m11 = m[ 0], m21 = m[ 1], m31 = m[ 2],
- m12 = m[ 4], m22 = m[ 5], m32 = m[ 6],
- m13 = m[ 8], m23 = m[ 9], m33 = m[10];
-
- var d = 1 / (m11*(m33*m22 - m32*m23) - m21*(m33*m12 - m32*m13) + m31*(m23*m12 - m22*m13));
-
- return [
- d * (m33*m22 - m32*m23), d * (m32*m13 - m33*m12), d * (m23*m12 - m22*m13),
- d * (m31*m23 - m33*m21), d * (m33*m11 - m31*m13), d * (m21*m13 - m23*m11),
- d * (m32*m21 - m31*m22), d * (m31*m12 - m32*m11), d * (m22*m11 - m21*m12)
- ];
-}
-
-/**
- * Calculates the trace (i.e. the sum of the diagonal elements) of a 4x4 matrix.
- *
- * @param {array} m The input matrix.
- *
- * @returns {number} The trace of m.
- */
-SpiderGL.Math.Mat4.trace = function (m) {
- return (m[0] + m[5] + m[10] + m[15]);
-}
-
-/**
- * Creates a column-major 4x4 translation matrix.
- * The input translation vector will be placed on the 4th column of an identity matrix.
- *
- * @param {array} v A 3-dimensional vector with translation offsets.
- *
- * @returns {array} A column-major 4x4 translation matrix.
- */
-SpiderGL.Math.Mat4.translation = function (v) {
- return [
- 1, 0, 0, 0,
- 0, 1, 0, 0,
- 0, 0, 1, 0,
- v[0], v[1], v[2], 1
- ];
-}
-
-/**
- * Creates a column-major 4x4 rotation matrix.
- * The returned matrix will represent a counter-clockwise rotation about the input axis by the input angle in radians.
- * The input axis need not to be normalized.
- *
- * @param {number} angle The counter-clockwise rotation angle, in radians.
- * @param {array} axis A 3-dimensional vector representing the rotation axis.
- *
- * @returns {array} A column-major 4x4 rotation matrix.
- */
-SpiderGL.Math.Mat4.rotationAngleAxis = function (angle, axis) {
- var ax = SpiderGL.Math.Vec3.normalize(axis);
- var s = SpiderGL.Math.sin(angle);
- var c = SpiderGL.Math.cos(angle);
- var q = 1 - c;
-
- var x = ax[0];
- var y = ax[1];
- var z = ax[2];
-
- var xx, yy, zz, xy, yz, zx, xs, ys, zs;
-
- xx = x * x;
- yy = y * y;
- zz = z * z;
- xy = x * y;
- yz = y * z;
- zx = z * x;
- xs = x * s;
- ys = y * s;
- zs = z * s;
-
- return [
- (q * xx) + c, (q * xy) + zs, (q * zx) - ys, 0,
- (q * xy) - zs, (q * yy) + c, (q * yz) + xs, 0,
- (q * zx) + ys, (q * yz) - xs, (q * zz) + c, 0,
- 0, 0, 0, 1
- ];
-}
-
-/**
- * Creates a column-major 4x4 scaling matrix.
- *
- * @param {array} v The scaling amount as a 3-dimensional array.
- *
- * @returns {array} A 4x4 scaling matrix.
- */
-SpiderGL.Math.Mat4.scaling = function (v) {
- return [
- v[0], 0, 0, 0,
- 0, v[0], 0, 0,
- 0, 0, v[0], 0,
- 0, 0, 0, 1
- ];
-}
-
-/**
- * Creates a column-major 4x4 look-at matrix.
- *
- * @param {array} position The viewer's position as a 3-dimensional vector.
- * @param {array} target The viewer's look-at point as a 3-dimensional vector.
- * @param {array} position The viewer's up vector as a 3-dimensional vector.
- *
- * @returns {array} A column-major 4x4 look-at matrix.
- */
-SpiderGL.Math.Mat4.lookAt = function (position, target, up) {
- var v = SpiderGL.Math.Vec3.normalize(SpiderGL.Math.Vec3.sub(target, position));
- var u = SpiderGL.Math.Vec3.normalize(up);
- var s = SpiderGL.Math.Vec3.normalize(SpiderGL.Math.Vec3.cross(v, u));
-
- u = SpiderGL.Math.Vec3.cross(s, v);
-
- var m = [
- s[0], u[0], -v[0], 0,
- s[1], u[1], -v[1], 0,
- s[2], u[2], -v[2], 0,
- 0, 0, 0, 1
- ];
-
- return SpiderGL.Math.Mat4.translate$(m, SpiderGL.Math.Vec3.neg(position));
-}
-
-/**
- * Creates a column-major 4x4 orthographic projection matrix.
- *
- * @param {array} min A 3-component array with the minimum coordinates of the parallel viewing volume.
- * @param {array} max A 3-component array with the maximum coordinates of the parallel viewing volume.
- *
- * @returns {array} A column-major 4x4 orthographic projection matrix.
- */
-SpiderGL.Math.Mat4.ortho = function (min, max) {
- var sum = SpiderGL.Math.Vec3.add(max, min);
- var dif = SpiderGL.Math.Vec3.sub(max, min);
-
- return [
- 2 / dif[0], 0, 0, 0,
- 0, 2 / dif[1], 0, 0,
- 0, 0, -2 / dif[2], 0,
- -sum[0] / dif[0], -sum[1] / dif[1], -sum[2] / dif[2], 1
- ];
-}
-
-/**
- * Creates a column-major 4x4 frustum matrix.
- *
- * @param {array} min A 3-component array with the minimum coordinates of the frustum volume.
- * @param {array} max A 3-component array with the maximum coordinates of the frustum volume.
- *
- * @returns {array} A column-major 4x4 frustum matrix.
- */
-SpiderGL.Math.Mat4.frustum = function (min, max) {
- var sum = SpiderGL.Math.Vec3.add(max, min);
- var dif = SpiderGL.Math.Vec3.sub(max, min);
- var t = 2.0 * min[2];
-
- return [
- t / dif[0], 0, 0, 0,
- 0, t / dif[1], 0, 0,
- sum[0] / dif[0], sum[1] / dif[1], -sum[2] / dif[2], -1,
- 0, 0, -t * max[2] / dif[2], 0
- ];
-}
-
-/**
- * Creates a column-major 4x4 perspective projection matrix.
- *
- * @param {number} fovY The vertical field-of-view angle, in radians.
- * @param {number} aspectRatio The projection plane aspect ratio.
- * @param {number} zNear The distance of the near clipping plane.
- * @param {number} zFar The distance of the far clipping plane.
- *
- * @returns {array} A column-major 4x4 perspective projection matrix.
- */
-SpiderGL.Math.Mat4.perspective = function (fovY, aspectRatio, zNear, zFar) {
- var a = zNear * SpiderGL.Math.tan(fovY / 2);
- var b = a * aspectRatio;
-
- return SpiderGL.Math.Mat4.frustum([-b, -a, zNear], [b, a, zFar]);
-}
-
-/**
- * Copies a 4x4 matrix.
- *
- * @param {array} dst The destination 4x4 matrix.
- * @param {array} src The source 4x4 matrix.
- *
- * @returns {array} The input matrix dst, where dst[i] = src[i].
- */
-SpiderGL.Math.Mat4.copy$ = function (dst, src) {
- for (var i=0; i<16; ++i) {
- dst[i] = src[i];
- }
- return dst;
-}
-
-/**
- * Sets a 4x4 matrix as the identity matrix.
- *
- * @param {array} m The input 4x4 matrix to be set as identity.
- *
- * @returns {array} The input matrix m.
- */
-SpiderGL.Math.Mat4.identity$ = function (m) {
- m[ 0] = 1; m[ 1] = 0; m[ 2] = 0; m[ 3] = 0;
- m[ 4] = 0; m[ 5] = 1; m[ 6] = 0; m[ 7] = 0;
- m[ 8] = 0; m[ 9] = 0; m[10] = 1; m[11] = 0;
- m[12] = 0; m[13] = 0; m[14] = 0; m[15] = 1;
- return m;
-}
-
-/**
- * In-place negation of a 4x4 matrix.
- *
- * @param {array} m The input 4x4 matrix.
- *
- * @returns {array} The input matrix m, where m[i] = -m[i].
- */
-SpiderGL.Math.Mat4.neg$ = function (m) {
- for (var i=0; i<16; ++i) {
- m[i] = -m[i];
- }
- return m;
-}
-
-/**
- * In-place addition of two 4x4 matrices.
- *
- * @param {array} a The first 4x4 input matrix.
- * @param {array} b The second 4x4 input matrix.
- *
- * @returns {array} The input matrix a, where a[i] = a[i] + b[i].
- */
-SpiderGL.Math.Mat4.add$ = function (a, b) {
- for (var i=0; i<16; ++i) {
- a[i] += b[i];
- }
- return a;
-}
-
-/**
- * In-place subtraction of two 4x4 matrices.
- *
- * @param {array} a The first 4x4 input matrix.
- * @param {array} b The second 4x4 input matrix.
- *
- * @returns {array} The input matrix a, where a[i] = a[i] - b[i].
- */
-SpiderGL.Math.Mat4.sub$ = function (a, b) {
- for (var i=0; i<16; ++i) {
- a[i] -= b[i];
- }
- return a;
-}
-
-/**
- * In-place multiplication of two 4x4 matrices.
- *
- * @param {array} a The first 4x4 input matrix.
- * @param {array} b The second 4x4 input matrix.
- *
- * @returns {array} The input matrix a, where a = a * b.
- */
-SpiderGL.Math.Mat4.mul$ = function (a, b) {
- var a0 = a[ 0], a1 = a[ 1], a2 = a[ 2], a3 = a[ 3],
- a4 = a[ 4], a5 = a[ 5], a6 = a[ 6], a7 = a[ 7],
- a8 = a[ 8], a9 = a[ 9], a10 = a[10], a11 = a[11],
- a12 = a[12], a13 = a[13], a14 = a[14], a15 = a[15],
-
- b0 = b[ 0], b1 = b[ 1], b2 = b[ 2], b3 = b[ 3],
- b4 = b[ 4], b5 = b[ 5], b6 = b[ 6], b7 = b[ 7],
- b8 = b[ 8], b9 = b[ 9], b10 = b[10], b11 = b[11],
- b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15];
-
- a[ 0] = a0*b0 + a4*b1 + a8*b2 + a12*b3;
- a[ 1] = a1*b0 + a5*b1 + a9*b2 + a13*b3;
- a[ 2] = a2*b0 + a6*b1 + a10*b2 + a14*b3;
- a[ 3] = a3*b0 + a7*b1 + a11*b2 + a15*b3;
-
- a[ 4] = a0*b4 + a4*b5 + a8*b6 + a12*b7;
- a[ 5] = a1*b4 + a5*b5 + a9*b6 + a13*b7;
- a[ 6] = a2*b4 + a6*b5 + a10*b6 + a14*b7;
- a[ 7] = a3*b4 + a7*b5 + a11*b6 + a15*b7;
-
- a[ 8] = a0*b8 + a4*b9 + a8*b10 + a12*b11;
- a[ 9] = a1*b8 + a5*b9 + a9*b10 + a13*b11;
- a[10] = a2*b8 + a6*b9 + a10*b10 + a14*b11;
- a[11] = a3*b8 + a7*b9 + a11*b10 + a15*b11;
-
- a[12] = a0*b12 + a4*b13 + a8*b14 + a12*b15;
- a[13] = a1*b12 + a5*b13 + a9*b14 + a13*b15;
- a[14] = a2*b12 + a6*b13 + a10*b14 + a14*b15;
- a[15] = a3*b12 + a7*b13 + a11*b14 + a15*b15;
-
- return a;
-}
-
-/**
- * In-place subtraction of a 4x4 matrix and a scalar.
- *
- * @param {array} m The 4x4 input matrix.
- * @param {number} s The input scalar.
- *
- * @returns {array} The input matrix m, where m[i] = m[i] * s.
- */
-SpiderGL.Math.Mat4.muls$ = function (m, s) {
- for (var i=0; i<16; ++i) {
- m[i] *= s;
- }
- return m;
-}
-
-/**
- * In-place component-wise multiplication of two 4x4 matrices.
- *
- * @param {array} a The first 4x4 input matrix.
- * @param {array} b The second 4x4 input matrix.
- *
- * @returns {array} The input matrix a, where a[i] = a[i] * b[i].
- */
-SpiderGL.Math.Mat4.compMul$ = function (a, b) {
- for (var i=0; i<16; ++i) {
- a[i] *= b[i];
- }
- return a;
-}
-
-/**
- * In-place component-wise division of two 4x4 matrices.
- *
- * @param {array} a The first 4x4 input matrix.
- * @param {array} b The second 4x4 input matrix.
- *
- * @returns {array} The input matrix a, where a[i] = a[i] / b[i].
- */
-SpiderGL.Math.Mat4.compDiv$ = function (a, b) {
- for (var i=0; i<16; ++i) {
- a[i] /= b[i];
- }
- return a;
-}
-
-/**
- * In-place transpose of a 4x4 matrix.
- *
- * @param {array} m The 4x4 input matrix.
- *
- * @returns {array} The transposed input matrix m.
- */
-SpiderGL.Math.Mat4.transpose$ = function (m) {
- var t;
- t = m[ 1]; m[ 1] = m[ 4]; m[ 4] = t;
- t = m[ 2]; m[ 2] = m[ 8]; m[ 8] = t;
- t = m[ 3]; m[ 3] = m[12]; m[12] = t;
- t = m[ 6]; m[ 6] = m[ 9]; m[ 9] = t;
- t = m[ 7]; m[ 7] = m[13]; m[13] = t;
- t = m[11]; m[11] = m[14]; m[14] = t;
- return m;
-}
-
-/**
- * In-place inversion of a 4x4 matrix.
- *
- * @param {array} m The 4x4 input matrix.
- *
- * @returns {array} The inverted input matrix m.
- */
-SpiderGL.Math.Mat4.invert$ = function (m) {
- var m0 = m[ 0], m1 = m[ 1], m2 = m[ 2], m3 = m[ 3],
- m4 = m[ 4], m5 = m[ 5], m6 = m[ 6], m7 = m[ 7],
- m8 = m[ 8], m9 = m[ 9], m10 = m[10], m11 = m[11],
- m12 = m[12], m13 = m[13], m14 = m[14], m15 = m[15];
-
- var d = 1.0 / (
- m12 * m9 * m6 * m3 - m8 * m13 * m6 * m3 - m12 * m5 * m10 * m3 + m4 * m13 * m10 * m3 +
- m8 * m5 * m14 * m3 - m4 * m9 * m14 * m3 - m12 * m9 * m2 * m7 + m8 * m13 * m2 * m7 +
- m12 * m1 * m10 * m7 - m0 * m13 * m10 * m7 - m8 * m1 * m14 * m7 + m0 * m9 * m14 * m7 +
- m12 * m5 * m2 * m11 - m4 * m13 * m2 * m11 - m12 * m1 * m6 * m11 + m0 * m13 * m6 * m11 +
- m4 * m1 * m14 * m11 - m0 * m5 * m14 * m11 - m8 * m5 * m2 * m15 + m4 * m9 * m2 * m15 +
- m8 * m1 * m6 * m15 - m0 * m9 * m6 * m15 - m4 * m1 * m10 * m15 + m0 * m5 * m10 * m15);
-
- m[ 0] = d * (m9*m14*m7-m13*m10*m7+m13*m6*m11-m5*m14*m11-m9*m6*m15+m5*m10*m15);
- m[ 1] = d * (m13*m10*m3-m9*m14*m3-m13*m2*m11+m1*m14*m11+m9*m2*m15-m1*m10*m15);
- m[ 2] = d * (m5*m14*m3-m13*m6*m3+m13*m2*m7-m1*m14*m7-m5*m2*m15+m1*m6*m15);
- m[ 3] = d * (m9*m6*m3-m5*m10*m3-m9*m2*m7+m1*m10*m7+m5*m2*m11-m1*m6*m11);
-
- m[ 4] = d * (m12*m10*m7-m8*m14*m7-m12*m6*m11+m4*m14*m11+m8*m6*m15-m4*m10*m15);
- m[ 5] = d * (m8*m14*m3-m12*m10*m3+m12*m2*m11-m0*m14*m11-m8*m2*m15+m0*m10*m15);
- m[ 6] = d * (m12*m6*m3-m4*m14*m3-m12*m2*m7+m0*m14*m7+m4*m2*m15-m0*m6*m15);
- m[ 7] = d * (m4*m10*m3-m8*m6*m3+m8*m2*m7-m0*m10*m7-m4*m2*m11+m0*m6*m11);
-
- m[ 8] = d * (m8*m13*m7-m12*m9*m7+m12*m5*m11-m4*m13*m11-m8*m5*m15+m4*m9*m15);
- m[ 9] = d * (m12*m9*m3-m8*m13*m3-m12*m1*m11+m0*m13*m11+m8*m1*m15-m0*m9*m15);
- m[10] = d * (m4*m13*m3-m12*m5*m3+m12*m1*m7-m0*m13*m7-m4*m1*m15+m0*m5*m15);
- m[11] = d * (m8*m5*m3-m4*m9*m3-m8*m1*m7+m0*m9*m7+m4*m1*m11-m0*m5*m11);
-
- m[12] = d * (m12*m9*m6-m8*m13*m6-m12*m5*m10+m4*m13*m10+m8*m5*m14-m4*m9*m14);
- m[13] = d * (m8*m13*m2-m12*m9*m2+m12*m1*m10-m0*m13*m10-m8*m1*m14+m0*m9*m14);
- m[14] = d * (m12*m5*m2-m4*m13*m2-m12*m1*m6+m0*m13*m6+m4*m1*m14-m0*m5*m14);
- m[15] = d * (m4*m9*m2-m8*m5*m2+m8*m1*m6-m0*m9*m6-m4*m1*m10+m0*m5*m10);
-
- return m;
-}
-
-/**
- * In-place column-major translation of a 4x4 matrix.
- *
- * @param {array} m The 4x4 input matrix.
- * @param {array} v The 3-dimensional translation vector.
- *
- * @returns {array} The translated input matrix m with the same result as m = m * t, where t is a translation matrix.
- */
-SpiderGL.Math.Mat4.translate$ = function (m, v) {
- var x = v[0],
- y = v[1],
- z = v[2];
-
- m[12] = m[ 0]*x + m[ 4]*y + m[ 8]*z + m[12];
- m[13] = m[ 1]*x + m[ 5]*y + m[ 9]*z + m[13];
- m[14] = m[ 2]*x + m[ 6]*y + m[10]*z + m[14];
- m[15] = m[ 3]*x + m[ 7]*y + m[11]*z + m[15];
-
- return m;
-}
-
-/**
- * In-place column-major rotation of a 4x4 matrix.
- * The input matrix m will be post-multiplied by a matrix r representing a counter-clockwise rotation about the input axis by the input angle in radians.
- * The input axis need not to be normalized.
- *
- * @param {array} m The input 4x4 matrix.
- * @param {number} angle The counter-clockwise rotation angle, in radians.
- * @param {array} axis A 3-dimensional vector representing the rotation axis.
- *
- * @returns {array} The rotated input matrix m with the same result as m = m * r, where r is a rotation matrix.
- */
-SpiderGL.Math.Mat4.rotateAngleAxis$ = function (m, angle, axis) {
- var r = SpiderGL.Math.Mat4.rotationAngleAxis(angle, axis);
- return SpiderGL.Math.Mat4.mul$(m, r);
-}
-
-/**
- * In-place column-major scaling of a 4x4 matrix.
- *
- * @param {array} m The 4x4 input matrix.
- * @param {array} v The scaling amount as a 3-dimensional array.
- *
- * @returns {array} The scaled input matrix m with the same result as m = m * s, where s is a scaling matrix.
- */
-SpiderGL.Math.Mat4.scale$ = function (m, v) {
- var x = v[0],
- y = v[1],
- z = v[2];
-
- m[ 0] *= x; m[ 1] *= x; m[ 2] *= x; m[ 3] *= x;
- m[ 4] *= y; m[ 5] *= y; m[ 6] *= y; m[ 7] *= y;
- m[ 8] *= z; m[ 9] *= z; m[10] *= z; m[11] *= z;
-
- return m;
-}
-
-/*---------------------------------------------------------*/
-
-
-
-// quaternion
-/*---------------------------------------------------------*/
-
-/**
- * The SpiderGL.Math.Quat namespace.
- * The provided functions operate on quaternions, represented as standard JavaScript arrays of length 4.
- *
- * @namespace The SpiderGL.Math.Quat namespace defines operations on quaternions.
- */
-SpiderGL.Math.Quat = { };
-
-/**
- * Duplicates the input quaternion.
- *
- * @param {array} n The input quaternion.
- *
- * @returns {array} A 4-component array r, where r[i] = q[i] (same as q.slice(0, 4)).
- */
-SpiderGL.Math.Quat.dup = function (q) {
- return q.slice(0, 4);
-}
-
-SpiderGL.Math.Quat.identity = function (q) {
- return [0, 0, 0, 1];
-}
-
-SpiderGL.Math.Quat.inverse = function (q) {
- return [-q[0], -q[1], -q[2], q[3]];
-}
-
-SpiderGL.Math.Quat.mul = function (p, q) {
- var px = p[0],
- py = p[1],
- pz = p[2],
- pw = p[3];
-
- var qx = q[0],
- qy = q[1],
- qz = q[2],
- qw = q[3];
-
- return [
- px*qw + pw*qx + pz*qy - py*qz,
- py*qw + pw*qy + px*qz - pz*qx,
- pz*qw + pw*qz + py*qx - px*qy,
- pw*qw - px*qx - py*qy - pz*qz
- ];
-}
-
-SpiderGL.Math.Quat.muls = function (q, s) {
- return [q[0]*s, q[1]*s, q[2]*s, q[3]*s];
-}
-
-SpiderGL.Math.Quat.normalize = function (q) {
- var s = 1 / SpiderGL.Math.sqrt(q[0]*q[0] + q[1]*q[1] + q[2]*q[2] + q[3]*q[3]);
- return SpiderGL.Math.Quat.muls(q, s);
-}
-
-SpiderGL.Math.Quat.from33 = function (m) {
- var m00 = m[0],
- m10 = m[1],
- m20 = m[2];
-
- var m01 = m[3],
- m11 = m[4],
- m21 = m[5];
-
- var m02 = m[6],
- m12 = m[7],
- m22 = m[8];
-
- var t = m00 + m11 + m22;
- var s;
-
- if (t > 0) {
- t = t + 1;
- s = 0.5 / SpiderGL.Math.sqrt(t);
- return [
- (m21 - m12) * s,
- (m02 - m20) * s,
- (m10 - m01) * s,
- t * s
- ];
- } else if ((m00 > m11) && (m00 > m22)) {
- t = m00 - m11 - m22 + 1;
- s = 0.5 / SpiderGL.Math.sqrt(t);
- return [
- t * s,
- (m10 + m01) * s,
- (m02 + m20) * s,
- (m21 - m12) * s,
- ];
- }
- else if (m11 > m22) {
- t = -m00 + m11 - m22 + 1;
- s = 0.5 / SpiderGL.Math.sqrt(t);
- return [
- (m10 + m01) * s,
- t * s,
- (m21 + m12) * s,
- (m02 - m20) * s
- ];
- }
- else {
- t = -m00 - m11 + m22 + 1;
- s = 0.5 / SpiderGL.Math.sqrt(t);
- return [
- (m02 + m20) * s,
- (m21 + m12) * s,
- t * s,
- (m10 - m01) * s
- ];
- }
-
- return null;
-}
-
-SpiderGL.Math.Quat.to33 = function (q) {
- var x = q[0],
- y = q[1],
- z = q[2],
- w = q[3];
-
- var xx = x*x,
- xy = x*y,
- xz = x*z,
- xw = x*w;
-
- var yy = y*y,
- yz = y*z,
- yw = y*w;
-
- var zz = z*z,
- zw = z*w;
-
- return [
- 1 - 2 * ( yy + zz ),
- 2 * ( xy + zw ),
- 2 * ( xz - yw ),
-
- 2 * ( xy - zw ),
- 1 - 2 * ( xx + zz ),
- 2 * ( yz + xw ),
-
- 2 * ( xz + yw ),
- 2 * ( yz - xw ),
- 1 - 2 * ( xx + yy )
- ];
-}
-
-SpiderGL.Math.Quat.from44 = function (m) {
- return SpiderGL.Math.Quat.from33(SpiderGL.Math.Mat4.to33(m));
-}
-
-SpiderGL.Math.Quat.to44 = function (q) {
- return SpiderGL.Math.Mat3.to44(SpiderGL.Math.Quat.to33(q));
-}
-
-SpiderGL.Math.Quat.fromAngleAxis = function (angle, axis) {
- return [0, 0, 0, 1];
-}
-
-SpiderGL.Math.Quat.toAngleAxis = function (q) {
- return [0, 0, 0, 1];
-}
-
-SpiderGL.Math.Quat.fromEulerAngles = function (x, y, z) {
- return [0, 0, 0, 1];
-}
-
-SpiderGL.Math.Quat.toEulerAngles = function (q) {
- return [0, 0, 0, 1];
-}
-
-SpiderGL.Math.Quat.copy$ = function (p, q) {
- p[0] = q[0];
- p[1] = q[1];
- p[2] = q[2];
- p[3] = q[3];
- return p;
-}
-
-SpiderGL.Math.Quat.identity$ = function (q) {
- q[0] = 0;
- q[1] = 0;
- q[2] = 0;
- q[3] = 1;
- return q;
-}
-
-SpiderGL.Math.Quat.invert$ = function (q) {
- q[0] = -q[0];
- q[1] = -q[1];
- q[2] = -q[2];
- return q;
-}
-
-SpiderGL.Math.Quat.mul$ = function (q) {
- var px = p[0],
- py = p[1],
- pz = p[2],
- pw = p[3];
-
- var qx = q[0],
- qy = q[1],
- qz = q[2],
- qw = q[3];
-
- q[0] = px*qw + pw*qx + pz*qy - py*qz;
- q[1] = py*qw + pw*qy + px*qz - pz*qx;
- q[2] = pz*qw + pw*qz + py*qx - px*qy;
- q[3] = pw*qw - px*qx - py*qy - pz*qz;
-
- return q;
-}
-
-SpiderGL.Math.Quat.muls$ = function (q, s) {
- q[0] *= s;
- q[1] *= s;
- q[2] *= s;
- q[3] *= s;
- return q;
-}
-
-SpiderGL.Math.Quat.normalize$ = function (q) {
- var s = 1 / SpiderGL.Math.sqrt(q[0]*q[0] + q[1]*q[1] + q[2]*q[2] + q[3]*q[3]);
- return SpiderGL.Math.Quat.muls$(q, s);
-}
-
-SpiderGL.Math.project = function (xyzw, modelViewProjectionMatrix, viewport, depthRange) {
- var v3 = SpiderGL.Math.Vec3;
- var m4 = SpiderGL.Math.Mat4;
-
- var r = m4.mul4(modelViewProjectionMatrix, xyzw);
- var invW = 1 / r[3];
- r[3] = invW;
-
- v3.muls$(r, invW / 2);
- v3.adds$(r, 0.5);
-
- v3.mul$(r, [viewport[2], viewport[3], depthRange[1] - depthRange[0]]);
- v3.add$(r, [viewport[0], viewport[1], depthRange[0]]);
-
- return r;
-};
-
-SpiderGL.Math.unproject = function (xyz, modelViewProjectionMatrixInverse, viewport, depthRange) {
- var v3 = SpiderGL.Math.Vec3;
- var m4 = SpiderGL.Math.Mat4;
-
- var r = v3.to4(xyz, 1.0);
-
- v3.sub$(r, [viewport[0], viewport[1], depthRange[0]]);
- v3.div$(r, [viewport[2], viewport[3], depthRange[1] - depthRange[0]]);
-
- v3.muls$(r, 2);
- v3.subs$(r, 1);
-
- r = m4.mul4(modelViewProjectionMatrixInverse, r);
- var invW = 1 / r[3];
- r[3] = invW;
-
- v3.muls$(r, invW);
-
- return r;
-};
-
diff --git a/src/common/script_system/meshlabfilterXMLspecificationformat.xsd b/src/common/script_system/meshlabfilterXMLspecificationformat.xsd
deleted file mode 100644
index 7005f4325..000000000
--- a/src/common/script_system/meshlabfilterXMLspecificationformat.xsd
+++ /dev/null
@@ -1,185 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/common/script_system/parser/js_lex.l b/src/common/script_system/parser/js_lex.l
deleted file mode 100644
index 5a204a4eb..000000000
--- a/src/common/script_system/parser/js_lex.l
+++ /dev/null
@@ -1,140 +0,0 @@
-
-%option noyywrap
-%option nounistd
-%x MLCOMMENTSTATE
-
-%{
-#include "js_parser.tab.hh"
-#include
-#include
-#include
-#include
-
-
-#define YY_DECL int yylex(yy::JSCacheParser::semantic_type* yylval,yy::JSCacheParser::location_type* yylloc)
-#define YY_USER_ACTION yylloc->columns(yyleng);
-
-typedef yy::JSCacheParser::token token;
-%}
-
-hex [0-9a-fA-F]
-dec [1-9][0-9]*
-oct [0-7]
-digit [0-9]
-letter [a-zA-Z]
-
-fract {digit}*\.{digit}+|{digit}+\.
-exp [eE][+-]?{digit}+
-
-hexfract {hex}*\.{hex}+|{hex}+\.
-binexp [pP][+-]?{digit}+
-
-icst ({dec}|0{oct}*|0[xX]{hex}+)
-
-%%
-
-%{
- yylloc->step();
-%}
-
-"*/" {BEGIN(INITIAL);}
-[^*\n]+ {}
-"*" {}
-\n {}
-"//"(.)* {}
-"/*" {BEGIN(MLCOMMENTSTATE);}
-"&&" {}
-"&=" {}
-"&" {}
-"break" {}
-"case" {}
-"catch" {}
-":" {return token::T_COLON;}
-"," {return token::T_COMMA;}
-"continue" {}
-"default" {}
-"delete" {}
-"/=" {}
-"/" {}
-"do" {}
-"." {return token::T_DOT;}
-"else" {}
-"===" {}
-"==" {}
-"=" {return token::T_EQ;}
-"finally" {}
-"for" {}
-"function" {return token::T_FUNCTION;}
-">>>=" {}
-">>=" {}
-">=" {}
-">>" {}
-">" {}
-"if" {}
-"in" {}
-"instanceof" {}
-"{" {return token::T_LBRACKET;}
-"[" {return token::T_LBRACE;}
-"<<=" {}
-"<<" {}
-"<=" {}
-"<" {}
-"(" {return token::T_LPAREN;}
-"--" {}
-"-=" {}
-"-" {}
-"new" {return token::T_NEW;}
-"!==" {}
-"!=" {}
-"!" {}
-"|=" {}
-"||" {}
-"|" {}
-"+=" {}
-"++" {}
-"+" {}
-"?" {}
-"}" {return token::T_RBRACKET;}
-"]" {return token::T_RBRACE;}
-"%=" {}
-"%" {}
-"return" {}
-")" {return token::T_RPAREN;}
-";" {return token::T_SEMICOLON;}
-"*=" {}
-"*" {}
-\"([^"\\]|\\.)*\" {return token::T_STRING_LITERAL;}
-"switch" {}
-"this" {return token::T_THIS;}
-"throw" {}
-"~" {}
-"try" {}
-"typeof" {}
-"var" {return token::T_VAR;}
-"void" {}
-"while" {}
-"with" {}
-"^=" {}
-"^" {}
-"null" {return token::T_NULL;}
-"true" {}
-"false" {}
-"const" {return token::T_CONST;}
-"debugger" {}
-"reserved" {}
-{icst} {yylval->i = QString(yytext).toInt();return token::T_NUMERIC_LITERAL;}
-{icst}[uU] {yylval->u = QString(yytext).toUInt();return token::T_NUMERIC_LITERAL;}
-{icst}[uU][lL] {yylval->ul = QString(yytext).toULong();return token::T_NUMERIC_LITERAL;}
-{icst}[lL][uU] {yylval->ul = QString(yytext).toULong();return token::T_NUMERIC_LITERAL;}
-{icst}[lL] {yylval->l = QString(yytext).toLong();return token::T_NUMERIC_LITERAL;}
-{icst}[uU](ll|LL) {yylval->l = QString(yytext).toULongLong();return token::T_NUMERIC_LITERAL;}
-{icst}(ll|LL) {yylval->l = QString(yytext).toLongLong();return token::T_NUMERIC_LITERAL;}
-{icst}(ll|LL)[uU] {yylval->l = QString(yytext).toULongLong();return token::T_NUMERIC_LITERAL;}
-{fract}{exp}?[flFL]? {yylval->f = QString(yytext).toFloat();return token::T_NUMERIC_LITERAL;}
-{digit}+{exp}[flFL]? {yylval->f = QString(yytext).toFloat();return token::T_NUMERIC_LITERAL;}
-0[xX]{hexfract}{binexp}[flFL]? {yylval->f = QString(yytext).toFloat();return token::T_NUMERIC_LITERAL;}
-0[xX]{hex}+{binexp}[flFL]? {yylval->f = QString(yytext).toFloat();return token::T_NUMERIC_LITERAL;}
-({letter}|"_")+({letter}|{digit}|"_")* {yylval->s = new QString(yytext);return token::T_IDENTIFIER;}
-[ \t\n] {}
-
-%%
diff --git a/src/common/script_system/parser/js_lex_lex.cpp b/src/common/script_system/parser/js_lex_lex.cpp
deleted file mode 100644
index 8c4eb2487..000000000
--- a/src/common/script_system/parser/js_lex_lex.cpp
+++ /dev/null
@@ -1,2532 +0,0 @@
-
-#line 3 "lex.yy.c"
-
-#define YY_INT_ALIGNED short int
-
-/* A lexical scanner generated by flex */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#define FLEX_BETA
-#endif
-
-/* First, we deal with platform-specific or compiler-specific issues. */
-
-/* begin standard C headers. */
-#include
-#include
-#include
-#include
-
-/* end standard C headers. */
-
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#define FLEXINT_H
-
-/* C99 systems have . Non-C99 systems may or may not. */
-
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
- */
-#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS 1
-#endif
-
-#include
-typedef int8_t flex_int8_t;
-typedef uint8_t flex_uint8_t;
-typedef int16_t flex_int16_t;
-typedef uint16_t flex_uint16_t;
-typedef int32_t flex_int32_t;
-typedef uint32_t flex_uint32_t;
-#else
-typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
-
-/* Limits of integral types. */
-#ifndef INT8_MIN
-#define INT8_MIN (-128)
-#endif
-#ifndef INT16_MIN
-#define INT16_MIN (-32767-1)
-#endif
-#ifndef INT32_MIN
-#define INT32_MIN (-2147483647-1)
-#endif
-#ifndef INT8_MAX
-#define INT8_MAX (127)
-#endif
-#ifndef INT16_MAX
-#define INT16_MAX (32767)
-#endif
-#ifndef INT32_MAX
-#define INT32_MAX (2147483647)
-#endif
-#ifndef UINT8_MAX
-#define UINT8_MAX (255U)
-#endif
-#ifndef UINT16_MAX
-#define UINT16_MAX (65535U)
-#endif
-#ifndef UINT32_MAX
-#define UINT32_MAX (4294967295U)
-#endif
-
-#endif /* ! FLEXINT_H */
-
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else /* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition. This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN (yy_start) = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state. The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START (((yy_start) - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart(yyin )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#define YY_BUF_SIZE 16384
-#endif
-
-/* The state buf must be large enough to hold one state per character in the main buffer.
- */
-#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
-
-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
-#define YY_TYPEDEF_YY_BUFFER_STATE
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-#endif
-
-extern int yyleng;
-
-extern FILE *yyin, *yyout;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
- #define YY_LESS_LINENO(n)
-
-/* Return all but the first "n" matched characters back to the input stream. */
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- int yyless_macro_arg = (n); \
- YY_LESS_LINENO(yyless_macro_arg);\
- *yy_cp = (yy_hold_char); \
- YY_RESTORE_YY_MORE_OFFSET \
- (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
- } \
- while ( 0 )
-
-#define unput(c) yyunput( c, (yytext_ptr) )
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#define YY_STRUCT_YY_BUFFER_STATE
-struct yy_buffer_state
- {
- FILE *yy_input_file;
-
- char *yy_ch_buf; /* input buffer */
- char *yy_buf_pos; /* current position in input buffer */
-
- /* Size of input buffer in bytes, not including room for EOB
- * characters.
- */
- yy_size_t yy_buf_size;
-
- /* Number of characters read into yy_ch_buf, not including EOB
- * characters.
- */
- int yy_n_chars;
-
- /* Whether we "own" the buffer - i.e., we know we created it,
- * and can realloc() it to grow it, and should free() it to
- * delete it.
- */
- int yy_is_our_buffer;
-
- /* Whether this is an "interactive" input source; if so, and
- * if we're using stdio for input, then we want to use getc()
- * instead of fread(), to make sure we stop fetching input after
- * each newline.
- */
- int yy_is_interactive;
-
- /* Whether we're considered to be at the beginning of a line.
- * If so, '^' rules will be active on the next match, otherwise
- * not.
- */
- int yy_at_bol;
-
- int yy_bs_lineno; /**< The line count. */
- int yy_bs_column; /**< The column count. */
-
- /* Whether to try to fill the input buffer when we reach the
- * end of it.
- */
- int yy_fill_buffer;
-
- int yy_buffer_status;
-
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
- /* When an EOF's been seen but there's still some text to process
- * then we mark the buffer as YY_EOF_PENDING, to indicate that we
- * shouldn't try reading from the input source any more. We might
- * still have a bunch of tokens to match, though, because of
- * possible backing-up.
- *
- * When we actually see the EOF, we change the status to "new"
- * (via yyrestart()), so that the user can continue scanning by
- * just pointing yyin at a new input file.
- */
-#define YY_BUFFER_EOF_PENDING 2
-
- };
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-
-/* Stack of input buffers. */
-static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
-static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- *
- * Returns the top of the stack, or NULL.
- */
-#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
- ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
- : NULL)
-
-/* Same as previous macro, but useful when we know that the buffer stack is not
- * NULL or when we need an lvalue. For internal use only.
- */
-#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
-
-/* yy_hold_char holds the character lost when yytext is formed. */
-static char yy_hold_char;
-static int yy_n_chars; /* number of characters read into yy_ch_buf */
-int yyleng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 0; /* whether we need to initialize */
-static int yy_start = 0; /* start state number */
-
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin. A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-
-void yyrestart (FILE *input_file );
-void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
-YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
-void yy_delete_buffer (YY_BUFFER_STATE b );
-void yy_flush_buffer (YY_BUFFER_STATE b );
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
-void yypop_buffer_state (void );
-
-static void yyensure_buffer_stack (void );
-static void yy_load_buffer_state (void );
-static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
-
-#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
-
-YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
-YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
-
-void *yyalloc (yy_size_t );
-void *yyrealloc (void *,yy_size_t );
-void yyfree (void * );
-
-#define yy_new_buffer yy_create_buffer
-
-#define yy_set_interactive(is_interactive) \
- { \
- if ( ! YY_CURRENT_BUFFER ){ \
- yyensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
- yy_create_buffer(yyin,YY_BUF_SIZE ); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
- }
-
-#define yy_set_bol(at_bol) \
- { \
- if ( ! YY_CURRENT_BUFFER ){\
- yyensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
- yy_create_buffer(yyin,YY_BUF_SIZE ); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
- }
-
-#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-
-/* Begin user sect3 */
-
-#define yywrap(n) 1
-#define YY_SKIP_YYWRAP
-
-typedef unsigned char YY_CHAR;
-
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
-
-typedef int yy_state_type;
-
-extern int yylineno;
-
-int yylineno = 1;
-
-extern char *yytext;
-#define yytext_ptr yytext
-
-static yy_state_type yy_get_previous_state (void );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
-static int yy_get_next_buffer (void );
-static void yy_fatal_error (yyconst char msg[] );
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
- (yytext_ptr) = yy_bp; \
- yyleng = (size_t) (yy_cp - yy_bp); \
- (yy_hold_char) = *yy_cp; \
- *yy_cp = '\0'; \
- (yy_c_buf_p) = yy_cp;
-
-#define YY_NUM_RULES 100
-#define YY_END_OF_BUFFER 101
-/* This struct is not used in this scanner,
- but its presence is necessary. */
-struct yy_trans_info
- {
- flex_int32_t yy_verify;
- flex_int32_t yy_nxt;
- };
-static yyconst flex_int16_t yy_accept[237] =
- { 0,
- 0, 0, 0, 0, 101, 100, 99, 50, 100, 61,
- 9, 43, 63, 66, 56, 14, 46, 21, 19, 86,
- 86, 13, 64, 42, 25, 33, 57, 98, 38, 59,
- 79, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 37, 53, 58, 71, 2, 4, 3,
- 49, 0, 67, 0, 60, 7, 8, 65, 55, 54,
- 44, 45, 94, 6, 5, 18, 94, 86, 0, 0,
- 90, 87, 0, 90, 86, 40, 41, 24, 31, 32,
- 98, 98, 78, 98, 98, 98, 98, 20, 98, 98,
- 98, 98, 98, 34, 35, 98, 98, 98, 98, 98,
-
- 98, 98, 98, 98, 98, 98, 51, 52, 2, 1,
- 48, 0, 94, 5, 0, 95, 92, 89, 88, 88,
- 0, 86, 39, 23, 30, 0, 98, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 27, 98, 98, 47,
- 98, 98, 98, 98, 98, 98, 98, 72, 98, 74,
- 98, 98, 98, 0, 94, 95, 93, 91, 0, 0,
- 0, 29, 98, 11, 98, 98, 98, 98, 98, 98,
- 22, 98, 98, 98, 98, 80, 98, 98, 98, 69,
- 98, 81, 98, 75, 98, 77, 0, 0, 97, 10,
- 12, 83, 98, 98, 98, 98, 82, 98, 98, 98,
-
- 98, 98, 98, 70, 98, 76, 0, 96, 97, 98,
- 98, 98, 17, 98, 98, 98, 98, 62, 68, 73,
- 96, 98, 98, 16, 26, 98, 98, 98, 15, 84,
- 28, 98, 85, 98, 36, 0
- } ;
-
-static yyconst flex_int32_t yy_ec[256] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 4, 5, 1, 1, 6, 7, 1, 8,
- 9, 10, 11, 12, 13, 14, 15, 16, 17, 17,
- 17, 17, 17, 17, 17, 18, 18, 19, 20, 21,
- 22, 23, 24, 1, 25, 25, 25, 25, 26, 27,
- 28, 28, 28, 28, 28, 29, 28, 28, 28, 30,
- 28, 28, 28, 28, 31, 28, 28, 32, 28, 28,
- 33, 34, 35, 36, 37, 1, 38, 39, 40, 41,
-
- 42, 43, 44, 45, 46, 28, 47, 48, 28, 49,
- 50, 51, 28, 52, 53, 54, 55, 56, 57, 32,
- 58, 28, 59, 60, 61, 62, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1
- } ;
-
-static yyconst flex_int32_t yy_meta[63] =
- { 0,
- 1, 1, 2, 1, 1, 1, 1, 1, 1, 3,
- 1, 1, 1, 4, 1, 5, 5, 5, 1, 1,
- 1, 1, 1, 1, 5, 5, 5, 6, 6, 6,
- 6, 6, 1, 1, 1, 1, 6, 5, 5, 5,
- 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 1, 1,
- 1, 1
- } ;
-
-static yyconst flex_int16_t yy_base[245] =
- { 0,
- 0, 0, 60, 61, 212, 879, 879, 187, 60, 181,
- 59, 879, 879, 171, 56, 879, 55, 56, 65, 81,
- 68, 879, 879, 61, 158, 66, 879, 74, 879, 879,
- 156, 85, 88, 98, 101, 104, 114, 127, 135, 117,
- 144, 118, 120, 879, 86, 879, 879, 0, 879, 161,
- 149, 91, 879, 164, 879, 879, 879, 879, 879, 879,
- 879, 879, 168, 879, 0, 879, 188, 115, 206, 222,
- 152, 80, 127, 124, 0, 117, 879, 105, 879, 165,
- 0, 174, 879, 183, 210, 225, 228, 233, 236, 239,
- 242, 252, 261, 264, 267, 276, 279, 282, 285, 291,
-
- 295, 298, 305, 301, 308, 312, 879, 879, 0, 879,
- 879, 328, 879, 0, 342, 345, 38, 879, 95, 63,
- 0, 350, 879, 879, 879, 57, 351, 360, 366, 369,
- 374, 378, 391, 394, 397, 401, 408, 414, 424, 427,
- 431, 435, 439, 442, 445, 449, 453, 456, 464, 467,
- 470, 473, 484, 487, 491, 879, 879, 879, 168, 178,
- 499, 879, 506, 509, 514, 519, 524, 527, 530, 533,
- 538, 544, 547, 550, 558, 561, 564, 572, 575, 581,
- 584, 589, 592, 595, 601, 604, 612, 615, 618, 621,
- 632, 635, 638, 641, 646, 651, 654, 657, 660, 663,
-
- 666, 672, 679, 682, 685, 691, 697, 700, 879, 714,
- 717, 720, 723, 728, 733, 736, 739, 744, 747, 750,
- 879, 754, 761, 771, 774, 777, 781, 784, 787, 790,
- 793, 798, 801, 804, 811, 879, 848, 854, 856, 862,
- 868, 871, 872, 71
- } ;
-
-static yyconst flex_int16_t yy_def[245] =
- { 0,
- 236, 1, 237, 237, 236, 236, 236, 236, 238, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 20, 236, 236, 236, 236, 236, 236, 239, 236, 236,
- 236, 239, 239, 239, 239, 239, 239, 239, 239, 239,
- 239, 36, 36, 236, 236, 236, 236, 240, 236, 236,
- 236, 238, 236, 238, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 241, 236, 236, 20, 236, 236,
- 236, 236, 242, 236, 21, 236, 236, 236, 236, 236,
- 243, 239, 236, 239, 239, 239, 239, 239, 239, 239,
- 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
-
- 239, 239, 239, 239, 239, 239, 236, 236, 240, 236,
- 236, 236, 236, 241, 236, 236, 236, 236, 236, 236,
- 244, 242, 236, 236, 236, 236, 239, 239, 239, 239,
- 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
- 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
- 239, 239, 239, 236, 236, 236, 236, 236, 244, 244,
- 236, 236, 239, 239, 239, 239, 239, 239, 239, 239,
- 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
- 239, 239, 239, 239, 239, 239, 236, 236, 236, 239,
- 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
-
- 239, 239, 239, 239, 239, 239, 236, 236, 236, 239,
- 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
- 236, 239, 239, 239, 239, 239, 239, 239, 239, 239,
- 239, 239, 239, 239, 239, 0, 236, 236, 236, 236,
- 236, 236, 236, 236
- } ;
-
-static yyconst flex_int16_t yy_nxt[942] =
- { 0,
- 6, 7, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 21, 22, 23,
- 24, 25, 26, 27, 28, 28, 28, 28, 28, 28,
- 28, 28, 29, 6, 30, 31, 28, 28, 32, 33,
- 34, 35, 36, 28, 28, 37, 28, 28, 38, 28,
- 28, 39, 40, 41, 28, 42, 43, 28, 44, 45,
- 46, 47, 49, 49, 53, 56, 59, 61, 157, 50,
- 50, 63, 63, 63, 64, 159, 62, 60, 162, 65,
- 57, 76, 77, 75, 75, 75, 66, 79, 80, 81,
- 81, 81, 157, 54, 67, 53, 68, 68, 69, 236,
-
- 81, 81, 81, 81, 81, 81, 70, 107, 119, 71,
- 158, 72, 73, 81, 81, 81, 81, 81, 81, 81,
- 81, 81, 70, 158, 54, 85, 124, 120, 74, 81,
- 81, 81, 81, 81, 81, 72, 84, 86, 123, 87,
- 121, 90, 81, 81, 81, 108, 236, 88, 89, 91,
- 81, 81, 81, 92, 118, 103, 94, 82, 93, 81,
- 81, 81, 95, 82, 105, 106, 236, 104, 96, 82,
- 111, 117, 82, 99, 82, 110, 98, 83, 118, 78,
- 117, 97, 118, 63, 63, 63, 125, 126, 100, 81,
- 81, 81, 58, 112, 113, 101, 113, 187, 81, 81,
-
- 81, 102, 55, 63, 63, 63, 118, 187, 51, 112,
- 113, 236, 236, 112, 113, 113, 113, 236, 187, 67,
- 236, 69, 69, 69, 127, 81, 81, 81, 187, 112,
- 113, 70, 115, 236, 115, 113, 236, 116, 116, 116,
- 81, 81, 81, 81, 81, 81, 236, 70, 81, 81,
- 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
- 236, 236, 128, 129, 236, 236, 131, 81, 81, 81,
- 132, 236, 236, 130, 236, 133, 81, 81, 81, 81,
- 81, 81, 81, 81, 81, 236, 135, 236, 134, 236,
- 136, 81, 81, 81, 81, 81, 81, 81, 81, 81,
-
- 81, 81, 81, 137, 236, 236, 81, 81, 81, 138,
- 81, 81, 81, 81, 81, 81, 81, 81, 81, 139,
- 81, 81, 81, 81, 81, 81, 141, 81, 81, 81,
- 144, 236, 140, 236, 142, 143, 145, 236, 154, 236,
- 154, 236, 146, 155, 155, 155, 151, 236, 149, 147,
- 236, 236, 148, 152, 236, 236, 150, 116, 116, 116,
- 116, 116, 116, 160, 236, 153, 81, 81, 81, 236,
- 236, 156, 236, 156, 236, 81, 81, 81, 71, 161,
- 72, 81, 81, 81, 81, 81, 81, 156, 163, 81,
- 81, 81, 156, 81, 81, 81, 236, 74, 236, 236,
-
- 161, 164, 236, 236, 72, 165, 81, 81, 81, 81,
- 81, 81, 81, 81, 81, 169, 81, 81, 81, 236,
- 236, 166, 167, 81, 81, 81, 236, 236, 168, 81,
- 81, 81, 170, 236, 236, 171, 236, 236, 173, 81,
- 81, 81, 81, 81, 81, 236, 81, 81, 81, 172,
- 81, 81, 81, 174, 81, 81, 81, 81, 81, 81,
- 81, 81, 81, 236, 81, 81, 81, 236, 81, 81,
- 81, 81, 81, 81, 236, 236, 177, 175, 176, 81,
- 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
- 81, 236, 236, 178, 182, 179, 236, 180, 181, 81,
-
- 81, 81, 155, 155, 155, 183, 155, 155, 155, 188,
- 184, 188, 236, 236, 189, 189, 189, 113, 236, 113,
- 185, 81, 81, 81, 81, 81, 81, 236, 186, 81,
- 81, 81, 236, 113, 81, 81, 81, 236, 113, 81,
- 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
- 81, 236, 190, 81, 81, 81, 236, 236, 191, 81,
- 81, 81, 81, 81, 81, 81, 81, 81, 236, 193,
- 194, 236, 192, 81, 81, 81, 81, 81, 81, 81,
- 81, 81, 236, 236, 195, 197, 196, 81, 81, 81,
- 81, 81, 81, 236, 198, 200, 81, 81, 81, 81,
-
- 81, 81, 236, 199, 81, 81, 81, 81, 81, 81,
- 81, 81, 81, 236, 203, 201, 81, 81, 81, 81,
- 81, 81, 207, 202, 207, 236, 236, 208, 208, 208,
- 189, 189, 189, 189, 189, 189, 81, 81, 81, 236,
- 204, 205, 206, 236, 209, 236, 209, 81, 81, 81,
- 81, 81, 81, 81, 81, 81, 81, 81, 81, 236,
- 209, 81, 81, 81, 236, 209, 81, 81, 81, 81,
- 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
- 81, 81, 81, 81, 211, 236, 210, 81, 81, 81,
- 236, 236, 213, 212, 81, 81, 81, 81, 81, 81,
-
- 81, 81, 81, 236, 214, 215, 81, 81, 81, 236,
- 236, 216, 208, 208, 208, 208, 208, 208, 236, 236,
- 218, 217, 236, 219, 236, 236, 221, 220, 221, 81,
- 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
- 81, 236, 221, 81, 81, 81, 236, 221, 81, 81,
- 81, 81, 81, 81, 81, 81, 81, 236, 223, 81,
- 81, 81, 81, 81, 81, 81, 81, 81, 222, 81,
- 81, 81, 236, 224, 236, 227, 81, 81, 81, 236,
- 228, 236, 226, 236, 236, 225, 81, 81, 81, 81,
- 81, 81, 81, 81, 81, 229, 81, 81, 81, 81,
-
- 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
- 81, 236, 230, 81, 81, 81, 81, 81, 81, 81,
- 81, 81, 232, 236, 233, 231, 81, 81, 81, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 235, 234, 48, 48,
- 48, 48, 48, 48, 52, 52, 52, 52, 52, 52,
- 82, 82, 109, 236, 236, 109, 109, 109, 114, 236,
- 114, 114, 114, 114, 122, 122, 81, 81, 5, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
-
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236
- } ;
-
-static yyconst flex_int16_t yy_chk[942] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 3, 4, 9, 11, 15, 17, 117, 3,
- 4, 18, 18, 18, 19, 244, 17, 15, 126, 19,
- 11, 24, 24, 21, 21, 21, 19, 26, 26, 28,
- 28, 28, 117, 9, 20, 52, 20, 20, 20, 21,
-
- 32, 32, 32, 33, 33, 33, 20, 45, 72, 20,
- 120, 20, 20, 34, 34, 34, 35, 35, 35, 36,
- 36, 36, 20, 119, 52, 33, 78, 72, 20, 37,
- 37, 37, 40, 40, 40, 20, 32, 33, 76, 34,
- 73, 36, 38, 38, 38, 45, 68, 34, 35, 36,
- 39, 39, 39, 36, 74, 42, 37, 43, 36, 41,
- 41, 41, 37, 42, 43, 43, 54, 42, 38, 43,
- 51, 74, 42, 40, 43, 50, 39, 31, 74, 25,
- 71, 38, 71, 63, 63, 63, 80, 80, 41, 82,
- 82, 82, 14, 63, 63, 41, 63, 159, 84, 84,
-
- 84, 41, 10, 67, 67, 67, 71, 160, 8, 63,
- 63, 5, 0, 67, 67, 63, 67, 0, 159, 69,
- 0, 69, 69, 69, 84, 85, 85, 85, 160, 67,
- 67, 69, 70, 0, 70, 67, 0, 70, 70, 70,
- 86, 86, 86, 87, 87, 87, 0, 69, 88, 88,
- 88, 89, 89, 89, 90, 90, 90, 91, 91, 91,
- 0, 0, 85, 85, 0, 0, 87, 92, 92, 92,
- 87, 0, 0, 86, 0, 87, 93, 93, 93, 94,
- 94, 94, 95, 95, 95, 0, 90, 0, 89, 0,
- 91, 96, 96, 96, 97, 97, 97, 98, 98, 98,
-
- 99, 99, 99, 92, 0, 0, 100, 100, 100, 93,
- 101, 101, 101, 102, 102, 102, 104, 104, 104, 95,
- 103, 103, 103, 105, 105, 105, 97, 106, 106, 106,
- 99, 0, 96, 0, 98, 98, 100, 0, 112, 0,
- 112, 0, 100, 112, 112, 112, 104, 0, 102, 101,
- 0, 0, 101, 105, 0, 0, 103, 115, 115, 115,
- 116, 116, 116, 122, 0, 106, 127, 127, 127, 0,
- 0, 116, 0, 116, 0, 128, 128, 128, 122, 122,
- 122, 129, 129, 129, 130, 130, 130, 116, 127, 131,
- 131, 131, 116, 132, 132, 132, 0, 122, 0, 0,
-
- 122, 128, 0, 0, 122, 129, 133, 133, 133, 134,
- 134, 134, 135, 135, 135, 132, 136, 136, 136, 0,
- 0, 130, 130, 137, 137, 137, 0, 0, 131, 138,
- 138, 138, 133, 0, 0, 134, 0, 0, 136, 139,
- 139, 139, 140, 140, 140, 0, 141, 141, 141, 135,
- 142, 142, 142, 138, 143, 143, 143, 144, 144, 144,
- 145, 145, 145, 0, 146, 146, 146, 0, 147, 147,
- 147, 148, 148, 148, 0, 0, 142, 139, 141, 149,
- 149, 149, 150, 150, 150, 151, 151, 151, 152, 152,
- 152, 0, 0, 143, 147, 144, 0, 145, 146, 153,
-
- 153, 153, 154, 154, 154, 149, 155, 155, 155, 161,
- 151, 161, 0, 0, 161, 161, 161, 155, 0, 155,
- 152, 163, 163, 163, 164, 164, 164, 0, 153, 165,
- 165, 165, 0, 155, 166, 166, 166, 0, 155, 167,
- 167, 167, 168, 168, 168, 169, 169, 169, 170, 170,
- 170, 0, 163, 171, 171, 171, 0, 0, 165, 172,
- 172, 172, 173, 173, 173, 174, 174, 174, 0, 167,
- 168, 0, 166, 175, 175, 175, 176, 176, 176, 177,
- 177, 177, 0, 0, 169, 172, 170, 178, 178, 178,
- 179, 179, 179, 0, 173, 175, 180, 180, 180, 181,
-
- 181, 181, 0, 174, 182, 182, 182, 183, 183, 183,
- 184, 184, 184, 0, 179, 177, 185, 185, 185, 186,
- 186, 186, 187, 178, 187, 0, 0, 187, 187, 187,
- 188, 188, 188, 189, 189, 189, 190, 190, 190, 0,
- 181, 183, 185, 0, 189, 0, 189, 191, 191, 191,
- 192, 192, 192, 193, 193, 193, 194, 194, 194, 0,
- 189, 195, 195, 195, 0, 189, 196, 196, 196, 197,
- 197, 197, 198, 198, 198, 199, 199, 199, 200, 200,
- 200, 201, 201, 201, 194, 0, 193, 202, 202, 202,
- 0, 0, 196, 195, 203, 203, 203, 204, 204, 204,
-
- 205, 205, 205, 0, 198, 199, 206, 206, 206, 0,
- 0, 200, 207, 207, 207, 208, 208, 208, 0, 0,
- 202, 201, 0, 203, 0, 0, 208, 205, 208, 210,
- 210, 210, 211, 211, 211, 212, 212, 212, 213, 213,
- 213, 0, 208, 214, 214, 214, 0, 208, 215, 215,
- 215, 216, 216, 216, 217, 217, 217, 0, 211, 218,
- 218, 218, 219, 219, 219, 220, 220, 220, 210, 222,
- 222, 222, 0, 212, 0, 216, 223, 223, 223, 0,
- 217, 0, 215, 0, 0, 214, 224, 224, 224, 225,
- 225, 225, 226, 226, 226, 222, 227, 227, 227, 228,
-
- 228, 228, 229, 229, 229, 230, 230, 230, 231, 231,
- 231, 0, 223, 232, 232, 232, 233, 233, 233, 234,
- 234, 234, 227, 0, 228, 226, 235, 235, 235, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 234, 232, 237, 237,
- 237, 237, 237, 237, 238, 238, 238, 238, 238, 238,
- 239, 239, 240, 0, 0, 240, 240, 240, 241, 0,
- 241, 241, 241, 241, 242, 242, 243, 243, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
-
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236
- } ;
-
-static yy_state_type yy_last_accepting_state;
-static char *yy_last_accepting_cpos;
-
-extern int yy_flex_debug;
-int yy_flex_debug = 0;
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
-#line 1 "js_lex.l"
-#define YY_NO_UNISTD_H 1
-
-#line 7 "js_lex.l"
-#include "js_parser.tab.hh"
-#include
-#include
-#include
-#include
-
-
-#define YY_DECL int yylex(yy::JSCacheParser::semantic_type* yylval,yy::JSCacheParser::location_type* yylloc)
-#define YY_USER_ACTION yylloc->columns(yyleng);
-
-typedef yy::JSCacheParser::token token;
-#line 755 "lex.yy.c"
-
-#define INITIAL 0
-#define MLCOMMENTSTATE 1
-
-#ifndef YY_NO_UNISTD_H
-/* Special case for "unistd.h", since it is non-ANSI. We include it way
- * down here because we want the user's section 1 to have been scanned first.
- * The user has a chance to override it with an option.
- */
-#include
-#endif
-
-#ifndef YY_EXTRA_TYPE
-#define YY_EXTRA_TYPE void *
-#endif
-
-static int yy_init_globals (void );
-
-/* Accessor methods to globals.
- These are made visible to non-reentrant scanners for convenience. */
-
-int yylex_destroy (void );
-
-int yyget_debug (void );
-
-void yyset_debug (int debug_flag );
-
-YY_EXTRA_TYPE yyget_extra (void );
-
-void yyset_extra (YY_EXTRA_TYPE user_defined );
-
-FILE *yyget_in (void );
-
-void yyset_in (FILE * in_str );
-
-FILE *yyget_out (void );
-
-void yyset_out (FILE * out_str );
-
-int yyget_leng (void );
-
-char *yyget_text (void );
-
-int yyget_lineno (void );
-
-void yyset_lineno (int line_number );
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int yywrap (void );
-#else
-extern int yywrap (void );
-#endif
-#endif
-
- static void yyunput (int c,char *buf_ptr );
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int );
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * );
-#endif
-
-#ifndef YY_NO_INPUT
-
-#ifdef __cplusplus
-static int yyinput (void );
-#else
-static int input (void );
-#endif
-
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
-#endif
-
-/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
- if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
- { \
- int c = '*'; \
- int n; \
- for ( n = 0; n < max_size && \
- (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
- buf[n] = (char) c; \
- if ( c == '\n' ) \
- buf[n++] = (char) c; \
- if ( c == EOF && ferror( yyin ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- result = n; \
- } \
- else \
- { \
- errno=0; \
- while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
- { \
- if( errno != EINTR) \
- { \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- break; \
- } \
- errno=0; \
- clearerr(yyin); \
- } \
- }\
-\
-
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
-#endif
-
-/* end tables serialization structures and prototypes */
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL_IS_OURS 1
-
-extern int yylex (void);
-
-#define YY_DECL int yylex (void)
-#endif /* !YY_DECL */
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
- YY_USER_ACTION
-
-/** The main scanner function which does all the work.
- */
-YY_DECL
-{
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
-
-#line 34 "js_lex.l"
-
-
-
- yylloc->step();
-
-
-#line 945 "lex.yy.c"
-
- if ( !(yy_init) )
- {
- (yy_init) = 1;
-
-#ifdef YY_USER_INIT
- YY_USER_INIT;
-#endif
-
- if ( ! (yy_start) )
- (yy_start) = 1; /* first start state */
-
- if ( ! yyin )
- yyin = stdin;
-
- if ( ! yyout )
- yyout = stdout;
-
- if ( ! YY_CURRENT_BUFFER ) {
- yyensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
- yy_create_buffer(yyin,YY_BUF_SIZE );
- }
-
- yy_load_buffer_state( );
- }
-
- while ( 1 ) /* loops until end-of-file is reached */
- {
- yy_cp = (yy_c_buf_p);
-
- /* Support of yytext. */
- *yy_cp = (yy_hold_char);
-
- /* yy_bp points to the position in yy_ch_buf of the start of
- * the current run.
- */
- yy_bp = yy_cp;
-
- yy_current_state = (yy_start);
-yy_match:
- do
- {
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 237 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- ++yy_cp;
- }
- while ( yy_base[yy_current_state] != 879 );
-
-yy_find_action:
- yy_act = yy_accept[yy_current_state];
- if ( yy_act == 0 )
- { /* have to back up */
- yy_cp = (yy_last_accepting_cpos);
- yy_current_state = (yy_last_accepting_state);
- yy_act = yy_accept[yy_current_state];
- }
-
- YY_DO_BEFORE_ACTION;
-
-do_action: /* This label is used only to access EOF actions. */
-
- switch ( yy_act )
- { /* beginning of action switch */
- case 0: /* must back up */
- /* undo the effects of YY_DO_BEFORE_ACTION */
- *yy_cp = (yy_hold_char);
- yy_cp = (yy_last_accepting_cpos);
- yy_current_state = (yy_last_accepting_state);
- goto yy_find_action;
-
-case 1:
-YY_RULE_SETUP
-#line 40 "js_lex.l"
-{BEGIN(INITIAL);}
- YY_BREAK
-case 2:
-YY_RULE_SETUP
-#line 41 "js_lex.l"
-{}
- YY_BREAK
-case 3:
-YY_RULE_SETUP
-#line 42 "js_lex.l"
-{}
- YY_BREAK
-case 4:
-/* rule 4 can match eol */
-YY_RULE_SETUP
-#line 43 "js_lex.l"
-{}
- YY_BREAK
-case 5:
-YY_RULE_SETUP
-#line 44 "js_lex.l"
-{}
- YY_BREAK
-case 6:
-YY_RULE_SETUP
-#line 45 "js_lex.l"
-{BEGIN(MLCOMMENTSTATE);}
- YY_BREAK
-case 7:
-YY_RULE_SETUP
-#line 46 "js_lex.l"
-{}
- YY_BREAK
-case 8:
-YY_RULE_SETUP
-#line 47 "js_lex.l"
-{}
- YY_BREAK
-case 9:
-YY_RULE_SETUP
-#line 48 "js_lex.l"
-{}
- YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 49 "js_lex.l"
-{}
- YY_BREAK
-case 11:
-YY_RULE_SETUP
-#line 50 "js_lex.l"
-{}
- YY_BREAK
-case 12:
-YY_RULE_SETUP
-#line 51 "js_lex.l"
-{}
- YY_BREAK
-case 13:
-YY_RULE_SETUP
-#line 52 "js_lex.l"
-{return token::T_COLON;}
- YY_BREAK
-case 14:
-YY_RULE_SETUP
-#line 53 "js_lex.l"
-{return token::T_COMMA;}
- YY_BREAK
-case 15:
-YY_RULE_SETUP
-#line 54 "js_lex.l"
-{}
- YY_BREAK
-case 16:
-YY_RULE_SETUP
-#line 55 "js_lex.l"
-{}
- YY_BREAK
-case 17:
-YY_RULE_SETUP
-#line 56 "js_lex.l"
-{}
- YY_BREAK
-case 18:
-YY_RULE_SETUP
-#line 57 "js_lex.l"
-{}
- YY_BREAK
-case 19:
-YY_RULE_SETUP
-#line 58 "js_lex.l"
-{}
- YY_BREAK
-case 20:
-YY_RULE_SETUP
-#line 59 "js_lex.l"
-{}
- YY_BREAK
-case 21:
-YY_RULE_SETUP
-#line 60 "js_lex.l"
-{return token::T_DOT;}
- YY_BREAK
-case 22:
-YY_RULE_SETUP
-#line 61 "js_lex.l"
-{}
- YY_BREAK
-case 23:
-YY_RULE_SETUP
-#line 62 "js_lex.l"
-{}
- YY_BREAK
-case 24:
-YY_RULE_SETUP
-#line 63 "js_lex.l"
-{}
- YY_BREAK
-case 25:
-YY_RULE_SETUP
-#line 64 "js_lex.l"
-{return token::T_EQ;}
- YY_BREAK
-case 26:
-YY_RULE_SETUP
-#line 65 "js_lex.l"
-{}
- YY_BREAK
-case 27:
-YY_RULE_SETUP
-#line 66 "js_lex.l"
-{}
- YY_BREAK
-case 28:
-YY_RULE_SETUP
-#line 67 "js_lex.l"
-{return token::T_FUNCTION;}
- YY_BREAK
-case 29:
-YY_RULE_SETUP
-#line 68 "js_lex.l"
-{}
- YY_BREAK
-case 30:
-YY_RULE_SETUP
-#line 69 "js_lex.l"
-{}
- YY_BREAK
-case 31:
-YY_RULE_SETUP
-#line 70 "js_lex.l"
-{}
- YY_BREAK
-case 32:
-YY_RULE_SETUP
-#line 71 "js_lex.l"
-{}
- YY_BREAK
-case 33:
-YY_RULE_SETUP
-#line 72 "js_lex.l"
-{}
- YY_BREAK
-case 34:
-YY_RULE_SETUP
-#line 73 "js_lex.l"
-{}
- YY_BREAK
-case 35:
-YY_RULE_SETUP
-#line 74 "js_lex.l"
-{}
- YY_BREAK
-case 36:
-YY_RULE_SETUP
-#line 75 "js_lex.l"
-{}
- YY_BREAK
-case 37:
-YY_RULE_SETUP
-#line 76 "js_lex.l"
-{return token::T_LBRACKET;}
- YY_BREAK
-case 38:
-YY_RULE_SETUP
-#line 77 "js_lex.l"
-{return token::T_LBRACE;}
- YY_BREAK
-case 39:
-YY_RULE_SETUP
-#line 78 "js_lex.l"
-{}
- YY_BREAK
-case 40:
-YY_RULE_SETUP
-#line 79 "js_lex.l"
-{}
- YY_BREAK
-case 41:
-YY_RULE_SETUP
-#line 80 "js_lex.l"
-{}
- YY_BREAK
-case 42:
-YY_RULE_SETUP
-#line 81 "js_lex.l"
-{}
- YY_BREAK
-case 43:
-YY_RULE_SETUP
-#line 82 "js_lex.l"
-{return token::T_LPAREN;}
- YY_BREAK
-case 44:
-YY_RULE_SETUP
-#line 83 "js_lex.l"
-{}
- YY_BREAK
-case 45:
-YY_RULE_SETUP
-#line 84 "js_lex.l"
-{}
- YY_BREAK
-case 46:
-YY_RULE_SETUP
-#line 85 "js_lex.l"
-{}
- YY_BREAK
-case 47:
-YY_RULE_SETUP
-#line 86 "js_lex.l"
-{return token::T_NEW;}
- YY_BREAK
-case 48:
-YY_RULE_SETUP
-#line 87 "js_lex.l"
-{}
- YY_BREAK
-case 49:
-YY_RULE_SETUP
-#line 88 "js_lex.l"
-{}
- YY_BREAK
-case 50:
-YY_RULE_SETUP
-#line 89 "js_lex.l"
-{}
- YY_BREAK
-case 51:
-YY_RULE_SETUP
-#line 90 "js_lex.l"
-{}
- YY_BREAK
-case 52:
-YY_RULE_SETUP
-#line 91 "js_lex.l"
-{}
- YY_BREAK
-case 53:
-YY_RULE_SETUP
-#line 92 "js_lex.l"
-{}
- YY_BREAK
-case 54:
-YY_RULE_SETUP
-#line 93 "js_lex.l"
-{}
- YY_BREAK
-case 55:
-YY_RULE_SETUP
-#line 94 "js_lex.l"
-{}
- YY_BREAK
-case 56:
-YY_RULE_SETUP
-#line 95 "js_lex.l"
-{}
- YY_BREAK
-case 57:
-YY_RULE_SETUP
-#line 96 "js_lex.l"
-{}
- YY_BREAK
-case 58:
-YY_RULE_SETUP
-#line 97 "js_lex.l"
-{return token::T_RBRACKET;}
- YY_BREAK
-case 59:
-YY_RULE_SETUP
-#line 98 "js_lex.l"
-{return token::T_RBRACE;}
- YY_BREAK
-case 60:
-YY_RULE_SETUP
-#line 99 "js_lex.l"
-{}
- YY_BREAK
-case 61:
-YY_RULE_SETUP
-#line 100 "js_lex.l"
-{}
- YY_BREAK
-case 62:
-YY_RULE_SETUP
-#line 101 "js_lex.l"
-{}
- YY_BREAK
-case 63:
-YY_RULE_SETUP
-#line 102 "js_lex.l"
-{return token::T_RPAREN;}
- YY_BREAK
-case 64:
-YY_RULE_SETUP
-#line 103 "js_lex.l"
-{return token::T_SEMICOLON;}
- YY_BREAK
-case 65:
-YY_RULE_SETUP
-#line 104 "js_lex.l"
-{}
- YY_BREAK
-case 66:
-YY_RULE_SETUP
-#line 105 "js_lex.l"
-{}
- YY_BREAK
-case 67:
-/* rule 67 can match eol */
-YY_RULE_SETUP
-#line 106 "js_lex.l"
-{return token::T_STRING_LITERAL;}
- YY_BREAK
-case 68:
-YY_RULE_SETUP
-#line 107 "js_lex.l"
-{}
- YY_BREAK
-case 69:
-YY_RULE_SETUP
-#line 108 "js_lex.l"
-{return token::T_THIS;}
- YY_BREAK
-case 70:
-YY_RULE_SETUP
-#line 109 "js_lex.l"
-{}
- YY_BREAK
-case 71:
-YY_RULE_SETUP
-#line 110 "js_lex.l"
-{}
- YY_BREAK
-case 72:
-YY_RULE_SETUP
-#line 111 "js_lex.l"
-{}
- YY_BREAK
-case 73:
-YY_RULE_SETUP
-#line 112 "js_lex.l"
-{}
- YY_BREAK
-case 74:
-YY_RULE_SETUP
-#line 113 "js_lex.l"
-{return token::T_VAR;}
- YY_BREAK
-case 75:
-YY_RULE_SETUP
-#line 114 "js_lex.l"
-{}
- YY_BREAK
-case 76:
-YY_RULE_SETUP
-#line 115 "js_lex.l"
-{}
- YY_BREAK
-case 77:
-YY_RULE_SETUP
-#line 116 "js_lex.l"
-{}
- YY_BREAK
-case 78:
-YY_RULE_SETUP
-#line 117 "js_lex.l"
-{}
- YY_BREAK
-case 79:
-YY_RULE_SETUP
-#line 118 "js_lex.l"
-{}
- YY_BREAK
-case 80:
-YY_RULE_SETUP
-#line 119 "js_lex.l"
-{return token::T_NULL;}
- YY_BREAK
-case 81:
-YY_RULE_SETUP
-#line 120 "js_lex.l"
-{}
- YY_BREAK
-case 82:
-YY_RULE_SETUP
-#line 121 "js_lex.l"
-{}
- YY_BREAK
-case 83:
-YY_RULE_SETUP
-#line 122 "js_lex.l"
-{return token::T_CONST;}
- YY_BREAK
-case 84:
-YY_RULE_SETUP
-#line 123 "js_lex.l"
-{}
- YY_BREAK
-case 85:
-YY_RULE_SETUP
-#line 124 "js_lex.l"
-{}
- YY_BREAK
-case 86:
-YY_RULE_SETUP
-#line 125 "js_lex.l"
-{yylval->i = QString(yytext).toInt();return token::T_NUMERIC_LITERAL;}
- YY_BREAK
-case 87:
-YY_RULE_SETUP
-#line 126 "js_lex.l"
-{yylval->u = QString(yytext).toUInt();return token::T_NUMERIC_LITERAL;}
- YY_BREAK
-case 88:
-YY_RULE_SETUP
-#line 127 "js_lex.l"
-{yylval->ul = QString(yytext).toULong();return token::T_NUMERIC_LITERAL;}
- YY_BREAK
-case 89:
-YY_RULE_SETUP
-#line 128 "js_lex.l"
-{yylval->ul = QString(yytext).toULong();return token::T_NUMERIC_LITERAL;}
- YY_BREAK
-case 90:
-YY_RULE_SETUP
-#line 129 "js_lex.l"
-{yylval->l = QString(yytext).toLong();return token::T_NUMERIC_LITERAL;}
- YY_BREAK
-case 91:
-YY_RULE_SETUP
-#line 130 "js_lex.l"
-{yylval->l = QString(yytext).toULongLong();return token::T_NUMERIC_LITERAL;}
- YY_BREAK
-case 92:
-YY_RULE_SETUP
-#line 131 "js_lex.l"
-{yylval->l = QString(yytext).toLongLong();return token::T_NUMERIC_LITERAL;}
- YY_BREAK
-case 93:
-YY_RULE_SETUP
-#line 132 "js_lex.l"
-{yylval->l = QString(yytext).toULongLong();return token::T_NUMERIC_LITERAL;}
- YY_BREAK
-case 94:
-YY_RULE_SETUP
-#line 133 "js_lex.l"
-{yylval->f = QString(yytext).toFloat();return token::T_NUMERIC_LITERAL;}
- YY_BREAK
-case 95:
-YY_RULE_SETUP
-#line 134 "js_lex.l"
-{yylval->f = QString(yytext).toFloat();return token::T_NUMERIC_LITERAL;}
- YY_BREAK
-case 96:
-YY_RULE_SETUP
-#line 135 "js_lex.l"
-{yylval->f = QString(yytext).toFloat();return token::T_NUMERIC_LITERAL;}
- YY_BREAK
-case 97:
-YY_RULE_SETUP
-#line 136 "js_lex.l"
-{yylval->f = QString(yytext).toFloat();return token::T_NUMERIC_LITERAL;}
- YY_BREAK
-case 98:
-YY_RULE_SETUP
-#line 137 "js_lex.l"
-{yylval->s = new QString(yytext);return token::T_IDENTIFIER;}
- YY_BREAK
-case 99:
-/* rule 99 can match eol */
-YY_RULE_SETUP
-#line 138 "js_lex.l"
-{}
- YY_BREAK
-case 100:
-YY_RULE_SETUP
-#line 140 "js_lex.l"
-ECHO;
- YY_BREAK
-#line 1531 "lex.yy.c"
-case YY_STATE_EOF(INITIAL):
-case YY_STATE_EOF(MLCOMMENTSTATE):
- yyterminate();
-
- case YY_END_OF_BUFFER:
- {
- /* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
-
- /* Undo the effects of YY_DO_BEFORE_ACTION. */
- *yy_cp = (yy_hold_char);
- YY_RESTORE_YY_MORE_OFFSET
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
- {
- /* We're scanning a new file or input source. It's
- * possible that this happened because the user
- * just pointed yyin at a new source and called
- * yylex(). If so, then we have to assure
- * consistency between YY_CURRENT_BUFFER and our
- * globals. Here is the right place to do so, because
- * this is the first action (other than possibly a
- * back-up) that will match for the new input source.
- */
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
- }
-
- /* Note that here we test for yy_c_buf_p "<=" to the position
- * of the first EOB in the buffer, since yy_c_buf_p will
- * already have been incremented past the NUL character
- * (since all states make transitions on EOB to the
- * end-of-buffer state). Contrast this with the test
- * in input().
- */
- if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
- { /* This was really a NUL. */
- yy_state_type yy_next_state;
-
- (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( );
-
- /* Okay, we're now positioned to make the NUL
- * transition. We couldn't have
- * yy_get_previous_state() go ahead and do it
- * for us because it doesn't know how to deal
- * with the possibility of jamming (and we don't
- * want to build jamming into it because then it
- * will run more slowly).
- */
-
- yy_next_state = yy_try_NUL_trans( yy_current_state );
-
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-
- if ( yy_next_state )
- {
- /* Consume the NUL. */
- yy_cp = ++(yy_c_buf_p);
- yy_current_state = yy_next_state;
- goto yy_match;
- }
-
- else
- {
- yy_cp = (yy_c_buf_p);
- goto yy_find_action;
- }
- }
-
- else switch ( yy_get_next_buffer( ) )
- {
- case EOB_ACT_END_OF_FILE:
- {
- (yy_did_buffer_switch_on_eof) = 0;
-
- if ( yywrap( ) )
- {
- /* Note: because we've taken care in
- * yy_get_next_buffer() to have set up
- * yytext, we can now set up
- * yy_c_buf_p so that if some total
- * hoser (like flex itself) wants to
- * call the scanner after we return the
- * YY_NULL, it'll still work - another
- * YY_NULL will get returned.
- */
- (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
- yy_act = YY_STATE_EOF(YY_START);
- goto do_action;
- }
-
- else
- {
- if ( ! (yy_did_buffer_switch_on_eof) )
- YY_NEW_FILE;
- }
- break;
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- (yy_c_buf_p) =
- (yytext_ptr) + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( );
-
- yy_cp = (yy_c_buf_p);
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
- goto yy_match;
-
- case EOB_ACT_LAST_MATCH:
- (yy_c_buf_p) =
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
-
- yy_current_state = yy_get_previous_state( );
-
- yy_cp = (yy_c_buf_p);
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
- goto yy_find_action;
- }
- break;
- }
-
- default:
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--no action found" );
- } /* end of action switch */
- } /* end of scanning one token */
-} /* end of yylex */
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- * EOB_ACT_LAST_MATCH -
- * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- * EOB_ACT_END_OF_FILE - end of file
- */
-static int yy_get_next_buffer (void)
-{
- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- register char *source = (yytext_ptr);
- register int number_to_move, i;
- int ret_val;
-
- if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--end of buffer missed" );
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
- { /* Don't try to fill the buffer, so this is an EOF. */
- if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
- {
- /* We matched a single character, the EOB, so
- * treat this as a final EOF.
- */
- return EOB_ACT_END_OF_FILE;
- }
-
- else
- {
- /* We matched some text prior to the EOB, first
- * process it.
- */
- return EOB_ACT_LAST_MATCH;
- }
- }
-
- /* Try to read more data. */
-
- /* First move last chars to start of buffer. */
- number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
-
- for ( i = 0; i < number_to_move; ++i )
- *(dest++) = *(source++);
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
- /* don't do the read, it's not guaranteed to return an EOF,
- * just force an EOF
- */
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
-
- else
- {
- int num_to_read =
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
- while ( num_to_read <= 0 )
- { /* Not enough room in the buffer - grow it. */
-
- /* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
- int yy_c_buf_p_offset =
- (int) ((yy_c_buf_p) - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- int new_size = b->yy_buf_size * 2;
-
- if ( new_size <= 0 )
- b->yy_buf_size += b->yy_buf_size / 8;
- else
- b->yy_buf_size *= 2;
-
- b->yy_ch_buf = (char *)
- /* Include room in for 2 EOB chars. */
- yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
- }
- else
- /* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
-
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR(
- "fatal error - scanner input buffer overflow" );
-
- (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
-
- num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
- number_to_move - 1;
-
- }
-
- if ( num_to_read > YY_READ_BUF_SIZE )
- num_to_read = YY_READ_BUF_SIZE;
-
- /* Read in more data. */
- YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- (yy_n_chars), (size_t) num_to_read );
-
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
-
- if ( (yy_n_chars) == 0 )
- {
- if ( number_to_move == YY_MORE_ADJ )
- {
- ret_val = EOB_ACT_END_OF_FILE;
- yyrestart(yyin );
- }
-
- else
- {
- ret_val = EOB_ACT_LAST_MATCH;
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
- YY_BUFFER_EOF_PENDING;
- }
- }
-
- else
- ret_val = EOB_ACT_CONTINUE_SCAN;
-
- if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
- /* Extend the array by 50%, plus the number we really need. */
- yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
- if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
- }
-
- (yy_n_chars) += number_to_move;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
-
- (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
-
- return ret_val;
-}
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
- static yy_state_type yy_get_previous_state (void)
-{
- register yy_state_type yy_current_state;
- register char *yy_cp;
-
- yy_current_state = (yy_start);
-
- for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
- {
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 237 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- }
-
- return yy_current_state;
-}
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- * next_state = yy_try_NUL_trans( current_state );
- */
- static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
-{
- register int yy_is_jam;
- register char *yy_cp = (yy_c_buf_p);
-
- register YY_CHAR yy_c = 1;
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 237 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 236);
-
- return yy_is_jam ? 0 : yy_current_state;
-}
-
- static void yyunput (int c, register char * yy_bp )
-{
- register char *yy_cp;
-
- yy_cp = (yy_c_buf_p);
-
- /* undo effects of setting up yytext */
- *yy_cp = (yy_hold_char);
-
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
- { /* need to shift things up to make room */
- /* +2 for EOB chars. */
- register int number_to_move = (yy_n_chars) + 2;
- register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
- register char *source =
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
-
- while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- *--dest = *--source;
-
- yy_cp += (int) (dest - source);
- yy_bp += (int) (dest - source);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
-
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
- }
-
- *--yy_cp = (char) c;
-
- (yytext_ptr) = yy_bp;
- (yy_hold_char) = *yy_cp;
- (yy_c_buf_p) = yy_cp;
-}
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
- static int yyinput (void)
-#else
- static int input (void)
-#endif
-
-{
- int c;
-
- *(yy_c_buf_p) = (yy_hold_char);
-
- if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
- {
- /* yy_c_buf_p now points to the character we want to return.
- * If this occurs *before* the EOB characters, then it's a
- * valid NUL; if not, then we've hit the end of the buffer.
- */
- if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
- /* This was really a NUL. */
- *(yy_c_buf_p) = '\0';
-
- else
- { /* need more input */
- int offset = (yy_c_buf_p) - (yytext_ptr);
- ++(yy_c_buf_p);
-
- switch ( yy_get_next_buffer( ) )
- {
- case EOB_ACT_LAST_MATCH:
- /* This happens because yy_g_n_b()
- * sees that we've accumulated a
- * token and flags that we need to
- * try matching the token before
- * proceeding. But for input(),
- * there's no matching to consider.
- * So convert the EOB_ACT_LAST_MATCH
- * to EOB_ACT_END_OF_FILE.
- */
-
- /* Reset buffer status. */
- yyrestart(yyin );
-
- /*FALLTHROUGH*/
-
- case EOB_ACT_END_OF_FILE:
- {
- if ( yywrap( ) )
- return EOF;
-
- if ( ! (yy_did_buffer_switch_on_eof) )
- YY_NEW_FILE;
-#ifdef __cplusplus
- return yyinput();
-#else
- return input();
-#endif
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- (yy_c_buf_p) = (yytext_ptr) + offset;
- break;
- }
- }
- }
-
- c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
- *(yy_c_buf_p) = '\0'; /* preserve yytext */
- (yy_hold_char) = *++(yy_c_buf_p);
-
- return c;
-}
-#endif /* ifndef YY_NO_INPUT */
-
-/** Immediately switch to a different input stream.
- * @param input_file A readable stream.
- *
- * @note This function does not reset the start condition to @c INITIAL .
- */
- void yyrestart (FILE * input_file )
-{
-
- if ( ! YY_CURRENT_BUFFER ){
- yyensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
- yy_create_buffer(yyin,YY_BUF_SIZE );
- }
-
- yy_init_buffer(YY_CURRENT_BUFFER,input_file );
- yy_load_buffer_state( );
-}
-
-/** Switch to a different input buffer.
- * @param new_buffer The new input buffer.
- *
- */
- void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
-{
-
- /* TODO. We should be able to replace this entire function body
- * with
- * yypop_buffer_state();
- * yypush_buffer_state(new_buffer);
- */
- yyensure_buffer_stack ();
- if ( YY_CURRENT_BUFFER == new_buffer )
- return;
-
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *(yy_c_buf_p) = (yy_hold_char);
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
-
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
- yy_load_buffer_state( );
-
- /* We don't actually know whether we did this switch during
- * EOF (yywrap()) processing, but the only time this flag
- * is looked at is after yywrap() is called, so it's safe
- * to go ahead and always set it.
- */
- (yy_did_buffer_switch_on_eof) = 1;
-}
-
-static void yy_load_buffer_state (void)
-{
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
- yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
- (yy_hold_char) = *(yy_c_buf_p);
-}
-
-/** Allocate and initialize an input buffer state.
- * @param file A readable stream.
- * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- *
- * @return the allocated buffer state.
- */
- YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
-{
- YY_BUFFER_STATE b;
-
- b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
- b->yy_buf_size = size;
-
- /* yy_ch_buf has to be 2 characters longer than the size given because
- * we need to put in 2 end-of-buffer characters.
- */
- b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
- b->yy_is_our_buffer = 1;
-
- yy_init_buffer(b,file );
-
- return b;
-}
-
-/** Destroy the buffer.
- * @param b a buffer created with yy_create_buffer()
- *
- */
- void yy_delete_buffer (YY_BUFFER_STATE b )
-{
-
- if ( ! b )
- return;
-
- if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
- YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
-
- if ( b->yy_is_our_buffer )
- yyfree((void *) b->yy_ch_buf );
-
- yyfree((void *) b );
-}
-
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-
-/* Initializes or reinitializes a buffer.
- * This function is sometimes called more than once on the same buffer,
- * such as during a yyrestart() or at EOF.
- */
- static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
-
-{
- int oerrno = errno;
-
- yy_flush_buffer(b );
-
- b->yy_input_file = file;
- b->yy_fill_buffer = 1;
-
- /* If b is the current buffer, then yy_init_buffer was _probably_
- * called from yyrestart() or through yy_get_next_buffer.
- * In that case, we don't want to reset the lineno or column.
- */
- if (b != YY_CURRENT_BUFFER){
- b->yy_bs_lineno = 1;
- b->yy_bs_column = 0;
- }
-
- b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-
- errno = oerrno;
-}
-
-/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
- * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- *
- */
- void yy_flush_buffer (YY_BUFFER_STATE b )
-{
- if ( ! b )
- return;
-
- b->yy_n_chars = 0;
-
- /* We always need two end-of-buffer characters. The first causes
- * a transition to the end-of-buffer state. The second causes
- * a jam in that state.
- */
- b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
- b->yy_buf_pos = &b->yy_ch_buf[0];
-
- b->yy_at_bol = 1;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- if ( b == YY_CURRENT_BUFFER )
- yy_load_buffer_state( );
-}
-
-/** Pushes the new state onto the stack. The new state becomes
- * the current state. This function will allocate the stack
- * if necessary.
- * @param new_buffer The new state.
- *
- */
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
-{
- if (new_buffer == NULL)
- return;
-
- yyensure_buffer_stack();
-
- /* This block is copied from yy_switch_to_buffer. */
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *(yy_c_buf_p) = (yy_hold_char);
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
-
- /* Only push if top exists. Otherwise, replace top. */
- if (YY_CURRENT_BUFFER)
- (yy_buffer_stack_top)++;
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
- /* copied from yy_switch_to_buffer. */
- yy_load_buffer_state( );
- (yy_did_buffer_switch_on_eof) = 1;
-}
-
-/** Removes and deletes the top of the stack, if present.
- * The next element becomes the new top.
- *
- */
-void yypop_buffer_state (void)
-{
- if (!YY_CURRENT_BUFFER)
- return;
-
- yy_delete_buffer(YY_CURRENT_BUFFER );
- YY_CURRENT_BUFFER_LVALUE = NULL;
- if ((yy_buffer_stack_top) > 0)
- --(yy_buffer_stack_top);
-
- if (YY_CURRENT_BUFFER) {
- yy_load_buffer_state( );
- (yy_did_buffer_switch_on_eof) = 1;
- }
-}
-
-/* Allocates the stack if it does not exist.
- * Guarantees space for at least one push.
- */
-static void yyensure_buffer_stack (void)
-{
- int num_to_alloc;
-
- if (!(yy_buffer_stack)) {
-
- /* First allocation is just for 2 elements, since we don't know if this
- * scanner will even need a stack. We use 2 instead of 1 to avoid an
- * immediate realloc on the next call.
- */
- num_to_alloc = 1;
- (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
- (num_to_alloc * sizeof(struct yy_buffer_state*)
- );
- if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-
- memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
- (yy_buffer_stack_max) = num_to_alloc;
- (yy_buffer_stack_top) = 0;
- return;
- }
-
- if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
-
- /* Increase the buffer to prepare for a possible push. */
- int grow_size = 8 /* arbitrary grow size */;
-
- num_to_alloc = (yy_buffer_stack_max) + grow_size;
- (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
- ((yy_buffer_stack),
- num_to_alloc * sizeof(struct yy_buffer_state*)
- );
- if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-
- /* zero only the new slots.*/
- memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
- (yy_buffer_stack_max) = num_to_alloc;
- }
-}
-
-/** Setup the input buffer state to scan directly from a user-specified character buffer.
- * @param base the character buffer
- * @param size the size in bytes of the character buffer
- *
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
-{
- YY_BUFFER_STATE b;
-
- if ( size < 2 ||
- base[size-2] != YY_END_OF_BUFFER_CHAR ||
- base[size-1] != YY_END_OF_BUFFER_CHAR )
- /* They forgot to leave room for the EOB's. */
- return 0;
-
- b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
-
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
- b->yy_buf_pos = b->yy_ch_buf = base;
- b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
- b->yy_n_chars = b->yy_buf_size;
- b->yy_is_interactive = 0;
- b->yy_at_bol = 1;
- b->yy_fill_buffer = 0;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- yy_switch_to_buffer(b );
-
- return b;
-}
-
-/** Setup the input buffer state to scan a string. The next call to yylex() will
- * scan from a @e copy of @a str.
- * @param yystr a NUL-terminated string to scan
- *
- * @return the newly allocated buffer state object.
- * @note If you want to scan bytes that may contain NUL values, then use
- * yy_scan_bytes() instead.
- */
-YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
-{
-
- return yy_scan_bytes(yystr,strlen(yystr) );
-}
-
-/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
- * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
- *
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
-{
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- int i;
-
- /* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
- buf = (char *) yyalloc(n );
- if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
-
- for ( i = 0; i < _yybytes_len; ++i )
- buf[i] = yybytes[i];
-
- buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
-
- b = yy_scan_buffer(buf,n );
- if ( ! b )
- YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
-
- /* It's okay to grow etc. this buffer, and we should throw it
- * away when we're done.
- */
- b->yy_is_our_buffer = 1;
-
- return b;
-}
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-static void yy_fatal_error (yyconst char* msg )
-{
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
-}
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- int yyless_macro_arg = (n); \
- YY_LESS_LINENO(yyless_macro_arg);\
- yytext[yyleng] = (yy_hold_char); \
- (yy_c_buf_p) = yytext + yyless_macro_arg; \
- (yy_hold_char) = *(yy_c_buf_p); \
- *(yy_c_buf_p) = '\0'; \
- yyleng = yyless_macro_arg; \
- } \
- while ( 0 )
-
-/* Accessor methods (get/set functions) to struct members. */
-
-/** Get the current line number.
- *
- */
-int yyget_lineno (void)
-{
-
- return yylineno;
-}
-
-/** Get the input stream.
- *
- */
-FILE *yyget_in (void)
-{
- return yyin;
-}
-
-/** Get the output stream.
- *
- */
-FILE *yyget_out (void)
-{
- return yyout;
-}
-
-/** Get the length of the current token.
- *
- */
-int yyget_leng (void)
-{
- return yyleng;
-}
-
-/** Get the current token.
- *
- */
-
-char *yyget_text (void)
-{
- return yytext;
-}
-
-/** Set the current line number.
- * @param line_number
- *
- */
-void yyset_lineno (int line_number )
-{
-
- yylineno = line_number;
-}
-
-/** Set the input stream. This does not discard the current
- * input buffer.
- * @param in_str A readable stream.
- *
- * @see yy_switch_to_buffer
- */
-void yyset_in (FILE * in_str )
-{
- yyin = in_str ;
-}
-
-void yyset_out (FILE * out_str )
-{
- yyout = out_str ;
-}
-
-int yyget_debug (void)
-{
- return yy_flex_debug;
-}
-
-void yyset_debug (int bdebug )
-{
- yy_flex_debug = bdebug ;
-}
-
-static int yy_init_globals (void)
-{
- /* Initialization is the same as for the non-reentrant scanner.
- * This function is called from yylex_destroy(), so don't allocate here.
- */
-
- (yy_buffer_stack) = 0;
- (yy_buffer_stack_top) = 0;
- (yy_buffer_stack_max) = 0;
- (yy_c_buf_p) = (char *) 0;
- (yy_init) = 0;
- (yy_start) = 0;
-
-/* Defined in main.c */
-#ifdef YY_STDINIT
- yyin = stdin;
- yyout = stdout;
-#else
- yyin = (FILE *) 0;
- yyout = (FILE *) 0;
-#endif
-
- /* For future reference: Set errno on error, since we are called by
- * yylex_init()
- */
- return 0;
-}
-
-/* yylex_destroy is for both reentrant and non-reentrant scanners. */
-int yylex_destroy (void)
-{
-
- /* Pop the buffer stack, destroying each element. */
- while(YY_CURRENT_BUFFER){
- yy_delete_buffer(YY_CURRENT_BUFFER );
- YY_CURRENT_BUFFER_LVALUE = NULL;
- yypop_buffer_state();
- }
-
- /* Destroy the stack itself. */
- yyfree((yy_buffer_stack) );
- (yy_buffer_stack) = NULL;
-
- /* Reset the globals. This is important in a non-reentrant scanner so the next time
- * yylex() is called, initialization will occur. */
- yy_init_globals( );
-
- return 0;
-}
-
-/*
- * Internal utility routines.
- */
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
-{
- register int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
-}
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s )
-{
- register int n;
- for ( n = 0; s[n]; ++n )
- ;
-
- return n;
-}
-#endif
-
-void *yyalloc (yy_size_t size )
-{
- return (void *) malloc( size );
-}
-
-void *yyrealloc (void * ptr, yy_size_t size )
-{
- /* The cast to (char *) in the following accommodates both
- * implementations that use char* generic pointers, and those
- * that use void* generic pointers. It works with the latter
- * because both ANSI C and C++ allow castless assignment from
- * any pointer type to void*, and deal with argument conversions
- * as though doing an assignment.
- */
- return (void *) realloc( (char *) ptr, size );
-}
-
-void yyfree (void * ptr )
-{
- free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
-}
-
-#define YYTABLES_NAME "yytables"
-
-#line 140 "js_lex.l"
-
-
-
diff --git a/src/common/script_system/parser/js_parser.tab.cc b/src/common/script_system/parser/js_parser.tab.cc
deleted file mode 100644
index a9da25f9b..000000000
--- a/src/common/script_system/parser/js_parser.tab.cc
+++ /dev/null
@@ -1,1178 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.5. */
-
-/* Skeleton implementation for Bison LALR(1) parsers in C++
-
- Copyright (C) 2002-2011 Free Software Foundation, Inc.
-
- 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 3 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 for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see . */
-
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
-
-/* First part of user declarations. */
-
-
-/* Line 293 of lalr1.cc */
-#line 39 "js_parser.tab.cc"
-
-
-#include "js_parser.tab.hh"
-
-/* User implementation prologue. */
-
-/* Line 299 of lalr1.cc */
-#line 52 "js_parser.yy"
-
- extern int yylex(yy::JSCacheParser::semantic_type *yylval,yy::JSCacheParser::location_type *yylloc);
-
-
-/* Line 299 of lalr1.cc */
-#line 53 "js_parser.tab.cc"
-
-#ifndef YY_
-# if defined YYENABLE_NLS && YYENABLE_NLS
-# if ENABLE_NLS
-# include /* FIXME: INFRINGES ON USER NAME SPACE */
-# define YY_(msgid) dgettext ("bison-runtime", msgid)
-# endif
-# endif
-# ifndef YY_
-# define YY_(msgid) msgid
-# endif
-#endif
-
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
- If N is 0, then set CURRENT to the empty location which ends
- the previous symbol: RHS[0] (always defined). */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (N) \
- { \
- (Current).begin = YYRHSLOC (Rhs, 1).begin; \
- (Current).end = YYRHSLOC (Rhs, N).end; \
- } \
- else \
- { \
- (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
- } \
- while (false)
-#endif
-
-/* Suppress unused-variable warnings by "using" E. */
-#define YYUSE(e) ((void) (e))
-
-/* Enable debugging if requested. */
-#if YYDEBUG
-
-/* A pseudo ostream that takes yydebug_ into account. */
-# define YYCDEBUG if (yydebug_) (*yycdebug_)
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug_) \
- { \
- *yycdebug_ << Title << ' '; \
- yy_symbol_print_ ((Type), (Value), (Location)); \
- *yycdebug_ << std::endl; \
- } \
-} while (false)
-
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug_) \
- yy_reduce_print_ (Rule); \
-} while (false)
-
-# define YY_STACK_PRINT() \
-do { \
- if (yydebug_) \
- yystack_print_ (); \
-} while (false)
-
-#else /* !YYDEBUG */
-
-# define YYCDEBUG if (false) std::cerr
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-# define YY_REDUCE_PRINT(Rule)
-# define YY_STACK_PRINT()
-
-#endif /* !YYDEBUG */
-
-#define yyerrok (yyerrstatus_ = 0)
-#define yyclearin (yychar = yyempty_)
-
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
-#define YYRECOVERING() (!!yyerrstatus_)
-
-
-namespace yy {
-
-/* Line 382 of lalr1.cc */
-#line 139 "js_parser.tab.cc"
-
- /// Build a parser object.
- JSCacheParser::JSCacheParser (JSSymbolsCache& symb_yyarg, QList& tmp_yyarg)
- :
-#if YYDEBUG
- yydebug_ (false),
- yycdebug_ (&std::cerr),
-#endif
- symb (symb_yyarg),
- tmp (tmp_yyarg)
- {
- }
-
- JSCacheParser::~JSCacheParser ()
- {
- }
-
-#if YYDEBUG
- /*--------------------------------.
- | Print this symbol on YYOUTPUT. |
- `--------------------------------*/
-
- inline void
- JSCacheParser::yy_symbol_value_print_ (int yytype,
- const semantic_type* yyvaluep, const location_type* yylocationp)
- {
- YYUSE (yylocationp);
- YYUSE (yyvaluep);
- switch (yytype)
- {
- default:
- break;
- }
- }
-
-
- void
- JSCacheParser::yy_symbol_print_ (int yytype,
- const semantic_type* yyvaluep, const location_type* yylocationp)
- {
- *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm")
- << ' ' << yytname_[yytype] << " ("
- << *yylocationp << ": ";
- yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
- *yycdebug_ << ')';
- }
-#endif
-
- void
- JSCacheParser::yydestruct_ (const char* yymsg,
- int yytype, semantic_type* yyvaluep, location_type* yylocationp)
- {
- YYUSE (yylocationp);
- YYUSE (yymsg);
- YYUSE (yyvaluep);
-
- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-
- switch (yytype)
- {
-
- default:
- break;
- }
- }
-
- void
- JSCacheParser::yypop_ (unsigned int n)
- {
- yystate_stack_.pop (n);
- yysemantic_stack_.pop (n);
- yylocation_stack_.pop (n);
- }
-
-#if YYDEBUG
- std::ostream&
- JSCacheParser::debug_stream () const
- {
- return *yycdebug_;
- }
-
- void
- JSCacheParser::set_debug_stream (std::ostream& o)
- {
- yycdebug_ = &o;
- }
-
-
- JSCacheParser::debug_level_type
- JSCacheParser::debug_level () const
- {
- return yydebug_;
- }
-
- void
- JSCacheParser::set_debug_level (debug_level_type l)
- {
- yydebug_ = l;
- }
-#endif
-
- inline bool
- JSCacheParser::yy_pact_value_is_default_ (int yyvalue)
- {
- return yyvalue == yypact_ninf_;
- }
-
- inline bool
- JSCacheParser::yy_table_value_is_error_ (int yyvalue)
- {
- return yyvalue == yytable_ninf_;
- }
-
- int
- JSCacheParser::parse ()
- {
- /// Lookahead and lookahead in internal form.
- int yychar = yyempty_;
- int yytoken = 0;
-
- /* State. */
- int yyn;
- int yylen = 0;
- int yystate = 0;
-
- /* Error handling. */
- int yynerrs_ = 0;
- int yyerrstatus_ = 0;
-
- /// Semantic value of the lookahead.
- semantic_type yylval;
- /// Location of the lookahead.
- location_type yylloc;
- /// The locations where the error started and ended.
- location_type yyerror_range[3];
-
- /// $$.
- semantic_type yyval;
- /// @$.
- location_type yyloc;
-
- int yyresult;
-
- YYCDEBUG << "Starting parse" << std::endl;
-
-
- /* Initialize the stacks. The initial state will be pushed in
- yynewstate, since the latter expects the semantical and the
- location values to have been already stored, initialize these
- stacks with a primary value. */
- yystate_stack_ = state_stack_type (0);
- yysemantic_stack_ = semantic_stack_type (0);
- yylocation_stack_ = location_stack_type (0);
- yysemantic_stack_.push (yylval);
- yylocation_stack_.push (yylloc);
-
- /* New state. */
- yynewstate:
- yystate_stack_.push (yystate);
- YYCDEBUG << "Entering state " << yystate << std::endl;
-
- /* Accept? */
- if (yystate == yyfinal_)
- goto yyacceptlab;
-
- goto yybackup;
-
- /* Backup. */
- yybackup:
-
- /* Try to take a decision without lookahead. */
- yyn = yypact_[yystate];
- if (yy_pact_value_is_default_ (yyn))
- goto yydefault;
-
- /* Read a lookahead token. */
- if (yychar == yyempty_)
- {
- YYCDEBUG << "Reading a token: ";
- yychar = yylex (&yylval, &yylloc);
- }
-
-
- /* Convert token to internal form. */
- if (yychar <= yyeof_)
- {
- yychar = yytoken = yyeof_;
- YYCDEBUG << "Now at end of input." << std::endl;
- }
- else
- {
- yytoken = yytranslate_ (yychar);
- YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
- }
-
- /* If the proper action on seeing token YYTOKEN is to reduce or to
- detect an error, take that action. */
- yyn += yytoken;
- if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken)
- goto yydefault;
-
- /* Reduce or error. */
- yyn = yytable_[yyn];
- if (yyn <= 0)
- {
- if (yy_table_value_is_error_ (yyn))
- goto yyerrlab;
- yyn = -yyn;
- goto yyreduce;
- }
-
- /* Shift the lookahead token. */
- YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
- /* Discard the token being shifted. */
- yychar = yyempty_;
-
- yysemantic_stack_.push (yylval);
- yylocation_stack_.push (yylloc);
-
- /* Count tokens shifted since error; after three, turn off error
- status. */
- if (yyerrstatus_)
- --yyerrstatus_;
-
- yystate = yyn;
- goto yynewstate;
-
- /*-----------------------------------------------------------.
- | yydefault -- do the default action for the current state. |
- `-----------------------------------------------------------*/
- yydefault:
- yyn = yydefact_[yystate];
- if (yyn == 0)
- goto yyerrlab;
- goto yyreduce;
-
- /*-----------------------------.
- | yyreduce -- Do a reduction. |
- `-----------------------------*/
- yyreduce:
- yylen = yyr2_[yyn];
- /* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'. Otherwise, use the top of the stack.
-
- Otherwise, the following line sets YYVAL to garbage.
- This behavior is undocumented and Bison
- users should not rely upon it. */
- if (yylen)
- yyval = yysemantic_stack_[yylen - 1];
- else
- yyval = yysemantic_stack_[0];
-
- {
- slice slice (yylocation_stack_, yylen);
- YYLLOC_DEFAULT (yyloc, slice, yylen);
- }
- YY_REDUCE_PRINT (yyn);
- switch (yyn)
- {
- case 9:
-
-/* Line 690 of lalr1.cc */
-#line 69 "js_parser.yy"
- {
- qDebug() << "Parsing Error Recovery!!!\n";
- }
- break;
-
- case 11:
-
-/* Line 690 of lalr1.cc */
-#line 77 "js_parser.yy"
- {
- symb.pushFrame();
- }
- break;
-
- case 12:
-
-/* Line 690 of lalr1.cc */
-#line 83 "js_parser.yy"
- {
- symb.popFrame();
- }
- break;
-
- case 13:
-
-/* Line 690 of lalr1.cc */
-#line 89 "js_parser.yy"
- {
- JSVarDescriptor vd(*(yysemantic_stack_[(5) - (2)].s),(yysemantic_stack_[(5) - (3)].ftd));
- symb.currentFrame()[*(yysemantic_stack_[(5) - (2)].s)] = vd;
- }
- break;
-
- case 14:
-
-/* Line 690 of lalr1.cc */
-#line 96 "js_parser.yy"
- {
-
- }
- break;
-
- case 15:
-
-/* Line 690 of lalr1.cc */
-#line 100 "js_parser.yy"
- {
-
- }
- break;
-
- case 20:
-
-/* Line 690 of lalr1.cc */
-#line 114 "js_parser.yy"
- {
- (yyval.ftd) = (yysemantic_stack_[(2) - (2)].ftd);
- }
- break;
-
- case 21:
-
-/* Line 690 of lalr1.cc */
-#line 120 "js_parser.yy"
- {
- (yyval.ftd) = NULL;
- }
- break;
-
- case 24:
-
-/* Line 690 of lalr1.cc */
-#line 129 "js_parser.yy"
- {
- JSFunctionTypeDescriptor ftd(*(yysemantic_stack_[(6) - (2)].s));
- symb.globalFunType()[*(yysemantic_stack_[(6) - (2)].s)] = ftd;
- }
- break;
-
- case 25:
-
-/* Line 690 of lalr1.cc */
-#line 136 "js_parser.yy"
- {
- QString nm;
- if (*(yysemantic_stack_[(5) - (2)].s) == "")
- nm = QUuid::createUuid().toString();
- JSFunctionTypeDescriptor ftd(nm);
- }
- break;
-
- case 27:
-
-/* Line 690 of lalr1.cc */
-#line 146 "js_parser.yy"
- {
- symb.currentFrame()[*(yysemantic_stack_[(2) - (1)].s)] = JSVarDescriptor(*(yysemantic_stack_[(2) - (1)].s),NULL);
- }
- break;
-
- case 29:
-
-/* Line 690 of lalr1.cc */
-#line 153 "js_parser.yy"
- {
- symb.currentFrame()[*(yysemantic_stack_[(3) - (3)].s)] = JSVarDescriptor(*(yysemantic_stack_[(3) - (3)].s),NULL);
- }
- break;
-
- case 30:
-
-/* Line 690 of lalr1.cc */
-#line 159 "js_parser.yy"
- {
- (yyval.ftd) = NULL;
- }
- break;
-
- case 31:
-
-/* Line 690 of lalr1.cc */
-#line 163 "js_parser.yy"
- {
- (yyval.ftd) = NULL;
- }
- break;
-
- case 32:
-
-/* Line 690 of lalr1.cc */
-#line 167 "js_parser.yy"
- {
-
- (yyval.ftd) = (yysemantic_stack_[(1) - (1)].ftd);
- }
- break;
-
- case 33:
-
-/* Line 690 of lalr1.cc */
-#line 172 "js_parser.yy"
- {
- (yyval.ftd) = NULL;
- }
- break;
-
- case 34:
-
-/* Line 690 of lalr1.cc */
-#line 176 "js_parser.yy"
- {
- (yyval.ftd) = NULL;
- }
- break;
-
- case 35:
-
-/* Line 690 of lalr1.cc */
-#line 180 "js_parser.yy"
- {
- JSFunctionTypeDescriptor ftd(QUuid::createUuid().toString());
- for(int ii = 0;ii < tmp.size();++ii)
- ftd.varmember[tmp[ii].name] = tmp[ii];
- tmp.clear();
- symb.globalFunType()[ftd.name] = ftd;
- (yyval.ftd) = &symb.globalFunType()[ftd.name];
- }
- break;
-
- case 36:
-
-/* Line 690 of lalr1.cc */
-#line 189 "js_parser.yy"
- {
- (yyval.ftd) = NULL;
- }
- break;
-
- case 37:
-
-/* Line 690 of lalr1.cc */
-#line 193 "js_parser.yy"
- {
- (yyval.ftd) = NULL;
- }
- break;
-
- case 38:
-
-/* Line 690 of lalr1.cc */
-#line 197 "js_parser.yy"
- {
- (yyval.ftd) = NULL;
- }
- break;
-
- case 39:
-
-/* Line 690 of lalr1.cc */
-#line 201 "js_parser.yy"
- {
- (yyval.ftd) = NULL;
- }
- break;
-
- case 40:
-
-/* Line 690 of lalr1.cc */
-#line 207 "js_parser.yy"
- {
- (yyval.s) = NULL;
- }
- break;
-
- case 48:
-
-/* Line 690 of lalr1.cc */
-#line 226 "js_parser.yy"
- {
- (yyval.ftd) = symb.getFunctionType(*(yysemantic_stack_[(5) - (2)].s));
- }
- break;
-
- case 49:
-
-/* Line 690 of lalr1.cc */
-#line 233 "js_parser.yy"
- {
-
-
- }
- break;
-
- case 60:
-
-/* Line 690 of lalr1.cc */
-#line 263 "js_parser.yy"
- {
- JSVarDescriptor vd(*(yysemantic_stack_[(6) - (2)].s),(yysemantic_stack_[(6) - (4)].ftd));
- tmp.push_back(vd);
- }
- break;
-
- case 62:
-
-/* Line 690 of lalr1.cc */
-#line 271 "js_parser.yy"
- {
- JSVarDescriptor vd(*(yysemantic_stack_[(5) - (3)].s),(yysemantic_stack_[(5) - (5)].ftd));
- tmp.push_back(vd);
- }
- break;
-
-
-
-/* Line 690 of lalr1.cc */
-#line 660 "js_parser.tab.cc"
- default:
- break;
- }
- /* User semantic actions sometimes alter yychar, and that requires
- that yytoken be updated with the new translation. We take the
- approach of translating immediately before every use of yytoken.
- One alternative is translating here after every semantic action,
- but that translation would be missed if the semantic action
- invokes YYABORT, YYACCEPT, or YYERROR immediately after altering
- yychar. In the case of YYABORT or YYACCEPT, an incorrect
- destructor might then be invoked immediately. In the case of
- YYERROR, subsequent parser actions might lead to an incorrect
- destructor call or verbose syntax error message before the
- lookahead is translated. */
- YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
-
- yypop_ (yylen);
- yylen = 0;
- YY_STACK_PRINT ();
-
- yysemantic_stack_.push (yyval);
- yylocation_stack_.push (yyloc);
-
- /* Shift the result of the reduction. */
- yyn = yyr1_[yyn];
- yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0];
- if (0 <= yystate && yystate <= yylast_
- && yycheck_[yystate] == yystate_stack_[0])
- yystate = yytable_[yystate];
- else
- yystate = yydefgoto_[yyn - yyntokens_];
- goto yynewstate;
-
- /*------------------------------------.
- | yyerrlab -- here on detecting error |
- `------------------------------------*/
- yyerrlab:
- /* Make sure we have latest lookahead translation. See comments at
- user semantic actions for why this is necessary. */
- yytoken = yytranslate_ (yychar);
-
- /* If not already recovering from an error, report this error. */
- if (!yyerrstatus_)
- {
- ++yynerrs_;
- if (yychar == yyempty_)
- yytoken = yyempty_;
- error (yylloc, yysyntax_error_ (yystate, yytoken));
- }
-
- yyerror_range[1] = yylloc;
- if (yyerrstatus_ == 3)
- {
- /* If just tried and failed to reuse lookahead token after an
- error, discard it. */
-
- if (yychar <= yyeof_)
- {
- /* Return failure if at end of input. */
- if (yychar == yyeof_)
- YYABORT;
- }
- else
- {
- yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc);
- yychar = yyempty_;
- }
- }
-
- /* Else will try to reuse lookahead token after shifting the error
- token. */
- goto yyerrlab1;
-
-
- /*---------------------------------------------------.
- | yyerrorlab -- error raised explicitly by YYERROR. |
- `---------------------------------------------------*/
- yyerrorlab:
-
- /* Pacify compilers like GCC when the user code never invokes
- YYERROR and the label yyerrorlab therefore never appears in user
- code. */
- if (false)
- goto yyerrorlab;
-
- yyerror_range[1] = yylocation_stack_[yylen - 1];
- /* Do not reclaim the symbols of the rule which action triggered
- this YYERROR. */
- yypop_ (yylen);
- yylen = 0;
- yystate = yystate_stack_[0];
- goto yyerrlab1;
-
- /*-------------------------------------------------------------.
- | yyerrlab1 -- common code for both syntax error and YYERROR. |
- `-------------------------------------------------------------*/
- yyerrlab1:
- yyerrstatus_ = 3; /* Each real token shifted decrements this. */
-
- for (;;)
- {
- yyn = yypact_[yystate];
- if (!yy_pact_value_is_default_ (yyn))
- {
- yyn += yyterror_;
- if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
- {
- yyn = yytable_[yyn];
- if (0 < yyn)
- break;
- }
- }
-
- /* Pop the current state because it cannot handle the error token. */
- if (yystate_stack_.height () == 1)
- YYABORT;
-
- yyerror_range[1] = yylocation_stack_[0];
- yydestruct_ ("Error: popping",
- yystos_[yystate],
- &yysemantic_stack_[0], &yylocation_stack_[0]);
- yypop_ ();
- yystate = yystate_stack_[0];
- YY_STACK_PRINT ();
- }
-
- yyerror_range[2] = yylloc;
- // Using YYLLOC is tempting, but would change the location of
- // the lookahead. YYLOC is available though.
- YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
- yysemantic_stack_.push (yylval);
- yylocation_stack_.push (yyloc);
-
- /* Shift the error token. */
- YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
- &yysemantic_stack_[0], &yylocation_stack_[0]);
-
- yystate = yyn;
- goto yynewstate;
-
- /* Accept. */
- yyacceptlab:
- yyresult = 0;
- goto yyreturn;
-
- /* Abort. */
- yyabortlab:
- yyresult = 1;
- goto yyreturn;
-
- yyreturn:
- if (yychar != yyempty_)
- {
- /* Make sure we have latest lookahead translation. See comments
- at user semantic actions for why this is necessary. */
- yytoken = yytranslate_ (yychar);
- yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval,
- &yylloc);
- }
-
- /* Do not reclaim the symbols of the rule which action triggered
- this YYABORT or YYACCEPT. */
- yypop_ (yylen);
- while (yystate_stack_.height () != 1)
- {
- yydestruct_ ("Cleanup: popping",
- yystos_[yystate_stack_[0]],
- &yysemantic_stack_[0],
- &yylocation_stack_[0]);
- yypop_ ();
- }
-
- return yyresult;
- }
-
- // Generate an error message.
- std::string
- JSCacheParser::yysyntax_error_ (int, int)
- {
- return YY_("syntax error");
- }
-
-
- /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
- const signed char JSCacheParser::yypact_ninf_ = -46;
- const signed char
- JSCacheParser::yypact_[] =
- {
- -46, 17, 85, -46, 5, 32, -46, -46, -46, -46,
- -46, -46, -46, -46, -46, -46, 32, -46, -46, 8,
- 37, 29, -46, -46, 40, 47, 37, 47, 32, 100,
- 42, 43, 32, -46, 32, -46, -46, -46, -46, -46,
- -46, 32, -46, -46, -46, -46, -46, 2, -46, -46,
- 13, 40, 32, -46, -46, -46, -46, -46, 100, -46,
- -46, 48, 45, -46, 3, 40, -46, -46, 60, 47,
- 100, 100, 40, -46, -46, 54, 62, 32, -46, 32,
- 100, -46, -46, 45, 45, 32, 28, -46, 32, 37,
- 45, -46, 67, -46, -46, -46, 45, 100, -46, -46,
- -46, -46, -46, 11, 69, -46, -46, 32, -46, 32,
- 74, -46, 100, -46
- };
-
- /* YYDEFACT[S] -- default reduction number in state S. Performed when
- YYTABLE doesn't specify something else to do. Zero means the
- default is an error. */
- const unsigned char
- JSCacheParser::yydefact_[] =
- {
- 3, 0, 0, 1, 0, 0, 46, 11, 45, 18,
- 19, 4, 5, 3, 7, 8, 0, 6, 3, 0,
- 0, 0, 42, 9, 0, 0, 21, 0, 0, 0,
- 0, 0, 0, 64, 26, 12, 10, 22, 16, 23,
- 43, 40, 66, 47, 38, 37, 39, 0, 3, 20,
- 30, 31, 0, 32, 33, 34, 35, 36, 0, 14,
- 15, 44, 0, 28, 0, 0, 41, 59, 0, 0,
- 0, 0, 0, 53, 65, 0, 27, 0, 13, 26,
- 0, 49, 53, 0, 0, 55, 0, 24, 0, 21,
- 0, 61, 52, 50, 51, 57, 0, 0, 67, 63,
- 29, 17, 25, 0, 56, 48, 54, 0, 60, 0,
- 0, 58, 0, 62
- };
-
- /* YYPGOTO[NTERM-NUM]. */
- const signed char
- JSCacheParser::yypgoto_[] =
- {
- -46, -46, -9, -46, -46, 1, -25, -46, -46, -46,
- -46, 26, -8, -46, -46, -46, 9, -46, -28, -46,
- 6, 10, -46, -5, -46, -46, -46, -46, 16, 0,
- -46, -46, -46, -46, -46, -45, -34, -46, -46
- };
-
- /* YYDEFGOTO[NTERM-NUM]. */
- const signed char
- JSCacheParser::yydefgoto_[] =
- {
- -1, 1, 2, 11, 12, 47, 36, 14, 15, 64,
- 16, 37, 38, 17, 18, 48, 62, 76, 82, 65,
- 50, 51, 21, 22, 52, 53, 54, 55, 83, 86,
- 96, 104, 56, 103, 57, 34, 75, 58, 99
- };
-
- /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule which
- number is the opposite. If YYTABLE_NINF_, syntax error. */
- const signed char JSCacheParser::yytable_ninf_ = -3;
- const signed char
- JSCacheParser::yytable_[] =
- {
- 24, 49, 39, 13, 25, 70, 71, 77, 19, 27,
- 6, 26, 20, 28, 29, 107, 35, 3, 28, 78,
- 79, 23, 67, 40, 33, 35, 13, 85, 13, 63,
- 73, 19, 97, 19, 32, 20, 66, 20, 61, 69,
- 6, 98, 68, 29, 81, 30, 31, 72, 4, 93,
- 94, 33, 91, 28, 5, 6, 102, 7, 59, 60,
- 74, 35, 105, 80, 7, 8, 88, 9, 10, 106,
- 13, 97, 89, 109, 63, 19, 87, 112, 108, 20,
- 95, 101, 92, 100, 113, -2, 4, 84, 90, 0,
- 0, 0, 5, 6, 0, 7, 0, 0, 0, 0,
- 0, 0, 110, 8, 111, 9, 10, 41, 6, 42,
- 7, 0, 43, 0, 0, 0, 0, 44, 8, 45,
- 0, 0, 46
- };
-
- /* YYCHECK. */
- const signed char
- JSCacheParser::yycheck_[] =
- {
- 5, 29, 27, 2, 13, 50, 51, 4, 2, 18,
- 8, 16, 2, 5, 6, 4, 14, 0, 5, 16,
- 65, 16, 47, 28, 11, 14, 25, 72, 27, 34,
- 58, 25, 4, 27, 5, 25, 41, 27, 32, 48,
- 8, 13, 47, 6, 69, 19, 20, 52, 1, 83,
- 84, 11, 80, 5, 7, 8, 90, 10, 16, 16,
- 15, 14, 96, 3, 10, 18, 4, 20, 21, 97,
- 69, 4, 77, 4, 79, 69, 75, 3, 103, 69,
- 85, 89, 82, 88, 112, 0, 1, 71, 79, -1,
- -1, -1, 7, 8, -1, 10, -1, -1, -1, -1,
- -1, -1, 107, 18, 109, 20, 21, 7, 8, 9,
- 10, -1, 12, -1, -1, -1, -1, 17, 18, 19,
- -1, -1, 22
- };
-
- /* STOS_[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
- const unsigned char
- JSCacheParser::yystos_[] =
- {
- 0, 24, 25, 0, 1, 7, 8, 10, 18, 20,
- 21, 26, 27, 28, 30, 31, 33, 36, 37, 43,
- 44, 45, 46, 16, 46, 25, 46, 25, 5, 6,
- 34, 34, 5, 11, 58, 14, 29, 34, 35, 29,
- 46, 7, 9, 12, 17, 19, 22, 28, 38, 41,
- 43, 44, 47, 48, 49, 50, 55, 57, 60, 16,
- 16, 43, 39, 46, 32, 42, 46, 29, 46, 25,
- 58, 58, 46, 41, 15, 59, 40, 4, 16, 58,
- 3, 29, 41, 51, 51, 58, 52, 28, 4, 46,
- 39, 41, 52, 59, 59, 46, 53, 4, 13, 61,
- 46, 35, 59, 56, 54, 59, 41, 4, 29, 4,
- 46, 46, 3, 41
- };
-
-#if YYDEBUG
- /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
- to YYLEX-NUM. */
- const unsigned short int
- JSCacheParser::yytoken_number_[] =
- {
- 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
- 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
- 275, 276, 277
- };
-#endif
-
- /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
- const unsigned char
- JSCacheParser::yyr1_[] =
- {
- 0, 23, 24, 25, 25, 26, 26, 26, 26, 26,
- 27, 28, 29, 30, 31, 31, 32, 32, 33, 33,
- 34, 35, 35, 36, 37, 38, 39, 39, 40, 40,
- 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
- 42, 42, 43, 43, 44, 45, 46, 47, 48, 49,
- 50, 50, 51, 52, 52, 53, 53, 54, 54, 55,
- 55, 56, 56, 57, 58, 59, 60, 61
- };
-
- /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
- const unsigned char
- JSCacheParser::yyr2_[] =
- {
- 0, 2, 1, 0, 2, 1, 1, 1, 1, 2,
- 3, 1, 1, 5, 3, 3, 0, 4, 1, 1,
- 2, 0, 1, 3, 6, 5, 0, 2, 0, 3,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 0, 1, 1, 3, 3, 1, 1, 1, 5, 3,
- 4, 4, 2, 0, 3, 0, 2, 0, 3, 2,
- 6, 0, 5, 4, 1, 1, 1, 1
- };
-
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
- /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
- First, the terminals, then, starting at \a yyntokens_, nonterminals. */
- const char*
- const JSCacheParser::yytname_[] =
- {
- "$end", "error", "$undefined", "T_COLON", "T_COMMA", "T_DOT", "T_EQ",
- "T_FUNCTION", "T_IDENTIFIER", "T_LBRACE", "T_LBRACKET", "T_LPAREN",
- "T_NEW", "T_RBRACE", "T_RBRACKET", "T_RPAREN", "T_SEMICOLON",
- "T_STRING_LITERAL", "T_THIS", "T_NULL", "T_VAR", "T_CONST",
- "T_NUMERIC_LITERAL", "$accept", "Program", "StatementList", "Statement",
- "Block", "OpenBlock", "CloseBlock", "VariableDeclStatement",
- "AssignmentStatement", "OtherDeclOpt", "DeclTok", "Assignment",
- "InitOpt", "FunctionDecl", "StartFun", "StartOptFun", "OptParamList",
- "OtherOptParamList", "Expression", "OptIdTok", "MemberExpr", "ThisExpr",
- "ThisTok", "IdTok", "NewTok", "NewExpr", "FunctionExpr", "FunctionCall",
- "OptExpressionList", "OtherOptExpressionList", "OptArgumentList",
- "OtherOptArgumentList", "ObjConstExpr", "OtherOptFields", "ArrayExpr",
- "OpenBracket", "CloseBracket", "OpenArrBracket", "CloseArrBracket", 0
- };
-#endif
-
-#if YYDEBUG
- /* YYRHS -- A `-1'-separated list of the rules' RHS. */
- const JSCacheParser::rhs_number_type
- JSCacheParser::yyrhs_[] =
- {
- 24, 0, -1, 25, -1, -1, 25, 26, -1, 27,
- -1, 36, -1, 30, -1, 31, -1, 1, 16, -1,
- 28, 25, 29, -1, 10, -1, 14, -1, 33, 46,
- 35, 32, 16, -1, 43, 34, 16, -1, 44, 34,
- 16, -1, -1, 32, 4, 46, 35, -1, 20, -1,
- 21, -1, 6, 41, -1, -1, 34, -1, 37, 25,
- 29, -1, 7, 46, 58, 39, 59, 28, -1, 7,
- 42, 58, 39, 59, -1, -1, 46, 40, -1, -1,
- 40, 4, 46, -1, 43, -1, 44, -1, 48, -1,
- 49, -1, 50, -1, 55, -1, 57, -1, 19, -1,
- 17, -1, 22, -1, -1, 46, -1, 46, -1, 43,
- 5, 46, -1, 45, 5, 43, -1, 18, -1, 8,
- -1, 12, -1, 47, 46, 58, 53, 59, -1, 38,
- 25, 29, -1, 43, 58, 51, 59, -1, 44, 58,
- 51, 59, -1, 41, 52, -1, -1, 52, 4, 41,
- -1, -1, 46, 54, -1, -1, 54, 4, 46, -1,
- 28, 29, -1, 28, 46, 3, 41, 56, 29, -1,
- -1, 56, 4, 46, 3, 41, -1, 60, 41, 52,
- 61, -1, 11, -1, 15, -1, 9, -1, 13, -1
- };
-
- /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
- YYRHS. */
- const unsigned char
- JSCacheParser::yyprhs_[] =
- {
- 0, 0, 3, 5, 6, 9, 11, 13, 15, 17,
- 20, 24, 26, 28, 34, 38, 42, 43, 48, 50,
- 52, 55, 56, 58, 62, 69, 75, 76, 79, 80,
- 84, 86, 88, 90, 92, 94, 96, 98, 100, 102,
- 104, 105, 107, 109, 113, 117, 119, 121, 123, 129,
- 133, 138, 143, 146, 147, 151, 152, 155, 156, 160,
- 163, 170, 171, 177, 182, 184, 186, 188
- };
-
- /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
- const unsigned short int
- JSCacheParser::yyrline_[] =
- {
- 0, 58, 58, 60, 61, 64, 65, 66, 67, 68,
- 74, 76, 82, 88, 95, 99, 105, 106, 109, 110,
- 113, 120, 123, 127, 128, 135, 144, 145, 151, 152,
- 158, 162, 166, 171, 175, 179, 188, 192, 196, 200,
- 207, 210, 213, 214, 217, 219, 221, 223, 225, 232,
- 239, 240, 245, 248, 249, 253, 254, 257, 258, 261,
- 262, 269, 270, 277, 279, 281, 283, 285
- };
-
- // Print the state stack on the debug stream.
- void
- JSCacheParser::yystack_print_ ()
- {
- *yycdebug_ << "Stack now";
- for (state_stack_type::const_iterator i = yystate_stack_.begin ();
- i != yystate_stack_.end (); ++i)
- *yycdebug_ << ' ' << *i;
- *yycdebug_ << std::endl;
- }
-
- // Report on the debug stream that the rule \a yyrule is going to be reduced.
- void
- JSCacheParser::yy_reduce_print_ (int yyrule)
- {
- unsigned int yylno = yyrline_[yyrule];
- int yynrhs = yyr2_[yyrule];
- /* Print the symbols being reduced, and their result. */
- *yycdebug_ << "Reducing stack by rule " << yyrule - 1
- << " (line " << yylno << "):" << std::endl;
- /* The symbols being reduced. */
- for (int yyi = 0; yyi < yynrhs; yyi++)
- YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
- yyrhs_[yyprhs_[yyrule] + yyi],
- &(yysemantic_stack_[(yynrhs) - (yyi + 1)]),
- &(yylocation_stack_[(yynrhs) - (yyi + 1)]));
- }
-#endif // YYDEBUG
-
- /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
- JSCacheParser::token_number_type
- JSCacheParser::yytranslate_ (int t)
- {
- static
- const token_number_type
- translate_table[] =
- {
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
- 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22
- };
- if ((unsigned int) t <= yyuser_token_number_max_)
- return translate_table[t];
- else
- return yyundef_token_;
- }
-
- const int JSCacheParser::yyeof_ = 0;
- const int JSCacheParser::yylast_ = 122;
- const int JSCacheParser::yynnts_ = 39;
- const int JSCacheParser::yyempty_ = -2;
- const int JSCacheParser::yyfinal_ = 3;
- const int JSCacheParser::yyterror_ = 1;
- const int JSCacheParser::yyerrcode_ = 256;
- const int JSCacheParser::yyntokens_ = 23;
-
- const unsigned int JSCacheParser::yyuser_token_number_max_ = 277;
- const JSCacheParser::token_number_type JSCacheParser::yyundef_token_ = 2;
-
-
-} // yy
-
-/* Line 1136 of lalr1.cc */
-#line 1165 "js_parser.tab.cc"
-
-
-/* Line 1138 of lalr1.cc */
-#line 287 "js_parser.yy"
-
-
-namespace yy
-{
- void JSCacheParser::error(location const& loc, const std::string& s)
- {
- //std::cerr << "error at " << loc << ": " << s << "\n";
- }
-}
-
diff --git a/src/common/script_system/parser/js_parser.tab.hh b/src/common/script_system/parser/js_parser.tab.hh
deleted file mode 100644
index 75f063d46..000000000
--- a/src/common/script_system/parser/js_parser.tab.hh
+++ /dev/null
@@ -1,320 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.5. */
-
-/* Skeleton interface for Bison LALR(1) parsers in C++
-
- Copyright (C) 2002-2011 Free Software Foundation, Inc.
-
- 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 3 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 for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see . */
-
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
-/* C++ LALR(1) parser skeleton written by Akim Demaille. */
-
-#ifndef PARSER_HEADER_H
-# define PARSER_HEADER_H
-
-/* "%code requires" blocks. */
-
-/* Line 35 of lalr1.cc */
-#line 7 "js_parser.yy"
-
- #include
- #include "../../scriptsyntax.h"
-
-
-
-/* Line 35 of lalr1.cc */
-#line 50 "js_parser.tab.hh"
-
-
-#include
-#include
-#include "stack.hh"
-#include "location.hh"
-
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
-#endif
-
-
-namespace yy {
-
-/* Line 35 of lalr1.cc */
-#line 80 "js_parser.tab.hh"
-
- /// A Bison parser.
- class JSCacheParser
- {
- public:
- /// Symbol semantic values.
-#ifndef YYSTYPE
- union semantic_type
- {
-
-/* Line 35 of lalr1.cc */
-#line 15 "js_parser.yy"
-
- int i;
- unsigned u;
- unsigned long ul;
- unsigned long long ull;
- long l;
- double d;
- float f;
- QString *s;
- JSFunctionTypeDescriptor* ftd;
- JSVarDescriptor* vd;
-
-
-
-/* Line 35 of lalr1.cc */
-#line 108 "js_parser.tab.hh"
- };
-#else
- typedef YYSTYPE semantic_type;
-#endif
- /// Symbol locations.
- typedef location location_type;
- /// Tokens.
- struct token
- {
- /* Tokens. */
- enum yytokentype {
- T_COLON = 258,
- T_COMMA = 259,
- T_DOT = 260,
- T_EQ = 261,
- T_FUNCTION = 262,
- T_IDENTIFIER = 263,
- T_LBRACE = 264,
- T_LBRACKET = 265,
- T_LPAREN = 266,
- T_NEW = 267,
- T_RBRACE = 268,
- T_RBRACKET = 269,
- T_RPAREN = 270,
- T_SEMICOLON = 271,
- T_STRING_LITERAL = 272,
- T_THIS = 273,
- T_NULL = 274,
- T_VAR = 275,
- T_CONST = 276,
- T_NUMERIC_LITERAL = 277
- };
-
- };
- /// Token type.
- typedef token::yytokentype token_type;
-
- /// Build a parser object.
- JSCacheParser (JSSymbolsCache& symb_yyarg, QList& tmp_yyarg);
- virtual ~JSCacheParser ();
-
- /// Parse.
- /// \returns 0 iff parsing succeeded.
- virtual int parse ();
-
-#if YYDEBUG
- /// The current debugging stream.
- std::ostream& debug_stream () const;
- /// Set the current debugging stream.
- void set_debug_stream (std::ostream &);
-
- /// Type for debugging levels.
- typedef int debug_level_type;
- /// The current debugging level.
- debug_level_type debug_level () const;
- /// Set the current debugging level.
- void set_debug_level (debug_level_type l);
-#endif
-
- private:
- /// Report a syntax error.
- /// \param loc where the syntax error is found.
- /// \param msg a description of the syntax error.
- virtual void error (const location_type& loc, const std::string& msg);
-
- /// Generate an error message.
- /// \param state the state where the error occurred.
- /// \param tok the lookahead token.
- virtual std::string yysyntax_error_ (int yystate, int tok);
-
-#if YYDEBUG
- /// \brief Report a symbol value on the debug stream.
- /// \param yytype The token type.
- /// \param yyvaluep Its semantic value.
- /// \param yylocationp Its location.
- virtual void yy_symbol_value_print_ (int yytype,
- const semantic_type* yyvaluep,
- const location_type* yylocationp);
- /// \brief Report a symbol on the debug stream.
- /// \param yytype The token type.
- /// \param yyvaluep Its semantic value.
- /// \param yylocationp Its location.
- virtual void yy_symbol_print_ (int yytype,
- const semantic_type* yyvaluep,
- const location_type* yylocationp);
-#endif
-
-
- /// State numbers.
- typedef int state_type;
- /// State stack type.
- typedef stack state_stack_type;
- /// Semantic value stack type.
- typedef stack semantic_stack_type;
- /// location stack type.
- typedef stack location_stack_type;
-
- /// The state stack.
- state_stack_type yystate_stack_;
- /// The semantic value stack.
- semantic_stack_type yysemantic_stack_;
- /// The location stack.
- location_stack_type yylocation_stack_;
-
- /// Whether the given \c yypact_ value indicates a defaulted state.
- /// \param yyvalue the value to check
- static bool yy_pact_value_is_default_ (int yyvalue);
-
- /// Whether the given \c yytable_ value indicates a syntax error.
- /// \param yyvalue the value to check
- static bool yy_table_value_is_error_ (int yyvalue);
-
- /// Internal symbol numbers.
- typedef unsigned char token_number_type;
- /* Tables. */
- /// For a state, the index in \a yytable_ of its portion.
- static const signed char yypact_[];
- static const signed char yypact_ninf_;
-
- /// For a state, default reduction number.
- /// Unless\a yytable_ specifies something else to do.
- /// Zero means the default is an error.
- static const unsigned char yydefact_[];
-
- static const signed char yypgoto_[];
- static const signed char yydefgoto_[];
-
- /// What to do in a state.
- /// \a yytable_[yypact_[s]]: what to do in state \a s.
- /// - if positive, shift that token.
- /// - if negative, reduce the rule which number is the opposite.
- /// - if zero, do what YYDEFACT says.
- static const signed char yytable_[];
- static const signed char yytable_ninf_;
-
- static const signed char yycheck_[];
-
- /// For a state, its accessing symbol.
- static const unsigned char yystos_[];
-
- /// For a rule, its LHS.
- static const unsigned char yyr1_[];
- /// For a rule, its RHS length.
- static const unsigned char yyr2_[];
-
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
- /// For a symbol, its name in clear.
- static const char* const yytname_[];
-#endif
-
-#if YYDEBUG
- /// A type to store symbol numbers and -1.
- typedef signed char rhs_number_type;
- /// A `-1'-separated list of the rules' RHS.
- static const rhs_number_type yyrhs_[];
- /// For each rule, the index of the first RHS symbol in \a yyrhs_.
- static const unsigned char yyprhs_[];
- /// For each rule, its source line number.
- static const unsigned short int yyrline_[];
- /// For each scanner token number, its symbol number.
- static const unsigned short int yytoken_number_[];
- /// Report on the debug stream that the rule \a r is going to be reduced.
- virtual void yy_reduce_print_ (int r);
- /// Print the state stack on the debug stream.
- virtual void yystack_print_ ();
-
- /* Debugging. */
- int yydebug_;
- std::ostream* yycdebug_;
-#endif
-
- /// Convert a scanner token number \a t to a symbol number.
- token_number_type yytranslate_ (int t);
-
- /// \brief Reclaim the memory associated to a symbol.
- /// \param yymsg Why this token is reclaimed.
- /// \param yytype The symbol type.
- /// \param yyvaluep Its semantic value.
- /// \param yylocationp Its location.
- inline void yydestruct_ (const char* yymsg,
- int yytype,
- semantic_type* yyvaluep,
- location_type* yylocationp);
-
- /// Pop \a n symbols the three stacks.
- inline void yypop_ (unsigned int n = 1);
-
- /* Constants. */
- static const int yyeof_;
- /* LAST_ -- Last index in TABLE_. */
- static const int yylast_;
- static const int yynnts_;
- static const int yyempty_;
- static const int yyfinal_;
- static const int yyterror_;
- static const int yyerrcode_;
- static const int yyntokens_;
- static const unsigned int yyuser_token_number_max_;
- static const token_number_type yyundef_token_;
-
- /* User arguments. */
- JSSymbolsCache& symb;
- QList& tmp;
- };
-
-} // yy
-
-/* Line 35 of lalr1.cc */
-#line 317 "js_parser.tab.hh"
-
-
-
-#endif /* ! defined PARSER_HEADER_H */
diff --git a/src/common/script_system/parser/js_parser.yy b/src/common/script_system/parser/js_parser.yy
deleted file mode 100644
index 2e43a1ce8..000000000
--- a/src/common/script_system/parser/js_parser.yy
+++ /dev/null
@@ -1,295 +0,0 @@
-%language "C++"
-%defines /* generates .h */
-%locations
-%define parser_class_name "JSCacheParser"
-
-%code requires
-{
- #include
- #include "../../scriptsyntax.h"
-}
-
-%parse-param {JSSymbolsCache& symb} /*add a parameter member to the parser class*/
-%parse-param {QList& tmp} /*add a parameter member to the parser class*/
-
-%union {
- int i;
- unsigned u;
- unsigned long ul;
- unsigned long long ull;
- long l;
- double d;
- float f;
- QString *s;
- JSFunctionTypeDescriptor* ftd;
- JSVarDescriptor* vd;
-};
-
-%token T_COLON
-%token T_COMMA
-%token T_DOT
-%token T_EQ
-%token T_FUNCTION
-%token T_IDENTIFIER
-%token T_LBRACE
-%token T_LBRACKET
-%token T_LPAREN
-%token T_NEW
-%token T_RBRACE
-%token T_RBRACKET
-%token T_RPAREN
-%token T_SEMICOLON
-%token T_STRING_LITERAL
-%token T_THIS
-%token T_NULL
-%token T_VAR
-%token T_CONST
-%token T_NUMERIC_LITERAL
-
-%type Expression NewExpr Assignment InitOpt;
-%type IdTok OptIdTok;
-
-%{
- extern int yylex(yy::JSCacheParser::semantic_type *yylval,yy::JSCacheParser::location_type *yylloc);
-%}
-
-%%
-
-Program: StatementList;
-
-StatementList:
- | StatementList Statement
- ;
-
-Statement: Block
- | FunctionDecl
- | VariableDeclStatement
- | AssignmentStatement
- | error T_SEMICOLON
- {
- qDebug() << "Parsing Error Recovery!!!\n";
- }
- ;
-
-Block: OpenBlock StatementList CloseBlock;
-
-OpenBlock: T_LBRACKET
- {
- symb.pushFrame();
- }
- ;
-
-CloseBlock: T_RBRACKET
- {
- symb.popFrame();
- }
- ;
-
-VariableDeclStatement: DeclTok IdTok InitOpt OtherDeclOpt T_SEMICOLON
- {
- JSVarDescriptor vd(*$2,$3);
- symb.currentFrame()[*$2] = vd;
- }
- ;
-
-AssignmentStatement: MemberExpr Assignment T_SEMICOLON
- {
-
- }
- | ThisExpr Assignment T_SEMICOLON
- {
-
- }
- ;
-
-OtherDeclOpt:
- | OtherDeclOpt T_COMMA IdTok InitOpt
- ;
-
-DeclTok: T_VAR
- | T_CONST
- ;
-
-Assignment: T_EQ Expression
- {
- $$ = $2;
- }
- ;
-
-InitOpt:
- {
- $$ = NULL;
- }
- | Assignment
- ;
-
-/*divided in two rules in order to add formal parameters to current frame in the varsstack*/
-FunctionDecl: StartFun StatementList CloseBlock;
-StartFun: T_FUNCTION IdTok OpenBracket OptParamList CloseBracket OpenBlock
- {
- JSFunctionTypeDescriptor ftd(*$2);
- symb.globalFunType()[*$2] = ftd;
- }
- ;
-
-StartOptFun : T_FUNCTION OptIdTok OpenBracket OptParamList CloseBracket
- {
- QString nm;
- if (*$2 == "")
- nm = QUuid::createUuid().toString();
- JSFunctionTypeDescriptor ftd(nm);
- }
- ;
-
-OptParamList:
- | IdTok OtherOptParamList
- {
- symb.currentFrame()[*$1] = JSVarDescriptor(*$1,NULL);
- }
- ;
-
-OtherOptParamList:
- | OtherOptParamList T_COMMA IdTok
- {
- symb.currentFrame()[*$3] = JSVarDescriptor(*$3,NULL);
- }
- ;
-
-Expression: MemberExpr
- {
- $$ = NULL;
- }
- | ThisExpr
- {
- $$ = NULL;
- }
- | NewExpr
- {
-
- $$ = $1;
- }
- | FunctionExpr
- {
- $$ = NULL;
- }
- | FunctionCall
- {
- $$ = NULL;
- }
- | ObjConstExpr
- {
- JSFunctionTypeDescriptor ftd(QUuid::createUuid().toString());
- for(int ii = 0;ii < tmp.size();++ii)
- ftd.varmember[tmp[ii].name] = tmp[ii];
- tmp.clear();
- symb.globalFunType()[ftd.name] = ftd;
- $$ = &symb.globalFunType()[ftd.name];
- }
- | ArrayExpr
- {
- $$ = NULL;
- }
- | T_NULL
- {
- $$ = NULL;
- }
- | T_STRING_LITERAL
- {
- $$ = NULL;
- }
- | T_NUMERIC_LITERAL
- {
- $$ = NULL;
- }
- ;
-
-OptIdTok:
- {
- $$ = NULL;
- }
- | IdTok
- ;
-
-MemberExpr: IdTok
- | MemberExpr T_DOT IdTok
- ;
-
-ThisExpr: ThisTok T_DOT MemberExpr;
-
-ThisTok: T_THIS;
-
-IdTok: T_IDENTIFIER;
-
-NewTok: T_NEW;
-
-NewExpr: NewTok IdTok OpenBracket OptArgumentList CloseBracket
- {
- $$ = symb.getFunctionType(*$2);
- };
-
-
-
-FunctionExpr: StartOptFun StatementList CloseBlock
- {
-
-
- }
- ;
-
-FunctionCall: MemberExpr OpenBracket OptExpressionList CloseBracket
- | ThisExpr OpenBracket OptExpressionList CloseBracket
- ;
-
-
-OptExpressionList:
- Expression OtherOptExpressionList
- ;
-
-OtherOptExpressionList:
- | OtherOptExpressionList T_COMMA Expression
- ;
-
-
-OptArgumentList:
- | IdTok OtherOptArgumentList
- ;
-
-OtherOptArgumentList:
- | OtherOptArgumentList T_COMMA IdTok
- ;
-
-ObjConstExpr: OpenBlock CloseBlock
- | OpenBlock IdTok T_COLON Expression OtherOptFields CloseBlock
- {
- JSVarDescriptor vd(*$2,$4);
- tmp.push_back(vd);
- }
- ;
-
-OtherOptFields:
- | OtherOptFields T_COMMA IdTok T_COLON Expression
- {
- JSVarDescriptor vd(*$3,$5);
- tmp.push_back(vd);
- }
- ;
-
-ArrayExpr: OpenArrBracket Expression OtherOptExpressionList CloseArrBracket;
-
-OpenBracket: T_LPAREN;
-
-CloseBracket: T_RPAREN;
-
-OpenArrBracket: T_LBRACE;
-
-CloseArrBracket: T_RBRACE;
-
-%%
-
-namespace yy
-{
- void JSCacheParser::error(location const& loc, const std::string& s)
- {
- //std::cerr << "error at " << loc << ": " << s << "\n";
- }
-}
diff --git a/src/common/script_system/parser/location.hh b/src/common/script_system/parser/location.hh
deleted file mode 100644
index c125dd262..000000000
--- a/src/common/script_system/parser/location.hh
+++ /dev/null
@@ -1,164 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.5. */
-
-/* Locations for Bison parsers in C++
-
- Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc.
-
- 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 3 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 for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see . */
-
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
-/**
- ** \file location.hh
- ** Define the yy::location class.
- */
-
-#ifndef BISON_LOCATION_HH
-# define BISON_LOCATION_HH
-
-# include
-# include
-# include "position.hh"
-
-
-namespace yy {
-
-/* Line 162 of location.cc */
-#line 50 "location.hh"
-
- /// Abstract a location.
- class location
- {
- public:
-
- /// Construct a location.
- location ()
- : begin (), end ()
- {
- }
-
-
- /// Initialization.
- inline void initialize (std::string* fn)
- {
- begin.initialize (fn);
- end = begin;
- }
-
- /** \name Line and Column related manipulators
- ** \{ */
- public:
- /// Reset initial location to final location.
- inline void step ()
- {
- begin = end;
- }
-
- /// Extend the current location to the COUNT next columns.
- inline void columns (unsigned int count = 1)
- {
- end += count;
- }
-
- /// Extend the current location to the COUNT next lines.
- inline void lines (unsigned int count = 1)
- {
- end.lines (count);
- }
- /** \} */
-
-
- public:
- /// Beginning of the located region.
- position begin;
- /// End of the located region.
- position end;
- };
-
- /// Join two location objects to create a location.
- inline const location operator+ (const location& begin, const location& end)
- {
- location res = begin;
- res.end = end.end;
- return res;
- }
-
- /// Add two location objects.
- inline const location operator+ (const location& begin, unsigned int width)
- {
- location res = begin;
- res.columns (width);
- return res;
- }
-
- /// Add and assign a location.
- inline location& operator+= (location& res, unsigned int width)
- {
- res.columns (width);
- return res;
- }
-
- /// Compare two location objects.
- inline bool
- operator== (const location& loc1, const location& loc2)
- {
- return loc1.begin == loc2.begin && loc1.end == loc2.end;
- }
-
- /// Compare two location objects.
- inline bool
- operator!= (const location& loc1, const location& loc2)
- {
- return !(loc1 == loc2);
- }
-
- /** \brief Intercept output stream redirection.
- ** \param ostr the destination output stream
- ** \param loc a reference to the location to redirect
- **
- ** Avoid duplicate information.
- */
- inline std::ostream& operator<< (std::ostream& ostr, const location& loc)
- {
- position last = loc.end - 1;
- ostr << loc.begin;
- if (last.filename
- && (!loc.begin.filename
- || *loc.begin.filename != *last.filename))
- ostr << '-' << last;
- else if (loc.begin.line != last.line)
- ostr << '-' << last.line << '.' << last.column;
- else if (loc.begin.column != last.column)
- ostr << '-' << last.column;
- return ostr;
- }
-
-
-} // yy
-
-/* Line 271 of location.cc */
-#line 163 "location.hh"
-
-#endif // not BISON_LOCATION_HH
diff --git a/src/common/script_system/parser/position.hh b/src/common/script_system/parser/position.hh
deleted file mode 100644
index 07361ba14..000000000
--- a/src/common/script_system/parser/position.hh
+++ /dev/null
@@ -1,161 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.5. */
-
-/* Positions for Bison parsers in C++
-
- Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc.
-
- 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 3 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 for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see . */
-
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
-/**
- ** \file position.hh
- ** Define the yy::position class.
- */
-
-#ifndef BISON_POSITION_HH
-# define BISON_POSITION_HH
-
-# include
-# include
-# include
-
-
-namespace yy {
-
-/* Line 37 of location.cc */
-#line 50 "position.hh"
- /// Abstract a position.
- class position
- {
- public:
-
- /// Construct a position.
- position ()
- : filename (0), line (1), column (1)
- {
- }
-
-
- /// Initialization.
- inline void initialize (std::string* fn)
- {
- filename = fn;
- line = 1;
- column = 1;
- }
-
- /** \name Line and Column related manipulators
- ** \{ */
- public:
- /// (line related) Advance to the COUNT next lines.
- inline void lines (int count = 1)
- {
- column = 1;
- line += count;
- }
-
- /// (column related) Advance to the COUNT next columns.
- inline void columns (int count = 1)
- {
- column = std::max (1u, column + count);
- }
- /** \} */
-
- public:
- /// File name to which this position refers.
- std::string* filename;
- /// Current line number.
- unsigned int line;
- /// Current column number.
- unsigned int column;
- };
-
- /// Add and assign a position.
- inline const position&
- operator+= (position& res, const int width)
- {
- res.columns (width);
- return res;
- }
-
- /// Add two position objects.
- inline const position
- operator+ (const position& begin, const int width)
- {
- position res = begin;
- return res += width;
- }
-
- /// Add and assign a position.
- inline const position&
- operator-= (position& res, const int width)
- {
- return res += -width;
- }
-
- /// Add two position objects.
- inline const position
- operator- (const position& begin, const int width)
- {
- return begin + -width;
- }
-
- /// Compare two position objects.
- inline bool
- operator== (const position& pos1, const position& pos2)
- {
- return (pos1.line == pos2.line
- && pos1.column == pos2.column
- && (pos1.filename == pos2.filename
- || (pos1.filename && pos2.filename
- && *pos1.filename == *pos2.filename)));
- }
-
- /// Compare two position objects.
- inline bool
- operator!= (const position& pos1, const position& pos2)
- {
- return !(pos1 == pos2);
- }
-
- /** \brief Intercept output stream redirection.
- ** \param ostr the destination output stream
- ** \param pos a reference to the position to redirect
- */
- inline std::ostream&
- operator<< (std::ostream& ostr, const position& pos)
- {
- if (pos.filename)
- ostr << *pos.filename << ':';
- return ostr << pos.line << '.' << pos.column;
- }
-
-
-} // yy
-
-/* Line 144 of location.cc */
-#line 161 "position.hh"
-#endif // not BISON_POSITION_HH
diff --git a/src/common/script_system/parser/stack.hh b/src/common/script_system/parser/stack.hh
deleted file mode 100644
index 48db71755..000000000
--- a/src/common/script_system/parser/stack.hh
+++ /dev/null
@@ -1,135 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.5. */
-
-/* Stack handling for Bison parsers in C++
-
- Copyright (C) 2002-2011 Free Software Foundation, Inc.
-
- 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 3 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 for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see . */
-
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
-#ifndef BISON_STACK_HH
-# define BISON_STACK_HH
-
-#include
-
-
-namespace yy {
-
-/* Line 1149 of lalr1.cc */
-#line 43 "stack.hh"
- template >
- class stack
- {
- public:
-
- // Hide our reversed order.
- typedef typename S::reverse_iterator iterator;
- typedef typename S::const_reverse_iterator const_iterator;
-
- stack () : seq_ ()
- {
- }
-
- stack (unsigned int n) : seq_ (n)
- {
- }
-
- inline
- T&
- operator [] (unsigned int i)
- {
- return seq_[i];
- }
-
- inline
- const T&
- operator [] (unsigned int i) const
- {
- return seq_[i];
- }
-
- inline
- void
- push (const T& t)
- {
- seq_.push_front (t);
- }
-
- inline
- void
- pop (unsigned int n = 1)
- {
- for (; n; --n)
- seq_.pop_front ();
- }
-
- inline
- unsigned int
- height () const
- {
- return seq_.size ();
- }
-
- inline const_iterator begin () const { return seq_.rbegin (); }
- inline const_iterator end () const { return seq_.rend (); }
-
- private:
-
- S seq_;
- };
-
- /// Present a slice of the top of a stack.
- template >
- class slice
- {
- public:
-
- slice (const S& stack,
- unsigned int range) : stack_ (stack),
- range_ (range)
- {
- }
-
- inline
- const T&
- operator [] (unsigned int i) const
- {
- return stack_[range_ - i];
- }
-
- private:
-
- const S& stack_;
- unsigned int range_;
- };
-
-} // yy
-
-/* Line 1235 of lalr1.cc */
-#line 133 "stack.hh"
-
-#endif // not BISON_STACK_HH[]dnl
-
diff --git a/src/external.cmake b/src/external.cmake
deleted file mode 100644
index 08be7e6c3..000000000
--- a/src/external.cmake
+++ /dev/null
@@ -1,366 +0,0 @@
-# Copyright 2019 Collabora, Ltd.
-# SPDX-License-Identifier: BSL-1.0
-
-# GLEW - required
-set(GLEW_DIR ${EXTERNAL_DIR}/glew-2.1.0)
-if(ALLOW_SYSTEM_GLEW AND TARGET GLEW::GLEW)
- message(STATUS "- glew - using system-provided library")
- add_library(external-glew INTERFACE)
- target_link_libraries(external-glew INTERFACE GLEW::GLEW)
- if(TARGET OpenGL::OpenGL)
- target_link_libraries(external-glew INTERFACE OpenGL::OpenGL)
- elseif(TARGET OpenGL::GL)
- target_link_libraries(external-glew INTERFACE OpenGL::GL)
- else()
- message(FATAL_ERROR "OpenGL not found or your CMake version is too old!")
- endif()
-elseif(ALLOW_BUNDLED_GLEW AND EXISTS "${GLEW_DIR}/src/glew.c")
- message(STATUS "- glew - using bundled source")
- add_library(external-glew STATIC "${GLEW_DIR}/src/glew.c")
- target_compile_definitions(external-glew PUBLIC GLEW_STATIC)
- target_include_directories(external-glew SYSTEM PUBLIC ${GLEW_DIR}/include)
- if(TARGET OpenGL::OpenGL)
- target_link_libraries(external-glew PUBLIC OpenGL::OpenGL)
- elseif(TARGET OpenGL::GL)
- target_link_libraries(external-glew PUBLIC OpenGL::GL)
- else()
- message(FATAL_ERROR "OpenGL not found or your CMake version is too old!")
- endif()
- if(TARGET OpenGL::GLX)
- target_link_libraries(external-glew PUBLIC OpenGL::GLX)
- endif()
- set_property(TARGET external-glew PROPERTY FOLDER External)
-else()
- message(
- FATAL_ERROR
- "GLEW is required - at least one of ALLOW_SYSTEM_GLEW or ALLOW_BUNDLED_GLEW must be enabled and found.")
-endif()
-
-# Eigen3 - required
-set(EIGEN_DIR ${VCGDIR}/eigenlib)
-if(ALLOW_SYSTEM_EIGEN AND EIGEN3_INCLUDE_DIR)
- message(STATUS "- Eigen - using system-provided library")
- set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
-elseif(ALLOW_BUNDLED_EIGEN AND EXISTS "${EIGEN_DIR}/Eigen/Eigen")
- message(STATUS "- Eigen - using bundled source")
- set(EIGEN_INCLUDE_DIRS ${EIGEN_DIR})
-else()
- message(
- FATAL_ERROR
- "Eigen is required - at least one of ALLOW_SYSTEM_EIGEN or ALLOW_BUNDLED_EIGEN must be enabled and found.")
-endif()
-
-# newuoa - optional and header-only, for several plugins including all that use levmar
-set(NEWUOA_DIR ${VCGDIR}/wrap/newuoa)
-if(ALLOW_BUNDLED_NEWUOA AND EXISTS "${NEWUOA_DIR}/include/newuoa.h")
- message(STATUS "- newuoa - using bundled source")
- add_library(external-newuoa INTERFACE)
- target_include_directories(external-newuoa INTERFACE ${NEWUOA_DIR}/include)
-endif()
-
-# levmar - optional, for several plugins
-set(LEVMAR_DIR ${EXTERNAL_DIR}/levmar-2.3)
-if(ALLOW_BUNDLED_LEVMAR AND EXISTS "${LEVMAR_DIR}/lm.h")
- message(STATUS "- levmar - using bundled source")
- add_library(
- external-levmar STATIC
- "${LEVMAR_DIR}/compiler.h"
- "${LEVMAR_DIR}/lm.h"
- "${LEVMAR_DIR}/misc.h"
- "${LEVMAR_DIR}/Axb.c"
- "${LEVMAR_DIR}/lm.c"
- "${LEVMAR_DIR}/lmbc.c"
- "${LEVMAR_DIR}/lmblec.c"
- "${LEVMAR_DIR}/lmlec.c"
- "${LEVMAR_DIR}/misc.c")
- target_include_directories(external-levmar PUBLIC ${LEVMAR_DIR})
- set_property(TARGET external-levmar PROPERTY FOLDER External)
-endif()
-
-# lib3ds - optional, for io_3ds
-set(LIB3DS_DIR ${EXTERNAL_DIR}/lib3ds-1.3.0)
-if(ALLOW_SYSTEM_LIB3DS AND TARGET Lib3ds::Lib3ds)
- message(STATUS "- lib3ds - using system-provided library")
- add_library(external-lib3ds INTERFACE)
- target_link_libraries(external-lib3ds INTERFACE Lib3ds::Lib3ds)
-elseif(ALLOW_BUNDLED_LIB3DS AND EXISTS "${LIB3DS_DIR}/lib3ds/types.h")
- message(STATUS "- lib3ds - using bundled source")
- add_library(
- external-lib3ds STATIC
- "${LIB3DS_DIR}/lib3ds/atmosphere.c"
- "${LIB3DS_DIR}/lib3ds/atmosphere.h"
- "${LIB3DS_DIR}/lib3ds/background.c"
- "${LIB3DS_DIR}/lib3ds/background.h"
- "${LIB3DS_DIR}/lib3ds/camera.c"
- "${LIB3DS_DIR}/lib3ds/camera.h"
- "${LIB3DS_DIR}/lib3ds/chunk.c"
- "${LIB3DS_DIR}/lib3ds/chunk.h"
- "${LIB3DS_DIR}/lib3ds/chunktable.h"
- "${LIB3DS_DIR}/lib3ds/ease.c"
- "${LIB3DS_DIR}/lib3ds/ease.h"
- "${LIB3DS_DIR}/lib3ds/file.c"
- "${LIB3DS_DIR}/lib3ds/file.h"
- "${LIB3DS_DIR}/lib3ds/io.c"
- "${LIB3DS_DIR}/lib3ds/io.h"
- "${LIB3DS_DIR}/lib3ds/light.c"
- "${LIB3DS_DIR}/lib3ds/light.h"
- "${LIB3DS_DIR}/lib3ds/material.c"
- "${LIB3DS_DIR}/lib3ds/material.h"
- "${LIB3DS_DIR}/lib3ds/matrix.c"
- "${LIB3DS_DIR}/lib3ds/matrix.h"
- "${LIB3DS_DIR}/lib3ds/mesh.c"
- "${LIB3DS_DIR}/lib3ds/mesh.h"
- "${LIB3DS_DIR}/lib3ds/node.c"
- "${LIB3DS_DIR}/lib3ds/node.h"
- "${LIB3DS_DIR}/lib3ds/quat.c"
- "${LIB3DS_DIR}/lib3ds/quat.h"
- "${LIB3DS_DIR}/lib3ds/shadow.c"
- "${LIB3DS_DIR}/lib3ds/shadow.h"
- "${LIB3DS_DIR}/lib3ds/tcb.c"
- "${LIB3DS_DIR}/lib3ds/tcb.h"
- "${LIB3DS_DIR}/lib3ds/tracks.c"
- "${LIB3DS_DIR}/lib3ds/tracks.h"
- "${LIB3DS_DIR}/lib3ds/types.h"
- "${LIB3DS_DIR}/lib3ds/vector.c"
- "${LIB3DS_DIR}/lib3ds/vector.h"
- "${LIB3DS_DIR}/lib3ds/viewport.c"
- "${LIB3DS_DIR}/lib3ds/viewport.h")
- target_include_directories(external-lib3ds SYSTEM PUBLIC "${LIB3DS_DIR}")
- target_compile_definitions(external-lib3ds PUBLIC LIB3DS_STATIC)
- set_property(TARGET external-lib3ds PROPERTY FOLDER External)
-endif()
-
-# gmp or mpir - optional, for filter_csg
-if(ALLOW_SYSTEM_GMP AND GMP_FOUND)
- message(STATUS "- GMP/MPIR - using system-provided GMP library")
- add_library(external-gmp INTERFACE)
- target_include_directories(external-gmp SYSTEM INTERFACE ${GMP_INCLUDE_DIRS})
- target_link_libraries(external-gmp INTERFACE ${GMP_LIBRARIES})
-else()
- # TODO set up external-mpir per-os for bundled mpir
-endif()
-
-# muparser - optional, for filter_func
-set(MUPARSER_DIR ${EXTERNAL_DIR}/muparser_v225)
-if(ALLOW_SYSTEM_MUPARSER AND TARGET muparser::muparser)
- message(STATUS "- muparser - using system-provided library")
- add_library(external-muparser INTERFACE)
- target_link_libraries(external-muparser INTERFACE muparser::muparser)
-elseif(ALLOW_BUNDLED_MUPARSER AND EXISTS "${MUPARSER_DIR}/src/muParser.cpp")
- message(STATUS "- muparser - using bundled source")
- add_library(
- external-muparser STATIC
- "${MUPARSER_DIR}/src/muParser.cpp"
- "${MUPARSER_DIR}/src/muParserBase.cpp"
- "${MUPARSER_DIR}/src/muParserBytecode.cpp"
- "${MUPARSER_DIR}/src/muParserCallback.cpp"
- "${MUPARSER_DIR}/src/muParserDLL.cpp"
- "${MUPARSER_DIR}/src/muParserError.cpp"
- "${MUPARSER_DIR}/src/muParserInt.cpp"
- "${MUPARSER_DIR}/src/muParserTest.cpp"
- "${MUPARSER_DIR}/src/muParserTokenReader.cpp")
- target_include_directories(external-muparser SYSTEM PUBLIC ${MUPARSER_DIR}/include)
- target_compile_definitions(external-muparser PUBLIC _UNICODE)
- set_property(TARGET external-muparser PROPERTY FOLDER External)
-endif()
-
-# OpenCTM - optional, for io_ctm
-set(OPENCTM_DIR ${EXTERNAL_DIR}/OpenCTM-1.0.3)
-if(ALLOW_SYSTEM_OPENCTM AND TARGET OpenCTM::OpenCTM)
- message(STATUS "- OpenCTM - using system-provided library")
- add_library(external-openctm INTERFACE)
- target_link_libraries(external-openctm INTERFACE OpenCTM::OpenCTM)
-elseif(ALLOW_BUNDLED_OPENCTM AND EXISTS "${OPENCTM_DIR}/lib/openctm.c")
- message(STATUS "- OpenCTM - using bundled source")
- # Modified liblzma included - can't build against system version
- add_library(
- external-openctm STATIC
- "${OPENCTM_DIR}/lib/openctm.c"
- "${OPENCTM_DIR}/lib/stream.c"
- "${OPENCTM_DIR}/lib/compressRAW.c"
- "${OPENCTM_DIR}/lib/compressMG1.c"
- "${OPENCTM_DIR}/lib/compressMG2.c"
- "${OPENCTM_DIR}/lib/liblzma/Alloc.c"
- "${OPENCTM_DIR}/lib/liblzma/LzFind.c"
- "${OPENCTM_DIR}/lib/liblzma/LzmaDec.c"
- "${OPENCTM_DIR}/lib/liblzma/LzmaEnc.c"
- "${OPENCTM_DIR}/lib/liblzma/LzmaLib.c")
- target_compile_definitions(external-openctm PUBLIC OPENCTM_STATIC)
- target_include_directories(
- external-openctm SYSTEM
- PUBLIC "${OPENCTM_DIR}/lib" SYSTEM
- PRIVATE "${OPENCTM_DIR}/lib/liblzma")
- if(MSVC)
- target_compile_definitions(external-openctm PRIVATE _CRT_SECURE_NO_WARNINGS)
- endif()
- set_property(TARGET external-openctm PROPERTY FOLDER External)
-endif()
-
-# structure-synth - optional, for filter_ssynth
-set(SSYNTH_DIR ${EXTERNAL_DIR}/structuresynth-1.5)
-if(ALLOW_BUNDLED_SSYNTH AND EXISTS "${LEVMAR_DIR}/lm.h")
- message(STATUS "- structure-synth - using bundled source")
- # Can't use a system version because using StructureSynth as a library is not common
- add_library(
- external-ssynth STATIC
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Action.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/AmbiguousRule.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Builder.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/ColorPool.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/CustomRule.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/ExecutionStack.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/PrimitiveClass.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/PrimitiveRule.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/RandomStreams.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rule.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/RuleRef.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/RuleSet.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/State.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Transformation.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/TransformationLoop.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Parser/EisenParser.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Parser/Preprocessor.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Parser/Tokenizer.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Exceptions/Exception.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Box.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Dot.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/EngineWidget.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Grid.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Line.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Mesh.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Object3D.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/AtomicCounter.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/RenderThread.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/Sampler.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/VoxelStepper.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/RaytraceTriangle.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Sphere.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Triangle.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Logging/ListWidgetLogger.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Logging/Logging.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Matrix4.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Random.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Vector3.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/ColorUtils.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/MiniParser.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/Persistence.h"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/Version.h"
- "${SSYNTH_DIR}/ssynth/ThirdPartyCode/MersenneTwister/MersenneTwister.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/OpenGLRenderer.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/Renderer.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/TemplateRenderer.h"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Action.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/AmbiguousRule.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Builder.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/ColorPool.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/CustomRule.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/ExecutionStack.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/PrimitiveClass.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/PrimitiveRule.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/RandomStreams.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rule.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/RuleRef.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/RuleSet.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/State.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Transformation.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/TransformationLoop.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Parser/EisenParser.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Parser/Preprocessor.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Parser/Tokenizer.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Box.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Dot.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Grid.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Line.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Mesh.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Object3D.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/AtomicCounter.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/RenderThread.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/Sampler.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/VoxelStepper.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/RaytraceTriangle.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Triangle.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Logging/ListWidgetLogger.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Logging/Logging.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Matrix4.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Random.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Vector3.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/ColorUtils.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/MiniParser.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/Persistence.cpp"
- "${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/Version.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/Renderer.cpp"
- "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/TemplateRenderer.cpp")
-
- # These sources were disabled in the .pro file: "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/EngineWidget.cpp"
- # "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp"
- # "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Sphere.cpp"
- # "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/OpenGLRenderer.cpp"
- target_include_directories(external-ssynth SYSTEM PUBLIC "${SSYNTH_DIR}/ssynth")
- target_link_libraries(external-ssynth PRIVATE Qt5::Core Qt5::Xml Qt5::OpenGL OpenGL::GLU)
- set_property(TARGET external-ssynth PROPERTY FOLDER External)
-endif()
-
-# qhull - optional, for filter_qhull
-set(QHULL_DIR ${EXTERNAL_DIR}/qhull-2003.1)
-if(ALLOW_SYSTEM_QHULL AND TARGET Qhull::libqhull)
- message(STATUS "- qhull - using system-provided library")
- add_library(external-qhull INTERFACE)
- target_link_libraries(external-qhull INTERFACE Qhull::libqhull)
- target_compile_definitions(external-qhull INTERFACE SYSTEM_QHULL)
- target_include_directories(external-qhull INTERFACE ${QHULL_libqhull_INCLUDE_DIR}/libqhull)
-elseif(ALLOW_BUNDLED_QHULL AND EXISTS "${QHULL_DIR}/src/qhull.h")
- message(STATUS "- qhull - using bundled source")
- add_library(
- external-qhull STATIC
- "${QHULL_DIR}/src/geom2.c"
- "${QHULL_DIR}/src/global.c"
- "${QHULL_DIR}/src/io.c"
- "${QHULL_DIR}/src/io.h"
- "${QHULL_DIR}/src/mem.c"
- "${QHULL_DIR}/src/mem.h"
- "${QHULL_DIR}/src/merge.c"
- "${QHULL_DIR}/src/merge.h"
- "${QHULL_DIR}/src/poly.c"
- "${QHULL_DIR}/src/poly.h"
- "${QHULL_DIR}/src/poly2.c"
- "${QHULL_DIR}/src/qconvex.c"
- "${QHULL_DIR}/src/qhull.c"
- "${QHULL_DIR}/src/qhull.h"
- "${QHULL_DIR}/src/qset.c"
- "${QHULL_DIR}/src/qset.h"
- "${QHULL_DIR}/src/stat.c"
- "${QHULL_DIR}/src/stat.h"
- "${QHULL_DIR}/src/geom.c"
- "${QHULL_DIR}/src/geom.h"
- "${QHULL_DIR}/src/user.c"
- "${QHULL_DIR}/src/user.h")
- target_include_directories(external-qhull INTERFACE "${QHULL_DIR}/src")
- set_property(TARGET external-qhull PROPERTY FOLDER External)
-endif()
-
-# u3d - optional, for io_u3d
-set(U3D_DIR ${EXTERNAL_DIR}/u3d)
-if(ALLOW_BUNDLED_U3D)
- message(STATUS "- u3d - using bundled source")
-
- include("${U3D_DIR}/src/u3d.cmake")
- set_property(TARGET external-IDTFConverter PROPERTY FOLDER External)
-
- # These sources were disabled in the .pro file: "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/EngineWidget.cpp"
- # "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp"
- # "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Sphere.cpp"
- # "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/OpenGLRenderer.cpp"
-
- #target_include_directories(external-IDTFConverter SYSTEM PUBLIC "${U3D_DIR}/IDTF")
- #set_property(TARGET external-IDTFConverter PROPERTY FOLDER External)
-endif()
-
-# opengr - optional and header-only, for filter_globalregistration
-set(OPENGR_DIR ${EXTERNAL_DIR}/OpenGR)
-if(ALLOW_BUNDLED_OPENGR AND EXISTS "${OPENGR_DIR}/src/gr/algorithms/match4pcsBase.h")
- message(STATUS "- OpenGR - using bundled source")
- add_library(external-opengr INTERFACE)
- target_include_directories(external-opengr INTERFACE ${OPENGR_DIR}/src/)
-endif()
-
diff --git a/src/external/OpenCTM-1.0.3/CMakeLists.txt b/src/external/OpenCTM-1.0.3/CMakeLists.txt
new file mode 100644
index 000000000..856282c33
--- /dev/null
+++ b/src/external/OpenCTM-1.0.3/CMakeLists.txt
@@ -0,0 +1,29 @@
+if(TARGET OpenCTM::OpenCTM)
+ message(STATUS "- OpenCTM - using system-provided library")
+ add_library(external-openctm INTERFACE)
+ target_link_libraries(external-openctm INTERFACE OpenCTM::OpenCTM)
+else()
+ message(STATUS "- OpenCTM - using bundled source")
+ # Modified liblzma included - can't build against system version
+ add_library(
+ external-openctm STATIC
+ "${OPENCTM_DIR}/lib/openctm.c"
+ "${OPENCTM_DIR}/lib/stream.c"
+ "${OPENCTM_DIR}/lib/compressRAW.c"
+ "${OPENCTM_DIR}/lib/compressMG1.c"
+ "${OPENCTM_DIR}/lib/compressMG2.c"
+ "${OPENCTM_DIR}/lib/liblzma/Alloc.c"
+ "${OPENCTM_DIR}/lib/liblzma/LzFind.c"
+ "${OPENCTM_DIR}/lib/liblzma/LzmaDec.c"
+ "${OPENCTM_DIR}/lib/liblzma/LzmaEnc.c"
+ "${OPENCTM_DIR}/lib/liblzma/LzmaLib.c")
+ target_compile_definitions(external-openctm PUBLIC OPENCTM_STATIC)
+ target_include_directories(
+ external-openctm SYSTEM
+ PUBLIC "${OPENCTM_DIR}/lib" SYSTEM
+ PRIVATE "${OPENCTM_DIR}/lib/liblzma")
+ if(MSVC)
+ target_compile_definitions(external-openctm PRIVATE _CRT_SECURE_NO_WARNINGS)
+ endif()
+ set_property(TARGET external-openctm PROPERTY FOLDER External)
+endif()
diff --git a/src/external/external.cmake b/src/external/external.cmake
new file mode 100644
index 000000000..72d39a932
--- /dev/null
+++ b/src/external/external.cmake
@@ -0,0 +1,68 @@
+# Copyright 2019 Collabora, Ltd.
+# SPDX-License-Identifier: BSL-1.0
+
+# GLEW - required
+set(GLEW_DIR ${EXTERNAL_DIR}/glew-2.1.0)
+add_subdirectory(${GLEW_DIR})
+
+# Eigen3 - required
+set(EIGEN_DIR ${VCGDIR}/eigenlib)
+if(EIGEN3_INCLUDE_DIR)
+ message(STATUS "- Eigen - using system-provided library")
+ set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
+else()
+ message(STATUS "- Eigen - using bundled source")
+ set(EIGEN_INCLUDE_DIRS ${EIGEN_DIR})
+endif()
+
+# newuoa - optional and header-only, for several plugins including all that use levmar
+set(NEWUOA_DIR ${VCGDIR}/wrap/newuoa)
+message(STATUS "- newuoa - using bundled source")
+add_library(external-newuoa INTERFACE)
+target_include_directories(external-newuoa INTERFACE ${NEWUOA_DIR}/include)
+
+# levmar - optional, for several plugins
+set(LEVMAR_DIR ${EXTERNAL_DIR}/levmar-2.3)
+add_subdirectory(${LEVMAR_DIR})
+
+# lib3ds - optional, for io_3ds
+set(LIB3DS_DIR ${EXTERNAL_DIR}/lib3ds-1.3.0)
+add_subdirectory(${LIB3DS_DIR})
+
+# gmp or mpir - optional, for filter_csg
+if(GMP_FOUND)
+ message(STATUS "- GMP/MPIR - using system-provided GMP library")
+ add_library(external-gmp INTERFACE)
+ target_include_directories(external-gmp SYSTEM INTERFACE ${GMP_INCLUDE_DIRS})
+ target_link_libraries(external-gmp INTERFACE ${GMP_LIBRARIES})
+else()
+ # TODO set up external-mpir per-os for bundled mpir
+endif()
+
+# muparser - optional, for filter_func
+set(MUPARSER_DIR ${EXTERNAL_DIR}/muparser_v225)
+add_subdirectory(${MUPARSER_DIR})
+
+# OpenCTM - optional, for io_ctm
+set(OPENCTM_DIR ${EXTERNAL_DIR}/OpenCTM-1.0.3)
+add_subdirectory(${OPENCTM_DIR})
+
+# structure-synth - optional, for filter_ssynth
+set(SSYNTH_DIR ${EXTERNAL_DIR}/structuresynth-1.5)
+add_subdirectory(${SSYNTH_DIR})
+
+# qhull - optional, for filter_qhull
+set(QHULL_DIR ${EXTERNAL_DIR}/qhull-2003.1)
+add_subdirectory(${QHULL_DIR})
+
+# u3d - optional, for io_u3d
+set(U3D_DIR ${EXTERNAL_DIR}/u3d)
+add_subdirectory(${U3D_DIR})
+#set_property(TARGET external-IDTFConverter PROPERTY FOLDER External)
+
+# opengr - optional and header-only, for filter_globalregistration
+set(OPENGR_DIR ${EXTERNAL_DIR}/OpenGR)
+message(STATUS "- OpenGR - using bundled source")
+add_library(external-opengr INTERFACE)
+target_include_directories(external-opengr INTERFACE ${OPENGR_DIR}/src/)
+
diff --git a/src/external/glew-2.1.0/CMakeLists.txt b/src/external/glew-2.1.0/CMakeLists.txt
new file mode 100644
index 000000000..18e7f21e2
--- /dev/null
+++ b/src/external/glew-2.1.0/CMakeLists.txt
@@ -0,0 +1,39 @@
+if (DEFINED GLEW_VERSION)
+ if((TARGET GLEW::GLEW) AND (${GLEW_VERSION} VERSION_GREATER_EQUAL "2.0.0"))
+ set(USE_BUNDLED_GLEW false)
+ else()
+ set(USE_BUNDLED_GLEW true)
+ endif()
+else()
+ set(USE_BUNDLED_GLEW true)
+endif()
+
+if(${USE_BUNDLED_GLEW})
+ message(STATUS "- glew - using bundled source")
+ add_library(external-glew STATIC "${GLEW_DIR}/src/glew.c")
+ target_compile_definitions(external-glew PUBLIC GLEW_STATIC)
+ target_include_directories(external-glew SYSTEM PUBLIC ${GLEW_DIR}/include)
+ if(TARGET OpenGL::OpenGL)
+ target_link_libraries(external-glew PUBLIC OpenGL::OpenGL)
+ elseif(TARGET OpenGL::GL)
+ target_link_libraries(external-glew PUBLIC OpenGL::GL)
+ else()
+ message(FATAL_ERROR "OpenGL not found or your CMake version is too old!")
+ endif()
+ if(TARGET OpenGL::GLX)
+ target_link_libraries(external-glew PUBLIC OpenGL::GLX)
+ endif()
+ set_property(TARGET external-glew PROPERTY FOLDER External)
+else()
+ message(STATUS "- glew - using system-provided library")
+ add_library(external-glew INTERFACE)
+ target_link_libraries(external-glew INTERFACE GLEW::GLEW)
+ if(TARGET OpenGL::OpenGL)
+ target_link_libraries(external-glew INTERFACE OpenGL::OpenGL)
+ elseif(TARGET OpenGL::GL)
+ target_link_libraries(external-glew INTERFACE OpenGL::GL)
+ else()
+ message(FATAL_ERROR "OpenGL not found or your CMake version is too old!")
+ endif()
+endif()
+
diff --git a/src/external/levmar-2.3/CMakeLists.txt b/src/external/levmar-2.3/CMakeLists.txt
index 0ba255c15..2c9c00561 100644
--- a/src/external/levmar-2.3/CMakeLists.txt
+++ b/src/external/levmar-2.3/CMakeLists.txt
@@ -1,52 +1,14 @@
-# levmar CMake file; see http://www.cmake.org and
-# http://www.insightsoftwareconsortium.org/wiki/index.php/CMake_Tutorial
-
-PROJECT(LEVMAR)
-#CMAKE_MINIMUM_REQUIRED(VERSION 1.4)
-
-# compiler flags
-ADD_DEFINITIONS(-DLINSOLVERS_RETAIN_MEMORY) # do not free memory between linear solvers calls
-#REMOVE_DEFINITIONS(-DLINSOLVERS_RETAIN_MEMORY)
-
-# f2c is sometimes equivalent to libF77 & libI77; in that case, set HAVE_F2C to 0
-SET(HAVE_F2C 1 CACHE BOOL "Do we have f2c or F77/I77?" )
-
-# the directory where the lapack/blas/f2c libraries reside
-SET(LAPACKBLAS_DIR /usr/lib CACHE PATH "Path to lapack/blas libraries")
-
-# actual names for the lapack/blas/f2c libraries
-SET(LAPACK_LIB lapack CACHE STRING "The name of the lapack library")
-SET(BLAS_LIB blas CACHE STRING "The name of the blas library")
-IF(HAVE_F2C)
- SET(F2C_LIB f2c CACHE STRING "The name of the f2c library")
-ELSE(HAVE_F2C)
- SET(F77_LIB libF77 CACHE STRING "The name of the F77 library")
- SET(I77_LIB libI77 CACHE STRING "The name of the I77 library")
-ENDIF(HAVE_F2C)
-
-########################## NO CHANGES BEYOND THIS POINT ##########################
-
-#INCLUDE_DIRECTORIES(/usr/include)
-LINK_DIRECTORIES(${LAPACKBLAS_DIR})
-
-# levmar library source files
-ADD_LIBRARY(levmar STATIC
- lm.c Axb.c misc.c lmlec.c lmbc.c lmblec.c
- lm.h misc.h compiler.h
-)
-
-# demo program
-ADD_EXECUTABLE(lmdemo lmdemo.c lm.h)
-# libraries the demo depends on
-IF(HAVE_F2C)
- TARGET_LINK_LIBRARIES(lmdemo levmar ${LAPACK_LIB} ${BLAS_LIB} ${F2C_LIB})
-ELSE(HAVE_F2C)
- TARGET_LINK_LIBRARIES(lmdemo levmar ${LAPACK_LIB} ${BLAS_LIB} ${F77_LIB} ${I77_LIB})
-ENDIF(HAVE_F2C)
-
-# make sure that the library is built before the demo
-ADD_DEPENDENCIES(lmdemo levmar)
-
-#SUBDIRS(matlab)
-
-#ADD_TEST(levmar_tst lmdemo)
+message(STATUS "- levmar - using bundled source")
+add_library(
+ external-levmar STATIC
+ "${LEVMAR_DIR}/compiler.h"
+ "${LEVMAR_DIR}/lm.h"
+ "${LEVMAR_DIR}/misc.h"
+ "${LEVMAR_DIR}/Axb.c"
+ "${LEVMAR_DIR}/lm.c"
+ "${LEVMAR_DIR}/lmbc.c"
+ "${LEVMAR_DIR}/lmblec.c"
+ "${LEVMAR_DIR}/lmlec.c"
+ "${LEVMAR_DIR}/misc.c")
+target_include_directories(external-levmar PUBLIC ${LEVMAR_DIR})
+set_property(TARGET external-levmar PROPERTY FOLDER External)
diff --git a/src/external/levmar-2.3/CMakeLists_original.txt b/src/external/levmar-2.3/CMakeLists_original.txt
new file mode 100644
index 000000000..0ba255c15
--- /dev/null
+++ b/src/external/levmar-2.3/CMakeLists_original.txt
@@ -0,0 +1,52 @@
+# levmar CMake file; see http://www.cmake.org and
+# http://www.insightsoftwareconsortium.org/wiki/index.php/CMake_Tutorial
+
+PROJECT(LEVMAR)
+#CMAKE_MINIMUM_REQUIRED(VERSION 1.4)
+
+# compiler flags
+ADD_DEFINITIONS(-DLINSOLVERS_RETAIN_MEMORY) # do not free memory between linear solvers calls
+#REMOVE_DEFINITIONS(-DLINSOLVERS_RETAIN_MEMORY)
+
+# f2c is sometimes equivalent to libF77 & libI77; in that case, set HAVE_F2C to 0
+SET(HAVE_F2C 1 CACHE BOOL "Do we have f2c or F77/I77?" )
+
+# the directory where the lapack/blas/f2c libraries reside
+SET(LAPACKBLAS_DIR /usr/lib CACHE PATH "Path to lapack/blas libraries")
+
+# actual names for the lapack/blas/f2c libraries
+SET(LAPACK_LIB lapack CACHE STRING "The name of the lapack library")
+SET(BLAS_LIB blas CACHE STRING "The name of the blas library")
+IF(HAVE_F2C)
+ SET(F2C_LIB f2c CACHE STRING "The name of the f2c library")
+ELSE(HAVE_F2C)
+ SET(F77_LIB libF77 CACHE STRING "The name of the F77 library")
+ SET(I77_LIB libI77 CACHE STRING "The name of the I77 library")
+ENDIF(HAVE_F2C)
+
+########################## NO CHANGES BEYOND THIS POINT ##########################
+
+#INCLUDE_DIRECTORIES(/usr/include)
+LINK_DIRECTORIES(${LAPACKBLAS_DIR})
+
+# levmar library source files
+ADD_LIBRARY(levmar STATIC
+ lm.c Axb.c misc.c lmlec.c lmbc.c lmblec.c
+ lm.h misc.h compiler.h
+)
+
+# demo program
+ADD_EXECUTABLE(lmdemo lmdemo.c lm.h)
+# libraries the demo depends on
+IF(HAVE_F2C)
+ TARGET_LINK_LIBRARIES(lmdemo levmar ${LAPACK_LIB} ${BLAS_LIB} ${F2C_LIB})
+ELSE(HAVE_F2C)
+ TARGET_LINK_LIBRARIES(lmdemo levmar ${LAPACK_LIB} ${BLAS_LIB} ${F77_LIB} ${I77_LIB})
+ENDIF(HAVE_F2C)
+
+# make sure that the library is built before the demo
+ADD_DEPENDENCIES(lmdemo levmar)
+
+#SUBDIRS(matlab)
+
+#ADD_TEST(levmar_tst lmdemo)
diff --git a/src/external/lib3ds-1.3.0/CMakeLists.txt b/src/external/lib3ds-1.3.0/CMakeLists.txt
new file mode 100644
index 000000000..63fd1cd5b
--- /dev/null
+++ b/src/external/lib3ds-1.3.0/CMakeLists.txt
@@ -0,0 +1,50 @@
+if(TARGET Lib3ds::Lib3ds)
+ message(STATUS "- lib3ds - using system-provided library")
+ add_library(external-lib3ds INTERFACE)
+ target_link_libraries(external-lib3ds INTERFACE Lib3ds::Lib3ds)
+else()
+ message(STATUS "- lib3ds - using bundled source")
+ add_library(
+ external-lib3ds STATIC
+ "${LIB3DS_DIR}/lib3ds/atmosphere.c"
+ "${LIB3DS_DIR}/lib3ds/atmosphere.h"
+ "${LIB3DS_DIR}/lib3ds/background.c"
+ "${LIB3DS_DIR}/lib3ds/background.h"
+ "${LIB3DS_DIR}/lib3ds/camera.c"
+ "${LIB3DS_DIR}/lib3ds/camera.h"
+ "${LIB3DS_DIR}/lib3ds/chunk.c"
+ "${LIB3DS_DIR}/lib3ds/chunk.h"
+ "${LIB3DS_DIR}/lib3ds/chunktable.h"
+ "${LIB3DS_DIR}/lib3ds/ease.c"
+ "${LIB3DS_DIR}/lib3ds/ease.h"
+ "${LIB3DS_DIR}/lib3ds/file.c"
+ "${LIB3DS_DIR}/lib3ds/file.h"
+ "${LIB3DS_DIR}/lib3ds/io.c"
+ "${LIB3DS_DIR}/lib3ds/io.h"
+ "${LIB3DS_DIR}/lib3ds/light.c"
+ "${LIB3DS_DIR}/lib3ds/light.h"
+ "${LIB3DS_DIR}/lib3ds/material.c"
+ "${LIB3DS_DIR}/lib3ds/material.h"
+ "${LIB3DS_DIR}/lib3ds/matrix.c"
+ "${LIB3DS_DIR}/lib3ds/matrix.h"
+ "${LIB3DS_DIR}/lib3ds/mesh.c"
+ "${LIB3DS_DIR}/lib3ds/mesh.h"
+ "${LIB3DS_DIR}/lib3ds/node.c"
+ "${LIB3DS_DIR}/lib3ds/node.h"
+ "${LIB3DS_DIR}/lib3ds/quat.c"
+ "${LIB3DS_DIR}/lib3ds/quat.h"
+ "${LIB3DS_DIR}/lib3ds/shadow.c"
+ "${LIB3DS_DIR}/lib3ds/shadow.h"
+ "${LIB3DS_DIR}/lib3ds/tcb.c"
+ "${LIB3DS_DIR}/lib3ds/tcb.h"
+ "${LIB3DS_DIR}/lib3ds/tracks.c"
+ "${LIB3DS_DIR}/lib3ds/tracks.h"
+ "${LIB3DS_DIR}/lib3ds/types.h"
+ "${LIB3DS_DIR}/lib3ds/vector.c"
+ "${LIB3DS_DIR}/lib3ds/vector.h"
+ "${LIB3DS_DIR}/lib3ds/viewport.c"
+ "${LIB3DS_DIR}/lib3ds/viewport.h")
+ target_include_directories(external-lib3ds SYSTEM PUBLIC "${LIB3DS_DIR}")
+ target_compile_definitions(external-lib3ds PUBLIC LIB3DS_STATIC)
+ set_property(TARGET external-lib3ds PROPERTY FOLDER External)
+endif()
diff --git a/src/external/muparser_v225/CMakeLists.txt b/src/external/muparser_v225/CMakeLists.txt
new file mode 100644
index 000000000..301af8e3d
--- /dev/null
+++ b/src/external/muparser_v225/CMakeLists.txt
@@ -0,0 +1,21 @@
+if(TARGET muparser::muparser)
+ message(STATUS "- muparser - using system-provided library")
+ add_library(external-muparser INTERFACE)
+ target_link_libraries(external-muparser INTERFACE muparser::muparser)
+else()
+ message(STATUS "- muparser - using bundled source")
+ add_library(
+ external-muparser STATIC
+ "${MUPARSER_DIR}/src/muParser.cpp"
+ "${MUPARSER_DIR}/src/muParserBase.cpp"
+ "${MUPARSER_DIR}/src/muParserBytecode.cpp"
+ "${MUPARSER_DIR}/src/muParserCallback.cpp"
+ "${MUPARSER_DIR}/src/muParserDLL.cpp"
+ "${MUPARSER_DIR}/src/muParserError.cpp"
+ "${MUPARSER_DIR}/src/muParserInt.cpp"
+ "${MUPARSER_DIR}/src/muParserTest.cpp"
+ "${MUPARSER_DIR}/src/muParserTokenReader.cpp")
+ target_include_directories(external-muparser SYSTEM PUBLIC ${MUPARSER_DIR}/include)
+ target_compile_definitions(external-muparser PUBLIC _UNICODE)
+ set_property(TARGET external-muparser PROPERTY FOLDER External)
+endif()
diff --git a/src/external/qhull-2003.1/CMakeLists.txt b/src/external/qhull-2003.1/CMakeLists.txt
new file mode 100644
index 000000000..46b0873f4
--- /dev/null
+++ b/src/external/qhull-2003.1/CMakeLists.txt
@@ -0,0 +1,35 @@
+if(TARGET Qhull::libqhull)
+ message(STATUS "- qhull - using system-provided library")
+ add_library(external-qhull INTERFACE)
+ target_link_libraries(external-qhull INTERFACE Qhull::libqhull)
+ target_compile_definitions(external-qhull INTERFACE SYSTEM_QHULL)
+ target_include_directories(external-qhull INTERFACE ${QHULL_libqhull_INCLUDE_DIR}/libqhull)
+else()
+ message(STATUS "- qhull - using bundled source")
+ add_library(
+ external-qhull STATIC
+ "${QHULL_DIR}/src/geom2.c"
+ "${QHULL_DIR}/src/global.c"
+ "${QHULL_DIR}/src/io.c"
+ "${QHULL_DIR}/src/io.h"
+ "${QHULL_DIR}/src/mem.c"
+ "${QHULL_DIR}/src/mem.h"
+ "${QHULL_DIR}/src/merge.c"
+ "${QHULL_DIR}/src/merge.h"
+ "${QHULL_DIR}/src/poly.c"
+ "${QHULL_DIR}/src/poly.h"
+ "${QHULL_DIR}/src/poly2.c"
+ "${QHULL_DIR}/src/qconvex.c"
+ "${QHULL_DIR}/src/qhull.c"
+ "${QHULL_DIR}/src/qhull.h"
+ "${QHULL_DIR}/src/qset.c"
+ "${QHULL_DIR}/src/qset.h"
+ "${QHULL_DIR}/src/stat.c"
+ "${QHULL_DIR}/src/stat.h"
+ "${QHULL_DIR}/src/geom.c"
+ "${QHULL_DIR}/src/geom.h"
+ "${QHULL_DIR}/src/user.c"
+ "${QHULL_DIR}/src/user.h")
+ target_include_directories(external-qhull INTERFACE "${QHULL_DIR}/src")
+ set_property(TARGET external-qhull PROPERTY FOLDER External)
+endif()
diff --git a/src/external/structuresynth-1.5/CMakeLists.txt b/src/external/structuresynth-1.5/CMakeLists.txt
new file mode 100644
index 000000000..21df23281
--- /dev/null
+++ b/src/external/structuresynth-1.5/CMakeLists.txt
@@ -0,0 +1,100 @@
+message(STATUS "- structure-synth - using bundled source")
+# Can't use a system version because using StructureSynth as a library is not common
+add_library(
+ external-ssynth STATIC
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Action.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/AmbiguousRule.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Builder.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/ColorPool.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/CustomRule.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/ExecutionStack.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/PrimitiveClass.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/PrimitiveRule.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/RandomStreams.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rule.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/RuleRef.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/RuleSet.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/State.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Transformation.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/TransformationLoop.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Parser/EisenParser.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Parser/Preprocessor.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Parser/Tokenizer.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Exceptions/Exception.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Box.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Dot.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/EngineWidget.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Grid.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Line.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Mesh.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Object3D.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/AtomicCounter.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/RenderThread.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/Sampler.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/VoxelStepper.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/RaytraceTriangle.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Sphere.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Triangle.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Logging/ListWidgetLogger.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Logging/Logging.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Matrix4.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Random.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Vector3.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/ColorUtils.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/MiniParser.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/Persistence.h"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/Version.h"
+ "${SSYNTH_DIR}/ssynth/ThirdPartyCode/MersenneTwister/MersenneTwister.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/OpenGLRenderer.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/Renderer.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/TemplateRenderer.h"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Action.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/AmbiguousRule.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Builder.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/ColorPool.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/CustomRule.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/ExecutionStack.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/PrimitiveClass.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/PrimitiveRule.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/RandomStreams.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rule.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/RuleRef.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/RuleSet.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/State.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Transformation.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/TransformationLoop.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Parser/EisenParser.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Parser/Preprocessor.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Parser/Tokenizer.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Box.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Dot.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Grid.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Line.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Mesh.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Object3D.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/AtomicCounter.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/RenderThread.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/Sampler.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/VoxelStepper.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/RaytraceTriangle.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Triangle.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Logging/ListWidgetLogger.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Logging/Logging.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Matrix4.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Random.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Vector3.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/ColorUtils.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/MiniParser.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/Persistence.cpp"
+ "${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/Version.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/Renderer.cpp"
+ "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/TemplateRenderer.cpp")
+
+# These sources were disabled in the .pro file: "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/EngineWidget.cpp"
+# "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp"
+# "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Sphere.cpp"
+# "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/OpenGLRenderer.cpp"
+target_include_directories(external-ssynth SYSTEM PUBLIC "${SSYNTH_DIR}/ssynth")
+target_link_libraries(external-ssynth PRIVATE Qt5::Core Qt5::Xml Qt5::OpenGL OpenGL::GLU)
+set_property(TARGET external-ssynth PROPERTY FOLDER External)
diff --git a/src/external/u3d/CMakeLists.txt b/src/external/u3d/CMakeLists.txt
new file mode 100644
index 000000000..5d2dd45f4
--- /dev/null
+++ b/src/external/u3d/CMakeLists.txt
@@ -0,0 +1,1505 @@
+message(STATUS "- u3d - using bundled source")
+
+IF(APPLE)
+# Tiger build
+# SET( CMAKE_OSX_ARCHITECTURES "ppc;i386" )
+# SET( CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk )
+# SET( CMAKE_OSX_DEPLOYMENT_TARGET 10.4 )
+#----
+# Leopard build
+# SET( CMAKE_OSX_ARCHITECTURES "ppc;i386" )
+# SET( CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk )
+# SET( CMAKE_OSX_DEPLOYMENT_TARGET 10.5 )
+#----
+# Snow Leopard build
+# SET( CMAKE_OSX_ARCHITECTURES "ppc;i386" )
+# SET( CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk )
+# SET( CMAKE_OSX_DEPLOYMENT_TARGET 10.6 )
+#----
+ ADD_DEFINITIONS( -DMAC32 -fno-strict-aliasing )
+ SET( U3D_PLATFORM Mac32 )
+ENDIF(APPLE)
+
+IF(WIN32)
+ ADD_DEFINITIONS( -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE )
+ SET( U3D_PLATFORM Win32 )
+ LINK_LIBRARIES( winmm )
+ UNSET( CMAKE_SHARED_LIBRARY_PREFIX )
+ UNSET( CMAKE_SHARED_MODULE_PREFIX )
+ UNSET( CMAKE_STATIC_LIBRARY_PREFIX )
+ UNSET( CMAKE_IMPORT_LIBRARY_PREFIX )
+ENDIF(WIN32)
+
+IF(UNIX AND NOT APPLE)
+ ADD_DEFINITIONS( -DLIN32 -fno-strict-aliasing )
+ SET( U3D_PLATFORM Lin32 )
+ENDIF(UNIX AND NOT APPLE)
+
+#============================================================================
+# zlib
+#============================================================================
+
+include(CheckTypeSize)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckCSourceCompiles)
+
+check_include_file(sys/types.h HAVE_SYS_TYPES_H)
+check_include_file(stdint.h HAVE_STDINT_H)
+check_include_file(stddef.h HAVE_STDDEF_H)
+
+#
+# Check to see if we have large file support
+#
+set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
+check_type_size(off64_t OFF64_T)
+if(HAVE_OFF64_T)
+ add_definitions(-D_LARGEFILE64_SOURCE=1)
+endif()
+set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
+
+#
+# Check for fseeko
+#
+check_function_exists(fseeko HAVE_FSEEKO)
+if(NOT HAVE_FSEEKO)
+ add_definitions(-DNO_FSEEKO)
+endif()
+
+#
+# Check for unistd.h
+#
+check_include_file(unistd.h Z_HAVE_UNISTD_H)
+
+if(MSVC)
+ add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
+ add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
+endif()
+
+SET(ZLIB_SOURCE_DIR ${U3D_DIR}/src/RTL/Dependencies/zlib)
+#configure_file(${ZLIB_SOURCE_DIR}/zconf.h.cmakein
+# ${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY)
+#include_directories(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${ZLIB_SOURCE_DIR})
+
+set(ZLIB_PUBLIC_HDRS
+ ${ZLIB_SOURCE_DIR}/zconf.h
+ ${ZLIB_SOURCE_DIR}/zlib.h
+)
+set(ZLIB_PRIVATE_HDRS
+ ${ZLIB_SOURCE_DIR}/zconf.h
+ ${ZLIB_SOURCE_DIR}/crc32.h
+ ${ZLIB_SOURCE_DIR}/deflate.h
+ ${ZLIB_SOURCE_DIR}/gzguts.h
+ ${ZLIB_SOURCE_DIR}/inffast.h
+ ${ZLIB_SOURCE_DIR}/inffixed.h
+ ${ZLIB_SOURCE_DIR}/inflate.h
+ ${ZLIB_SOURCE_DIR}/inftrees.h
+ ${ZLIB_SOURCE_DIR}/trees.h
+ ${ZLIB_SOURCE_DIR}/zutil.h
+)
+set(ZLIB_SRCS
+ ${ZLIB_SOURCE_DIR}/adler32.c
+ ${ZLIB_SOURCE_DIR}/compress.c
+ ${ZLIB_SOURCE_DIR}/crc32.c
+ ${ZLIB_SOURCE_DIR}/deflate.c
+ ${ZLIB_SOURCE_DIR}/gzclose.c
+ ${ZLIB_SOURCE_DIR}/gzlib.c
+ ${ZLIB_SOURCE_DIR}/gzread.c
+ ${ZLIB_SOURCE_DIR}/gzwrite.c
+ ${ZLIB_SOURCE_DIR}/inflate.c
+ ${ZLIB_SOURCE_DIR}/infback.c
+ ${ZLIB_SOURCE_DIR}/inftrees.c
+ ${ZLIB_SOURCE_DIR}/inffast.c
+ ${ZLIB_SOURCE_DIR}/trees.c
+ ${ZLIB_SOURCE_DIR}/uncompr.c
+ ${ZLIB_SOURCE_DIR}/zutil.c
+)
+
+
+#============================================================================
+# png
+#============================================================================
+
+if(NOT WIN32)
+ find_library(M_LIBRARY
+ NAMES m
+ PATHS /usr/lib /usr/local/lib)
+ if(NOT M_LIBRARY)
+ message(STATUS
+ "math library 'libm' not found - floating point support disabled")
+ endif()
+else()
+ # not needed on windows
+ set(M_LIBRARY "")
+endif()
+
+set(PNG_SOURCE_DIR ${U3D_DIR}/src/RTL/Dependencies/png)
+#include_directories(${CMAKE_CURRENT_BINARY_DIR})
+
+# OUR SOURCES
+set(libpng_public_hdrs
+ ${PNG_SOURCE_DIR}/png.h
+ ${PNG_SOURCE_DIR}/pngconf.h
+ ${PNG_SOURCE_DIR}/pnglibconf.h
+)
+set(libpng_sources
+ ${libpng_public_hdrs}
+ ${PNG_SOURCE_DIR}/pngdebug.h
+ ${PNG_SOURCE_DIR}/pnginfo.h
+ ${PNG_SOURCE_DIR}/pngpriv.h
+ ${PNG_SOURCE_DIR}/pngstruct.h
+ ${PNG_SOURCE_DIR}/png.c
+ ${PNG_SOURCE_DIR}/pngerror.c
+ ${PNG_SOURCE_DIR}/pngget.c
+ ${PNG_SOURCE_DIR}/pngmem.c
+ ${PNG_SOURCE_DIR}/pngpread.c
+ ${PNG_SOURCE_DIR}/pngread.c
+ ${PNG_SOURCE_DIR}/pngrio.c
+ ${PNG_SOURCE_DIR}/pngrtran.c
+ ${PNG_SOURCE_DIR}/pngrutil.c
+ ${PNG_SOURCE_DIR}/pngset.c
+ ${PNG_SOURCE_DIR}/pngtrans.c
+ ${PNG_SOURCE_DIR}/pngwio.c
+ ${PNG_SOURCE_DIR}/pngwrite.c
+ ${PNG_SOURCE_DIR}/pngwtran.c
+ ${PNG_SOURCE_DIR}/pngwutil.c
+)
+# SOME NEEDED DEFINITIONS
+
+if(MSVC)
+ add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
+endif(MSVC)
+
+set(ADDITIONAL_LIBRARIES ${ADDITIONAL_LIBRARIES} ${M_LIBRARY})
+include_directories(${PNG_SOURCE_DIR})
+
+CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
+
+set(JPEG_SOURCE_DIR ${U3D_DIR}/src/RTL/Dependencies/jpeg)
+#configure_file(${JPEG_SOURCE_DIR}/jconfig.h.cmake
+# ${CMAKE_CURRENT_BINARY_DIR}/jconfig.h)
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${JPEG_SOURCE_DIR})
+
+if(MSVC)
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+endif()
+
+set(JPEG_PUBLIC_HDRS
+ ${JPEG_SOURCE_DIR}/jconfig.h
+ ${JPEG_SOURCE_DIR}/jerror.h
+ ${JPEG_SOURCE_DIR}/jmorecfg.h
+ ${JPEG_SOURCE_DIR}/jpeglib.h
+ ${JPEG_SOURCE_DIR}/jconfig.h
+)
+set(JPEG_PRIVATE_HDRS
+ ${JPEG_SOURCE_DIR}/cderror.h
+ ${JPEG_SOURCE_DIR}/jdct.h
+ ${JPEG_SOURCE_DIR}/jinclude.h
+ ${JPEG_SOURCE_DIR}/jmemsys.h
+ ${JPEG_SOURCE_DIR}/jpegint.h
+ ${JPEG_SOURCE_DIR}/jversion.h
+ ${JPEG_SOURCE_DIR}/transupp.h
+)
+
+# memmgr back ends: compile only one of these into a working library
+# (For now, let's use the mode that requires the image fit into memory.
+# This is the recommended mode for Win32 anyway.)
+SET(JPEG_systemdependent_SRCS ${JPEG_SOURCE_DIR}/jmemnobs.c)
+
+set(JPEG_SRCS
+ ${JPEG_SOURCE_DIR}/jaricom.c
+ ${JPEG_SOURCE_DIR}/jcapimin.c
+ ${JPEG_SOURCE_DIR}/jcapistd.c
+ ${JPEG_SOURCE_DIR}/jcarith.c
+ ${JPEG_SOURCE_DIR}/jccoefct.c
+ ${JPEG_SOURCE_DIR}/jccolor.c
+ ${JPEG_SOURCE_DIR}/jcdctmgr.c
+ ${JPEG_SOURCE_DIR}/jchuff.c
+ ${JPEG_SOURCE_DIR}/jcinit.c
+ ${JPEG_SOURCE_DIR}/jcmainct.c
+ ${JPEG_SOURCE_DIR}/jcmarker.c
+ ${JPEG_SOURCE_DIR}/jcmaster.c
+ ${JPEG_SOURCE_DIR}/jcomapi.c
+ ${JPEG_SOURCE_DIR}/jcparam.c
+ ${JPEG_SOURCE_DIR}/jcprepct.c
+ ${JPEG_SOURCE_DIR}/jcsample.c
+ ${JPEG_SOURCE_DIR}/jctrans.c
+ ${JPEG_SOURCE_DIR}/jdapimin.c
+ ${JPEG_SOURCE_DIR}/jdapistd.c
+ ${JPEG_SOURCE_DIR}/jdarith.c
+ ${JPEG_SOURCE_DIR}/jdatadst.c
+ ${JPEG_SOURCE_DIR}/jdatasrc.c
+ ${JPEG_SOURCE_DIR}/jdcoefct.c
+ ${JPEG_SOURCE_DIR}/jdcolor.c
+ ${JPEG_SOURCE_DIR}/jddctmgr.c
+ ${JPEG_SOURCE_DIR}/jdhuff.c
+ ${JPEG_SOURCE_DIR}/jdinput.c
+ ${JPEG_SOURCE_DIR}/jdmainct.c
+ ${JPEG_SOURCE_DIR}/jdmarker.c
+ ${JPEG_SOURCE_DIR}/jdmaster.c
+ ${JPEG_SOURCE_DIR}/jdmerge.c
+ ${JPEG_SOURCE_DIR}/jdpostct.c
+ ${JPEG_SOURCE_DIR}/jdsample.c
+ ${JPEG_SOURCE_DIR}/jdtrans.c
+ ${JPEG_SOURCE_DIR}/jerror.c
+ ${JPEG_SOURCE_DIR}/jfdctflt.c
+ ${JPEG_SOURCE_DIR}/jfdctfst.c
+ ${JPEG_SOURCE_DIR}/jfdctint.c
+ ${JPEG_SOURCE_DIR}/jidctflt.c
+ ${JPEG_SOURCE_DIR}/jidctfst.c
+ ${JPEG_SOURCE_DIR}/jidctint.c
+ ${JPEG_SOURCE_DIR}/jquant1.c
+ ${JPEG_SOURCE_DIR}/jquant2.c
+ ${JPEG_SOURCE_DIR}/jutils.c
+ ${JPEG_SOURCE_DIR}/jmemmgr.c)
+
+SET(DEPENDENCIES_SRCS
+ ${ZLIB_SRCS}
+ ${ZLIB_PUBLIC_HDRS}
+ ${ZLIB_PRIVATE_HDRS}
+ ${libpng_sources}
+ ${JPEG_systemdependent_SRCS}
+ ${JPEG_SRCS}
+ ${JPEG_PUBLIC_HDRS}
+ ${JPEG_PRIVATE_HDRS})
+#====
+
+
+INCLUDE_DIRECTORIES(
+ ${U3D_DIR}/src/RTL/Component/Include
+ ${U3D_DIR}/src/RTL/Kernel/Include
+ ${U3D_DIR}/src/RTL/Platform/Include)
+SET( Component_HDRS
+ ${U3D_DIR}/src/RTL/Component/Include/CArrayList.h
+ ${U3D_DIR}/src/RTL/Component/Include/DX7asDX8.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXACContext.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAdaptiveMetric.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAnimationModifier.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXArray.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAttributes.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAuthor.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAuthorCLODAccess.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAuthorCLODGen.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAuthorCLODMesh.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAuthorCLODResource.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAuthorGeomCompiler.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAuthorLineSet.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAuthorLineSetAccess.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAuthorLineSetAnalyzer.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAuthorLineSetResource.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAuthorMesh.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAuthorMeshMap.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAuthorMeshScrub.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAuthorPointSet.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAuthorPointSetAccess.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAuthorPointSetResource.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAuthorUpdate.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXAutoPtr.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXBaseOpenGL.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXBitStreamCompressedX.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXBitStreamX.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXBlendParam.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXBlockReaderX.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXBlockTypes.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXBlockWriterX.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXBones.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXBonesManager.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXBoneWeightsModifier.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXBoundHierarchy.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXBoundHierarchyMgr.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXBoundingBox.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXBoundSphereDataElement.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXBoundVolume.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXBTTHash.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXClock.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXCLODManagerInterface.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXCLODModifier.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXCoincidentVertexMap.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXCollection.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXCoreCIDs.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXCoreServices.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXCoreServicesRef.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXCornerIter.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXDataBlock.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXDataBlockQueueX.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXDataBlockX.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXDataPacket.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXDecoderChainX.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXDecoderX.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXDeque.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXDevice.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXDidRegistry.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXDids.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXDirectX7.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXDirectX8.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXDummyModifier.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXEncoderX.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXEnums.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXErrorInfo.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXEuler.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXExportingCIDs.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXExportingInterfaces.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXExportOptions.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXExtensionDecoderX.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXExtensionEncoderX.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXFace.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXFastAllocator.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXFastHeap.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXFatCornerIter.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXFileReference.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXFrustum.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXGenerator.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXGlyph2DCommands.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXGlyph2DModifier.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXGlyphCommandList.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXHash.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXHashMap.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXHistogramDynamic.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXIDManager.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXImageCodec.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXImportingCIDs.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXImportingInterfaces.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXInet.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXInstant.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXInterleavedData.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXIterators.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXKeyFrame.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXKeyTrack.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXKeyTrackArray.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXLight.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXLightResource.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXLightSet.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXLine.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXList.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXListContext.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXListNode.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXLoadManager.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXMarker.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXMarkerX.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXMaterialResource.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXMesh.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXMeshCompiler.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXMeshGroup.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXMeshMap.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXMetaDataX.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXMixerConstruct.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXMixerQueue.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXModel.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXModifier.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXModifierBaseDecoder.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXModifierChain.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXModifierDataElementIter.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXModifierDataPacket.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXMotion.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXMotionManager.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXMotionMixer.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXMotionResource.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXNameMap.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXNeighborFace.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXNeighborMesh.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXNeighborResControllerIntfc.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXNode.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXNotificationInfo.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXNotificationManager.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXObserver.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXOpenGL.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXPalette.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXPickObject.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXProgressCallback.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRay.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXReadBuffer.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXReadBufferX.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRender.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRenderable.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRenderBlend.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRenderCaps.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRenderClear.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRenderContext.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRenderDevice.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRenderFog.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRenderHelpers.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRenderingCIDs.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRenderingInterfaces.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRenderLight.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRenderMaterial.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRenderPass.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRenderServices.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRenderStencil.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRenderTexUnit.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXRenderView.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXResourceClient.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSceneGraph.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXScheduler.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSchedulerInfo.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSchedulerTypes.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSchedulingCIDs.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSchedulingInterfaces.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXScreenSpaceMetricInterface.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSetAdjacencyX.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSetX.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXShader.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXShaderList.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXShaderLitTexture.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXShadingModifier.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSimpleHash.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSimpleList.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSimulationInfo.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSimulationManager.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSimulationTask.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSkeleton.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSkeletonDataElement.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSkeletonMixer.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSmartPtr.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSpatial.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSpatialAssociation.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSpatialSetQuery.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXStdio.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSubdivManagerInterface.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSubdivModifier.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSubject.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXSystemManager.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXTask.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXTaskCallback.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXTaskData.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXTaskManager.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXTaskManagerNode.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXTaskManagerView.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXTextureImageTools.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXTextureObject.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXTimeManager.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXTransform.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXTransformStack.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXUnitAllocator.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXUpdates.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXUpdatesGroup.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXUVGenerator.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXUVMapper.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXVertexAttributes.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXVertexIndexer.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXVertexMap.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXVertexMapGroup.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXView.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXViewResource.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXVoidStar.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXVoidWrapper.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXWriteBuffer.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXWriteBufferX.h
+ ${U3D_DIR}/src/RTL/Component/Include/IFXWriteManager.h
+ ${U3D_DIR}/src/RTL/Component/Include/InsertionSort.h
+)
+SET( Kernel_HDRS
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXAutoRelease.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXCheckX.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXCOM.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXConnection.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXConnectionServer.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXDataTypes.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXDebug.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXException.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXGUID.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXIPP.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXMatrix4x4.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXMemory.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXPerformanceTimer.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXPlugin.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXQuaternion.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXResult.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXResultComponentEngine.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXString.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXUnknown.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXVector2.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXVector3.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXVector4.h
+ ${U3D_DIR}/src/RTL/Kernel/Include/IFXVersion.h
+)
+SET( Platform_HDRS
+ ${U3D_DIR}/src/RTL/Platform/Include/IFXAPI.h
+ ${U3D_DIR}/src/RTL/Platform/Include/IFXOSFileIterator.h
+ ${U3D_DIR}/src/RTL/Platform/Include/IFXOSLoader.h
+ ${U3D_DIR}/src/RTL/Platform/Include/IFXOSRender.h
+ ${U3D_DIR}/src/RTL/Platform/Include/IFXOSSocket.h
+ ${U3D_DIR}/src/RTL/Platform/Include/IFXOSUtilities.h
+ ${U3D_DIR}/src/RTL/Platform/Include/IFXRenderWindow.h
+)
+
+# IFXCoreStatic
+INCLUDE_DIRECTORIES(
+ ${U3D_DIR}/src/RTL/Component/Include
+ ${U3D_DIR}/src/RTL/Kernel/Include
+ ${U3D_DIR}/src/RTL/Platform/Include
+ ${U3D_DIR}/src/RTL/Component/Base
+ ${U3D_DIR}/src/RTL/Component/Rendering
+ ${U3D_DIR}/src/RTL/Dependencies/WildCards )
+
+SET( IFXCoreStatic_HDRS
+ ${Component_HDRS}
+ ${Kernel_HDRS}
+ ${Platform_HDRS}
+ ${U3D_DIR}/src/RTL/Component/Base/IFXVectorHasher.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/CIFXDeviceBase.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/CIFXDeviceLight.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/CIFXDeviceTexture.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/CIFXDeviceTexUnit.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/CIFXRender.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/CIFXRenderContext.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/CIFXRenderDevice.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/CIFXRenderServices.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX7/CIFXDeviceLightDX7.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX7/CIFXDeviceTextureDX7.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX7/CIFXDeviceTexUnitDX7.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX7/CIFXDirectX7.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX7/CIFXRenderDeviceDX7.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX7/CIFXRenderDX7.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX7/IFXRenderPCHDX7.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX8/CIFXDeviceLightDX8.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX8/CIFXDeviceTextureDX8.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX8/CIFXDeviceTexUnitDX8.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX8/CIFXDirectX8.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX8/CIFXRenderDeviceDX8.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX8/CIFXRenderDX8.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX8/IFXRenderPCHDX8.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/IFXAAFilter.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/IFXRenderPCH.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/Null/CIFXDeviceLightNULL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/Null/CIFXDeviceTextureNULL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/Null/CIFXDeviceTexUnitNULL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/Null/CIFXRenderDeviceNULL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/Null/CIFXRenderNULL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/Null/IFXRenderPCHNULL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/OpenGL/CIFXDeviceLightOGL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/OpenGL/CIFXDeviceTextureOGL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/OpenGL/CIFXDeviceTexUnitOGL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/OpenGL/CIFXOpenGL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/OpenGL/CIFXRenderDeviceOGL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/OpenGL/CIFXRenderOGL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/OpenGL/IFXRenderPCHOGL.h
+ ${U3D_DIR}/src/RTL/Dependencies/WildCards/wcmatch.h
+)
+SET( IFXCoreStatic_SRCS
+ ${U3D_DIR}/src/RTL/IFXCoreStatic/IFXCoreStatic.cpp
+ ${U3D_DIR}/src/RTL/Platform/${U3D_PLATFORM}/Common/IFXOSUtilities.cpp
+ ${U3D_DIR}/src/RTL/Platform/${U3D_PLATFORM}/Common/IFXOSLoader.cpp
+ ${U3D_DIR}/src/RTL/Platform/${U3D_PLATFORM}/Common/IFXOSRenderWindow.cpp
+ ${U3D_DIR}/src/RTL/Component/Common/IFXDids.cpp
+ ${U3D_DIR}/src/RTL/Component/Base/IFXCoincidentVertexMap.cpp
+ ${U3D_DIR}/src/RTL/Component/Base/IFXCornerIter.cpp
+ ${U3D_DIR}/src/RTL/Component/Base/IFXEuler.cpp
+ ${U3D_DIR}/src/RTL/Component/Base/IFXFatCornerIter.cpp
+ ${U3D_DIR}/src/RTL/Component/Base/IFXTransform.cpp
+ ${U3D_DIR}/src/RTL/Component/Base/IFXVectorHasher.cpp
+ ${U3D_DIR}/src/RTL/Component/Base/IFXVertexMap.cpp
+ ${U3D_DIR}/src/RTL/Component/Base/IFXVertexMapGroup.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXCoreArray.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXCoreList.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXFastAllocator.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXListNode.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXMatrix4x4.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXQuaternion.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXString.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXUnitAllocator.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXVector3.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXVector4.cpp
+ ${U3D_DIR}/src/RTL/Dependencies/WildCards/wcmatch.cpp
+ ${U3D_DIR}/src/RTL/Kernel/Common/IFXDebug.cpp
+)
+ADD_LIBRARY( IFXCoreStatic STATIC ${IFXCoreStatic_SRCS} ${IFXCoreStatic_HDRS} )
+IF(UNIX)
+ target_link_libraries( IFXCoreStatic ${CMAKE_DL_LIBS} )
+ENDIF(UNIX)
+
+# Something Windows-only
+# INCLUDE_DIRECTORIES( RTL/Component/Include RTL/Kernel/Include RTL/Platform/Include )
+#
+# SET( IFXImportingStatic_SRCS
+# RTL/Component/Base/IFXCoincidentVertexMap.cpp
+# RTL/Component/Base/IFXCornerIter.cpp
+# RTL/Component/Base/IFXVectorHasher.cpp
+# RTL/Component/Base/IFXBoundingBox.cpp
+# RTL/Component/Base/IFXVertexMap.cpp )
+
+# ADD_LIBRARY( IFXImportingStatic ${IFXImportingStatic_SRCS} )
+
+# IFXCore
+INCLUDE_DIRECTORIES(
+ ${U3D_DIR}/src/RTL/Component/Include
+ ${U3D_DIR}/src/RTL/Kernel/Include
+ ${U3D_DIR}/src/RTL/Platform/Include
+ ${U3D_DIR}/src/RTL/Component/Base
+ ${U3D_DIR}/src/RTL/Component/BitStream
+ ${U3D_DIR}/src/RTL/Component/Bones
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor
+ ${U3D_DIR}/src/RTL/Component/Common
+ ${U3D_DIR}/src/RTL/Component/Generators/CLOD
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D
+ ${U3D_DIR}/src/RTL/Component/Generators/LineSet
+ ${U3D_DIR}/src/RTL/Component/Generators/PointSet
+ ${U3D_DIR}/src/RTL/Component/Mesh
+ ${U3D_DIR}/src/RTL/Component/ModifierChain
+ ${U3D_DIR}/src/RTL/Component/Palette
+ ${U3D_DIR}/src/RTL/Component/Rendering
+ ${U3D_DIR}/src/RTL/Component/SceneGraph
+ ${U3D_DIR}/src/RTL/Component/Shaders
+ ${U3D_DIR}/src/RTL/Component/Subdiv
+ ${U3D_DIR}/src/RTL/Component/Texture
+ ${U3D_DIR}/src/RTL/Component/UVGenerator
+ ${U3D_DIR}/src/RTL/Kernel/IFXCom
+ ${U3D_DIR}/src/RTL/Kernel/Common
+ ${U3D_DIR}/src/RTL/Dependencies/FNVHash
+ ${U3D_DIR}/src/RTL/Dependencies/Predicates
+ ${U3D_DIR}/src/RTL/Dependencies/WildCards
+)
+
+SET( IFXCore_SRCS
+ ${U3D_DIR}/src/RTL/Platform/${U3D_PLATFORM}/IFXCore/IFXCoreDllMain.cpp
+ ${U3D_DIR}/src/RTL/IFXCorePluginStatic/IFXCorePluginStatic.cpp
+ ${U3D_DIR}/src/RTL/Platform/${U3D_PLATFORM}/Common/IFXOSLoader.cpp
+ ${U3D_DIR}/src/RTL/Platform/${U3D_PLATFORM}/Common/IFXOSRenderWindow.cpp
+ ${U3D_DIR}/src/RTL/Platform/${U3D_PLATFORM}/Common/IFXOSUtilities.cpp
+ ${U3D_DIR}/src/RTL/Component/Base/IFXCoincidentVertexMap.cpp
+ ${U3D_DIR}/src/RTL/Component/Base/IFXCornerIter.cpp
+ ${U3D_DIR}/src/RTL/Component/Base/IFXEuler.cpp
+ ${U3D_DIR}/src/RTL/Component/Base/IFXFatCornerIter.cpp
+ ${U3D_DIR}/src/RTL/Component/Base/IFXTransform.cpp
+ ${U3D_DIR}/src/RTL/Component/Base/IFXVectorHasher.cpp
+ ${U3D_DIR}/src/RTL/Component/Base/IFXVertexMap.cpp
+ ${U3D_DIR}/src/RTL/Component/Base/IFXVertexMapGroup.cpp
+ ${U3D_DIR}/src/RTL/Component/BitStream/CIFXBitStreamX.cpp
+ ${U3D_DIR}/src/RTL/Component/BitStream/CIFXDataBlockQueueX.cpp
+ ${U3D_DIR}/src/RTL/Component/BitStream/CIFXDataBlockX.cpp
+ ${U3D_DIR}/src/RTL/Component/BitStream/IFXHistogramDynamic.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/CIFXAnimationModifier.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/CIFXBoneWeightsModifier.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/CIFXSkeleton.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXBoneCacheArray.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXBoneNode.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXBonesManagerImpl.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXCharacter.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXCoreNode.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXKeyTrack.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXMeshGroup_Character.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXMixerQueue.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXMixerQueueImpl.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXMotion.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXMotionManagerImpl.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXMotionMixerImpl.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXSkin.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXSkin_p3.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXVertexWeight.cpp
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXVertexWeights.cpp
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXAABBHierarchyBuilder.cpp
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXAxisAlignedBBox.cpp
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXBoundFace.cpp
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXBoundHierarchy.cpp
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXBoundUtil.cpp
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXBTree.cpp
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXBTreeNode.cpp
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXCollisionResult.cpp
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXPickObject.cpp
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXPrimitiveOverlap.cpp
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXResultAllocator.cpp
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/CIFXAuthorCLODGen.cpp
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/CIFXAuthorMeshMap.cpp
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/CIFXSetAdjacencyX.cpp
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/CIFXSetX.cpp
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/CLODGenerator.cpp
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/ContractionRecorder.cpp
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/Face.cpp
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/Matrix4x4.cpp
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/NormalMap.cpp
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/Pair.cpp
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/PairFinder.cpp
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/PairHash.cpp
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/PairHeap.cpp
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/Primitives.cpp
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/Vertex.cpp
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/VertexPairContractor.cpp
+ ${U3D_DIR}/src/RTL/Component/Common/CIFXCoreServices.cpp
+ ${U3D_DIR}/src/RTL/Component/Common/CIFXCoreServicesRef.cpp
+ ${U3D_DIR}/src/RTL/Component/Common/CIFXHashMap.cpp
+ ${U3D_DIR}/src/RTL/Component/Common/CIFXIDManager.cpp
+ ${U3D_DIR}/src/RTL/Component/Common/CIFXMetaData.cpp
+ ${U3D_DIR}/src/RTL/Component/Common/CIFXNameMap.cpp
+ ${U3D_DIR}/src/RTL/Component/Common/CIFXSimpleHash.cpp
+ ${U3D_DIR}/src/RTL/Component/Common/CIFXVoidWrapper.cpp
+ ${U3D_DIR}/src/RTL/Component/Common/IFXComponentDescriptorList.cpp
+ ${U3D_DIR}/src/RTL/Component/Common/IFXComponentIds.cpp
+ ${U3D_DIR}/src/RTL/Component/Common/IFXDids.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/CLOD/CIFXAuthorCLODResource.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/CLOD/CIFXAuthorMesh.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/CLOD/CIFXAuthorMeshScrub.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/CLOD/CIFXCLODModifier.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/CLOD/CIFXMeshCompiler.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/CLOD/CIFXMeshMap.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/CLOD/IFXCLODManager.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/CLOD/IFXNeighborResController.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXContour.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXContourExtruder.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXContourGenerator.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXContourTessellator.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXGlyph2DCommands.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXGlyph2DModifier.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXGlyph3DGenerator.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXGlyphCommandList.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXQuadEdge.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/LineSet/CIFXAuthorLineSetAnalyzer.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/LineSet/CIFXAuthorLineSet.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/LineSet/CIFXAuthorLineSetResource.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/PointSet/CIFXAuthorPointSet.cpp
+ ${U3D_DIR}/src/RTL/Component/Generators/PointSet/CIFXAuthorPointSetResource.cpp
+ ${U3D_DIR}/src/RTL/Component/Mesh/CIFXInterleavedData.cpp
+ ${U3D_DIR}/src/RTL/Component/Mesh/CIFXMesh.cpp
+ ${U3D_DIR}/src/RTL/Component/Mesh/CIFXMeshGroup.cpp
+ ${U3D_DIR}/src/RTL/Component/Mesh/CIFXNeighborMesh.cpp
+ ${U3D_DIR}/src/RTL/Component/Mesh/CIFXRenderable.cpp
+ ${U3D_DIR}/src/RTL/Component/Mesh/IFXFaceLists.cpp
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXDidRegistry.cpp
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXModifierChain.cpp
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXModifier.cpp
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXModifierDataElementIter.cpp
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXModifierDataPacket.cpp
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXSubject.cpp
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/IFXModifierChainState.cpp
+ ${U3D_DIR}/src/RTL/Component/Palette/CIFXPalette.cpp
+ ${U3D_DIR}/src/RTL/Component/Palette/CIFXSimpleObject.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXBoundSphereDataElement.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXDevice.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXDummyModifier.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXFileReference.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXGroup.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXLight.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXLightResource.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXLightSet.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXMarker.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXMaterialResource.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXMixerConstruct.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXModel.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXMotionResource.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXNode.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXResourceClient.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXSceneGraph.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXShaderList.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXSimpleCollection.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXSimpleList.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXView.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXViewResource.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/IFXRenderPass.cpp
+ ${U3D_DIR}/src/RTL/Component/Shaders/CIFXShader.cpp
+ ${U3D_DIR}/src/RTL/Component/Shaders/CIFXShaderLitTexture.cpp
+ ${U3D_DIR}/src/RTL/Component/Shaders/CIFXShadingModifier.cpp
+ ${U3D_DIR}/src/RTL/Component/Subdiv/CIFXSubdivModifier.cpp
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXAttributeNeighborhood.cpp
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXButterflyScheme.cpp
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXScreenSpaceMetric.cpp
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXSharedUnitAllocator.cpp
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXSubdivisionManager.cpp
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXTQTAddress.cpp
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXTQTAttribute.cpp
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXTQTBaseTriangle.cpp
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXTQTTriangleAllocator.cpp
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXTQTTriangle.cpp
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXVertexAllocator.cpp
+ ${U3D_DIR}/src/RTL/Component/Texture/CIFXImageTools.cpp
+ ${U3D_DIR}/src/RTL/Component/Texture/CIFXTextureImageTools.cpp
+ ${U3D_DIR}/src/RTL/Component/Texture/CIFXTextureObject.cpp
+ ${U3D_DIR}/src/RTL/Component/UVGenerator/CIFXUVGenerator.cpp
+ ${U3D_DIR}/src/RTL/Component/UVGenerator/CIFXUVMapperCylindrical.cpp
+ ${U3D_DIR}/src/RTL/Component/UVGenerator/CIFXUVMapperNone.cpp
+ ${U3D_DIR}/src/RTL/Component/UVGenerator/CIFXUVMapperPlanar.cpp
+ ${U3D_DIR}/src/RTL/Component/UVGenerator/CIFXUVMapperReflection.cpp
+ ${U3D_DIR}/src/RTL/Component/UVGenerator/CIFXUVMapperSpherical.cpp
+ ${U3D_DIR}/src/RTL/Kernel/Common/CIFXConnector.cpp
+ ${U3D_DIR}/src/RTL/Kernel/Common/CIFXPerformanceTimer.cpp
+ ${U3D_DIR}/src/RTL/Kernel/Common/IFXCheckX.cpp
+ ${U3D_DIR}/src/RTL/Kernel/IFXCom/CIFXComponentManager.cpp
+ ${U3D_DIR}/src/RTL/Kernel/IFXCom/CIFXGUIDHashMap.cpp
+ ${U3D_DIR}/src/RTL/Kernel/IFXCom/CIFXPluginProxy.cpp
+ ${U3D_DIR}/src/RTL/Kernel/IFXCom/IFXCom.cpp
+ ${U3D_DIR}/src/RTL/Kernel/Memory/IFXMemory.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXCoreArray.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXCoreList.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXFastAllocator.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXListNode.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXMatrix4x4.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXQuaternion.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXString.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXUnitAllocator.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXVector3.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXVector4.cpp
+ ${U3D_DIR}/src/RTL/Dependencies/WildCards/wcmatch.cpp
+ ${U3D_DIR}/src/RTL/Dependencies/Predicates/predicates.cpp
+ ${U3D_DIR}/src/RTL/Kernel/Common/IFXDebug.cpp
+)
+SET( IFXCore_HDRS
+ ${Component_HDRS}
+ ${Kernel_HDRS}
+ ${Platform_HDRS}
+ ${U3D_DIR}/src/RTL/Component/Base/IFXVectorHasher.h
+ ${U3D_DIR}/src/RTL/Component/BitStream/CIFXBitStreamX.h
+ ${U3D_DIR}/src/RTL/Component/BitStream/CIFXDataBlockQueueX.h
+ ${U3D_DIR}/src/RTL/Component/BitStream/CIFXDataBlockX.h
+ ${U3D_DIR}/src/RTL/Component/Bones/CIFXAnimationModifier.h
+ ${U3D_DIR}/src/RTL/Component/Bones/CIFXBoneWeightsModifier.h
+ ${U3D_DIR}/src/RTL/Component/Bones/CIFXSkeleton.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXBoneCache.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXBoneCacheArray.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXBoneContext.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXBoneLinks.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXBoneNode.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXBoneNodeList.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXBonesManagerImpl.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXCharacter.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXConstraints.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXCoreNode.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXCylinder.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXIKModes.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXKeyFrameContext.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXLong3.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXMatrix3x4.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXMeshGroup_Character.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXMeshGroup_Impl.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXMeshInterface.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXMeshVertexMap.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXMixerQueueImpl.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXMotionManagerImpl.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXMotionMixerImpl.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXMotionReader.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXPackWeights.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXSkin.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXVertexWeight.h
+ ${U3D_DIR}/src/RTL/Component/Bones/IFXVertexWeights.h
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXAABBHierarchyBuilder.h
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXAxisAlignedBBox.h
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXBoundFace.h
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXBoundHierarchy.h
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXBoundUtil.h
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXBTree.h
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXBTreeNode.h
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXCollisionResult.h
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXPickObject.h
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXPrimitiveOverlap.h
+ ${U3D_DIR}/src/RTL/Component/BoundHierarchy/CIFXResultAllocator.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/CIFXAuthorCLODGen.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/CIFXAuthorMeshMap.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/CIFXSetAdjacencyX.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/CIFXSetX.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/CLODGenerator.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/ContractionRecorder.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/CostMap.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/Face.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/FaceExam.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/FacePtrSet.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/FaceUpdate.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/GeometryObject.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/IFXSList.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/Matrix4x4.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/NormalMap.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/Pair.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/PairFinder.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/PairHash.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/PairHeap.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/Primitives.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/QEConstants.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/SmallPtrSet.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/Vertex.h
+ ${U3D_DIR}/src/RTL/Component/CLODAuthor/VertexPairContractor.h
+ ${U3D_DIR}/src/RTL/Component/Common/CIFXCoreServices.h
+ ${U3D_DIR}/src/RTL/Component/Common/CIFXCoreServicesRef.h
+ ${U3D_DIR}/src/RTL/Component/Common/CIFXHashMap.h
+ ${U3D_DIR}/src/RTL/Component/Common/CIFXIDManager.h
+ ${U3D_DIR}/src/RTL/Component/Common/CIFXMetaData.h
+ ${U3D_DIR}/src/RTL/Component/Common/CIFXNameMap.h
+ ${U3D_DIR}/src/RTL/Component/Common/CIFXSimpleHash.h
+ ${U3D_DIR}/src/RTL/Component/Common/CIFXVoidWrapper.h
+ ${U3D_DIR}/src/RTL/Component/Common/IFXComponentFactories.h
+ ${U3D_DIR}/src/RTL/Component/Generators/CLOD/CIFXAuthorCLODResource.h
+ ${U3D_DIR}/src/RTL/Component/Generators/CLOD/CIFXAuthorMesh.h
+ ${U3D_DIR}/src/RTL/Component/Generators/CLOD/CIFXAuthorMeshScrub.h
+ ${U3D_DIR}/src/RTL/Component/Generators/CLOD/CIFXCLODModifier.h
+ ${U3D_DIR}/src/RTL/Component/Generators/CLOD/CIFXMeshCompiler.h
+ ${U3D_DIR}/src/RTL/Component/Generators/CLOD/CIFXMeshMap.h
+ ${U3D_DIR}/src/RTL/Component/Generators/CLOD/IFXCLODManager.h
+ ${U3D_DIR}/src/RTL/Component/Generators/CLOD/IFXNeighborResController.h
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXContour.h
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXContourExtruder.h
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXContourGenerator.h
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXContourTessellator.h
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXGeom2D.h
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXGlyph2DCommands.h
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXGlyph2DModifier.h
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXGlyph3DGenerator.h
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXGlyphCommandList.h
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/CIFXQuadEdge.h
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/IFXContour.h
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/IFXContourExtruder.h
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/IFXContourGenerator.h
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/IFXContourTessellator.h
+ ${U3D_DIR}/src/RTL/Component/Generators/Glyph2D/IFXGlyph3DGenerator.h
+ ${U3D_DIR}/src/RTL/Component/Generators/LineSet/CIFXAuthorLineSet.h
+ ${U3D_DIR}/src/RTL/Component/Generators/LineSet/CIFXAuthorLineSetAnalyzer.h
+ ${U3D_DIR}/src/RTL/Component/Generators/LineSet/CIFXAuthorLineSetResource.h
+ ${U3D_DIR}/src/RTL/Component/Generators/PointSet/CIFXAuthorPointSet.h
+ ${U3D_DIR}/src/RTL/Component/Generators/PointSet/CIFXAuthorPointSetResource.h
+ ${U3D_DIR}/src/RTL/Component/Mesh/CIFXInterleavedData.h
+ ${U3D_DIR}/src/RTL/Component/Mesh/CIFXMesh.h
+ ${U3D_DIR}/src/RTL/Component/Mesh/CIFXMeshGroup.h
+ ${U3D_DIR}/src/RTL/Component/Mesh/CIFXNeighborMesh.h
+ ${U3D_DIR}/src/RTL/Component/Mesh/CIFXRenderable.h
+ ${U3D_DIR}/src/RTL/Component/Mesh/IFXFaceLists.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXDidRegistry.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXModifier.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXModifierChain.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXModifierDataElementIter.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXModifierDataPacket.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXObserverStateTree.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXSubject.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CRedBlackTree.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/IFXModifierChainInternal.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/IFXModifierChainState.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/IFXModifierDataPacketInternal.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/IFXSet.h
+ ${U3D_DIR}/src/RTL/Component/Palette/CIFXPalette.h
+ ${U3D_DIR}/src/RTL/Component/Palette/CIFXSimpleObject.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/CIFXDeviceBase.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/CIFXDeviceLight.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/CIFXDeviceTexture.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/CIFXDeviceTexUnit.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/CIFXRender.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/CIFXRenderContext.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/CIFXRenderDevice.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/CIFXRenderServices.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX7/CIFXDeviceLightDX7.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX7/CIFXDeviceTextureDX7.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX7/CIFXDeviceTexUnitDX7.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX7/CIFXDirectX7.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX7/CIFXRenderDeviceDX7.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX7/CIFXRenderDX7.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX7/IFXRenderPCHDX7.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX8/CIFXDeviceLightDX8.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX8/CIFXDeviceTextureDX8.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX8/CIFXDeviceTexUnitDX8.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX8/CIFXDirectX8.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX8/CIFXRenderDeviceDX8.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX8/CIFXRenderDX8.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/DX8/IFXRenderPCHDX8.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/IFXAAFilter.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/IFXRenderPCH.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/Null/CIFXDeviceLightNULL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/Null/CIFXDeviceTextureNULL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/Null/CIFXDeviceTexUnitNULL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/Null/CIFXRenderDeviceNULL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/Null/CIFXRenderNULL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/Null/IFXRenderPCHNULL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/OpenGL/CIFXDeviceLightOGL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/OpenGL/CIFXDeviceTextureOGL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/OpenGL/CIFXDeviceTexUnitOGL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/OpenGL/CIFXOpenGL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/OpenGL/CIFXRenderDeviceOGL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/OpenGL/CIFXRenderOGL.h
+ ${U3D_DIR}/src/RTL/Component/Rendering/OpenGL/IFXRenderPCHOGL.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXBoundSphereDataElement.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXDevice.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXDummyModifier.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXFileReference.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXGroup.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXLight.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXLightResource.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXLightSet.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXMarker.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXMaterialResource.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXMixerConstruct.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXModel.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXMotionResource.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXNode.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXResourceClient.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXSceneGraph.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXShaderList.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXSimpleCollection.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXSimpleList.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXView.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXViewResource.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/IFXSceneGraphPCH.h
+ ${U3D_DIR}/src/RTL/Component/Shaders/CIFXShader.h
+ ${U3D_DIR}/src/RTL/Component/Shaders/CIFXShaderLitTexture.h
+ ${U3D_DIR}/src/RTL/Component/Shaders/CIFXShadingModifier.h
+ ${U3D_DIR}/src/RTL/Component/Subdiv/CIFXSubdivModifier.h
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXAttributeNeighborhood.h
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXBFMaskLayout.h
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXButterflyMask.h
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXButterflyScheme.h
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXScreenSpaceMetric.h
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXSharedUnitAllocator.h
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXSpecularMetric.h
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXSubdivisionManager.h
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXTQTAddress.h
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXTQTAttribute.h
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXTQTBaseTriangle.h
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXTQTTriangle.h
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXTQTTriangleAllocator.h
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXTQTVertex.h
+ ${U3D_DIR}/src/RTL/Component/Subdiv/IFXVertexAllocator.h
+ ${U3D_DIR}/src/RTL/Component/Texture/CIFXImageTools.h
+ ${U3D_DIR}/src/RTL/Component/Texture/CIFXTextureImageTools.h
+ ${U3D_DIR}/src/RTL/Component/Texture/CIFXTextureObject.h
+ ${U3D_DIR}/src/RTL/Component/Texture/CIFXUtilities.h
+ ${U3D_DIR}/src/RTL/Component/Texture/IFXTextureErrors.h
+ ${U3D_DIR}/src/RTL/Component/UVGenerator/CIFXUVGenerator.h
+ ${U3D_DIR}/src/RTL/Component/UVGenerator/CIFXUVMapperCylindrical.h
+ ${U3D_DIR}/src/RTL/Component/UVGenerator/CIFXUVMapperNone.h
+ ${U3D_DIR}/src/RTL/Component/UVGenerator/CIFXUVMapperPlanar.h
+ ${U3D_DIR}/src/RTL/Component/UVGenerator/CIFXUVMapperReflection.h
+ ${U3D_DIR}/src/RTL/Component/UVGenerator/CIFXUVMapperSpherical.h
+ ${U3D_DIR}/src/RTL/Kernel/IFXCom/CIFXComponentManager.h
+ ${U3D_DIR}/src/RTL/Kernel/IFXCom/CIFXGuidHashMap.h
+ ${U3D_DIR}/src/RTL/Kernel/IFXCom/CIFXPluginProxy.h
+ ${U3D_DIR}/src/RTL/Kernel/Common/CIFXConnector.h
+ ${U3D_DIR}/src/RTL/Kernel/Common/CIFXPerformanceTimer.h
+ ${U3D_DIR}/src/RTL/Dependencies/FNVHash/FNVPlusPlus.h
+ ${U3D_DIR}/src/RTL/Dependencies/Predicates/predicates.h
+ ${U3D_DIR}/src/RTL/Dependencies/WildCards/wcmatch.h
+)
+IF(WIN32)
+ SET( CORE_DIR ${U3D_DIR}/src/RTL/Platform/Win32/IFXCore )
+ ADD_LIBRARY( IFXCore SHARED ${IFXCore_SRCS} ${IFXCore_HDRS} ${CORE_DIR}/IFXCore.rc ${CORE_DIR}/IFXResource.h ${CORE_DIR}/IFXCore.def ${DEPENDENCIES_SRCS} )
+ENDIF(WIN32)
+IF(APPLE)
+ ADD_LIBRARY( IFXCore SHARED ${IFXCore_SRCS} ${IFXCore_HDRS} ${DEPENDENCIES_SRCS} )
+ set_target_properties( IFXCore PROPERTIES
+ LINK_FLAGS "${MY_LINK_FLAGS} -exported_symbols_list ${U3D_DIR}/src/RTL/Platform/Mac32/IFXCore/IFXCore.def"
+ SUFFIX .so)
+ENDIF(APPLE)
+IF(UNIX AND NOT APPLE)
+ ADD_LIBRARY( IFXCore SHARED ${IFXCore_SRCS} ${IFXCore_HDRS} ${DEPENDENCIES_SRCS} )
+ set_target_properties( IFXCore PROPERTIES
+ LINK_FLAGS "-Wl,--version-script=${U3D_DIR}/src/RTL/Platform/Lin32/IFXCore/IFXCore.list -Wl,--no-undefined" )
+ target_link_libraries( IFXCore ${CMAKE_DL_LIBS} )
+ENDIF(UNIX AND NOT APPLE)
+TARGET_LINK_LIBRARIES( IFXCore ${ADDITIONAL_LIBRARIES} )
+
+
+#IFXExporting
+INCLUDE_DIRECTORIES(
+ ${U3D_DIR}/src/RTL/Component/Include
+ ${U3D_DIR}/src/RTL/Kernel/Include
+ ${U3D_DIR}/src/RTL/Platform/Include
+ ${U3D_DIR}/src/RTL/Component/Exporting
+ ${U3D_DIR}/src/RTL/Dependencies/WildCards )
+SET( IFXExporting_HDRS
+ ${Component_HDRS}
+ ${Kernel_HDRS}
+ ${Platform_HDRS}
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXAnimationModifierEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXAuthorCLODEncoderX.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXAuthorGeomCompiler.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXBlockPriorityQueueX.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXBlockWriterX.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXBoneWeightsModifierEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXCLODModifierEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXDummyModifierEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXFileReferenceEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXGlyphModifierEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXGroupNodeEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXLightNodeEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXLightResourceEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXLineSetEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXMaterialResourceEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXModelNodeEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXMotionResourceEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXNodeBaseEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXPointSetEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXShaderLitTextureEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXShadingModifierEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXStdioWriteBufferX.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXSubdivisionModifierEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXViewNodeEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXViewResourceEncoder.h
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXWriteManager.h
+ ${U3D_DIR}/src/RTL/Dependencies/WildCards/wcmatch.h
+)
+SET( IFXExporting_SRCS
+ ${U3D_DIR}/src/RTL/Platform/${U3D_PLATFORM}/IFXExporting/IFXExportingDllMain.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXAnimationModifierEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXAuthorCLODEncoderX.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXAuthorCLODEncoderX_P.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXAuthorCLODEncoderX_S.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXAuthorGeomCompiler.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXBlockPriorityQueueX.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXBlockWriterX.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXBoneWeightsModifierEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXCLODModifierEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXDummyModifierEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXFileReferenceEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXGlyphModifierEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXGroupNodeEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXLightNodeEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXLightResourceEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXLineSetEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXMaterialResourceEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXModelNodeEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXMotionResourceEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXNodeBaseEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXPointSetEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXShaderLitTextureEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXShadingModifierEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXStdioWriteBufferX.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXSubdivisionModifierEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXViewNodeEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXViewResourceEncoder.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXWriteManager.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/IFXExporting.cpp
+ ${U3D_DIR}/src/RTL/Component/Exporting/IFXExportingGuids.cpp
+ ${U3D_DIR}/src/RTL/IFXCorePluginStatic/IFXCorePluginStatic.cpp
+ ${U3D_DIR}/src/RTL/Platform/${U3D_PLATFORM}/Common/IFXOSUtilities.cpp
+ ${U3D_DIR}/src/RTL/Platform/${U3D_PLATFORM}/Common/IFXOSLoader.cpp
+ ${U3D_DIR}/src/RTL/Component/Base/IFXVertexMap.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXCoreArray.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXCoreList.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXFastAllocator.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXListNode.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXMatrix4x4.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXQuaternion.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXString.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXUnitAllocator.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXVector3.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXVector4.cpp
+ ${U3D_DIR}/src/RTL/Dependencies/WildCards/wcmatch.cpp
+ ${U3D_DIR}/src/RTL/Kernel/Common/IFXDebug.cpp
+)
+IF(WIN32)
+ SET( EXPORT_DIR ${U3D_DIR}/src/RTL/Platform/Win32/IFXExporting )
+ ADD_LIBRARY( IFXExporting SHARED ${IFXExporting_SRCS} ${IFXExporting_HDRS} ${EXPORT_DIR}/IFXExporting.rc ${EXPORT_DIR}/IFXResource.h ${EXPORT_DIR}/IFXExporting.def )
+ TARGET_LINK_LIBRARIES( IFXExporting IFXCore )
+ENDIF(WIN32)
+IF(APPLE)
+ ADD_LIBRARY( IFXExporting SHARED ${IFXExporting_SRCS} ${IFXExporting_HDRS} )
+ set_target_properties( IFXExporting IFXCore PROPERTIES
+ LINK_FLAGS "${MY_LINK_FLAGS} -exported_symbols_list ${U3D_DIR}/src/RTL/Platform/Mac32/IFXExporting/IFXExporting.def -undefined dynamic_lookup"
+ SUFFIX .so)
+ENDIF(APPLE)
+IF(UNIX AND NOT APPLE)
+ ADD_LIBRARY( IFXExporting SHARED ${IFXExporting_SRCS} ${IFXExporting_HDRS} )
+ set_target_properties( IFXExporting PROPERTIES
+ LINK_FLAGS "-Wl,--version-script=${U3D_DIR}/src/RTL/Platform/Lin32/IFXExporting/IFXExporting.list" )
+ TARGET_LINK_LIBRARIES( IFXExporting IFXCore IFXCoreStatic ${CMAKE_DL_LIBS} )
+ENDIF(UNIX AND NOT APPLE)
+
+#IFXScheduling
+INCLUDE_DIRECTORIES(
+ ${U3D_DIR}/src/RTL/Component/Include
+ ${U3D_DIR}/src/RTL/Kernel/Include
+ ${U3D_DIR}/src/RTL/Platform/Include
+ ${U3D_DIR}/src/RTL/Component/ModifierChain
+ ${U3D_DIR}/src/RTL/Component/SceneGraph
+ ${U3D_DIR}/src/RTL/Component/Scheduling
+ ${U3D_DIR}/src/RTL/Dependencies/WildCards )
+SET( IFXScheduling_HDRS
+ ${Component_HDRS}
+ ${Kernel_HDRS}
+ ${Platform_HDRS}
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXDidRegistry.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXModifier.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXModifierChain.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXModifierDataElementIter.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXModifierDataPacket.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXObserverStateTree.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXSubject.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CRedBlackTree.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/IFXModifierChainInternal.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/IFXModifierChainState.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/IFXModifierDataPacketInternal.h
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/IFXSet.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXBoundSphereDataElement.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXDevice.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXDummyModifier.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXFileReference.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXGroup.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXLight.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXLightResource.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXLightSet.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXMarker.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXMaterialResource.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXMixerConstruct.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXModel.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXMotionResource.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXNode.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXResourceClient.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXSceneGraph.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXShaderList.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXSimpleCollection.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXSimpleList.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXView.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXViewResource.h
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/IFXSceneGraphPCH.h
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXClock.h
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXErrorInfo.h
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXNotificationInfo.h
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXNotificationManager.h
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXScheduler.h
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXSchedulerInfo.h
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXSimulationInfo.h
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXSimulationManager.h
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXSystemManager.h
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXTaskCallback.h
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXTaskData.h
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXTaskManager.h
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXTaskManagerNode.h
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXTaskManagerView.h
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXTimeManager.h
+ ${U3D_DIR}/src/RTL/Dependencies/WildCards/wcmatch.h
+)
+SET( IFXScheduling_SRCS
+ ${U3D_DIR}/src/RTL/Platform/${U3D_PLATFORM}/IFXScheduling/IFXSchedulingDllMain.cpp
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXClock.cpp
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXErrorInfo.cpp
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXNotificationInfo.cpp
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXNotificationManager.cpp
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXScheduler.cpp
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXSchedulerInfo.cpp
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXSimulationInfo.cpp
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXSimulationManager.cpp
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXSystemManager.cpp
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXTaskCallback.cpp
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXTaskData.cpp
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXTaskManager.cpp
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXTaskManagerNode.cpp
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXTaskManagerView.cpp
+ ${U3D_DIR}/src/RTL/Component/Scheduling/CIFXTimeManager.cpp
+ ${U3D_DIR}/src/RTL/Component/Scheduling/IFXScheduling.cpp
+ ${U3D_DIR}/src/RTL/Component/Scheduling/IFXSchedulingGuids.cpp
+ ${U3D_DIR}/src/RTL/IFXCorePluginStatic/IFXCorePluginStatic.cpp
+ ${U3D_DIR}/src/RTL/Platform/${U3D_PLATFORM}/Common/IFXOSUtilities.cpp
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXSubject.cpp
+ ${U3D_DIR}/src/RTL/Component/ModifierChain/CIFXModifier.cpp
+ ${U3D_DIR}/src/RTL/Component/SceneGraph/CIFXMarker.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXCoreArray.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXCoreList.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXFastAllocator.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXListNode.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXMatrix4x4.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXQuaternion.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXString.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXUnitAllocator.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXVector3.cpp
+ ${U3D_DIR}/src/RTL/Kernel/DataTypes/IFXVector4.cpp
+ ${U3D_DIR}/src/RTL/Dependencies/WildCards/wcmatch.cpp
+ ${U3D_DIR}/src/RTL/Kernel/Common/IFXDebug.cpp
+ )
+IF(WIN32)
+ SET( SCHED_DIR ${U3D_DIR}/src/RTL/Platform/Win32/IFXScheduling )
+ ADD_LIBRARY( IFXScheduling SHARED ${IFXScheduling_SRCS} ${IFXScheduling_HDRS} ${SCHED_DIR}/IFXScheduling.rc ${SCHED_DIR}/IFXResource.h ${SCHED_DIR}/IFXScheduling.def )
+ TARGET_LINK_LIBRARIES( IFXScheduling IFXCore )
+ENDIF(WIN32)
+IF(APPLE)
+ ADD_LIBRARY( IFXScheduling SHARED ${IFXScheduling_SRCS} ${IFXScheduling_HDRS} )
+ set_target_properties( IFXScheduling IFXCore PROPERTIES
+ LINK_FLAGS "${MY_LINK_FLAGS} -exported_symbols_list ${U3D_DIR}/src/RTL/Platform/Mac32/IFXScheduling/IFXScheduling.def -undefined dynamic_lookup"
+ SUFFIX .so)
+ENDIF(APPLE)
+IF(UNIX AND NOT APPLE)
+ ADD_LIBRARY( IFXScheduling SHARED ${IFXScheduling_SRCS} ${IFXScheduling_HDRS} )
+ set_target_properties( IFXScheduling PROPERTIES
+ LINK_FLAGS "-Wl,--version-script=${U3D_DIR}/src/RTL/Platform/Lin32/IFXScheduling/IFXScheduling.list" )
+ TARGET_LINK_LIBRARIES( IFXScheduling IFXCore IFXCoreStatic ${CMAKE_DL_LIBS} )
+ENDIF(UNIX AND NOT APPLE)
+
+#external-IDTFConverter
+INCLUDE_DIRECTORIES(
+ ${U3D_DIR}/src/RTL/Component/Include
+ ${U3D_DIR}/src/RTL/Kernel/Include
+ ${U3D_DIR}/src/RTL/Platform/Include
+ ${U3D_DIR}/src/IDTF
+ ${U3D_DIR}/src/IDTF/Include
+ ${U3D_DIR}/src/IDTF/Common )
+SET( IDTFConverter_SRCS
+ ${U3D_DIR}/src/IDTF/FileParser.cpp
+ ${U3D_DIR}/src/IDTF/SceneConverter.cpp
+ ${U3D_DIR}/src/IDTF/PointSetResourceParser.cpp
+ ${U3D_DIR}/src/IDTF/UrlListParser.cpp
+ ${U3D_DIR}/src/IDTF/NodeParser.cpp
+ ${U3D_DIR}/src/IDTF/ModifierParser.cpp
+ ${U3D_DIR}/src/IDTF/PointSetConverter.cpp
+ ${U3D_DIR}/src/IDTF/MaterialParser.cpp
+ ${U3D_DIR}/src/IDTF/MetaDataConverter.cpp
+ ${U3D_DIR}/src/IDTF/MeshResourceParser.cpp
+ ${U3D_DIR}/src/IDTF/ResourceConverter.cpp
+ ${U3D_DIR}/src/IDTF/TextureConverter.cpp
+ ${U3D_DIR}/src/IDTF/ResourceListParser.cpp
+ ${U3D_DIR}/src/IDTF/File.cpp
+ ${U3D_DIR}/src/IDTF/LineSetConverter.cpp
+ ${U3D_DIR}/src/IDTF/Converter.cpp
+ #${U3D_DIR}/src/IDTF/ConverterDriver.cpp
+ ${U3D_DIR}/src/IDTF/ModelConverter.cpp
+ ${U3D_DIR}/src/IDTF/TextureParser.cpp
+ ${U3D_DIR}/src/IDTF/NodeConverter.cpp
+ ${U3D_DIR}/src/IDTF/MeshConverter.cpp
+ ${U3D_DIR}/src/IDTF/BlockParser.cpp
+ ${U3D_DIR}/src/IDTF/ModelResourceParser.cpp
+ ${U3D_DIR}/src/IDTF/FileReferenceConverter.cpp
+ ${U3D_DIR}/src/IDTF/ShaderParser.cpp
+ ${U3D_DIR}/src/IDTF/FileScanner.cpp
+ ${U3D_DIR}/src/IDTF/FileReferenceParser.cpp
+ ${U3D_DIR}/src/IDTF/ModifierConverter.cpp
+ ${U3D_DIR}/src/IDTF/MetaDataParser.cpp
+ ${U3D_DIR}/src/IDTF/LineSetResourceParser.cpp
+ ${U3D_DIR}/src/IDTF/Helpers/MiscUtilities.cpp
+ ${U3D_DIR}/src/IDTF/Helpers/TGAImage.cpp
+ ${U3D_DIR}/src/IDTF/Helpers/ModifierUtilities.cpp
+ ${U3D_DIR}/src/IDTF/Helpers/ConverterHelpers.cpp
+ ${U3D_DIR}/src/IDTF/Helpers/SceneUtilities.cpp
+ ${U3D_DIR}/src/IDTF/Helpers/DebugInfo.cpp
+ ${U3D_DIR}/src/IDTF/Helpers/Guids.cpp
+ ${U3D_DIR}/src/IDTF/Common/GlyphModifier.cpp
+ ${U3D_DIR}/src/IDTF/Common/ModelResource.cpp
+ ${U3D_DIR}/src/IDTF/Common/ModifierList.cpp
+ ${U3D_DIR}/src/IDTF/Common/NodeList.cpp
+ ${U3D_DIR}/src/IDTF/Common/FileReference.cpp
+ ${U3D_DIR}/src/IDTF/Common/ResourceList.cpp
+ ${U3D_DIR}/src/IDTF/Common/SceneResources.cpp
+ ${U3D_DIR}/src/IDTF/Common/ModelResourceList.cpp
+ ${U3D_DIR}/src/IDTF/Common/MetaDataList.cpp
+ ${U3D_DIR}/src/IDTF/Common/ParentList.cpp
+ ${U3D_DIR}/src/IDTF/Common/GlyphCommandList.cpp
+)
+SET( IDTFConverter_HDRS
+ ${Component_HDRS}
+ ${Kernel_HDRS}
+ ${Platform_HDRS}
+ ${U3D_DIR}/src/IDTF/Converter.h
+ ${U3D_DIR}/src/IDTF/BlockParser.h
+ ${U3D_DIR}/src/IDTF/DefaultSettings.h
+ ${U3D_DIR}/src/IDTF/File.h
+ ${U3D_DIR}/src/IDTF/FileParser.h
+ ${U3D_DIR}/src/IDTF/FileReferenceConverter.h
+ ${U3D_DIR}/src/IDTF/FileReferenceParser.h
+ ${U3D_DIR}/src/IDTF/FileScanner.h
+ ${U3D_DIR}/src/IDTF/IConverter.h
+ ${U3D_DIR}/src/IDTF/LineSetConverter.h
+ ${U3D_DIR}/src/IDTF/LineSetResourceParser.h
+ ${U3D_DIR}/src/IDTF/MaterialParser.h
+ ${U3D_DIR}/src/IDTF/MeshConverter.h
+ ${U3D_DIR}/src/IDTF/MeshResourceParser.h
+ ${U3D_DIR}/src/IDTF/MetaDataConverter.h
+ ${U3D_DIR}/src/IDTF/MetaDataParser.h
+ ${U3D_DIR}/src/IDTF/ModelConverter.h
+ ${U3D_DIR}/src/IDTF/ModelResourceParser.h
+ ${U3D_DIR}/src/IDTF/ModifierConverter.h
+ ${U3D_DIR}/src/IDTF/ModifierParser.h
+ ${U3D_DIR}/src/IDTF/NodeConverter.h
+ ${U3D_DIR}/src/IDTF/NodeParser.h
+ ${U3D_DIR}/src/IDTF/PointSetConverter.h
+ ${U3D_DIR}/src/IDTF/PointSetResourceParser.h
+ ${U3D_DIR}/src/IDTF/ResourceConverter.h
+ ${U3D_DIR}/src/IDTF/ResourceListParser.h
+ ${U3D_DIR}/src/IDTF/SceneConverter.h
+ ${U3D_DIR}/src/IDTF/ShaderParser.h
+ ${U3D_DIR}/src/IDTF/TextureConverter.h
+ ${U3D_DIR}/src/IDTF/TextureParser.h
+ ${U3D_DIR}/src/IDTF/UrlListParser.h
+ ${U3D_DIR}/src/IDTF/Include/ConverterHelpers.h
+ ${U3D_DIR}/src/IDTF/Include/ConverterOptions.h
+ ${U3D_DIR}/src/IDTF/Include/ConverterResult.h
+ ${U3D_DIR}/src/IDTF/Include/DebugInfo.h
+ ${U3D_DIR}/src/IDTF/Include/SceneUtilities.h
+ ${U3D_DIR}/src/IDTF/Include/TGAImage.h
+ ${U3D_DIR}/src/IDTF/Include/U3DHeaders.h
+ ${U3D_DIR}/src/IDTF/Common/AnimationModifier.h
+ ${U3D_DIR}/src/IDTF/Common/BoneWeightModifier.h
+ ${U3D_DIR}/src/IDTF/Common/CLODModifier.h
+ ${U3D_DIR}/src/IDTF/Common/Color.h
+ ${U3D_DIR}/src/IDTF/Common/FileReference.h
+ ${U3D_DIR}/src/IDTF/Common/GlyphCommandList.h
+ ${U3D_DIR}/src/IDTF/Common/GlyphCommands.h
+ ${U3D_DIR}/src/IDTF/Common/GlyphModifier.h
+ ${U3D_DIR}/src/IDTF/Common/INode.h
+ ${U3D_DIR}/src/IDTF/Common/Int2.h
+ ${U3D_DIR}/src/IDTF/Common/Int3.h
+ ${U3D_DIR}/src/IDTF/Common/IResource.h
+ ${U3D_DIR}/src/IDTF/Common/LightNode.h
+ ${U3D_DIR}/src/IDTF/Common/LightResource.h
+ ${U3D_DIR}/src/IDTF/Common/LightResourceList.h
+ ${U3D_DIR}/src/IDTF/Common/LineSetResource.h
+ ${U3D_DIR}/src/IDTF/Common/MaterialResource.h
+ ${U3D_DIR}/src/IDTF/Common/MaterialResourceList.h
+ ${U3D_DIR}/src/IDTF/Common/MeshResource.h
+ ${U3D_DIR}/src/IDTF/Common/MetaDataList.h
+ ${U3D_DIR}/src/IDTF/Common/ModelNode.h
+ ${U3D_DIR}/src/IDTF/Common/ModelResource.h
+ ${U3D_DIR}/src/IDTF/Common/ModelResourceList.h
+ ${U3D_DIR}/src/IDTF/Common/ModelSkeleton.h
+ ${U3D_DIR}/src/IDTF/Common/Modifier.h
+ ${U3D_DIR}/src/IDTF/Common/ModifierList.h
+ ${U3D_DIR}/src/IDTF/Common/MotionResource.h
+ ${U3D_DIR}/src/IDTF/Common/MotionResourceList.h
+ ${U3D_DIR}/src/IDTF/Common/Node.h
+ ${U3D_DIR}/src/IDTF/Common/NodeList.h
+ ${U3D_DIR}/src/IDTF/Common/ParentData.h
+ ${U3D_DIR}/src/IDTF/Common/ParentList.h
+ ${U3D_DIR}/src/IDTF/Common/Point.h
+ ${U3D_DIR}/src/IDTF/Common/PointSetResource.h
+ ${U3D_DIR}/src/IDTF/Common/Quat.h
+ ${U3D_DIR}/src/IDTF/Common/Resource.h
+ ${U3D_DIR}/src/IDTF/Common/ResourceList.h
+ ${U3D_DIR}/src/IDTF/Common/SceneData.h
+ ${U3D_DIR}/src/IDTF/Common/SceneResources.h
+ ${U3D_DIR}/src/IDTF/Common/ShaderResource.h
+ ${U3D_DIR}/src/IDTF/Common/ShaderResourceList.h
+ ${U3D_DIR}/src/IDTF/Common/ShadingDescription.h
+ ${U3D_DIR}/src/IDTF/Common/ShadingDescriptionList.h
+ ${U3D_DIR}/src/IDTF/Common/ShadingModifier.h
+ ${U3D_DIR}/src/IDTF/Common/SubdivisionModifier.h
+ ${U3D_DIR}/src/IDTF/Common/TextureResource.h
+ ${U3D_DIR}/src/IDTF/Common/TextureResourceList.h
+ ${U3D_DIR}/src/IDTF/Common/Tokens.h
+ ${U3D_DIR}/src/IDTF/Common/UrlList.h
+ ${U3D_DIR}/src/IDTF/Common/ViewNodeData.h
+ ${U3D_DIR}/src/IDTF/Common/ViewNode.h
+ ${U3D_DIR}/src/IDTF/Common/ViewResource.h
+ ${U3D_DIR}/src/IDTF/Common/ViewResourceList.h
+)
+IF(WIN32)
+ SET( CORE_DIR ${U3D_DIR}/src/RTL/Platform/Win32/IDTFConverter )
+ ADD_LIBRARY( external-IDTFConverter STATIC ${IDTFConverter_SRCS} ${IDTFConverter_HDRS} ${U3D_DIR}/src/IDTF/IDTFConverter.rc ${U3D_DIR}/src/IDTF/IFXResource.h)
+ENDIF(WIN32)
+IF(APPLE)
+ ADD_LIBRARY( external-IDTFConverter ${IDTFConverter_SRCS} ${IDTFConverter_HDRS})
+# set_target_properties( external-IDTFConverter PROPERTIES
+# LINK_FLAGS "${MY_LINK_FLAGS} -exported_symbols_list /dev/null" )
+ENDIF(APPLE)
+IF(UNIX AND NOT APPLE)
+ ADD_LIBRARY( external-IDTFConverter STATIC ${IDTFConverter_SRCS} ${IDTFConverter_HDRS} )
+ENDIF(UNIX AND NOT APPLE)
+
+IF(UNIX AND NOT APPLE)
+ set(U3D_LIB_RELATIVE_PATH "../external/u3d/")
+ set(U3D_INSTALL_RELATIVE_PATH "../lib/meshlab/")
+ELSEIF(APPLE)
+ set(U3D_LIB_RELATIVE_PATH "../../../../external/u3d/")
+ set(U3D_INSTALL_RELATIVE_PATH "../Frameworks/")
+elseif(WIN32)
+ set(U3D_LIB_RELATIVE_PATH "../external/u3d/")
+ set(U3D_INSTALL_RELATIVE_PATH ".")
+endif()
+
+message(--U3D_OUT_PATH: ${OUT_PATH_LIB})
+
+TARGET_LINK_LIBRARIES( external-IDTFConverter IFXCoreStatic ${ADDITIONAL_LIBRARIES} ${CMAKE_DL_LIBS} )
+
+set_property(TARGET external-IDTFConverter PROPERTY FOLDER External)
+
+SET_PROPERTY( SOURCE
+ ${U3D_DIR}/src/RTL/Platform/${U3D_PLATFORM}/Common/IFXOSLoader.cpp
+ PROPERTY COMPILE_DEFINITIONS U3DPluginsPath="Plugins" U3DCorePath="${U3D_LIB_RELATIVE_PATH}" U3DInstallPath="${U3D_INSTALL_RELATIVE_PATH}")
+IF(STDIO_HACK)
+SET_PROPERTY( SOURCE
+ ${U3D_DIR}/src/RTL/Component/Exporting/CIFXStdioWriteBufferX.cpp
+ ${U3D_DIR}/src/IDTF/ConverterDriver.cpp
+ ${U3D_DIR}/src/IDTF/File.cpp
+ PROPERTY COMPILE_DEFINITIONS STDIO_HACK )
+SET_PROPERTY( SOURCE
+ ${U3D_DIR}/src/RTL/Platform/${U3D_PLATFORM}/Common/IFXOSLoader.cpp
+ PROPERTY COMPILE_DEFINITIONS U3DPluginsPath="Plugins" U3DCorePath="${U3D_LIB_RELATIVE_PATH}" U3DInstallPath="${U3D_INSTALL_RELATIVE_PATH}" STDIO_HACK )
+ENDIF(STDIO_HACK)
+
+install(TARGETS IFXCore IFXExporting IFXScheduling DESTINATION ${MESHLAB_LIB_INSTALL_DIR})
diff --git a/src/external/u3d/IFXCore/IFXCore.pro b/src/external/u3d/IFXCore/IFXCore.pro
index 6f915246e..a3cd5b9e1 100644
--- a/src/external/u3d/IFXCore/IFXCore.pro
+++ b/src/external/u3d/IFXCore/IFXCore.pro
@@ -11,7 +11,7 @@ linux{
U3D_PLATFORM=Lin32
}
macx {
- DEFINES+=MAC32
+ DEFINES+=MAC32
U3D_PLATFORM=Mac32
}
diff --git a/src/external/u3d/IFXExporting/IFXExporting.pro b/src/external/u3d/IFXExporting/IFXExporting.pro
index ac2c482b3..8eed2e67a 100644
--- a/src/external/u3d/IFXExporting/IFXExporting.pro
+++ b/src/external/u3d/IFXExporting/IFXExporting.pro
@@ -81,7 +81,7 @@ SOURCES += \
$${BASE_SRC_RTL}/Kernel/Common/IFXDebug.cpp
macx {
- QMAKE_LFLAGS += -exported_symbols_list $${BASE_SRC_RTL}/Platform/Mac32/IFXExporting/IFXExporting.def -undefined dynamic_lookup
+ QMAKE_LFLAGS += -exported_symbols_list $${BASE_SRC_RTL}/Platform/Mac32/IFXExporting/IFXExporting.def -undefined dynamic_lookup
QMAKE_LFLAGS_PLUGIN -= -dynamiclib
QMAKE_LFLAGS_PLUGIN += -bundle
QMAKE_EXTENSION_SHLIB = so
diff --git a/src/external/u3d/IFXScheduling/IFXScheduling.pro b/src/external/u3d/IFXScheduling/IFXScheduling.pro
index 0159c3800..6d505466d 100644
--- a/src/external/u3d/IFXScheduling/IFXScheduling.pro
+++ b/src/external/u3d/IFXScheduling/IFXScheduling.pro
@@ -11,7 +11,7 @@ linux{
U3D_PLATFORM=Lin32
}
macx {
- DEFINES+=MAC32
+ DEFINES+=MAC32
U3D_PLATFORM=Mac32
}
@@ -66,7 +66,7 @@ SOURCES += \
$${BASE_SRC_RTL}/Kernel/Common/IFXDebug.cpp
macx {
- QMAKE_LFLAGS += -exported_symbols_list $${BASE_SRC_RTL}/Platform/Mac32/IFXScheduling/IFXScheduling.def -undefined dynamic_lookup
+ QMAKE_LFLAGS += -exported_symbols_list $${BASE_SRC_RTL}/Platform/Mac32/IFXScheduling/IFXScheduling.def -undefined dynamic_lookup
QMAKE_LFLAGS_PLUGIN -= -dynamiclib
QMAKE_LFLAGS_PLUGIN += -bundle
QMAKE_EXTENSION_SHLIB = so
diff --git a/src/external/u3d/src/RTL/Platform/Lin32/Common/IFXOSLoader.cpp b/src/external/u3d/src/RTL/Platform/Lin32/Common/IFXOSLoader.cpp
index 2cda96085..4ceddee82 100644
--- a/src/external/u3d/src/RTL/Platform/Lin32/Common/IFXOSLoader.cpp
+++ b/src/external/u3d/src/RTL/Platform/Lin32/Common/IFXOSLoader.cpp
@@ -44,7 +44,13 @@ static const char* s_pCorePathEnvVar = "U3D_LIBDIR";
static const char* s_pCorePathDefault = U3DCorePath;
#else
static const char* s_pCorePathDefault = ".";
-#endif
+#endif //U3DCorePath
+#ifdef U3DInstallPath
+static const char* s_pInstallPathDefault = U3DInstallPath;
+#else
+static const char* s_pInstallPathDefault = ".";
+#endif //U3DInstallPath
+
#ifdef U3DPluginsPath
#define IFXOSFI_SUBDIR U3DPluginsPath
#else
@@ -95,6 +101,28 @@ IFXHANDLE IFXAPI IFXLoadLibrary( const IFXCHAR* pFileName )
IFXTRACE_GENERIC(L"%s:%i \"%s/%s\" FileName lenth is more then %i\n",__FILE__, __LINE__, pCorePath, fileName, _MAXIMUM_FILENAME_LENGTH);
}
}
+
+ //add for meshlab
+ if (!handle)
+ {
+ const char* pCorePath = s_pInstallPathDefault;
+
+ char newFileName[_MAXIMUM_FILENAME_LENGTH];
+ size += strlen(pCorePath);
+
+ if (size+1 < _MAXIMUM_FILENAME_LENGTH)
+ {
+ strcpy(newFileName, pCorePath);
+ strcat(newFileName, "/");
+ strcat(newFileName, fileName);
+
+ handle = dlopen(newFileName, RTLD_LAZY | RTLD_GLOBAL );
+ }
+ else
+ {
+ IFXTRACE_GENERIC(L"%s:%i \"%s/%s\" FileName lenth is more then %i\n",__FILE__, __LINE__, pCorePath, fileName, _MAXIMUM_FILENAME_LENGTH);
+ }
+ }
if (!handle)
{
@@ -116,6 +144,27 @@ IFXHANDLE IFXAPI IFXLoadLibrary( const IFXCHAR* pFileName )
IFXTRACE_GENERIC(L"%s:%i \"%s/" IFXOSFI_SUBDIR "/%s\" FileName lenth is more then %i\n",__FILE__, __LINE__, pCorePath, fileName, _MAXIMUM_FILENAME_LENGTH);
}
}
+
+ //add for meshlab
+ if (!handle)
+ {
+ const char* pCorePath = s_pInstallPathDefault;
+
+ char newFileName[_MAXIMUM_FILENAME_LENGTH];
+
+ if (size+2+strlen(IFXOSFI_SUBDIR) < _MAXIMUM_FILENAME_LENGTH)
+ {
+ strcpy(newFileName, pCorePath);
+ strcat(newFileName, "/" IFXOSFI_SUBDIR "/");
+ strcat(newFileName, fileName);
+
+ handle = dlopen(newFileName, RTLD_LAZY | RTLD_GLOBAL );
+ }
+ else
+ {
+ IFXTRACE_GENERIC(L"%s:%i \"%s/" IFXOSFI_SUBDIR "/%s\" FileName lenth is more then %i\n",__FILE__, __LINE__, pCorePath, fileName, _MAXIMUM_FILENAME_LENGTH);
+ }
+ }
if (!handle)
{
diff --git a/src/external/u3d/src/RTL/Platform/Mac32/Common/IFXOSLoader.cpp b/src/external/u3d/src/RTL/Platform/Mac32/Common/IFXOSLoader.cpp
index 717d32442..65d017b52 100644
--- a/src/external/u3d/src/RTL/Platform/Mac32/Common/IFXOSLoader.cpp
+++ b/src/external/u3d/src/RTL/Platform/Mac32/Common/IFXOSLoader.cpp
@@ -43,7 +43,12 @@ static const char* s_pCorePathEnvVar = "U3D_LIBDIR";
static const char* s_pCorePathDefault = U3DCorePath;
#else
static const char* s_pCorePathDefault = ".";
-#endif
+#endif //U3DCorePath
+#ifdef U3DInstallPath
+static const char* s_pInstallPathDefault = U3DInstallPath;
+#else
+static const char* s_pInstallPathDefault = ".";
+#endif //U3DInstallPath
#ifdef U3DPluginsPath
#define IFXOSFI_SUBDIR U3DPluginsPath
#else
@@ -94,6 +99,28 @@ IFXHANDLE IFXAPI IFXLoadLibrary( const IFXCHAR* pFileName )
IFXTRACE_GENERIC(L"%s:%i \"%s/%s\" FileName lenth is more then %i\n",__FILE__, __LINE__, pCorePath, fileName, _MAXIMUM_FILENAME_LENGTH);
}
}
+
+ //add for meshlab
+ if (!handle)
+ {
+ const char* pCorePath = s_pInstallPathDefault;
+
+ char newFileName[_MAXIMUM_FILENAME_LENGTH];
+ size += strlen(pCorePath);
+
+ if (size+1 < _MAXIMUM_FILENAME_LENGTH)
+ {
+ strcpy(newFileName, pCorePath);
+ strcat(newFileName, "/");
+ strcat(newFileName, fileName);
+
+ handle = dlopen(newFileName, RTLD_LAZY );
+ }
+ else
+ {
+ IFXTRACE_GENERIC(L"%s:%i \"%s/%s\" FileName lenth is more then %i\n",__FILE__, __LINE__, pCorePath, fileName, _MAXIMUM_FILENAME_LENGTH);
+ }
+ }
if (!handle)
{
@@ -115,6 +142,27 @@ IFXHANDLE IFXAPI IFXLoadLibrary( const IFXCHAR* pFileName )
IFXTRACE_GENERIC(L"%s:%i \"%s/" IFXOSFI_SUBDIR "/%s\" FileName lenth is more then %i\n",__FILE__, __LINE__, pCorePath, fileName, _MAXIMUM_FILENAME_LENGTH);
}
}
+
+ //add for meshlab
+ if (!handle)
+ {
+ const char* pCorePath = s_pInstallPathDefault;
+
+ char newFileName[_MAXIMUM_FILENAME_LENGTH];
+
+ if (size+2+strlen(IFXOSFI_SUBDIR) < _MAXIMUM_FILENAME_LENGTH)
+ {
+ strcpy(newFileName, pCorePath);
+ strcat(newFileName, "/" IFXOSFI_SUBDIR "/");
+ strcat(newFileName, fileName);
+
+ handle = dlopen(newFileName, RTLD_LAZY );
+ }
+ else
+ {
+ IFXTRACE_GENERIC(L"%s:%i \"%s/" IFXOSFI_SUBDIR "/%s\" FileName lenth is more then %i\n",__FILE__, __LINE__, pCorePath, fileName, _MAXIMUM_FILENAME_LENGTH);
+ }
+ }
if (!handle)
{
diff --git a/src/general.pri b/src/general.pri
index 84b7dec17..fb98eb7a9 100644
--- a/src/general.pri
+++ b/src/general.pri
@@ -9,7 +9,7 @@
DEFINES += MESHLAB_SCALAR=float
# VCG directory
-VCGDIR = $$MESHLAB_SOURCE_DIRECTORY/../vcglib
+VCGDIR = $$MESHLAB_SOURCE_DIRECTORY/vcglib
include(find_system_libs.pri)
diff --git a/src/meshlab/CMakeLists.txt b/src/meshlab/CMakeLists.txt
index d931250da..9d589366a 100644
--- a/src/meshlab/CMakeLists.txt
+++ b/src/meshlab/CMakeLists.txt
@@ -74,13 +74,9 @@ set(UI
ui/savesnapshotDialog.ui)
set(CMAKE_AUTOUIC_SEARCH_PATHS ${CMAKE_CURRENT_SOURCE_DIR}/ui)
-#if(APPLE)
-# list(APPEND SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../install/macx/info.plist
-# images/meshlab.icns)
-#endif()
if(WIN32)
- list(APPEND SOURCES meshlab.rc)
+ list(APPEND SOURCES meshlab.rc)
endif()
add_executable(meshlab WIN32 MACOSX_BUNDLE
@@ -95,19 +91,14 @@ target_link_libraries(
)
set_property(TARGET meshlab PROPERTY FOLDER Core)
+if (APPLE)
+ set_target_properties(meshlab PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
+ set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/images/meshlab.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
+ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/images/meshlab.icns DESTINATION "${MESHLAB_BUILD_DISTRIB_DIR}/meshlab.app/Contents/Resources/")
+ set_target_properties(meshlab PROPERTIES MACOSX_BUNDLE_ICONFILE meshlab.icns)
+endif()
install(
TARGETS meshlab
DESTINATION ${MESHLAB_BIN_INSTALL_DIR}
-COMPONENT MeshLab)
-
-if(Qt5_windeployqt_EXECUTABLE AND BUILD_WITH_WINDEPLOYQT_POST_BUILD)
- add_custom_command(
- TARGET meshlab
- POST_BUILD
- COMMAND "${Qt5_windeployqt_EXECUTABLE}" --no-translations
- $
- WORKING_DIRECTORY $
- COMMENT "Deploying Qt to the build directory of meshlab"
- VERBATIM USES_TERMINAL)
-endif()
+ COMPONENT MeshLab)
diff --git a/src/meshlab/meshlab.qrc b/src/meshlab/meshlab.qrc
index b4a6f838f..72f7122ca 100644
--- a/src/meshlab/meshlab.qrc
+++ b/src/meshlab/meshlab.qrc
@@ -1,7 +1,5 @@
- ../common/script_system/meshlabfilterXMLspecificationformat.xsd
- ../common/script_system/math.js
images/backlines.png
images/bbox.png
images/cursors/plain.png
diff --git a/src/meshlabplugins/edit_align/align/Guess.cpp b/src/meshlabplugins/edit_align/align/Guess.cpp
deleted file mode 100644
index 9fae7c942..000000000
--- a/src/meshlabplugins/edit_align/align/Guess.cpp
+++ /dev/null
@@ -1,333 +0,0 @@
-/****************************************************************************
-* MeshLab o o *
-* A versatile mesh processing toolbox o o *
-* _ O _ *
-* Copyright(C) 2005 \/)\/ *
-* 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. *
-* *
-****************************************************************************/
-
-#include
-#include
-#include
-#include
-#include "Guess.h"
-#include
-
-using namespace std;
-
-namespace vcg
-{
-namespace tri
-{
-
-
-
-
-// Fill movVert with the transformed version of movVertBase;
-void Guess::ApplyTransformation(const Point3f &BaseTranslation, const Matrix44f &BaseRot,
- std::vector< Point3f > &movVert,
- std::vector< Point3f > &movNorm,
- Box3f &movBox
- ) const
-
-/*
- Very Low level function
- Given a Occupancy grid initialized with the Fix mesh.
- We search the best translation matrix T such that
- T * R * Mov has the greatest overlap with Fix
-*/
-
-int Guess::SearchBestTranslation( GridStaticObj &U,
- const Matrix44x &BaseRot,
- const int range,
- Point3x &StartTrans,
- Point3x &BestTrans // miglior vettore di spostamento
- )
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#if 0
-/*
-Funzione che allinea due mesh a caso.
-
-Parametri fondamentali
-
-- Spazio di ricerca della searchtranslate
-Ragionevole range=8 step =2 nel Second step
-e range=8,step =1 nel third step di raffinamento
-
-- Parametri allineamento
-fondamentale mettere una mindist non molto alta
-e disabilitare il reducefactor
-
-Un po' difficile capire quando l'allinamento e' venuto bene
-*/
-void Guess::ComputeTrans(std::vector &rv)
-{
- int StartTm=clock();
- std::vector rvt;
- Point3d BestTransV;
-
- // Second Step: Compute for each possible Orientation the Best Translation
- Matrix44d TrBase;
- size_t i;
- for(i=0;i &rv)
-{
- FILE * lfp=fopen("Guesslog.txt","w");
- // - try to align and store the best results
- Point3d BestTransV;
- int StartTm=clock();
- AlignPair::Result ar;
- vector Alns;
- Matrix44d BestTransM;
- int cnt=0;
-// UGrid< AlignPair::A2Mesh::face_container > U;
- AlignPair::A2Grid U;
- aa.InitFix(aa.fix,aa.ap,U);
- for(int i=0;i<20 && cnt < 4;++i)
- {
- int fnd;
- GetM(rv[i],BaseRot);
- do
- {
- fnd=SearchTranslate(0,BaseRot,8,1,BestTransV,false);
- BestTransM.SetTranslate(BestTransV);
- BaseRot=BaseRot*BestTransM;
- }
- while(BestTransV != Point3d(0,0,0));
- if(fnd>rv[i].err) printf("improved solution %i from %i to %i\n",i,int(rv[i].err),fnd);
-
- //AlignStat as;
- aa.ap = ap;
- aa.ap.MaxIterNum = 100;
- aa.ap.MinDistAbs = aa.Abs2Perc(0.05f,aa.fix->bbox);
- aa.ap.SampleNum = 2000;
- // aa.ap.TrgDist = TrgDist;
- // aa.ap.PointNum = PointNum;
- //aa.ap.MaxAngle = ToRad(MaxAngle);
- aa.ap.MatchMode=AlignPair::Param::MMRigid;
- aa.ap.EndStepNum = 8;
- aa.ap.ReduceFactor = .95;
-
- Matrix44d trinc=BaseRot;
- Matrix44d TrRes;
-
- aa.InitMov(movvert,movnorm,movbox,BaseRot);
- //aa.Align(U, movvert, movnorm, movbox,trinc,ar);
- aa.Align(U,trinc,ar.Tr,
- ar.Pfix, ar.Nfix,
- ar.Pmov, ar.Nmov,
- ar.H, ar.as);
- ar.err=ar.as.LastPcl50();
-// printf("Ornt %2i n %3i (%6.3f %6.3f %6.3f) angle %2i %s Err:%8.5f %4i \n",
-// i, rv[i].nind,NV[rv[i].nind][0],NV[rv[i].nind][1],NV[rv[i].nind][2],rv[i].angl,
-// AlignPair::ErrorMsg(aa.status),
-// ar.err,
-// ar.as.TotTime());
-
- ar.as.Dump(lfp);
-
- if(aa.status==AlignPair::SUCCESS ){
- if(ar.err<1.0){
- Alns.push_back(ar);
- printf("Alignment Succeeded!:\n");
- cnt++;
- //as.Dump(stdout);
- //printf("\nInputM\n");print(BaseRot);
- //printf("\nResult\n");print(TrRes);
- //BaseRot=TrRes;
- }
- }
- }
- sort(Alns.begin(),Alns.end());
- printf("Completed Alignment in %lu ms, found %li good alignments\n",clock()-StartTm,Alns.size());
- for(int i=0;i movvert;
- std::vector< Point3d > movnorm;
- Box3d movbox;
- //SGrid< bool,float> &U=u[UGLev];
- GridStaticObj< bool,float> &U=u[UGLev];
- //SGrid RG;
- GridStaticObj RG;
- RG.Create(Point3i((range*2+1),(range*2+1),(range*2+1)),0);
-
- int t0=clock();
- aa.InitMov(movvert,movnorm,movbox,BaseRot);
- Point3i ip;
- int i,ii,jj,kk;
-
- Point3i b,e;
- for(i=0;i=U.siz[0]) e[0]-=step;
- while(b[1]<0) b[1]+=step;
- while(e[1]>=U.siz[1]) e[1]-=step;
- while(b[2]<0) b[2]+=step;
- while(e[2]>=U.siz[2]) e[2]-=step;
-
- for(ii=b[0];ii<=e[0];ii+=step)
- {
- for(jj=b[1];jj<=e[1];jj+=step)
- {
- for(kk=b[2];kk<=e[2];kk+=step)
- {
- if(U.Grid(ii,jj,kk))
- ++RG.Grid(ii-b[0]+range,jj-b[1]+range,kk-b[2]+range);
- assert(ii >=0 && ii < U.siz[0]);
- assert(jj >=0 && jj < U.siz[1]);
- assert(kk >=0 && kk < U.siz[2]);
- }
- }
- }
- }
- }
- int maxfnd=0;
- Point3i BestI;
- for(ii=-range;ii<=range;ii+=step)
- for(jj=-range;jj<=range;jj+=step)
- for(kk=-range;kk<=range;kk+=step)
- {
-
- if(RG.Grid(ii+range,jj+range,kk+range)>maxfnd)
- {
- BestI=Point3i(ii,jj,kk);
- BestTransV=Point3d(-ii*U.voxel[0], -jj*U.voxel[1], -kk*U.voxel[2]);
- maxfnd=RG.Grid(ii+range,jj+range,kk+range);
- }
- //printf("Found %i su %i in %i\n",test[testcnt],movvert.size(),t1-t0);
- }
-
- int t1=clock();
- if(Verbose) printf("BestTransl (%4i in %3ims) is %8.4f %8.4f %8.4f (%3i %3i %3i)\n",maxfnd,t1-t0,BestTransV[0],BestTransV[1],BestTransV[2],BestI[0],BestI[1],BestI[2]);
- return maxfnd;
-}
-
-
-/* Check che non ci siano troppe matrici uguali
- Hist H;
- for(i=0;i
-#include
-#include
-#include
-#include
-#include
-namespace vcg
-{
-namespace tri
-{
-
-// Class for Brute force alignment.
-// given two meshes, Fix and Mov, it build a set of coarser and coarser occupancy grids.
-// Put Fix into the grids, and then try to rotate a subset of the Mov points to see how much
-// they cover the same space of the other one.
-
-template
-class Guess
-{
- typedef typename vcg::Point3 Point3x;
- typedef typename vcg::Matrix44 Matrix44x;
- typedef typename vcg::Box3 Box3x;
-public:
- // Parameter of the automatic alighment approach
- class Param
- {
- public:
- Param()
- {
-
- GridSize=200000;
- MatrixNum=1000;
- Range=8;
- SampleNum=10000;
- UGLevels=3;
- }
-
- int MatrixNum; // Number of Direction to be tested.
-
- int Range; // numero
- int GridSize;
- int SampleNum; // Number of points of the Movable mesh that has to be used in the SearchTranslate
- int UGLevels;
- };
-
- class Result
- {
- public:
-
- Result(const Matrix44x &_m, int _score,int _id, const Point3x &BestTransvec)
- {
- m=_m;
- id=_id;
- score=_score;
- BestTr=BestTransvec;
- }
- Matrix44x m;
- int id; // the id of the in the RotMVec;
- int score;
- Point3x BestTr; //Best Translation vector found.
- bool operator < (const Result & rr) const {return (score< rr.score);}
- };
-
-/***********************************/
- // The internal state:
-
- std::vector RotMVec;
- Param pp;
-
- // the array of finer and finer grids
- GridStaticObj< bool,ScalarType> u[4];
-
- // the mesh are represented by just two (well sampled) point clouds.
- std::vector< Point3x > movVertBase;
- std::vector< Point3x > movNormBase;
-
- Point3x movBarycenterBase;
- Point3x fixBarycenterBase;
-
-/***********************************/
-
- Guess(){}
-
- template
- void Init(MeshType &fixm, MeshType &movm)
- {
- std::vector FixV;
- std::vector MV;
- Matrix44x tm; tm.SetIdentity();
- MV.push_back(tm);
- FixV.push_back(&fixm);
- Init(FixV,MV,movm,tm);
- }
-
- template
- void GenerateOccupancyMesh(MeshType &m, int lev, const Matrix44x &res)
- {
- typedef typename MeshType::CoordType CoordType;
- VectorConstDataWrapper > ww(this->movVertBase);
- Matrix44x invRes = Inverse(res);
- KdTree surfTree(ww);
- float scaleFact=0;
- float squaredVoxDiag = u[lev].voxel.SquaredNorm();
- m.Clear();
- int cnt =0,crossCnt=0;
- for(int i=0;i::Scale(t,scaleFact);
- tri::UpdatePosition::Translate(t,CoordType(0.5f,0.5f,0.5f));
- tri::UpdatePosition::Translate(t,CoordType(float(i),float(j),float(k)));
- tri::Append::Mesh(m,t);
- }
- }
- }
- }
- tri::UpdatePosition::Matrix(m,u[lev].IPtoPfMatrix());
- qDebug("Found %i (%i) filled on %i",cnt, crossCnt, u[lev].siz[0]*u[lev].siz[1]*u[lev].siz[2]);
- }
- template
- void Init( std::vector &FixMV, std::vector &FixTrV, MeshType &MovM, const Matrix44x & MovTr)
- {
- Box3x tbb;
- // Step 1; Compute the Global BBox and init all the ug's
- for(size_t i=0;ibbox);
-
- // the UG are coaser and coarser;
- // u[0] is the finest
- // u[1] has 1/8 of the cells of u[0] etc etc...
- for(int kk=0;kkvert.begin();vi!=FixMV[i]->vert.end();++vi)
- {
- tp=FixTrV[i]*(*vi).P();
- for(int kk=0;kk ts(movVertBase);
- SurfaceSampling >::Montecarlo(MovM, ts, pp.SampleNum);
-
- movBarycenterBase=Point3x(0,0,0);
- for(size_t i=0;i &rv);
- void ComputeAlign(std::vector &rv);
- void AddVert(std::vector &vv, Matrix44d &Tr);
- void ApplyTransformation(const Point3x &BaseTranslation, const Matrix44x &BaseRot,
- std::vector< Point3x > &movVert, std::vector< Point3x > &movNorm, Box3x &movBox) const
-{
- movBox.SetNull();
- movVert.clear();
- const Matrix44x baseTransf = BuildTransformation(BaseRot,BaseTranslation);
-
- typename std::vector< Point3x >::const_iterator vi;
- for(vi=this->movVertBase.begin();vi!=this->movVertBase.end();++vi)
- {
- movVert.push_back(baseTransf * (*vi));
- movBox.Add(movVert.back());
- }
-}
-
- int SearchBestTranslation(GridStaticObj &U,
- const Matrix44x &BaseRot,
- const int range,
- Point3x &StartTrans,
- Point3x &BestTrans // miglior vettore di spostamento
- ){
-
- const int wide1=(range*2+1);
- const int wide2=wide1*wide1;
-
-
- // the rotated and translated) set of vertices;
- std::vector< Point3x > movVert;
- std::vector< Point3x > movNorm;
- Box3x movBox;
-
- ApplyTransformation(StartTrans, BaseRot,movVert,movNorm, movBox);
-
- int t0=clock();
-
-// qDebug("Start searchTranslate movVert %i(grid sz %i %i %i",movVert.size(), U.siz[0],U.siz[1],U.siz[2]);
-// qDebug(" bbox ug = %6.2f %6.2f %6.2f - %6.2f %6.2f %6.2f",U.bbox.min[0],U.bbox.min[1],U.bbox.min[2],U.bbox.max[1],U.bbox.max[1],U.bbox.max[2]);
-// qDebug(" bbox mov = %6.2f %6.2f %6.2f - %6.2f %6.2f %6.2f",movBox.min[0],movBox.min[1],movBox.min[2],movBox.max[1],movBox.max[1],movBox.max[2]);
- Point3i ip;
- int i,ii,jj,kk;
- std::vector test((range*2+1)*(range*2+1)*(range*2+1),0);
- //int bx,by,bz,ex,ey,ez;
- Point3i b,e;
- int testposii,testposjj;
- // First Loop, for each point, attempt all the possible translations (2*range)^3 and
- // if the translated point hits something increment the counter for that "translation"
-
- for(i=0;i=0 && ii < U.siz[0]);
- assert(jj >=0 && jj < U.siz[1]);
- assert(kk >=0 && kk < U.siz[2]);
- }
- }
- }
- }
- }
- int maxfnd=0;
- Point3i BestI;
- for(ii=-range;ii<=range;++ii)
- for(jj=-range;jj<=range;++jj)
- for(kk=-range;kk<=range;++kk)
- {
- const int pos = (range+ii)*wide2+(range+jj)*wide1+range+kk;
- if(test[pos]>maxfnd)
- {
- BestI=Point3i(ii,jj,kk);
- BestTrans=Point3x(ii*U.voxel[0], jj*U.voxel[1], kk*U.voxel[2]);
- maxfnd=test[pos];
- }
- //printf("Found %i su %i in %i\n",test[testcnt],movvert.size(),t1-t0);
- }
-
- int t1=clock();
- //if(Verbose)
- qDebug("BestTransl (%4i in %i msec) is %8.4f %8.4f %8.4f (%3i %3i %3i)",maxfnd, (1000*(t1-t0))/CLOCKS_PER_SEC,BestTrans[0],BestTrans[1],BestTrans[2],BestI[0],BestI[1],BestI[2]);
- return maxfnd;
-}
-
- void GenRotMatrix()
- {
- vector NV;
- GenNormal::Fibonacci(sqrt(float(pp.MatrixNum)),NV);
-
- ScalarType AngleStep;
- int AngleNum;
- ComputeStep(NV.size(),AngleStep,AngleNum);
- RotMVec.resize(NV.size()*AngleNum);
- qDebug("Generated %li normals and %li rotations",NV.size(),RotMVec.size());
- for(size_t i=0;imovBarycenterBase;
- return this->movBarycenterBase - movBarycenter ;
- }
-
- Matrix44x BuildTransformation(const Matrix44x &baseRot, const Point3x &BaseTrans) const
- {
- Matrix44x Tr;
- Tr.SetTranslate(BaseTrans);
- return Tr*baseRot;
- }
-
- Matrix44x BuildResult(const Matrix44x &baseRot, const Point3x &BaseTrans, const Point3x &BestTrans) const
-{
- Matrix44x Tr;
- Tr.SetTranslate(BestTrans);
- return Tr*BuildTransformation(baseRot, BaseTrans);
-}
-private :
-
-
- // Genera la matrice di rotazione che porta l'asse z a coincidere con Axis
- // e poi ruota di angle intorno a quell'asse.
-
-
- // If i have k uniformly distributed directions, each of them subtends a solid angle of 4Pi/k steradian;
- // A given cone with an apex angle of subtends a solid angle of c = (1 - cos(a/2))*2Pi
- // (think to the cylindrical projection of a cone...)
- // examples:
- // a=0 -> c= 0
- // a=pi/2 c= 2pi
- // a=120 = 2/3 pi -> (1-cos(pi/3)*2pi -> pi cioe' 1/4 di sfera.
- // quindi se ogni normale sottende un angolo solido di s ottengo che
- // s = (1 - cos(a/2)) *2pi
- // s/2pi -1 = -cos (a/2)
- // 1 - s/2pi = cos (a/2)
- // a/2 = acos( 1- s/2pi))
- // a = 2*acos(( 1 - s/2pi))
- void GenMatrix(Matrix44x &a, Point3x Axis, ScalarType angleRad)
- {
- const ScalarType eps=1e-10;
- Point3x RotAx = Axis ^ Point3x(0,0,1);
- float RotAngleRad = Angle(Axis,Point3x(0,0,1));
-
- if(math::Abs(RotAx.Norm())
-
-#include
-#include
-
-#include
-
-using namespace vcg;
-
-const QString AlignTools::UseMarkers = "UseM";
-const QString AlignTools::AllowScaling = "AllowScaling";
-const QString AlignTools::UseICP = "UseICP";
-const QString AlignTools::StuckMesh = "StuckMesh";
-const QString AlignTools::MeshToMove = "MeshToMove";
-
-AlignTools::AlignTools(){}
-
-void AlignTools::buildParameterSet(MeshDocument &md,RichParameterSet & parlst)
-{
- vcg::AlignPair::Param ICPParameters;
- AlignParameter::buildRichParameterSet(ICPParameters, parlst);
-
- parlst.addParam(new RichBool(UseMarkers, true, "Use Markers for Alignment","if true (default), then use the user picked markers to do an alignment (or pre alignment if you also use ICP)."));
- parlst.addParam(new RichBool(AllowScaling, false, "Scale the mesh","if true (false by default), in addition to the alignment, scale the mesh based on the points picked"));
-
- parlst.addParam(new RichBool(UseICP, true, "Use ICP for Alignment","if true (default), then use the ICP to align the two meshes."));
-
- parlst.addParam(new RichMesh (StuckMesh, md.mm(), &md,"Stuck Mesh",
- "The mesh that will not move."));
- parlst.addParam(new RichMesh (MeshToMove, md.mm(), &md, "Mesh to Move",
- "The mesh that will move to fit close to the Stuck Mesh."));
-}
-
-bool AlignTools::setupThenAlign(MeshModel &/*mm*/, RichParameterSet & par)
-{
- //mesh that wont move
- MeshModel *stuckModel = par.getMesh(StuckMesh);
- PickedPoints *stuckPickedPoints = 0;
-
- //mesh that will move
- MeshModel *modelToMove = par.getMesh(MeshToMove);
- PickedPoints *modelToMovePickedPoints = 0;
-
- bool useMarkers = par.getBool(UseMarkers);
-
- if(NULL == stuckModel || NULL == modelToMove)
- {
- qDebug() << "one of the input meshes to filter align was null";
- return false;
- }
-
- //if we are going to use the markers try to load them
- if(useMarkers){
- //first try to get points from memory
- if(vcg::tri::HasPerMeshAttribute(stuckModel->cm, PickedPoints::Key) )
- {
- CMeshO::PerMeshAttributeHandle ppHandle =
- vcg::tri::Allocator::GetPerMeshAttribute(stuckModel->cm, PickedPoints::Key);
-
- stuckPickedPoints = ppHandle();
-
- if(NULL == stuckPickedPoints){
- qDebug() << "problem casting to picked points";
- return false;
- }
- } else
- {
- //now try to load them from a file
- QString ppFileName = PickedPoints::getSuggestedPickedPointsFileName(*stuckModel);
- QFileInfo file(ppFileName);
- if(file.exists())
- {
- stuckPickedPoints = new PickedPoints();
- bool success = stuckPickedPoints->open(ppFileName);
-
- if(!success){
- qDebug() << "problem loading stuck picked points from a file";
- return false;
- }
- } else
- {
- qDebug() << "stuck points file didn't exist: " << ppFileName;
- //Log(GLLogStream::WARNING, "No points were found for the Stuck mesh.");
- return false;
- }
- }
-
- if(vcg::tri::HasPerMeshAttribute(modelToMove->cm, PickedPoints::Key) )
- {
- CMeshO::PerMeshAttributeHandle ppHandle =
- vcg::tri::Allocator::GetPerMeshAttribute(modelToMove->cm, PickedPoints::Key);
-
- modelToMovePickedPoints = ppHandle();
-
- if(NULL == modelToMovePickedPoints){
- qDebug() << "problem casting to picked poitns";
- return false;
- }
- } else
- {
- QString ppFileName = PickedPoints::getSuggestedPickedPointsFileName(*modelToMove);
- QFileInfo file(ppFileName);
- if(file.exists())
- {
- modelToMovePickedPoints = new PickedPoints();
- bool success = modelToMovePickedPoints->open(ppFileName);
- if(!success){
- qDebug() << "failed to load modelToMove pick points";
- return false;
- }
- } else
- {
- qDebug() << "model to move points file didn't exist: " << ppFileName;
- //Log(GLLogStream::WARNING, "No points were found for the mesh to move.");
- return false;
- }
- }
- }
-
- bool result = AlignTools::align(stuckModel, stuckPickedPoints,
- modelToMove, modelToMovePickedPoints,
- 0, par);
-
- return result;
-}
-
-
-bool AlignTools::align(MeshModel *stuckModel, PickedPoints *stuckPickedPoints,
- MeshModel *modelToMove, PickedPoints *modelToMovePickedPoints,
- GLArea *modelToMoveGLArea,
- RichParameterSet &filterParameters,
- QWidget *parentWidget, bool confirm)
-{
- vcg::Matrix44f result;
-
- bool useMarkers = filterParameters.getBool(UseMarkers);
- bool allowScaling = filterParameters.getBool(AllowScaling);
- bool useICP = filterParameters.getBool(UseICP);
-
- if(useMarkers){
- //get the picked points
- std::vector *stuckPoints = stuckPickedPoints->getPoint3fVector();
- std::vector *meshToMovePoints = modelToMovePickedPoints->getPoint3fVector();
-
- //number of points are not the same so return false
- if(stuckPoints->size() != meshToMovePoints->size()) return false;
-
- //this will calculate the transform for the destination mesh model which we will be moving
- //into alignment with the source
- if(allowScaling)
- {
- qDebug() << "Scaling allowed";
- vcg::PointMatching::ComputeSimilarityMatchMatrix(result, *stuckPoints, *meshToMovePoints);
- } else
- vcg::PointMatching::ComputeRigidMatchMatrix(result, *stuckPoints, *meshToMovePoints);
-
- //set the transform
- modelToMove->cm.Tr = result;
-
- if(NULL != modelToMoveGLArea)
- modelToMoveGLArea->update();
- }
-
- if(useICP)
- {
- qDebug("Now on to ICP");
-
- //create a meshtree
- MeshTree meshTree;
- //put both meshes in it
- meshTree.nodeList.push_back(new MeshNode(stuckModel, 0));
- meshTree.nodeList.push_back(new MeshNode(modelToMove, 1));
-
- //set both to glued
- foreach(MeshNode *mn, meshTree.nodeList)
- mn->glued=true;
-
- vcg::AlignPair::Param ICPParameters;
-
- //get the parameter values
- AlignParameter::buildAlignParameters(filterParameters, ICPParameters);
-
- meshTree.Process(ICPParameters);
-
- qDebug() << "done with process for ICP";
-
- if(NULL != modelToMoveGLArea)
- modelToMoveGLArea->update();
-
- }
-
- if(useMarkers || useICP)
- {
-
- if(confirm && NULL != modelToMoveGLArea)
- {
- bool removeMeshAddedForQuestion = false;
-
- vcg::Color4b oldStuckColor;
- vcg::Color4b oldToMoveColor;
- vcg::GLW::ColorMode oldColorMode;
- //if the stuck model is not displayed next to the model to move,
- //then temporarily display it
- if(!modelToMoveGLArea->md()->meshList.contains(stuckModel))
- {
- removeMeshAddedForQuestion = true;
- modelToMoveGLArea->md()->meshList.push_back(stuckModel);
-
- //save the old colors
- oldStuckColor = stuckModel->cm.C();
- oldToMoveColor = modelToMove->cm.C();
- //set the color of the objects
- stuckModel->cm.C() = vcg::Color4b::LightBlue;
- modelToMove->cm.C() = vcg::Color4b::LightGray;
-
- //save the old colorMode
- oldColorMode = modelToMoveGLArea->rm.colorMode;
- //set the new colorMode
- modelToMoveGLArea->rm.colorMode = GLW::CMPerMesh;
-
- modelToMoveGLArea->update();
- }
-
- int returnValue = QMessageBox::question(parentWidget,
- "MeshLab", "Do you want accept this alignment?",
- QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
-
- //if we added the other model in for comparing
- if(removeMeshAddedForQuestion)
- {
- //remove the mesh that was added
- modelToMoveGLArea->md()->meshList.pop_back();
-
- //set back to how things were before
- stuckModel->cm.C() = oldStuckColor;
- modelToMove->cm.C() = oldToMoveColor;
- modelToMoveGLArea->rm.colorMode = oldColorMode;
-
- modelToMoveGLArea->update();
- }
-
- if(returnValue == QMessageBox::No)
- {
- modelToMove->cm.Tr.SetIdentity();
-
- modelToMoveGLArea->update();
-
- return false;
- }
- }
-
- //if there are points (may not be if you just used ICP
- if(NULL != modelToMovePickedPoints)
- {
- //now translate the picked points points
- modelToMovePickedPoints->translatePoints(modelToMove->cm.Tr);
-
- //update the metadata
- CMeshO::PerMeshAttributeHandle ppHandle =
- (vcg::tri::HasPerMeshAttribute(modelToMove->cm, PickedPoints::Key) ?
- vcg::tri::Allocator::GetPerMeshAttribute (modelToMove->cm, PickedPoints::Key) :
- vcg::tri::Allocator::AddPerMeshAttribute (modelToMove->cm, PickedPoints::Key) );
-
- ppHandle() = modelToMovePickedPoints;
- }
-
- //now save the transform as perMeshData so that we can undo it in the future
- CMeshO::PerMeshAttributeHandle transformHandle =
- (vcg::tri::HasPerMeshAttribute(modelToMove->cm, getKey()) ?
- vcg::tri::Allocator::GetPerMeshAttribute (modelToMove->cm, getKey()) :
- vcg::tri::Allocator::AddPerMeshAttribute (modelToMove->cm, getKey()) );
- transformHandle() = modelToMove->cm.Tr;
-
- //now translate all the points in the mesh
- //TODO probably should call a function to do this so if meshlab changes we don't have to
- //taken from meshlab/src/meshlabplugins/meshfilter/meshfilter.cpp
- //if (ID(filter) == (FP_FREEZE_TRANSFORM) ) {
- vcg::tri::UpdatePosition::Matrix(modelToMove->cm, modelToMove->cm.Tr);
- vcg::tri::UpdateNormals::PerVertexNormalizedPerFace(modelToMove->cm);
- vcg::tri::UpdateBounding::Box(modelToMove->cm);
- modelToMove->cm.Tr.SetIdentity();
-
- return true;
- } else
- {
- qDebug() << "you ran align without choosing a method";
- }
-
- return false;
-}
diff --git a/src/meshlabplugins/filter_clean/align_tools.h b/src/meshlabplugins/filter_clean/align_tools.h
deleted file mode 100644
index d821866bf..000000000
--- a/src/meshlabplugins/filter_clean/align_tools.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-* MeshLab o o *
-* An extendible mesh processor o o *
-* _ O _ *
-* Copyright(C) 2005, 2009 \/)\/ *
-* 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. *
-* *
-****************************************************************************/
-
-/*
- * This class will will hold useful things for doing alignment of meshes
- *
- * @author Oscar Barney
- *
- */
-
-#ifndef ALIGN_TOOLS_H
-#define ALIGN_TOOLS_H
-
-#include
-
-#include
-#include
-
-#include
-#include
-
-class AlignTools : public QObject
-{
- Q_OBJECT
-
-public:
- static const QString FilterName;
- static const QString UseMarkers;
- static const QString AllowScaling;
- static const QString UseICP;
- static const QString StuckMesh;
- static const QString MeshToMove;
-
- //make the default parameter set for this filter
- static void buildParameterSet(MeshDocument &md,RichParameterList & parlst);
-
- //setup all the parameters and then call align
- static bool setupThenAlign(MeshModel &mm, RichParameterList & par);
-
- /*
- * stuckModel - the mesh one that stays put
- * modelToMove - the mesh to be moved into place
- * modelToMoveGLArea - so we can update the position of the model
- * parentWidget - the widget that should be the parent of the confirm dialog window
- * confirm - whether to ask the user if they want the alignment to stay put
- *
- * return value - true if align was accepted or successful
- */
- static bool align(MeshModel *stuckModel, PickedPoints *stuckPickedPoints,
- MeshModel *modelToMove, PickedPoints *modelToMovePickedPoints,
- GLArea *modelToMoveGLArea,
- RichParameterList ¶meters,
- QWidget *parentWidget = 0, bool confirm = false);
-
- //returns the key applied if this transform is stored to perMeshAttribute
- static const std::string getKey() { return "TransformAppliedKey"; }
-
-protected:
- AlignTools();
-
-};
-
-#endif
diff --git a/src/meshlabplugins/filter_clean/cleanfilter.cpp b/src/meshlabplugins/filter_clean/cleanfilter.cpp
index 447c7d6bc..efded8c10 100644
--- a/src/meshlabplugins/filter_clean/cleanfilter.cpp
+++ b/src/meshlabplugins/filter_clean/cleanfilter.cpp
@@ -22,7 +22,6 @@
****************************************************************************/
#include "cleanfilter.h"
-#include "align_tools.h"
#include
#include
@@ -37,7 +36,7 @@ int SnapVertexBorder(CMeshO &m, float threshold,vcg::CallBackPos * cb);
CleanFilter::CleanFilter()
{
- typeList
+ typeList
<< FP_BALL_PIVOTING
<< FP_REMOVE_WRT_Q
<< FP_REMOVE_ISOLATED_COMPLEXITY
@@ -54,14 +53,13 @@ CleanFilter::CleanFilter()
<< FP_REMOVE_DUPLICATED_VERTEX
<< FP_REMOVE_FACE_ZERO_AREA
<< FP_MERGE_CLOSE_VERTEX
- << FP_MERGE_WEDGE_TEX
+ << FP_MERGE_WEDGE_TEX
<< FP_COMPACT_FACE
<< FP_COMPACT_VERT;
- FilterIDType tt;
- foreach(tt , types())
- actionList << new QAction(filterName(tt), this);
- getFilterAction(FP_SNAP_MISMATCHED_BORDER)->setShortcut(QKeySequence("ALT+`"));
+ for(FilterIDType tt : types())
+ actionList << new QAction(filterName(tt), this);
+ getFilterAction(FP_SNAP_MISMATCHED_BORDER)->setShortcut(QKeySequence("ALT+`"));
}
CleanFilter::~CleanFilter() {
diff --git a/src/meshlabplugins/filter_clean/parameter.h b/src/meshlabplugins/filter_clean/parameter.h
deleted file mode 100644
index ed457b806..000000000
--- a/src/meshlabplugins/filter_clean/parameter.h
+++ /dev/null
@@ -1,12 +0,0 @@
-class Parameter : QWidget
-{
- public:
-
- void addBool();
- void addOption()
- void addFloat();
- void addRangedFloat();
-
- exec
-};
-
diff --git a/src/meshlabplugins/filter_mls/CMakeLists.txt b/src/meshlabplugins/filter_mls/CMakeLists.txt
index ff58e2d28..1b72f2c17 100644
--- a/src/meshlabplugins/filter_mls/CMakeLists.txt
+++ b/src/meshlabplugins/filter_mls/CMakeLists.txt
@@ -6,20 +6,29 @@
### or create a derived template in src/templates/filter_mls.cmake,
### then re-run ./make-cmake.py
-set(SOURCES apss.cpp balltree.cpp mlsplugin.cpp rimls.cpp)
+set(SOURCES
+ apss.cpp
+ balltree.cpp
+ mlsplugin.cpp
+ rimls.cpp)
set(HEADERS
- apss.h
- balltree.h
- implicits.h
- mlsmarchingcube.h
- mlsplugin.h
- mlssurface.h
- priorityqueue.h
- rimls.h
- smallcomponentselection.h)
+ apss.h
+ balltree.h
+ implicits.h
+ mlsmarchingcube.h
+ mlsplugin.h
+ mlssurface.h
+ priorityqueue.h
+ rimls.h
+ smallcomponentselection.h)
-add_library(filter_mls MODULE ${SOURCES} ${HEADERS})
+SET(TPP_HEADERS
+ apss.tpp
+ mlssurface.tpp
+ rimls.tpp)
+
+add_library(filter_mls MODULE ${SOURCES} ${HEADERS} ${TPP_HEADERS})
target_include_directories(filter_mls PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(filter_mls PUBLIC common)
diff --git a/src/meshlabplugins/filter_mutualglobal/CMakeLists.txt b/src/meshlabplugins/filter_mutualglobal/CMakeLists.txt
index fa096a29e..0ba4c9c02 100644
--- a/src/meshlabplugins/filter_mutualglobal/CMakeLists.txt
+++ b/src/meshlabplugins/filter_mutualglobal/CMakeLists.txt
@@ -8,51 +8,52 @@
# Only build if we have newuoa and levmar
if(TARGET external-newuoa AND TARGET external-levmar)
- set(SOURCES
- alignset.cpp
- filter_mutualglobal.cpp
- levmarmethods.cpp
- mutual.cpp
- parameters.cpp
- pointCorrespondence.cpp
- solver.cpp)
+ set(SOURCES
+ alignset.cpp
+ filter_mutualglobal.cpp
+ levmarmethods.cpp
+ mutual.cpp
+ parameters.cpp
+ pointCorrespondence.cpp
+ solver.cpp)
- set(HEADERS
- alignset.h
- filter_mutualglobal.h
- levmarmethods.h
- mutual.h
- parameters.h
- pointCorrespondence.h
- pointOnLayer.h
- shutils.h
- solver.h)
+ set(HEADERS
+ alignset.h
+ alignGlobal.h
+ filter_mutualglobal.h
+ levmarmethods.h
+ mutual.h
+ parameters.h
+ pointCorrespondence.h
+ pointOnLayer.h
+ shutils.h
+ solver.h)
- add_library(filter_mutualglobal MODULE ${SOURCES} ${HEADERS})
+ add_library(filter_mutualglobal MODULE ${SOURCES} ${HEADERS})
- target_include_directories(filter_mutualglobal
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
- target_link_libraries(filter_mutualglobal PUBLIC common)
+ target_include_directories(filter_mutualglobal
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
+ target_link_libraries(filter_mutualglobal PUBLIC common)
- target_link_libraries(filter_mutualglobal PRIVATE external-newuoa
- external-levmar)
+ target_link_libraries(filter_mutualglobal PRIVATE external-newuoa
+ external-levmar)
- set_property(TARGET filter_mutualglobal PROPERTY FOLDER Plugins)
+ set_property(TARGET filter_mutualglobal PROPERTY FOLDER Plugins)
- set_property(TARGET filter_mutualglobal
- PROPERTY RUNTIME_OUTPUT_DIRECTORY ${MESHLAB_PLUGIN_OUTPUT_DIR})
+ set_property(TARGET filter_mutualglobal
+ PROPERTY RUNTIME_OUTPUT_DIRECTORY ${MESHLAB_PLUGIN_OUTPUT_DIR})
- set_property(TARGET filter_mutualglobal
- PROPERTY LIBRARY_OUTPUT_DIRECTORY ${MESHLAB_PLUGIN_OUTPUT_DIR})
+ set_property(TARGET filter_mutualglobal
+ PROPERTY LIBRARY_OUTPUT_DIRECTORY ${MESHLAB_PLUGIN_OUTPUT_DIR})
- install(
- TARGETS filter_mutualglobal
- DESTINATION ${MESHLAB_PLUGIN_INSTALL_DIR}
- COMPONENT Plugins)
+ install(
+ TARGETS filter_mutualglobal
+ DESTINATION ${MESHLAB_PLUGIN_INSTALL_DIR}
+ COMPONENT Plugins)
else()
- message(
- STATUS
- "Skipping filter_mutualglobal - missing either newuoa or levmar in external directory."
- )
+ message(
+ STATUS
+ "Skipping filter_mutualglobal - missing either newuoa or levmar in external directory."
+ )
endif()
diff --git a/src/meshlabplugins/filter_mutualglobal/alignGlobal.cpp b/src/meshlabplugins/filter_mutualglobal/alignGlobal.cpp
deleted file mode 100644
index c797fcdbb..000000000
--- a/src/meshlabplugins/filter_mutualglobal/alignGlobal.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/****************************************************************************
-* MeshLab o o *
-* A versatile mesh processing toolbox o o *
-* _ O _ *
-* Copyright(C) 2005 \/)\/ *
-* 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. *
-* *
-****************************************************************************/
-
-#include "alignGlobal.h"
-
-#include "alignset.h"
-#include "solver.h"
-#include "mutual.h"
-
-
-//#include "shutils.h"
-
-#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_mutualglobal/alignset.h b/src/meshlabplugins/filter_mutualglobal/alignset.h
index 616213e1d..3b94e135d 100644
--- a/src/meshlabplugins/filter_mutualglobal/alignset.h
+++ b/src/meshlabplugins/filter_mutualglobal/alignset.h
@@ -42,7 +42,7 @@ class AlignSet {
double error; //alignment error in px
QImage rend;
QImage comb;
- Node* node;
+ //Node* node;
std::vector arcImages;
std::vector*> arcShots;
std::vector arcMI;
diff --git a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp
index e0deeaefe..dcf0e5e6c 100644
--- a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp
+++ b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp
@@ -878,7 +878,7 @@ bool FilterMutualGlobal::AlignNode(MeshDocument &md, Node node)
MutualInfo mutual;
alignset.mode=AlignSet::NODE;
- alignset.node=&node;
+ //alignset.node=&node;
alignset.image=&md.rasterList[node.id]->currentPlane->image;
alignset.shot=md.rasterList[node.id]->shot;
diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.cpp b/src/meshlabplugins/filter_plymc/filter_plymc.cpp
index f8880a01f..2cd432773 100644
--- a/src/meshlabplugins/filter_plymc/filter_plymc.cpp
+++ b/src/meshlabplugins/filter_plymc/filter_plymc.cpp
@@ -37,10 +37,10 @@ using namespace vcg;
PlyMCPlugin::PlyMCPlugin()
{
typeList
- << FP_PLYMC
- << FP_MC_SIMPLIFY
- ;
-
+ << FP_PLYMC
+ << FP_MC_SIMPLIFY
+ ;
+
foreach(FilterIDType tt , types())
actionList << new QAction(filterName(tt), this);
}
@@ -52,44 +52,44 @@ QString PlyMCPlugin::pluginName() const
// ST() must return the very short string describing each filtering action
// (this string is used also to define the menu entry)
- QString PlyMCPlugin::filterName(FilterIDType filterId) const
+QString PlyMCPlugin::filterName(FilterIDType filterId) const
{
switch(filterId)
{
- case FP_PLYMC : return QString("Surface Reconstruction: VCG");
- case FP_MC_SIMPLIFY : return QString("Simplfication: Edge Collapse for Marching Cube meshes");
- default : assert(0);
+ case FP_PLYMC : return QString("Surface Reconstruction: VCG");
+ case FP_MC_SIMPLIFY : return QString("Simplification: Edge Collapse for Marching Cube meshes");
+ default : assert(0);
}
- return {};
+ return {};
}
// Info() must return the longer string describing each filtering action
// (this string is used in the About plugin dialog)
- QString PlyMCPlugin::filterInfo(FilterIDType filterId) const
+QString PlyMCPlugin::filterInfo(FilterIDType filterId) const
{
switch(filterId)
{
- 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.");
- case FP_MC_SIMPLIFY : return QString( "A simplification/cleaning algorithm that works ONLY on meshes generated by Marching Cubes algorithm." );
-
- default : assert(0);
- }
- return QString("Unknown Filter");
+ 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.");
+ case FP_MC_SIMPLIFY : return QString( "A simplification/cleaning algorithm that works ONLY on meshes generated by Marching Cubes algorithm." );
+
+ default : assert(0);
+ }
+ return QString("Unknown Filter");
}
// 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(const QAction *a) const
+PlyMCPlugin::FilterClass PlyMCPlugin::getClass(const QAction *a) const
{
switch(ID(a))
{
- case FP_PLYMC : return FilterPluginInterface::Remeshing;
- case FP_MC_SIMPLIFY : return FilterPluginInterface::Remeshing;
- default : assert(0);
+ case FP_PLYMC : return FilterPluginInterface::Remeshing;
+ case FP_MC_SIMPLIFY : return FilterPluginInterface::Remeshing;
+ default : assert(0);
}
return FilterPluginInterface::Generic;
}
@@ -103,157 +103,157 @@ QString PlyMCPlugin::pluginName() const
// - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog)
void PlyMCPlugin::initParameterList(const QAction *action,MeshModel &m, RichParameterList & parlst)
{
- switch(ID(action))
- {
- case FP_PLYMC :
- parlst.addParam(RichAbsPerc("voxSize",m.cm.bbox.Diag()/100.0,0,m.cm.bbox.Diag(),"Voxel Side", "VoxelSide"));
- parlst.addParam( RichInt("subdiv",1,"SubVol Splitting","The level of recursive splitting of the subvolume reconstruction process. A value of '3' means that a 3x3x3 regular space subdivision is created and the reconstruction process generate 8 matching meshes. It is useful for reconsruction objects at a very high resolution. Default value (1) means no splitting."));
- parlst.addParam( RichFloat("geodesic",2.0,"Geodesic Weighting","The influence of each range map is weighted with its geodesic distance from the borders. In this way when two (or more ) range maps overlaps their contribution blends smoothly hiding possible misalignments. "));
- parlst.addParam( RichBool("openResult",true,"Show Result","if not checked the result is only saved into the current directory"));
- parlst.addParam( RichInt("smoothNum",1,"Volume Laplacian iter","How many volume smoothing step are performed to clean out the eventually noisy borders"));
- parlst.addParam( RichInt("wideNum",3,"Widening" ," How many voxel the field is expanded. Larger this value more holes will be filled"));
- parlst.addParam( RichBool("mergeColor",false,"Vertex Splatting","This option use a different way to build up the volume, instead of using rasterization of the triangular face it splat the vertices into the grids. It works under the assumption that you have at least one sample for each voxel of your reconstructed volume."));
- parlst.addParam( RichBool("simplification",false,"Post Merge simplification","After the merging an automatic simplification step is performed."));
- parlst.addParam( RichInt("normalSmooth",3,"PreSmooth iter" ,"How many times, before converting meshes into volume, the normal of the surface are smoothed. It is useful only to get more smooth expansion in case of noisy borders."));
- break;
- case FP_MC_SIMPLIFY :
- break;
- default: break; // do not add any parameter for the other filters
- }
+ switch(ID(action))
+ {
+ case FP_PLYMC :
+ parlst.addParam(RichAbsPerc("voxSize",m.cm.bbox.Diag()/100.0,0,m.cm.bbox.Diag(),"Voxel Side", "VoxelSide"));
+ parlst.addParam( RichInt("subdiv",1,"SubVol Splitting","The level of recursive splitting of the subvolume reconstruction process. A value of '3' means that a 3x3x3 regular space subdivision is created and the reconstruction process generate 8 matching meshes. It is useful for reconsruction objects at a very high resolution. Default value (1) means no splitting."));
+ parlst.addParam( RichFloat("geodesic",2.0,"Geodesic Weighting","The influence of each range map is weighted with its geodesic distance from the borders. In this way when two (or more ) range maps overlaps their contribution blends smoothly hiding possible misalignments. "));
+ parlst.addParam( RichBool("openResult",true,"Show Result","if not checked the result is only saved into the current directory"));
+ parlst.addParam( RichInt("smoothNum",1,"Volume Laplacian iter","How many volume smoothing step are performed to clean out the eventually noisy borders"));
+ parlst.addParam( RichInt("wideNum",3,"Widening" ," How many voxel the field is expanded. Larger this value more holes will be filled"));
+ parlst.addParam( RichBool("mergeColor",false,"Vertex Splatting","This option use a different way to build up the volume, instead of using rasterization of the triangular face it splat the vertices into the grids. It works under the assumption that you have at least one sample for each voxel of your reconstructed volume."));
+ parlst.addParam( RichBool("simplification",false,"Post Merge simplification","After the merging an automatic simplification step is performed."));
+ parlst.addParam( RichInt("normalSmooth",3,"PreSmooth iter" ,"How many times, before converting meshes into volume, the normal of the surface are smoothed. It is useful only to get more smooth expansion in case of noisy borders."));
+ break;
+ case FP_MC_SIMPLIFY :
+ break;
+ default: break; // do not add any parameter for the other filters
+ }
}
// The Real Core Function doing the actual mesh processing.
bool PlyMCPlugin::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos * cb)
{
- switch(ID(filter))
- {
- case FP_PLYMC:
- {
- srand(time(NULL));
-
- //check if folder is writable
- QTemporaryFile file("./_tmp_XXXXXX.tmp");
- if (!file.open())
+ switch(ID(filter))
{
- log("ERROR - current folder is not writable. VCG 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.");
- errorMessage = "current folder is not writable.
VCG 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;
+ case FP_PLYMC:
+ {
+ srand(time(NULL));
+
+ //check if folder is writable
+ QTemporaryFile file("./_tmp_XXXXXX.tmp");
+ if (!file.open())
+ {
+ log("ERROR - current folder is not writable. VCG 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.");
+ errorMessage = "current folder is not writable.
VCG 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;
+ }
+
+ tri::PlyMC > pmc;
+ pmc.MP.setCacheSize(64);
+ tri::PlyMC >::Parameter &p = pmc.p;
+
+ int subdiv=par.getInt("subdiv");
+
+ p.IDiv=Point3i(subdiv,subdiv,subdiv);
+ p.IPosS=Point3i(0,0,0);
+ p.IPosE[0]=p.IDiv[0]-1; p.IPosE[1]=p.IDiv[1]-1; p.IPosE[2]=p.IDiv[2]-1;
+ printf("AutoComputing all subVolumes on a %ix%ix%i\n",p.IDiv[0],p.IDiv[1],p.IDiv[2]);
+
+ p.VoxSize=par.getAbsPerc("voxSize");
+ p.QualitySmoothVox = par.getFloat("geodesic");
+ p.SmoothNum = par.getInt("smoothNum");
+ p.WideNum = par.getInt("wideNum");
+ p.NCell=0;
+ p.FullyPreprocessedFlag=true;
+ p.MergeColor=p.VertSplatFlag=par.getBool("mergeColor");
+ p.SimplificationFlag = par.getBool("simplification");
+ foreach(MeshModel*mm, md.meshList)
+ {
+ if(mm->visible)
+ {
+ SMesh sm;
+ mm->updateDataMask(MeshModel::MM_FACEQUALITY);
+ tri::Append::Mesh(sm, mm->cm/*,false,p.VertSplatFlag*/); // note the last parameter of the append to prevent removal of unreferenced vertices...
+ tri::UpdatePosition::Matrix(sm, Matrix44f::Construct(mm->cm.Tr),true);
+ tri::UpdateBounding::Box(sm);
+ tri::UpdateNormal::NormalizePerVertex(sm);
+ tri::UpdateTopology::VertexFace(sm);
+ tri::UpdateFlags::VertexBorderFromNone(sm);
+ tri::Geodesic::DistanceFromBorder(sm);
+ for(int i=0;i::FaceNormalLaplacianVF(sm);
+ //QString mshTmpPath=QDir::tempPath()+QString("/")+QString(mm->shortName())+QString(".vmi");
+ QString mshTmpPath=QString("__TMP")+QString(mm->shortName())+QString(".vmi");
+ qDebug("Saving tmp file %s",qUtf8Printable(mshTmpPath));
+ int retVal = tri::io::ExporterVMI::Save(sm,qUtf8Printable(mshTmpPath) );
+ if(retVal!=0)
+ {
+ qDebug("Failed to write vmi temp file %s",qUtf8Printable(mshTmpPath));
+ errorMessage = "Failed to write vmi temp file " + mshTmpPath;
+ log("ERROR - Failed to write vmi temp file %s", qUtf8Printable(mshTmpPath));
+ return false;
+ }
+ pmc.MP.AddSingleMesh(qUtf8Printable(mshTmpPath));
+ log("Preprocessing mesh %s",qUtf8Printable(mm->shortName()));
+ }
+ }
+
+ if(pmc.Process(cb)==false)
+ {
+ this->errorMessage = pmc.errorMessage;
+ return false;
+ }
+
+
+ if(par.getBool("openResult"))
+ {
+ for(size_t i=0;i::Open(mp->cm,name.c_str(),loadMask);
+ if(p.MergeColor) mp->updateDataMask(MeshModel::MM_VERTCOLOR);
+ mp->updateDataMask(MeshModel::MM_VERTQUALITY);
+ mp->UpdateBoxAndNormals();
+ }
+ }
+
+ for(int i=0;i(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.");
+ errorMessage = "Cannot simplify: this is not a Marching Cube -generated mesh.";
+ mm.clearDataMask(MeshModel::MM_VERTFACETOPO);
+ mm.clearDataMask(MeshModel::MM_FACEFACETOPO);
+ return false;
+ }
+
+ tri::Allocator::CompactFaceVector(mm.cm);
+ tri::Clean::RemoveTVertexByFlip(mm.cm,20,true);
+ tri::Clean::RemoveFaceFoldByFlip(mm.cm);
+ mm.clearDataMask(MeshModel::MM_VERTFACETOPO);
+ mm.clearDataMask(MeshModel::MM_FACEFACETOPO);
}
-
- tri::PlyMC > pmc;
- pmc.MP.setCacheSize(64);
- tri::PlyMC >::Parameter &p = pmc.p;
-
- int subdiv=par.getInt("subdiv");
-
- p.IDiv=Point3i(subdiv,subdiv,subdiv);
- p.IPosS=Point3i(0,0,0);
- p.IPosE[0]=p.IDiv[0]-1; p.IPosE[1]=p.IDiv[1]-1; p.IPosE[2]=p.IDiv[2]-1;
- printf("AutoComputing all subVolumes on a %ix%ix%i\n",p.IDiv[0],p.IDiv[1],p.IDiv[2]);
-
- p.VoxSize=par.getAbsPerc("voxSize");
- p.QualitySmoothVox = par.getFloat("geodesic");
- p.SmoothNum = par.getInt("smoothNum");
- p.WideNum = par.getInt("wideNum");
- p.NCell=0;
- p.FullyPreprocessedFlag=true;
- p.MergeColor=p.VertSplatFlag=par.getBool("mergeColor");
- p.SimplificationFlag = par.getBool("simplification");
- foreach(MeshModel*mm, md.meshList)
- {
- if(mm->visible)
- {
- SMesh sm;
- mm->updateDataMask(MeshModel::MM_FACEQUALITY);
- tri::Append::Mesh(sm, mm->cm/*,false,p.VertSplatFlag*/); // note the last parameter of the append to prevent removal of unreferenced vertices...
- tri::UpdatePosition::Matrix(sm, Matrix44f::Construct(mm->cm.Tr),true);
- tri::UpdateBounding::Box(sm);
- tri::UpdateNormal::NormalizePerVertex(sm);
- tri::UpdateTopology::VertexFace(sm);
- tri::UpdateFlags::VertexBorderFromNone(sm);
- tri::Geodesic::DistanceFromBorder(sm);
- for(int i=0;i::FaceNormalLaplacianVF(sm);
- //QString mshTmpPath=QDir::tempPath()+QString("/")+QString(mm->shortName())+QString(".vmi");
- QString mshTmpPath=QString("__TMP")+QString(mm->shortName())+QString(".vmi");
- qDebug("Saving tmp file %s",qUtf8Printable(mshTmpPath));
- int retVal = tri::io::ExporterVMI::Save(sm,qUtf8Printable(mshTmpPath) );
- if(retVal!=0)
- {
- qDebug("Failed to write vmi temp file %s",qUtf8Printable(mshTmpPath));
- errorMessage = "Failed to write vmi temp file " + mshTmpPath;
- log("ERROR - Failed to write vmi temp file %s", qUtf8Printable(mshTmpPath));
- return false;
- }
- pmc.MP.AddSingleMesh(qUtf8Printable(mshTmpPath));
- log("Preprocessing mesh %s",qUtf8Printable(mm->shortName()));
- }
- }
-
- if(pmc.Process(cb)==false)
- {
- this->errorMessage = pmc.errorMessage;
- return false;
- }
-
-
- if(par.getBool("openResult"))
- {
- for(size_t i=0;i::Open(mp->cm,name.c_str(),loadMask);
- if(p.MergeColor) mp->updateDataMask(MeshModel::MM_VERTCOLOR);
- mp->updateDataMask(MeshModel::MM_VERTQUALITY);
- mp->UpdateBoxAndNormals();
- }
- }
-
- for(int i=0;i(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.");
- errorMessage = "Cannot simplify: this is not a Marching Cube -generated mesh.";
- mm.clearDataMask(MeshModel::MM_VERTFACETOPO);
- mm.clearDataMask(MeshModel::MM_FACEFACETOPO);
- return false;
- }
-
- tri::Allocator::CompactFaceVector(mm.cm);
- tri::Clean::RemoveTVertexByFlip(mm.cm,20,true);
- tri::Clean::RemoveFaceFoldByFlip(mm.cm);
- mm.clearDataMask(MeshModel::MM_VERTFACETOPO);
- mm.clearDataMask(MeshModel::MM_FACEFACETOPO);
- }
-
- }
- return true;
+
+ }
+ return true;
}
FilterPluginInterface::FILTER_ARITY PlyMCPlugin::filterArity(const QAction * filter ) const
{
switch(ID(filter))
{
- case FP_PLYMC : return FilterPluginInterface::VARIABLE;
- case FP_MC_SIMPLIFY : return FilterPluginInterface::SINGLE_MESH;
- default: return FilterPluginInterface::NONE;
+ case FP_PLYMC : return FilterPluginInterface::VARIABLE;
+ case FP_MC_SIMPLIFY : return FilterPluginInterface::SINGLE_MESH;
+ default: return FilterPluginInterface::NONE;
}
}
@@ -261,9 +261,9 @@ int PlyMCPlugin::postCondition(const QAction * filter) const
{
switch (ID(filter))
{
- case FP_PLYMC: return MeshModel::MM_NONE; // no change to old layers
- case FP_MC_SIMPLIFY: return MeshModel::MM_GEOMETRY_AND_TOPOLOGY_CHANGE;
- default: return MeshModel::MM_ALL;
+ case FP_PLYMC: return MeshModel::MM_NONE; // no change to old layers
+ case FP_MC_SIMPLIFY: return MeshModel::MM_GEOMETRY_AND_TOPOLOGY_CHANGE;
+ default: return MeshModel::MM_ALL;
}
}
diff --git a/src/meshlabplugins/filter_screened_poisson/CMakeLists.txt b/src/meshlabplugins/filter_screened_poisson/CMakeLists.txt
index c9bb79c0c..7b8be5031 100644
--- a/src/meshlabplugins/filter_screened_poisson/CMakeLists.txt
+++ b/src/meshlabplugins/filter_screened_poisson/CMakeLists.txt
@@ -6,58 +6,78 @@
### then re-run ./make-cmake.py
set(SOURCES
- filter_screened_poisson.cpp Src/MarchingCubes.cpp
- # Src/CmdLineParser.cpp
- Src/Factor.cpp Src/Geometry.cpp)
+ filter_screened_poisson.cpp Src/MarchingCubes.cpp
+ # Src/CmdLineParser.cpp
+ Src/Factor.cpp Src/Geometry.cpp)
set(HEADERS
- Src/Allocator.h
- Src/Array.h
- Src/BSplineData.h
- Src/BinaryNode.h
- Src/CmdLineParser.h
- Src/Factor.h
- Src/FunctionData.h
- Src/Geometry.h
- Src/Hash.h
- Src/MAT.h
- Src/MarchingCubes.h
- Src/MemoryUsage.h
- Src/MultiGridOctreeData.h
- Src/MyTime.h
- Src/Octree.h
- Src/PPolynomial.h
- Src/PlyVertexMini.h
- Src/PointStream.h
- Src/Polynomial.h
- Src/SparseMatrix.h
- Src/Time.h
- Src/Vector.h
- filter_screened_poisson.h
- poisson_utils.h)
+ Src/Allocator.h
+ Src/Array.h
+ Src/BSplineData.h
+ Src/BinaryNode.h
+ Src/CmdLineParser.h
+ Src/Factor.h
+ Src/FunctionData.h
+ Src/Geometry.h
+ Src/Hash.h
+ Src/MAT.h
+ Src/MarchingCubes.h
+ Src/MemoryUsage.h
+ Src/MultiGridOctreeData.h
+ Src/MyTime.h
+ Src/Octree.h
+ Src/PPolynomial.h
+ Src/PlyVertexMini.h
+ Src/PointStream.h
+ Src/Polynomial.h
+ Src/SparseMatrix.h
+ Src/Time.h
+ Src/Vector.h
+ filter_screened_poisson.h
+ poisson_utils.h)
-add_library(filter_screened_poisson MODULE ${SOURCES} ${HEADERS})
+set(INL_HEADERS
+ Src/Array.inl
+ Src/BSplineData.inl
+ Src/CmdLineParser.inl
+ Src/FunctionData.inl
+ Src/Geometry.inl
+ Src/MAT.inl
+ Src/MultiGridOctreeData.Evaluation.inl
+ Src/MultiGridOctreeData.inl
+ Src/MultiGridOctreeData.IsoSurface.inl
+ Src/MultiGridOctreeData.SortedTreeNodes.inl
+ Src/MultiGridOctreeData.System.inl
+ Src/MultiGridOctreeData.WeightedSamples.inl
+ Src/Octree.inl
+ Src/PointStream.inl
+ Src/Polynomial.inl
+ Src/PPolynomial.inl
+ Src/SparseMatrix.inl
+ Src/Vector.inl)
+
+add_library(filter_screened_poisson MODULE ${SOURCES} ${HEADERS} ${INL_HEADERS})
target_compile_definitions(filter_screened_poisson PRIVATE BRUNO_LEVY_FIX
- FOR_RELEASE)
+ FOR_RELEASE)
if(OpenMP_CXX_FOUND)
- target_link_libraries(filter_screened_poisson PRIVATE OpenMP::OpenMP_CXX)
+ target_link_libraries(filter_screened_poisson PRIVATE OpenMP::OpenMP_CXX)
endif()
target_include_directories(filter_screened_poisson
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(filter_screened_poisson PUBLIC common)
set_property(TARGET filter_screened_poisson PROPERTY FOLDER Plugins)
set_property(TARGET filter_screened_poisson
- PROPERTY RUNTIME_OUTPUT_DIRECTORY ${MESHLAB_PLUGIN_OUTPUT_DIR})
+ PROPERTY RUNTIME_OUTPUT_DIRECTORY ${MESHLAB_PLUGIN_OUTPUT_DIR})
set_property(TARGET filter_screened_poisson
- PROPERTY LIBRARY_OUTPUT_DIRECTORY ${MESHLAB_PLUGIN_OUTPUT_DIR})
+ PROPERTY LIBRARY_OUTPUT_DIRECTORY ${MESHLAB_PLUGIN_OUTPUT_DIR})
install(
- TARGETS filter_screened_poisson
- DESTINATION ${MESHLAB_PLUGIN_INSTALL_DIR}
- COMPONENT Plugins)
+ TARGETS filter_screened_poisson
+ DESTINATION ${MESHLAB_PLUGIN_INSTALL_DIR}
+ COMPONENT Plugins)
diff --git a/src/meshlabplugins/filter_texture/filter_texture_old.cpp b/src/meshlabplugins/filter_texture/filter_texture_old.cpp
deleted file mode 100644
index c240cdca6..000000000
--- a/src/meshlabplugins/filter_texture/filter_texture_old.cpp
+++ /dev/null
@@ -1,430 +0,0 @@
-/****************************************************************************
-* MeshLab o o *
-* A versatile mesh processing toolbox o o *
-* _ O _ *
-* Copyright(C) 2005 \/)\/ *
-* 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. *
-* *
-****************************************************************************/
-/****************************************************************************
- History
-$Log: samplefilter.cpp,v $
-****************************************************************************/
-
-#include
-#include
-#include
-
-#include
-#include
-
-#include
-#include
-
-#include "filter_texture.h"
-
-using namespace vcg;
-using namespace std;
-// 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
-
-FilterTexturePlugin::FilterTexturePlugin()
-{
- typeList << FP_MAKE_ATLAS;
-
- foreach(FilterIDType tt , types())
- actionList << new QAction(filterName(tt), this);
-}
-
-// ST() must return the very short string describing each filtering action
-// (this string is used also to define the menu entry)
-const QString FilterTexturePlugin::filterName(FilterIDType filterId)
-{
- switch(filterId) {
- case FP_MAKE_ATLAS : return QString("Build texture atlas");
- default : assert(0);
- }
-}
-
-// Info() must return the longer string describing each filtering action
-// (this string is used in the About plugin dialog)
-const QString FilterTexturePlugin::filterInfo(FilterIDType filterId)
-{
- switch(filterId) {
- case FP_MAKE_ATLAS : return QString("Compact all the texture of multitextured mesh into a single atlas");
- default : assert(0);
- }
-}
-
-// 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
-// For each parameter you need to define,
-// - the name of the parameter,
-// - 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,MeshModel &m, FilterParameterSet &parlst)
-{
- switch(ID(action)) {
- default :
- parlst.addInt ("Xmax",4096,"Maximum width of texture atlas");// values are large enough so realistically should never have to resize to get the textures to fit in. empty space in the encoded texture atlas image will not affect PNG file size, and can be cropped out later if desired
- parlst.addInt ("Ymax",4096,"Maximum height of texture atlas");//add to parList
- QStringList algoList;
- algoList.push_front("resampled tiles");
- algoList.push_front("copied tiles");
- parlst.addEnum( "algoList", 0, algoList, "which algorithm to use for the texture atlas", "choose the algorithm to use for the texture atlas" );//use high resolution atlas (large file size that copies repeated tiles) or lowest-common-denominator resolution (smaller file size that resamples repeated tiles into the original space for its dimensions)
- }
-}
-//this function determines the maximum u & v coordinates for each texture, by iterating through every face in the model. this is needed because it is common for models to have UV coordinates outside of the normalized range 0-1 in order to repeat the texture. this becomes a problem when we try to stitch all the textures together into one texture atlas (the solution is to copy the texture however many times is necessary to encompass the maximum UV coords, or to clip triangles - we currently only support tiling. to clip triangles you need to look at the refine.h, edgelen class). if a model of a wall has a texture tiled 30x along the U and 40x along the V, there is no need to tile the texture 30 and 40 times because each triangle will only span over a few copies of the texture, so we tile based on the maximum span of each polygon
-void FilterTexturePlugin::maxFaceSpan(int &c, float maxdiffUV[][2], MeshModel &m, int &mat, CMeshO::FaceIterator &fit)//c++ passes arrays by reference, don't need &
-{
- int whole;
- float dec, diff1,diff2,diff3;//'dec' stores decimal components
- for (fit=m.cm.face.begin(); fit != m.cm.face.end(); ++fit)//iterate through faces with textures
- {
- mat = fit->WT(0).N();//fit->cWT the 'c' is for const
- if (mat!=-1)//only do this for faces with textures
- {//you have 3 vertices in every triangle, so we determine the difference between the uv coordinates of all 3 combinations to find the maximum
- //first thing to do is to transform negative UV coords into positive ones, to make life simpler
- //way to do this is to negate the whole number component, and to do (1-decimal component)
- //need to do this BEFORE calculate maximum spans (maxdiffUV) otherwise will have incorrect span: ie -1.4 to 0 different distance than 1.6 to 0
- /*for (c= 0; c < 3;++c)//UVs are per-vertex
- {
- if (fit->WT(c).U()<0)//is negative
- {
- whole = int(fit->WT(c).U());//cast to integer. -0.9 -> 0, or -1.4 -> -1
- //qDebug() << "correcting negative:" << fit->WT(c).U() << "to";
- dec = fit->WT(c).U() - whole;//-.9, or -.4
- fit->WT(c).U() = abs(whole)+(1+dec);//0 + (1+-.9) = 0.1, or 1 + (1+-.4) = 1.6
- //qDebug() << fit->WT(c).U() << endl;
- }
- if (fit->WT(c).V()<0)//is negative
- {
- whole = int(fit->WT(c).V());//cast to integer. -0.9 -> 0, or -1.4 -> -1
- //qDebug() << "correcting negative:" << fit->WT(c).U() << "to";
- dec = fit->WT(c).V() - whole;//-.9, or -.4
- fit->WT(c).V() = abs(whole)+(1+dec);//0 + (1+-.9) = 0.1, or 1 + (1+-.4) = 1.6
- //qDebug() << fit->WT(c).U() << endl;
- }
- }*/
-
- //need fabs() to ensure result of subtraction is positive
- diff1 = fabs(fit->WT(0).U() - fit->WT(1).U());//fabs is floating-point absolute value function call
- diff2 = fabs(fit->WT(1).U() - fit->WT(2).U());
- diff3 = fabs(fit->WT(0).U() - fit->WT(2).U());
- //find the max of the first two, then the max of that result and diff3, then the max of that with the previous highest diffUV value
- //(so end up storing the highest span across all faces that use that material)
- maxdiffUV[mat][0] = max(maxdiffUV[mat][0],max(max(diff1, diff2),diff3));
- //now do the same for the v-coordinate
- diff1 = fabs(fit->WT(0).V() - fit->WT(1).V());
- diff2 = fabs(fit->WT(1).V() - fit->WT(2).V());
- diff3 = fabs(fit->WT(0).V() - fit->WT(2).V());
- maxdiffUV[mat][1] = max(maxdiffUV[mat][1],max(max(diff1, diff2),diff3));
- }
- }
-}
-
-//this function does not create the texture atlas, rather it just copies each image to itself for however many repetitions is necessary based on its uv coordinates
-void FilterTexturePlugin::copyTiles(QPixmap images[], QImage tiledimages[], int &numTextures, int &c, float maxdiffUV[][2], MeshModel &m, int &algo, std::vector &sizes, Point2i &size)
-{
- int xPos, yPos;
- QPixmap tempImage;//for use in cropping to fill area at top of tiledimage
- for (c=0; c1 (in need of tiling) will get span of 2 to allow for uvs from 0.9 to 1.1, etc.
- maxdiffUV[c][0]++;//incrementing by one unit to allow for the original unit to still be present - so when span is 2, will create an image of 3* the original
- maxdiffUV[c][1]++;//this will allow for a UV coordinate of .9 with a span of 2 = 2.9
- if ((maxdiffUV[c][0]>1) || (maxdiffUV[c][1]>1))//tiling texture, if uv > 1 means want it is tiled/repeated (even though added one by incrementing)
- {
- tiledimages[c] = QImage(maxdiffUV[c][0]*images[c].width(), maxdiffUV[c][1]*images[c].height(), QImage::Format_ARGB32);//doesn't need to be ceiling (ceil function) - doesn't matter if texture is not a complete copy
- QPainter painter(&tiledimages[c]);//TODO: how move initialization outside of for loop, so can re-use the painter?
- //now draw into the image however many times necessary
- //meshlab considers the (0,0) texture coordinate to be at the bottom-left, not the top-left, so that's where we start drawing
- for (xPos = 0; xPos < maxdiffUV[c][0]*images[c].width(); xPos += images[c].width())//nested for loop in order to fill whole grid, does one column at a time
- {
- for (yPos = (maxdiffUV[c][1]-1)*images[c].height(); yPos > 0; yPos -= images[c].height())
- {
- qDebug() << "drawing mat:" << c << "into position:" << xPos << "," << yPos << endl;
- painter.drawPixmap(xPos, yPos, images[c]);//x & y position to insert top-left corner at, which image to insert
- }
- if (yPos<0)//this will be executed after the drawer is done painting all the textures from the bottom, until there's possibly a bit of space left at the top
- {
- yPos += images[c].height();//now check if there is any space left at the top of the tiled image, yPos is this amount
- if (yPos>0)//if so, crop the texture (from the top) and insert it in that space
- {
- tempImage = images[c].copy(0,(images[c].height()-yPos),images[c].width(),yPos);//x,y,width,height
- painter.drawPixmap(xPos, 0, tempImage);//x,y,image
- }
- }
- }
- if (algo==1)//resampled tiles
- {
- qDebug() << "resampling" << endl;
- images[c] = QPixmap::fromImage(tiledimages[c].scaled(images[c].width(), images[c].height()));//resample image to original size
- }
- else
- images[c] = QPixmap::fromImage(tiledimages[c]);//not necessary to write file if stays in memory, so just re-assign the QPixmap to the new tiled image
- }
- }
- if (images[c].width()!=0 && images[c].height()!=0)
- {
- size = Point2i(images[c].width(), images[c].height());//regardless of whether or not it was tiled, now store the image's dimensions
- sizes.push_back(size);
- qDebug() << "copyTiles loaded image into sizes vector: " << m.cm.textures[c].c_str() << "with (potentially tiled) size: " << size[0] << " " << size[1] << endl;
- }
- }
-}
-
-bool FilterTexturePlugin::createAtlas(int &numTextures, int &c, MeshModel &m, QPixmap images[], std::vector &posiz, Point2i &global_size)
-{
- QImage atlas;
- int index;
- QString filename;
-
- atlas = QImage(global_size[0], global_size[1], QImage::Format_ARGB32);//make a texture of that dimension
- //insert textures one after another at position returned by rect_packer, starting at 0,0 (origin in top-left corner)
- QPainter painter(&atlas);
- for (index=0; index &posiz, Point2i &global_size, MeshModel &m, float maxdiffUV[][2], QPixmap images[])
-{
- float minU, minV;
- int minUwhole, minVwhole;//stores whole-number components
- //bool UwasNegative, VwasNegative;
- for (fit=m.cm.face.begin(); fit != m.cm.face.end(); ++fit)//iterate through faces with textures
- {
- mat = fit->WT(0).N();//fit->cWT the 'c' is for const
- if (mat!=-1)//only re-assign texture if face has a texture material to begin with
- {
- fit->WT(0).N() = 0;//re-assign N to texture atlas's index (0, as only one texture now)
- //if all UV coordinates are less than the maximum span of U or V and >=0, just divide by max span of U or V and have the new normalized coordinate
- //ie if maximum span is 2, and have u coordinates .5 and 1, can just divide
- //but if have maximum span 2, and have u coordinates 3.7 and 3.9 (which is possible because their span is still 0.2) need to correct for, same case if negative
- //tiled texture coordinates (3.7 and 3.9): start position determined by .7, how many times you repeat determined by difference?
- //negative UV coordinates do not mirror the texture, just continue in u-v plane
- //negative U coordinate of -.2 equivalent to + U coordinate of 1-.2 = .8
- //4 cases depending on whether or not minU/minV is positive or negative - 4 quadrants
- //can't just flip negative values along an axis - as that would reverse the direction of the triangle's texture
- //cannot clamp values otherwise lose its ability to wrap i.e. repeat
-
- //3 ways of rendering values outside 0-1: clamp, wrap, or mirror
- //CLAMP - any value outside 0-1 gets clamped to 0 or 1
- //MIRROR - if whole number is odd, is frac(U) and whole number is even, is 1-frac(U), so 1.1 -> 0.9
- //WRAP - repeat as frac(U), so 1.1 -> 0.1
- //this assumes we're doing WRAP-around
- //texture gets 'flipped' whenever the UVs cross-product is negative
-
- //fabs to allow for negative uv coords
- if ((((fabs(fit->WT(0).U()) <= maxdiffUV[mat][0]) && (fabs(fit->WT(0).V()) <= maxdiffUV[mat][1])) && ((fabs(fit->WT(1).U()) <= maxdiffUV[mat][0]) && (fabs(fit->WT(1).V()) <= maxdiffUV[mat][1])) && ((fabs(fit->WT(2).U()) <= maxdiffUV[mat][0]) && (fabs(fit->WT(2).V()) <= maxdiffUV[mat][1])))){}
- else//otherwise, need to reposition UV coordinates close to the 0,0 by letting smallest U,V be between 0-1 (by subtracting its whole number component, leaving its decimal) and subtracting its whole number component from the other values (maintaining the offsets between them). this corrects for UV coords outside the range of the span. the resulting coordinates (before the last for loop) should be in the span, but not necessarily 0-1
- {
- qDebug() << "doing adjustment for > maxdiffUV" << endl;
-
- //find minimum U
- minU = min(fit->WT(0).U(), fit->WT(1).U());
- minU = min(fit->WT(2).U(), minU);
- //find minimum V
- minV = min(fit->WT(0).V(), fit->WT(1).V());
- minV = min(fit->WT(2).V(), minV);
- //if two points are both minimum values, valid to pick either one
- //float origU, origV;
-
- //now reposition UVs so that the smallest U & V coordinates are in the 0-1 box and others are translated accordingly
- //because you're minimizing the U & Vs separately, you won't necessarily end up with one vertex in the 0-1 box
-
- //4 cases: need to maintain the sign of each coordinate, and the spans between them (by translation)
- //all 3 coordinates are positive: below
- //2 are positive, 1 negative: offset negative coordinate to between 0 & -1
- //1 is positive, 2 negative: offset the LEAST negative coordinate to between 0 & -1
- //0 is positive, 3 negative: " "
- //the last 3 (those with at least one negative coord) are in effect the same algorithm, as when there is only one negative coord the least negative coord is that one
-
- //do for U, then repeat for V
-
- //first case
- if (fit->WT(0).U()>0 && fit->WT(1).U()>0 && fit->WT(2).U()>0){}
- else//other 3 cases (with at least one negative coord)
- {
- //find the least negative value - you already have the minimum, so just compare all values until find a negative one that's greater than it
- for (c=0; c<3; ++c)
- {
- if (fit->WT(c).U()<0 && fit->WT(c).U()>minU)
- minU=fit->WT(c).U();
- }
- qDebug() << "correcting negative, new minU:" << minU << endl;
- }
- minUwhole = int(minU);//get minimum U's whole number (equivalent to the floor)
- for (c=0; c<3; ++c)
- fit->WT(c).U() -= minUwhole;//offset by this value
-
-
- //first case
- if (fit->WT(0).V()>0 && fit->WT(1).V()>0 && fit->WT(2).V()>0){}
- else//other 3 cases (with at least one negative coord)
- {
- //find the least negative value - you already have the minimum, so just compare all values until find a negative one that's greater than it
- for (c=0; c<3; ++c)
- {
- if (fit->WT(c).V()<0 && fit->WT(c).V()>minV)
- minV=fit->WT(c).V();
- }
- qDebug() << "correcting negative, new minV:" << minV << endl;
- }
- minVwhole = int(minV);//get minimum V's whole number
- for (c=0; c<3; ++c)
- fit->WT(c).V() -= minVwhole;//offset by this value
-
- /*for (c=0; c<3; ++c)
- {
- //origU=fit->WT(c).U();
- //origV=fit->WT(c).V();
- fit->WT(c).U() -= minUwhole;
- fit->WT(c).V() -= minVwhole;
- /*if ((fit->WT(c).U()>maxdiffUV[mat][0])||(fit->WT(c).V()>maxdiffUV[mat][1]))
- {
- qDebug() << "-------------------" << endl;
- qDebug() << "maxdiffuv:" << maxdiffUV[mat][0] << "," << maxdiffUV[mat][1] << endl;
- qDebug() << "original u,v:" << origU << "," << origV << endl;
- qDebug() << "minu,minuwhole,minv,minvwhole:" << minU << "," << minUwhole << "," << minV << "," << minVwhole << endl;
- qDebug() << "shifted u,v:" << fit->WT(c).U() << "," << fit->WT(c).V() << endl;
- }/*
- }*/
- }
-
- for (c= 0; c < 3;++c)//UVs are per-vertex
- {
- //UwasNegative=VwasNegative=false;
- qDebug() << "------------------" << endl;
- qDebug() << "material " << mat << "position:" << posiz[mat][0] << "," << posiz[mat][1] << endl;
- qDebug() << "U: " << fit->WT(c).U() << "V: " << fit->WT(c).V() << endl;
- qDebug() << "maxdiffs:" << maxdiffUV[mat][0] << "," << maxdiffUV[mat][1] << endl;
- if (maxdiffUV[mat][0]>=1)//so that division by 0 won't yield coordinate of 'inf': infinity, and only do for textures you tiled
- fit->WT(c).U() /= maxdiffUV[mat][0];
- if (maxdiffUV[mat][1]>=1)
- fit->WT(c).V() /= maxdiffUV[mat][1];
- qDebug() << "new (first division) U: " << fit->WT(c).U() << "new V: " << fit->WT(c).V() << endl;
-
- //these values should all be between 0 & 1, as should the final outputs
- if ((fabs(fit->WT(c).U()) > 1)||(fabs(fit->WT(c).V()) > 1))
- qDebug() << "atlas's UV coords outside 0-1 range!" << endl;
- //if (fit->WT(c).U()<0)
- // UwasNegative=true;
- //if (fit->WT(c).V()<0)
- // VwasNegative=true;
- fit->WT(c).U() = (fabs(fit->WT(c).U())*images[mat].width() + posiz[mat][0])/global_size[0];//offset U by coord posiz, u*width is pixel, global_size is dimension - for normalizing (between 0 & 1)
- //if (UwasNegative)
- // fit->WT(c).U() *= -1;
- //extra adjustment here because V coordinate is measured from the bottom, whereas the rect packer gives us the position from the top
- fit->WT(c).V() = (fabs(fit->WT(c).V())*images[mat].height() + (global_size[1]-posiz[mat][1]-images[mat].height()))/global_size[1];//offset V by coord in posiz
- //if (VwasNegative)
- // fit->WT(c).V() *= -1;
- qDebug() << "new (second division) U: " << fit->WT(c).U() << "new V: " << fit->WT(c).V() << endl;
- }
- }
- }
- qDebug() << "global:" << global_size[0] << "," << global_size[1] << endl;
-}
-
-// The Real Core Function doing the actual mesh processing
-bool FilterTexturePlugin::applyFilter(QAction *filter, MeshModel &m, const FilterParameterSet &par, vcg::CallBackPos * cb)
-{
- //this function takes every texture in the model and creates a single texture composed of all the individual textures - necessary before calling the Quadric-with-texture filter
- //QT has support for all the major image formats (GIF/JPEG/PNG/BMP/TIFF) - though you need to compile QT with -qt-gif to get GIF support (on Ubuntu the package for qt already has this - check your /usr/share/qt4/plugins/imageformats folder)
- //can't do any file-format-specific calls, this has to be generalizable to any model
- //the general 'packing problem' is NP-complete, so you have to use a heuristic or genetic algorithm to get an approximate answer
- //this is not an optimal packing - we are not rotating textures, for example
- //TODO:how read image data from images already loaded into Meshlab, to prevent from opening files again?
- qDebug() << "called filterTexture applyFilter" << endl;
-
- //vcg::tri::Allocator::CompactVertexVector(m);
- //vcg::tri::Allocator::CompactFaceVector(m);
-
- int numTextures = m.cm.textures.size();
-
- Point2i global_size;
- Point2i max_size;
- Point2i size;
-
- std::vector posiz;
- std::vector sizes;
- max_size[0] = par.getInt("Xmax");
- max_size[1] = par.getInt("Ymax");
- int algo = par.getEnum("algoList");
-
- if (numTextures < 2)
- {
- qDebug() << "filterTexture failed - # textures < 2" << endl;
- return false;//return false if numTextures == 0 or 1 (no need for an atlas)
- }
-
- //1) generate an array of Point2f that will store the maximum difference in the u & v coordinates for each texture index
- float maxdiffUV[numTextures][2];
- //2) iterate through all faces, and for each face do 6 subtractions to figure out the maximum difference (absolute value?) for the U & V coordinates of vertices in that face
- CMeshO::FaceIterator fit;
- int mat,c;
- maxFaceSpan(c,maxdiffUV,m,mat,fit);
-
- //4) when done, copy the texture the necessary number of times (as indicated in the array), - do resampling here, if wanted
- //iterate through all values in maxdiffUV - if either value > 1, tile texture
- QPixmap images[numTextures];//array of images
- QImage tiledimages[numTextures];
- copyTiles(images, tiledimages, numTextures, c, maxdiffUV, m, algo, sizes, size);
-
- if (rect_packer::pack(sizes, max_size, posiz, global_size)==false)
- return false;//textures just couldn't fit in given texture atlas dimensions
-
- adjustUVCoords(mat, c, fit, posiz, global_size, m, maxdiffUV, images);
-
- return createAtlas(numTextures, c, m, images, posiz, global_size);
-}
-
-const int FilterTexturePlugin::getRequirements(QAction *action)
-{
- switch(ID(action))
- {
- case FP_MAKE_ATLAS : return MeshModel::MM_BORDERFLAG; // <-- ADD YOUR REQUIREMENT HERE
- default: assert(0);
- }
- return 0;
-}
-
-const FilterTexturePlugin::FilterClass FilterTexturePlugin::getClass(QAction *a)
-{
- switch(ID(a))
- {
- case FP_MAKE_ATLAS :
- return MeshFilterInterface::Generic;
- default : return MeshFilterInterface::Generic;
- }
-}
-
-Q_EXPORT_PLUGIN(FilterTexturePlugin)
diff --git a/src/meshlabplugins/filter_texture/filter_texture_old.h b/src/meshlabplugins/filter_texture/filter_texture_old.h
deleted file mode 100644
index 8ae0c8192..000000000
--- a/src/meshlabplugins/filter_texture/filter_texture_old.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-* MeshLab o o *
-* A versatile mesh processing toolbox o o *
-* _ O _ *
-* Copyright(C) 2005 \/)\/ *
-* 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. *
-* *
-****************************************************************************/
-/****************************************************************************
- History
-$Log: sampleplugins.h,v $
-
-****************************************************************************/
-
-#ifndef _FILTER_TEXTURE_PLUGIN_H
-#define _FILTER_TEXTURE_PLUGIN_H
-
-#include
-
-#include
-#include
-#include "rect_packer.h"
-
-class FilterTexturePlugin : public QObject, public MeshFilterInterface
-{
- Q_OBJECT
- Q_INTERFACES(MeshFilterInterface)
-
-public:
- enum { FP_MAKE_ATLAS } ;
-
- FilterTexturePlugin();
-
- virtual const QString filterName(FilterIDType filter);
- virtual const QString filterInfo(FilterIDType filter);
-
- virtual const FilterClass getClass(QAction *);
- virtual const int getRequirements(QAction *);
-
- virtual bool autoDialog(QAction *) {return true;}
- virtual void initParameterSet(QAction *,MeshModel &m, FilterParameterSet &parlst);
- virtual bool applyFilter(QAction *filter, MeshModel &m, const FilterParameterSet &par, vcg::CallBackPos * cb);
- virtual void maxFaceSpan(int &c, float maxdiffUV[][2], MeshModel &m, int &mat, CMeshO::FaceIterator &fit);
- virtual void copyTiles(QPixmap images[], QImage tiledimages[], int &numTextures, int &c, float maxdiffUV[][2], MeshModel &m, int &algo, std::vector& sizes, Point2i &size);
- virtual bool createAtlas(int &numTextures, int &c, MeshModel &m, QPixmap images[], std::vector &posiz, Point2i &global_size);
- virtual void adjustUVCoords(int &mat, int &c, CMeshO::FaceIterator &fit, std::vector &posiz, Point2i &global_size, MeshModel &m, float maxdiffUV[][2], QPixmap images[]);
-};
-
-#endif
diff --git a/src/meshlabplugins/filter_texture/filter_texture_old.pro b/src/meshlabplugins/filter_texture/filter_texture_old.pro
deleted file mode 100644
index df6580c05..000000000
--- a/src/meshlabplugins/filter_texture/filter_texture_old.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-include (../../sharedfilter.pri)
-HEADERS = filter_texture.h
-
-SOURCES = filter_texture.cpp\
- rect_packer.cpp\
-
-
-TARGET = filter_texture
-
diff --git a/src/meshlabplugins/filter_texture/rect_packer_old.cpp b/src/meshlabplugins/filter_texture/rect_packer_old.cpp
deleted file mode 100644
index 4d7391f7a..000000000
--- a/src/meshlabplugins/filter_texture/rect_packer_old.cpp
+++ /dev/null
@@ -1,216 +0,0 @@
-/****************************************************************************
-* MeshLab o o *
-* An extendible mesh processor o o *
-* _ O _ *
-* Copyright(C) 2005, 2009 \/)\/ *
-* 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. *
-* *
-****************************************************************************/
-
-#include
-#include
-#include
-
-#include "rect_packer.h"
-
-using namespace std;
-
-class point2iConf
-{
-public:
- const std::vector & v;
-
- inline point2iConf( const std::vector & nv ) : v(nv) { }
-
- inline bool operator() ( int a, int b )
- {
- return v[a]>v[b];
- //return v[a][0]*v[a][1]>v[b][0]*v[b][1];
- }
-};
-
-/*
-1) 'sizes' is a vector of points corresponding to the width/height of each texture
-2) 'max_size' is a single point that represents the maximum height/width of the texture atlas you want to create
-3) 'posiz' is a vector of points that indicate for each texture in 'sizes', where to place this texture in the texture atlas (initially this would be empty)
-4) 'global_size' represents the minimum height/width necessary to encompass the resulting texture atlas (initially null)
-*/
-bool rect_packer::pack(const std::vector & sizes, const Point2i & max_size, std::vector & posiz, Point2i & global_size)
-{
- int n = (int)(sizes.size());
- if (n<=0)
- return false;
- //assert(n>0);
- assert(max_size[0]>0);
- assert(max_size[1]>0);
-
- int gdim = max_size[0]*max_size[1]; // grid size
- int i,j,x,y;
-
- posiz.resize(n);
- for(i=0;i grid(gdim); // grid creation
- for(i=0;i perm(n); // permutation creation - vector, one element for each size in sizes - this is what you want the result of
- for(i=0;imax_size[0] ||
- sizes[perm[0]][1]>max_size[1] )
- return false;
-
- // Find the position of the first one
- j = perm[0];
- global_size[0] = sizes[j][0];
- global_size[1] = sizes[j][1];
- posiz[j][0] = 0;
- posiz[j][1] = 0;
- for(y=0;y=0);
- assert(x=0);
- assert(y=0);
- assert(j0);
- assert(sy>0);
-
- // limit positions
- int lx = min(global_size[0],max_size[0]-sx);
- int ly = min(global_size[1],max_size[1]-sy);
-
- assert(lx>0);
- assert(ly>0);
-
- int finterior = 0;
-
- for(y=0;y<=ly;y++)
- {
- for(x=0;x<=lx;)
- {
- int px;
- int c;
- // intersection check
- c = Grid(x,y+sy-1);
- if(!c) c = Grid(x+sx-1,y+sy-1);
- if(!c)
- {
- for(px=x;px=0);
- assert(ca)
- {
- bestx = x;
- besty = y;
- bestsx = nsx;
- bestsy = nsy;
- besta = a;
- if( bestsx==global_size[0] && bestsy==global_size[1] )
- finterior = 1;
- }
- break;
- }
- if(finterior) break;
- }
- if( finterior ) break;
- }
-
- if(besta==-1)
- {
- return false;
- }
-
- posiz[j][0] = bestx;//new U offset for texture at position j
- posiz[j][1] = besty;//new V offset for texture at position j
- global_size[0] = bestsx;//holds smallest encompassing width for texture atlas
- global_size[1] = bestsy;//holds smallest encompassing height for texture atlas
- for(y=posiz[j][1];y=0);
- assert(x=0);
- assert(y
-
-#include
-
-using namespace vcg;
-
-class rect_packer
-{
- public:
-
- typedef rect_packer this_type;
-
- static bool pack(const std::vector & sizes, const Point2i & max_size, std::vector & posiz, Point2i & global_size);
-};
-
-#endif // RECT_PACKER_H
diff --git a/src/meshlabplugins/io_u3d/CMakeLists.txt b/src/meshlabplugins/io_u3d/CMakeLists.txt
index 2cbd9fe0f..f29479394 100644
--- a/src/meshlabplugins/io_u3d/CMakeLists.txt
+++ b/src/meshlabplugins/io_u3d/CMakeLists.txt
@@ -12,13 +12,15 @@ if(TARGET external-IDTFConverter)
set(SOURCES io_u3d.cpp)
set(HEADERS io_u3d.h)
+ include_directories("${U3D_DIR}/src/IDTF")
add_library(io_u3d MODULE ${SOURCES} ${HEADERS})
target_include_directories(io_u3d PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
+
target_link_libraries(io_u3d PUBLIC common)
- target_link_libraries(io_u3d PRIVATE external-IDTFConverter ${CMAKE_DL_LIBS})
+ target_link_libraries(io_u3d PUBLIC external-IDTFConverter IFXCoreStatic ${CMAKE_DL_LIBS})
set_property(TARGET io_u3d PROPERTY FOLDER Plugins)
diff --git a/src/meshlabplugins/io_u3d/io_u3d.cpp b/src/meshlabplugins/io_u3d/io_u3d.cpp
index fa8286edc..026c361c9 100644
--- a/src/meshlabplugins/io_u3d/io_u3d.cpp
+++ b/src/meshlabplugins/io_u3d/io_u3d.cpp
@@ -42,20 +42,26 @@ using namespace std;
using namespace vcg;
-U3DIOPlugin::U3DIOPlugin()
-:QObject(),IOPluginInterface(),_param()
+U3DIOPlugin::U3DIOPlugin() :
+ QObject(), IOPluginInterface(), _param()
{
-
}
-bool U3DIOPlugin::open(const QString &, const QString &, MeshModel &, int&, const RichParameterList &, CallBackPos *, QWidget *)
+bool U3DIOPlugin::open(
+ const QString &,
+ const QString &,
+ MeshModel &,
+ int&,
+ const RichParameterList &,
+ CallBackPos *,
+ QWidget *)
{
return false;
}
QString U3DIOPlugin::computePluginsPath()
{
- QDir pluginsDir(PluginManager::getDefaultPluginDirPath());
+ QDir pluginsDir(PluginManager::getDefaultPluginDirPath());
#if defined(Q_OS_WIN)
pluginsDir.cd("U3D_W32");
#elif defined(Q_OS_MAC)
@@ -68,7 +74,14 @@ QString U3DIOPlugin::computePluginsPath()
}
-bool U3DIOPlugin::save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const RichParameterList & par, vcg::CallBackPos *, QWidget *parent)
+bool U3DIOPlugin::save(
+ const QString &formatName,
+ const QString &fileName,
+ MeshModel &m,
+ const int mask,
+ const RichParameterList & par,
+ vcg::CallBackPos *,
+ QWidget *parent)
{
vcg::tri::Allocator::CompactVertexVector(m.cm);
vcg::tri::Allocator::CompactFaceVector(m.cm);
@@ -78,10 +91,12 @@ bool U3DIOPlugin::save(const QString &formatName, const QString &fileName, MeshM
std::string ex = formatName.toUtf8().data();
- QStringList textures_to_be_restored;
- QStringList lst = vcg::tri::io::ExporterIDTF::convertInTGATextures(m.cm,QDir::tempPath(),textures_to_be_restored);
+ QStringList textures_to_be_restored;
+ QStringList lst =
+ vcg::tri::io::ExporterIDTF::convertInTGATextures(
+ m.cm, QDir::tempPath(), textures_to_be_restored);
if(formatName.toUpper() == tr("U3D")) {
- qApp->restoreOverrideCursor();
+ qApp->restoreOverrideCursor();
saveParameters(par);
QSettings settings;
@@ -91,18 +106,22 @@ bool U3DIOPlugin::save(const QString &formatName, const QString &fileName, MeshM
QString out(fileName);
QStringList out_trim;
vcg::tri::io::QtUtilityFunctions::splitFilePath(fileName,out_trim);
- tmp = tmp + "/" + vcg::tri::io::QtUtilityFunctions::fileNameFromTrimmedPath(out_trim) + ".idtf";
+ tmp = tmp + "/" +
+ vcg::tri::io::QtUtilityFunctions::fileNameFromTrimmedPath(out_trim) + ".idtf";
vcg::tri::io::ExporterIDTF::Save(m.cm,qPrintable(tmp),mask);
//conversion from idtf to u3d
bool result = IDTFConverter::IDTFToU3d(tmp.toStdString(), filename, _param.positionQuality);
- if(result==false) {
- QMessageBox::warning(parent, tr("Saving Error"), errorMsgFormat.arg(fileName, vcg::tri::io::ExporterU3D::ErrorMsg(!result)));
- return false;
- }
-
- //saving latex:
+ if(result==false) {
+ QMessageBox::warning(
+ parent,
+ tr("Saving Error"),
+ errorMsgFormat.arg(fileName, vcg::tri::io::ExporterU3D::ErrorMsg(!result)));
+ return false;
+ }
+
+ //saving latex:
QDir::setCurrent(curr);
QString lat (fileName);
QStringList l = lat.split(".");
@@ -114,8 +133,10 @@ bool U3DIOPlugin::save(const QString &formatName, const QString &fileName, MeshM
}
if(formatName.toUpper() == tr("IDTF"))
- tri::io::ExporterIDTF::Save(m.cm,filename.c_str(),mask);
- vcg::tri::io::ExporterIDTF::restoreConvertedTextures(m.cm,textures_to_be_restored);
+ tri::io::ExporterIDTF::Save(m.cm,filename.c_str(),mask);
+ vcg::tri::io::ExporterIDTF::restoreConvertedTextures(
+ m.cm,
+ textures_to_be_restored);
return true;
}
@@ -148,17 +169,22 @@ 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(const 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();
+ capability = defaultBits =
+ vcg::tri::io::ExporterU3D::GetExportMaskCapability();
defaultBits &= (~vcg::tri::io::Mask::IOM_VERTNORMAL);
defaultBits &= (~vcg::tri::io::Mask::IOM_VERTCOLOR);
defaultBits &= (~vcg::tri::io::Mask::IOM_FACECOLOR);
return;
}
if(format.toUpper() == tr("IDTF")) {
- capability=defaultBits = vcg::tri::io::ExporterIDTF::GetExportMaskCapability();
+ capability = defaultBits =
+ vcg::tri::io::ExporterIDTF::GetExportMaskCapability();
defaultBits &= (~vcg::tri::io::Mask::IOM_VERTNORMAL);
defaultBits &= (~vcg::tri::io::Mask::IOM_VERTCOLOR);
defaultBits &= (~vcg::tri::io::Mask::IOM_FACECOLOR);
@@ -168,39 +194,28 @@ void U3DIOPlugin::GetExportMaskCapability(const QString &format, int &capability
assert(0);
}
-//static float avoidExponentialNotation(const float n,const float bboxdiag)
-//{
-// float val_min = std::min(1000.0f,floorf(bboxdiag * 1000.0f));
-// return floorf(val_min * n ) / val_min;
-//}
-//
-//static vcg::Point3f avoidExponentialNotation(const vcg::Point3f& p,const float bboxdiag)
-//{
-// return vcg::Point3f(avoidExponentialNotation(p.X(),bboxdiag),
-// avoidExponentialNotation(p.Y(),bboxdiag),
-// avoidExponentialNotation(p.Z(),bboxdiag));
-//}
-
void U3DIOPlugin::initSaveParameter(const QString &, MeshModel &m, RichParameterList &par)
{
- _param._campar = new vcg::tri::io::u3dparametersclasses::Movie15Parameters::CameraParameters(m.cm.bbox.Center(),m.cm.bbox.Diag());
- //vcg::Point3f pos = avoidExponentialNotation(_param._campar->_obj_pos,_param._campar->_obj_bbox_diag);
+ _param._campar =
+ new vcg::tri::io::u3dparametersclasses::Movie15Parameters::CameraParameters(
+ m.cm.bbox.Center(),m.cm.bbox.Diag());
Point3m pos = _param._campar->_obj_pos;
Point3m dir(0.0f,0.0f,-1.0f * _param._campar->_obj_bbox_diag);
par.addParam(RichPoint3f("position_val",dir, "Camera Position",
- "The position in which the camera is set. The default value is derived by the 3d mesh's bounding box."));
- //vcg::Point3f dir(0.0f,0.0f,avoidExponentialNotation(-1.0f * _param._campar->_obj_bbox_diag,_param._campar->_obj_bbox_diag));
+ "The position in which the camera is set. The default value is derived by the 3d mesh's bounding box."));
par.addParam(RichPoint3f("target_val",pos, "Camera target point",
"The point towards the camera is seeing. The default value is derived by the 3d mesh's bounding box."));
- par.addParam(RichFloat("fov_val",60.0f,"Camera's FOV Angle 0..180","Camera's FOV Angle. The values' range is between 0-180 degree. The default value is 60."));
- par.addParam(RichInt("compression_val",500,"U3D quality 0..1000","U3D mesh's compression ratio. The values' range is between 0-1000 degree. The default value is 500."));
+ par.addParam(RichFloat("fov_val",60.0f,
+ "Camera's FOV Angle 0..180","Camera's FOV Angle. The values' range is between 0-180 degree. The default value is 60."));
+ par.addParam(RichInt("compression_val",500,"U3D quality 0..1000",
+ "U3D mesh's compression ratio. The values' range is between 0-1000 degree. The default value is 500."));
}
void U3DIOPlugin::saveParameters(const RichParameterList &par)
{
- Point3m from_target_to_camera = Point3m(par.getPoint3m(QString("position_val")) - par.getPoint3m(QString("target_val")));
+ Point3m from_target_to_camera =
+ Point3m(par.getPoint3m(QString("position_val")) - par.getPoint3m(QString("target_val")));
vcg::tri::io::u3dparametersclasses::Movie15Parameters::CameraParameters* sw = _param._campar;
- //vcg::Point3f p = avoidExponentialNotation(sw->_obj_pos,_param._campar->_obj_bbox_diag);
Point3m p = sw->_obj_pos;
_param._campar = new vcg::tri::io::u3dparametersclasses::Movie15Parameters::CameraParameters(
par.getFloat(QString("fov_val")),0.0,from_target_to_camera,from_target_to_camera.Norm(),sw->_obj_bbox_diag,p);
@@ -215,7 +230,8 @@ void U3DIOPlugin::saveLatex(const QString& file,const vcg::tri::io::u3dparameter
QString u3df = file + ".u3d";
QStringList file_trim;
vcg::tri::io::QtUtilityFunctions::splitFilePath(u3df,file_trim);
- std::string u3d_final = vcg::tri::io::QtUtilityFunctions::fileNameFromTrimmedPath(file_trim).toStdString();
+ std::string u3d_final =
+ vcg::tri::io::QtUtilityFunctions::fileNameFromTrimmedPath(file_trim).toStdString();
latex.write(0,"\\documentclass[a4paper]{article}");
latex.write(0,"\\usepackage[3D]{movie15}");
latex.write(0,"\\usepackage{hyperref}");
@@ -232,8 +248,7 @@ void U3DIOPlugin::saveLatex(const QString& file,const vcg::tri::io::u3dparameter
latex.write(1,"text=(" + u3d_text.toStdString() + "),");
std::string cam_string;
typename vcg::tri::io::u3dparametersclasses::Movie15Parameters::CameraParameters* cam = mov_par._campar;
- if (cam != NULL)
- {
+ if (cam != NULL) {
cam_string = cam_string + "3Daac=" + TextUtility::nmbToStr(cam->_cam_fov_angle) +
", 3Droll=" + TextUtility::nmbToStr(cam->_cam_roll_angle) +
", 3Dc2c=" + TextUtility::nmbToStr(cam->_obj_to_cam_dir.X()) + " " + TextUtility::nmbToStr(cam->_obj_to_cam_dir.Z()) + " " + TextUtility::nmbToStr(cam->_obj_to_cam_dir.Y()) +
diff --git a/src/meshlabplugins/io_x3d/vrml/VrmlTranslator.atg b/src/meshlabplugins/io_x3d/vrml/VrmlTranslator.atg
deleted file mode 100644
index 1ff4be70e..000000000
--- a/src/meshlabplugins/io_x3d/vrml/VrmlTranslator.atg
+++ /dev/null
@@ -1,514 +0,0 @@
-#include
-#include
-
-COMPILER VrmlTranslator
-
- QDomDocument *doc;
-
- std::map defNode;
-
- std::set proto;
-
- std::set x3dNode;
-
- void InitX3dNode()
- {
- x3dNode.insert("Arc2D"); x3dNode.insert("ArcClose2D"); x3dNode.insert("BallJoint");
- x3dNode.insert("BooleanFilter"); x3dNode.insert("BooleanSequencer"); x3dNode.insert("BooleanToggle");
- x3dNode.insert("BooleanTrigger"); x3dNode.insert("BoundedPhysicsModel"); x3dNode.insert("CADAssembly");
- x3dNode.insert("CADFace"); x3dNode.insert("CADLayer"); x3dNode.insert("CADPart");
- x3dNode.insert("Circle2D"); x3dNode.insert("ClipPlane"); x3dNode.insert("CollidableOffset");
- x3dNode.insert("CollidableShape"); x3dNode.insert("CollisionCollection"); x3dNode.insert("CollisionSensor");
- x3dNode.insert("CollisionSpace"); x3dNode.insert("ColorDamper");x3dNode.insert("ColorRGBA");
- x3dNode.insert("ComposedCubeMapTexture"); x3dNode.insert("ComposedShader");
- x3dNode.insert("ComposedTexture3D"); x3dNode.insert("ConeEmitter"); x3dNode.insert("Contact");
- x3dNode.insert("Contour2D"); x3dNode.insert("ContourPolyline2D"); x3dNode.insert("CoordinateDamper");
- x3dNode.insert("CoordinateDouble"); x3dNode.insert("CoordinateInterpolator2D");
- x3dNode.insert("DISEntityManager"); x3dNode.insert("DISEntityTypeMapping");
- x3dNode.insert("Disk2D"); x3dNode.insert("DoubleAxisHingeJoint"); x3dNode.insert("EaseInEaseOut");
- x3dNode.insert("EspduTransform"); x3dNode.insert("ExplosionEmitter");
- x3dNode.insert("FillProperties"); x3dNode.insert("FloatVertexAttribute");
- x3dNode.insert("FogCoordinate"); x3dNode.insert(" GeneratedCubeMapTexture");
- x3dNode.insert("GeoCoordinate"); x3dNode.insert("GeoElevationGrid"); x3dNode.insert("GeoLocation");
- x3dNode.insert("GeoLOD"); x3dNode.insert("GeoMetadata"); x3dNode.insert("GeoOrigin");
- x3dNode.insert("GeoPositionInterpolator"); x3dNode.insert("GeoProximitySensor");
- x3dNode.insert("GeoTouchSensor"); x3dNode.insert("GeoViewpoint"); x3dNode.insert("GravityPhysicsModel");
- x3dNode.insert("HAnimDisplacer"); x3dNode.insert("HAnimHumanoid"); x3dNode.insert("HAnimJoint");
- x3dNode.insert("HAnimSegment"); x3dNode.insert("HAnimSite"); x3dNode.insert("ImageCubeMapTexture");
- x3dNode.insert("ImageTexture3D"); x3dNode.insert("IndexedQuadSet"); x3dNode.insert("IndexedTriangleFanSet");
- x3dNode.insert("IndexedTriangleSet"); x3dNode.insert("IndexedTriangleStripSet");
- x3dNode.insert("IntegerSequencer"); x3dNode.insert("IntegerTrigger"); x3dNode.insert("KeySensor");
- x3dNode.insert("Layer"); x3dNode.insert("LayerSet"); x3dNode.insert("Layout");
- x3dNode.insert("LayoutGroup"); x3dNode.insert("LayoutLayer"); x3dNode.insert("LinePicker");
- x3dNode.insert("LineProperties"); x3dNode.insert("LineSet"); x3dNode.insert("LoadSensor");
- x3dNode.insert("LocalFog"); x3dNode.insert("Material"); x3dNode.insert("Matrix3VertexAttribute");
- x3dNode.insert("Matrix4VertexAttribute"); x3dNode.insert("MetadataDouble");
- x3dNode.insert("MetadataFloat"); x3dNode.insert("MetadataInteger"); x3dNode.insert("MetadataSet");
- x3dNode.insert("MetadataString"); x3dNode.insert("MotorJoint"); x3dNode.insert("MultiTexture");
- x3dNode.insert("MultiTextureCoordinate"); x3dNode.insert("MultiTextureTransform");
- x3dNode.insert("NurbsCurve"); x3dNode.insert("NurbsCurve2D"); x3dNode.insert("NurbsOrientationInterpolator");
- x3dNode.insert("NurbsPatchSurface"); x3dNode.insert("NurbsPositionInterpolator"); x3dNode.insert("NurbsSet");
- x3dNode.insert("NurbsSurfaceInterpolator"); x3dNode.insert("NurbsSweptSurface");
- x3dNode.insert("NurbsSwungSurface"); x3dNode.insert("NurbsTextureCoordinate");
- x3dNode.insert("NurbsTrimmedSurface"); x3dNode.insert("OrientationChaser");
- x3dNode.insert("OrientationDamper"); x3dNode.insert("OrthoViewpoint"); x3dNode.insert("PackagedShader");
- x3dNode.insert("ParticleSystem"); x3dNode.insert("PickableGroup"); x3dNode.insert("PixelTexture3D");
- x3dNode.insert("PointEmitter"); x3dNode.insert("PointPicker"); x3dNode.insert("PointSet");
- x3dNode.insert("Polyline2D"); x3dNode.insert("PolylineEmitter"); x3dNode.insert("Polypoint2D");
- x3dNode.insert("PositionChaser"); x3dNode.insert("PositionChaser2D"); x3dNode.insert("PositionDamper");
- x3dNode.insert("PositionDamper2D"); x3dNode.insert("PositionInterpolator2D");
- x3dNode.insert("PrimitivePicker"); x3dNode.insert("ProgramShader"); x3dNode.insert("QuadSet");
- x3dNode.insert("ReceiverPdu"); x3dNode.insert("Rectangle2D"); x3dNode.insert("RigidBody");
- x3dNode.insert("RigidBodyCollection"); x3dNode.insert("ScalarChaser"); x3dNode.insert("ScreenFontStyle");
- x3dNode.insert("ScreenGroup"); x3dNode.insert("ShaderPart"); x3dNode.insert("ShaderProgram");
- x3dNode.insert("SignalPdu"); x3dNode.insert("SingleAxisHingeJoint"); x3dNode.insert("SliderJoint");
- x3dNode.insert("SplinePositionInterpolator"); x3dNode.insert("SplinePositionInterpolator2D");
- x3dNode.insert("SplineScalarInterpolator"); x3dNode.insert("SquadOrientationInterpolator");
- x3dNode.insert("StaticGroup"); x3dNode.insert("StringSensor"); x3dNode.insert("SurfaceEmitter");
- x3dNode.insert("TexCoordDamper"); x3dNode.insert("TextureBackground");
- x3dNode.insert("TextureCoordiante3D"); x3dNode.insert("TextureCoordinate4D");
- x3dNode.insert("TextureCoordinateGenerator"); x3dNode.insert("TextureProperties");
- x3dNode.insert("TextureTransformMatrix3D"); x3dNode.insert("TextureTransform3D");
- x3dNode.insert("TimeTrigger"); x3dNode.insert("TransformSensor"); x3dNode.insert("TransmitterPdu");
- x3dNode.insert("TriangleFanSet"); x3dNode.insert("TriangleSet"); x3dNode.insert("TriangleSet2D");
- x3dNode.insert("TriangleStripSet"); x3dNode.insert("TwoSidedMaterial"); x3dNode.insert("UniversalJoint");
- x3dNode.insert(" Viewpoint"); x3dNode.insert("ViewpointGroup"); x3dNode.insert("VolumeEmitter");
- x3dNode.insert("VolumePicker"); x3dNode.insert("WindPhysicsModel");
- }
-
-CHARACTERS
- digit = "0123456789".
- invalidChar = '\u0000' .. '\u0020'.
- idRestChar = ANY - invalidChar - '\u0022' - '\u0023' - '\u0027' - '\u002c' - '\u002e' - '\u005b' - '\u005c' - '\u005d' - '\u007b' -'\u007d' - '\u007f'.
- idFirstChar = idRestChar - digit - '\u002b' - '\u002d'.
- hexDigit = digit + "ABCDEFabcdef".
- notDigit = ANY - digit.
- regularStringChar = ANY - '"' - '\\' - '\n' - '\r'.
- commentCont = ANY - '\n' - '\r'.
-
-TOKENS
- id = idFirstChar {idRestChar}.
- intCont = ['+'|'-']( digit {digit} | ("0x" | "0X") hexDigit {hexDigit}).
- realCont = ['+'|'-'] ("." digit {digit} [("e" | "E") ["+" | "-"] digit {digit}]
- | digit {digit} ( "." {digit} [("e" | "E" ) ["+" | "-"] digit {digit} ] | ("e" | "E") ["+" | "-"] digit {digit})).
- string = "\"" { regularStringChar
- | "\\\'" | "\\\"" | "\\\\" | "\\0" | "\\a" | "\\b" | "\\f" | "\\n" | "\\r" | "\\t" | "\\v"
- | "\\x" hexDigit [hexDigit] [hexDigit] [hexDigit]
- | "\\u" hexDigit hexDigit hexDigit hexDigit
- | "\\U" hexDigit hexDigit hexDigit hexDigit hexDigit hexDigit hexDigit hexDigit
- | "\n" | "\r" | "\t"
- } "\"".
-
- x3dVersion = "V3.0" | "V3.1" | "V3.2".
- vrmlVersion = "V2.0".
-
-/*PRAGMAS
- comment = "#" {commentCont}.
-*/
-COMMENTS FROM '#' TO '\n'
-
-IGNORE '\r' + '\n' + '\t'
-
-PRODUCTIONS
-
-VrmlTranslator (.QDomElement root = doc->createElement("X3D");
- QDomElement scene = doc->createElement("Scene");
- root.appendChild(scene);
- InitX3dNode();.)
-= [HeaderStatement]
- [ProfileStatement]
- ComponentStatements
- MetaStatements
- Statements (.doc->appendChild(root);.)
- .
-
-HeaderStatement
-= "#"("X3D" [x3dVersion] | "VRML" [vrmlVersion]) "utf8" [string].
-
-
-ProfileStatement
-= "PROFILE" ProfileNameId.
-
-
-ProfileNameId
-= id.
-
-
-ComponentStatements
-= {ComponentStatement
- }.
-
-
-ComponentStatement
-= "COMPONENT" ComponentNameId
- ":"ComponentSupportLevel.
-
-
-ComponentNameId
-= id.
-
-
-ComponentSupportLevel
-= intCont.
-
-
-ExportStatement (.QString str;.)
-= "EXPORT" NodeNameId
- "AS" ExportedNodeNameId.
-
-
-ImportStatement (.QString str;.)
-= "IMPORT" InlineNodeNameId
- "."ExportedNodeNameId
- "AS" NodeNameId.
-
-
-MetaStatements
-= {MetaStatement
- }.
-
-
-MetaStatement
-= "META" Metakey
- Metavalue.
-
-
-Metakey
-= string.
-
-
-Metavalue
-= string.
-
-
-Statements
-= {Statement
- }.
-
-
-Statement
-= NodeStatement
- | ImportStatement
- | ExportStatement
- | ProtoStatement
- | RouteStatement.
-
-
-NodeStatement