diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 96d45d261..43616724f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,7 @@ env: name: Build jobs: set-lib3mf-version: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 outputs: lib3mf-version: ${{ steps.set-version.outputs.LIB3MF_VERSION }} steps: @@ -21,7 +21,7 @@ jobs: run: echo "LIB3MF_VERSION=${{ steps.set-version.outputs.LIB3MF_VERSION }}" build-linux-memtest: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: [set-lib3mf-version] steps: - run: sudo apt update @@ -34,7 +34,7 @@ jobs: working-directory: ./build build-linux-ubi8-gcc12: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: [set-lib3mf-version] env: LIB3MF_VERSION: ${{ needs.set-lib3mf-version.outputs.lib3mf-version }} @@ -110,7 +110,7 @@ jobs: path: dist/${{ env.ARTIFACT_NAME_RPM }} build-macos: - runs-on: macos-latest + runs-on: macos-15 needs: [set-lib3mf-version] env: LIB3MF_VERSION: ${{ needs.set-lib3mf-version.outputs.lib3mf-version }} @@ -131,19 +131,63 @@ jobs: echo "ARTIFACT_NAME=$(basename ${ZIP_FILE})" >> $GITHUB_ENV shell: bash - run: ls -al build/ + - name: Determine macOS dylib + id: find-mac-lib + run: | + set -euo pipefail + MAC_LIB=$(ls build/lib3mf*.dylib | head -n 1) + if [ -z "$MAC_LIB" ]; then + echo "No macOS dylib found in build/" >&2 + exit 1 + fi + echo "MAC_LIB=${MAC_LIB}" >> $GITHUB_ENV - name: Archive Mac binary uses: actions/upload-artifact@v4 with: name: lib3mf.dylib - path: build/lib3mf.${{ env.LIB3MF_VERSION }}.0.dylib + path: ${{ env.MAC_LIB }} - name: Upload Artifact (CPacked Archive) uses: actions/upload-artifact@v4 with: name: ${{ env.ARTIFACT_NAME }} path: build/${{ env.ARTIFACT_NAME }} + build-wasm: + runs-on: ubuntu-24.04 + needs: [set-lib3mf-version] + env: + LIB3MF_VERSION: ${{ needs.set-lib3mf-version.outputs.lib3mf-version }} + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Setup Emscripten + uses: mymindstorm/setup-emsdk@v14 + with: + version: latest + - name: Build lib3mf_wasm + run: | + emcmake cmake -S . -B build/wasm -DLIB3MF_BUILD_WASM=ON -DCMAKE_BUILD_TYPE=Release + cmake --build build/wasm --target lib3mf_wasm -j"$(nproc)" + - name: Test indexed WASM slice vertices + run: node Tests/SliceVertex.mjs Tests/TestFiles/Slice/MultiSliceStack_TwoFiles.3mf + - name: Package WASM artifact + run: | + mkdir -p build/wasm-artifact + cp build/wasm/lib3mf.js build/wasm-artifact/ + cp build/wasm/lib3mf.wasm build/wasm-artifact/ + ( + cd build + zip -r "lib3mf-wasm-${LIB3MF_VERSION}.zip" wasm-artifact + ) + - name: Upload WASM Artifact + uses: actions/upload-artifact@v4 + with: + name: lib3mf-wasm-${{ env.LIB3MF_VERSION }}.zip + path: build/lib3mf-wasm-${{ env.LIB3MF_VERSION }}.zip + build-macos-debug: - runs-on: macos-latest + runs-on: macos-15 needs: [set-lib3mf-version] steps: - uses: actions/checkout@v4 @@ -161,7 +205,7 @@ jobs: path: build/lib3mf.dylib codecoverage-macos: - runs-on: macos-latest + runs-on: macos-15 needs: [set-lib3mf-version] steps: - uses: actions/checkout@v4 @@ -189,7 +233,7 @@ jobs: verbose: true # optional (default = false) build-windows-release: - runs-on: windows-2019 + runs-on: windows-2022 needs: [set-lib3mf-version] env: LIB3MF_VERSION: ${{ needs.set-lib3mf-version.outputs.lib3mf-version }} @@ -197,7 +241,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: true - - run: ./cmake/GenerateVS2019.bat + - run: ./cmake/GenerateVS2022.bat - run: cmake --build . --config Release working-directory: ./build - run: ctest -V @@ -226,13 +270,13 @@ jobs: path: build/${{ env.ARTIFACT_NAME }} build-windows-debug: - runs-on: windows-2019 + runs-on: windows-2022 needs: [set-lib3mf-version] steps: - uses: actions/checkout@v4 with: submodules: true - - run: ./cmake/GenerateVS2019.bat + - run: ./cmake/GenerateVS2022.bat - run: cmake --build . --config Debug working-directory: ./build - run: ctest -V @@ -251,13 +295,13 @@ jobs: name: lib3mf.debug.lib path: build/Debug/lib3mf.lib build-windows-32bit: - runs-on: windows-2019 + runs-on: windows-2022 needs: [set-lib3mf-version] steps: - uses: actions/checkout@v4 with: submodules: true - - run: ./cmake/GenerateVS2019_32bit.bat + - run: ./cmake/GenerateVS2022_32bit.bat - run: cmake --build . --config Release working-directory: ./build_32bit - run: ctest -V @@ -273,7 +317,7 @@ jobs: name: lib3mf_32bit.lib path: build_32bit/Release/lib3mf.lib build-mingw-w64: - runs-on: windows-2019 + runs-on: windows-2022 needs: [set-lib3mf-version] steps: - run: choco install mingw -y @@ -288,7 +332,7 @@ jobs: assemble-sdk: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: [set-lib3mf-version, build-windows-release, build-macos, build-linux-ubi8-gcc12] env: LIB3MF_VERSION: ${{ needs.set-lib3mf-version.outputs.lib3mf-version }} @@ -305,7 +349,7 @@ jobs: - run: ls -Rlh ./build - run: unzip bindings.zip/bindings.zip working-directory: ./build - - run: bash SDK/GenerateSDK_github.sh + - run: python3 SDK/GenerateSDK_github.py - name: Archive SDK artifact (Comprehensive) uses: actions/upload-artifact@v4 with: @@ -314,7 +358,7 @@ jobs: deploy-linux: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: [set-lib3mf-version, assemble-sdk] env: LIB3MF_VERSION: ${{ needs.set-lib3mf-version.outputs.lib3mf-version }} @@ -365,6 +409,12 @@ jobs: cd SDK/CPackExamples/CppDynamic/build cmake --build . ./Example_ExtractInfo ../../../Examples/Files/Helix.3mf + - name: Build CDynamic - CPack (Linux) + run: | + sh SDK/CPackExamples/CDynamic/GenerateMake.sh + cd SDK/CPackExamples/CDynamic/build + cmake --build . + ./Example_CDynamic - name: Build Cpp - CPack (Linux) run: | sh SDK/CPackExamples/Cpp/GenerateMake.sh @@ -391,6 +441,12 @@ jobs: cd SDK/CPackExamples/CppDynamic/build cmake --build . ./Example_ExtractInfo ../../../Examples/Files/Helix.3mf + - name: Build CDynamic - CPack (Debian) + run: | + sh SDK/CPackExamples/CDynamic/GenerateMake.sh + cd SDK/CPackExamples/CDynamic/build + cmake --build . + ./Example_CDynamic - name: Build Cpp - CPack (Debian) run: | sh SDK/CPackExamples/Cpp/GenerateMake.sh @@ -410,7 +466,7 @@ jobs: ./create_cube deploy-windows: - runs-on: windows-2019 + runs-on: windows-2022 needs: [set-lib3mf-version, assemble-sdk] env: LIB3MF_VERSION: ${{ needs.set-lib3mf-version.outputs.lib3mf-version }} @@ -425,13 +481,13 @@ jobs: unzip lib3mf_sdk.zip/lib3mf_sdk.zip - name: Build CppDynamic run: | - ./Examples/CppDynamic/GenerateVS2019.bat + ./Examples/CppDynamic/GenerateVS2022.bat cd Examples/CppDynamic/build cmake --build . --config Release ./Release/Example_ExtractInfo.exe ../../Files/Helix.3mf - name: Build Cpp run: | - ./Examples/Cpp/GenerateVS2019.bat + ./Examples/Cpp/GenerateVS2022.bat cd Examples/Cpp/build cmake --build . --config Release ./Release/Example_ExtractInfo.exe ../../Files/Helix.3mf @@ -452,13 +508,19 @@ jobs: unzip lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip/lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip - name: Build CppDynamic - CPack (Windows) run: | - ./SDK/CPackExamples/CppDynamic/GenerateVS2019.bat + ./SDK/CPackExamples/CppDynamic/GenerateVS2022.bat cd SDK/CPackExamples/CppDynamic/build cmake --build . --config Release ./Release/Example_ExtractInfo.exe ../../../Examples/Files/Helix.3mf + - name: Build CDynamic - CPack (Windows) + run: | + ./SDK/CPackExamples/CDynamic/GenerateVS2022.bat + cd SDK/CPackExamples/CDynamic/build + cmake --build . --config Release + ./Release/Example_CDynamic.exe - name: Build Cpp - CPack (Windows) run: | - ./SDK/CPackExamples/Cpp/GenerateVS2019.bat + ./SDK/CPackExamples/Cpp/GenerateVS2022.bat cd SDK/CPackExamples/Cpp/build cmake --build . --config Release ./Release/Example_ExtractInfo.exe ../../../Examples/Files/Helix.3mf @@ -524,6 +586,12 @@ jobs: cd SDK/CPackExamples/CppDynamic/build cmake --build . ./Example_ExtractInfo ../../../Examples/Files/Helix.3mf + - name: Build CDynamic - CPack (Darwin) + run: | + sh SDK/CPackExamples/CDynamic/GenerateMake.sh + cd SDK/CPackExamples/CDynamic/build + cmake --build . + ./Example_CDynamic - name: Build Cpp - CPack (Darwin) run: | sh SDK/CPackExamples/Cpp/GenerateMake.sh @@ -543,7 +611,7 @@ jobs: ./create_cube deploy-source-code-with-submodules: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: [ set-lib3mf-version, assemble-sdk ] env: LIB3MF_VERSION: ${{ needs.set-lib3mf-version.outputs.lib3mf-version }} @@ -563,11 +631,16 @@ jobs: set-integration-tests-status: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: [ deploy-linux, deploy-windows, deploy-macos, deploy-source-code-with-submodules ] outputs: run_integration_tests: ${{ steps.set-status.outputs.run_integration_tests }} steps: + - name: Install prerequisites + if: env.RUN_INTEGRATION_TESTS == 'on' + run: | + sudo apt-get update + sudo apt-get install -y unzip wget - name: Set status id: set-status run: | @@ -576,10 +649,34 @@ jobs: else echo "run_integration_tests=false" >> $GITHUB_OUTPUT fi + + - name: Cache 3MF test suite + if: steps.set-status.outputs.run_integration_tests == 'true' + uses: actions/cache@v5 + with: + path: ~/.cache/3mf-test-suite + key: 3mf-test-suite-v2.0.0 + + - name: Download integration test suite + if: steps.set-status.outputs.run_integration_tests == 'true' + run: | + USER="${{ secrets.THREEMF_TEST_SUITE_DOWNLOAD_USER }}" + PASS="${{ secrets.THREEMF_TEST_SUITE_DOWNLOAD_TOKEN }}" + CACHE_DIR="$HOME/.cache/3mf-test-suite" + SUITE_ZIP="3MF_Conformance_Test_Suites_v2.0.0.zip" + CACHE_ZIP="$CACHE_DIR/$SUITE_ZIP" + + mkdir -p "$CACHE_DIR" + if [ ! -f "$CACHE_ZIP" ]; then + wget --user "$USER" \ + --password "$PASS" \ + "https://storage.3mf.dev/remote.php/dav/files/$USER/3MF_CONSORTIUM/GITHUB/$SUITE_ZIP" \ + -O "$CACHE_ZIP" + fi integration-tests-latest-release: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: [set-integration-tests-status] if: needs.set-integration-tests-status.outputs.run_integration_tests == 'true' # Single check before the job starts steps: @@ -619,10 +716,17 @@ jobs: cmake --build . ./Example_ExtractInfo ../../Files/Helix.3mf - - name: Download and unzip test suite + - name: Restore 3MF test suite cache + uses: actions/cache@v5 + with: + path: ~/.cache/3mf-test-suite + key: 3mf-test-suite-v2.0.0 + + - name: Unzip integration test suite run: | - wget https://github.com/3MFConsortium/test_suites/releases/download/v2.0.0/3MF_Conformance_Test_Suites_v2.0.0.zip - unzip 3MF_Conformance_Test_Suites_v2.0.0.zip -d test_suites + rm -rf test_suites + unzip -o "$HOME/.cache/3mf-test-suite/3MF_Conformance_Test_Suites_v2.0.0.zip" -d test_suites + - name: List files run: | @@ -636,6 +740,23 @@ jobs: run: | cd test_suites && /usr/bin/time -v python integration_test.py 2>&1 | tee latest_sdk_test.log + - name: List MUSTPASS failures and MUSTFAIL passes (latest release) + run: | + echo "MUSTPASS that failed (latest release):" + grep -E 'MUSTPASS file ".*" does not work' test_suites/latest_sdk_test.log | sed -n 's/.*MUSTPASS file "\([^"]*\)".*/\1/p' | sort -u > test_suites/latest_mp_failed.txt || true + cat test_suites/latest_mp_failed.txt || true + echo "\nMUSTFAIL that passed (latest release):" + grep -E 'MUSTFAIL file ".*" works' test_suites/latest_sdk_test.log | sed -n 's/.*MUSTFAIL file "\([^"]*\)".*/\1/p' | sort -u > test_suites/latest_mf_passed.txt || true + cat test_suites/latest_mf_passed.txt || true + { + echo "### Latest release detailed results"; + echo "MUSTPASS failed: $(wc -l < test_suites/latest_mp_failed.txt 2>/dev/null || echo 0)"; + sed 's/^/- /' test_suites/latest_mp_failed.txt 2>/dev/null || true; + echo; + echo "MUSTFAIL passed: $(wc -l < test_suites/latest_mf_passed.txt 2>/dev/null || echo 0)"; + sed 's/^/- /' test_suites/latest_mf_passed.txt 2>/dev/null || true; + } >> "$GITHUB_STEP_SUMMARY" + - name: Print results (Checks the total python script execution time) run: | LATEST_TIME=$(grep "Elapsed (wall clock) time" test_suites/latest_sdk_test.log | awk '{print $8}') @@ -653,7 +774,7 @@ jobs: integration-tests-last-two-releases: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: [set-integration-tests-status] if: needs.set-integration-tests-status.outputs.run_integration_tests == 'true' # Single check before the job starts steps: @@ -701,10 +822,17 @@ jobs: mv second_latest_lib3mf_sdk/lib3mf_sdk/* second_latest_lib3mf_sdk rmdir second_latest_lib3mf_sdk/lib3mf_sdk - - name: Download and unzip test suite + - name: Restore 3MF test suite cache + uses: actions/cache@v5 + with: + path: ~/.cache/3mf-test-suite + key: 3mf-test-suite-v2.0.0 + + - name: Unzip integration test suite run: | - wget https://github.com/3MFConsortium/test_suites/releases/download/v2.0.0/3MF_Conformance_Test_Suites_v2.0.0.zip - unzip 3MF_Conformance_Test_Suites_v2.0.0.zip -d test_suites + rm -rf test_suites + unzip -o "$HOME/.cache/3mf-test-suite/3MF_Conformance_Test_Suites_v2.0.0.zip" -d test_suites + - name: Copy integration test script run: | @@ -743,6 +871,36 @@ jobs: - name: Compare results (Checks the total python script execution time and must pass/fail counts) run: | + # Extract detailed lists from logs for diffing + grep -E 'MUSTPASS file ".*" does not work' test_suites/latest_sdk_test.log | sed -n 's/.*MUSTPASS file "\([^"]*\)".*/\1/p' | sort -u > test_suites/latest_mp_failed.txt || true + grep -E 'MUSTFAIL file ".*" works' test_suites/latest_sdk_test.log | sed -n 's/.*MUSTFAIL file "\([^"]*\)".*/\1/p' | sort -u > test_suites/latest_mf_passed.txt || true + grep -E 'MUSTPASS file ".*" does not work' test_suites/second_latest_sdk_test.log | sed -n 's/.*MUSTPASS file "\([^"]*\)".*/\1/p' | sort -u > test_suites/second_latest_mp_failed.txt || true + grep -E 'MUSTFAIL file ".*" works' test_suites/second_latest_sdk_test.log | sed -n 's/.*MUSTFAIL file "\([^"]*\)".*/\1/p' | sort -u > test_suites/second_latest_mf_passed.txt || true + + echo "=== Latest MUSTPASS failed:"; cat test_suites/latest_mp_failed.txt || true + echo "=== Second Latest MUSTPASS failed:"; cat test_suites/second_latest_mp_failed.txt || true + echo "=== Latest MUSTFAIL passed:"; cat test_suites/latest_mf_passed.txt || true + echo "=== Second Latest MUSTFAIL passed:"; cat test_suites/second_latest_mf_passed.txt || true + + # Compute regressions and improvements + comm -23 test_suites/latest_mp_failed.txt test_suites/second_latest_mp_failed.txt > test_suites/regressions_mp_now_failing.txt || true + comm -23 test_suites/latest_mf_passed.txt test_suites/second_latest_mf_passed.txt > test_suites/regressions_mf_now_passing.txt || true + comm -13 test_suites/latest_mp_failed.txt test_suites/second_latest_mp_failed.txt > test_suites/improvements_mp_fixed.txt || true + comm -13 test_suites/latest_mf_passed.txt test_suites/second_latest_mf_passed.txt > test_suites/improvements_mf_fixed.txt || true + + echo "=== Regressions - MUSTPASS now failing:"; cat test_suites/regressions_mp_now_failing.txt || true + echo "=== Regressions - MUSTFAIL now passing:"; cat test_suites/regressions_mf_now_passing.txt || true + echo "=== Improvements - MUSTPASS fixed:"; cat test_suites/improvements_mp_fixed.txt || true + echo "=== Improvements - MUSTFAIL fixed:"; cat test_suites/improvements_mf_fixed.txt || true + + { + echo "### Last two releases - detailed diffs"; + echo "#### Regressions - MUSTPASS now failing"; sed 's/^/- /' test_suites/regressions_mp_now_failing.txt 2>/dev/null || true; echo; + echo "#### Regressions - MUSTFAIL now passing"; sed 's/^/- /' test_suites/regressions_mf_now_passing.txt 2>/dev/null || true; echo; + echo "#### Improvements - MUSTPASS fixed"; sed 's/^/- /' test_suites/improvements_mp_fixed.txt 2>/dev/null || true; echo; + echo "#### Improvements - MUSTFAIL fixed"; sed 's/^/- /' test_suites/improvements_mf_fixed.txt 2>/dev/null || true; echo; + } >> "$GITHUB_STEP_SUMMARY" + LATEST_TIME=$(grep "Elapsed (wall clock) time" test_suites/latest_sdk_test.log | awk '{print $8}') SECOND_LATEST_TIME=$(grep "Elapsed (wall clock) time" test_suites/second_latest_sdk_test.log | awk '{print $8}') LATEST_TOTAL_SECONDS=$(echo $LATEST_TIME | awk -F: '{ print ($1 * 60) + $2 }') @@ -773,17 +931,19 @@ jobs: fi # Compare MUSTPASS and MUSTFAIL counts - if [ "$LATEST_MUSTPASS" != "$SECOND_LATEST_MUSTPASS" ] || [ "$LATEST_MUSTFAIL" != "$SECOND_LATEST_MUSTFAIL" ]; then - echo "MUSTPASS or MUSTFAIL counts have changed" + # Allow improvements: pass if latest >= second latest for both metrics; fail only on regression + if [ "$LATEST_MUSTPASS" -lt "$SECOND_LATEST_MUSTPASS" ] || [ "$LATEST_MUSTFAIL" -lt "$SECOND_LATEST_MUSTFAIL" ]; then + echo "MUSTPASS or MUSTFAIL counts have regressed" + echo "Regressions detected. See lists above and job summary for files." exit 1 else - echo "MUSTPASS and MUSTFAIL counts are consistent" + echo "MUSTPASS and MUSTFAIL counts have improved or stayed the same" fi integration-tests-latest-commit: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: [set-integration-tests-status] if: needs.set-integration-tests-status.outputs.run_integration_tests == 'true' # Single check before the job starts steps: @@ -818,10 +978,17 @@ jobs: cmake --build . ./Example_ExtractInfo ../../Files/Helix.3mf - - name: Download and unzip test suite + - name: Restore 3MF test suite cache + uses: actions/cache@v5 + with: + path: ~/.cache/3mf-test-suite + key: 3mf-test-suite-v2.0.0 + + - name: Unzip integration test suite run: | - wget https://github.com/3MFConsortium/test_suites/releases/download/v2.0.0/3MF_Conformance_Test_Suites_v2.0.0.zip - unzip 3MF_Conformance_Test_Suites_v2.0.0.zip -d test_suites + rm -rf test_suites + unzip -o "$HOME/.cache/3mf-test-suite/3MF_Conformance_Test_Suites_v2.0.0.zip" -d test_suites + - name: Copy integration test script run: | @@ -831,6 +998,23 @@ jobs: run: | cd test_suites && /usr/bin/time -v python integration_test.py 2>&1 | tee latest_sdk_test.log + - name: List MUSTPASS failures and MUSTFAIL passes (latest commit) + run: | + echo "MUSTPASS that failed (latest commit):" + grep -E 'MUSTPASS file ".*" does not work' test_suites/latest_sdk_test.log | sed -n 's/.*MUSTPASS file "\([^"]*\)".*/\1/p' | sort -u > test_suites/latest_commit_mp_failed.txt || true + cat test_suites/latest_commit_mp_failed.txt || true + echo "\nMUSTFAIL that passed (latest commit):" + grep -E 'MUSTFAIL file ".*" works' test_suites/latest_sdk_test.log | sed -n 's/.*MUSTFAIL file "\([^"]*\)".*/\1/p' | sort -u > test_suites/latest_commit_mf_passed.txt || true + cat test_suites/latest_commit_mf_passed.txt || true + { + echo "### Latest commit detailed results"; + echo "MUSTPASS failed: $(wc -l < test_suites/latest_commit_mp_failed.txt 2>/dev/null || echo 0)"; + sed 's/^/- /' test_suites/latest_commit_mp_failed.txt 2>/dev/null || true; + echo; + echo "MUSTFAIL passed: $(wc -l < test_suites/latest_commit_mf_passed.txt 2>/dev/null || echo 0)"; + sed 's/^/- /' test_suites/latest_commit_mf_passed.txt 2>/dev/null || true; + } >> "$GITHUB_STEP_SUMMARY" + - name: Print results (Checks the total python script execution time) run: | LATEST_TIME=$(grep "Elapsed (wall clock) time" test_suites/latest_sdk_test.log | awk '{print $8}') @@ -852,7 +1036,7 @@ jobs: echo "LATEST_TOTAL_MUSTFAIL=${LATEST_TOTAL_MUSTFAIL}" >> $GITHUB_ENV integration-test-last-commit-and-last-release: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: [set-integration-tests-status] if: needs.set-integration-tests-status.outputs.run_integration_tests == 'true' # Single check before the job starts steps: @@ -888,10 +1072,17 @@ jobs: cmake --build . ./Example_ExtractInfo ../../Files/Helix.3mf - - name: Download and unzip test suite + - name: Restore 3MF test suite cache + uses: actions/cache@v5 + with: + path: ~/.cache/3mf-test-suite + key: 3mf-test-suite-v2.0.0 + + - name: Unzip integration test suite run: | - wget https://github.com/3MFConsortium/test_suites/releases/download/v2.0.0/3MF_Conformance_Test_Suites_v2.0.0.zip - unzip 3MF_Conformance_Test_Suites_v2.0.0.zip -d test_suites + rm -rf test_suites + unzip -o "$HOME/.cache/3mf-test-suite/3MF_Conformance_Test_Suites_v2.0.0.zip" -d test_suites + - name: Copy integration test script run: | @@ -944,6 +1135,17 @@ jobs: - name: Compare results (Checks the total python script execution time) id: compare_results run: | + # Extract detailed lists from logs for diffing + grep -E 'MUSTPASS file ".*" does not work' test_suites/latest_commit_sdk_test.log | sed -n 's/.*MUSTPASS file "\([^"]*\)".*/\1/p' | sort -u > test_suites/latest_commit_mp_failed.txt || true + grep -E 'MUSTFAIL file ".*" works' test_suites/latest_commit_sdk_test.log | sed -n 's/.*MUSTFAIL file "\([^"]*\)".*/\1/p' | sort -u > test_suites/latest_commit_mf_passed.txt || true + grep -E 'MUSTPASS file ".*" does not work' test_suites/latest_release_sdk_test.log | sed -n 's/.*MUSTPASS file "\([^"]*\)".*/\1/p' | sort -u > test_suites/latest_release_mp_failed.txt || true + grep -E 'MUSTFAIL file ".*" works' test_suites/latest_release_sdk_test.log | sed -n 's/.*MUSTFAIL file "\([^"]*\)".*/\1/p' | sort -u > test_suites/latest_release_mf_passed.txt || true + + echo "=== Latest commit MUSTPASS failed:"; cat test_suites/latest_commit_mp_failed.txt || true + echo "=== Latest release MUSTPASS failed:"; cat test_suites/latest_release_mp_failed.txt || true + echo "=== Latest commit MUSTFAIL passed:"; cat test_suites/latest_commit_mf_passed.txt || true + echo "=== Latest release MUSTFAIL passed:"; cat test_suites/latest_release_mf_passed.txt || true + LATEST_COMMIT_TIME=$(grep "Elapsed (wall clock) time" test_suites/latest_commit_sdk_test.log | awk '{print $8}') LATEST_RELEASE_TIME=$(grep "Elapsed (wall clock) time" test_suites/latest_release_sdk_test.log | awk '{print $8}') LATEST_COMMIT_TOTAL_SECONDS=$(echo $LATEST_COMMIT_TIME | awk -F: '{ print ($1 * 60) + $2 }') @@ -967,11 +1169,22 @@ jobs: echo "Latest release MUSTFAIL: ${LATEST_RELEASE_MUSTFAIL} / ${LATEST_TOTAL_RELEASE_MUSTFAIL}" # Compare MUSTPASS and MUSTFAIL counts - if [ "$LATEST_COMMIT_MUSTPASS" != "$LATEST_RELEASE_MUSTPASS" ] || [ "$LATEST_COMMIT_MUSTFAIL" != "$LATEST_RELEASE_MUSTFAIL" ]; then - echo "MUSTPASS or MUSTFAIL counts have changed" + # Allow improvements: pass if latest commit >= latest release for both metrics; fail only on regression + if [ "$LATEST_COMMIT_MUSTPASS" -lt "$LATEST_RELEASE_MUSTPASS" ] || [ "$LATEST_COMMIT_MUSTFAIL" -lt "$LATEST_RELEASE_MUSTFAIL" ]; then + echo "MUSTPASS or MUSTFAIL counts have regressed" + # Highlight exactly which files changed outcome + comm -23 test_suites/latest_commit_mp_failed.txt test_suites/latest_release_mp_failed.txt > test_suites/regressions_commit_mp_now_failing.txt || true + comm -23 test_suites/latest_commit_mf_passed.txt test_suites/latest_release_mf_passed.txt > test_suites/regressions_commit_mf_now_passing.txt || true + echo "=== Regressions (commit vs release) - MUSTPASS now failing:"; cat test_suites/regressions_commit_mp_now_failing.txt || true + echo "=== Regressions (commit vs release) - MUSTFAIL now passing:"; cat test_suites/regressions_commit_mf_now_passing.txt || true + { + echo "### Latest commit vs latest release - regressions"; + echo "#### MUSTPASS now failing"; sed 's/^/- /' test_suites/regressions_commit_mp_now_failing.txt 2>/dev/null || true; echo; + echo "#### MUSTFAIL now passing"; sed 's/^/- /' test_suites/regressions_commit_mf_now_passing.txt 2>/dev/null || true; echo; + } >> "$GITHUB_STEP_SUMMARY" exit 1 else - echo "MUSTPASS and MUSTFAIL counts are consistent" + echo "MUSTPASS and MUSTFAIL counts have improved or stayed the same" fi # Compare the total seconds @@ -992,4 +1205,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: integration-test-results - path: results.txt \ No newline at end of file + path: results.txt diff --git a/.gitignore b/.gitignore index 85501469d..be4a573f7 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,6 @@ SetupWriteRead5.3mf v093reout.3mf .vs .idea -cmake-build-* \ No newline at end of file +cmake-build-* +TODO.md +Testing diff --git a/Autogenerated/Bindings/C/lib3mf.h b/Autogenerated/Bindings/C/lib3mf.h index f75df4012..c6713a407 100644 --- a/Autogenerated/Bindings/C/lib3mf.h +++ b/Autogenerated/Bindings/C/lib3mf.h @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated plain C Header file in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -497,6 +497,19 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobjectiterator_getcurrentmeshobject(Lib3 */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobjectiterator_getcurrentcomponentsobject(Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); +/************************************************************************************************************************* + Class definition for BooleanObjectIterator +**************************************************************************************************************************/ + +/** +* Returns the BooleanObject the iterator points at. +* +* @param[in] pBooleanObjectIterator - BooleanObjectIterator instance. +* @param[out] pResource - returns the BooleanObject instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobjectiterator_getcurrentbooleanobject(Lib3MF_BooleanObjectIterator pBooleanObjectIterator, Lib3MF_BooleanObject * pResource); + /************************************************************************************************************************* Class definition for Texture2DIterator **************************************************************************************************************************/ @@ -1011,6 +1024,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_iscomponentsobject(Lib3MF_Object pObj */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_islevelsetobject(Lib3MF_Object pObject, bool * pIsLevelSetObject); +/** +* Retrieves, if an object is a boolean object +* +* @param[in] pObject - Object instance. +* @param[out] pIsBooleanObject - returns, whether the object is a boolean object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_isbooleanobject(Lib3MF_Object pObject, bool * pIsBooleanObject); + /** * Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * @@ -1561,6 +1583,140 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_getvolumedata(Lib3MF_LevelSet pLeve */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_setvolumedata(Lib3MF_LevelSet pLevelSet, Lib3MF_VolumeData pTheVolumeData); +/************************************************************************************************************************* + Class definition for BooleanObject +**************************************************************************************************************************/ + +/** +* Sets the base object and transform for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pBaseObject - base object of the boolean shape +* @param[in] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_setbaseobject(Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object pBaseObject, const sLib3MFTransform * pTransform); + +/** +* Returns the base object of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pBaseObject - base object of the boolean shape +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getbaseobject(Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object * pBaseObject); + +/** +* Sets the base transform of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_setbasetransform(Lib3MF_BooleanObject pBooleanObject, const sLib3MFTransform * pTransform); + +/** +* Returns the base transform of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getbasetransform(Lib3MF_BooleanObject pBooleanObject, sLib3MFTransform * pTransform); + +/** +* Sets the boolean operation used for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] eOperation - boolean operation used for the shape +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_setoperation(Lib3MF_BooleanObject pBooleanObject, eLib3MFBooleanOperation eOperation); + +/** +* Returns the boolean operation used for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pOperation - boolean operation used for the shape +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getoperation(Lib3MF_BooleanObject pBooleanObject, eLib3MFBooleanOperation * pOperation); + +/** +* Enables or disables CSG field evaluation for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] bCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_setcsgmodeenabled(Lib3MF_BooleanObject pBooleanObject, bool bCSGModeEnabled); + +/** +* Returns whether CSG field evaluation is enabled for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getcsgmodeenabled(Lib3MF_BooleanObject pBooleanObject, bool * pCSGModeEnabled); + +/** +* Sets the extraction grid resolution used for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] nGridResolution - extraction grid resolution for boolean surface extraction +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_setextractiongridresolution(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nGridResolution); + +/** +* Returns the extraction grid resolution used for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pGridResolution - extraction grid resolution for boolean surface extraction +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getextractiongridresolution(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pGridResolution); + +/** +* Returns the number of operands in the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pCount - number of operands in the boolean sequence +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getoperandcount(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pCount); + +/** +* Adds an operand object to the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pOperandObject - mesh object used as operand +* @param[in] pTransform - transform applied to the operand object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_addoperand(Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject pOperandObject, const sLib3MFTransform * pTransform); + +/** +* Returns one operand object and transform from the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] nIndex - index of the operand in the boolean sequence +* @param[out] pOperandObject - mesh object used as operand +* @param[out] pTransform - transform applied to the operand object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getoperand(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nIndex, Lib3MF_MeshObject * pOperandObject, sLib3MFTransform * pTransform); + +/** +* Materializes the boolean shape into a newly created mesh object. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pMeshObject - new mesh object containing the tessellated boolean shape +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_mergetomeshobject(Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject * pMeshObject); + /************************************************************************************************************************* Class definition for BeamLattice **************************************************************************************************************************/ @@ -1926,7 +2082,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_setbasematerialgroup(Lib LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_getmaterialmappingcount(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 * pCount); /** -* Returns MaterialMappting with given index +* Returns MaterialMapping with given index * * @param[in] pVolumeDataComposite - VolumeDataComposite instance. * @param[in] nIndex - Index of the MaterialMapping in question. @@ -1936,7 +2092,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_getmaterialmappingcount( LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_getmaterialmapping(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 nIndex, Lib3MF_MaterialMapping * pTheMaterialMapping); /** -* Adds a the MaterialMapping +* Adds a MaterialMapping * * @param[in] pVolumeDataComposite - VolumeDataComposite instance. * @param[in] pTransform - new transformation matrix @@ -2048,7 +2204,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedata_removecolor(Lib3MF_VolumeData pVo * Returns the number of VolumeDataProperty * * @param[in] pVolumeData - VolumeData instance. -* @param[out] pCount - the number of VolumeDataProperty-elements within this VolumdeData +* @param[out] pCount - the number of VolumeDataProperty-elements within this VolumeData * @return error code or 0 (success) */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedata_getpropertycount(Lib3MF_VolumeData pVolumeData, Lib3MF_uint32 * pCount); @@ -2873,7 +3029,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_setrelationshiptype(Lib3MF_Attach LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAttachment, const char * pFileName); /** -* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * * @param[in] pAttachment - Attachment instance. * @param[in] pFileName - file to read from. @@ -2882,7 +3038,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAt LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfromfile(Lib3MF_Attachment pAttachment, const char * pFileName); /** -* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * * @param[in] pAttachment - Attachment instance. * @param[in] pTheReadCallback - Callback to call for reading a data chunk @@ -2914,7 +3070,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getstreamsize(Lib3MF_Attachment p LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetobuffer(Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); /** -* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* Reads an attachment from a memory buffer. This buffer is immediately read (in contrast to the ReadFromCallback and ReadFromFile-methods). * * @param[in] pAttachment - Attachment instance. * @param[in] nBufferBufferSize - Number of elements in buffer @@ -4026,6 +4182,233 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_unsignedmeshnode_getinputpos(Lib3MF_Unsigned */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_unsignedmeshnode_getoutputdistance(Lib3MF_UnsignedMeshNode pUnsignedMeshNode, Lib3MF_ImplicitPort * pDistance); +/************************************************************************************************************************* + Class definition for BeamLatticeNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the model resource id of the beam lattice +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pBeamLattice - the input port for the model resource id of the beam lattice (mesh with beamlattice extension) +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_getinputbeamlattice(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pBeamLattice); + +/** +* Retrieves the input for the position +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_getinputpos(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the output +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pDistance - the output port for the signed distance to the beam lattice +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_getoutputdistance(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pDistance); + +/** +* Sets the accurate range for distance computation +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[in] dAccurateRange - the accurate range in model units +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_setaccuraterange(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double dAccurateRange); + +/** +* Retrieves the accurate range for distance computation +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pAccurateRange - the accurate range in model units +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_getaccuraterange(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double * pAccurateRange); + +/************************************************************************************************************************* + Class definition for FunctionGradientNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the function id +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pFunction - the input port for the function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getinputfunctionid(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pFunction); + +/** +* Retrieves the input for the position +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getinputpos(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the input for the finite difference step +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pStep - the input port for the finite difference step +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getinputstep(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pStep); + +/** +* Sets the name of the referenced scalar output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] pScalarOutputName - the name of the scalar output of the referenced function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_setscalaroutputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pScalarOutputName); + +/** +* Retrieves the name of the referenced scalar output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getscalaroutputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + +/** +* Sets the name of the referenced vector input +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_setvectorinputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pVectorInputName); + +/** +* Retrieves the name of the referenced vector input +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getvectorinputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + +/** +* Retrieves the normalized gradient output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pNormalizedGradient - the output port for the normalized gradient +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getoutputnormalizedgradient(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pNormalizedGradient); + +/** +* Retrieves the raw gradient output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pGradient - the output port for the raw gradient +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getoutputgradient(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pGradient); + +/** +* Retrieves the gradient magnitude output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pMagnitude - the output port for the gradient magnitude +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getoutputmagnitude(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pMagnitude); + +/************************************************************************************************************************* + Class definition for NormalizeDistanceNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the function id +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pFunction - the input port for the function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getinputfunctionid(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pFunction); + +/** +* Retrieves the input for the position +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pPos - the input port for the position (vector) +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getinputpos(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the input for the finite difference step +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pStep - the input port for the finite difference step +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getinputstep(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pStep); + +/** +* Sets the name of the referenced scalar output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] pScalarOutputName - the name of the scalar output of the referenced function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_setscalaroutputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pScalarOutputName); + +/** +* Retrieves the name of the referenced scalar output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getscalaroutputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + +/** +* Sets the name of the referenced vector input +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_setvectorinputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pVectorInputName); + +/** +* Retrieves the name of the referenced vector input +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getvectorinputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + +/** +* Retrieves the normalized result output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pResult - the output port for the normalized distance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getoutputresult(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pResult); + /************************************************************************************************************************* Class definition for FunctionCallNode **************************************************************************************************************************/ @@ -4801,6 +5184,42 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addmeshnode(Lib3MF_Implicit */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addunsignedmeshnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_UnsignedMeshNode * pNode); +/** +* Add a BeamLatticeNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addbeamlatticenode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_BeamLatticeNode * pNode); + +/** +* Add a FunctionGradientNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addfunctiongradientnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_FunctionGradientNode * pNode); + +/** +* Add a NormalizeDistanceNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addnormalizedistancenode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_NormalizeDistanceNode * pNode); + /** * Add a FunctionCallNode * @@ -5915,6 +6334,16 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getmeshobjectbyid(Lib3MF_Model pModel, */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getcomponentsobjectbyid(Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_ComponentsObject * pComponentsObjectInstance); +/** +* finds a boolean object by its UniqueResourceID +* +* @param[in] pModel - Model instance. +* @param[in] nUniqueResourceID - UniqueResourceID +* @param[out] pBooleanObjectInstance - returns the boolean object instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getbooleanobjectbyid(Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_BooleanObject * pBooleanObjectInstance); + /** * finds a model color group by its UniqueResourceID * @@ -6020,6 +6449,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getmeshobjects(Lib3MF_Model pModel, Li */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getcomponentsobjects(Lib3MF_Model pModel, Lib3MF_ComponentsObjectIterator * pResourceIterator); +/** +* creates a resource iterator instance with all boolean object resources. +* +* @param[in] pModel - Model instance. +* @param[out] pResourceIterator - returns the iterator instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getbooleanobjects(Lib3MF_Model pModel, Lib3MF_BooleanObjectIterator * pResourceIterator); + /** * creates a Texture2DIterator instance with all texture2d resources. * @@ -6128,6 +6566,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addmeshobject(Lib3MF_Model pModel, Lib */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addcomponentsobject(Lib3MF_Model pModel, Lib3MF_ComponentsObject * pComponentsObjectInstance); +/** +* adds an empty boolean object to the model. +* +* @param[in] pModel - Model instance. +* @param[out] pBooleanObjectInstance - returns the boolean object instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addbooleanobject(Lib3MF_Model pModel, Lib3MF_BooleanObject * pBooleanObjectInstance); + /** * creates a new model slicestack by its id * diff --git a/Autogenerated/Bindings/C/lib3mf_types.h b/Autogenerated/Bindings/C/lib3mf_types.h index 5df0da2fd..b9e4aec27 100644 --- a/Autogenerated/Bindings/C/lib3mf_types.h +++ b/Autogenerated/Bindings/C/lib3mf_types.h @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated plain C Header file with basic types in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -84,7 +84,7 @@ typedef void * Lib3MF_pvoid; **************************************************************************************************************************/ #define LIB3MF_VERSION_MAJOR 2 -#define LIB3MF_VERSION_MINOR 4 +#define LIB3MF_VERSION_MINOR 6 #define LIB3MF_VERSION_MICRO 0 #define LIB3MF_VERSION_PRERELEASEINFO "" #define LIB3MF_VERSION_BUILDINFO "" @@ -220,6 +220,7 @@ typedef Lib3MFHandle Lib3MF_SliceStackIterator; typedef Lib3MFHandle Lib3MF_ObjectIterator; typedef Lib3MFHandle Lib3MF_MeshObjectIterator; typedef Lib3MFHandle Lib3MF_ComponentsObjectIterator; +typedef Lib3MFHandle Lib3MF_BooleanObjectIterator; typedef Lib3MFHandle Lib3MF_Texture2DIterator; typedef Lib3MFHandle Lib3MF_BaseMaterialGroupIterator; typedef Lib3MFHandle Lib3MF_ColorGroupIterator; @@ -235,6 +236,7 @@ typedef Lib3MFHandle Lib3MF_TriangleSet; typedef Lib3MFHandle Lib3MF_Object; typedef Lib3MFHandle Lib3MF_MeshObject; typedef Lib3MFHandle Lib3MF_LevelSet; +typedef Lib3MFHandle Lib3MF_BooleanObject; typedef Lib3MFHandle Lib3MF_BeamLattice; typedef Lib3MFHandle Lib3MF_FunctionReference; typedef Lib3MFHandle Lib3MF_VolumeDataColor; @@ -310,6 +312,9 @@ typedef Lib3MFHandle Lib3MF_ConstVecNode; typedef Lib3MFHandle Lib3MF_ConstMatNode; typedef Lib3MFHandle Lib3MF_MeshNode; typedef Lib3MFHandle Lib3MF_UnsignedMeshNode; +typedef Lib3MFHandle Lib3MF_BeamLatticeNode; +typedef Lib3MFHandle Lib3MF_FunctionGradientNode; +typedef Lib3MFHandle Lib3MF_NormalizeDistanceNode; typedef Lib3MFHandle Lib3MF_FunctionCallNode; typedef Lib3MFHandle Lib3MF_NodeIterator; typedef Lib3MFHandle Lib3MF_Function; @@ -358,9 +363,16 @@ typedef enum eLib3MFObjectType { eObjectTypeOther = 0, eObjectTypeModel = 1, eObjectTypeSupport = 2, - eObjectTypeSolidSupport = 3 + eObjectTypeSolidSupport = 3, + eObjectTypeSurface = 4 } eLib3MFObjectType; +typedef enum eLib3MFBooleanOperation { + eBooleanOperationUnion = 0, + eBooleanOperationDifference = 1, + eBooleanOperationIntersection = 2 +} eLib3MFBooleanOperation; + typedef enum eLib3MFTextureType { eTextureTypeUnknown = 0, eTextureTypePNG = 1, @@ -472,11 +484,11 @@ typedef enum eLib3MFImplicitNodeType { eImplicitNodeTypeMatVecMultiplication = 14, /** Multiplies a matrix with a vector */ eImplicitNodeTypeTranspose = 15, /** Transposes a matrix */ eImplicitNodeTypeInverse = 16, /** Computes the inverse of a matrix */ - eImplicitNodeTypeSinus = 17, /** Calculates the sinus */ - eImplicitNodeTypeCosinus = 18, /** Calculates the cosinus */ + eImplicitNodeTypeSinus = 17, /** Calculates the sine */ + eImplicitNodeTypeCosinus = 18, /** Calculates the cosine */ eImplicitNodeTypeTan = 19, /** Calculates the tangent */ - eImplicitNodeTypeArcSin = 20, /** Calculates the arcsinus */ - eImplicitNodeTypeArcCos = 21, /** Calculates the arccosinus */ + eImplicitNodeTypeArcSin = 20, /** Calculates the arcsine */ + eImplicitNodeTypeArcCos = 21, /** Calculates the arccosine */ eImplicitNodeTypeArcTan = 22, /** Calculates the arctangent */ eImplicitNodeTypeArcTan2 = 23, /** Calculates the arctangent */ eImplicitNodeTypeMin = 24, /** Calculates the minimum of two values */ @@ -486,9 +498,9 @@ typedef enum eLib3MFImplicitNodeType { eImplicitNodeTypePow = 28, /** Calculates the power A^B */ eImplicitNodeTypeSqrt = 29, /** Calculates the square root */ eImplicitNodeTypeExp = 30, /** Exponential function */ - eImplicitNodeTypeLog = 31, /** Natural logarithmus */ - eImplicitNodeTypeLog2 = 32, /** Logarithmus to the base 2 */ - eImplicitNodeTypeLog10 = 33, /** Logarithmus to the base 10 */ + eImplicitNodeTypeLog = 31, /** Natural logarithm */ + eImplicitNodeTypeLog2 = 32, /** Logarithm to the base 2 */ + eImplicitNodeTypeLog10 = 33, /** Logarithm to the base 10 */ eImplicitNodeTypeSelect = 34, /** If A is less than B returns C, else D */ eImplicitNodeTypeClamp = 35, /** Clamps the input value to min and max */ eImplicitNodeTypeSinh = 36, /** Calculates the hyperbolic sine */ @@ -503,9 +515,12 @@ typedef enum eLib3MFImplicitNodeType { eImplicitNodeTypeMesh = 45, /** Calculates the signed distance to a mesh */ eImplicitNodeTypeLength = 46, /** Calculates the length of a vector */ eImplicitNodeTypeConstResourceID = 47, /** Selects a resource (function, mesh etc.) */ - eImplicitNodeTypeVectorFromScalar = 48, /** Creates a vector from one scalar values */ + eImplicitNodeTypeVectorFromScalar = 48, /** Creates a vector from one scalar value */ eImplicitNodeTypeUnsignedMesh = 49, /** Calculates the unsigned distance to a mesh */ - eImplicitNodeTypeMod = 50 /** Calculates the modulo of two values (same behaviour as glsl mod) */ + eImplicitNodeTypeMod = 50, /** Calculates the modulo of two values (same behaviour as glsl mod) */ + eImplicitNodeTypeBeamLattice = 51, /** Calculates the signed distance to a beam lattice */ + eImplicitNodeTypeFunctionGradient = 52, /** Calculates the gradient of a function */ + eImplicitNodeTypeNormalizeDistance = 53 /** Normalizes a distance field */ } eLib3MFImplicitNodeType; /** @@ -578,6 +593,11 @@ typedef union { int m_code; } structEnumLib3MFObjectType; +typedef union { + eLib3MFBooleanOperation m_enum; + int m_code; +} structEnumLib3MFBooleanOperation; + typedef union { eLib3MFTextureType m_enum; int m_code; diff --git a/Autogenerated/Bindings/CDynamic/lib3mf_dynamic.cc b/Autogenerated/Bindings/CDynamic/lib3mf_dynamic.cc index c687178fc..550350f35 100644 --- a/Autogenerated/Bindings/CDynamic/lib3mf_dynamic.cc +++ b/Autogenerated/Bindings/CDynamic/lib3mf_dynamic.cc @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated plain C Header file in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -90,6 +90,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_ObjectIterator_GetCurrentObject = NULL; pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = NULL; pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = NULL; + pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject = NULL; pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = NULL; pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = NULL; pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = NULL; @@ -138,6 +139,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Object_IsMeshObject = NULL; pWrapperTable->m_Object_IsComponentsObject = NULL; pWrapperTable->m_Object_IsLevelSetObject = NULL; + pWrapperTable->m_Object_IsBooleanObject = NULL; pWrapperTable->m_Object_IsValid = NULL; pWrapperTable->m_Object_SetAttachmentAsThumbnail = NULL; pWrapperTable->m_Object_GetThumbnailAttachment = NULL; @@ -195,6 +197,20 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_LevelSet_GetMesh = NULL; pWrapperTable->m_LevelSet_GetVolumeData = NULL; pWrapperTable->m_LevelSet_SetVolumeData = NULL; + pWrapperTable->m_BooleanObject_SetBaseObject = NULL; + pWrapperTable->m_BooleanObject_GetBaseObject = NULL; + pWrapperTable->m_BooleanObject_SetBaseTransform = NULL; + pWrapperTable->m_BooleanObject_GetBaseTransform = NULL; + pWrapperTable->m_BooleanObject_SetOperation = NULL; + pWrapperTable->m_BooleanObject_GetOperation = NULL; + pWrapperTable->m_BooleanObject_SetCSGModeEnabled = NULL; + pWrapperTable->m_BooleanObject_GetCSGModeEnabled = NULL; + pWrapperTable->m_BooleanObject_SetExtractionGridResolution = NULL; + pWrapperTable->m_BooleanObject_GetExtractionGridResolution = NULL; + pWrapperTable->m_BooleanObject_GetOperandCount = NULL; + pWrapperTable->m_BooleanObject_AddOperand = NULL; + pWrapperTable->m_BooleanObject_GetOperand = NULL; + pWrapperTable->m_BooleanObject_MergeToMeshObject = NULL; pWrapperTable->m_BeamLattice_GetMinLength = NULL; pWrapperTable->m_BeamLattice_SetMinLength = NULL; pWrapperTable->m_BeamLattice_GetClipping = NULL; @@ -422,6 +438,29 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_UnsignedMeshNode_GetInputMesh = NULL; pWrapperTable->m_UnsignedMeshNode_GetInputPos = NULL; pWrapperTable->m_UnsignedMeshNode_GetOutputDistance = NULL; + pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice = NULL; + pWrapperTable->m_BeamLatticeNode_GetInputPos = NULL; + pWrapperTable->m_BeamLatticeNode_GetOutputDistance = NULL; + pWrapperTable->m_BeamLatticeNode_SetAccurateRange = NULL; + pWrapperTable->m_BeamLatticeNode_GetAccurateRange = NULL; + pWrapperTable->m_FunctionGradientNode_GetInputFunctionID = NULL; + pWrapperTable->m_FunctionGradientNode_GetInputPos = NULL; + pWrapperTable->m_FunctionGradientNode_GetInputStep = NULL; + pWrapperTable->m_FunctionGradientNode_SetScalarOutputName = NULL; + pWrapperTable->m_FunctionGradientNode_GetScalarOutputName = NULL; + pWrapperTable->m_FunctionGradientNode_SetVectorInputName = NULL; + pWrapperTable->m_FunctionGradientNode_GetVectorInputName = NULL; + pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient = NULL; + pWrapperTable->m_FunctionGradientNode_GetOutputGradient = NULL; + pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetInputPos = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetInputStep = NULL; + pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName = NULL; + pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetOutputResult = NULL; pWrapperTable->m_FunctionCallNode_GetInputFunctionID = NULL; pWrapperTable->m_NodeIterator_GetCurrent = NULL; pWrapperTable->m_Function_GetDisplayName = NULL; @@ -485,6 +524,9 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_ImplicitFunction_AddConstMatNode = NULL; pWrapperTable->m_ImplicitFunction_AddMeshNode = NULL; pWrapperTable->m_ImplicitFunction_AddUnsignedMeshNode = NULL; + pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode = NULL; + pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode = NULL; + pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode = NULL; pWrapperTable->m_ImplicitFunction_AddFunctionCallNode = NULL; pWrapperTable->m_ImplicitFunction_GetNodes = NULL; pWrapperTable->m_ImplicitFunction_RemoveNode = NULL; @@ -594,6 +636,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_GetMultiPropertyGroupByID = NULL; pWrapperTable->m_Model_GetMeshObjectByID = NULL; pWrapperTable->m_Model_GetComponentsObjectByID = NULL; + pWrapperTable->m_Model_GetBooleanObjectByID = NULL; pWrapperTable->m_Model_GetColorGroupByID = NULL; pWrapperTable->m_Model_GetSliceStackByID = NULL; pWrapperTable->m_Model_GetLevelSetByID = NULL; @@ -605,6 +648,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_GetObjects = NULL; pWrapperTable->m_Model_GetMeshObjects = NULL; pWrapperTable->m_Model_GetComponentsObjects = NULL; + pWrapperTable->m_Model_GetBooleanObjects = NULL; pWrapperTable->m_Model_GetTexture2Ds = NULL; pWrapperTable->m_Model_GetBaseMaterialGroups = NULL; pWrapperTable->m_Model_GetColorGroups = NULL; @@ -617,6 +661,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_MergeFromModel = NULL; pWrapperTable->m_Model_AddMeshObject = NULL; pWrapperTable->m_Model_AddComponentsObject = NULL; + pWrapperTable->m_Model_AddBooleanObject = NULL; pWrapperTable->m_Model_AddSliceStack = NULL; pWrapperTable->m_Model_AddTexture2DFromAttachment = NULL; pWrapperTable->m_Model_AddBaseMaterialGroup = NULL; @@ -1100,6 +1145,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject = (PLib3MFBooleanObjectIterator_GetCurrentBooleanObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobjectiterator_getcurrentbooleanobject"); + #else // _WIN32 + pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject = (PLib3MFBooleanObjectIterator_GetCurrentBooleanObjectPtr) dlsym(hLibrary, "lib3mf_booleanobjectiterator_getcurrentbooleanobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); #else // _WIN32 @@ -1532,6 +1586,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Object_IsLevelSetObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Object_IsBooleanObject = (PLib3MFObject_IsBooleanObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_isbooleanobject"); + #else // _WIN32 + pWrapperTable->m_Object_IsBooleanObject = (PLib3MFObject_IsBooleanObjectPtr) dlsym(hLibrary, "lib3mf_object_isbooleanobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_IsBooleanObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) GetProcAddress(hLibrary, "lib3mf_object_isvalid"); #else // _WIN32 @@ -2045,6 +2108,132 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_LevelSet_SetVolumeData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetBaseObject = (PLib3MFBooleanObject_SetBaseObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setbaseobject"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetBaseObject = (PLib3MFBooleanObject_SetBaseObjectPtr) dlsym(hLibrary, "lib3mf_booleanobject_setbaseobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetBaseObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetBaseObject = (PLib3MFBooleanObject_GetBaseObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getbaseobject"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetBaseObject = (PLib3MFBooleanObject_GetBaseObjectPtr) dlsym(hLibrary, "lib3mf_booleanobject_getbaseobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetBaseObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetBaseTransform = (PLib3MFBooleanObject_SetBaseTransformPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setbasetransform"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetBaseTransform = (PLib3MFBooleanObject_SetBaseTransformPtr) dlsym(hLibrary, "lib3mf_booleanobject_setbasetransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetBaseTransform == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetBaseTransform = (PLib3MFBooleanObject_GetBaseTransformPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getbasetransform"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetBaseTransform = (PLib3MFBooleanObject_GetBaseTransformPtr) dlsym(hLibrary, "lib3mf_booleanobject_getbasetransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetBaseTransform == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetOperation = (PLib3MFBooleanObject_SetOperationPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setoperation"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetOperation = (PLib3MFBooleanObject_SetOperationPtr) dlsym(hLibrary, "lib3mf_booleanobject_setoperation"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetOperation == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetOperation = (PLib3MFBooleanObject_GetOperationPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getoperation"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetOperation = (PLib3MFBooleanObject_GetOperationPtr) dlsym(hLibrary, "lib3mf_booleanobject_getoperation"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetOperation == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetCSGModeEnabled = (PLib3MFBooleanObject_SetCSGModeEnabledPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setcsgmodeenabled"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetCSGModeEnabled = (PLib3MFBooleanObject_SetCSGModeEnabledPtr) dlsym(hLibrary, "lib3mf_booleanobject_setcsgmodeenabled"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetCSGModeEnabled == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetCSGModeEnabled = (PLib3MFBooleanObject_GetCSGModeEnabledPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getcsgmodeenabled"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetCSGModeEnabled = (PLib3MFBooleanObject_GetCSGModeEnabledPtr) dlsym(hLibrary, "lib3mf_booleanobject_getcsgmodeenabled"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetCSGModeEnabled == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetExtractionGridResolution = (PLib3MFBooleanObject_SetExtractionGridResolutionPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setextractiongridresolution"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetExtractionGridResolution = (PLib3MFBooleanObject_SetExtractionGridResolutionPtr) dlsym(hLibrary, "lib3mf_booleanobject_setextractiongridresolution"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetExtractionGridResolution == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetExtractionGridResolution = (PLib3MFBooleanObject_GetExtractionGridResolutionPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getextractiongridresolution"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetExtractionGridResolution = (PLib3MFBooleanObject_GetExtractionGridResolutionPtr) dlsym(hLibrary, "lib3mf_booleanobject_getextractiongridresolution"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetExtractionGridResolution == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetOperandCount = (PLib3MFBooleanObject_GetOperandCountPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getoperandcount"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetOperandCount = (PLib3MFBooleanObject_GetOperandCountPtr) dlsym(hLibrary, "lib3mf_booleanobject_getoperandcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetOperandCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_AddOperand = (PLib3MFBooleanObject_AddOperandPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_addoperand"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_AddOperand = (PLib3MFBooleanObject_AddOperandPtr) dlsym(hLibrary, "lib3mf_booleanobject_addoperand"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_AddOperand == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetOperand = (PLib3MFBooleanObject_GetOperandPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getoperand"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetOperand = (PLib3MFBooleanObject_GetOperandPtr) dlsym(hLibrary, "lib3mf_booleanobject_getoperand"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetOperand == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_MergeToMeshObject = (PLib3MFBooleanObject_MergeToMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_mergetomeshobject"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_MergeToMeshObject = (PLib3MFBooleanObject_MergeToMeshObjectPtr) dlsym(hLibrary, "lib3mf_booleanobject_mergetomeshobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_MergeToMeshObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getminlength"); #else // _WIN32 @@ -4088,6 +4277,213 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_UnsignedMeshNode_GetOutputDistance == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice = (PLib3MFBeamLatticeNode_GetInputBeamLatticePtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_getinputbeamlattice"); + #else // _WIN32 + pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice = (PLib3MFBeamLatticeNode_GetInputBeamLatticePtr) dlsym(hLibrary, "lib3mf_beamlatticenode_getinputbeamlattice"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLatticeNode_GetInputPos = (PLib3MFBeamLatticeNode_GetInputPosPtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_getinputpos"); + #else // _WIN32 + pWrapperTable->m_BeamLatticeNode_GetInputPos = (PLib3MFBeamLatticeNode_GetInputPosPtr) dlsym(hLibrary, "lib3mf_beamlatticenode_getinputpos"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLatticeNode_GetInputPos == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLatticeNode_GetOutputDistance = (PLib3MFBeamLatticeNode_GetOutputDistancePtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_getoutputdistance"); + #else // _WIN32 + pWrapperTable->m_BeamLatticeNode_GetOutputDistance = (PLib3MFBeamLatticeNode_GetOutputDistancePtr) dlsym(hLibrary, "lib3mf_beamlatticenode_getoutputdistance"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLatticeNode_GetOutputDistance == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLatticeNode_SetAccurateRange = (PLib3MFBeamLatticeNode_SetAccurateRangePtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_setaccuraterange"); + #else // _WIN32 + pWrapperTable->m_BeamLatticeNode_SetAccurateRange = (PLib3MFBeamLatticeNode_SetAccurateRangePtr) dlsym(hLibrary, "lib3mf_beamlatticenode_setaccuraterange"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLatticeNode_SetAccurateRange == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLatticeNode_GetAccurateRange = (PLib3MFBeamLatticeNode_GetAccurateRangePtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_getaccuraterange"); + #else // _WIN32 + pWrapperTable->m_BeamLatticeNode_GetAccurateRange = (PLib3MFBeamLatticeNode_GetAccurateRangePtr) dlsym(hLibrary, "lib3mf_beamlatticenode_getaccuraterange"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLatticeNode_GetAccurateRange == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputFunctionID = (PLib3MFFunctionGradientNode_GetInputFunctionIDPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getinputfunctionid"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputFunctionID = (PLib3MFFunctionGradientNode_GetInputFunctionIDPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getinputfunctionid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetInputFunctionID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputPos = (PLib3MFFunctionGradientNode_GetInputPosPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getinputpos"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputPos = (PLib3MFFunctionGradientNode_GetInputPosPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getinputpos"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetInputPos == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputStep = (PLib3MFFunctionGradientNode_GetInputStepPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getinputstep"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputStep = (PLib3MFFunctionGradientNode_GetInputStepPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getinputstep"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetInputStep == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_SetScalarOutputName = (PLib3MFFunctionGradientNode_SetScalarOutputNamePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_setscalaroutputname"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_SetScalarOutputName = (PLib3MFFunctionGradientNode_SetScalarOutputNamePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_setscalaroutputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_SetScalarOutputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetScalarOutputName = (PLib3MFFunctionGradientNode_GetScalarOutputNamePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getscalaroutputname"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetScalarOutputName = (PLib3MFFunctionGradientNode_GetScalarOutputNamePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getscalaroutputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetScalarOutputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_SetVectorInputName = (PLib3MFFunctionGradientNode_SetVectorInputNamePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_setvectorinputname"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_SetVectorInputName = (PLib3MFFunctionGradientNode_SetVectorInputNamePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_setvectorinputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_SetVectorInputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetVectorInputName = (PLib3MFFunctionGradientNode_GetVectorInputNamePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getvectorinputname"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetVectorInputName = (PLib3MFFunctionGradientNode_GetVectorInputNamePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getvectorinputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetVectorInputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient = (PLib3MFFunctionGradientNode_GetOutputNormalizedGradientPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getoutputnormalizedgradient"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient = (PLib3MFFunctionGradientNode_GetOutputNormalizedGradientPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getoutputnormalizedgradient"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputGradient = (PLib3MFFunctionGradientNode_GetOutputGradientPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getoutputgradient"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputGradient = (PLib3MFFunctionGradientNode_GetOutputGradientPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getoutputgradient"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetOutputGradient == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude = (PLib3MFFunctionGradientNode_GetOutputMagnitudePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getoutputmagnitude"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude = (PLib3MFFunctionGradientNode_GetOutputMagnitudePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getoutputmagnitude"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID = (PLib3MFNormalizeDistanceNode_GetInputFunctionIDPtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getinputfunctionid"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID = (PLib3MFNormalizeDistanceNode_GetInputFunctionIDPtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getinputfunctionid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputPos = (PLib3MFNormalizeDistanceNode_GetInputPosPtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getinputpos"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputPos = (PLib3MFNormalizeDistanceNode_GetInputPosPtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getinputpos"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetInputPos == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputStep = (PLib3MFNormalizeDistanceNode_GetInputStepPtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getinputstep"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputStep = (PLib3MFNormalizeDistanceNode_GetInputStepPtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getinputstep"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetInputStep == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName = (PLib3MFNormalizeDistanceNode_SetScalarOutputNamePtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_setscalaroutputname"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName = (PLib3MFNormalizeDistanceNode_SetScalarOutputNamePtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_setscalaroutputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName = (PLib3MFNormalizeDistanceNode_GetScalarOutputNamePtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getscalaroutputname"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName = (PLib3MFNormalizeDistanceNode_GetScalarOutputNamePtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getscalaroutputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName = (PLib3MFNormalizeDistanceNode_SetVectorInputNamePtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_setvectorinputname"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName = (PLib3MFNormalizeDistanceNode_SetVectorInputNamePtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_setvectorinputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName = (PLib3MFNormalizeDistanceNode_GetVectorInputNamePtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getvectorinputname"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName = (PLib3MFNormalizeDistanceNode_GetVectorInputNamePtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getvectorinputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetOutputResult = (PLib3MFNormalizeDistanceNode_GetOutputResultPtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getoutputresult"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetOutputResult = (PLib3MFNormalizeDistanceNode_GetOutputResultPtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getoutputresult"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetOutputResult == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_FunctionCallNode_GetInputFunctionID = (PLib3MFFunctionCallNode_GetInputFunctionIDPtr) GetProcAddress(hLibrary, "lib3mf_functioncallnode_getinputfunctionid"); #else // _WIN32 @@ -4655,6 +5051,33 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_ImplicitFunction_AddUnsignedMeshNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode = (PLib3MFImplicitFunction_AddBeamLatticeNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addbeamlatticenode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode = (PLib3MFImplicitFunction_AddBeamLatticeNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addbeamlatticenode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode = (PLib3MFImplicitFunction_AddFunctionGradientNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addfunctiongradientnode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode = (PLib3MFImplicitFunction_AddFunctionGradientNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addfunctiongradientnode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode = (PLib3MFImplicitFunction_AddNormalizeDistanceNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addnormalizedistancenode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode = (PLib3MFImplicitFunction_AddNormalizeDistanceNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addnormalizedistancenode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_ImplicitFunction_AddFunctionCallNode = (PLib3MFImplicitFunction_AddFunctionCallNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addfunctioncallnode"); #else // _WIN32 @@ -5636,6 +6059,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Model_GetComponentsObjectByID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_GetBooleanObjectByID = (PLib3MFModel_GetBooleanObjectByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getbooleanobjectbyid"); + #else // _WIN32 + pWrapperTable->m_Model_GetBooleanObjectByID = (PLib3MFModel_GetBooleanObjectByIDPtr) dlsym(hLibrary, "lib3mf_model_getbooleanobjectbyid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetBooleanObjectByID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Model_GetColorGroupByID = (PLib3MFModel_GetColorGroupByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getcolorgroupbyid"); #else // _WIN32 @@ -5735,6 +6167,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Model_GetComponentsObjects == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_GetBooleanObjects = (PLib3MFModel_GetBooleanObjectsPtr) GetProcAddress(hLibrary, "lib3mf_model_getbooleanobjects"); + #else // _WIN32 + pWrapperTable->m_Model_GetBooleanObjects = (PLib3MFModel_GetBooleanObjectsPtr) dlsym(hLibrary, "lib3mf_model_getbooleanobjects"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetBooleanObjects == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Model_GetTexture2Ds = (PLib3MFModel_GetTexture2DsPtr) GetProcAddress(hLibrary, "lib3mf_model_gettexture2ds"); #else // _WIN32 @@ -5843,6 +6284,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Model_AddComponentsObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_AddBooleanObject = (PLib3MFModel_AddBooleanObjectPtr) GetProcAddress(hLibrary, "lib3mf_model_addbooleanobject"); + #else // _WIN32 + pWrapperTable->m_Model_AddBooleanObject = (PLib3MFModel_AddBooleanObjectPtr) dlsym(hLibrary, "lib3mf_model_addbooleanobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddBooleanObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Model_AddSliceStack = (PLib3MFModel_AddSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_model_addslicestack"); #else // _WIN32 diff --git a/Autogenerated/Bindings/CDynamic/lib3mf_dynamic.h b/Autogenerated/Bindings/CDynamic/lib3mf_dynamic.h index 76b6778df..d18f473b1 100644 --- a/Autogenerated/Bindings/CDynamic/lib3mf_dynamic.h +++ b/Autogenerated/Bindings/CDynamic/lib3mf_dynamic.h @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated plain C Header file in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -484,6 +484,19 @@ typedef Lib3MFResult (*PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) (Lib3M */ typedef Lib3MFResult (*PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) (Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); +/************************************************************************************************************************* + Class definition for BooleanObjectIterator +**************************************************************************************************************************/ + +/** +* Returns the BooleanObject the iterator points at. +* +* @param[in] pBooleanObjectIterator - BooleanObjectIterator instance. +* @param[out] pResource - returns the BooleanObject instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObjectIterator_GetCurrentBooleanObjectPtr) (Lib3MF_BooleanObjectIterator pBooleanObjectIterator, Lib3MF_BooleanObject * pResource); + /************************************************************************************************************************* Class definition for Texture2DIterator **************************************************************************************************************************/ @@ -998,6 +1011,15 @@ typedef Lib3MFResult (*PLib3MFObject_IsComponentsObjectPtr) (Lib3MF_Object pObje */ typedef Lib3MFResult (*PLib3MFObject_IsLevelSetObjectPtr) (Lib3MF_Object pObject, bool * pIsLevelSetObject); +/** +* Retrieves, if an object is a boolean object +* +* @param[in] pObject - Object instance. +* @param[out] pIsBooleanObject - returns, whether the object is a boolean object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_IsBooleanObjectPtr) (Lib3MF_Object pObject, bool * pIsBooleanObject); + /** * Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * @@ -1548,6 +1570,140 @@ typedef Lib3MFResult (*PLib3MFLevelSet_GetVolumeDataPtr) (Lib3MF_LevelSet pLevel */ typedef Lib3MFResult (*PLib3MFLevelSet_SetVolumeDataPtr) (Lib3MF_LevelSet pLevelSet, Lib3MF_VolumeData pTheVolumeData); +/************************************************************************************************************************* + Class definition for BooleanObject +**************************************************************************************************************************/ + +/** +* Sets the base object and transform for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pBaseObject - base object of the boolean shape +* @param[in] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetBaseObjectPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object pBaseObject, const sLib3MFTransform * pTransform); + +/** +* Returns the base object of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pBaseObject - base object of the boolean shape +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetBaseObjectPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object * pBaseObject); + +/** +* Sets the base transform of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetBaseTransformPtr) (Lib3MF_BooleanObject pBooleanObject, const sLib3MFTransform * pTransform); + +/** +* Returns the base transform of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetBaseTransformPtr) (Lib3MF_BooleanObject pBooleanObject, sLib3MFTransform * pTransform); + +/** +* Sets the boolean operation used for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] eOperation - boolean operation used for the shape +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetOperationPtr) (Lib3MF_BooleanObject pBooleanObject, eLib3MFBooleanOperation eOperation); + +/** +* Returns the boolean operation used for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pOperation - boolean operation used for the shape +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetOperationPtr) (Lib3MF_BooleanObject pBooleanObject, eLib3MFBooleanOperation * pOperation); + +/** +* Enables or disables CSG field evaluation for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] bCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetCSGModeEnabledPtr) (Lib3MF_BooleanObject pBooleanObject, bool bCSGModeEnabled); + +/** +* Returns whether CSG field evaluation is enabled for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetCSGModeEnabledPtr) (Lib3MF_BooleanObject pBooleanObject, bool * pCSGModeEnabled); + +/** +* Sets the extraction grid resolution used for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] nGridResolution - extraction grid resolution for boolean surface extraction +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetExtractionGridResolutionPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nGridResolution); + +/** +* Returns the extraction grid resolution used for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pGridResolution - extraction grid resolution for boolean surface extraction +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetExtractionGridResolutionPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pGridResolution); + +/** +* Returns the number of operands in the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pCount - number of operands in the boolean sequence +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetOperandCountPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pCount); + +/** +* Adds an operand object to the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pOperandObject - mesh object used as operand +* @param[in] pTransform - transform applied to the operand object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_AddOperandPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject pOperandObject, const sLib3MFTransform * pTransform); + +/** +* Returns one operand object and transform from the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] nIndex - index of the operand in the boolean sequence +* @param[out] pOperandObject - mesh object used as operand +* @param[out] pTransform - transform applied to the operand object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetOperandPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nIndex, Lib3MF_MeshObject * pOperandObject, sLib3MFTransform * pTransform); + +/** +* Materializes the boolean shape into a newly created mesh object. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pMeshObject - new mesh object containing the tessellated boolean shape +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_MergeToMeshObjectPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject * pMeshObject); + /************************************************************************************************************************* Class definition for BeamLattice **************************************************************************************************************************/ @@ -1913,7 +2069,7 @@ typedef Lib3MFResult (*PLib3MFVolumeDataComposite_SetBaseMaterialGroupPtr) (Lib3 typedef Lib3MFResult (*PLib3MFVolumeDataComposite_GetMaterialMappingCountPtr) (Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 * pCount); /** -* Returns MaterialMappting with given index +* Returns MaterialMapping with given index * * @param[in] pVolumeDataComposite - VolumeDataComposite instance. * @param[in] nIndex - Index of the MaterialMapping in question. @@ -1923,7 +2079,7 @@ typedef Lib3MFResult (*PLib3MFVolumeDataComposite_GetMaterialMappingCountPtr) (L typedef Lib3MFResult (*PLib3MFVolumeDataComposite_GetMaterialMappingPtr) (Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 nIndex, Lib3MF_MaterialMapping * pTheMaterialMapping); /** -* Adds a the MaterialMapping +* Adds a MaterialMapping * * @param[in] pVolumeDataComposite - VolumeDataComposite instance. * @param[in] pTransform - new transformation matrix @@ -2035,7 +2191,7 @@ typedef Lib3MFResult (*PLib3MFVolumeData_RemoveColorPtr) (Lib3MF_VolumeData pVol * Returns the number of VolumeDataProperty * * @param[in] pVolumeData - VolumeData instance. -* @param[out] pCount - the number of VolumeDataProperty-elements within this VolumdeData +* @param[out] pCount - the number of VolumeDataProperty-elements within this VolumeData * @return error code or 0 (success) */ typedef Lib3MFResult (*PLib3MFVolumeData_GetPropertyCountPtr) (Lib3MF_VolumeData pVolumeData, Lib3MF_uint32 * pCount); @@ -2860,7 +3016,7 @@ typedef Lib3MFResult (*PLib3MFAttachment_SetRelationShipTypePtr) (Lib3MF_Attachm typedef Lib3MFResult (*PLib3MFAttachment_WriteToFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); /** -* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * * @param[in] pAttachment - Attachment instance. * @param[in] pFileName - file to read from. @@ -2869,7 +3025,7 @@ typedef Lib3MFResult (*PLib3MFAttachment_WriteToFilePtr) (Lib3MF_Attachment pAtt typedef Lib3MFResult (*PLib3MFAttachment_ReadFromFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); /** -* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * * @param[in] pAttachment - Attachment instance. * @param[in] pTheReadCallback - Callback to call for reading a data chunk @@ -2901,7 +3057,7 @@ typedef Lib3MFResult (*PLib3MFAttachment_GetStreamSizePtr) (Lib3MF_Attachment pA typedef Lib3MFResult (*PLib3MFAttachment_WriteToBufferPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); /** -* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* Reads an attachment from a memory buffer. This buffer is immediately read (in contrast to the ReadFromCallback and ReadFromFile-methods). * * @param[in] pAttachment - Attachment instance. * @param[in] nBufferBufferSize - Number of elements in buffer @@ -4013,6 +4169,233 @@ typedef Lib3MFResult (*PLib3MFUnsignedMeshNode_GetInputPosPtr) (Lib3MF_UnsignedM */ typedef Lib3MFResult (*PLib3MFUnsignedMeshNode_GetOutputDistancePtr) (Lib3MF_UnsignedMeshNode pUnsignedMeshNode, Lib3MF_ImplicitPort * pDistance); +/************************************************************************************************************************* + Class definition for BeamLatticeNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the model resource id of the beam lattice +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pBeamLattice - the input port for the model resource id of the beam lattice (mesh with beamlattice extension) +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_GetInputBeamLatticePtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pBeamLattice); + +/** +* Retrieves the input for the position +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_GetInputPosPtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the output +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pDistance - the output port for the signed distance to the beam lattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_GetOutputDistancePtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pDistance); + +/** +* Sets the accurate range for distance computation +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[in] dAccurateRange - the accurate range in model units +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_SetAccurateRangePtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double dAccurateRange); + +/** +* Retrieves the accurate range for distance computation +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pAccurateRange - the accurate range in model units +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_GetAccurateRangePtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double * pAccurateRange); + +/************************************************************************************************************************* + Class definition for FunctionGradientNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the function id +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pFunction - the input port for the function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetInputFunctionIDPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pFunction); + +/** +* Retrieves the input for the position +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetInputPosPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the input for the finite difference step +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pStep - the input port for the finite difference step +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetInputStepPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pStep); + +/** +* Sets the name of the referenced scalar output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] pScalarOutputName - the name of the scalar output of the referenced function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_SetScalarOutputNamePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pScalarOutputName); + +/** +* Retrieves the name of the referenced scalar output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetScalarOutputNamePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + +/** +* Sets the name of the referenced vector input +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_SetVectorInputNamePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pVectorInputName); + +/** +* Retrieves the name of the referenced vector input +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetVectorInputNamePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + +/** +* Retrieves the normalized gradient output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pNormalizedGradient - the output port for the normalized gradient +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetOutputNormalizedGradientPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pNormalizedGradient); + +/** +* Retrieves the raw gradient output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pGradient - the output port for the raw gradient +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetOutputGradientPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pGradient); + +/** +* Retrieves the gradient magnitude output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pMagnitude - the output port for the gradient magnitude +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetOutputMagnitudePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pMagnitude); + +/************************************************************************************************************************* + Class definition for NormalizeDistanceNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the function id +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pFunction - the input port for the function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetInputFunctionIDPtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pFunction); + +/** +* Retrieves the input for the position +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pPos - the input port for the position (vector) +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetInputPosPtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the input for the finite difference step +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pStep - the input port for the finite difference step +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetInputStepPtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pStep); + +/** +* Sets the name of the referenced scalar output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] pScalarOutputName - the name of the scalar output of the referenced function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_SetScalarOutputNamePtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pScalarOutputName); + +/** +* Retrieves the name of the referenced scalar output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetScalarOutputNamePtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + +/** +* Sets the name of the referenced vector input +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_SetVectorInputNamePtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pVectorInputName); + +/** +* Retrieves the name of the referenced vector input +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetVectorInputNamePtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + +/** +* Retrieves the normalized result output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pResult - the output port for the normalized distance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetOutputResultPtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pResult); + /************************************************************************************************************************* Class definition for FunctionCallNode **************************************************************************************************************************/ @@ -4788,6 +5171,42 @@ typedef Lib3MFResult (*PLib3MFImplicitFunction_AddMeshNodePtr) (Lib3MF_ImplicitF */ typedef Lib3MFResult (*PLib3MFImplicitFunction_AddUnsignedMeshNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_UnsignedMeshNode * pNode); +/** +* Add a BeamLatticeNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFImplicitFunction_AddBeamLatticeNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_BeamLatticeNode * pNode); + +/** +* Add a FunctionGradientNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFImplicitFunction_AddFunctionGradientNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_FunctionGradientNode * pNode); + +/** +* Add a NormalizeDistanceNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFImplicitFunction_AddNormalizeDistanceNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_NormalizeDistanceNode * pNode); + /** * Add a FunctionCallNode * @@ -5902,6 +6321,16 @@ typedef Lib3MFResult (*PLib3MFModel_GetMeshObjectByIDPtr) (Lib3MF_Model pModel, */ typedef Lib3MFResult (*PLib3MFModel_GetComponentsObjectByIDPtr) (Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_ComponentsObject * pComponentsObjectInstance); +/** +* finds a boolean object by its UniqueResourceID +* +* @param[in] pModel - Model instance. +* @param[in] nUniqueResourceID - UniqueResourceID +* @param[out] pBooleanObjectInstance - returns the boolean object instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_GetBooleanObjectByIDPtr) (Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_BooleanObject * pBooleanObjectInstance); + /** * finds a model color group by its UniqueResourceID * @@ -6007,6 +6436,15 @@ typedef Lib3MFResult (*PLib3MFModel_GetMeshObjectsPtr) (Lib3MF_Model pModel, Lib */ typedef Lib3MFResult (*PLib3MFModel_GetComponentsObjectsPtr) (Lib3MF_Model pModel, Lib3MF_ComponentsObjectIterator * pResourceIterator); +/** +* creates a resource iterator instance with all boolean object resources. +* +* @param[in] pModel - Model instance. +* @param[out] pResourceIterator - returns the iterator instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_GetBooleanObjectsPtr) (Lib3MF_Model pModel, Lib3MF_BooleanObjectIterator * pResourceIterator); + /** * creates a Texture2DIterator instance with all texture2d resources. * @@ -6115,6 +6553,15 @@ typedef Lib3MFResult (*PLib3MFModel_AddMeshObjectPtr) (Lib3MF_Model pModel, Lib3 */ typedef Lib3MFResult (*PLib3MFModel_AddComponentsObjectPtr) (Lib3MF_Model pModel, Lib3MF_ComponentsObject * pComponentsObjectInstance); +/** +* adds an empty boolean object to the model. +* +* @param[in] pModel - Model instance. +* @param[out] pBooleanObjectInstance - returns the boolean object instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_AddBooleanObjectPtr) (Lib3MF_Model pModel, Lib3MF_BooleanObject * pBooleanObjectInstance); + /** * creates a new model slicestack by its id * @@ -6665,6 +7112,7 @@ typedef struct { PLib3MFObjectIterator_GetCurrentObjectPtr m_ObjectIterator_GetCurrentObject; PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr m_MeshObjectIterator_GetCurrentMeshObject; PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr m_ComponentsObjectIterator_GetCurrentComponentsObject; + PLib3MFBooleanObjectIterator_GetCurrentBooleanObjectPtr m_BooleanObjectIterator_GetCurrentBooleanObject; PLib3MFTexture2DIterator_GetCurrentTexture2DPtr m_Texture2DIterator_GetCurrentTexture2D; PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup; PLib3MFColorGroupIterator_GetCurrentColorGroupPtr m_ColorGroupIterator_GetCurrentColorGroup; @@ -6713,6 +7161,7 @@ typedef struct { PLib3MFObject_IsMeshObjectPtr m_Object_IsMeshObject; PLib3MFObject_IsComponentsObjectPtr m_Object_IsComponentsObject; PLib3MFObject_IsLevelSetObjectPtr m_Object_IsLevelSetObject; + PLib3MFObject_IsBooleanObjectPtr m_Object_IsBooleanObject; PLib3MFObject_IsValidPtr m_Object_IsValid; PLib3MFObject_SetAttachmentAsThumbnailPtr m_Object_SetAttachmentAsThumbnail; PLib3MFObject_GetThumbnailAttachmentPtr m_Object_GetThumbnailAttachment; @@ -6770,6 +7219,20 @@ typedef struct { PLib3MFLevelSet_GetMeshPtr m_LevelSet_GetMesh; PLib3MFLevelSet_GetVolumeDataPtr m_LevelSet_GetVolumeData; PLib3MFLevelSet_SetVolumeDataPtr m_LevelSet_SetVolumeData; + PLib3MFBooleanObject_SetBaseObjectPtr m_BooleanObject_SetBaseObject; + PLib3MFBooleanObject_GetBaseObjectPtr m_BooleanObject_GetBaseObject; + PLib3MFBooleanObject_SetBaseTransformPtr m_BooleanObject_SetBaseTransform; + PLib3MFBooleanObject_GetBaseTransformPtr m_BooleanObject_GetBaseTransform; + PLib3MFBooleanObject_SetOperationPtr m_BooleanObject_SetOperation; + PLib3MFBooleanObject_GetOperationPtr m_BooleanObject_GetOperation; + PLib3MFBooleanObject_SetCSGModeEnabledPtr m_BooleanObject_SetCSGModeEnabled; + PLib3MFBooleanObject_GetCSGModeEnabledPtr m_BooleanObject_GetCSGModeEnabled; + PLib3MFBooleanObject_SetExtractionGridResolutionPtr m_BooleanObject_SetExtractionGridResolution; + PLib3MFBooleanObject_GetExtractionGridResolutionPtr m_BooleanObject_GetExtractionGridResolution; + PLib3MFBooleanObject_GetOperandCountPtr m_BooleanObject_GetOperandCount; + PLib3MFBooleanObject_AddOperandPtr m_BooleanObject_AddOperand; + PLib3MFBooleanObject_GetOperandPtr m_BooleanObject_GetOperand; + PLib3MFBooleanObject_MergeToMeshObjectPtr m_BooleanObject_MergeToMeshObject; PLib3MFBeamLattice_GetMinLengthPtr m_BeamLattice_GetMinLength; PLib3MFBeamLattice_SetMinLengthPtr m_BeamLattice_SetMinLength; PLib3MFBeamLattice_GetClippingPtr m_BeamLattice_GetClipping; @@ -6997,6 +7460,29 @@ typedef struct { PLib3MFUnsignedMeshNode_GetInputMeshPtr m_UnsignedMeshNode_GetInputMesh; PLib3MFUnsignedMeshNode_GetInputPosPtr m_UnsignedMeshNode_GetInputPos; PLib3MFUnsignedMeshNode_GetOutputDistancePtr m_UnsignedMeshNode_GetOutputDistance; + PLib3MFBeamLatticeNode_GetInputBeamLatticePtr m_BeamLatticeNode_GetInputBeamLattice; + PLib3MFBeamLatticeNode_GetInputPosPtr m_BeamLatticeNode_GetInputPos; + PLib3MFBeamLatticeNode_GetOutputDistancePtr m_BeamLatticeNode_GetOutputDistance; + PLib3MFBeamLatticeNode_SetAccurateRangePtr m_BeamLatticeNode_SetAccurateRange; + PLib3MFBeamLatticeNode_GetAccurateRangePtr m_BeamLatticeNode_GetAccurateRange; + PLib3MFFunctionGradientNode_GetInputFunctionIDPtr m_FunctionGradientNode_GetInputFunctionID; + PLib3MFFunctionGradientNode_GetInputPosPtr m_FunctionGradientNode_GetInputPos; + PLib3MFFunctionGradientNode_GetInputStepPtr m_FunctionGradientNode_GetInputStep; + PLib3MFFunctionGradientNode_SetScalarOutputNamePtr m_FunctionGradientNode_SetScalarOutputName; + PLib3MFFunctionGradientNode_GetScalarOutputNamePtr m_FunctionGradientNode_GetScalarOutputName; + PLib3MFFunctionGradientNode_SetVectorInputNamePtr m_FunctionGradientNode_SetVectorInputName; + PLib3MFFunctionGradientNode_GetVectorInputNamePtr m_FunctionGradientNode_GetVectorInputName; + PLib3MFFunctionGradientNode_GetOutputNormalizedGradientPtr m_FunctionGradientNode_GetOutputNormalizedGradient; + PLib3MFFunctionGradientNode_GetOutputGradientPtr m_FunctionGradientNode_GetOutputGradient; + PLib3MFFunctionGradientNode_GetOutputMagnitudePtr m_FunctionGradientNode_GetOutputMagnitude; + PLib3MFNormalizeDistanceNode_GetInputFunctionIDPtr m_NormalizeDistanceNode_GetInputFunctionID; + PLib3MFNormalizeDistanceNode_GetInputPosPtr m_NormalizeDistanceNode_GetInputPos; + PLib3MFNormalizeDistanceNode_GetInputStepPtr m_NormalizeDistanceNode_GetInputStep; + PLib3MFNormalizeDistanceNode_SetScalarOutputNamePtr m_NormalizeDistanceNode_SetScalarOutputName; + PLib3MFNormalizeDistanceNode_GetScalarOutputNamePtr m_NormalizeDistanceNode_GetScalarOutputName; + PLib3MFNormalizeDistanceNode_SetVectorInputNamePtr m_NormalizeDistanceNode_SetVectorInputName; + PLib3MFNormalizeDistanceNode_GetVectorInputNamePtr m_NormalizeDistanceNode_GetVectorInputName; + PLib3MFNormalizeDistanceNode_GetOutputResultPtr m_NormalizeDistanceNode_GetOutputResult; PLib3MFFunctionCallNode_GetInputFunctionIDPtr m_FunctionCallNode_GetInputFunctionID; PLib3MFNodeIterator_GetCurrentPtr m_NodeIterator_GetCurrent; PLib3MFFunction_GetDisplayNamePtr m_Function_GetDisplayName; @@ -7060,6 +7546,9 @@ typedef struct { PLib3MFImplicitFunction_AddConstMatNodePtr m_ImplicitFunction_AddConstMatNode; PLib3MFImplicitFunction_AddMeshNodePtr m_ImplicitFunction_AddMeshNode; PLib3MFImplicitFunction_AddUnsignedMeshNodePtr m_ImplicitFunction_AddUnsignedMeshNode; + PLib3MFImplicitFunction_AddBeamLatticeNodePtr m_ImplicitFunction_AddBeamLatticeNode; + PLib3MFImplicitFunction_AddFunctionGradientNodePtr m_ImplicitFunction_AddFunctionGradientNode; + PLib3MFImplicitFunction_AddNormalizeDistanceNodePtr m_ImplicitFunction_AddNormalizeDistanceNode; PLib3MFImplicitFunction_AddFunctionCallNodePtr m_ImplicitFunction_AddFunctionCallNode; PLib3MFImplicitFunction_GetNodesPtr m_ImplicitFunction_GetNodes; PLib3MFImplicitFunction_RemoveNodePtr m_ImplicitFunction_RemoveNode; @@ -7169,6 +7658,7 @@ typedef struct { PLib3MFModel_GetMultiPropertyGroupByIDPtr m_Model_GetMultiPropertyGroupByID; PLib3MFModel_GetMeshObjectByIDPtr m_Model_GetMeshObjectByID; PLib3MFModel_GetComponentsObjectByIDPtr m_Model_GetComponentsObjectByID; + PLib3MFModel_GetBooleanObjectByIDPtr m_Model_GetBooleanObjectByID; PLib3MFModel_GetColorGroupByIDPtr m_Model_GetColorGroupByID; PLib3MFModel_GetSliceStackByIDPtr m_Model_GetSliceStackByID; PLib3MFModel_GetLevelSetByIDPtr m_Model_GetLevelSetByID; @@ -7180,6 +7670,7 @@ typedef struct { PLib3MFModel_GetObjectsPtr m_Model_GetObjects; PLib3MFModel_GetMeshObjectsPtr m_Model_GetMeshObjects; PLib3MFModel_GetComponentsObjectsPtr m_Model_GetComponentsObjects; + PLib3MFModel_GetBooleanObjectsPtr m_Model_GetBooleanObjects; PLib3MFModel_GetTexture2DsPtr m_Model_GetTexture2Ds; PLib3MFModel_GetBaseMaterialGroupsPtr m_Model_GetBaseMaterialGroups; PLib3MFModel_GetColorGroupsPtr m_Model_GetColorGroups; @@ -7192,6 +7683,7 @@ typedef struct { PLib3MFModel_MergeFromModelPtr m_Model_MergeFromModel; PLib3MFModel_AddMeshObjectPtr m_Model_AddMeshObject; PLib3MFModel_AddComponentsObjectPtr m_Model_AddComponentsObject; + PLib3MFModel_AddBooleanObjectPtr m_Model_AddBooleanObject; PLib3MFModel_AddSliceStackPtr m_Model_AddSliceStack; PLib3MFModel_AddTexture2DFromAttachmentPtr m_Model_AddTexture2DFromAttachment; PLib3MFModel_AddBaseMaterialGroupPtr m_Model_AddBaseMaterialGroup; diff --git a/Autogenerated/Bindings/CDynamic/lib3mf_types.h b/Autogenerated/Bindings/CDynamic/lib3mf_types.h index 5df0da2fd..b9e4aec27 100644 --- a/Autogenerated/Bindings/CDynamic/lib3mf_types.h +++ b/Autogenerated/Bindings/CDynamic/lib3mf_types.h @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated plain C Header file with basic types in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -84,7 +84,7 @@ typedef void * Lib3MF_pvoid; **************************************************************************************************************************/ #define LIB3MF_VERSION_MAJOR 2 -#define LIB3MF_VERSION_MINOR 4 +#define LIB3MF_VERSION_MINOR 6 #define LIB3MF_VERSION_MICRO 0 #define LIB3MF_VERSION_PRERELEASEINFO "" #define LIB3MF_VERSION_BUILDINFO "" @@ -220,6 +220,7 @@ typedef Lib3MFHandle Lib3MF_SliceStackIterator; typedef Lib3MFHandle Lib3MF_ObjectIterator; typedef Lib3MFHandle Lib3MF_MeshObjectIterator; typedef Lib3MFHandle Lib3MF_ComponentsObjectIterator; +typedef Lib3MFHandle Lib3MF_BooleanObjectIterator; typedef Lib3MFHandle Lib3MF_Texture2DIterator; typedef Lib3MFHandle Lib3MF_BaseMaterialGroupIterator; typedef Lib3MFHandle Lib3MF_ColorGroupIterator; @@ -235,6 +236,7 @@ typedef Lib3MFHandle Lib3MF_TriangleSet; typedef Lib3MFHandle Lib3MF_Object; typedef Lib3MFHandle Lib3MF_MeshObject; typedef Lib3MFHandle Lib3MF_LevelSet; +typedef Lib3MFHandle Lib3MF_BooleanObject; typedef Lib3MFHandle Lib3MF_BeamLattice; typedef Lib3MFHandle Lib3MF_FunctionReference; typedef Lib3MFHandle Lib3MF_VolumeDataColor; @@ -310,6 +312,9 @@ typedef Lib3MFHandle Lib3MF_ConstVecNode; typedef Lib3MFHandle Lib3MF_ConstMatNode; typedef Lib3MFHandle Lib3MF_MeshNode; typedef Lib3MFHandle Lib3MF_UnsignedMeshNode; +typedef Lib3MFHandle Lib3MF_BeamLatticeNode; +typedef Lib3MFHandle Lib3MF_FunctionGradientNode; +typedef Lib3MFHandle Lib3MF_NormalizeDistanceNode; typedef Lib3MFHandle Lib3MF_FunctionCallNode; typedef Lib3MFHandle Lib3MF_NodeIterator; typedef Lib3MFHandle Lib3MF_Function; @@ -358,9 +363,16 @@ typedef enum eLib3MFObjectType { eObjectTypeOther = 0, eObjectTypeModel = 1, eObjectTypeSupport = 2, - eObjectTypeSolidSupport = 3 + eObjectTypeSolidSupport = 3, + eObjectTypeSurface = 4 } eLib3MFObjectType; +typedef enum eLib3MFBooleanOperation { + eBooleanOperationUnion = 0, + eBooleanOperationDifference = 1, + eBooleanOperationIntersection = 2 +} eLib3MFBooleanOperation; + typedef enum eLib3MFTextureType { eTextureTypeUnknown = 0, eTextureTypePNG = 1, @@ -472,11 +484,11 @@ typedef enum eLib3MFImplicitNodeType { eImplicitNodeTypeMatVecMultiplication = 14, /** Multiplies a matrix with a vector */ eImplicitNodeTypeTranspose = 15, /** Transposes a matrix */ eImplicitNodeTypeInverse = 16, /** Computes the inverse of a matrix */ - eImplicitNodeTypeSinus = 17, /** Calculates the sinus */ - eImplicitNodeTypeCosinus = 18, /** Calculates the cosinus */ + eImplicitNodeTypeSinus = 17, /** Calculates the sine */ + eImplicitNodeTypeCosinus = 18, /** Calculates the cosine */ eImplicitNodeTypeTan = 19, /** Calculates the tangent */ - eImplicitNodeTypeArcSin = 20, /** Calculates the arcsinus */ - eImplicitNodeTypeArcCos = 21, /** Calculates the arccosinus */ + eImplicitNodeTypeArcSin = 20, /** Calculates the arcsine */ + eImplicitNodeTypeArcCos = 21, /** Calculates the arccosine */ eImplicitNodeTypeArcTan = 22, /** Calculates the arctangent */ eImplicitNodeTypeArcTan2 = 23, /** Calculates the arctangent */ eImplicitNodeTypeMin = 24, /** Calculates the minimum of two values */ @@ -486,9 +498,9 @@ typedef enum eLib3MFImplicitNodeType { eImplicitNodeTypePow = 28, /** Calculates the power A^B */ eImplicitNodeTypeSqrt = 29, /** Calculates the square root */ eImplicitNodeTypeExp = 30, /** Exponential function */ - eImplicitNodeTypeLog = 31, /** Natural logarithmus */ - eImplicitNodeTypeLog2 = 32, /** Logarithmus to the base 2 */ - eImplicitNodeTypeLog10 = 33, /** Logarithmus to the base 10 */ + eImplicitNodeTypeLog = 31, /** Natural logarithm */ + eImplicitNodeTypeLog2 = 32, /** Logarithm to the base 2 */ + eImplicitNodeTypeLog10 = 33, /** Logarithm to the base 10 */ eImplicitNodeTypeSelect = 34, /** If A is less than B returns C, else D */ eImplicitNodeTypeClamp = 35, /** Clamps the input value to min and max */ eImplicitNodeTypeSinh = 36, /** Calculates the hyperbolic sine */ @@ -503,9 +515,12 @@ typedef enum eLib3MFImplicitNodeType { eImplicitNodeTypeMesh = 45, /** Calculates the signed distance to a mesh */ eImplicitNodeTypeLength = 46, /** Calculates the length of a vector */ eImplicitNodeTypeConstResourceID = 47, /** Selects a resource (function, mesh etc.) */ - eImplicitNodeTypeVectorFromScalar = 48, /** Creates a vector from one scalar values */ + eImplicitNodeTypeVectorFromScalar = 48, /** Creates a vector from one scalar value */ eImplicitNodeTypeUnsignedMesh = 49, /** Calculates the unsigned distance to a mesh */ - eImplicitNodeTypeMod = 50 /** Calculates the modulo of two values (same behaviour as glsl mod) */ + eImplicitNodeTypeMod = 50, /** Calculates the modulo of two values (same behaviour as glsl mod) */ + eImplicitNodeTypeBeamLattice = 51, /** Calculates the signed distance to a beam lattice */ + eImplicitNodeTypeFunctionGradient = 52, /** Calculates the gradient of a function */ + eImplicitNodeTypeNormalizeDistance = 53 /** Normalizes a distance field */ } eLib3MFImplicitNodeType; /** @@ -578,6 +593,11 @@ typedef union { int m_code; } structEnumLib3MFObjectType; +typedef union { + eLib3MFBooleanOperation m_enum; + int m_code; +} structEnumLib3MFBooleanOperation; + typedef union { eLib3MFTextureType m_enum; int m_code; diff --git a/Autogenerated/Bindings/CSharp/Lib3MF.cs b/Autogenerated/Bindings/CSharp/Lib3MF.cs index 668cedf38..cc9cf06cc 100644 --- a/Autogenerated/Bindings/CSharp/Lib3MF.cs +++ b/Autogenerated/Bindings/CSharp/Lib3MF.cs @@ -24,12 +24,12 @@ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated CSharp file in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -39,6 +39,294 @@ use of the 3MF Library namespace Lib3MF { + /// + /// Exception class for Lib3MF errors + /// + public class ELib3MFException : Exception + { + private readonly int _errorCode; + private readonly string _errorMessage; + + /// + /// Initializes a new instance of the ELib3MFException class + /// + /// The error code + /// The error message + public ELib3MFException(int errorCode, string errorMessage = "") : base(FormatMessage(errorCode, errorMessage)) + { + _errorCode = errorCode; + _errorMessage = errorMessage; + } + + /// + /// Gets the error code + /// + public int ErrorCode => _errorCode; + + /// + /// Gets the custom error message + /// + public string ErrorMessage => _errorMessage; + + /// + /// Gets the error name (constant name) + /// + public string ErrorName + { + get + { + switch (_errorCode) + { + case 0: return "SUCCESS"; + case 1: return "NOTIMPLEMENTED"; + case 2: return "INVALIDPARAM"; + case 3: return "INVALIDCAST"; + case 4: return "BUFFERTOOSMALL"; + case 5: return "GENERICEXCEPTION"; + case 6: return "COULDNOTLOADLIBRARY"; + case 7: return "COULDNOTFINDLIBRARYEXPORT"; + case 8: return "INCOMPATIBLEBINARYVERSION"; + case 10: return "CALCULATIONABORTED"; + case 11: return "SHOULDNOTBECALLED"; + case 100: return "READERCLASSUNKNOWN"; + case 101: return "WRITERCLASSUNKNOWN"; + case 102: return "ITERATORINVALIDINDEX"; + case 103: return "INVALIDMODELRESOURCE"; + case 104: return "RESOURCENOTFOUND"; + case 105: return "INVALIDMODEL"; + case 106: return "INVALIDOBJECT"; + case 107: return "INVALIDMESHOBJECT"; + case 108: return "INVALIDCOMPONENTSOBJECT"; + case 109: return "INVALIDCOMPONENT"; + case 110: return "INVALIDBUILDITEM"; + case 111: return "INVALIDBASEMATERIALGROUP"; + case 112: return "INVALIDSLICESTACKRESOURCE"; + case 113: return "INVALIDTEXTURERESOURCE"; + case 114: return "INVALIDCOLORGROUP"; + case 115: return "INVALIDTEXTURE2DGROUP"; + case 116: return "INVALIDCOMPOSITEMATERIALS"; + case 117: return "INVALIDMULTIPROPERTYGROUP"; + case 120: return "INVALIDRESOURCEINDEX"; + case 121: return "ATTACHMENTNOTFOUND"; + case 130: return "FORBIDDENCYCLICREFERENCE"; + case 131: return "INVALIDATTACHMENTSTREAM"; + case 132: return "INVALIDPROPERTYCOUNT"; + case 140: return "UNKOWNPROGRESSIDENTIFIER"; + case 141: return "ELEMENTCOUNTEXCEEDSLIMIT"; + case 142: return "INVALIDRESOURCE"; + case 143: return "INVALIDLEVELSET"; + case 144: return "COULDNOTFINDTRIANGLESET"; + case 145: return "INVALIDTRIANGLESETINDEX"; + case 2000: return "BEAMLATTICE_INVALID_OBJECTTYPE"; + case 3000: return "INVALIDKEYSTORE"; + case 3001: return "INVALIDKEYSTORECONSUMER"; + case 3002: return "KEYSTORECONSUMERNOTFOUND"; + case 3003: return "KEYSTORERESOURCEDATANOTFOUND"; + case 3004: return "SECURECONTEXTNOTREGISTERED"; + case 3005: return "INVALIDKEYSIZE"; + case 4000: return "INCOMPATIBLEPORTTYPES"; + case 4001: return "GRAPHISCYCLIC"; + case 4002: return "INPUTNOTSET"; + case 4003: return "INVALIDNODECONFIGURATION"; + default: return "UNKNOWN"; + } + } + } + + /// + /// Gets the error description (human-readable) + /// + public string ErrorDescription + { + get + { + switch (_errorCode) + { + case 0: return "success"; + case 1: return "functionality not implemented"; + case 2: return "an invalid parameter was passed"; + case 3: return "a type cast failed"; + case 4: return "a provided buffer is too small"; + case 5: return "a generic exception occurred"; + case 6: return "the library could not be loaded"; + case 7: return "a required exported symbol could not be found in the library"; + case 8: return "the version of the binary interface does not match the bindings interface"; + case 10: return "a calculation has been aborted"; + case 11: return "functionality should not be called"; + case 100: return "the queried reader class is unknown"; + case 101: return "the queried writer class is unknown"; + case 102: return "the current index of an iterator is invalid"; + case 103: return "no Model Resource has been given"; + case 104: return "Resource not found"; + case 105: return "A model is invalid"; + case 106: return "An object is invalid"; + case 107: return "A mesh object is invalid"; + case 108: return "A components object is invalid"; + case 109: return "A component is invalid"; + case 110: return "A build item is invalid"; + case 111: return "A basematerialgroup is invalid"; + case 112: return "A slicestack resource is invalid"; + case 113: return "A texture resource is invalid"; + case 114: return "A color group resource is invalid"; + case 115: return "A texture2d group resource is invalid"; + case 116: return "A composite materials resource is invalid"; + case 117: return "A MultiPropertyGroup resource is invalid"; + case 120: return "A resource index is invalid"; + case 121: return "Attachment not found"; + case 130: return "A component references one of its ancestors"; + case 131: return "An attachment stream is invalid"; + case 132: return "Invalid property count."; + case 140: return "A progress identifier is unknown"; + case 141: return "An element buffer exceeds its spec limit"; + case 142: return "A resource is invalid"; + case 143: return "A level set is invalid"; + case 144: return "Could not find triangle set"; + case 145: return "Invalid triangle set index"; + case 2000: return "This object type is not valid for beamlattices"; + case 3000: return "The keystore object is invalid"; + case 3001: return "The consumer keystore object is invalid"; + case 3002: return "A consumer has not been found"; + case 3003: return "A resource data has not been found"; + case 3004: return "A Key or Conentent encryption callback has not been registered"; + case 3005: return "The key size is invalid"; + case 4000: return "Link could not be added, the port types are incompatible"; + case 4001: return "The functin graph is cyclic. Only dircected graphs are valid and can be topological sorted."; + case 4002: return "The input of a node is not set."; + case 4003: return "The selected node configuration is not supported"; + default: return "unknown error"; + } + } + } + + private static string FormatMessage(int errorCode, string errorMessage) + { + string errorName = GetErrorName(errorCode); + string errorDesc = GetErrorDescription(errorCode); + if (!string.IsNullOrEmpty(errorMessage)) + return $"ELib3MFException {errorName} ({errorCode}): {errorDesc} - {errorMessage}"; + else + return $"ELib3MFException {errorName} ({errorCode}): {errorDesc}"; + } + + private static string GetErrorName(int errorCode) + { + switch (errorCode) + { + case 0: return "SUCCESS"; + case 1: return "NOTIMPLEMENTED"; + case 2: return "INVALIDPARAM"; + case 3: return "INVALIDCAST"; + case 4: return "BUFFERTOOSMALL"; + case 5: return "GENERICEXCEPTION"; + case 6: return "COULDNOTLOADLIBRARY"; + case 7: return "COULDNOTFINDLIBRARYEXPORT"; + case 8: return "INCOMPATIBLEBINARYVERSION"; + case 10: return "CALCULATIONABORTED"; + case 11: return "SHOULDNOTBECALLED"; + case 100: return "READERCLASSUNKNOWN"; + case 101: return "WRITERCLASSUNKNOWN"; + case 102: return "ITERATORINVALIDINDEX"; + case 103: return "INVALIDMODELRESOURCE"; + case 104: return "RESOURCENOTFOUND"; + case 105: return "INVALIDMODEL"; + case 106: return "INVALIDOBJECT"; + case 107: return "INVALIDMESHOBJECT"; + case 108: return "INVALIDCOMPONENTSOBJECT"; + case 109: return "INVALIDCOMPONENT"; + case 110: return "INVALIDBUILDITEM"; + case 111: return "INVALIDBASEMATERIALGROUP"; + case 112: return "INVALIDSLICESTACKRESOURCE"; + case 113: return "INVALIDTEXTURERESOURCE"; + case 114: return "INVALIDCOLORGROUP"; + case 115: return "INVALIDTEXTURE2DGROUP"; + case 116: return "INVALIDCOMPOSITEMATERIALS"; + case 117: return "INVALIDMULTIPROPERTYGROUP"; + case 120: return "INVALIDRESOURCEINDEX"; + case 121: return "ATTACHMENTNOTFOUND"; + case 130: return "FORBIDDENCYCLICREFERENCE"; + case 131: return "INVALIDATTACHMENTSTREAM"; + case 132: return "INVALIDPROPERTYCOUNT"; + case 140: return "UNKOWNPROGRESSIDENTIFIER"; + case 141: return "ELEMENTCOUNTEXCEEDSLIMIT"; + case 142: return "INVALIDRESOURCE"; + case 143: return "INVALIDLEVELSET"; + case 144: return "COULDNOTFINDTRIANGLESET"; + case 145: return "INVALIDTRIANGLESETINDEX"; + case 2000: return "BEAMLATTICE_INVALID_OBJECTTYPE"; + case 3000: return "INVALIDKEYSTORE"; + case 3001: return "INVALIDKEYSTORECONSUMER"; + case 3002: return "KEYSTORECONSUMERNOTFOUND"; + case 3003: return "KEYSTORERESOURCEDATANOTFOUND"; + case 3004: return "SECURECONTEXTNOTREGISTERED"; + case 3005: return "INVALIDKEYSIZE"; + case 4000: return "INCOMPATIBLEPORTTYPES"; + case 4001: return "GRAPHISCYCLIC"; + case 4002: return "INPUTNOTSET"; + case 4003: return "INVALIDNODECONFIGURATION"; + default: return "UNKNOWN"; + } + } + + private static string GetErrorDescription(int errorCode) + { + switch (errorCode) + { + case 0: return "success"; + case 1: return "functionality not implemented"; + case 2: return "an invalid parameter was passed"; + case 3: return "a type cast failed"; + case 4: return "a provided buffer is too small"; + case 5: return "a generic exception occurred"; + case 6: return "the library could not be loaded"; + case 7: return "a required exported symbol could not be found in the library"; + case 8: return "the version of the binary interface does not match the bindings interface"; + case 10: return "a calculation has been aborted"; + case 11: return "functionality should not be called"; + case 100: return "the queried reader class is unknown"; + case 101: return "the queried writer class is unknown"; + case 102: return "the current index of an iterator is invalid"; + case 103: return "no Model Resource has been given"; + case 104: return "Resource not found"; + case 105: return "A model is invalid"; + case 106: return "An object is invalid"; + case 107: return "A mesh object is invalid"; + case 108: return "A components object is invalid"; + case 109: return "A component is invalid"; + case 110: return "A build item is invalid"; + case 111: return "A basematerialgroup is invalid"; + case 112: return "A slicestack resource is invalid"; + case 113: return "A texture resource is invalid"; + case 114: return "A color group resource is invalid"; + case 115: return "A texture2d group resource is invalid"; + case 116: return "A composite materials resource is invalid"; + case 117: return "A MultiPropertyGroup resource is invalid"; + case 120: return "A resource index is invalid"; + case 121: return "Attachment not found"; + case 130: return "A component references one of its ancestors"; + case 131: return "An attachment stream is invalid"; + case 132: return "Invalid property count."; + case 140: return "A progress identifier is unknown"; + case 141: return "An element buffer exceeds its spec limit"; + case 142: return "A resource is invalid"; + case 143: return "A level set is invalid"; + case 144: return "Could not find triangle set"; + case 145: return "Invalid triangle set index"; + case 2000: return "This object type is not valid for beamlattices"; + case 3000: return "The keystore object is invalid"; + case 3001: return "The consumer keystore object is invalid"; + case 3002: return "A consumer has not been found"; + case 3003: return "A resource data has not been found"; + case 3004: return "A Key or Conentent encryption callback has not been registered"; + case 3005: return "The key size is invalid"; + case 4000: return "Link could not be added, the port types are incompatible"; + case 4001: return "The functin graph is cyclic. Only dircected graphs are valid and can be topological sorted."; + case 4002: return "The input of a node is not set."; + case 4003: return "The selected node configuration is not supported"; + default: return "unknown error"; + } + } + } + public enum ePropertyType { NoPropertyType = 0, BaseMaterial = 1, @@ -66,7 +354,14 @@ public enum eObjectType { Other = 0, Model = 1, Support = 2, - SolidSupport = 3 + SolidSupport = 3, + Surface = 4 + }; + + public enum eBooleanOperation { + Union = 0, + Difference = 1, + Intersection = 2 }; public enum eTextureType { @@ -210,7 +505,10 @@ public enum eImplicitNodeType { ConstResourceID = 47, VectorFromScalar = 48, UnsignedMesh = 49, - Mod = 50 + Mod = 50, + BeamLattice = 51, + FunctionGradient = 52, + NormalizeDistance = 53 }; public enum eImplicitPortType { @@ -561,6 +859,9 @@ public class Lib3MFWrapper [DllImport("lib3mf.dll", EntryPoint = "lib3mf_componentsobjectiterator_getcurrentcomponentsobject", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 ComponentsObjectIterator_GetCurrentComponentsObject (IntPtr Handle, out IntPtr AResource); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_booleanobjectiterator_getcurrentbooleanobject", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BooleanObjectIterator_GetCurrentBooleanObject (IntPtr Handle, out IntPtr AResource); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_texture2diterator_getcurrenttexture2d", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Texture2DIterator_GetCurrentTexture2D (IntPtr Handle, out IntPtr AResource); @@ -705,6 +1006,9 @@ public class Lib3MFWrapper [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_islevelsetobject", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Object_IsLevelSetObject (IntPtr Handle, out Byte AIsLevelSetObject); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_isbooleanobject", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Object_IsBooleanObject (IntPtr Handle, out Byte AIsBooleanObject); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_isvalid", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Object_IsValid (IntPtr Handle, out Byte AIsValid); @@ -876,6 +1180,48 @@ public class Lib3MFWrapper [DllImport("lib3mf.dll", EntryPoint = "lib3mf_levelset_setvolumedata", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 LevelSet_SetVolumeData (IntPtr Handle, IntPtr ATheVolumeData); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_booleanobject_setbaseobject", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BooleanObject_SetBaseObject (IntPtr Handle, IntPtr ABaseObject, ref InternalTransform ATransform); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_booleanobject_getbaseobject", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BooleanObject_GetBaseObject (IntPtr Handle, out IntPtr ABaseObject); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_booleanobject_setbasetransform", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BooleanObject_SetBaseTransform (IntPtr Handle, ref InternalTransform ATransform); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_booleanobject_getbasetransform", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BooleanObject_GetBaseTransform (IntPtr Handle, out InternalTransform ATransform); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_booleanobject_setoperation", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BooleanObject_SetOperation (IntPtr Handle, Int32 AOperation); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_booleanobject_getoperation", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BooleanObject_GetOperation (IntPtr Handle, out Int32 AOperation); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_booleanobject_setcsgmodeenabled", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BooleanObject_SetCSGModeEnabled (IntPtr Handle, Byte ACSGModeEnabled); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_booleanobject_getcsgmodeenabled", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BooleanObject_GetCSGModeEnabled (IntPtr Handle, out Byte ACSGModeEnabled); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_booleanobject_setextractiongridresolution", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BooleanObject_SetExtractionGridResolution (IntPtr Handle, UInt32 AGridResolution); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_booleanobject_getextractiongridresolution", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BooleanObject_GetExtractionGridResolution (IntPtr Handle, out UInt32 AGridResolution); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_booleanobject_getoperandcount", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BooleanObject_GetOperandCount (IntPtr Handle, out UInt32 ACount); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_booleanobject_addoperand", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BooleanObject_AddOperand (IntPtr Handle, IntPtr AOperandObject, ref InternalTransform ATransform); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_booleanobject_getoperand", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BooleanObject_GetOperand (IntPtr Handle, UInt32 AIndex, out IntPtr AOperandObject, out InternalTransform ATransform); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_booleanobject_mergetomeshobject", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BooleanObject_MergeToMeshObject (IntPtr Handle, out IntPtr AMeshObject); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_getminlength", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 BeamLattice_GetMinLength (IntPtr Handle, out Double AMinLength); @@ -1557,6 +1903,75 @@ public class Lib3MFWrapper [DllImport("lib3mf.dll", EntryPoint = "lib3mf_unsignedmeshnode_getoutputdistance", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 UnsignedMeshNode_GetOutputDistance (IntPtr Handle, out IntPtr ADistance); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlatticenode_getinputbeamlattice", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BeamLatticeNode_GetInputBeamLattice (IntPtr Handle, out IntPtr ABeamLattice); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlatticenode_getinputpos", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BeamLatticeNode_GetInputPos (IntPtr Handle, out IntPtr APos); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlatticenode_getoutputdistance", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BeamLatticeNode_GetOutputDistance (IntPtr Handle, out IntPtr ADistance); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlatticenode_setaccuraterange", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BeamLatticeNode_SetAccurateRange (IntPtr Handle, Double AAccurateRange); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlatticenode_getaccuraterange", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BeamLatticeNode_GetAccurateRange (IntPtr Handle, out Double AAccurateRange); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_functiongradientnode_getinputfunctionid", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 FunctionGradientNode_GetInputFunctionID (IntPtr Handle, out IntPtr AFunction); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_functiongradientnode_getinputpos", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 FunctionGradientNode_GetInputPos (IntPtr Handle, out IntPtr APos); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_functiongradientnode_getinputstep", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 FunctionGradientNode_GetInputStep (IntPtr Handle, out IntPtr AStep); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_functiongradientnode_setscalaroutputname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 FunctionGradientNode_SetScalarOutputName (IntPtr Handle, byte[] AScalarOutputName); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_functiongradientnode_getscalaroutputname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 FunctionGradientNode_GetScalarOutputName (IntPtr Handle, UInt32 sizeScalarOutputName, out UInt32 neededScalarOutputName, IntPtr dataScalarOutputName); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_functiongradientnode_setvectorinputname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 FunctionGradientNode_SetVectorInputName (IntPtr Handle, byte[] AVectorInputName); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_functiongradientnode_getvectorinputname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 FunctionGradientNode_GetVectorInputName (IntPtr Handle, UInt32 sizeVectorInputName, out UInt32 neededVectorInputName, IntPtr dataVectorInputName); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_functiongradientnode_getoutputnormalizedgradient", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 FunctionGradientNode_GetOutputNormalizedGradient (IntPtr Handle, out IntPtr ANormalizedGradient); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_functiongradientnode_getoutputgradient", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 FunctionGradientNode_GetOutputGradient (IntPtr Handle, out IntPtr AGradient); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_functiongradientnode_getoutputmagnitude", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 FunctionGradientNode_GetOutputMagnitude (IntPtr Handle, out IntPtr AMagnitude); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_normalizedistancenode_getinputfunctionid", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 NormalizeDistanceNode_GetInputFunctionID (IntPtr Handle, out IntPtr AFunction); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_normalizedistancenode_getinputpos", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 NormalizeDistanceNode_GetInputPos (IntPtr Handle, out IntPtr APos); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_normalizedistancenode_getinputstep", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 NormalizeDistanceNode_GetInputStep (IntPtr Handle, out IntPtr AStep); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_normalizedistancenode_setscalaroutputname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 NormalizeDistanceNode_SetScalarOutputName (IntPtr Handle, byte[] AScalarOutputName); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_normalizedistancenode_getscalaroutputname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 NormalizeDistanceNode_GetScalarOutputName (IntPtr Handle, UInt32 sizeScalarOutputName, out UInt32 neededScalarOutputName, IntPtr dataScalarOutputName); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_normalizedistancenode_setvectorinputname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 NormalizeDistanceNode_SetVectorInputName (IntPtr Handle, byte[] AVectorInputName); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_normalizedistancenode_getvectorinputname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 NormalizeDistanceNode_GetVectorInputName (IntPtr Handle, UInt32 sizeVectorInputName, out UInt32 neededVectorInputName, IntPtr dataVectorInputName); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_normalizedistancenode_getoutputresult", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 NormalizeDistanceNode_GetOutputResult (IntPtr Handle, out IntPtr AResult); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_functioncallnode_getinputfunctionid", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 FunctionCallNode_GetInputFunctionID (IntPtr Handle, out IntPtr AFunction); @@ -1746,6 +2161,15 @@ public class Lib3MFWrapper [DllImport("lib3mf.dll", EntryPoint = "lib3mf_implicitfunction_addunsignedmeshnode", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 ImplicitFunction_AddUnsignedMeshNode (IntPtr Handle, byte[] AIdentifier, byte[] ADisplayName, byte[] ATag, out IntPtr ANode); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_implicitfunction_addbeamlatticenode", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ImplicitFunction_AddBeamLatticeNode (IntPtr Handle, byte[] AIdentifier, byte[] ADisplayName, byte[] ATag, out IntPtr ANode); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_implicitfunction_addfunctiongradientnode", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ImplicitFunction_AddFunctionGradientNode (IntPtr Handle, byte[] AIdentifier, byte[] ADisplayName, byte[] ATag, out IntPtr ANode); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_implicitfunction_addnormalizedistancenode", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ImplicitFunction_AddNormalizeDistanceNode (IntPtr Handle, byte[] AIdentifier, byte[] ADisplayName, byte[] ATag, out IntPtr ANode); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_implicitfunction_addfunctioncallnode", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 ImplicitFunction_AddFunctionCallNode (IntPtr Handle, byte[] AIdentifier, byte[] ADisplayName, byte[] ATag, out IntPtr ANode); @@ -2073,6 +2497,9 @@ public class Lib3MFWrapper [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getcomponentsobjectbyid", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Model_GetComponentsObjectByID (IntPtr Handle, UInt32 AUniqueResourceID, out IntPtr AComponentsObjectInstance); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getbooleanobjectbyid", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Model_GetBooleanObjectByID (IntPtr Handle, UInt32 AUniqueResourceID, out IntPtr ABooleanObjectInstance); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getcolorgroupbyid", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Model_GetColorGroupByID (IntPtr Handle, UInt32 AUniqueResourceID, out IntPtr AColorGroupInstance); @@ -2106,6 +2533,9 @@ public class Lib3MFWrapper [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getcomponentsobjects", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Model_GetComponentsObjects (IntPtr Handle, out IntPtr AResourceIterator); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getbooleanobjects", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Model_GetBooleanObjects (IntPtr Handle, out IntPtr AResourceIterator); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_gettexture2ds", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Model_GetTexture2Ds (IntPtr Handle, out IntPtr AResourceIterator); @@ -2142,6 +2572,9 @@ public class Lib3MFWrapper [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_addcomponentsobject", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Model_AddComponentsObject (IntPtr Handle, out IntPtr AComponentsObjectInstance); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_addbooleanobject", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Model_AddBooleanObject (IntPtr Handle, out IntPtr ABooleanObjectInstance); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_addslicestack", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Model_AddSliceStack (IntPtr Handle, Double AZBottom, out IntPtr ASliceStackInstance); @@ -2629,7 +3062,7 @@ public static void ThrowError(IntPtr Handle, Int32 errorCode) } } - throw new Exception(sMessage + "(# " + errorCode + ")"); + throw new ELib3MFException(errorCode, sMessage); } /** @@ -2660,6 +3093,7 @@ public static T PolymorphicFactory(IntPtr Handle) where T : class case 0xDE92510BD2112288: Object = new CObjectIterator(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::ObjectIterator" case 0xF4196034E2B9FDE6: Object = new CMeshObjectIterator(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObjectIterator" case 0x564DE4217ED7614A: Object = new CComponentsObjectIterator(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObjectIterator" + case 0xAFF01F512E1FF6AE: Object = new CBooleanObjectIterator(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::BooleanObjectIterator" case 0x4BD32B4870FFC03B: Object = new CTexture2DIterator(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DIterator" case 0x65E6EDD9362C79CB: Object = new CBaseMaterialGroupIterator(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroupIterator" case 0x10274A1757C729C0: Object = new CColorGroupIterator(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroupIterator" @@ -2675,6 +3109,7 @@ public static T PolymorphicFactory(IntPtr Handle) where T : class case 0x2DA2136F577A779C: Object = new CObject(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::Object" case 0x3B3A6DC6EC610497: Object = new CMeshObject(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObject" case 0xE8A7D9C192EFD0E2: Object = new CLevelSet(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::LevelSet" + case 0x85FA0E8806B6C357: Object = new CBooleanObject(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::BooleanObject" case 0x63B3B461B30B4BA5: Object = new CBeamLattice(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLattice" case 0x4DF17E76926221C2: Object = new CFunctionReference(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionReference" case 0xD85B5B6143E787E3: Object = new CVolumeDataColor(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::VolumeDataColor" @@ -2750,6 +3185,9 @@ public static T PolymorphicFactory(IntPtr Handle) where T : class case 0xF85C90EDCE6F90A4: Object = new CConstMatNode(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::ConstMatNode" case 0x53601FD432E3DEF4: Object = new CMeshNode(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshNode" case 0x29985A628251A9CD: Object = new CUnsignedMeshNode(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::UnsignedMeshNode" + case 0x0F3A4EE98F7FEC0C: Object = new CBeamLatticeNode(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLatticeNode" + case 0x0437E27AEF740121: Object = new CFunctionGradientNode(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionGradientNode" + case 0x817D2E566E73AA8F: Object = new CNormalizeDistanceNode(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::NormalizeDistanceNode" case 0x0765C17C952F24E3: Object = new CFunctionCallNode(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionCallNode" case 0xFC006BC888CAB4D0: Object = new CNodeIterator(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::NodeIterator" case 0x9EFB2757CA1A5231: Object = new CFunction(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::Function" @@ -3227,6 +3665,22 @@ public CComponentsObject GetCurrentComponentsObject () } + public class CBooleanObjectIterator : CResourceIterator + { + public CBooleanObjectIterator (IntPtr NewHandle) : base (NewHandle) + { + } + + public CBooleanObject GetCurrentBooleanObject () + { + IntPtr newResource = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.BooleanObjectIterator_GetCurrentBooleanObject (Handle, out newResource)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); + } + + } + public class CTexture2DIterator : CResourceIterator { public CTexture2DIterator (IntPtr NewHandle) : base (NewHandle) @@ -3760,6 +4214,14 @@ public bool IsLevelSetObject () return (resultIsLevelSetObject != 0); } + public bool IsBooleanObject () + { + Byte resultIsBooleanObject = 0; + + CheckError(Internal.Lib3MFWrapper.Object_IsBooleanObject (Handle, out resultIsBooleanObject)); + return (resultIsBooleanObject != 0); + } + public bool IsValid () { Byte resultIsValid = 0; @@ -4274,6 +4736,126 @@ public void SetVolumeData (CVolumeData ATheVolumeData) } + public class CBooleanObject : CObject + { + public CBooleanObject (IntPtr NewHandle) : base (NewHandle) + { + } + + public void SetBaseObject (CObject ABaseObject, sTransform ATransform) + { + IntPtr ABaseObjectHandle = IntPtr.Zero; + if (ABaseObject != null) + ABaseObjectHandle = ABaseObject.GetHandle(); + Internal.InternalTransform intTransform = Internal.Lib3MFWrapper.convertStructToInternal_Transform (ATransform); + + CheckError(Internal.Lib3MFWrapper.BooleanObject_SetBaseObject (Handle, ABaseObjectHandle, ref intTransform)); + } + + public CObject GetBaseObject () + { + IntPtr newBaseObject = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.BooleanObject_GetBaseObject (Handle, out newBaseObject)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newBaseObject); + } + + public void SetBaseTransform (sTransform ATransform) + { + Internal.InternalTransform intTransform = Internal.Lib3MFWrapper.convertStructToInternal_Transform (ATransform); + + CheckError(Internal.Lib3MFWrapper.BooleanObject_SetBaseTransform (Handle, ref intTransform)); + } + + public sTransform GetBaseTransform () + { + Internal.InternalTransform intresultTransform; + + CheckError(Internal.Lib3MFWrapper.BooleanObject_GetBaseTransform (Handle, out intresultTransform)); + return Internal.Lib3MFWrapper.convertInternalToStruct_Transform (intresultTransform); + } + + public void SetOperation (eBooleanOperation AOperation) + { + Int32 enumOperation = (Int32) AOperation; + + CheckError(Internal.Lib3MFWrapper.BooleanObject_SetOperation (Handle, enumOperation)); + } + + public eBooleanOperation GetOperation () + { + Int32 resultOperation = 0; + + CheckError(Internal.Lib3MFWrapper.BooleanObject_GetOperation (Handle, out resultOperation)); + return (eBooleanOperation) (resultOperation); + } + + public void SetCSGModeEnabled (bool ACSGModeEnabled) + { + + CheckError(Internal.Lib3MFWrapper.BooleanObject_SetCSGModeEnabled (Handle, (Byte)( ACSGModeEnabled ? 1 : 0 ))); + } + + public bool GetCSGModeEnabled () + { + Byte resultCSGModeEnabled = 0; + + CheckError(Internal.Lib3MFWrapper.BooleanObject_GetCSGModeEnabled (Handle, out resultCSGModeEnabled)); + return (resultCSGModeEnabled != 0); + } + + public void SetExtractionGridResolution (UInt32 AGridResolution) + { + + CheckError(Internal.Lib3MFWrapper.BooleanObject_SetExtractionGridResolution (Handle, AGridResolution)); + } + + public UInt32 GetExtractionGridResolution () + { + UInt32 resultGridResolution = 0; + + CheckError(Internal.Lib3MFWrapper.BooleanObject_GetExtractionGridResolution (Handle, out resultGridResolution)); + return resultGridResolution; + } + + public UInt32 GetOperandCount () + { + UInt32 resultCount = 0; + + CheckError(Internal.Lib3MFWrapper.BooleanObject_GetOperandCount (Handle, out resultCount)); + return resultCount; + } + + public void AddOperand (CMeshObject AOperandObject, sTransform ATransform) + { + IntPtr AOperandObjectHandle = IntPtr.Zero; + if (AOperandObject != null) + AOperandObjectHandle = AOperandObject.GetHandle(); + Internal.InternalTransform intTransform = Internal.Lib3MFWrapper.convertStructToInternal_Transform (ATransform); + + CheckError(Internal.Lib3MFWrapper.BooleanObject_AddOperand (Handle, AOperandObjectHandle, ref intTransform)); + } + + public sTransform GetOperand (UInt32 AIndex, out CMeshObject AOperandObject) + { + IntPtr newOperandObject = IntPtr.Zero; + Internal.InternalTransform intresultTransform; + + CheckError(Internal.Lib3MFWrapper.BooleanObject_GetOperand (Handle, AIndex, out newOperandObject, out intresultTransform)); + AOperandObject = Internal.Lib3MFWrapper.PolymorphicFactory(newOperandObject); + return Internal.Lib3MFWrapper.convertInternalToStruct_Transform (intresultTransform); + } + + public CMeshObject MergeToMeshObject () + { + IntPtr newMeshObject = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.BooleanObject_MergeToMeshObject (Handle, out newMeshObject)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newMeshObject); + } + + } + public class CBeamLattice : CBase { public CBeamLattice (IntPtr NewHandle) : base (NewHandle) @@ -6832,6 +7414,232 @@ public CImplicitPort GetOutputDistance () } + public class CBeamLatticeNode : CImplicitNode + { + public CBeamLatticeNode (IntPtr NewHandle) : base (NewHandle) + { + } + + public CImplicitPort GetInputBeamLattice () + { + IntPtr newBeamLattice = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.BeamLatticeNode_GetInputBeamLattice (Handle, out newBeamLattice)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newBeamLattice); + } + + public CImplicitPort GetInputPos () + { + IntPtr newPos = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.BeamLatticeNode_GetInputPos (Handle, out newPos)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newPos); + } + + public CImplicitPort GetOutputDistance () + { + IntPtr newDistance = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.BeamLatticeNode_GetOutputDistance (Handle, out newDistance)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newDistance); + } + + public void SetAccurateRange (Double AAccurateRange) + { + + CheckError(Internal.Lib3MFWrapper.BeamLatticeNode_SetAccurateRange (Handle, AAccurateRange)); + } + + public Double GetAccurateRange () + { + Double resultAccurateRange = 0; + + CheckError(Internal.Lib3MFWrapper.BeamLatticeNode_GetAccurateRange (Handle, out resultAccurateRange)); + return resultAccurateRange; + } + + } + + public class CFunctionGradientNode : CImplicitNode + { + public CFunctionGradientNode (IntPtr NewHandle) : base (NewHandle) + { + } + + public CImplicitPort GetInputFunctionID () + { + IntPtr newFunction = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.FunctionGradientNode_GetInputFunctionID (Handle, out newFunction)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newFunction); + } + + public CImplicitPort GetInputPos () + { + IntPtr newPos = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.FunctionGradientNode_GetInputPos (Handle, out newPos)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newPos); + } + + public CImplicitPort GetInputStep () + { + IntPtr newStep = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.FunctionGradientNode_GetInputStep (Handle, out newStep)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newStep); + } + + public void SetScalarOutputName (String AScalarOutputName) + { + byte[] byteScalarOutputName = Encoding.UTF8.GetBytes(AScalarOutputName + char.MinValue); + + CheckError(Internal.Lib3MFWrapper.FunctionGradientNode_SetScalarOutputName (Handle, byteScalarOutputName)); + } + + public String GetScalarOutputName () + { + UInt32 sizeScalarOutputName = 0; + UInt32 neededScalarOutputName = 0; + CheckError(Internal.Lib3MFWrapper.FunctionGradientNode_GetScalarOutputName (Handle, sizeScalarOutputName, out neededScalarOutputName, IntPtr.Zero)); + sizeScalarOutputName = neededScalarOutputName; + byte[] bytesScalarOutputName = new byte[sizeScalarOutputName]; + GCHandle dataScalarOutputName = GCHandle.Alloc(bytesScalarOutputName, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.FunctionGradientNode_GetScalarOutputName (Handle, sizeScalarOutputName, out neededScalarOutputName, dataScalarOutputName.AddrOfPinnedObject())); + dataScalarOutputName.Free(); + return Encoding.UTF8.GetString(bytesScalarOutputName).TrimEnd(char.MinValue); + } + + public void SetVectorInputName (String AVectorInputName) + { + byte[] byteVectorInputName = Encoding.UTF8.GetBytes(AVectorInputName + char.MinValue); + + CheckError(Internal.Lib3MFWrapper.FunctionGradientNode_SetVectorInputName (Handle, byteVectorInputName)); + } + + public String GetVectorInputName () + { + UInt32 sizeVectorInputName = 0; + UInt32 neededVectorInputName = 0; + CheckError(Internal.Lib3MFWrapper.FunctionGradientNode_GetVectorInputName (Handle, sizeVectorInputName, out neededVectorInputName, IntPtr.Zero)); + sizeVectorInputName = neededVectorInputName; + byte[] bytesVectorInputName = new byte[sizeVectorInputName]; + GCHandle dataVectorInputName = GCHandle.Alloc(bytesVectorInputName, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.FunctionGradientNode_GetVectorInputName (Handle, sizeVectorInputName, out neededVectorInputName, dataVectorInputName.AddrOfPinnedObject())); + dataVectorInputName.Free(); + return Encoding.UTF8.GetString(bytesVectorInputName).TrimEnd(char.MinValue); + } + + public CImplicitPort GetOutputNormalizedGradient () + { + IntPtr newNormalizedGradient = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.FunctionGradientNode_GetOutputNormalizedGradient (Handle, out newNormalizedGradient)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newNormalizedGradient); + } + + public CImplicitPort GetOutputGradient () + { + IntPtr newGradient = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.FunctionGradientNode_GetOutputGradient (Handle, out newGradient)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newGradient); + } + + public CImplicitPort GetOutputMagnitude () + { + IntPtr newMagnitude = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.FunctionGradientNode_GetOutputMagnitude (Handle, out newMagnitude)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newMagnitude); + } + + } + + public class CNormalizeDistanceNode : CImplicitNode + { + public CNormalizeDistanceNode (IntPtr NewHandle) : base (NewHandle) + { + } + + public CImplicitPort GetInputFunctionID () + { + IntPtr newFunction = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.NormalizeDistanceNode_GetInputFunctionID (Handle, out newFunction)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newFunction); + } + + public CImplicitPort GetInputPos () + { + IntPtr newPos = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.NormalizeDistanceNode_GetInputPos (Handle, out newPos)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newPos); + } + + public CImplicitPort GetInputStep () + { + IntPtr newStep = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.NormalizeDistanceNode_GetInputStep (Handle, out newStep)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newStep); + } + + public void SetScalarOutputName (String AScalarOutputName) + { + byte[] byteScalarOutputName = Encoding.UTF8.GetBytes(AScalarOutputName + char.MinValue); + + CheckError(Internal.Lib3MFWrapper.NormalizeDistanceNode_SetScalarOutputName (Handle, byteScalarOutputName)); + } + + public String GetScalarOutputName () + { + UInt32 sizeScalarOutputName = 0; + UInt32 neededScalarOutputName = 0; + CheckError(Internal.Lib3MFWrapper.NormalizeDistanceNode_GetScalarOutputName (Handle, sizeScalarOutputName, out neededScalarOutputName, IntPtr.Zero)); + sizeScalarOutputName = neededScalarOutputName; + byte[] bytesScalarOutputName = new byte[sizeScalarOutputName]; + GCHandle dataScalarOutputName = GCHandle.Alloc(bytesScalarOutputName, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.NormalizeDistanceNode_GetScalarOutputName (Handle, sizeScalarOutputName, out neededScalarOutputName, dataScalarOutputName.AddrOfPinnedObject())); + dataScalarOutputName.Free(); + return Encoding.UTF8.GetString(bytesScalarOutputName).TrimEnd(char.MinValue); + } + + public void SetVectorInputName (String AVectorInputName) + { + byte[] byteVectorInputName = Encoding.UTF8.GetBytes(AVectorInputName + char.MinValue); + + CheckError(Internal.Lib3MFWrapper.NormalizeDistanceNode_SetVectorInputName (Handle, byteVectorInputName)); + } + + public String GetVectorInputName () + { + UInt32 sizeVectorInputName = 0; + UInt32 neededVectorInputName = 0; + CheckError(Internal.Lib3MFWrapper.NormalizeDistanceNode_GetVectorInputName (Handle, sizeVectorInputName, out neededVectorInputName, IntPtr.Zero)); + sizeVectorInputName = neededVectorInputName; + byte[] bytesVectorInputName = new byte[sizeVectorInputName]; + GCHandle dataVectorInputName = GCHandle.Alloc(bytesVectorInputName, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.NormalizeDistanceNode_GetVectorInputName (Handle, sizeVectorInputName, out neededVectorInputName, dataVectorInputName.AddrOfPinnedObject())); + dataVectorInputName.Free(); + return Encoding.UTF8.GetString(bytesVectorInputName).TrimEnd(char.MinValue); + } + + public CImplicitPort GetOutputResult () + { + IntPtr newResult = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.NormalizeDistanceNode_GetOutputResult (Handle, out newResult)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newResult); + } + + } + public class CFunctionCallNode : CImplicitNode { public CFunctionCallNode (IntPtr NewHandle) : base (NewHandle) @@ -7566,6 +8374,39 @@ public CUnsignedMeshNode AddUnsignedMeshNode (String AIdentifier, String ADispla return Internal.Lib3MFWrapper.PolymorphicFactory(newNode); } + public CBeamLatticeNode AddBeamLatticeNode (String AIdentifier, String ADisplayName, String ATag) + { + byte[] byteIdentifier = Encoding.UTF8.GetBytes(AIdentifier + char.MinValue); + byte[] byteDisplayName = Encoding.UTF8.GetBytes(ADisplayName + char.MinValue); + byte[] byteTag = Encoding.UTF8.GetBytes(ATag + char.MinValue); + IntPtr newNode = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.ImplicitFunction_AddBeamLatticeNode (Handle, byteIdentifier, byteDisplayName, byteTag, out newNode)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newNode); + } + + public CFunctionGradientNode AddFunctionGradientNode (String AIdentifier, String ADisplayName, String ATag) + { + byte[] byteIdentifier = Encoding.UTF8.GetBytes(AIdentifier + char.MinValue); + byte[] byteDisplayName = Encoding.UTF8.GetBytes(ADisplayName + char.MinValue); + byte[] byteTag = Encoding.UTF8.GetBytes(ATag + char.MinValue); + IntPtr newNode = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.ImplicitFunction_AddFunctionGradientNode (Handle, byteIdentifier, byteDisplayName, byteTag, out newNode)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newNode); + } + + public CNormalizeDistanceNode AddNormalizeDistanceNode (String AIdentifier, String ADisplayName, String ATag) + { + byte[] byteIdentifier = Encoding.UTF8.GetBytes(AIdentifier + char.MinValue); + byte[] byteDisplayName = Encoding.UTF8.GetBytes(ADisplayName + char.MinValue); + byte[] byteTag = Encoding.UTF8.GetBytes(ATag + char.MinValue); + IntPtr newNode = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.ImplicitFunction_AddNormalizeDistanceNode (Handle, byteIdentifier, byteDisplayName, byteTag, out newNode)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newNode); + } + public CFunctionCallNode AddFunctionCallNode (String AIdentifier, String ADisplayName, String ATag) { byte[] byteIdentifier = Encoding.UTF8.GetBytes(AIdentifier + char.MinValue); @@ -8674,6 +9515,14 @@ public CComponentsObject GetComponentsObjectByID (UInt32 AUniqueResourceID) return Internal.Lib3MFWrapper.PolymorphicFactory(newComponentsObjectInstance); } + public CBooleanObject GetBooleanObjectByID (UInt32 AUniqueResourceID) + { + IntPtr newBooleanObjectInstance = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.Model_GetBooleanObjectByID (Handle, AUniqueResourceID, out newBooleanObjectInstance)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newBooleanObjectInstance); + } + public CColorGroup GetColorGroupByID (UInt32 AUniqueResourceID) { IntPtr newColorGroupInstance = IntPtr.Zero; @@ -8769,6 +9618,14 @@ public CComponentsObjectIterator GetComponentsObjects () return Internal.Lib3MFWrapper.PolymorphicFactory(newResourceIterator); } + public CBooleanObjectIterator GetBooleanObjects () + { + IntPtr newResourceIterator = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.Model_GetBooleanObjects (Handle, out newResourceIterator)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newResourceIterator); + } + public CTexture2DIterator GetTexture2Ds () { IntPtr newResourceIterator = IntPtr.Zero; @@ -8866,6 +9723,14 @@ public CComponentsObject AddComponentsObject () return Internal.Lib3MFWrapper.PolymorphicFactory(newComponentsObjectInstance); } + public CBooleanObject AddBooleanObject () + { + IntPtr newBooleanObjectInstance = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.Model_AddBooleanObject (Handle, out newBooleanObjectInstance)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newBooleanObjectInstance); + } + public CSliceStack AddSliceStack (Double AZBottom) { IntPtr newSliceStackInstance = IntPtr.Zero; @@ -9141,7 +10006,7 @@ public void RemoveResource (CResource AResource) } - class Wrapper + public class Wrapper { private static void CheckError (Int32 errorCode) { diff --git a/Autogenerated/Bindings/Cpp/lib3mf_abi.hpp b/Autogenerated/Bindings/Cpp/lib3mf_abi.hpp index b7f5c96da..b247b7351 100644 --- a/Autogenerated/Bindings/Cpp/lib3mf_abi.hpp +++ b/Autogenerated/Bindings/Cpp/lib3mf_abi.hpp @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++-Header file in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -497,6 +497,19 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobjectiterator_getcurrentmeshobject(Lib3 */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobjectiterator_getcurrentcomponentsobject(Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); +/************************************************************************************************************************* + Class definition for BooleanObjectIterator +**************************************************************************************************************************/ + +/** +* Returns the BooleanObject the iterator points at. +* +* @param[in] pBooleanObjectIterator - BooleanObjectIterator instance. +* @param[out] pResource - returns the BooleanObject instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobjectiterator_getcurrentbooleanobject(Lib3MF_BooleanObjectIterator pBooleanObjectIterator, Lib3MF_BooleanObject * pResource); + /************************************************************************************************************************* Class definition for Texture2DIterator **************************************************************************************************************************/ @@ -1011,6 +1024,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_iscomponentsobject(Lib3MF_Object pObj */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_islevelsetobject(Lib3MF_Object pObject, bool * pIsLevelSetObject); +/** +* Retrieves, if an object is a boolean object +* +* @param[in] pObject - Object instance. +* @param[out] pIsBooleanObject - returns, whether the object is a boolean object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_isbooleanobject(Lib3MF_Object pObject, bool * pIsBooleanObject); + /** * Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * @@ -1561,6 +1583,140 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_getvolumedata(Lib3MF_LevelSet pLeve */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_setvolumedata(Lib3MF_LevelSet pLevelSet, Lib3MF_VolumeData pTheVolumeData); +/************************************************************************************************************************* + Class definition for BooleanObject +**************************************************************************************************************************/ + +/** +* Sets the base object and transform for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pBaseObject - base object of the boolean shape +* @param[in] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_setbaseobject(Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object pBaseObject, const Lib3MF::sTransform * pTransform); + +/** +* Returns the base object of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pBaseObject - base object of the boolean shape +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getbaseobject(Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object * pBaseObject); + +/** +* Sets the base transform of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_setbasetransform(Lib3MF_BooleanObject pBooleanObject, const Lib3MF::sTransform * pTransform); + +/** +* Returns the base transform of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getbasetransform(Lib3MF_BooleanObject pBooleanObject, Lib3MF::sTransform * pTransform); + +/** +* Sets the boolean operation used for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] eOperation - boolean operation used for the shape +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_setoperation(Lib3MF_BooleanObject pBooleanObject, Lib3MF::eBooleanOperation eOperation); + +/** +* Returns the boolean operation used for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pOperation - boolean operation used for the shape +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getoperation(Lib3MF_BooleanObject pBooleanObject, Lib3MF::eBooleanOperation * pOperation); + +/** +* Enables or disables CSG field evaluation for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] bCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_setcsgmodeenabled(Lib3MF_BooleanObject pBooleanObject, bool bCSGModeEnabled); + +/** +* Returns whether CSG field evaluation is enabled for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getcsgmodeenabled(Lib3MF_BooleanObject pBooleanObject, bool * pCSGModeEnabled); + +/** +* Sets the extraction grid resolution used for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] nGridResolution - extraction grid resolution for boolean surface extraction +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_setextractiongridresolution(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nGridResolution); + +/** +* Returns the extraction grid resolution used for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pGridResolution - extraction grid resolution for boolean surface extraction +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getextractiongridresolution(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pGridResolution); + +/** +* Returns the number of operands in the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pCount - number of operands in the boolean sequence +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getoperandcount(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pCount); + +/** +* Adds an operand object to the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pOperandObject - mesh object used as operand +* @param[in] pTransform - transform applied to the operand object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_addoperand(Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject pOperandObject, const Lib3MF::sTransform * pTransform); + +/** +* Returns one operand object and transform from the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] nIndex - index of the operand in the boolean sequence +* @param[out] pOperandObject - mesh object used as operand +* @param[out] pTransform - transform applied to the operand object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getoperand(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nIndex, Lib3MF_MeshObject * pOperandObject, Lib3MF::sTransform * pTransform); + +/** +* Materializes the boolean shape into a newly created mesh object. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pMeshObject - new mesh object containing the tessellated boolean shape +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_mergetomeshobject(Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject * pMeshObject); + /************************************************************************************************************************* Class definition for BeamLattice **************************************************************************************************************************/ @@ -1926,7 +2082,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_setbasematerialgroup(Lib LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_getmaterialmappingcount(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 * pCount); /** -* Returns MaterialMappting with given index +* Returns MaterialMapping with given index * * @param[in] pVolumeDataComposite - VolumeDataComposite instance. * @param[in] nIndex - Index of the MaterialMapping in question. @@ -1936,7 +2092,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_getmaterialmappingcount( LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_getmaterialmapping(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 nIndex, Lib3MF_MaterialMapping * pTheMaterialMapping); /** -* Adds a the MaterialMapping +* Adds a MaterialMapping * * @param[in] pVolumeDataComposite - VolumeDataComposite instance. * @param[in] pTransform - new transformation matrix @@ -2048,7 +2204,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedata_removecolor(Lib3MF_VolumeData pVo * Returns the number of VolumeDataProperty * * @param[in] pVolumeData - VolumeData instance. -* @param[out] pCount - the number of VolumeDataProperty-elements within this VolumdeData +* @param[out] pCount - the number of VolumeDataProperty-elements within this VolumeData * @return error code or 0 (success) */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedata_getpropertycount(Lib3MF_VolumeData pVolumeData, Lib3MF_uint32 * pCount); @@ -2873,7 +3029,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_setrelationshiptype(Lib3MF_Attach LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAttachment, const char * pFileName); /** -* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * * @param[in] pAttachment - Attachment instance. * @param[in] pFileName - file to read from. @@ -2882,7 +3038,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAt LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfromfile(Lib3MF_Attachment pAttachment, const char * pFileName); /** -* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * * @param[in] pAttachment - Attachment instance. * @param[in] pTheReadCallback - Callback to call for reading a data chunk @@ -2914,7 +3070,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getstreamsize(Lib3MF_Attachment p LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetobuffer(Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); /** -* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* Reads an attachment from a memory buffer. This buffer is immediately read (in contrast to the ReadFromCallback and ReadFromFile-methods). * * @param[in] pAttachment - Attachment instance. * @param[in] nBufferBufferSize - Number of elements in buffer @@ -4026,6 +4182,233 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_unsignedmeshnode_getinputpos(Lib3MF_Unsigned */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_unsignedmeshnode_getoutputdistance(Lib3MF_UnsignedMeshNode pUnsignedMeshNode, Lib3MF_ImplicitPort * pDistance); +/************************************************************************************************************************* + Class definition for BeamLatticeNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the model resource id of the beam lattice +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pBeamLattice - the input port for the model resource id of the beam lattice (mesh with beamlattice extension) +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_getinputbeamlattice(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pBeamLattice); + +/** +* Retrieves the input for the position +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_getinputpos(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the output +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pDistance - the output port for the signed distance to the beam lattice +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_getoutputdistance(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pDistance); + +/** +* Sets the accurate range for distance computation +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[in] dAccurateRange - the accurate range in model units +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_setaccuraterange(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double dAccurateRange); + +/** +* Retrieves the accurate range for distance computation +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pAccurateRange - the accurate range in model units +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_getaccuraterange(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double * pAccurateRange); + +/************************************************************************************************************************* + Class definition for FunctionGradientNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the function id +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pFunction - the input port for the function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getinputfunctionid(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pFunction); + +/** +* Retrieves the input for the position +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getinputpos(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the input for the finite difference step +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pStep - the input port for the finite difference step +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getinputstep(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pStep); + +/** +* Sets the name of the referenced scalar output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] pScalarOutputName - the name of the scalar output of the referenced function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_setscalaroutputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pScalarOutputName); + +/** +* Retrieves the name of the referenced scalar output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getscalaroutputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + +/** +* Sets the name of the referenced vector input +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_setvectorinputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pVectorInputName); + +/** +* Retrieves the name of the referenced vector input +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getvectorinputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + +/** +* Retrieves the normalized gradient output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pNormalizedGradient - the output port for the normalized gradient +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getoutputnormalizedgradient(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pNormalizedGradient); + +/** +* Retrieves the raw gradient output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pGradient - the output port for the raw gradient +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getoutputgradient(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pGradient); + +/** +* Retrieves the gradient magnitude output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pMagnitude - the output port for the gradient magnitude +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getoutputmagnitude(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pMagnitude); + +/************************************************************************************************************************* + Class definition for NormalizeDistanceNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the function id +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pFunction - the input port for the function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getinputfunctionid(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pFunction); + +/** +* Retrieves the input for the position +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pPos - the input port for the position (vector) +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getinputpos(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the input for the finite difference step +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pStep - the input port for the finite difference step +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getinputstep(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pStep); + +/** +* Sets the name of the referenced scalar output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] pScalarOutputName - the name of the scalar output of the referenced function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_setscalaroutputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pScalarOutputName); + +/** +* Retrieves the name of the referenced scalar output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getscalaroutputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + +/** +* Sets the name of the referenced vector input +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_setvectorinputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pVectorInputName); + +/** +* Retrieves the name of the referenced vector input +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getvectorinputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + +/** +* Retrieves the normalized result output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pResult - the output port for the normalized distance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getoutputresult(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pResult); + /************************************************************************************************************************* Class definition for FunctionCallNode **************************************************************************************************************************/ @@ -4801,6 +5184,42 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addmeshnode(Lib3MF_Implicit */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addunsignedmeshnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_UnsignedMeshNode * pNode); +/** +* Add a BeamLatticeNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addbeamlatticenode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_BeamLatticeNode * pNode); + +/** +* Add a FunctionGradientNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addfunctiongradientnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_FunctionGradientNode * pNode); + +/** +* Add a NormalizeDistanceNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addnormalizedistancenode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_NormalizeDistanceNode * pNode); + /** * Add a FunctionCallNode * @@ -5915,6 +6334,16 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getmeshobjectbyid(Lib3MF_Model pModel, */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getcomponentsobjectbyid(Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_ComponentsObject * pComponentsObjectInstance); +/** +* finds a boolean object by its UniqueResourceID +* +* @param[in] pModel - Model instance. +* @param[in] nUniqueResourceID - UniqueResourceID +* @param[out] pBooleanObjectInstance - returns the boolean object instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getbooleanobjectbyid(Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_BooleanObject * pBooleanObjectInstance); + /** * finds a model color group by its UniqueResourceID * @@ -6020,6 +6449,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getmeshobjects(Lib3MF_Model pModel, Li */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getcomponentsobjects(Lib3MF_Model pModel, Lib3MF_ComponentsObjectIterator * pResourceIterator); +/** +* creates a resource iterator instance with all boolean object resources. +* +* @param[in] pModel - Model instance. +* @param[out] pResourceIterator - returns the iterator instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getbooleanobjects(Lib3MF_Model pModel, Lib3MF_BooleanObjectIterator * pResourceIterator); + /** * creates a Texture2DIterator instance with all texture2d resources. * @@ -6128,6 +6566,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addmeshobject(Lib3MF_Model pModel, Lib */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addcomponentsobject(Lib3MF_Model pModel, Lib3MF_ComponentsObject * pComponentsObjectInstance); +/** +* adds an empty boolean object to the model. +* +* @param[in] pModel - Model instance. +* @param[out] pBooleanObjectInstance - returns the boolean object instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addbooleanobject(Lib3MF_Model pModel, Lib3MF_BooleanObject * pBooleanObjectInstance); + /** * creates a new model slicestack by its id * diff --git a/Autogenerated/Bindings/Cpp/lib3mf_implicit.hpp b/Autogenerated/Bindings/Cpp/lib3mf_implicit.hpp index 3eb2e2b82..c0a282adb 100644 --- a/Autogenerated/Bindings/Cpp/lib3mf_implicit.hpp +++ b/Autogenerated/Bindings/Cpp/lib3mf_implicit.hpp @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++-Header file in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -67,6 +67,7 @@ class CSliceStackIterator; class CObjectIterator; class CMeshObjectIterator; class CComponentsObjectIterator; +class CBooleanObjectIterator; class CTexture2DIterator; class CBaseMaterialGroupIterator; class CColorGroupIterator; @@ -82,6 +83,7 @@ class CTriangleSet; class CObject; class CMeshObject; class CLevelSet; +class CBooleanObject; class CBeamLattice; class CFunctionReference; class CVolumeDataColor; @@ -157,6 +159,9 @@ class CConstVecNode; class CConstMatNode; class CMeshNode; class CUnsignedMeshNode; +class CBeamLatticeNode; +class CFunctionGradientNode; +class CNormalizeDistanceNode; class CFunctionCallNode; class CNodeIterator; class CFunction; @@ -188,6 +193,7 @@ typedef CSliceStackIterator CLib3MFSliceStackIterator; typedef CObjectIterator CLib3MFObjectIterator; typedef CMeshObjectIterator CLib3MFMeshObjectIterator; typedef CComponentsObjectIterator CLib3MFComponentsObjectIterator; +typedef CBooleanObjectIterator CLib3MFBooleanObjectIterator; typedef CTexture2DIterator CLib3MFTexture2DIterator; typedef CBaseMaterialGroupIterator CLib3MFBaseMaterialGroupIterator; typedef CColorGroupIterator CLib3MFColorGroupIterator; @@ -203,6 +209,7 @@ typedef CTriangleSet CLib3MFTriangleSet; typedef CObject CLib3MFObject; typedef CMeshObject CLib3MFMeshObject; typedef CLevelSet CLib3MFLevelSet; +typedef CBooleanObject CLib3MFBooleanObject; typedef CBeamLattice CLib3MFBeamLattice; typedef CFunctionReference CLib3MFFunctionReference; typedef CVolumeDataColor CLib3MFVolumeDataColor; @@ -278,6 +285,9 @@ typedef CConstVecNode CLib3MFConstVecNode; typedef CConstMatNode CLib3MFConstMatNode; typedef CMeshNode CLib3MFMeshNode; typedef CUnsignedMeshNode CLib3MFUnsignedMeshNode; +typedef CBeamLatticeNode CLib3MFBeamLatticeNode; +typedef CFunctionGradientNode CLib3MFFunctionGradientNode; +typedef CNormalizeDistanceNode CLib3MFNormalizeDistanceNode; typedef CFunctionCallNode CLib3MFFunctionCallNode; typedef CNodeIterator CLib3MFNodeIterator; typedef CFunction CLib3MFFunction; @@ -309,6 +319,7 @@ typedef std::shared_ptr PSliceStackIterator; typedef std::shared_ptr PObjectIterator; typedef std::shared_ptr PMeshObjectIterator; typedef std::shared_ptr PComponentsObjectIterator; +typedef std::shared_ptr PBooleanObjectIterator; typedef std::shared_ptr PTexture2DIterator; typedef std::shared_ptr PBaseMaterialGroupIterator; typedef std::shared_ptr PColorGroupIterator; @@ -324,6 +335,7 @@ typedef std::shared_ptr PTriangleSet; typedef std::shared_ptr PObject; typedef std::shared_ptr PMeshObject; typedef std::shared_ptr PLevelSet; +typedef std::shared_ptr PBooleanObject; typedef std::shared_ptr PBeamLattice; typedef std::shared_ptr PFunctionReference; typedef std::shared_ptr PVolumeDataColor; @@ -399,6 +411,9 @@ typedef std::shared_ptr PConstVecNode; typedef std::shared_ptr PConstMatNode; typedef std::shared_ptr PMeshNode; typedef std::shared_ptr PUnsignedMeshNode; +typedef std::shared_ptr PBeamLatticeNode; +typedef std::shared_ptr PFunctionGradientNode; +typedef std::shared_ptr PNormalizeDistanceNode; typedef std::shared_ptr PFunctionCallNode; typedef std::shared_ptr PNodeIterator; typedef std::shared_ptr PFunction; @@ -430,6 +445,7 @@ typedef PSliceStackIterator PLib3MFSliceStackIterator; typedef PObjectIterator PLib3MFObjectIterator; typedef PMeshObjectIterator PLib3MFMeshObjectIterator; typedef PComponentsObjectIterator PLib3MFComponentsObjectIterator; +typedef PBooleanObjectIterator PLib3MFBooleanObjectIterator; typedef PTexture2DIterator PLib3MFTexture2DIterator; typedef PBaseMaterialGroupIterator PLib3MFBaseMaterialGroupIterator; typedef PColorGroupIterator PLib3MFColorGroupIterator; @@ -445,6 +461,7 @@ typedef PTriangleSet PLib3MFTriangleSet; typedef PObject PLib3MFObject; typedef PMeshObject PLib3MFMeshObject; typedef PLevelSet PLib3MFLevelSet; +typedef PBooleanObject PLib3MFBooleanObject; typedef PBeamLattice PLib3MFBeamLattice; typedef PFunctionReference PLib3MFFunctionReference; typedef PVolumeDataColor PLib3MFVolumeDataColor; @@ -520,6 +537,9 @@ typedef PConstVecNode PLib3MFConstVecNode; typedef PConstMatNode PLib3MFConstMatNode; typedef PMeshNode PLib3MFMeshNode; typedef PUnsignedMeshNode PLib3MFUnsignedMeshNode; +typedef PBeamLatticeNode PLib3MFBeamLatticeNode; +typedef PFunctionGradientNode PLib3MFFunctionGradientNode; +typedef PNormalizeDistanceNode PLib3MFNormalizeDistanceNode; typedef PFunctionCallNode PLib3MFFunctionCallNode; typedef PNodeIterator PLib3MFNodeIterator; typedef PFunction PLib3MFFunction; @@ -843,6 +863,7 @@ class CWrapper { friend class CObjectIterator; friend class CMeshObjectIterator; friend class CComponentsObjectIterator; + friend class CBooleanObjectIterator; friend class CTexture2DIterator; friend class CBaseMaterialGroupIterator; friend class CColorGroupIterator; @@ -858,6 +879,7 @@ class CWrapper { friend class CObject; friend class CMeshObject; friend class CLevelSet; + friend class CBooleanObject; friend class CBeamLattice; friend class CFunctionReference; friend class CVolumeDataColor; @@ -933,6 +955,9 @@ class CWrapper { friend class CConstMatNode; friend class CMeshNode; friend class CUnsignedMeshNode; + friend class CBeamLatticeNode; + friend class CFunctionGradientNode; + friend class CNormalizeDistanceNode; friend class CFunctionCallNode; friend class CNodeIterator; friend class CFunction; @@ -1008,6 +1033,8 @@ class CBase { friend class CWrapper; inline Lib3MF_uint64 ClassTypeId(); + +protected: }; /************************************************************************************************************************* @@ -1195,6 +1222,23 @@ class CComponentsObjectIterator : public CResourceIterator { inline PComponentsObject GetCurrentComponentsObject(); }; +/************************************************************************************************************************* + Class CBooleanObjectIterator +**************************************************************************************************************************/ +class CBooleanObjectIterator : public CResourceIterator { +public: + + /** + * CBooleanObjectIterator::CBooleanObjectIterator - Constructor for BooleanObjectIterator class. + */ + CBooleanObjectIterator(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CResourceIterator(pWrapper, pHandle) + { + } + + inline PBooleanObject GetCurrentBooleanObject(); +}; + /************************************************************************************************************************* Class CTexture2DIterator **************************************************************************************************************************/ @@ -1449,6 +1493,7 @@ class CObject : public CResource { inline bool IsMeshObject(); inline bool IsComponentsObject(); inline bool IsLevelSetObject(); + inline bool IsBooleanObject(); inline bool IsValid(); inline void SetAttachmentAsThumbnail(classParam pAttachment); inline PAttachment GetThumbnailAttachment(); @@ -1540,6 +1585,36 @@ class CLevelSet : public CObject { inline void SetVolumeData(classParam pTheVolumeData); }; +/************************************************************************************************************************* + Class CBooleanObject +**************************************************************************************************************************/ +class CBooleanObject : public CObject { +public: + + /** + * CBooleanObject::CBooleanObject - Constructor for BooleanObject class. + */ + CBooleanObject(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CObject(pWrapper, pHandle) + { + } + + inline void SetBaseObject(classParam pBaseObject, const sTransform & Transform); + inline PObject GetBaseObject(); + inline void SetBaseTransform(const sTransform & Transform); + inline sTransform GetBaseTransform(); + inline void SetOperation(const eBooleanOperation eOperation); + inline eBooleanOperation GetOperation(); + inline void SetCSGModeEnabled(const bool bCSGModeEnabled); + inline bool GetCSGModeEnabled(); + inline void SetExtractionGridResolution(const Lib3MF_uint32 nGridResolution); + inline Lib3MF_uint32 GetExtractionGridResolution(); + inline Lib3MF_uint32 GetOperandCount(); + inline void AddOperand(classParam pOperandObject, const sTransform & Transform); + inline sTransform GetOperand(const Lib3MF_uint32 nIndex, PMeshObject & pOperandObject); + inline PMeshObject MergeToMeshObject(); +}; + /************************************************************************************************************************* Class CBeamLattice **************************************************************************************************************************/ @@ -2967,6 +3042,77 @@ class CUnsignedMeshNode : public CImplicitNode { inline PImplicitPort GetOutputDistance(); }; +/************************************************************************************************************************* + Class CBeamLatticeNode +**************************************************************************************************************************/ +class CBeamLatticeNode : public CImplicitNode { +public: + + /** + * CBeamLatticeNode::CBeamLatticeNode - Constructor for BeamLatticeNode class. + */ + CBeamLatticeNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputBeamLattice(); + inline PImplicitPort GetInputPos(); + inline PImplicitPort GetOutputDistance(); + inline void SetAccurateRange(const Lib3MF_double dAccurateRange); + inline Lib3MF_double GetAccurateRange(); +}; + +/************************************************************************************************************************* + Class CFunctionGradientNode +**************************************************************************************************************************/ +class CFunctionGradientNode : public CImplicitNode { +public: + + /** + * CFunctionGradientNode::CFunctionGradientNode - Constructor for FunctionGradientNode class. + */ + CFunctionGradientNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputFunctionID(); + inline PImplicitPort GetInputPos(); + inline PImplicitPort GetInputStep(); + inline void SetScalarOutputName(const std::string & sScalarOutputName); + inline std::string GetScalarOutputName(); + inline void SetVectorInputName(const std::string & sVectorInputName); + inline std::string GetVectorInputName(); + inline PImplicitPort GetOutputNormalizedGradient(); + inline PImplicitPort GetOutputGradient(); + inline PImplicitPort GetOutputMagnitude(); +}; + +/************************************************************************************************************************* + Class CNormalizeDistanceNode +**************************************************************************************************************************/ +class CNormalizeDistanceNode : public CImplicitNode { +public: + + /** + * CNormalizeDistanceNode::CNormalizeDistanceNode - Constructor for NormalizeDistanceNode class. + */ + CNormalizeDistanceNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputFunctionID(); + inline PImplicitPort GetInputPos(); + inline PImplicitPort GetInputStep(); + inline void SetScalarOutputName(const std::string & sScalarOutputName); + inline std::string GetScalarOutputName(); + inline void SetVectorInputName(const std::string & sVectorInputName); + inline std::string GetVectorInputName(); + inline PImplicitPort GetOutputResult(); +}; + /************************************************************************************************************************* Class CFunctionCallNode **************************************************************************************************************************/ @@ -3092,6 +3238,9 @@ class CImplicitFunction : public CFunction { inline PConstMatNode AddConstMatNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); inline PMeshNode AddMeshNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); inline PUnsignedMeshNode AddUnsignedMeshNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PBeamLatticeNode AddBeamLatticeNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PFunctionGradientNode AddFunctionGradientNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PNormalizeDistanceNode AddNormalizeDistanceNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); inline PFunctionCallNode AddFunctionCallNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); inline PNodeIterator GetNodes(); inline void RemoveNode(classParam pNode); @@ -3393,6 +3542,7 @@ class CModel : public CBase { inline PMultiPropertyGroup GetMultiPropertyGroupByID(const Lib3MF_uint32 nUniqueResourceID); inline PMeshObject GetMeshObjectByID(const Lib3MF_uint32 nUniqueResourceID); inline PComponentsObject GetComponentsObjectByID(const Lib3MF_uint32 nUniqueResourceID); + inline PBooleanObject GetBooleanObjectByID(const Lib3MF_uint32 nUniqueResourceID); inline PColorGroup GetColorGroupByID(const Lib3MF_uint32 nUniqueResourceID); inline PSliceStack GetSliceStackByID(const Lib3MF_uint32 nUniqueResourceID); inline PLevelSet GetLevelSetByID(const Lib3MF_uint32 nUniqueResourceID); @@ -3404,6 +3554,7 @@ class CModel : public CBase { inline PObjectIterator GetObjects(); inline PMeshObjectIterator GetMeshObjects(); inline PComponentsObjectIterator GetComponentsObjects(); + inline PBooleanObjectIterator GetBooleanObjects(); inline PTexture2DIterator GetTexture2Ds(); inline PBaseMaterialGroupIterator GetBaseMaterialGroups(); inline PColorGroupIterator GetColorGroups(); @@ -3416,6 +3567,7 @@ class CModel : public CBase { inline void MergeFromModel(classParam pModelInstance); inline PMeshObject AddMeshObject(); inline PComponentsObject AddComponentsObject(); + inline PBooleanObject AddBooleanObject(); inline PSliceStack AddSliceStack(const Lib3MF_double dZBottom); inline PTexture2D AddTexture2DFromAttachment(classParam pTextureAttachment); inline PBaseMaterialGroup AddBaseMaterialGroup(); @@ -3476,6 +3628,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) case 0xDE92510BD2112288UL: return new CObjectIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ObjectIterator" case 0xF4196034E2B9FDE6UL: return new CMeshObjectIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObjectIterator" case 0x564DE4217ED7614AUL: return new CComponentsObjectIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObjectIterator" + case 0xAFF01F512E1FF6AEUL: return new CBooleanObjectIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BooleanObjectIterator" case 0x4BD32B4870FFC03BUL: return new CTexture2DIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DIterator" case 0x65E6EDD9362C79CBUL: return new CBaseMaterialGroupIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroupIterator" case 0x10274A1757C729C0UL: return new CColorGroupIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroupIterator" @@ -3491,6 +3644,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) case 0x2DA2136F577A779CUL: return new CObject(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Object" case 0x3B3A6DC6EC610497UL: return new CMeshObject(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObject" case 0xE8A7D9C192EFD0E2UL: return new CLevelSet(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::LevelSet" + case 0x85FA0E8806B6C357UL: return new CBooleanObject(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BooleanObject" case 0x63B3B461B30B4BA5UL: return new CBeamLattice(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLattice" case 0x4DF17E76926221C2UL: return new CFunctionReference(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionReference" case 0xD85B5B6143E787E3UL: return new CVolumeDataColor(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::VolumeDataColor" @@ -3566,6 +3720,9 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) case 0xF85C90EDCE6F90A4UL: return new CConstMatNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ConstMatNode" case 0x53601FD432E3DEF4UL: return new CMeshNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshNode" case 0x29985A628251A9CDUL: return new CUnsignedMeshNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::UnsignedMeshNode" + case 0x0F3A4EE98F7FEC0CUL: return new CBeamLatticeNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLatticeNode" + case 0x0437E27AEF740121UL: return new CFunctionGradientNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionGradientNode" + case 0x817D2E566E73AA8FUL: return new CNormalizeDistanceNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::NormalizeDistanceNode" case 0x0765C17C952F24E3UL: return new CFunctionCallNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionCallNode" case 0xFC006BC888CAB4D0UL: return new CNodeIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::NodeIterator" case 0x9EFB2757CA1A5231UL: return new CFunction(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Function" @@ -4403,6 +4560,25 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } + /** + * Method definitions for class CBooleanObjectIterator + */ + + /** + * CBooleanObjectIterator::GetCurrentBooleanObject - Returns the BooleanObject the iterator points at. + * @return returns the BooleanObject instance. + */ + PBooleanObject CBooleanObjectIterator::GetCurrentBooleanObject() + { + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; + CheckError(lib3mf_booleanobjectiterator_getcurrentbooleanobject(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + /** * Method definitions for class CTexture2DIterator */ @@ -5053,6 +5229,18 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return resultIsLevelSetObject; } + /** + * CObject::IsBooleanObject - Retrieves, if an object is a boolean object + * @return returns, whether the object is a boolean object + */ + bool CObject::IsBooleanObject() + { + bool resultIsBooleanObject = 0; + CheckError(lib3mf_object_isbooleanobject(m_pHandle, &resultIsBooleanObject)); + + return resultIsBooleanObject; + } + /** * CObject::IsValid - Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * @return returns whether the object is a valid object description @@ -5748,6 +5936,178 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) CheckError(lib3mf_levelset_setvolumedata(m_pHandle, hTheVolumeData)); } + /** + * Method definitions for class CBooleanObject + */ + + /** + * CBooleanObject::SetBaseObject - Sets the base object and transform for the boolean shape. + * @param[in] pBaseObject - base object of the boolean shape + * @param[in] Transform - transform applied to the base object + */ + void CBooleanObject::SetBaseObject(classParam pBaseObject, const sTransform & Transform) + { + Lib3MFHandle hBaseObject = pBaseObject.GetHandle(); + CheckError(lib3mf_booleanobject_setbaseobject(m_pHandle, hBaseObject, &Transform)); + } + + /** + * CBooleanObject::GetBaseObject - Returns the base object of the boolean shape. + * @return base object of the boolean shape + */ + PObject CBooleanObject::GetBaseObject() + { + Lib3MFHandle hBaseObject = (Lib3MFHandle)nullptr; + CheckError(lib3mf_booleanobject_getbaseobject(m_pHandle, &hBaseObject)); + + if (!hBaseObject) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBaseObject))); + } + + /** + * CBooleanObject::SetBaseTransform - Sets the base transform of the boolean shape. + * @param[in] Transform - transform applied to the base object + */ + void CBooleanObject::SetBaseTransform(const sTransform & Transform) + { + CheckError(lib3mf_booleanobject_setbasetransform(m_pHandle, &Transform)); + } + + /** + * CBooleanObject::GetBaseTransform - Returns the base transform of the boolean shape. + * @return transform applied to the base object + */ + sTransform CBooleanObject::GetBaseTransform() + { + sTransform resultTransform; + CheckError(lib3mf_booleanobject_getbasetransform(m_pHandle, &resultTransform)); + + return resultTransform; + } + + /** + * CBooleanObject::SetOperation - Sets the boolean operation used for the boolean shape. + * @param[in] eOperation - boolean operation used for the shape + */ + void CBooleanObject::SetOperation(const eBooleanOperation eOperation) + { + CheckError(lib3mf_booleanobject_setoperation(m_pHandle, eOperation)); + } + + /** + * CBooleanObject::GetOperation - Returns the boolean operation used for the boolean shape. + * @return boolean operation used for the shape + */ + eBooleanOperation CBooleanObject::GetOperation() + { + eBooleanOperation resultOperation = (eBooleanOperation) 0; + CheckError(lib3mf_booleanobject_getoperation(m_pHandle, &resultOperation)); + + return resultOperation; + } + + /** + * CBooleanObject::SetCSGModeEnabled - Enables or disables CSG field evaluation for boolean-to-mesh materialization. + * @param[in] bCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback + */ + void CBooleanObject::SetCSGModeEnabled(const bool bCSGModeEnabled) + { + CheckError(lib3mf_booleanobject_setcsgmodeenabled(m_pHandle, bCSGModeEnabled)); + } + + /** + * CBooleanObject::GetCSGModeEnabled - Returns whether CSG field evaluation is enabled for boolean-to-mesh materialization. + * @return if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback + */ + bool CBooleanObject::GetCSGModeEnabled() + { + bool resultCSGModeEnabled = 0; + CheckError(lib3mf_booleanobject_getcsgmodeenabled(m_pHandle, &resultCSGModeEnabled)); + + return resultCSGModeEnabled; + } + + /** + * CBooleanObject::SetExtractionGridResolution - Sets the extraction grid resolution used for boolean-to-mesh materialization. + * @param[in] nGridResolution - extraction grid resolution for boolean surface extraction + */ + void CBooleanObject::SetExtractionGridResolution(const Lib3MF_uint32 nGridResolution) + { + CheckError(lib3mf_booleanobject_setextractiongridresolution(m_pHandle, nGridResolution)); + } + + /** + * CBooleanObject::GetExtractionGridResolution - Returns the extraction grid resolution used for boolean-to-mesh materialization. + * @return extraction grid resolution for boolean surface extraction + */ + Lib3MF_uint32 CBooleanObject::GetExtractionGridResolution() + { + Lib3MF_uint32 resultGridResolution = 0; + CheckError(lib3mf_booleanobject_getextractiongridresolution(m_pHandle, &resultGridResolution)); + + return resultGridResolution; + } + + /** + * CBooleanObject::GetOperandCount - Returns the number of operands in the boolean sequence. + * @return number of operands in the boolean sequence + */ + Lib3MF_uint32 CBooleanObject::GetOperandCount() + { + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_booleanobject_getoperandcount(m_pHandle, &resultCount)); + + return resultCount; + } + + /** + * CBooleanObject::AddOperand - Adds an operand object to the boolean sequence. + * @param[in] pOperandObject - mesh object used as operand + * @param[in] Transform - transform applied to the operand object + */ + void CBooleanObject::AddOperand(classParam pOperandObject, const sTransform & Transform) + { + Lib3MFHandle hOperandObject = pOperandObject.GetHandle(); + CheckError(lib3mf_booleanobject_addoperand(m_pHandle, hOperandObject, &Transform)); + } + + /** + * CBooleanObject::GetOperand - Returns one operand object and transform from the boolean sequence. + * @param[in] nIndex - index of the operand in the boolean sequence + * @param[out] pOperandObject - mesh object used as operand + * @return transform applied to the operand object + */ + sTransform CBooleanObject::GetOperand(const Lib3MF_uint32 nIndex, PMeshObject & pOperandObject) + { + Lib3MFHandle hOperandObject = (Lib3MFHandle)nullptr; + sTransform resultTransform; + CheckError(lib3mf_booleanobject_getoperand(m_pHandle, nIndex, &hOperandObject, &resultTransform)); + if (!hOperandObject) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } else { + pOperandObject = std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hOperandObject))); + } + + return resultTransform; + } + + /** + * CBooleanObject::MergeToMeshObject - Materializes the boolean shape into a newly created mesh object. + * @return new mesh object containing the tessellated boolean shape + */ + PMeshObject CBooleanObject::MergeToMeshObject() + { + Lib3MFHandle hMeshObject = (Lib3MFHandle)nullptr; + CheckError(lib3mf_booleanobject_mergetomeshobject(m_pHandle, &hMeshObject)); + + if (!hMeshObject) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMeshObject))); + } + /** * Method definitions for class CBeamLattice */ @@ -6182,7 +6542,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) } /** - * CVolumeDataComposite::GetMaterialMapping - Returns MaterialMappting with given index + * CVolumeDataComposite::GetMaterialMapping - Returns MaterialMapping with given index * @param[in] nIndex - Index of the MaterialMapping in question. * @return MaterialMapping used in this element */ @@ -6198,7 +6558,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) } /** - * CVolumeDataComposite::AddMaterialMapping - Adds a the MaterialMapping + * CVolumeDataComposite::AddMaterialMapping - Adds a MaterialMapping * @param[in] Transform - new transformation matrix * @return The new MaterialMapping */ @@ -6348,7 +6708,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) /** * CVolumeData::GetPropertyCount - Returns the number of VolumeDataProperty - * @return the number of VolumeDataProperty-elements within this VolumdeData + * @return the number of VolumeDataProperty-elements within this VolumeData */ Lib3MF_uint32 CVolumeData::GetPropertyCount() { @@ -7377,7 +7737,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) } /** - * CAttachment::ReadFromFile - Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. + * CAttachment::ReadFromFile - Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * @param[in] sFileName - file to read from. */ void CAttachment::ReadFromFile(const std::string & sFileName) @@ -7386,7 +7746,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) } /** - * CAttachment::ReadFromCallback - Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. + * CAttachment::ReadFromCallback - Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * @param[in] pTheReadCallback - Callback to call for reading a data chunk * @param[in] nStreamSize - number of bytes the callback returns * @param[in] pTheSeekCallback - Callback to call for seeking in the stream. @@ -7423,7 +7783,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) } /** - * CAttachment::ReadFromBuffer - Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). + * CAttachment::ReadFromBuffer - Reads an attachment from a memory buffer. This buffer is immediately read (in contrast to the ReadFromCallback and ReadFromFile-methods). * @param[in] BufferBuffer - Buffer to read from */ void CAttachment::ReadFromBuffer(const CInputVector & BufferBuffer) @@ -8968,6 +9328,330 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hDistance))); } + /** + * Method definitions for class CBeamLatticeNode + */ + + /** + * CBeamLatticeNode::GetInputBeamLattice - Retrieves the input for the model resource id of the beam lattice + * @return the input port for the model resource id of the beam lattice (mesh with beamlattice extension) + */ + PImplicitPort CBeamLatticeNode::GetInputBeamLattice() + { + Lib3MFHandle hBeamLattice = (Lib3MFHandle)nullptr; + CheckError(lib3mf_beamlatticenode_getinputbeamlattice(m_pHandle, &hBeamLattice)); + + if (!hBeamLattice) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBeamLattice))); + } + + /** + * CBeamLatticeNode::GetInputPos - Retrieves the input for the position + * @return the input port for the position + */ + PImplicitPort CBeamLatticeNode::GetInputPos() + { + Lib3MFHandle hPos = (Lib3MFHandle)nullptr; + CheckError(lib3mf_beamlatticenode_getinputpos(m_pHandle, &hPos)); + + if (!hPos) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPos))); + } + + /** + * CBeamLatticeNode::GetOutputDistance - Retrieves the output + * @return the output port for the signed distance to the beam lattice + */ + PImplicitPort CBeamLatticeNode::GetOutputDistance() + { + Lib3MFHandle hDistance = (Lib3MFHandle)nullptr; + CheckError(lib3mf_beamlatticenode_getoutputdistance(m_pHandle, &hDistance)); + + if (!hDistance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hDistance))); + } + + /** + * CBeamLatticeNode::SetAccurateRange - Sets the accurate range for distance computation + * @param[in] dAccurateRange - the accurate range in model units + */ + void CBeamLatticeNode::SetAccurateRange(const Lib3MF_double dAccurateRange) + { + CheckError(lib3mf_beamlatticenode_setaccuraterange(m_pHandle, dAccurateRange)); + } + + /** + * CBeamLatticeNode::GetAccurateRange - Retrieves the accurate range for distance computation + * @return the accurate range in model units + */ + Lib3MF_double CBeamLatticeNode::GetAccurateRange() + { + Lib3MF_double resultAccurateRange = 0; + CheckError(lib3mf_beamlatticenode_getaccuraterange(m_pHandle, &resultAccurateRange)); + + return resultAccurateRange; + } + + /** + * Method definitions for class CFunctionGradientNode + */ + + /** + * CFunctionGradientNode::GetInputFunctionID - Retrieves the input for the function id + * @return the input port for the function + */ + PImplicitPort CFunctionGradientNode::GetInputFunctionID() + { + Lib3MFHandle hFunction = (Lib3MFHandle)nullptr; + CheckError(lib3mf_functiongradientnode_getinputfunctionid(m_pHandle, &hFunction)); + + if (!hFunction) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hFunction))); + } + + /** + * CFunctionGradientNode::GetInputPos - Retrieves the input for the position + * @return the input port for the position + */ + PImplicitPort CFunctionGradientNode::GetInputPos() + { + Lib3MFHandle hPos = (Lib3MFHandle)nullptr; + CheckError(lib3mf_functiongradientnode_getinputpos(m_pHandle, &hPos)); + + if (!hPos) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPos))); + } + + /** + * CFunctionGradientNode::GetInputStep - Retrieves the input for the finite difference step + * @return the input port for the finite difference step + */ + PImplicitPort CFunctionGradientNode::GetInputStep() + { + Lib3MFHandle hStep = (Lib3MFHandle)nullptr; + CheckError(lib3mf_functiongradientnode_getinputstep(m_pHandle, &hStep)); + + if (!hStep) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hStep))); + } + + /** + * CFunctionGradientNode::SetScalarOutputName - Sets the name of the referenced scalar output + * @param[in] sScalarOutputName - the name of the scalar output of the referenced function + */ + void CFunctionGradientNode::SetScalarOutputName(const std::string & sScalarOutputName) + { + CheckError(lib3mf_functiongradientnode_setscalaroutputname(m_pHandle, sScalarOutputName.c_str())); + } + + /** + * CFunctionGradientNode::GetScalarOutputName - Retrieves the name of the referenced scalar output + * @return the name of the scalar output of the referenced function + */ + std::string CFunctionGradientNode::GetScalarOutputName() + { + Lib3MF_uint32 bytesNeededScalarOutputName = 0; + Lib3MF_uint32 bytesWrittenScalarOutputName = 0; + CheckError(lib3mf_functiongradientnode_getscalaroutputname(m_pHandle, 0, &bytesNeededScalarOutputName, nullptr)); + std::vector bufferScalarOutputName(bytesNeededScalarOutputName); + CheckError(lib3mf_functiongradientnode_getscalaroutputname(m_pHandle, bytesNeededScalarOutputName, &bytesWrittenScalarOutputName, &bufferScalarOutputName[0])); + + return std::string(&bufferScalarOutputName[0]); + } + + /** + * CFunctionGradientNode::SetVectorInputName - Sets the name of the referenced vector input + * @param[in] sVectorInputName - the name of the vector input (float3) of the referenced function + */ + void CFunctionGradientNode::SetVectorInputName(const std::string & sVectorInputName) + { + CheckError(lib3mf_functiongradientnode_setvectorinputname(m_pHandle, sVectorInputName.c_str())); + } + + /** + * CFunctionGradientNode::GetVectorInputName - Retrieves the name of the referenced vector input + * @return the name of the vector input (float3) of the referenced function + */ + std::string CFunctionGradientNode::GetVectorInputName() + { + Lib3MF_uint32 bytesNeededVectorInputName = 0; + Lib3MF_uint32 bytesWrittenVectorInputName = 0; + CheckError(lib3mf_functiongradientnode_getvectorinputname(m_pHandle, 0, &bytesNeededVectorInputName, nullptr)); + std::vector bufferVectorInputName(bytesNeededVectorInputName); + CheckError(lib3mf_functiongradientnode_getvectorinputname(m_pHandle, bytesNeededVectorInputName, &bytesWrittenVectorInputName, &bufferVectorInputName[0])); + + return std::string(&bufferVectorInputName[0]); + } + + /** + * CFunctionGradientNode::GetOutputNormalizedGradient - Retrieves the normalized gradient output + * @return the output port for the normalized gradient + */ + PImplicitPort CFunctionGradientNode::GetOutputNormalizedGradient() + { + Lib3MFHandle hNormalizedGradient = (Lib3MFHandle)nullptr; + CheckError(lib3mf_functiongradientnode_getoutputnormalizedgradient(m_pHandle, &hNormalizedGradient)); + + if (!hNormalizedGradient) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNormalizedGradient))); + } + + /** + * CFunctionGradientNode::GetOutputGradient - Retrieves the raw gradient output + * @return the output port for the raw gradient + */ + PImplicitPort CFunctionGradientNode::GetOutputGradient() + { + Lib3MFHandle hGradient = (Lib3MFHandle)nullptr; + CheckError(lib3mf_functiongradientnode_getoutputgradient(m_pHandle, &hGradient)); + + if (!hGradient) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hGradient))); + } + + /** + * CFunctionGradientNode::GetOutputMagnitude - Retrieves the gradient magnitude output + * @return the output port for the gradient magnitude + */ + PImplicitPort CFunctionGradientNode::GetOutputMagnitude() + { + Lib3MFHandle hMagnitude = (Lib3MFHandle)nullptr; + CheckError(lib3mf_functiongradientnode_getoutputmagnitude(m_pHandle, &hMagnitude)); + + if (!hMagnitude) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMagnitude))); + } + + /** + * Method definitions for class CNormalizeDistanceNode + */ + + /** + * CNormalizeDistanceNode::GetInputFunctionID - Retrieves the input for the function id + * @return the input port for the function + */ + PImplicitPort CNormalizeDistanceNode::GetInputFunctionID() + { + Lib3MFHandle hFunction = (Lib3MFHandle)nullptr; + CheckError(lib3mf_normalizedistancenode_getinputfunctionid(m_pHandle, &hFunction)); + + if (!hFunction) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hFunction))); + } + + /** + * CNormalizeDistanceNode::GetInputPos - Retrieves the input for the position + * @return the input port for the position (vector) + */ + PImplicitPort CNormalizeDistanceNode::GetInputPos() + { + Lib3MFHandle hPos = (Lib3MFHandle)nullptr; + CheckError(lib3mf_normalizedistancenode_getinputpos(m_pHandle, &hPos)); + + if (!hPos) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPos))); + } + + /** + * CNormalizeDistanceNode::GetInputStep - Retrieves the input for the finite difference step + * @return the input port for the finite difference step + */ + PImplicitPort CNormalizeDistanceNode::GetInputStep() + { + Lib3MFHandle hStep = (Lib3MFHandle)nullptr; + CheckError(lib3mf_normalizedistancenode_getinputstep(m_pHandle, &hStep)); + + if (!hStep) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hStep))); + } + + /** + * CNormalizeDistanceNode::SetScalarOutputName - Sets the name of the referenced scalar output + * @param[in] sScalarOutputName - the name of the scalar output of the referenced function + */ + void CNormalizeDistanceNode::SetScalarOutputName(const std::string & sScalarOutputName) + { + CheckError(lib3mf_normalizedistancenode_setscalaroutputname(m_pHandle, sScalarOutputName.c_str())); + } + + /** + * CNormalizeDistanceNode::GetScalarOutputName - Retrieves the name of the referenced scalar output + * @return the name of the scalar output of the referenced function + */ + std::string CNormalizeDistanceNode::GetScalarOutputName() + { + Lib3MF_uint32 bytesNeededScalarOutputName = 0; + Lib3MF_uint32 bytesWrittenScalarOutputName = 0; + CheckError(lib3mf_normalizedistancenode_getscalaroutputname(m_pHandle, 0, &bytesNeededScalarOutputName, nullptr)); + std::vector bufferScalarOutputName(bytesNeededScalarOutputName); + CheckError(lib3mf_normalizedistancenode_getscalaroutputname(m_pHandle, bytesNeededScalarOutputName, &bytesWrittenScalarOutputName, &bufferScalarOutputName[0])); + + return std::string(&bufferScalarOutputName[0]); + } + + /** + * CNormalizeDistanceNode::SetVectorInputName - Sets the name of the referenced vector input + * @param[in] sVectorInputName - the name of the vector input (float3) of the referenced function + */ + void CNormalizeDistanceNode::SetVectorInputName(const std::string & sVectorInputName) + { + CheckError(lib3mf_normalizedistancenode_setvectorinputname(m_pHandle, sVectorInputName.c_str())); + } + + /** + * CNormalizeDistanceNode::GetVectorInputName - Retrieves the name of the referenced vector input + * @return the name of the vector input (float3) of the referenced function + */ + std::string CNormalizeDistanceNode::GetVectorInputName() + { + Lib3MF_uint32 bytesNeededVectorInputName = 0; + Lib3MF_uint32 bytesWrittenVectorInputName = 0; + CheckError(lib3mf_normalizedistancenode_getvectorinputname(m_pHandle, 0, &bytesNeededVectorInputName, nullptr)); + std::vector bufferVectorInputName(bytesNeededVectorInputName); + CheckError(lib3mf_normalizedistancenode_getvectorinputname(m_pHandle, bytesNeededVectorInputName, &bytesWrittenVectorInputName, &bufferVectorInputName[0])); + + return std::string(&bufferVectorInputName[0]); + } + + /** + * CNormalizeDistanceNode::GetOutputResult - Retrieves the normalized result output + * @return the output port for the normalized distance + */ + PImplicitPort CNormalizeDistanceNode::GetOutputResult() + { + Lib3MFHandle hResult = (Lib3MFHandle)nullptr; + CheckError(lib3mf_normalizedistancenode_getoutputresult(m_pHandle, &hResult)); + + if (!hResult) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResult))); + } + /** * Method definitions for class CFunctionCallNode */ @@ -10095,6 +10779,60 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); } + /** + * CImplicitFunction::AddBeamLatticeNode - Add a BeamLatticeNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PBeamLatticeNode CImplicitFunction::AddBeamLatticeNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addbeamlatticenode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddFunctionGradientNode - Add a FunctionGradientNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PFunctionGradientNode CImplicitFunction::AddFunctionGradientNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addfunctiongradientnode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddNormalizeDistanceNode - Add a NormalizeDistanceNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PNormalizeDistanceNode CImplicitFunction::AddNormalizeDistanceNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(lib3mf_implicitfunction_addnormalizedistancenode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + /** * CImplicitFunction::AddFunctionCallNode - Add a FunctionCallNode * @param[in] sIdentifier - the identifier of the node @@ -11582,6 +12320,22 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hComponentsObjectInstance))); } + /** + * CModel::GetBooleanObjectByID - finds a boolean object by its UniqueResourceID + * @param[in] nUniqueResourceID - UniqueResourceID + * @return returns the boolean object instance + */ + PBooleanObject CModel::GetBooleanObjectByID(const Lib3MF_uint32 nUniqueResourceID) + { + Lib3MFHandle hBooleanObjectInstance = (Lib3MFHandle)nullptr; + CheckError(lib3mf_model_getbooleanobjectbyid(m_pHandle, nUniqueResourceID, &hBooleanObjectInstance)); + + if (!hBooleanObjectInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBooleanObjectInstance))); + } + /** * CModel::GetColorGroupByID - finds a model color group by its UniqueResourceID * @param[in] nUniqueResourceID - UniqueResourceID @@ -11742,6 +12496,21 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); } + /** + * CModel::GetBooleanObjects - creates a resource iterator instance with all boolean object resources. + * @return returns the iterator instance. + */ + PBooleanObjectIterator CModel::GetBooleanObjects() + { + Lib3MFHandle hResourceIterator = (Lib3MFHandle)nullptr; + CheckError(lib3mf_model_getbooleanobjects(m_pHandle, &hResourceIterator)); + + if (!hResourceIterator) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); + } + /** * CModel::GetTexture2Ds - creates a Texture2DIterator instance with all texture2d resources. * @return returns the iterator instance. @@ -11917,6 +12686,21 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hComponentsObjectInstance))); } + /** + * CModel::AddBooleanObject - adds an empty boolean object to the model. + * @return returns the boolean object instance + */ + PBooleanObject CModel::AddBooleanObject() + { + Lib3MFHandle hBooleanObjectInstance = (Lib3MFHandle)nullptr; + CheckError(lib3mf_model_addbooleanobject(m_pHandle, &hBooleanObjectInstance)); + + if (!hBooleanObjectInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBooleanObjectInstance))); + } + /** * CModel::AddSliceStack - creates a new model slicestack by its id * @param[in] dZBottom - Bottom Z value of the slicestack diff --git a/Autogenerated/Bindings/Cpp/lib3mf_types.hpp b/Autogenerated/Bindings/Cpp/lib3mf_types.hpp index 6a9ff486d..09f6a3441 100644 --- a/Autogenerated/Bindings/Cpp/lib3mf_types.hpp +++ b/Autogenerated/Bindings/Cpp/lib3mf_types.hpp @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++-Header file with basic types in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -83,7 +83,7 @@ typedef void * Lib3MF_pvoid; **************************************************************************************************************************/ #define LIB3MF_VERSION_MAJOR 2 -#define LIB3MF_VERSION_MINOR 4 +#define LIB3MF_VERSION_MINOR 6 #define LIB3MF_VERSION_MICRO 0 #define LIB3MF_VERSION_PRERELEASEINFO "" #define LIB3MF_VERSION_BUILDINFO "" @@ -219,6 +219,7 @@ typedef Lib3MFHandle Lib3MF_SliceStackIterator; typedef Lib3MFHandle Lib3MF_ObjectIterator; typedef Lib3MFHandle Lib3MF_MeshObjectIterator; typedef Lib3MFHandle Lib3MF_ComponentsObjectIterator; +typedef Lib3MFHandle Lib3MF_BooleanObjectIterator; typedef Lib3MFHandle Lib3MF_Texture2DIterator; typedef Lib3MFHandle Lib3MF_BaseMaterialGroupIterator; typedef Lib3MFHandle Lib3MF_ColorGroupIterator; @@ -234,6 +235,7 @@ typedef Lib3MFHandle Lib3MF_TriangleSet; typedef Lib3MFHandle Lib3MF_Object; typedef Lib3MFHandle Lib3MF_MeshObject; typedef Lib3MFHandle Lib3MF_LevelSet; +typedef Lib3MFHandle Lib3MF_BooleanObject; typedef Lib3MFHandle Lib3MF_BeamLattice; typedef Lib3MFHandle Lib3MF_FunctionReference; typedef Lib3MFHandle Lib3MF_VolumeDataColor; @@ -309,6 +311,9 @@ typedef Lib3MFHandle Lib3MF_ConstVecNode; typedef Lib3MFHandle Lib3MF_ConstMatNode; typedef Lib3MFHandle Lib3MF_MeshNode; typedef Lib3MFHandle Lib3MF_UnsignedMeshNode; +typedef Lib3MFHandle Lib3MF_BeamLatticeNode; +typedef Lib3MFHandle Lib3MF_FunctionGradientNode; +typedef Lib3MFHandle Lib3MF_NormalizeDistanceNode; typedef Lib3MFHandle Lib3MF_FunctionCallNode; typedef Lib3MFHandle Lib3MF_NodeIterator; typedef Lib3MFHandle Lib3MF_Function; @@ -359,7 +364,14 @@ namespace Lib3MF { Other = 0, Model = 1, Support = 2, - SolidSupport = 3 + SolidSupport = 3, + Surface = 4 + }; + + enum class eBooleanOperation : Lib3MF_int32 { + Union = 0, + Difference = 1, + Intersection = 2 }; enum class eTextureType : Lib3MF_int32 { @@ -473,11 +485,11 @@ namespace Lib3MF { MatVecMultiplication = 14, /** Multiplies a matrix with a vector */ Transpose = 15, /** Transposes a matrix */ Inverse = 16, /** Computes the inverse of a matrix */ - Sinus = 17, /** Calculates the sinus */ - Cosinus = 18, /** Calculates the cosinus */ + Sinus = 17, /** Calculates the sine */ + Cosinus = 18, /** Calculates the cosine */ Tan = 19, /** Calculates the tangent */ - ArcSin = 20, /** Calculates the arcsinus */ - ArcCos = 21, /** Calculates the arccosinus */ + ArcSin = 20, /** Calculates the arcsine */ + ArcCos = 21, /** Calculates the arccosine */ ArcTan = 22, /** Calculates the arctangent */ ArcTan2 = 23, /** Calculates the arctangent */ Min = 24, /** Calculates the minimum of two values */ @@ -487,9 +499,9 @@ namespace Lib3MF { Pow = 28, /** Calculates the power A^B */ Sqrt = 29, /** Calculates the square root */ Exp = 30, /** Exponential function */ - Log = 31, /** Natural logarithmus */ - Log2 = 32, /** Logarithmus to the base 2 */ - Log10 = 33, /** Logarithmus to the base 10 */ + Log = 31, /** Natural logarithm */ + Log2 = 32, /** Logarithm to the base 2 */ + Log10 = 33, /** Logarithm to the base 10 */ Select = 34, /** If A is less than B returns C, else D */ Clamp = 35, /** Clamps the input value to min and max */ Sinh = 36, /** Calculates the hyperbolic sine */ @@ -504,9 +516,12 @@ namespace Lib3MF { Mesh = 45, /** Calculates the signed distance to a mesh */ Length = 46, /** Calculates the length of a vector */ ConstResourceID = 47, /** Selects a resource (function, mesh etc.) */ - VectorFromScalar = 48, /** Creates a vector from one scalar values */ + VectorFromScalar = 48, /** Creates a vector from one scalar value */ UnsignedMesh = 49, /** Calculates the unsigned distance to a mesh */ - Mod = 50 /** Calculates the modulo of two values (same behaviour as glsl mod) */ + Mod = 50, /** Calculates the modulo of two values (same behaviour as glsl mod) */ + BeamLattice = 51, /** Calculates the signed distance to a beam lattice */ + FunctionGradient = 52, /** Calculates the gradient of a function */ + NormalizeDistance = 53 /** Normalizes a distance field */ }; /** @@ -715,6 +730,7 @@ typedef Lib3MF::ePropertyType eLib3MFPropertyType; typedef Lib3MF::eSlicesMeshResolution eLib3MFSlicesMeshResolution; typedef Lib3MF::eModelUnit eLib3MFModelUnit; typedef Lib3MF::eObjectType eLib3MFObjectType; +typedef Lib3MF::eBooleanOperation eLib3MFBooleanOperation; typedef Lib3MF::eTextureType eLib3MFTextureType; typedef Lib3MF::eTextureTileStyle eLib3MFTextureTileStyle; typedef Lib3MF::eTextureFilter eLib3MFTextureFilter; diff --git a/Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.h b/Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.h index 8e83e673b..b645518d0 100644 --- a/Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.h +++ b/Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.h @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++-Header file in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -484,6 +484,19 @@ typedef Lib3MFResult (*PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) (Lib3M */ typedef Lib3MFResult (*PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) (Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); +/************************************************************************************************************************* + Class definition for BooleanObjectIterator +**************************************************************************************************************************/ + +/** +* Returns the BooleanObject the iterator points at. +* +* @param[in] pBooleanObjectIterator - BooleanObjectIterator instance. +* @param[out] pResource - returns the BooleanObject instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObjectIterator_GetCurrentBooleanObjectPtr) (Lib3MF_BooleanObjectIterator pBooleanObjectIterator, Lib3MF_BooleanObject * pResource); + /************************************************************************************************************************* Class definition for Texture2DIterator **************************************************************************************************************************/ @@ -998,6 +1011,15 @@ typedef Lib3MFResult (*PLib3MFObject_IsComponentsObjectPtr) (Lib3MF_Object pObje */ typedef Lib3MFResult (*PLib3MFObject_IsLevelSetObjectPtr) (Lib3MF_Object pObject, bool * pIsLevelSetObject); +/** +* Retrieves, if an object is a boolean object +* +* @param[in] pObject - Object instance. +* @param[out] pIsBooleanObject - returns, whether the object is a boolean object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_IsBooleanObjectPtr) (Lib3MF_Object pObject, bool * pIsBooleanObject); + /** * Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * @@ -1548,6 +1570,140 @@ typedef Lib3MFResult (*PLib3MFLevelSet_GetVolumeDataPtr) (Lib3MF_LevelSet pLevel */ typedef Lib3MFResult (*PLib3MFLevelSet_SetVolumeDataPtr) (Lib3MF_LevelSet pLevelSet, Lib3MF_VolumeData pTheVolumeData); +/************************************************************************************************************************* + Class definition for BooleanObject +**************************************************************************************************************************/ + +/** +* Sets the base object and transform for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pBaseObject - base object of the boolean shape +* @param[in] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetBaseObjectPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object pBaseObject, const Lib3MF::sTransform * pTransform); + +/** +* Returns the base object of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pBaseObject - base object of the boolean shape +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetBaseObjectPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object * pBaseObject); + +/** +* Sets the base transform of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetBaseTransformPtr) (Lib3MF_BooleanObject pBooleanObject, const Lib3MF::sTransform * pTransform); + +/** +* Returns the base transform of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetBaseTransformPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF::sTransform * pTransform); + +/** +* Sets the boolean operation used for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] eOperation - boolean operation used for the shape +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetOperationPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF::eBooleanOperation eOperation); + +/** +* Returns the boolean operation used for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pOperation - boolean operation used for the shape +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetOperationPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF::eBooleanOperation * pOperation); + +/** +* Enables or disables CSG field evaluation for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] bCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetCSGModeEnabledPtr) (Lib3MF_BooleanObject pBooleanObject, bool bCSGModeEnabled); + +/** +* Returns whether CSG field evaluation is enabled for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetCSGModeEnabledPtr) (Lib3MF_BooleanObject pBooleanObject, bool * pCSGModeEnabled); + +/** +* Sets the extraction grid resolution used for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] nGridResolution - extraction grid resolution for boolean surface extraction +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetExtractionGridResolutionPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nGridResolution); + +/** +* Returns the extraction grid resolution used for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pGridResolution - extraction grid resolution for boolean surface extraction +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetExtractionGridResolutionPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pGridResolution); + +/** +* Returns the number of operands in the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pCount - number of operands in the boolean sequence +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetOperandCountPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pCount); + +/** +* Adds an operand object to the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pOperandObject - mesh object used as operand +* @param[in] pTransform - transform applied to the operand object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_AddOperandPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject pOperandObject, const Lib3MF::sTransform * pTransform); + +/** +* Returns one operand object and transform from the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] nIndex - index of the operand in the boolean sequence +* @param[out] pOperandObject - mesh object used as operand +* @param[out] pTransform - transform applied to the operand object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetOperandPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nIndex, Lib3MF_MeshObject * pOperandObject, Lib3MF::sTransform * pTransform); + +/** +* Materializes the boolean shape into a newly created mesh object. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pMeshObject - new mesh object containing the tessellated boolean shape +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_MergeToMeshObjectPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject * pMeshObject); + /************************************************************************************************************************* Class definition for BeamLattice **************************************************************************************************************************/ @@ -1913,7 +2069,7 @@ typedef Lib3MFResult (*PLib3MFVolumeDataComposite_SetBaseMaterialGroupPtr) (Lib3 typedef Lib3MFResult (*PLib3MFVolumeDataComposite_GetMaterialMappingCountPtr) (Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 * pCount); /** -* Returns MaterialMappting with given index +* Returns MaterialMapping with given index * * @param[in] pVolumeDataComposite - VolumeDataComposite instance. * @param[in] nIndex - Index of the MaterialMapping in question. @@ -1923,7 +2079,7 @@ typedef Lib3MFResult (*PLib3MFVolumeDataComposite_GetMaterialMappingCountPtr) (L typedef Lib3MFResult (*PLib3MFVolumeDataComposite_GetMaterialMappingPtr) (Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 nIndex, Lib3MF_MaterialMapping * pTheMaterialMapping); /** -* Adds a the MaterialMapping +* Adds a MaterialMapping * * @param[in] pVolumeDataComposite - VolumeDataComposite instance. * @param[in] pTransform - new transformation matrix @@ -2035,7 +2191,7 @@ typedef Lib3MFResult (*PLib3MFVolumeData_RemoveColorPtr) (Lib3MF_VolumeData pVol * Returns the number of VolumeDataProperty * * @param[in] pVolumeData - VolumeData instance. -* @param[out] pCount - the number of VolumeDataProperty-elements within this VolumdeData +* @param[out] pCount - the number of VolumeDataProperty-elements within this VolumeData * @return error code or 0 (success) */ typedef Lib3MFResult (*PLib3MFVolumeData_GetPropertyCountPtr) (Lib3MF_VolumeData pVolumeData, Lib3MF_uint32 * pCount); @@ -2860,7 +3016,7 @@ typedef Lib3MFResult (*PLib3MFAttachment_SetRelationShipTypePtr) (Lib3MF_Attachm typedef Lib3MFResult (*PLib3MFAttachment_WriteToFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); /** -* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * * @param[in] pAttachment - Attachment instance. * @param[in] pFileName - file to read from. @@ -2869,7 +3025,7 @@ typedef Lib3MFResult (*PLib3MFAttachment_WriteToFilePtr) (Lib3MF_Attachment pAtt typedef Lib3MFResult (*PLib3MFAttachment_ReadFromFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); /** -* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * * @param[in] pAttachment - Attachment instance. * @param[in] pTheReadCallback - Callback to call for reading a data chunk @@ -2901,7 +3057,7 @@ typedef Lib3MFResult (*PLib3MFAttachment_GetStreamSizePtr) (Lib3MF_Attachment pA typedef Lib3MFResult (*PLib3MFAttachment_WriteToBufferPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); /** -* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* Reads an attachment from a memory buffer. This buffer is immediately read (in contrast to the ReadFromCallback and ReadFromFile-methods). * * @param[in] pAttachment - Attachment instance. * @param[in] nBufferBufferSize - Number of elements in buffer @@ -4013,6 +4169,233 @@ typedef Lib3MFResult (*PLib3MFUnsignedMeshNode_GetInputPosPtr) (Lib3MF_UnsignedM */ typedef Lib3MFResult (*PLib3MFUnsignedMeshNode_GetOutputDistancePtr) (Lib3MF_UnsignedMeshNode pUnsignedMeshNode, Lib3MF_ImplicitPort * pDistance); +/************************************************************************************************************************* + Class definition for BeamLatticeNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the model resource id of the beam lattice +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pBeamLattice - the input port for the model resource id of the beam lattice (mesh with beamlattice extension) +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_GetInputBeamLatticePtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pBeamLattice); + +/** +* Retrieves the input for the position +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_GetInputPosPtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the output +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pDistance - the output port for the signed distance to the beam lattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_GetOutputDistancePtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pDistance); + +/** +* Sets the accurate range for distance computation +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[in] dAccurateRange - the accurate range in model units +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_SetAccurateRangePtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double dAccurateRange); + +/** +* Retrieves the accurate range for distance computation +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pAccurateRange - the accurate range in model units +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_GetAccurateRangePtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double * pAccurateRange); + +/************************************************************************************************************************* + Class definition for FunctionGradientNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the function id +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pFunction - the input port for the function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetInputFunctionIDPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pFunction); + +/** +* Retrieves the input for the position +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetInputPosPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the input for the finite difference step +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pStep - the input port for the finite difference step +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetInputStepPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pStep); + +/** +* Sets the name of the referenced scalar output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] pScalarOutputName - the name of the scalar output of the referenced function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_SetScalarOutputNamePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pScalarOutputName); + +/** +* Retrieves the name of the referenced scalar output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetScalarOutputNamePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + +/** +* Sets the name of the referenced vector input +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_SetVectorInputNamePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pVectorInputName); + +/** +* Retrieves the name of the referenced vector input +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetVectorInputNamePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + +/** +* Retrieves the normalized gradient output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pNormalizedGradient - the output port for the normalized gradient +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetOutputNormalizedGradientPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pNormalizedGradient); + +/** +* Retrieves the raw gradient output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pGradient - the output port for the raw gradient +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetOutputGradientPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pGradient); + +/** +* Retrieves the gradient magnitude output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pMagnitude - the output port for the gradient magnitude +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetOutputMagnitudePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pMagnitude); + +/************************************************************************************************************************* + Class definition for NormalizeDistanceNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the function id +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pFunction - the input port for the function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetInputFunctionIDPtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pFunction); + +/** +* Retrieves the input for the position +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pPos - the input port for the position (vector) +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetInputPosPtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the input for the finite difference step +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pStep - the input port for the finite difference step +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetInputStepPtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pStep); + +/** +* Sets the name of the referenced scalar output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] pScalarOutputName - the name of the scalar output of the referenced function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_SetScalarOutputNamePtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pScalarOutputName); + +/** +* Retrieves the name of the referenced scalar output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetScalarOutputNamePtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + +/** +* Sets the name of the referenced vector input +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_SetVectorInputNamePtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pVectorInputName); + +/** +* Retrieves the name of the referenced vector input +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetVectorInputNamePtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + +/** +* Retrieves the normalized result output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pResult - the output port for the normalized distance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetOutputResultPtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pResult); + /************************************************************************************************************************* Class definition for FunctionCallNode **************************************************************************************************************************/ @@ -4788,6 +5171,42 @@ typedef Lib3MFResult (*PLib3MFImplicitFunction_AddMeshNodePtr) (Lib3MF_ImplicitF */ typedef Lib3MFResult (*PLib3MFImplicitFunction_AddUnsignedMeshNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_UnsignedMeshNode * pNode); +/** +* Add a BeamLatticeNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFImplicitFunction_AddBeamLatticeNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_BeamLatticeNode * pNode); + +/** +* Add a FunctionGradientNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFImplicitFunction_AddFunctionGradientNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_FunctionGradientNode * pNode); + +/** +* Add a NormalizeDistanceNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFImplicitFunction_AddNormalizeDistanceNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_NormalizeDistanceNode * pNode); + /** * Add a FunctionCallNode * @@ -5902,6 +6321,16 @@ typedef Lib3MFResult (*PLib3MFModel_GetMeshObjectByIDPtr) (Lib3MF_Model pModel, */ typedef Lib3MFResult (*PLib3MFModel_GetComponentsObjectByIDPtr) (Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_ComponentsObject * pComponentsObjectInstance); +/** +* finds a boolean object by its UniqueResourceID +* +* @param[in] pModel - Model instance. +* @param[in] nUniqueResourceID - UniqueResourceID +* @param[out] pBooleanObjectInstance - returns the boolean object instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_GetBooleanObjectByIDPtr) (Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_BooleanObject * pBooleanObjectInstance); + /** * finds a model color group by its UniqueResourceID * @@ -6007,6 +6436,15 @@ typedef Lib3MFResult (*PLib3MFModel_GetMeshObjectsPtr) (Lib3MF_Model pModel, Lib */ typedef Lib3MFResult (*PLib3MFModel_GetComponentsObjectsPtr) (Lib3MF_Model pModel, Lib3MF_ComponentsObjectIterator * pResourceIterator); +/** +* creates a resource iterator instance with all boolean object resources. +* +* @param[in] pModel - Model instance. +* @param[out] pResourceIterator - returns the iterator instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_GetBooleanObjectsPtr) (Lib3MF_Model pModel, Lib3MF_BooleanObjectIterator * pResourceIterator); + /** * creates a Texture2DIterator instance with all texture2d resources. * @@ -6115,6 +6553,15 @@ typedef Lib3MFResult (*PLib3MFModel_AddMeshObjectPtr) (Lib3MF_Model pModel, Lib3 */ typedef Lib3MFResult (*PLib3MFModel_AddComponentsObjectPtr) (Lib3MF_Model pModel, Lib3MF_ComponentsObject * pComponentsObjectInstance); +/** +* adds an empty boolean object to the model. +* +* @param[in] pModel - Model instance. +* @param[out] pBooleanObjectInstance - returns the boolean object instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_AddBooleanObjectPtr) (Lib3MF_Model pModel, Lib3MF_BooleanObject * pBooleanObjectInstance); + /** * creates a new model slicestack by its id * @@ -6665,6 +7112,7 @@ typedef struct { PLib3MFObjectIterator_GetCurrentObjectPtr m_ObjectIterator_GetCurrentObject; PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr m_MeshObjectIterator_GetCurrentMeshObject; PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr m_ComponentsObjectIterator_GetCurrentComponentsObject; + PLib3MFBooleanObjectIterator_GetCurrentBooleanObjectPtr m_BooleanObjectIterator_GetCurrentBooleanObject; PLib3MFTexture2DIterator_GetCurrentTexture2DPtr m_Texture2DIterator_GetCurrentTexture2D; PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup; PLib3MFColorGroupIterator_GetCurrentColorGroupPtr m_ColorGroupIterator_GetCurrentColorGroup; @@ -6713,6 +7161,7 @@ typedef struct { PLib3MFObject_IsMeshObjectPtr m_Object_IsMeshObject; PLib3MFObject_IsComponentsObjectPtr m_Object_IsComponentsObject; PLib3MFObject_IsLevelSetObjectPtr m_Object_IsLevelSetObject; + PLib3MFObject_IsBooleanObjectPtr m_Object_IsBooleanObject; PLib3MFObject_IsValidPtr m_Object_IsValid; PLib3MFObject_SetAttachmentAsThumbnailPtr m_Object_SetAttachmentAsThumbnail; PLib3MFObject_GetThumbnailAttachmentPtr m_Object_GetThumbnailAttachment; @@ -6770,6 +7219,20 @@ typedef struct { PLib3MFLevelSet_GetMeshPtr m_LevelSet_GetMesh; PLib3MFLevelSet_GetVolumeDataPtr m_LevelSet_GetVolumeData; PLib3MFLevelSet_SetVolumeDataPtr m_LevelSet_SetVolumeData; + PLib3MFBooleanObject_SetBaseObjectPtr m_BooleanObject_SetBaseObject; + PLib3MFBooleanObject_GetBaseObjectPtr m_BooleanObject_GetBaseObject; + PLib3MFBooleanObject_SetBaseTransformPtr m_BooleanObject_SetBaseTransform; + PLib3MFBooleanObject_GetBaseTransformPtr m_BooleanObject_GetBaseTransform; + PLib3MFBooleanObject_SetOperationPtr m_BooleanObject_SetOperation; + PLib3MFBooleanObject_GetOperationPtr m_BooleanObject_GetOperation; + PLib3MFBooleanObject_SetCSGModeEnabledPtr m_BooleanObject_SetCSGModeEnabled; + PLib3MFBooleanObject_GetCSGModeEnabledPtr m_BooleanObject_GetCSGModeEnabled; + PLib3MFBooleanObject_SetExtractionGridResolutionPtr m_BooleanObject_SetExtractionGridResolution; + PLib3MFBooleanObject_GetExtractionGridResolutionPtr m_BooleanObject_GetExtractionGridResolution; + PLib3MFBooleanObject_GetOperandCountPtr m_BooleanObject_GetOperandCount; + PLib3MFBooleanObject_AddOperandPtr m_BooleanObject_AddOperand; + PLib3MFBooleanObject_GetOperandPtr m_BooleanObject_GetOperand; + PLib3MFBooleanObject_MergeToMeshObjectPtr m_BooleanObject_MergeToMeshObject; PLib3MFBeamLattice_GetMinLengthPtr m_BeamLattice_GetMinLength; PLib3MFBeamLattice_SetMinLengthPtr m_BeamLattice_SetMinLength; PLib3MFBeamLattice_GetClippingPtr m_BeamLattice_GetClipping; @@ -6997,6 +7460,29 @@ typedef struct { PLib3MFUnsignedMeshNode_GetInputMeshPtr m_UnsignedMeshNode_GetInputMesh; PLib3MFUnsignedMeshNode_GetInputPosPtr m_UnsignedMeshNode_GetInputPos; PLib3MFUnsignedMeshNode_GetOutputDistancePtr m_UnsignedMeshNode_GetOutputDistance; + PLib3MFBeamLatticeNode_GetInputBeamLatticePtr m_BeamLatticeNode_GetInputBeamLattice; + PLib3MFBeamLatticeNode_GetInputPosPtr m_BeamLatticeNode_GetInputPos; + PLib3MFBeamLatticeNode_GetOutputDistancePtr m_BeamLatticeNode_GetOutputDistance; + PLib3MFBeamLatticeNode_SetAccurateRangePtr m_BeamLatticeNode_SetAccurateRange; + PLib3MFBeamLatticeNode_GetAccurateRangePtr m_BeamLatticeNode_GetAccurateRange; + PLib3MFFunctionGradientNode_GetInputFunctionIDPtr m_FunctionGradientNode_GetInputFunctionID; + PLib3MFFunctionGradientNode_GetInputPosPtr m_FunctionGradientNode_GetInputPos; + PLib3MFFunctionGradientNode_GetInputStepPtr m_FunctionGradientNode_GetInputStep; + PLib3MFFunctionGradientNode_SetScalarOutputNamePtr m_FunctionGradientNode_SetScalarOutputName; + PLib3MFFunctionGradientNode_GetScalarOutputNamePtr m_FunctionGradientNode_GetScalarOutputName; + PLib3MFFunctionGradientNode_SetVectorInputNamePtr m_FunctionGradientNode_SetVectorInputName; + PLib3MFFunctionGradientNode_GetVectorInputNamePtr m_FunctionGradientNode_GetVectorInputName; + PLib3MFFunctionGradientNode_GetOutputNormalizedGradientPtr m_FunctionGradientNode_GetOutputNormalizedGradient; + PLib3MFFunctionGradientNode_GetOutputGradientPtr m_FunctionGradientNode_GetOutputGradient; + PLib3MFFunctionGradientNode_GetOutputMagnitudePtr m_FunctionGradientNode_GetOutputMagnitude; + PLib3MFNormalizeDistanceNode_GetInputFunctionIDPtr m_NormalizeDistanceNode_GetInputFunctionID; + PLib3MFNormalizeDistanceNode_GetInputPosPtr m_NormalizeDistanceNode_GetInputPos; + PLib3MFNormalizeDistanceNode_GetInputStepPtr m_NormalizeDistanceNode_GetInputStep; + PLib3MFNormalizeDistanceNode_SetScalarOutputNamePtr m_NormalizeDistanceNode_SetScalarOutputName; + PLib3MFNormalizeDistanceNode_GetScalarOutputNamePtr m_NormalizeDistanceNode_GetScalarOutputName; + PLib3MFNormalizeDistanceNode_SetVectorInputNamePtr m_NormalizeDistanceNode_SetVectorInputName; + PLib3MFNormalizeDistanceNode_GetVectorInputNamePtr m_NormalizeDistanceNode_GetVectorInputName; + PLib3MFNormalizeDistanceNode_GetOutputResultPtr m_NormalizeDistanceNode_GetOutputResult; PLib3MFFunctionCallNode_GetInputFunctionIDPtr m_FunctionCallNode_GetInputFunctionID; PLib3MFNodeIterator_GetCurrentPtr m_NodeIterator_GetCurrent; PLib3MFFunction_GetDisplayNamePtr m_Function_GetDisplayName; @@ -7060,6 +7546,9 @@ typedef struct { PLib3MFImplicitFunction_AddConstMatNodePtr m_ImplicitFunction_AddConstMatNode; PLib3MFImplicitFunction_AddMeshNodePtr m_ImplicitFunction_AddMeshNode; PLib3MFImplicitFunction_AddUnsignedMeshNodePtr m_ImplicitFunction_AddUnsignedMeshNode; + PLib3MFImplicitFunction_AddBeamLatticeNodePtr m_ImplicitFunction_AddBeamLatticeNode; + PLib3MFImplicitFunction_AddFunctionGradientNodePtr m_ImplicitFunction_AddFunctionGradientNode; + PLib3MFImplicitFunction_AddNormalizeDistanceNodePtr m_ImplicitFunction_AddNormalizeDistanceNode; PLib3MFImplicitFunction_AddFunctionCallNodePtr m_ImplicitFunction_AddFunctionCallNode; PLib3MFImplicitFunction_GetNodesPtr m_ImplicitFunction_GetNodes; PLib3MFImplicitFunction_RemoveNodePtr m_ImplicitFunction_RemoveNode; @@ -7169,6 +7658,7 @@ typedef struct { PLib3MFModel_GetMultiPropertyGroupByIDPtr m_Model_GetMultiPropertyGroupByID; PLib3MFModel_GetMeshObjectByIDPtr m_Model_GetMeshObjectByID; PLib3MFModel_GetComponentsObjectByIDPtr m_Model_GetComponentsObjectByID; + PLib3MFModel_GetBooleanObjectByIDPtr m_Model_GetBooleanObjectByID; PLib3MFModel_GetColorGroupByIDPtr m_Model_GetColorGroupByID; PLib3MFModel_GetSliceStackByIDPtr m_Model_GetSliceStackByID; PLib3MFModel_GetLevelSetByIDPtr m_Model_GetLevelSetByID; @@ -7180,6 +7670,7 @@ typedef struct { PLib3MFModel_GetObjectsPtr m_Model_GetObjects; PLib3MFModel_GetMeshObjectsPtr m_Model_GetMeshObjects; PLib3MFModel_GetComponentsObjectsPtr m_Model_GetComponentsObjects; + PLib3MFModel_GetBooleanObjectsPtr m_Model_GetBooleanObjects; PLib3MFModel_GetTexture2DsPtr m_Model_GetTexture2Ds; PLib3MFModel_GetBaseMaterialGroupsPtr m_Model_GetBaseMaterialGroups; PLib3MFModel_GetColorGroupsPtr m_Model_GetColorGroups; @@ -7192,6 +7683,7 @@ typedef struct { PLib3MFModel_MergeFromModelPtr m_Model_MergeFromModel; PLib3MFModel_AddMeshObjectPtr m_Model_AddMeshObject; PLib3MFModel_AddComponentsObjectPtr m_Model_AddComponentsObject; + PLib3MFModel_AddBooleanObjectPtr m_Model_AddBooleanObject; PLib3MFModel_AddSliceStackPtr m_Model_AddSliceStack; PLib3MFModel_AddTexture2DFromAttachmentPtr m_Model_AddTexture2DFromAttachment; PLib3MFModel_AddBaseMaterialGroupPtr m_Model_AddBaseMaterialGroup; diff --git a/Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.hpp b/Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.hpp index 827d262ab..63da359c9 100644 --- a/Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.hpp +++ b/Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.hpp @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++-Header file in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -67,6 +67,7 @@ class CSliceStackIterator; class CObjectIterator; class CMeshObjectIterator; class CComponentsObjectIterator; +class CBooleanObjectIterator; class CTexture2DIterator; class CBaseMaterialGroupIterator; class CColorGroupIterator; @@ -82,6 +83,7 @@ class CTriangleSet; class CObject; class CMeshObject; class CLevelSet; +class CBooleanObject; class CBeamLattice; class CFunctionReference; class CVolumeDataColor; @@ -157,6 +159,9 @@ class CConstVecNode; class CConstMatNode; class CMeshNode; class CUnsignedMeshNode; +class CBeamLatticeNode; +class CFunctionGradientNode; +class CNormalizeDistanceNode; class CFunctionCallNode; class CNodeIterator; class CFunction; @@ -188,6 +193,7 @@ typedef CSliceStackIterator CLib3MFSliceStackIterator; typedef CObjectIterator CLib3MFObjectIterator; typedef CMeshObjectIterator CLib3MFMeshObjectIterator; typedef CComponentsObjectIterator CLib3MFComponentsObjectIterator; +typedef CBooleanObjectIterator CLib3MFBooleanObjectIterator; typedef CTexture2DIterator CLib3MFTexture2DIterator; typedef CBaseMaterialGroupIterator CLib3MFBaseMaterialGroupIterator; typedef CColorGroupIterator CLib3MFColorGroupIterator; @@ -203,6 +209,7 @@ typedef CTriangleSet CLib3MFTriangleSet; typedef CObject CLib3MFObject; typedef CMeshObject CLib3MFMeshObject; typedef CLevelSet CLib3MFLevelSet; +typedef CBooleanObject CLib3MFBooleanObject; typedef CBeamLattice CLib3MFBeamLattice; typedef CFunctionReference CLib3MFFunctionReference; typedef CVolumeDataColor CLib3MFVolumeDataColor; @@ -278,6 +285,9 @@ typedef CConstVecNode CLib3MFConstVecNode; typedef CConstMatNode CLib3MFConstMatNode; typedef CMeshNode CLib3MFMeshNode; typedef CUnsignedMeshNode CLib3MFUnsignedMeshNode; +typedef CBeamLatticeNode CLib3MFBeamLatticeNode; +typedef CFunctionGradientNode CLib3MFFunctionGradientNode; +typedef CNormalizeDistanceNode CLib3MFNormalizeDistanceNode; typedef CFunctionCallNode CLib3MFFunctionCallNode; typedef CNodeIterator CLib3MFNodeIterator; typedef CFunction CLib3MFFunction; @@ -309,6 +319,7 @@ typedef std::shared_ptr PSliceStackIterator; typedef std::shared_ptr PObjectIterator; typedef std::shared_ptr PMeshObjectIterator; typedef std::shared_ptr PComponentsObjectIterator; +typedef std::shared_ptr PBooleanObjectIterator; typedef std::shared_ptr PTexture2DIterator; typedef std::shared_ptr PBaseMaterialGroupIterator; typedef std::shared_ptr PColorGroupIterator; @@ -324,6 +335,7 @@ typedef std::shared_ptr PTriangleSet; typedef std::shared_ptr PObject; typedef std::shared_ptr PMeshObject; typedef std::shared_ptr PLevelSet; +typedef std::shared_ptr PBooleanObject; typedef std::shared_ptr PBeamLattice; typedef std::shared_ptr PFunctionReference; typedef std::shared_ptr PVolumeDataColor; @@ -399,6 +411,9 @@ typedef std::shared_ptr PConstVecNode; typedef std::shared_ptr PConstMatNode; typedef std::shared_ptr PMeshNode; typedef std::shared_ptr PUnsignedMeshNode; +typedef std::shared_ptr PBeamLatticeNode; +typedef std::shared_ptr PFunctionGradientNode; +typedef std::shared_ptr PNormalizeDistanceNode; typedef std::shared_ptr PFunctionCallNode; typedef std::shared_ptr PNodeIterator; typedef std::shared_ptr PFunction; @@ -430,6 +445,7 @@ typedef PSliceStackIterator PLib3MFSliceStackIterator; typedef PObjectIterator PLib3MFObjectIterator; typedef PMeshObjectIterator PLib3MFMeshObjectIterator; typedef PComponentsObjectIterator PLib3MFComponentsObjectIterator; +typedef PBooleanObjectIterator PLib3MFBooleanObjectIterator; typedef PTexture2DIterator PLib3MFTexture2DIterator; typedef PBaseMaterialGroupIterator PLib3MFBaseMaterialGroupIterator; typedef PColorGroupIterator PLib3MFColorGroupIterator; @@ -445,6 +461,7 @@ typedef PTriangleSet PLib3MFTriangleSet; typedef PObject PLib3MFObject; typedef PMeshObject PLib3MFMeshObject; typedef PLevelSet PLib3MFLevelSet; +typedef PBooleanObject PLib3MFBooleanObject; typedef PBeamLattice PLib3MFBeamLattice; typedef PFunctionReference PLib3MFFunctionReference; typedef PVolumeDataColor PLib3MFVolumeDataColor; @@ -520,6 +537,9 @@ typedef PConstVecNode PLib3MFConstVecNode; typedef PConstMatNode PLib3MFConstMatNode; typedef PMeshNode PLib3MFMeshNode; typedef PUnsignedMeshNode PLib3MFUnsignedMeshNode; +typedef PBeamLatticeNode PLib3MFBeamLatticeNode; +typedef PFunctionGradientNode PLib3MFFunctionGradientNode; +typedef PNormalizeDistanceNode PLib3MFNormalizeDistanceNode; typedef PFunctionCallNode PLib3MFFunctionCallNode; typedef PNodeIterator PLib3MFNodeIterator; typedef PFunction PLib3MFFunction; @@ -867,6 +887,7 @@ class CWrapper { friend class CObjectIterator; friend class CMeshObjectIterator; friend class CComponentsObjectIterator; + friend class CBooleanObjectIterator; friend class CTexture2DIterator; friend class CBaseMaterialGroupIterator; friend class CColorGroupIterator; @@ -882,6 +903,7 @@ class CWrapper { friend class CObject; friend class CMeshObject; friend class CLevelSet; + friend class CBooleanObject; friend class CBeamLattice; friend class CFunctionReference; friend class CVolumeDataColor; @@ -957,6 +979,9 @@ class CWrapper { friend class CConstMatNode; friend class CMeshNode; friend class CUnsignedMeshNode; + friend class CBeamLatticeNode; + friend class CFunctionGradientNode; + friend class CNormalizeDistanceNode; friend class CFunctionCallNode; friend class CNodeIterator; friend class CFunction; @@ -1032,6 +1057,8 @@ class CBase { friend class CWrapper; inline Lib3MF_uint64 ClassTypeId(); + +protected: }; /************************************************************************************************************************* @@ -1219,6 +1246,23 @@ class CComponentsObjectIterator : public CResourceIterator { inline PComponentsObject GetCurrentComponentsObject(); }; +/************************************************************************************************************************* + Class CBooleanObjectIterator +**************************************************************************************************************************/ +class CBooleanObjectIterator : public CResourceIterator { +public: + + /** + * CBooleanObjectIterator::CBooleanObjectIterator - Constructor for BooleanObjectIterator class. + */ + CBooleanObjectIterator(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CResourceIterator(pWrapper, pHandle) + { + } + + inline PBooleanObject GetCurrentBooleanObject(); +}; + /************************************************************************************************************************* Class CTexture2DIterator **************************************************************************************************************************/ @@ -1473,6 +1517,7 @@ class CObject : public CResource { inline bool IsMeshObject(); inline bool IsComponentsObject(); inline bool IsLevelSetObject(); + inline bool IsBooleanObject(); inline bool IsValid(); inline void SetAttachmentAsThumbnail(classParam pAttachment); inline PAttachment GetThumbnailAttachment(); @@ -1564,6 +1609,36 @@ class CLevelSet : public CObject { inline void SetVolumeData(classParam pTheVolumeData); }; +/************************************************************************************************************************* + Class CBooleanObject +**************************************************************************************************************************/ +class CBooleanObject : public CObject { +public: + + /** + * CBooleanObject::CBooleanObject - Constructor for BooleanObject class. + */ + CBooleanObject(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CObject(pWrapper, pHandle) + { + } + + inline void SetBaseObject(classParam pBaseObject, const sTransform & Transform); + inline PObject GetBaseObject(); + inline void SetBaseTransform(const sTransform & Transform); + inline sTransform GetBaseTransform(); + inline void SetOperation(const eBooleanOperation eOperation); + inline eBooleanOperation GetOperation(); + inline void SetCSGModeEnabled(const bool bCSGModeEnabled); + inline bool GetCSGModeEnabled(); + inline void SetExtractionGridResolution(const Lib3MF_uint32 nGridResolution); + inline Lib3MF_uint32 GetExtractionGridResolution(); + inline Lib3MF_uint32 GetOperandCount(); + inline void AddOperand(classParam pOperandObject, const sTransform & Transform); + inline sTransform GetOperand(const Lib3MF_uint32 nIndex, PMeshObject & pOperandObject); + inline PMeshObject MergeToMeshObject(); +}; + /************************************************************************************************************************* Class CBeamLattice **************************************************************************************************************************/ @@ -2991,6 +3066,77 @@ class CUnsignedMeshNode : public CImplicitNode { inline PImplicitPort GetOutputDistance(); }; +/************************************************************************************************************************* + Class CBeamLatticeNode +**************************************************************************************************************************/ +class CBeamLatticeNode : public CImplicitNode { +public: + + /** + * CBeamLatticeNode::CBeamLatticeNode - Constructor for BeamLatticeNode class. + */ + CBeamLatticeNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputBeamLattice(); + inline PImplicitPort GetInputPos(); + inline PImplicitPort GetOutputDistance(); + inline void SetAccurateRange(const Lib3MF_double dAccurateRange); + inline Lib3MF_double GetAccurateRange(); +}; + +/************************************************************************************************************************* + Class CFunctionGradientNode +**************************************************************************************************************************/ +class CFunctionGradientNode : public CImplicitNode { +public: + + /** + * CFunctionGradientNode::CFunctionGradientNode - Constructor for FunctionGradientNode class. + */ + CFunctionGradientNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputFunctionID(); + inline PImplicitPort GetInputPos(); + inline PImplicitPort GetInputStep(); + inline void SetScalarOutputName(const std::string & sScalarOutputName); + inline std::string GetScalarOutputName(); + inline void SetVectorInputName(const std::string & sVectorInputName); + inline std::string GetVectorInputName(); + inline PImplicitPort GetOutputNormalizedGradient(); + inline PImplicitPort GetOutputGradient(); + inline PImplicitPort GetOutputMagnitude(); +}; + +/************************************************************************************************************************* + Class CNormalizeDistanceNode +**************************************************************************************************************************/ +class CNormalizeDistanceNode : public CImplicitNode { +public: + + /** + * CNormalizeDistanceNode::CNormalizeDistanceNode - Constructor for NormalizeDistanceNode class. + */ + CNormalizeDistanceNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CImplicitNode(pWrapper, pHandle) + { + } + + inline PImplicitPort GetInputFunctionID(); + inline PImplicitPort GetInputPos(); + inline PImplicitPort GetInputStep(); + inline void SetScalarOutputName(const std::string & sScalarOutputName); + inline std::string GetScalarOutputName(); + inline void SetVectorInputName(const std::string & sVectorInputName); + inline std::string GetVectorInputName(); + inline PImplicitPort GetOutputResult(); +}; + /************************************************************************************************************************* Class CFunctionCallNode **************************************************************************************************************************/ @@ -3116,6 +3262,9 @@ class CImplicitFunction : public CFunction { inline PConstMatNode AddConstMatNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); inline PMeshNode AddMeshNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); inline PUnsignedMeshNode AddUnsignedMeshNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PBeamLatticeNode AddBeamLatticeNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PFunctionGradientNode AddFunctionGradientNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); + inline PNormalizeDistanceNode AddNormalizeDistanceNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); inline PFunctionCallNode AddFunctionCallNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag); inline PNodeIterator GetNodes(); inline void RemoveNode(classParam pNode); @@ -3417,6 +3566,7 @@ class CModel : public CBase { inline PMultiPropertyGroup GetMultiPropertyGroupByID(const Lib3MF_uint32 nUniqueResourceID); inline PMeshObject GetMeshObjectByID(const Lib3MF_uint32 nUniqueResourceID); inline PComponentsObject GetComponentsObjectByID(const Lib3MF_uint32 nUniqueResourceID); + inline PBooleanObject GetBooleanObjectByID(const Lib3MF_uint32 nUniqueResourceID); inline PColorGroup GetColorGroupByID(const Lib3MF_uint32 nUniqueResourceID); inline PSliceStack GetSliceStackByID(const Lib3MF_uint32 nUniqueResourceID); inline PLevelSet GetLevelSetByID(const Lib3MF_uint32 nUniqueResourceID); @@ -3428,6 +3578,7 @@ class CModel : public CBase { inline PObjectIterator GetObjects(); inline PMeshObjectIterator GetMeshObjects(); inline PComponentsObjectIterator GetComponentsObjects(); + inline PBooleanObjectIterator GetBooleanObjects(); inline PTexture2DIterator GetTexture2Ds(); inline PBaseMaterialGroupIterator GetBaseMaterialGroups(); inline PColorGroupIterator GetColorGroups(); @@ -3440,6 +3591,7 @@ class CModel : public CBase { inline void MergeFromModel(classParam pModelInstance); inline PMeshObject AddMeshObject(); inline PComponentsObject AddComponentsObject(); + inline PBooleanObject AddBooleanObject(); inline PSliceStack AddSliceStack(const Lib3MF_double dZBottom); inline PTexture2D AddTexture2DFromAttachment(classParam pTextureAttachment); inline PBaseMaterialGroup AddBaseMaterialGroup(); @@ -3500,6 +3652,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) case 0xDE92510BD2112288UL: return new CObjectIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ObjectIterator" case 0xF4196034E2B9FDE6UL: return new CMeshObjectIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObjectIterator" case 0x564DE4217ED7614AUL: return new CComponentsObjectIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObjectIterator" + case 0xAFF01F512E1FF6AEUL: return new CBooleanObjectIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BooleanObjectIterator" case 0x4BD32B4870FFC03BUL: return new CTexture2DIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DIterator" case 0x65E6EDD9362C79CBUL: return new CBaseMaterialGroupIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroupIterator" case 0x10274A1757C729C0UL: return new CColorGroupIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroupIterator" @@ -3515,6 +3668,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) case 0x2DA2136F577A779CUL: return new CObject(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Object" case 0x3B3A6DC6EC610497UL: return new CMeshObject(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObject" case 0xE8A7D9C192EFD0E2UL: return new CLevelSet(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::LevelSet" + case 0x85FA0E8806B6C357UL: return new CBooleanObject(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BooleanObject" case 0x63B3B461B30B4BA5UL: return new CBeamLattice(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLattice" case 0x4DF17E76926221C2UL: return new CFunctionReference(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionReference" case 0xD85B5B6143E787E3UL: return new CVolumeDataColor(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::VolumeDataColor" @@ -3590,6 +3744,9 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) case 0xF85C90EDCE6F90A4UL: return new CConstMatNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ConstMatNode" case 0x53601FD432E3DEF4UL: return new CMeshNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshNode" case 0x29985A628251A9CDUL: return new CUnsignedMeshNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::UnsignedMeshNode" + case 0x0F3A4EE98F7FEC0CUL: return new CBeamLatticeNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLatticeNode" + case 0x0437E27AEF740121UL: return new CFunctionGradientNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionGradientNode" + case 0x817D2E566E73AA8FUL: return new CNormalizeDistanceNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::NormalizeDistanceNode" case 0x0765C17C952F24E3UL: return new CFunctionCallNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionCallNode" case 0xFC006BC888CAB4D0UL: return new CNodeIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::NodeIterator" case 0x9EFB2757CA1A5231UL: return new CFunction(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Function" @@ -3934,6 +4091,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) pWrapperTable->m_ObjectIterator_GetCurrentObject = nullptr; pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = nullptr; pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = nullptr; + pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject = nullptr; pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = nullptr; pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = nullptr; pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = nullptr; @@ -3982,6 +4140,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) pWrapperTable->m_Object_IsMeshObject = nullptr; pWrapperTable->m_Object_IsComponentsObject = nullptr; pWrapperTable->m_Object_IsLevelSetObject = nullptr; + pWrapperTable->m_Object_IsBooleanObject = nullptr; pWrapperTable->m_Object_IsValid = nullptr; pWrapperTable->m_Object_SetAttachmentAsThumbnail = nullptr; pWrapperTable->m_Object_GetThumbnailAttachment = nullptr; @@ -4039,6 +4198,20 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) pWrapperTable->m_LevelSet_GetMesh = nullptr; pWrapperTable->m_LevelSet_GetVolumeData = nullptr; pWrapperTable->m_LevelSet_SetVolumeData = nullptr; + pWrapperTable->m_BooleanObject_SetBaseObject = nullptr; + pWrapperTable->m_BooleanObject_GetBaseObject = nullptr; + pWrapperTable->m_BooleanObject_SetBaseTransform = nullptr; + pWrapperTable->m_BooleanObject_GetBaseTransform = nullptr; + pWrapperTable->m_BooleanObject_SetOperation = nullptr; + pWrapperTable->m_BooleanObject_GetOperation = nullptr; + pWrapperTable->m_BooleanObject_SetCSGModeEnabled = nullptr; + pWrapperTable->m_BooleanObject_GetCSGModeEnabled = nullptr; + pWrapperTable->m_BooleanObject_SetExtractionGridResolution = nullptr; + pWrapperTable->m_BooleanObject_GetExtractionGridResolution = nullptr; + pWrapperTable->m_BooleanObject_GetOperandCount = nullptr; + pWrapperTable->m_BooleanObject_AddOperand = nullptr; + pWrapperTable->m_BooleanObject_GetOperand = nullptr; + pWrapperTable->m_BooleanObject_MergeToMeshObject = nullptr; pWrapperTable->m_BeamLattice_GetMinLength = nullptr; pWrapperTable->m_BeamLattice_SetMinLength = nullptr; pWrapperTable->m_BeamLattice_GetClipping = nullptr; @@ -4266,6 +4439,29 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) pWrapperTable->m_UnsignedMeshNode_GetInputMesh = nullptr; pWrapperTable->m_UnsignedMeshNode_GetInputPos = nullptr; pWrapperTable->m_UnsignedMeshNode_GetOutputDistance = nullptr; + pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice = nullptr; + pWrapperTable->m_BeamLatticeNode_GetInputPos = nullptr; + pWrapperTable->m_BeamLatticeNode_GetOutputDistance = nullptr; + pWrapperTable->m_BeamLatticeNode_SetAccurateRange = nullptr; + pWrapperTable->m_BeamLatticeNode_GetAccurateRange = nullptr; + pWrapperTable->m_FunctionGradientNode_GetInputFunctionID = nullptr; + pWrapperTable->m_FunctionGradientNode_GetInputPos = nullptr; + pWrapperTable->m_FunctionGradientNode_GetInputStep = nullptr; + pWrapperTable->m_FunctionGradientNode_SetScalarOutputName = nullptr; + pWrapperTable->m_FunctionGradientNode_GetScalarOutputName = nullptr; + pWrapperTable->m_FunctionGradientNode_SetVectorInputName = nullptr; + pWrapperTable->m_FunctionGradientNode_GetVectorInputName = nullptr; + pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient = nullptr; + pWrapperTable->m_FunctionGradientNode_GetOutputGradient = nullptr; + pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude = nullptr; + pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID = nullptr; + pWrapperTable->m_NormalizeDistanceNode_GetInputPos = nullptr; + pWrapperTable->m_NormalizeDistanceNode_GetInputStep = nullptr; + pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName = nullptr; + pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName = nullptr; + pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName = nullptr; + pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName = nullptr; + pWrapperTable->m_NormalizeDistanceNode_GetOutputResult = nullptr; pWrapperTable->m_FunctionCallNode_GetInputFunctionID = nullptr; pWrapperTable->m_NodeIterator_GetCurrent = nullptr; pWrapperTable->m_Function_GetDisplayName = nullptr; @@ -4329,6 +4525,9 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) pWrapperTable->m_ImplicitFunction_AddConstMatNode = nullptr; pWrapperTable->m_ImplicitFunction_AddMeshNode = nullptr; pWrapperTable->m_ImplicitFunction_AddUnsignedMeshNode = nullptr; + pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode = nullptr; + pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode = nullptr; + pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode = nullptr; pWrapperTable->m_ImplicitFunction_AddFunctionCallNode = nullptr; pWrapperTable->m_ImplicitFunction_GetNodes = nullptr; pWrapperTable->m_ImplicitFunction_RemoveNode = nullptr; @@ -4438,6 +4637,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) pWrapperTable->m_Model_GetMultiPropertyGroupByID = nullptr; pWrapperTable->m_Model_GetMeshObjectByID = nullptr; pWrapperTable->m_Model_GetComponentsObjectByID = nullptr; + pWrapperTable->m_Model_GetBooleanObjectByID = nullptr; pWrapperTable->m_Model_GetColorGroupByID = nullptr; pWrapperTable->m_Model_GetSliceStackByID = nullptr; pWrapperTable->m_Model_GetLevelSetByID = nullptr; @@ -4449,6 +4649,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) pWrapperTable->m_Model_GetObjects = nullptr; pWrapperTable->m_Model_GetMeshObjects = nullptr; pWrapperTable->m_Model_GetComponentsObjects = nullptr; + pWrapperTable->m_Model_GetBooleanObjects = nullptr; pWrapperTable->m_Model_GetTexture2Ds = nullptr; pWrapperTable->m_Model_GetBaseMaterialGroups = nullptr; pWrapperTable->m_Model_GetColorGroups = nullptr; @@ -4461,6 +4662,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) pWrapperTable->m_Model_MergeFromModel = nullptr; pWrapperTable->m_Model_AddMeshObject = nullptr; pWrapperTable->m_Model_AddComponentsObject = nullptr; + pWrapperTable->m_Model_AddBooleanObject = nullptr; pWrapperTable->m_Model_AddSliceStack = nullptr; pWrapperTable->m_Model_AddTexture2DFromAttachment = nullptr; pWrapperTable->m_Model_AddBaseMaterialGroup = nullptr; @@ -4940,6 +5142,15 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) if (pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject = (PLib3MFBooleanObjectIterator_GetCurrentBooleanObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobjectiterator_getcurrentbooleanobject"); + #else // _WIN32 + pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject = (PLib3MFBooleanObjectIterator_GetCurrentBooleanObjectPtr) dlsym(hLibrary, "lib3mf_booleanobjectiterator_getcurrentbooleanobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); #else // _WIN32 @@ -5372,6 +5583,15 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) if (pWrapperTable->m_Object_IsLevelSetObject == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Object_IsBooleanObject = (PLib3MFObject_IsBooleanObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_isbooleanobject"); + #else // _WIN32 + pWrapperTable->m_Object_IsBooleanObject = (PLib3MFObject_IsBooleanObjectPtr) dlsym(hLibrary, "lib3mf_object_isbooleanobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_IsBooleanObject == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) GetProcAddress(hLibrary, "lib3mf_object_isvalid"); #else // _WIN32 @@ -5885,6 +6105,132 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) if (pWrapperTable->m_LevelSet_SetVolumeData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetBaseObject = (PLib3MFBooleanObject_SetBaseObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setbaseobject"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetBaseObject = (PLib3MFBooleanObject_SetBaseObjectPtr) dlsym(hLibrary, "lib3mf_booleanobject_setbaseobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetBaseObject == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetBaseObject = (PLib3MFBooleanObject_GetBaseObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getbaseobject"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetBaseObject = (PLib3MFBooleanObject_GetBaseObjectPtr) dlsym(hLibrary, "lib3mf_booleanobject_getbaseobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetBaseObject == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetBaseTransform = (PLib3MFBooleanObject_SetBaseTransformPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setbasetransform"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetBaseTransform = (PLib3MFBooleanObject_SetBaseTransformPtr) dlsym(hLibrary, "lib3mf_booleanobject_setbasetransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetBaseTransform == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetBaseTransform = (PLib3MFBooleanObject_GetBaseTransformPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getbasetransform"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetBaseTransform = (PLib3MFBooleanObject_GetBaseTransformPtr) dlsym(hLibrary, "lib3mf_booleanobject_getbasetransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetBaseTransform == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetOperation = (PLib3MFBooleanObject_SetOperationPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setoperation"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetOperation = (PLib3MFBooleanObject_SetOperationPtr) dlsym(hLibrary, "lib3mf_booleanobject_setoperation"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetOperation == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetOperation = (PLib3MFBooleanObject_GetOperationPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getoperation"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetOperation = (PLib3MFBooleanObject_GetOperationPtr) dlsym(hLibrary, "lib3mf_booleanobject_getoperation"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetOperation == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetCSGModeEnabled = (PLib3MFBooleanObject_SetCSGModeEnabledPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setcsgmodeenabled"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetCSGModeEnabled = (PLib3MFBooleanObject_SetCSGModeEnabledPtr) dlsym(hLibrary, "lib3mf_booleanobject_setcsgmodeenabled"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetCSGModeEnabled == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetCSGModeEnabled = (PLib3MFBooleanObject_GetCSGModeEnabledPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getcsgmodeenabled"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetCSGModeEnabled = (PLib3MFBooleanObject_GetCSGModeEnabledPtr) dlsym(hLibrary, "lib3mf_booleanobject_getcsgmodeenabled"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetCSGModeEnabled == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetExtractionGridResolution = (PLib3MFBooleanObject_SetExtractionGridResolutionPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setextractiongridresolution"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetExtractionGridResolution = (PLib3MFBooleanObject_SetExtractionGridResolutionPtr) dlsym(hLibrary, "lib3mf_booleanobject_setextractiongridresolution"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetExtractionGridResolution == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetExtractionGridResolution = (PLib3MFBooleanObject_GetExtractionGridResolutionPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getextractiongridresolution"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetExtractionGridResolution = (PLib3MFBooleanObject_GetExtractionGridResolutionPtr) dlsym(hLibrary, "lib3mf_booleanobject_getextractiongridresolution"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetExtractionGridResolution == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetOperandCount = (PLib3MFBooleanObject_GetOperandCountPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getoperandcount"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetOperandCount = (PLib3MFBooleanObject_GetOperandCountPtr) dlsym(hLibrary, "lib3mf_booleanobject_getoperandcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetOperandCount == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_AddOperand = (PLib3MFBooleanObject_AddOperandPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_addoperand"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_AddOperand = (PLib3MFBooleanObject_AddOperandPtr) dlsym(hLibrary, "lib3mf_booleanobject_addoperand"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_AddOperand == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetOperand = (PLib3MFBooleanObject_GetOperandPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getoperand"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetOperand = (PLib3MFBooleanObject_GetOperandPtr) dlsym(hLibrary, "lib3mf_booleanobject_getoperand"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetOperand == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_MergeToMeshObject = (PLib3MFBooleanObject_MergeToMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_mergetomeshobject"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_MergeToMeshObject = (PLib3MFBooleanObject_MergeToMeshObjectPtr) dlsym(hLibrary, "lib3mf_booleanobject_mergetomeshobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_MergeToMeshObject == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getminlength"); #else // _WIN32 @@ -7929,243 +8275,450 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_FunctionCallNode_GetInputFunctionID = (PLib3MFFunctionCallNode_GetInputFunctionIDPtr) GetProcAddress(hLibrary, "lib3mf_functioncallnode_getinputfunctionid"); + pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice = (PLib3MFBeamLatticeNode_GetInputBeamLatticePtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_getinputbeamlattice"); #else // _WIN32 - pWrapperTable->m_FunctionCallNode_GetInputFunctionID = (PLib3MFFunctionCallNode_GetInputFunctionIDPtr) dlsym(hLibrary, "lib3mf_functioncallnode_getinputfunctionid"); + pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice = (PLib3MFBeamLatticeNode_GetInputBeamLatticePtr) dlsym(hLibrary, "lib3mf_beamlatticenode_getinputbeamlattice"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_FunctionCallNode_GetInputFunctionID == nullptr) + if (pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_NodeIterator_GetCurrent = (PLib3MFNodeIterator_GetCurrentPtr) GetProcAddress(hLibrary, "lib3mf_nodeiterator_getcurrent"); + pWrapperTable->m_BeamLatticeNode_GetInputPos = (PLib3MFBeamLatticeNode_GetInputPosPtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_getinputpos"); #else // _WIN32 - pWrapperTable->m_NodeIterator_GetCurrent = (PLib3MFNodeIterator_GetCurrentPtr) dlsym(hLibrary, "lib3mf_nodeiterator_getcurrent"); + pWrapperTable->m_BeamLatticeNode_GetInputPos = (PLib3MFBeamLatticeNode_GetInputPosPtr) dlsym(hLibrary, "lib3mf_beamlatticenode_getinputpos"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_NodeIterator_GetCurrent == nullptr) + if (pWrapperTable->m_BeamLatticeNode_GetInputPos == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Function_GetDisplayName = (PLib3MFFunction_GetDisplayNamePtr) GetProcAddress(hLibrary, "lib3mf_function_getdisplayname"); + pWrapperTable->m_BeamLatticeNode_GetOutputDistance = (PLib3MFBeamLatticeNode_GetOutputDistancePtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_getoutputdistance"); #else // _WIN32 - pWrapperTable->m_Function_GetDisplayName = (PLib3MFFunction_GetDisplayNamePtr) dlsym(hLibrary, "lib3mf_function_getdisplayname"); + pWrapperTable->m_BeamLatticeNode_GetOutputDistance = (PLib3MFBeamLatticeNode_GetOutputDistancePtr) dlsym(hLibrary, "lib3mf_beamlatticenode_getoutputdistance"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Function_GetDisplayName == nullptr) + if (pWrapperTable->m_BeamLatticeNode_GetOutputDistance == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Function_SetDisplayName = (PLib3MFFunction_SetDisplayNamePtr) GetProcAddress(hLibrary, "lib3mf_function_setdisplayname"); + pWrapperTable->m_BeamLatticeNode_SetAccurateRange = (PLib3MFBeamLatticeNode_SetAccurateRangePtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_setaccuraterange"); #else // _WIN32 - pWrapperTable->m_Function_SetDisplayName = (PLib3MFFunction_SetDisplayNamePtr) dlsym(hLibrary, "lib3mf_function_setdisplayname"); + pWrapperTable->m_BeamLatticeNode_SetAccurateRange = (PLib3MFBeamLatticeNode_SetAccurateRangePtr) dlsym(hLibrary, "lib3mf_beamlatticenode_setaccuraterange"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Function_SetDisplayName == nullptr) + if (pWrapperTable->m_BeamLatticeNode_SetAccurateRange == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Function_AddInput = (PLib3MFFunction_AddInputPtr) GetProcAddress(hLibrary, "lib3mf_function_addinput"); + pWrapperTable->m_BeamLatticeNode_GetAccurateRange = (PLib3MFBeamLatticeNode_GetAccurateRangePtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_getaccuraterange"); #else // _WIN32 - pWrapperTable->m_Function_AddInput = (PLib3MFFunction_AddInputPtr) dlsym(hLibrary, "lib3mf_function_addinput"); + pWrapperTable->m_BeamLatticeNode_GetAccurateRange = (PLib3MFBeamLatticeNode_GetAccurateRangePtr) dlsym(hLibrary, "lib3mf_beamlatticenode_getaccuraterange"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Function_AddInput == nullptr) + if (pWrapperTable->m_BeamLatticeNode_GetAccurateRange == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Function_GetInputs = (PLib3MFFunction_GetInputsPtr) GetProcAddress(hLibrary, "lib3mf_function_getinputs"); + pWrapperTable->m_FunctionGradientNode_GetInputFunctionID = (PLib3MFFunctionGradientNode_GetInputFunctionIDPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getinputfunctionid"); #else // _WIN32 - pWrapperTable->m_Function_GetInputs = (PLib3MFFunction_GetInputsPtr) dlsym(hLibrary, "lib3mf_function_getinputs"); + pWrapperTable->m_FunctionGradientNode_GetInputFunctionID = (PLib3MFFunctionGradientNode_GetInputFunctionIDPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getinputfunctionid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Function_GetInputs == nullptr) + if (pWrapperTable->m_FunctionGradientNode_GetInputFunctionID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Function_RemoveInput = (PLib3MFFunction_RemoveInputPtr) GetProcAddress(hLibrary, "lib3mf_function_removeinput"); + pWrapperTable->m_FunctionGradientNode_GetInputPos = (PLib3MFFunctionGradientNode_GetInputPosPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getinputpos"); #else // _WIN32 - pWrapperTable->m_Function_RemoveInput = (PLib3MFFunction_RemoveInputPtr) dlsym(hLibrary, "lib3mf_function_removeinput"); + pWrapperTable->m_FunctionGradientNode_GetInputPos = (PLib3MFFunctionGradientNode_GetInputPosPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getinputpos"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Function_RemoveInput == nullptr) + if (pWrapperTable->m_FunctionGradientNode_GetInputPos == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Function_AddOutput = (PLib3MFFunction_AddOutputPtr) GetProcAddress(hLibrary, "lib3mf_function_addoutput"); + pWrapperTable->m_FunctionGradientNode_GetInputStep = (PLib3MFFunctionGradientNode_GetInputStepPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getinputstep"); #else // _WIN32 - pWrapperTable->m_Function_AddOutput = (PLib3MFFunction_AddOutputPtr) dlsym(hLibrary, "lib3mf_function_addoutput"); + pWrapperTable->m_FunctionGradientNode_GetInputStep = (PLib3MFFunctionGradientNode_GetInputStepPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getinputstep"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Function_AddOutput == nullptr) + if (pWrapperTable->m_FunctionGradientNode_GetInputStep == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Function_GetOutputs = (PLib3MFFunction_GetOutputsPtr) GetProcAddress(hLibrary, "lib3mf_function_getoutputs"); + pWrapperTable->m_FunctionGradientNode_SetScalarOutputName = (PLib3MFFunctionGradientNode_SetScalarOutputNamePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_setscalaroutputname"); #else // _WIN32 - pWrapperTable->m_Function_GetOutputs = (PLib3MFFunction_GetOutputsPtr) dlsym(hLibrary, "lib3mf_function_getoutputs"); + pWrapperTable->m_FunctionGradientNode_SetScalarOutputName = (PLib3MFFunctionGradientNode_SetScalarOutputNamePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_setscalaroutputname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Function_GetOutputs == nullptr) + if (pWrapperTable->m_FunctionGradientNode_SetScalarOutputName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Function_RemoveOutput = (PLib3MFFunction_RemoveOutputPtr) GetProcAddress(hLibrary, "lib3mf_function_removeoutput"); + pWrapperTable->m_FunctionGradientNode_GetScalarOutputName = (PLib3MFFunctionGradientNode_GetScalarOutputNamePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getscalaroutputname"); #else // _WIN32 - pWrapperTable->m_Function_RemoveOutput = (PLib3MFFunction_RemoveOutputPtr) dlsym(hLibrary, "lib3mf_function_removeoutput"); + pWrapperTable->m_FunctionGradientNode_GetScalarOutputName = (PLib3MFFunctionGradientNode_GetScalarOutputNamePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getscalaroutputname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Function_RemoveOutput == nullptr) + if (pWrapperTable->m_FunctionGradientNode_GetScalarOutputName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Function_FindInput = (PLib3MFFunction_FindInputPtr) GetProcAddress(hLibrary, "lib3mf_function_findinput"); + pWrapperTable->m_FunctionGradientNode_SetVectorInputName = (PLib3MFFunctionGradientNode_SetVectorInputNamePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_setvectorinputname"); #else // _WIN32 - pWrapperTable->m_Function_FindInput = (PLib3MFFunction_FindInputPtr) dlsym(hLibrary, "lib3mf_function_findinput"); + pWrapperTable->m_FunctionGradientNode_SetVectorInputName = (PLib3MFFunctionGradientNode_SetVectorInputNamePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_setvectorinputname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Function_FindInput == nullptr) + if (pWrapperTable->m_FunctionGradientNode_SetVectorInputName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Function_FindOutput = (PLib3MFFunction_FindOutputPtr) GetProcAddress(hLibrary, "lib3mf_function_findoutput"); + pWrapperTable->m_FunctionGradientNode_GetVectorInputName = (PLib3MFFunctionGradientNode_GetVectorInputNamePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getvectorinputname"); #else // _WIN32 - pWrapperTable->m_Function_FindOutput = (PLib3MFFunction_FindOutputPtr) dlsym(hLibrary, "lib3mf_function_findoutput"); + pWrapperTable->m_FunctionGradientNode_GetVectorInputName = (PLib3MFFunctionGradientNode_GetVectorInputNamePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getvectorinputname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Function_FindOutput == nullptr) + if (pWrapperTable->m_FunctionGradientNode_GetVectorInputName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ImplicitFunction_GetIdentifier = (PLib3MFImplicitFunction_GetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_getidentifier"); + pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient = (PLib3MFFunctionGradientNode_GetOutputNormalizedGradientPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getoutputnormalizedgradient"); #else // _WIN32 - pWrapperTable->m_ImplicitFunction_GetIdentifier = (PLib3MFImplicitFunction_GetIdentifierPtr) dlsym(hLibrary, "lib3mf_implicitfunction_getidentifier"); + pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient = (PLib3MFFunctionGradientNode_GetOutputNormalizedGradientPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getoutputnormalizedgradient"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ImplicitFunction_GetIdentifier == nullptr) + if (pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ImplicitFunction_SetIdentifier = (PLib3MFImplicitFunction_SetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_setidentifier"); + pWrapperTable->m_FunctionGradientNode_GetOutputGradient = (PLib3MFFunctionGradientNode_GetOutputGradientPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getoutputgradient"); #else // _WIN32 - pWrapperTable->m_ImplicitFunction_SetIdentifier = (PLib3MFImplicitFunction_SetIdentifierPtr) dlsym(hLibrary, "lib3mf_implicitfunction_setidentifier"); + pWrapperTable->m_FunctionGradientNode_GetOutputGradient = (PLib3MFFunctionGradientNode_GetOutputGradientPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getoutputgradient"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ImplicitFunction_SetIdentifier == nullptr) + if (pWrapperTable->m_FunctionGradientNode_GetOutputGradient == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ImplicitFunction_AddNode = (PLib3MFImplicitFunction_AddNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addnode"); + pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude = (PLib3MFFunctionGradientNode_GetOutputMagnitudePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getoutputmagnitude"); #else // _WIN32 - pWrapperTable->m_ImplicitFunction_AddNode = (PLib3MFImplicitFunction_AddNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addnode"); + pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude = (PLib3MFFunctionGradientNode_GetOutputMagnitudePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getoutputmagnitude"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ImplicitFunction_AddNode == nullptr) + if (pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ImplicitFunction_AddSinNode = (PLib3MFImplicitFunction_AddSinNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addsinnode"); + pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID = (PLib3MFNormalizeDistanceNode_GetInputFunctionIDPtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getinputfunctionid"); #else // _WIN32 - pWrapperTable->m_ImplicitFunction_AddSinNode = (PLib3MFImplicitFunction_AddSinNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addsinnode"); + pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID = (PLib3MFNormalizeDistanceNode_GetInputFunctionIDPtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getinputfunctionid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ImplicitFunction_AddSinNode == nullptr) + if (pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ImplicitFunction_AddCosNode = (PLib3MFImplicitFunction_AddCosNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addcosnode"); + pWrapperTable->m_NormalizeDistanceNode_GetInputPos = (PLib3MFNormalizeDistanceNode_GetInputPosPtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getinputpos"); #else // _WIN32 - pWrapperTable->m_ImplicitFunction_AddCosNode = (PLib3MFImplicitFunction_AddCosNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addcosnode"); + pWrapperTable->m_NormalizeDistanceNode_GetInputPos = (PLib3MFNormalizeDistanceNode_GetInputPosPtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getinputpos"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ImplicitFunction_AddCosNode == nullptr) + if (pWrapperTable->m_NormalizeDistanceNode_GetInputPos == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ImplicitFunction_AddTanNode = (PLib3MFImplicitFunction_AddTanNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addtannode"); + pWrapperTable->m_NormalizeDistanceNode_GetInputStep = (PLib3MFNormalizeDistanceNode_GetInputStepPtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getinputstep"); #else // _WIN32 - pWrapperTable->m_ImplicitFunction_AddTanNode = (PLib3MFImplicitFunction_AddTanNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addtannode"); + pWrapperTable->m_NormalizeDistanceNode_GetInputStep = (PLib3MFNormalizeDistanceNode_GetInputStepPtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getinputstep"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ImplicitFunction_AddTanNode == nullptr) + if (pWrapperTable->m_NormalizeDistanceNode_GetInputStep == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ImplicitFunction_AddArcSinNode = (PLib3MFImplicitFunction_AddArcSinNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addarcsinnode"); + pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName = (PLib3MFNormalizeDistanceNode_SetScalarOutputNamePtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_setscalaroutputname"); #else // _WIN32 - pWrapperTable->m_ImplicitFunction_AddArcSinNode = (PLib3MFImplicitFunction_AddArcSinNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addarcsinnode"); + pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName = (PLib3MFNormalizeDistanceNode_SetScalarOutputNamePtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_setscalaroutputname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ImplicitFunction_AddArcSinNode == nullptr) + if (pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ImplicitFunction_AddArcCosNode = (PLib3MFImplicitFunction_AddArcCosNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addarccosnode"); + pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName = (PLib3MFNormalizeDistanceNode_GetScalarOutputNamePtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getscalaroutputname"); #else // _WIN32 - pWrapperTable->m_ImplicitFunction_AddArcCosNode = (PLib3MFImplicitFunction_AddArcCosNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addarccosnode"); + pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName = (PLib3MFNormalizeDistanceNode_GetScalarOutputNamePtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getscalaroutputname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ImplicitFunction_AddArcCosNode == nullptr) + if (pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ImplicitFunction_AddArcTan2Node = (PLib3MFImplicitFunction_AddArcTan2NodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addarctan2node"); + pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName = (PLib3MFNormalizeDistanceNode_SetVectorInputNamePtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_setvectorinputname"); #else // _WIN32 - pWrapperTable->m_ImplicitFunction_AddArcTan2Node = (PLib3MFImplicitFunction_AddArcTan2NodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addarctan2node"); + pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName = (PLib3MFNormalizeDistanceNode_SetVectorInputNamePtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_setvectorinputname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ImplicitFunction_AddArcTan2Node == nullptr) + if (pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ImplicitFunction_AddSinhNode = (PLib3MFImplicitFunction_AddSinhNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addsinhnode"); + pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName = (PLib3MFNormalizeDistanceNode_GetVectorInputNamePtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getvectorinputname"); #else // _WIN32 - pWrapperTable->m_ImplicitFunction_AddSinhNode = (PLib3MFImplicitFunction_AddSinhNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addsinhnode"); + pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName = (PLib3MFNormalizeDistanceNode_GetVectorInputNamePtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getvectorinputname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ImplicitFunction_AddSinhNode == nullptr) + if (pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ImplicitFunction_AddCoshNode = (PLib3MFImplicitFunction_AddCoshNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addcoshnode"); + pWrapperTable->m_NormalizeDistanceNode_GetOutputResult = (PLib3MFNormalizeDistanceNode_GetOutputResultPtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getoutputresult"); #else // _WIN32 - pWrapperTable->m_ImplicitFunction_AddCoshNode = (PLib3MFImplicitFunction_AddCoshNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addcoshnode"); + pWrapperTable->m_NormalizeDistanceNode_GetOutputResult = (PLib3MFNormalizeDistanceNode_GetOutputResultPtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getoutputresult"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ImplicitFunction_AddCoshNode == nullptr) + if (pWrapperTable->m_NormalizeDistanceNode_GetOutputResult == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ImplicitFunction_AddTanhNode = (PLib3MFImplicitFunction_AddTanhNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addtanhnode"); + pWrapperTable->m_FunctionCallNode_GetInputFunctionID = (PLib3MFFunctionCallNode_GetInputFunctionIDPtr) GetProcAddress(hLibrary, "lib3mf_functioncallnode_getinputfunctionid"); #else // _WIN32 - pWrapperTable->m_ImplicitFunction_AddTanhNode = (PLib3MFImplicitFunction_AddTanhNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addtanhnode"); + pWrapperTable->m_FunctionCallNode_GetInputFunctionID = (PLib3MFFunctionCallNode_GetInputFunctionIDPtr) dlsym(hLibrary, "lib3mf_functioncallnode_getinputfunctionid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ImplicitFunction_AddTanhNode == nullptr) + if (pWrapperTable->m_FunctionCallNode_GetInputFunctionID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ImplicitFunction_AddRoundNode = (PLib3MFImplicitFunction_AddRoundNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addroundnode"); + pWrapperTable->m_NodeIterator_GetCurrent = (PLib3MFNodeIterator_GetCurrentPtr) GetProcAddress(hLibrary, "lib3mf_nodeiterator_getcurrent"); #else // _WIN32 - pWrapperTable->m_ImplicitFunction_AddRoundNode = (PLib3MFImplicitFunction_AddRoundNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addroundnode"); + pWrapperTable->m_NodeIterator_GetCurrent = (PLib3MFNodeIterator_GetCurrentPtr) dlsym(hLibrary, "lib3mf_nodeiterator_getcurrent"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ImplicitFunction_AddRoundNode == nullptr) + if (pWrapperTable->m_NodeIterator_GetCurrent == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ImplicitFunction_AddCeilNode = (PLib3MFImplicitFunction_AddCeilNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addceilnode"); + pWrapperTable->m_Function_GetDisplayName = (PLib3MFFunction_GetDisplayNamePtr) GetProcAddress(hLibrary, "lib3mf_function_getdisplayname"); #else // _WIN32 - pWrapperTable->m_ImplicitFunction_AddCeilNode = (PLib3MFImplicitFunction_AddCeilNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addceilnode"); + pWrapperTable->m_Function_GetDisplayName = (PLib3MFFunction_GetDisplayNamePtr) dlsym(hLibrary, "lib3mf_function_getdisplayname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ImplicitFunction_AddCeilNode == nullptr) + if (pWrapperTable->m_Function_GetDisplayName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ImplicitFunction_AddFloorNode = (PLib3MFImplicitFunction_AddFloorNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addfloornode"); + pWrapperTable->m_Function_SetDisplayName = (PLib3MFFunction_SetDisplayNamePtr) GetProcAddress(hLibrary, "lib3mf_function_setdisplayname"); #else // _WIN32 - pWrapperTable->m_ImplicitFunction_AddFloorNode = (PLib3MFImplicitFunction_AddFloorNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addfloornode"); + pWrapperTable->m_Function_SetDisplayName = (PLib3MFFunction_SetDisplayNamePtr) dlsym(hLibrary, "lib3mf_function_setdisplayname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Function_SetDisplayName == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Function_AddInput = (PLib3MFFunction_AddInputPtr) GetProcAddress(hLibrary, "lib3mf_function_addinput"); + #else // _WIN32 + pWrapperTable->m_Function_AddInput = (PLib3MFFunction_AddInputPtr) dlsym(hLibrary, "lib3mf_function_addinput"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Function_AddInput == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Function_GetInputs = (PLib3MFFunction_GetInputsPtr) GetProcAddress(hLibrary, "lib3mf_function_getinputs"); + #else // _WIN32 + pWrapperTable->m_Function_GetInputs = (PLib3MFFunction_GetInputsPtr) dlsym(hLibrary, "lib3mf_function_getinputs"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Function_GetInputs == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Function_RemoveInput = (PLib3MFFunction_RemoveInputPtr) GetProcAddress(hLibrary, "lib3mf_function_removeinput"); + #else // _WIN32 + pWrapperTable->m_Function_RemoveInput = (PLib3MFFunction_RemoveInputPtr) dlsym(hLibrary, "lib3mf_function_removeinput"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Function_RemoveInput == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Function_AddOutput = (PLib3MFFunction_AddOutputPtr) GetProcAddress(hLibrary, "lib3mf_function_addoutput"); + #else // _WIN32 + pWrapperTable->m_Function_AddOutput = (PLib3MFFunction_AddOutputPtr) dlsym(hLibrary, "lib3mf_function_addoutput"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Function_AddOutput == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Function_GetOutputs = (PLib3MFFunction_GetOutputsPtr) GetProcAddress(hLibrary, "lib3mf_function_getoutputs"); + #else // _WIN32 + pWrapperTable->m_Function_GetOutputs = (PLib3MFFunction_GetOutputsPtr) dlsym(hLibrary, "lib3mf_function_getoutputs"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Function_GetOutputs == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Function_RemoveOutput = (PLib3MFFunction_RemoveOutputPtr) GetProcAddress(hLibrary, "lib3mf_function_removeoutput"); + #else // _WIN32 + pWrapperTable->m_Function_RemoveOutput = (PLib3MFFunction_RemoveOutputPtr) dlsym(hLibrary, "lib3mf_function_removeoutput"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Function_RemoveOutput == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Function_FindInput = (PLib3MFFunction_FindInputPtr) GetProcAddress(hLibrary, "lib3mf_function_findinput"); + #else // _WIN32 + pWrapperTable->m_Function_FindInput = (PLib3MFFunction_FindInputPtr) dlsym(hLibrary, "lib3mf_function_findinput"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Function_FindInput == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Function_FindOutput = (PLib3MFFunction_FindOutputPtr) GetProcAddress(hLibrary, "lib3mf_function_findoutput"); + #else // _WIN32 + pWrapperTable->m_Function_FindOutput = (PLib3MFFunction_FindOutputPtr) dlsym(hLibrary, "lib3mf_function_findoutput"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Function_FindOutput == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_GetIdentifier = (PLib3MFImplicitFunction_GetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_getidentifier"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_GetIdentifier = (PLib3MFImplicitFunction_GetIdentifierPtr) dlsym(hLibrary, "lib3mf_implicitfunction_getidentifier"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_GetIdentifier == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_SetIdentifier = (PLib3MFImplicitFunction_SetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_setidentifier"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_SetIdentifier = (PLib3MFImplicitFunction_SetIdentifierPtr) dlsym(hLibrary, "lib3mf_implicitfunction_setidentifier"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_SetIdentifier == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddNode = (PLib3MFImplicitFunction_AddNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addnode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddNode = (PLib3MFImplicitFunction_AddNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addnode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddNode == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddSinNode = (PLib3MFImplicitFunction_AddSinNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addsinnode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddSinNode = (PLib3MFImplicitFunction_AddSinNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addsinnode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddSinNode == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddCosNode = (PLib3MFImplicitFunction_AddCosNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addcosnode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddCosNode = (PLib3MFImplicitFunction_AddCosNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addcosnode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddCosNode == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddTanNode = (PLib3MFImplicitFunction_AddTanNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addtannode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddTanNode = (PLib3MFImplicitFunction_AddTanNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addtannode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddTanNode == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddArcSinNode = (PLib3MFImplicitFunction_AddArcSinNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addarcsinnode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddArcSinNode = (PLib3MFImplicitFunction_AddArcSinNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addarcsinnode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddArcSinNode == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddArcCosNode = (PLib3MFImplicitFunction_AddArcCosNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addarccosnode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddArcCosNode = (PLib3MFImplicitFunction_AddArcCosNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addarccosnode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddArcCosNode == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddArcTan2Node = (PLib3MFImplicitFunction_AddArcTan2NodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addarctan2node"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddArcTan2Node = (PLib3MFImplicitFunction_AddArcTan2NodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addarctan2node"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddArcTan2Node == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddSinhNode = (PLib3MFImplicitFunction_AddSinhNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addsinhnode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddSinhNode = (PLib3MFImplicitFunction_AddSinhNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addsinhnode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddSinhNode == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddCoshNode = (PLib3MFImplicitFunction_AddCoshNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addcoshnode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddCoshNode = (PLib3MFImplicitFunction_AddCoshNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addcoshnode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddCoshNode == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddTanhNode = (PLib3MFImplicitFunction_AddTanhNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addtanhnode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddTanhNode = (PLib3MFImplicitFunction_AddTanhNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addtanhnode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddTanhNode == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddRoundNode = (PLib3MFImplicitFunction_AddRoundNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addroundnode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddRoundNode = (PLib3MFImplicitFunction_AddRoundNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addroundnode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddRoundNode == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddCeilNode = (PLib3MFImplicitFunction_AddCeilNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addceilnode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddCeilNode = (PLib3MFImplicitFunction_AddCeilNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addceilnode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddCeilNode == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddFloorNode = (PLib3MFImplicitFunction_AddFloorNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addfloornode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddFloorNode = (PLib3MFImplicitFunction_AddFloorNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addfloornode"); dlerror(); #endif // _WIN32 if (pWrapperTable->m_ImplicitFunction_AddFloorNode == nullptr) @@ -8495,6 +9048,33 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) if (pWrapperTable->m_ImplicitFunction_AddUnsignedMeshNode == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode = (PLib3MFImplicitFunction_AddBeamLatticeNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addbeamlatticenode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode = (PLib3MFImplicitFunction_AddBeamLatticeNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addbeamlatticenode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode = (PLib3MFImplicitFunction_AddFunctionGradientNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addfunctiongradientnode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode = (PLib3MFImplicitFunction_AddFunctionGradientNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addfunctiongradientnode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode = (PLib3MFImplicitFunction_AddNormalizeDistanceNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addnormalizedistancenode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode = (PLib3MFImplicitFunction_AddNormalizeDistanceNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addnormalizedistancenode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_ImplicitFunction_AddFunctionCallNode = (PLib3MFImplicitFunction_AddFunctionCallNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addfunctioncallnode"); #else // _WIN32 @@ -9476,6 +10056,15 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) if (pWrapperTable->m_Model_GetComponentsObjectByID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_GetBooleanObjectByID = (PLib3MFModel_GetBooleanObjectByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getbooleanobjectbyid"); + #else // _WIN32 + pWrapperTable->m_Model_GetBooleanObjectByID = (PLib3MFModel_GetBooleanObjectByIDPtr) dlsym(hLibrary, "lib3mf_model_getbooleanobjectbyid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetBooleanObjectByID == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Model_GetColorGroupByID = (PLib3MFModel_GetColorGroupByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getcolorgroupbyid"); #else // _WIN32 @@ -9575,6 +10164,15 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) if (pWrapperTable->m_Model_GetComponentsObjects == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_GetBooleanObjects = (PLib3MFModel_GetBooleanObjectsPtr) GetProcAddress(hLibrary, "lib3mf_model_getbooleanobjects"); + #else // _WIN32 + pWrapperTable->m_Model_GetBooleanObjects = (PLib3MFModel_GetBooleanObjectsPtr) dlsym(hLibrary, "lib3mf_model_getbooleanobjects"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetBooleanObjects == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Model_GetTexture2Ds = (PLib3MFModel_GetTexture2DsPtr) GetProcAddress(hLibrary, "lib3mf_model_gettexture2ds"); #else // _WIN32 @@ -9683,6 +10281,15 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) if (pWrapperTable->m_Model_AddComponentsObject == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_AddBooleanObject = (PLib3MFModel_AddBooleanObjectPtr) GetProcAddress(hLibrary, "lib3mf_model_addbooleanobject"); + #else // _WIN32 + pWrapperTable->m_Model_AddBooleanObject = (PLib3MFModel_AddBooleanObjectPtr) dlsym(hLibrary, "lib3mf_model_addbooleanobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddBooleanObject == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Model_AddSliceStack = (PLib3MFModel_AddSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_model_addslicestack"); #else // _WIN32 @@ -10326,6 +10933,10 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) if ( (eLookupError != 0) || (pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("lib3mf_booleanobjectiterator_getcurrentbooleanobject", (void**)&(pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject)); + if ( (eLookupError != 0) || (pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("lib3mf_texture2diterator_getcurrenttexture2d", (void**)&(pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D)); if ( (eLookupError != 0) || (pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; @@ -10518,6 +11129,10 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) if ( (eLookupError != 0) || (pWrapperTable->m_Object_IsLevelSetObject == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("lib3mf_object_isbooleanobject", (void**)&(pWrapperTable->m_Object_IsBooleanObject)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_IsBooleanObject == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("lib3mf_object_isvalid", (void**)&(pWrapperTable->m_Object_IsValid)); if ( (eLookupError != 0) || (pWrapperTable->m_Object_IsValid == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; @@ -10746,23 +11361,79 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) if ( (eLookupError != 0) || (pWrapperTable->m_LevelSet_SetVolumeData == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_getminlength", (void**)&(pWrapperTable->m_BeamLattice_GetMinLength)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetMinLength == nullptr) ) + eLookupError = (*pLookup)("lib3mf_booleanobject_setbaseobject", (void**)&(pWrapperTable->m_BooleanObject_SetBaseObject)); + if ( (eLookupError != 0) || (pWrapperTable->m_BooleanObject_SetBaseObject == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_setminlength", (void**)&(pWrapperTable->m_BeamLattice_SetMinLength)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetMinLength == nullptr) ) + eLookupError = (*pLookup)("lib3mf_booleanobject_getbaseobject", (void**)&(pWrapperTable->m_BooleanObject_GetBaseObject)); + if ( (eLookupError != 0) || (pWrapperTable->m_BooleanObject_GetBaseObject == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_getclipping", (void**)&(pWrapperTable->m_BeamLattice_GetClipping)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetClipping == nullptr) ) + eLookupError = (*pLookup)("lib3mf_booleanobject_setbasetransform", (void**)&(pWrapperTable->m_BooleanObject_SetBaseTransform)); + if ( (eLookupError != 0) || (pWrapperTable->m_BooleanObject_SetBaseTransform == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_setclipping", (void**)&(pWrapperTable->m_BeamLattice_SetClipping)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetClipping == nullptr) ) + eLookupError = (*pLookup)("lib3mf_booleanobject_getbasetransform", (void**)&(pWrapperTable->m_BooleanObject_GetBaseTransform)); + if ( (eLookupError != 0) || (pWrapperTable->m_BooleanObject_GetBaseTransform == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_getrepresentation", (void**)&(pWrapperTable->m_BeamLattice_GetRepresentation)); + eLookupError = (*pLookup)("lib3mf_booleanobject_setoperation", (void**)&(pWrapperTable->m_BooleanObject_SetOperation)); + if ( (eLookupError != 0) || (pWrapperTable->m_BooleanObject_SetOperation == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_booleanobject_getoperation", (void**)&(pWrapperTable->m_BooleanObject_GetOperation)); + if ( (eLookupError != 0) || (pWrapperTable->m_BooleanObject_GetOperation == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_booleanobject_setcsgmodeenabled", (void**)&(pWrapperTable->m_BooleanObject_SetCSGModeEnabled)); + if ( (eLookupError != 0) || (pWrapperTable->m_BooleanObject_SetCSGModeEnabled == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_booleanobject_getcsgmodeenabled", (void**)&(pWrapperTable->m_BooleanObject_GetCSGModeEnabled)); + if ( (eLookupError != 0) || (pWrapperTable->m_BooleanObject_GetCSGModeEnabled == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_booleanobject_setextractiongridresolution", (void**)&(pWrapperTable->m_BooleanObject_SetExtractionGridResolution)); + if ( (eLookupError != 0) || (pWrapperTable->m_BooleanObject_SetExtractionGridResolution == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_booleanobject_getextractiongridresolution", (void**)&(pWrapperTable->m_BooleanObject_GetExtractionGridResolution)); + if ( (eLookupError != 0) || (pWrapperTable->m_BooleanObject_GetExtractionGridResolution == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_booleanobject_getoperandcount", (void**)&(pWrapperTable->m_BooleanObject_GetOperandCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_BooleanObject_GetOperandCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_booleanobject_addoperand", (void**)&(pWrapperTable->m_BooleanObject_AddOperand)); + if ( (eLookupError != 0) || (pWrapperTable->m_BooleanObject_AddOperand == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_booleanobject_getoperand", (void**)&(pWrapperTable->m_BooleanObject_GetOperand)); + if ( (eLookupError != 0) || (pWrapperTable->m_BooleanObject_GetOperand == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_booleanobject_mergetomeshobject", (void**)&(pWrapperTable->m_BooleanObject_MergeToMeshObject)); + if ( (eLookupError != 0) || (pWrapperTable->m_BooleanObject_MergeToMeshObject == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_beamlattice_getminlength", (void**)&(pWrapperTable->m_BeamLattice_GetMinLength)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetMinLength == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_beamlattice_setminlength", (void**)&(pWrapperTable->m_BeamLattice_SetMinLength)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetMinLength == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_beamlattice_getclipping", (void**)&(pWrapperTable->m_BeamLattice_GetClipping)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetClipping == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_beamlattice_setclipping", (void**)&(pWrapperTable->m_BeamLattice_SetClipping)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetClipping == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_beamlattice_getrepresentation", (void**)&(pWrapperTable->m_BeamLattice_GetRepresentation)); if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetRepresentation == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; @@ -11654,6 +12325,98 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) if ( (eLookupError != 0) || (pWrapperTable->m_UnsignedMeshNode_GetOutputDistance == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("lib3mf_beamlatticenode_getinputbeamlattice", (void**)&(pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_beamlatticenode_getinputpos", (void**)&(pWrapperTable->m_BeamLatticeNode_GetInputPos)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLatticeNode_GetInputPos == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_beamlatticenode_getoutputdistance", (void**)&(pWrapperTable->m_BeamLatticeNode_GetOutputDistance)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLatticeNode_GetOutputDistance == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_beamlatticenode_setaccuraterange", (void**)&(pWrapperTable->m_BeamLatticeNode_SetAccurateRange)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLatticeNode_SetAccurateRange == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_beamlatticenode_getaccuraterange", (void**)&(pWrapperTable->m_BeamLatticeNode_GetAccurateRange)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLatticeNode_GetAccurateRange == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_functiongradientnode_getinputfunctionid", (void**)&(pWrapperTable->m_FunctionGradientNode_GetInputFunctionID)); + if ( (eLookupError != 0) || (pWrapperTable->m_FunctionGradientNode_GetInputFunctionID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_functiongradientnode_getinputpos", (void**)&(pWrapperTable->m_FunctionGradientNode_GetInputPos)); + if ( (eLookupError != 0) || (pWrapperTable->m_FunctionGradientNode_GetInputPos == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_functiongradientnode_getinputstep", (void**)&(pWrapperTable->m_FunctionGradientNode_GetInputStep)); + if ( (eLookupError != 0) || (pWrapperTable->m_FunctionGradientNode_GetInputStep == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_functiongradientnode_setscalaroutputname", (void**)&(pWrapperTable->m_FunctionGradientNode_SetScalarOutputName)); + if ( (eLookupError != 0) || (pWrapperTable->m_FunctionGradientNode_SetScalarOutputName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_functiongradientnode_getscalaroutputname", (void**)&(pWrapperTable->m_FunctionGradientNode_GetScalarOutputName)); + if ( (eLookupError != 0) || (pWrapperTable->m_FunctionGradientNode_GetScalarOutputName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_functiongradientnode_setvectorinputname", (void**)&(pWrapperTable->m_FunctionGradientNode_SetVectorInputName)); + if ( (eLookupError != 0) || (pWrapperTable->m_FunctionGradientNode_SetVectorInputName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_functiongradientnode_getvectorinputname", (void**)&(pWrapperTable->m_FunctionGradientNode_GetVectorInputName)); + if ( (eLookupError != 0) || (pWrapperTable->m_FunctionGradientNode_GetVectorInputName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_functiongradientnode_getoutputnormalizedgradient", (void**)&(pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient)); + if ( (eLookupError != 0) || (pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_functiongradientnode_getoutputgradient", (void**)&(pWrapperTable->m_FunctionGradientNode_GetOutputGradient)); + if ( (eLookupError != 0) || (pWrapperTable->m_FunctionGradientNode_GetOutputGradient == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_functiongradientnode_getoutputmagnitude", (void**)&(pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude)); + if ( (eLookupError != 0) || (pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_normalizedistancenode_getinputfunctionid", (void**)&(pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID)); + if ( (eLookupError != 0) || (pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_normalizedistancenode_getinputpos", (void**)&(pWrapperTable->m_NormalizeDistanceNode_GetInputPos)); + if ( (eLookupError != 0) || (pWrapperTable->m_NormalizeDistanceNode_GetInputPos == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_normalizedistancenode_getinputstep", (void**)&(pWrapperTable->m_NormalizeDistanceNode_GetInputStep)); + if ( (eLookupError != 0) || (pWrapperTable->m_NormalizeDistanceNode_GetInputStep == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_normalizedistancenode_setscalaroutputname", (void**)&(pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName)); + if ( (eLookupError != 0) || (pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_normalizedistancenode_getscalaroutputname", (void**)&(pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName)); + if ( (eLookupError != 0) || (pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_normalizedistancenode_setvectorinputname", (void**)&(pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName)); + if ( (eLookupError != 0) || (pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_normalizedistancenode_getvectorinputname", (void**)&(pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName)); + if ( (eLookupError != 0) || (pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_normalizedistancenode_getoutputresult", (void**)&(pWrapperTable->m_NormalizeDistanceNode_GetOutputResult)); + if ( (eLookupError != 0) || (pWrapperTable->m_NormalizeDistanceNode_GetOutputResult == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("lib3mf_functioncallnode_getinputfunctionid", (void**)&(pWrapperTable->m_FunctionCallNode_GetInputFunctionID)); if ( (eLookupError != 0) || (pWrapperTable->m_FunctionCallNode_GetInputFunctionID == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; @@ -11906,6 +12669,18 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) if ( (eLookupError != 0) || (pWrapperTable->m_ImplicitFunction_AddUnsignedMeshNode == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("lib3mf_implicitfunction_addbeamlatticenode", (void**)&(pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode)); + if ( (eLookupError != 0) || (pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_implicitfunction_addfunctiongradientnode", (void**)&(pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode)); + if ( (eLookupError != 0) || (pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_implicitfunction_addnormalizedistancenode", (void**)&(pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode)); + if ( (eLookupError != 0) || (pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("lib3mf_implicitfunction_addfunctioncallnode", (void**)&(pWrapperTable->m_ImplicitFunction_AddFunctionCallNode)); if ( (eLookupError != 0) || (pWrapperTable->m_ImplicitFunction_AddFunctionCallNode == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; @@ -12342,6 +13117,10 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetComponentsObjectByID == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("lib3mf_model_getbooleanobjectbyid", (void**)&(pWrapperTable->m_Model_GetBooleanObjectByID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetBooleanObjectByID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("lib3mf_model_getcolorgroupbyid", (void**)&(pWrapperTable->m_Model_GetColorGroupByID)); if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetColorGroupByID == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; @@ -12386,6 +13165,10 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetComponentsObjects == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("lib3mf_model_getbooleanobjects", (void**)&(pWrapperTable->m_Model_GetBooleanObjects)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetBooleanObjects == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("lib3mf_model_gettexture2ds", (void**)&(pWrapperTable->m_Model_GetTexture2Ds)); if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetTexture2Ds == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; @@ -12434,6 +13217,10 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddComponentsObject == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("lib3mf_model_addbooleanobject", (void**)&(pWrapperTable->m_Model_AddBooleanObject)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddBooleanObject == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("lib3mf_model_addslicestack", (void**)&(pWrapperTable->m_Model_AddSliceStack)); if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddSliceStack == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; @@ -13182,6 +13969,25 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } + /** + * Method definitions for class CBooleanObjectIterator + */ + + /** + * CBooleanObjectIterator::GetCurrentBooleanObject - Returns the BooleanObject the iterator points at. + * @return returns the BooleanObject instance. + */ + PBooleanObject CBooleanObjectIterator::GetCurrentBooleanObject() + { + Lib3MFHandle hResource = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_BooleanObjectIterator_GetCurrentBooleanObject(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + /** * Method definitions for class CTexture2DIterator */ @@ -13832,6 +14638,18 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return resultIsLevelSetObject; } + /** + * CObject::IsBooleanObject - Retrieves, if an object is a boolean object + * @return returns, whether the object is a boolean object + */ + bool CObject::IsBooleanObject() + { + bool resultIsBooleanObject = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Object_IsBooleanObject(m_pHandle, &resultIsBooleanObject)); + + return resultIsBooleanObject; + } + /** * CObject::IsValid - Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * @return returns whether the object is a valid object description @@ -14527,6 +15345,178 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) CheckError(m_pWrapper->m_WrapperTable.m_LevelSet_SetVolumeData(m_pHandle, hTheVolumeData)); } + /** + * Method definitions for class CBooleanObject + */ + + /** + * CBooleanObject::SetBaseObject - Sets the base object and transform for the boolean shape. + * @param[in] pBaseObject - base object of the boolean shape + * @param[in] Transform - transform applied to the base object + */ + void CBooleanObject::SetBaseObject(classParam pBaseObject, const sTransform & Transform) + { + Lib3MFHandle hBaseObject = pBaseObject.GetHandle(); + CheckError(m_pWrapper->m_WrapperTable.m_BooleanObject_SetBaseObject(m_pHandle, hBaseObject, &Transform)); + } + + /** + * CBooleanObject::GetBaseObject - Returns the base object of the boolean shape. + * @return base object of the boolean shape + */ + PObject CBooleanObject::GetBaseObject() + { + Lib3MFHandle hBaseObject = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_BooleanObject_GetBaseObject(m_pHandle, &hBaseObject)); + + if (!hBaseObject) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBaseObject))); + } + + /** + * CBooleanObject::SetBaseTransform - Sets the base transform of the boolean shape. + * @param[in] Transform - transform applied to the base object + */ + void CBooleanObject::SetBaseTransform(const sTransform & Transform) + { + CheckError(m_pWrapper->m_WrapperTable.m_BooleanObject_SetBaseTransform(m_pHandle, &Transform)); + } + + /** + * CBooleanObject::GetBaseTransform - Returns the base transform of the boolean shape. + * @return transform applied to the base object + */ + sTransform CBooleanObject::GetBaseTransform() + { + sTransform resultTransform; + CheckError(m_pWrapper->m_WrapperTable.m_BooleanObject_GetBaseTransform(m_pHandle, &resultTransform)); + + return resultTransform; + } + + /** + * CBooleanObject::SetOperation - Sets the boolean operation used for the boolean shape. + * @param[in] eOperation - boolean operation used for the shape + */ + void CBooleanObject::SetOperation(const eBooleanOperation eOperation) + { + CheckError(m_pWrapper->m_WrapperTable.m_BooleanObject_SetOperation(m_pHandle, eOperation)); + } + + /** + * CBooleanObject::GetOperation - Returns the boolean operation used for the boolean shape. + * @return boolean operation used for the shape + */ + eBooleanOperation CBooleanObject::GetOperation() + { + eBooleanOperation resultOperation = (eBooleanOperation) 0; + CheckError(m_pWrapper->m_WrapperTable.m_BooleanObject_GetOperation(m_pHandle, &resultOperation)); + + return resultOperation; + } + + /** + * CBooleanObject::SetCSGModeEnabled - Enables or disables CSG field evaluation for boolean-to-mesh materialization. + * @param[in] bCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback + */ + void CBooleanObject::SetCSGModeEnabled(const bool bCSGModeEnabled) + { + CheckError(m_pWrapper->m_WrapperTable.m_BooleanObject_SetCSGModeEnabled(m_pHandle, bCSGModeEnabled)); + } + + /** + * CBooleanObject::GetCSGModeEnabled - Returns whether CSG field evaluation is enabled for boolean-to-mesh materialization. + * @return if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback + */ + bool CBooleanObject::GetCSGModeEnabled() + { + bool resultCSGModeEnabled = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BooleanObject_GetCSGModeEnabled(m_pHandle, &resultCSGModeEnabled)); + + return resultCSGModeEnabled; + } + + /** + * CBooleanObject::SetExtractionGridResolution - Sets the extraction grid resolution used for boolean-to-mesh materialization. + * @param[in] nGridResolution - extraction grid resolution for boolean surface extraction + */ + void CBooleanObject::SetExtractionGridResolution(const Lib3MF_uint32 nGridResolution) + { + CheckError(m_pWrapper->m_WrapperTable.m_BooleanObject_SetExtractionGridResolution(m_pHandle, nGridResolution)); + } + + /** + * CBooleanObject::GetExtractionGridResolution - Returns the extraction grid resolution used for boolean-to-mesh materialization. + * @return extraction grid resolution for boolean surface extraction + */ + Lib3MF_uint32 CBooleanObject::GetExtractionGridResolution() + { + Lib3MF_uint32 resultGridResolution = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BooleanObject_GetExtractionGridResolution(m_pHandle, &resultGridResolution)); + + return resultGridResolution; + } + + /** + * CBooleanObject::GetOperandCount - Returns the number of operands in the boolean sequence. + * @return number of operands in the boolean sequence + */ + Lib3MF_uint32 CBooleanObject::GetOperandCount() + { + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BooleanObject_GetOperandCount(m_pHandle, &resultCount)); + + return resultCount; + } + + /** + * CBooleanObject::AddOperand - Adds an operand object to the boolean sequence. + * @param[in] pOperandObject - mesh object used as operand + * @param[in] Transform - transform applied to the operand object + */ + void CBooleanObject::AddOperand(classParam pOperandObject, const sTransform & Transform) + { + Lib3MFHandle hOperandObject = pOperandObject.GetHandle(); + CheckError(m_pWrapper->m_WrapperTable.m_BooleanObject_AddOperand(m_pHandle, hOperandObject, &Transform)); + } + + /** + * CBooleanObject::GetOperand - Returns one operand object and transform from the boolean sequence. + * @param[in] nIndex - index of the operand in the boolean sequence + * @param[out] pOperandObject - mesh object used as operand + * @return transform applied to the operand object + */ + sTransform CBooleanObject::GetOperand(const Lib3MF_uint32 nIndex, PMeshObject & pOperandObject) + { + Lib3MFHandle hOperandObject = (Lib3MFHandle)nullptr; + sTransform resultTransform; + CheckError(m_pWrapper->m_WrapperTable.m_BooleanObject_GetOperand(m_pHandle, nIndex, &hOperandObject, &resultTransform)); + if (!hOperandObject) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } else { + pOperandObject = std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hOperandObject))); + } + + return resultTransform; + } + + /** + * CBooleanObject::MergeToMeshObject - Materializes the boolean shape into a newly created mesh object. + * @return new mesh object containing the tessellated boolean shape + */ + PMeshObject CBooleanObject::MergeToMeshObject() + { + Lib3MFHandle hMeshObject = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_BooleanObject_MergeToMeshObject(m_pHandle, &hMeshObject)); + + if (!hMeshObject) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMeshObject))); + } + /** * Method definitions for class CBeamLattice */ @@ -14961,7 +15951,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) } /** - * CVolumeDataComposite::GetMaterialMapping - Returns MaterialMappting with given index + * CVolumeDataComposite::GetMaterialMapping - Returns MaterialMapping with given index * @param[in] nIndex - Index of the MaterialMapping in question. * @return MaterialMapping used in this element */ @@ -14977,7 +15967,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) } /** - * CVolumeDataComposite::AddMaterialMapping - Adds a the MaterialMapping + * CVolumeDataComposite::AddMaterialMapping - Adds a MaterialMapping * @param[in] Transform - new transformation matrix * @return The new MaterialMapping */ @@ -15127,7 +16117,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) /** * CVolumeData::GetPropertyCount - Returns the number of VolumeDataProperty - * @return the number of VolumeDataProperty-elements within this VolumdeData + * @return the number of VolumeDataProperty-elements within this VolumeData */ Lib3MF_uint32 CVolumeData::GetPropertyCount() { @@ -16156,7 +17146,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) } /** - * CAttachment::ReadFromFile - Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. + * CAttachment::ReadFromFile - Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * @param[in] sFileName - file to read from. */ void CAttachment::ReadFromFile(const std::string & sFileName) @@ -16165,7 +17155,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) } /** - * CAttachment::ReadFromCallback - Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. + * CAttachment::ReadFromCallback - Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * @param[in] pTheReadCallback - Callback to call for reading a data chunk * @param[in] nStreamSize - number of bytes the callback returns * @param[in] pTheSeekCallback - Callback to call for seeking in the stream. @@ -16202,7 +17192,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) } /** - * CAttachment::ReadFromBuffer - Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). + * CAttachment::ReadFromBuffer - Reads an attachment from a memory buffer. This buffer is immediately read (in contrast to the ReadFromCallback and ReadFromFile-methods). * @param[in] BufferBuffer - Buffer to read from */ void CAttachment::ReadFromBuffer(const CInputVector & BufferBuffer) @@ -17463,219 +18453,529 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) Lib3MFHandle hColumn0 = (Lib3MFHandle)nullptr; CheckError(m_pWrapper->m_WrapperTable.m_MatrixFromColumnsNode_GetInputA(m_pHandle, &hColumn0)); - if (!hColumn0) { + if (!hColumn0) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hColumn0))); + } + + /** + * CMatrixFromColumnsNode::GetInputB - Retrieves the input for the second column + * @return the input for the second column + */ + PImplicitPort CMatrixFromColumnsNode::GetInputB() + { + Lib3MFHandle hColumn1 = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MatrixFromColumnsNode_GetInputB(m_pHandle, &hColumn1)); + + if (!hColumn1) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hColumn1))); + } + + /** + * CMatrixFromColumnsNode::GetInputC - Retrieves the input for the third column + * @return the input for the third column + */ + PImplicitPort CMatrixFromColumnsNode::GetInputC() + { + Lib3MFHandle hColumn2 = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MatrixFromColumnsNode_GetInputC(m_pHandle, &hColumn2)); + + if (!hColumn2) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hColumn2))); + } + + /** + * CMatrixFromColumnsNode::GetInputD - Retrieves the input for the fourth column + * @return the input for the fourth column + */ + PImplicitPort CMatrixFromColumnsNode::GetInputD() + { + Lib3MFHandle hColumn3 = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MatrixFromColumnsNode_GetInputD(m_pHandle, &hColumn3)); + + if (!hColumn3) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hColumn3))); + } + + /** + * CMatrixFromColumnsNode::GetOutputResult - Retrieves the output + * @return the output + */ + PImplicitPort CMatrixFromColumnsNode::GetOutputResult() + { + Lib3MFHandle hResult = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MatrixFromColumnsNode_GetOutputResult(m_pHandle, &hResult)); + + if (!hResult) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResult))); + } + + /** + * Method definitions for class CConstantNode + */ + + /** + * CConstantNode::SetConstant - Sets the constant value of the node + * @param[in] dValue - the value + */ + void CConstantNode::SetConstant(const Lib3MF_double dValue) + { + CheckError(m_pWrapper->m_WrapperTable.m_ConstantNode_SetConstant(m_pHandle, dValue)); + } + + /** + * CConstantNode::GetConstant - Retrieves the constant value of the node + * @return the value + */ + Lib3MF_double CConstantNode::GetConstant() + { + Lib3MF_double resultValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ConstantNode_GetConstant(m_pHandle, &resultValue)); + + return resultValue; + } + + /** + * CConstantNode::GetOutputValue - Retrieves the output + * @return the output + */ + PImplicitPort CConstantNode::GetOutputValue() + { + Lib3MFHandle hValue = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ConstantNode_GetOutputValue(m_pHandle, &hValue)); + + if (!hValue) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hValue))); + } + + /** + * Method definitions for class CConstVecNode + */ + + /** + * CConstVecNode::SetVector - Sets the vector value of the node + * @param[in] Value - the value + */ + void CConstVecNode::SetVector(const sVector & Value) + { + CheckError(m_pWrapper->m_WrapperTable.m_ConstVecNode_SetVector(m_pHandle, &Value)); + } + + /** + * CConstVecNode::GetVector - Retrieves the vector value of the node + * @return the value + */ + sVector CConstVecNode::GetVector() + { + sVector resultValue; + CheckError(m_pWrapper->m_WrapperTable.m_ConstVecNode_GetVector(m_pHandle, &resultValue)); + + return resultValue; + } + + /** + * CConstVecNode::GetOutputVector - Retrieves the output + * @return the output + */ + PImplicitPort CConstVecNode::GetOutputVector() + { + Lib3MFHandle hVector = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ConstVecNode_GetOutputVector(m_pHandle, &hVector)); + + if (!hVector) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hVector))); + } + + /** + * Method definitions for class CConstMatNode + */ + + /** + * CConstMatNode::SetMatrix - Sets the matrix value of the node + * @param[in] Value - the value + */ + void CConstMatNode::SetMatrix(const sMatrix4x4 & Value) + { + CheckError(m_pWrapper->m_WrapperTable.m_ConstMatNode_SetMatrix(m_pHandle, &Value)); + } + + /** + * CConstMatNode::GetMatrix - Retrieves the matrix value of the node + * @return the matrix + */ + sMatrix4x4 CConstMatNode::GetMatrix() + { + sMatrix4x4 resultValue; + CheckError(m_pWrapper->m_WrapperTable.m_ConstMatNode_GetMatrix(m_pHandle, &resultValue)); + + return resultValue; + } + + /** + * CConstMatNode::GetOutputMatrix - Retrieves the output + * @return the output + */ + PImplicitPort CConstMatNode::GetOutputMatrix() + { + Lib3MFHandle hMatrix = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ConstMatNode_GetOutputMatrix(m_pHandle, &hMatrix)); + + if (!hMatrix) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMatrix))); + } + + /** + * Method definitions for class CMeshNode + */ + + /** + * CMeshNode::GetInputMesh - Retrieves the input for the model resource id of the mesh + * @return the input port for the model resource id of the mesh + */ + PImplicitPort CMeshNode::GetInputMesh() + { + Lib3MFHandle hMesh = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MeshNode_GetInputMesh(m_pHandle, &hMesh)); + + if (!hMesh) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMesh))); + } + + /** + * CMeshNode::GetInputPos - Retrieves the input for the position + * @return the input port for the position + */ + PImplicitPort CMeshNode::GetInputPos() + { + Lib3MFHandle hPos = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MeshNode_GetInputPos(m_pHandle, &hPos)); + + if (!hPos) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPos))); + } + + /** + * CMeshNode::GetOutputDistance - Retrieves the output + * @return the output port for the signed distance to the mesh + */ + PImplicitPort CMeshNode::GetOutputDistance() + { + Lib3MFHandle hDistance = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MeshNode_GetOutputDistance(m_pHandle, &hDistance)); + + if (!hDistance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hDistance))); + } + + /** + * Method definitions for class CUnsignedMeshNode + */ + + /** + * CUnsignedMeshNode::GetInputMesh - Retrieves the input for the model resource id of the mesh + * @return the input port for the model resource id of the mesh + */ + PImplicitPort CUnsignedMeshNode::GetInputMesh() + { + Lib3MFHandle hMesh = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_UnsignedMeshNode_GetInputMesh(m_pHandle, &hMesh)); + + if (!hMesh) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMesh))); + } + + /** + * CUnsignedMeshNode::GetInputPos - Retrieves the input for the position + * @return the input port for the position + */ + PImplicitPort CUnsignedMeshNode::GetInputPos() + { + Lib3MFHandle hPos = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_UnsignedMeshNode_GetInputPos(m_pHandle, &hPos)); + + if (!hPos) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPos))); + } + + /** + * CUnsignedMeshNode::GetOutputDistance - Retrieves the output + * @return the output port for the unsigned distance to the mesh + */ + PImplicitPort CUnsignedMeshNode::GetOutputDistance() + { + Lib3MFHandle hDistance = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_UnsignedMeshNode_GetOutputDistance(m_pHandle, &hDistance)); + + if (!hDistance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hDistance))); + } + + /** + * Method definitions for class CBeamLatticeNode + */ + + /** + * CBeamLatticeNode::GetInputBeamLattice - Retrieves the input for the model resource id of the beam lattice + * @return the input port for the model resource id of the beam lattice (mesh with beamlattice extension) + */ + PImplicitPort CBeamLatticeNode::GetInputBeamLattice() + { + Lib3MFHandle hBeamLattice = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_BeamLatticeNode_GetInputBeamLattice(m_pHandle, &hBeamLattice)); + + if (!hBeamLattice) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hColumn0))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBeamLattice))); } /** - * CMatrixFromColumnsNode::GetInputB - Retrieves the input for the second column - * @return the input for the second column + * CBeamLatticeNode::GetInputPos - Retrieves the input for the position + * @return the input port for the position */ - PImplicitPort CMatrixFromColumnsNode::GetInputB() + PImplicitPort CBeamLatticeNode::GetInputPos() { - Lib3MFHandle hColumn1 = (Lib3MFHandle)nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MatrixFromColumnsNode_GetInputB(m_pHandle, &hColumn1)); + Lib3MFHandle hPos = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_BeamLatticeNode_GetInputPos(m_pHandle, &hPos)); - if (!hColumn1) { + if (!hPos) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hColumn1))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPos))); } /** - * CMatrixFromColumnsNode::GetInputC - Retrieves the input for the third column - * @return the input for the third column + * CBeamLatticeNode::GetOutputDistance - Retrieves the output + * @return the output port for the signed distance to the beam lattice */ - PImplicitPort CMatrixFromColumnsNode::GetInputC() + PImplicitPort CBeamLatticeNode::GetOutputDistance() { - Lib3MFHandle hColumn2 = (Lib3MFHandle)nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MatrixFromColumnsNode_GetInputC(m_pHandle, &hColumn2)); + Lib3MFHandle hDistance = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_BeamLatticeNode_GetOutputDistance(m_pHandle, &hDistance)); - if (!hColumn2) { + if (!hDistance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hColumn2))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hDistance))); } /** - * CMatrixFromColumnsNode::GetInputD - Retrieves the input for the fourth column - * @return the input for the fourth column + * CBeamLatticeNode::SetAccurateRange - Sets the accurate range for distance computation + * @param[in] dAccurateRange - the accurate range in model units */ - PImplicitPort CMatrixFromColumnsNode::GetInputD() + void CBeamLatticeNode::SetAccurateRange(const Lib3MF_double dAccurateRange) { - Lib3MFHandle hColumn3 = (Lib3MFHandle)nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MatrixFromColumnsNode_GetInputD(m_pHandle, &hColumn3)); - - if (!hColumn3) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hColumn3))); + CheckError(m_pWrapper->m_WrapperTable.m_BeamLatticeNode_SetAccurateRange(m_pHandle, dAccurateRange)); } /** - * CMatrixFromColumnsNode::GetOutputResult - Retrieves the output - * @return the output + * CBeamLatticeNode::GetAccurateRange - Retrieves the accurate range for distance computation + * @return the accurate range in model units */ - PImplicitPort CMatrixFromColumnsNode::GetOutputResult() + Lib3MF_double CBeamLatticeNode::GetAccurateRange() { - Lib3MFHandle hResult = (Lib3MFHandle)nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MatrixFromColumnsNode_GetOutputResult(m_pHandle, &hResult)); + Lib3MF_double resultAccurateRange = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BeamLatticeNode_GetAccurateRange(m_pHandle, &resultAccurateRange)); - if (!hResult) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResult))); + return resultAccurateRange; } /** - * Method definitions for class CConstantNode + * Method definitions for class CFunctionGradientNode */ /** - * CConstantNode::SetConstant - Sets the constant value of the node - * @param[in] dValue - the value + * CFunctionGradientNode::GetInputFunctionID - Retrieves the input for the function id + * @return the input port for the function */ - void CConstantNode::SetConstant(const Lib3MF_double dValue) + PImplicitPort CFunctionGradientNode::GetInputFunctionID() { - CheckError(m_pWrapper->m_WrapperTable.m_ConstantNode_SetConstant(m_pHandle, dValue)); + Lib3MFHandle hFunction = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_FunctionGradientNode_GetInputFunctionID(m_pHandle, &hFunction)); + + if (!hFunction) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hFunction))); } /** - * CConstantNode::GetConstant - Retrieves the constant value of the node - * @return the value + * CFunctionGradientNode::GetInputPos - Retrieves the input for the position + * @return the input port for the position */ - Lib3MF_double CConstantNode::GetConstant() + PImplicitPort CFunctionGradientNode::GetInputPos() { - Lib3MF_double resultValue = 0; - CheckError(m_pWrapper->m_WrapperTable.m_ConstantNode_GetConstant(m_pHandle, &resultValue)); + Lib3MFHandle hPos = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_FunctionGradientNode_GetInputPos(m_pHandle, &hPos)); - return resultValue; + if (!hPos) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPos))); } /** - * CConstantNode::GetOutputValue - Retrieves the output - * @return the output + * CFunctionGradientNode::GetInputStep - Retrieves the input for the finite difference step + * @return the input port for the finite difference step */ - PImplicitPort CConstantNode::GetOutputValue() + PImplicitPort CFunctionGradientNode::GetInputStep() { - Lib3MFHandle hValue = (Lib3MFHandle)nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_ConstantNode_GetOutputValue(m_pHandle, &hValue)); + Lib3MFHandle hStep = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_FunctionGradientNode_GetInputStep(m_pHandle, &hStep)); - if (!hValue) { + if (!hStep) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hValue))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hStep))); } /** - * Method definitions for class CConstVecNode - */ - - /** - * CConstVecNode::SetVector - Sets the vector value of the node - * @param[in] Value - the value + * CFunctionGradientNode::SetScalarOutputName - Sets the name of the referenced scalar output + * @param[in] sScalarOutputName - the name of the scalar output of the referenced function */ - void CConstVecNode::SetVector(const sVector & Value) + void CFunctionGradientNode::SetScalarOutputName(const std::string & sScalarOutputName) { - CheckError(m_pWrapper->m_WrapperTable.m_ConstVecNode_SetVector(m_pHandle, &Value)); + CheckError(m_pWrapper->m_WrapperTable.m_FunctionGradientNode_SetScalarOutputName(m_pHandle, sScalarOutputName.c_str())); } /** - * CConstVecNode::GetVector - Retrieves the vector value of the node - * @return the value + * CFunctionGradientNode::GetScalarOutputName - Retrieves the name of the referenced scalar output + * @return the name of the scalar output of the referenced function */ - sVector CConstVecNode::GetVector() + std::string CFunctionGradientNode::GetScalarOutputName() { - sVector resultValue; - CheckError(m_pWrapper->m_WrapperTable.m_ConstVecNode_GetVector(m_pHandle, &resultValue)); + Lib3MF_uint32 bytesNeededScalarOutputName = 0; + Lib3MF_uint32 bytesWrittenScalarOutputName = 0; + CheckError(m_pWrapper->m_WrapperTable.m_FunctionGradientNode_GetScalarOutputName(m_pHandle, 0, &bytesNeededScalarOutputName, nullptr)); + std::vector bufferScalarOutputName(bytesNeededScalarOutputName); + CheckError(m_pWrapper->m_WrapperTable.m_FunctionGradientNode_GetScalarOutputName(m_pHandle, bytesNeededScalarOutputName, &bytesWrittenScalarOutputName, &bufferScalarOutputName[0])); - return resultValue; + return std::string(&bufferScalarOutputName[0]); } /** - * CConstVecNode::GetOutputVector - Retrieves the output - * @return the output + * CFunctionGradientNode::SetVectorInputName - Sets the name of the referenced vector input + * @param[in] sVectorInputName - the name of the vector input (float3) of the referenced function */ - PImplicitPort CConstVecNode::GetOutputVector() + void CFunctionGradientNode::SetVectorInputName(const std::string & sVectorInputName) { - Lib3MFHandle hVector = (Lib3MFHandle)nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_ConstVecNode_GetOutputVector(m_pHandle, &hVector)); - - if (!hVector) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hVector))); + CheckError(m_pWrapper->m_WrapperTable.m_FunctionGradientNode_SetVectorInputName(m_pHandle, sVectorInputName.c_str())); } /** - * Method definitions for class CConstMatNode - */ + * CFunctionGradientNode::GetVectorInputName - Retrieves the name of the referenced vector input + * @return the name of the vector input (float3) of the referenced function + */ + std::string CFunctionGradientNode::GetVectorInputName() + { + Lib3MF_uint32 bytesNeededVectorInputName = 0; + Lib3MF_uint32 bytesWrittenVectorInputName = 0; + CheckError(m_pWrapper->m_WrapperTable.m_FunctionGradientNode_GetVectorInputName(m_pHandle, 0, &bytesNeededVectorInputName, nullptr)); + std::vector bufferVectorInputName(bytesNeededVectorInputName); + CheckError(m_pWrapper->m_WrapperTable.m_FunctionGradientNode_GetVectorInputName(m_pHandle, bytesNeededVectorInputName, &bytesWrittenVectorInputName, &bufferVectorInputName[0])); + + return std::string(&bufferVectorInputName[0]); + } /** - * CConstMatNode::SetMatrix - Sets the matrix value of the node - * @param[in] Value - the value + * CFunctionGradientNode::GetOutputNormalizedGradient - Retrieves the normalized gradient output + * @return the output port for the normalized gradient */ - void CConstMatNode::SetMatrix(const sMatrix4x4 & Value) + PImplicitPort CFunctionGradientNode::GetOutputNormalizedGradient() { - CheckError(m_pWrapper->m_WrapperTable.m_ConstMatNode_SetMatrix(m_pHandle, &Value)); + Lib3MFHandle hNormalizedGradient = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_FunctionGradientNode_GetOutputNormalizedGradient(m_pHandle, &hNormalizedGradient)); + + if (!hNormalizedGradient) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNormalizedGradient))); } /** - * CConstMatNode::GetMatrix - Retrieves the matrix value of the node - * @return the matrix + * CFunctionGradientNode::GetOutputGradient - Retrieves the raw gradient output + * @return the output port for the raw gradient */ - sMatrix4x4 CConstMatNode::GetMatrix() + PImplicitPort CFunctionGradientNode::GetOutputGradient() { - sMatrix4x4 resultValue; - CheckError(m_pWrapper->m_WrapperTable.m_ConstMatNode_GetMatrix(m_pHandle, &resultValue)); + Lib3MFHandle hGradient = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_FunctionGradientNode_GetOutputGradient(m_pHandle, &hGradient)); - return resultValue; + if (!hGradient) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hGradient))); } /** - * CConstMatNode::GetOutputMatrix - Retrieves the output - * @return the output + * CFunctionGradientNode::GetOutputMagnitude - Retrieves the gradient magnitude output + * @return the output port for the gradient magnitude */ - PImplicitPort CConstMatNode::GetOutputMatrix() + PImplicitPort CFunctionGradientNode::GetOutputMagnitude() { - Lib3MFHandle hMatrix = (Lib3MFHandle)nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_ConstMatNode_GetOutputMatrix(m_pHandle, &hMatrix)); + Lib3MFHandle hMagnitude = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_FunctionGradientNode_GetOutputMagnitude(m_pHandle, &hMagnitude)); - if (!hMatrix) { + if (!hMagnitude) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMatrix))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMagnitude))); } /** - * Method definitions for class CMeshNode + * Method definitions for class CNormalizeDistanceNode */ /** - * CMeshNode::GetInputMesh - Retrieves the input for the model resource id of the mesh - * @return the input port for the model resource id of the mesh + * CNormalizeDistanceNode::GetInputFunctionID - Retrieves the input for the function id + * @return the input port for the function */ - PImplicitPort CMeshNode::GetInputMesh() + PImplicitPort CNormalizeDistanceNode::GetInputFunctionID() { - Lib3MFHandle hMesh = (Lib3MFHandle)nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MeshNode_GetInputMesh(m_pHandle, &hMesh)); + Lib3MFHandle hFunction = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_NormalizeDistanceNode_GetInputFunctionID(m_pHandle, &hFunction)); - if (!hMesh) { + if (!hFunction) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMesh))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hFunction))); } /** - * CMeshNode::GetInputPos - Retrieves the input for the position - * @return the input port for the position + * CNormalizeDistanceNode::GetInputPos - Retrieves the input for the position + * @return the input port for the position (vector) */ - PImplicitPort CMeshNode::GetInputPos() + PImplicitPort CNormalizeDistanceNode::GetInputPos() { Lib3MFHandle hPos = (Lib3MFHandle)nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MeshNode_GetInputPos(m_pHandle, &hPos)); + CheckError(m_pWrapper->m_WrapperTable.m_NormalizeDistanceNode_GetInputPos(m_pHandle, &hPos)); if (!hPos) { CheckError(LIB3MF_ERROR_INVALIDPARAM); @@ -17684,67 +18984,81 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) } /** - * CMeshNode::GetOutputDistance - Retrieves the output - * @return the output port for the signed distance to the mesh + * CNormalizeDistanceNode::GetInputStep - Retrieves the input for the finite difference step + * @return the input port for the finite difference step */ - PImplicitPort CMeshNode::GetOutputDistance() + PImplicitPort CNormalizeDistanceNode::GetInputStep() { - Lib3MFHandle hDistance = (Lib3MFHandle)nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MeshNode_GetOutputDistance(m_pHandle, &hDistance)); + Lib3MFHandle hStep = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_NormalizeDistanceNode_GetInputStep(m_pHandle, &hStep)); - if (!hDistance) { + if (!hStep) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hDistance))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hStep))); } /** - * Method definitions for class CUnsignedMeshNode - */ + * CNormalizeDistanceNode::SetScalarOutputName - Sets the name of the referenced scalar output + * @param[in] sScalarOutputName - the name of the scalar output of the referenced function + */ + void CNormalizeDistanceNode::SetScalarOutputName(const std::string & sScalarOutputName) + { + CheckError(m_pWrapper->m_WrapperTable.m_NormalizeDistanceNode_SetScalarOutputName(m_pHandle, sScalarOutputName.c_str())); + } /** - * CUnsignedMeshNode::GetInputMesh - Retrieves the input for the model resource id of the mesh - * @return the input port for the model resource id of the mesh + * CNormalizeDistanceNode::GetScalarOutputName - Retrieves the name of the referenced scalar output + * @return the name of the scalar output of the referenced function */ - PImplicitPort CUnsignedMeshNode::GetInputMesh() + std::string CNormalizeDistanceNode::GetScalarOutputName() { - Lib3MFHandle hMesh = (Lib3MFHandle)nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_UnsignedMeshNode_GetInputMesh(m_pHandle, &hMesh)); + Lib3MF_uint32 bytesNeededScalarOutputName = 0; + Lib3MF_uint32 bytesWrittenScalarOutputName = 0; + CheckError(m_pWrapper->m_WrapperTable.m_NormalizeDistanceNode_GetScalarOutputName(m_pHandle, 0, &bytesNeededScalarOutputName, nullptr)); + std::vector bufferScalarOutputName(bytesNeededScalarOutputName); + CheckError(m_pWrapper->m_WrapperTable.m_NormalizeDistanceNode_GetScalarOutputName(m_pHandle, bytesNeededScalarOutputName, &bytesWrittenScalarOutputName, &bufferScalarOutputName[0])); - if (!hMesh) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMesh))); + return std::string(&bufferScalarOutputName[0]); } /** - * CUnsignedMeshNode::GetInputPos - Retrieves the input for the position - * @return the input port for the position + * CNormalizeDistanceNode::SetVectorInputName - Sets the name of the referenced vector input + * @param[in] sVectorInputName - the name of the vector input (float3) of the referenced function */ - PImplicitPort CUnsignedMeshNode::GetInputPos() + void CNormalizeDistanceNode::SetVectorInputName(const std::string & sVectorInputName) { - Lib3MFHandle hPos = (Lib3MFHandle)nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_UnsignedMeshNode_GetInputPos(m_pHandle, &hPos)); + CheckError(m_pWrapper->m_WrapperTable.m_NormalizeDistanceNode_SetVectorInputName(m_pHandle, sVectorInputName.c_str())); + } + + /** + * CNormalizeDistanceNode::GetVectorInputName - Retrieves the name of the referenced vector input + * @return the name of the vector input (float3) of the referenced function + */ + std::string CNormalizeDistanceNode::GetVectorInputName() + { + Lib3MF_uint32 bytesNeededVectorInputName = 0; + Lib3MF_uint32 bytesWrittenVectorInputName = 0; + CheckError(m_pWrapper->m_WrapperTable.m_NormalizeDistanceNode_GetVectorInputName(m_pHandle, 0, &bytesNeededVectorInputName, nullptr)); + std::vector bufferVectorInputName(bytesNeededVectorInputName); + CheckError(m_pWrapper->m_WrapperTable.m_NormalizeDistanceNode_GetVectorInputName(m_pHandle, bytesNeededVectorInputName, &bytesWrittenVectorInputName, &bufferVectorInputName[0])); - if (!hPos) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPos))); + return std::string(&bufferVectorInputName[0]); } /** - * CUnsignedMeshNode::GetOutputDistance - Retrieves the output - * @return the output port for the unsigned distance to the mesh + * CNormalizeDistanceNode::GetOutputResult - Retrieves the normalized result output + * @return the output port for the normalized distance */ - PImplicitPort CUnsignedMeshNode::GetOutputDistance() + PImplicitPort CNormalizeDistanceNode::GetOutputResult() { - Lib3MFHandle hDistance = (Lib3MFHandle)nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_UnsignedMeshNode_GetOutputDistance(m_pHandle, &hDistance)); + Lib3MFHandle hResult = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_NormalizeDistanceNode_GetOutputResult(m_pHandle, &hResult)); - if (!hDistance) { + if (!hResult) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hDistance))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResult))); } /** @@ -18874,6 +20188,60 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); } + /** + * CImplicitFunction::AddBeamLatticeNode - Add a BeamLatticeNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PBeamLatticeNode CImplicitFunction::AddBeamLatticeNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ImplicitFunction_AddBeamLatticeNode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddFunctionGradientNode - Add a FunctionGradientNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PFunctionGradientNode CImplicitFunction::AddFunctionGradientNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ImplicitFunction_AddFunctionGradientNode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + + /** + * CImplicitFunction::AddNormalizeDistanceNode - Add a NormalizeDistanceNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + PNormalizeDistanceNode CImplicitFunction::AddNormalizeDistanceNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + { + Lib3MFHandle hNode = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ImplicitFunction_AddNormalizeDistanceNode(m_pHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hNode)); + + if (!hNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNode))); + } + /** * CImplicitFunction::AddFunctionCallNode - Add a FunctionCallNode * @param[in] sIdentifier - the identifier of the node @@ -20361,6 +21729,22 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hComponentsObjectInstance))); } + /** + * CModel::GetBooleanObjectByID - finds a boolean object by its UniqueResourceID + * @param[in] nUniqueResourceID - UniqueResourceID + * @return returns the boolean object instance + */ + PBooleanObject CModel::GetBooleanObjectByID(const Lib3MF_uint32 nUniqueResourceID) + { + Lib3MFHandle hBooleanObjectInstance = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Model_GetBooleanObjectByID(m_pHandle, nUniqueResourceID, &hBooleanObjectInstance)); + + if (!hBooleanObjectInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBooleanObjectInstance))); + } + /** * CModel::GetColorGroupByID - finds a model color group by its UniqueResourceID * @param[in] nUniqueResourceID - UniqueResourceID @@ -20521,6 +21905,21 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); } + /** + * CModel::GetBooleanObjects - creates a resource iterator instance with all boolean object resources. + * @return returns the iterator instance. + */ + PBooleanObjectIterator CModel::GetBooleanObjects() + { + Lib3MFHandle hResourceIterator = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Model_GetBooleanObjects(m_pHandle, &hResourceIterator)); + + if (!hResourceIterator) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); + } + /** * CModel::GetTexture2Ds - creates a Texture2DIterator instance with all texture2d resources. * @return returns the iterator instance. @@ -20696,6 +22095,21 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hComponentsObjectInstance))); } + /** + * CModel::AddBooleanObject - adds an empty boolean object to the model. + * @return returns the boolean object instance + */ + PBooleanObject CModel::AddBooleanObject() + { + Lib3MFHandle hBooleanObjectInstance = (Lib3MFHandle)nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Model_AddBooleanObject(m_pHandle, &hBooleanObjectInstance)); + + if (!hBooleanObjectInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBooleanObjectInstance))); + } + /** * CModel::AddSliceStack - creates a new model slicestack by its id * @param[in] dZBottom - Bottom Z value of the slicestack diff --git a/Autogenerated/Bindings/CppDynamic/lib3mf_types.hpp b/Autogenerated/Bindings/CppDynamic/lib3mf_types.hpp index 6a9ff486d..09f6a3441 100644 --- a/Autogenerated/Bindings/CppDynamic/lib3mf_types.hpp +++ b/Autogenerated/Bindings/CppDynamic/lib3mf_types.hpp @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++-Header file with basic types in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -83,7 +83,7 @@ typedef void * Lib3MF_pvoid; **************************************************************************************************************************/ #define LIB3MF_VERSION_MAJOR 2 -#define LIB3MF_VERSION_MINOR 4 +#define LIB3MF_VERSION_MINOR 6 #define LIB3MF_VERSION_MICRO 0 #define LIB3MF_VERSION_PRERELEASEINFO "" #define LIB3MF_VERSION_BUILDINFO "" @@ -219,6 +219,7 @@ typedef Lib3MFHandle Lib3MF_SliceStackIterator; typedef Lib3MFHandle Lib3MF_ObjectIterator; typedef Lib3MFHandle Lib3MF_MeshObjectIterator; typedef Lib3MFHandle Lib3MF_ComponentsObjectIterator; +typedef Lib3MFHandle Lib3MF_BooleanObjectIterator; typedef Lib3MFHandle Lib3MF_Texture2DIterator; typedef Lib3MFHandle Lib3MF_BaseMaterialGroupIterator; typedef Lib3MFHandle Lib3MF_ColorGroupIterator; @@ -234,6 +235,7 @@ typedef Lib3MFHandle Lib3MF_TriangleSet; typedef Lib3MFHandle Lib3MF_Object; typedef Lib3MFHandle Lib3MF_MeshObject; typedef Lib3MFHandle Lib3MF_LevelSet; +typedef Lib3MFHandle Lib3MF_BooleanObject; typedef Lib3MFHandle Lib3MF_BeamLattice; typedef Lib3MFHandle Lib3MF_FunctionReference; typedef Lib3MFHandle Lib3MF_VolumeDataColor; @@ -309,6 +311,9 @@ typedef Lib3MFHandle Lib3MF_ConstVecNode; typedef Lib3MFHandle Lib3MF_ConstMatNode; typedef Lib3MFHandle Lib3MF_MeshNode; typedef Lib3MFHandle Lib3MF_UnsignedMeshNode; +typedef Lib3MFHandle Lib3MF_BeamLatticeNode; +typedef Lib3MFHandle Lib3MF_FunctionGradientNode; +typedef Lib3MFHandle Lib3MF_NormalizeDistanceNode; typedef Lib3MFHandle Lib3MF_FunctionCallNode; typedef Lib3MFHandle Lib3MF_NodeIterator; typedef Lib3MFHandle Lib3MF_Function; @@ -359,7 +364,14 @@ namespace Lib3MF { Other = 0, Model = 1, Support = 2, - SolidSupport = 3 + SolidSupport = 3, + Surface = 4 + }; + + enum class eBooleanOperation : Lib3MF_int32 { + Union = 0, + Difference = 1, + Intersection = 2 }; enum class eTextureType : Lib3MF_int32 { @@ -473,11 +485,11 @@ namespace Lib3MF { MatVecMultiplication = 14, /** Multiplies a matrix with a vector */ Transpose = 15, /** Transposes a matrix */ Inverse = 16, /** Computes the inverse of a matrix */ - Sinus = 17, /** Calculates the sinus */ - Cosinus = 18, /** Calculates the cosinus */ + Sinus = 17, /** Calculates the sine */ + Cosinus = 18, /** Calculates the cosine */ Tan = 19, /** Calculates the tangent */ - ArcSin = 20, /** Calculates the arcsinus */ - ArcCos = 21, /** Calculates the arccosinus */ + ArcSin = 20, /** Calculates the arcsine */ + ArcCos = 21, /** Calculates the arccosine */ ArcTan = 22, /** Calculates the arctangent */ ArcTan2 = 23, /** Calculates the arctangent */ Min = 24, /** Calculates the minimum of two values */ @@ -487,9 +499,9 @@ namespace Lib3MF { Pow = 28, /** Calculates the power A^B */ Sqrt = 29, /** Calculates the square root */ Exp = 30, /** Exponential function */ - Log = 31, /** Natural logarithmus */ - Log2 = 32, /** Logarithmus to the base 2 */ - Log10 = 33, /** Logarithmus to the base 10 */ + Log = 31, /** Natural logarithm */ + Log2 = 32, /** Logarithm to the base 2 */ + Log10 = 33, /** Logarithm to the base 10 */ Select = 34, /** If A is less than B returns C, else D */ Clamp = 35, /** Clamps the input value to min and max */ Sinh = 36, /** Calculates the hyperbolic sine */ @@ -504,9 +516,12 @@ namespace Lib3MF { Mesh = 45, /** Calculates the signed distance to a mesh */ Length = 46, /** Calculates the length of a vector */ ConstResourceID = 47, /** Selects a resource (function, mesh etc.) */ - VectorFromScalar = 48, /** Creates a vector from one scalar values */ + VectorFromScalar = 48, /** Creates a vector from one scalar value */ UnsignedMesh = 49, /** Calculates the unsigned distance to a mesh */ - Mod = 50 /** Calculates the modulo of two values (same behaviour as glsl mod) */ + Mod = 50, /** Calculates the modulo of two values (same behaviour as glsl mod) */ + BeamLattice = 51, /** Calculates the signed distance to a beam lattice */ + FunctionGradient = 52, /** Calculates the gradient of a function */ + NormalizeDistance = 53 /** Normalizes a distance field */ }; /** @@ -715,6 +730,7 @@ typedef Lib3MF::ePropertyType eLib3MFPropertyType; typedef Lib3MF::eSlicesMeshResolution eLib3MFSlicesMeshResolution; typedef Lib3MF::eModelUnit eLib3MFModelUnit; typedef Lib3MF::eObjectType eLib3MFObjectType; +typedef Lib3MF::eBooleanOperation eLib3MFBooleanOperation; typedef Lib3MF::eTextureType eLib3MFTextureType; typedef Lib3MF::eTextureTileStyle eLib3MFTextureTileStyle; typedef Lib3MF::eTextureFilter eLib3MFTextureFilter; diff --git a/Autogenerated/Bindings/Go/cfunc.go b/Autogenerated/Bindings/Go/cfunc.go index 27d9bb809..db74d6965 100644 --- a/Autogenerated/Bindings/Go/cfunc.go +++ b/Autogenerated/Bindings/Go/cfunc.go @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated Go wrapper file in order to allow an easy use of the 3MF Library. -Interface version: 2.4.0 +Interface version: 2.6.0 */ diff --git a/Autogenerated/Bindings/Go/lib3mf.go b/Autogenerated/Bindings/Go/lib3mf.go index 8ac0d2168..c83e7300c 100644 --- a/Autogenerated/Bindings/Go/lib3mf.go +++ b/Autogenerated/Bindings/Go/lib3mf.go @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated Go wrapper file in order to allow an easy use of the 3MF Library. -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -93,6 +93,16 @@ const ( ObjectType_Model = 1 ObjectType_Support = 2 ObjectType_SolidSupport = 3 + ObjectType_Surface = 4 +) + +// BooleanOperation represents a Lib3MF enum. +type BooleanOperation int + +const ( + BooleanOperation_Union = 0 + BooleanOperation_Difference = 1 + BooleanOperation_Intersection = 2 ) // TextureType represents a Lib3MF enum. @@ -273,6 +283,9 @@ const ( ImplicitNodeType_VectorFromScalar = 48 ImplicitNodeType_UnsignedMesh = 49 ImplicitNodeType_Mod = 50 + ImplicitNodeType_BeamLattice = 51 + ImplicitNodeType_FunctionGradient = 52 + ImplicitNodeType_NormalizeDistance = 53 ) // ImplicitPortType represents a Lib3MF enum. @@ -1249,6 +1262,26 @@ func (inst ComponentsObjectIterator) GetCurrentComponentsObject() (ComponentsObj } +// BooleanObjectIterator represents a Lib3MF class. +type BooleanObjectIterator struct { + ResourceIterator +} + +func (wrapper Wrapper) NewBooleanObjectIterator(r ref) BooleanObjectIterator { + return BooleanObjectIterator{wrapper.NewResourceIterator(r)} +} + +// GetCurrentBooleanObject returns the BooleanObject the iterator points at. +func (inst BooleanObjectIterator) GetCurrentBooleanObject() (BooleanObject, error) { + var resource ref + ret := C.CCall_lib3mf_booleanobjectiterator_getcurrentbooleanobject(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) + if ret != 0 { + return BooleanObject{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewBooleanObject(resource), nil +} + + // Texture2DIterator represents a Lib3MF class. type Texture2DIterator struct { ResourceIterator @@ -1909,6 +1942,16 @@ func (inst Object) IsLevelSetObject() (bool, error) { return bool(isLevelSetObject), nil } +// IsBooleanObject retrieves, if an object is a boolean object. +func (inst Object) IsBooleanObject() (bool, error) { + var isBooleanObject C.bool + ret := C.CCall_lib3mf_object_isbooleanobject(inst.wrapperRef.LibraryHandle, inst.Ref, &isBooleanObject) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(isBooleanObject), nil +} + // IsValid retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. func (inst Object) IsValid() (bool, error) { var isValid C.bool @@ -2541,6 +2584,151 @@ func (inst LevelSet) SetVolumeData(theVolumeData VolumeData) error { } +// BooleanObject represents a Lib3MF class. +type BooleanObject struct { + Object +} + +func (wrapper Wrapper) NewBooleanObject(r ref) BooleanObject { + return BooleanObject{wrapper.NewObject(r)} +} + +// SetBaseObject sets the base object and transform for the boolean shape. +func (inst BooleanObject) SetBaseObject(baseObject Object, transform Transform) error { + ret := C.CCall_lib3mf_booleanobject_setbaseobject(inst.wrapperRef.LibraryHandle, inst.Ref, baseObject.Ref, (*C.sLib3MFTransform)(unsafe.Pointer(&transform))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// GetBaseObject returns the base object of the boolean shape. +func (inst BooleanObject) GetBaseObject() (Object, error) { + var baseObject ref + ret := C.CCall_lib3mf_booleanobject_getbaseobject(inst.wrapperRef.LibraryHandle, inst.Ref, &baseObject) + if ret != 0 { + return Object{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewObject(baseObject), nil +} + +// SetBaseTransform sets the base transform of the boolean shape. +func (inst BooleanObject) SetBaseTransform(transform Transform) error { + ret := C.CCall_lib3mf_booleanobject_setbasetransform(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFTransform)(unsafe.Pointer(&transform))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// GetBaseTransform returns the base transform of the boolean shape. +func (inst BooleanObject) GetBaseTransform() (Transform, error) { + var transform C.sLib3MFTransform + ret := C.CCall_lib3mf_booleanobject_getbasetransform(inst.wrapperRef.LibraryHandle, inst.Ref, &transform) + if ret != 0 { + return Transform{}, makeError(uint32(ret)) + } + return *(*Transform)(unsafe.Pointer(&transform)), nil +} + +// SetOperation sets the boolean operation used for the boolean shape. +func (inst BooleanObject) SetOperation(operation BooleanOperation) error { + ret := C.CCall_lib3mf_booleanobject_setoperation(inst.wrapperRef.LibraryHandle, inst.Ref, C.eLib3MFBooleanOperation(operation)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// GetOperation returns the boolean operation used for the boolean shape. +func (inst BooleanObject) GetOperation() (BooleanOperation, error) { + var operation C.eLib3MFBooleanOperation + ret := C.CCall_lib3mf_booleanobject_getoperation(inst.wrapperRef.LibraryHandle, inst.Ref, &operation) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return BooleanOperation(operation), nil +} + +// SetCSGModeEnabled enables or disables CSG field evaluation for boolean-to-mesh materialization. +func (inst BooleanObject) SetCSGModeEnabled(cSGModeEnabled bool) error { + ret := C.CCall_lib3mf_booleanobject_setcsgmodeenabled(inst.wrapperRef.LibraryHandle, inst.Ref, C.bool(cSGModeEnabled)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// GetCSGModeEnabled returns whether CSG field evaluation is enabled for boolean-to-mesh materialization. +func (inst BooleanObject) GetCSGModeEnabled() (bool, error) { + var cSGModeEnabled C.bool + ret := C.CCall_lib3mf_booleanobject_getcsgmodeenabled(inst.wrapperRef.LibraryHandle, inst.Ref, &cSGModeEnabled) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(cSGModeEnabled), nil +} + +// SetExtractionGridResolution sets the extraction grid resolution used for boolean-to-mesh materialization. +func (inst BooleanObject) SetExtractionGridResolution(gridResolution uint32) error { + ret := C.CCall_lib3mf_booleanobject_setextractiongridresolution(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(gridResolution)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// GetExtractionGridResolution returns the extraction grid resolution used for boolean-to-mesh materialization. +func (inst BooleanObject) GetExtractionGridResolution() (uint32, error) { + var gridResolution C.uint32_t + ret := C.CCall_lib3mf_booleanobject_getextractiongridresolution(inst.wrapperRef.LibraryHandle, inst.Ref, &gridResolution) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint32(gridResolution), nil +} + +// GetOperandCount returns the number of operands in the boolean sequence. +func (inst BooleanObject) GetOperandCount() (uint32, error) { + var count C.uint32_t + ret := C.CCall_lib3mf_booleanobject_getoperandcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint32(count), nil +} + +// AddOperand adds an operand object to the boolean sequence. +func (inst BooleanObject) AddOperand(operandObject MeshObject, transform Transform) error { + ret := C.CCall_lib3mf_booleanobject_addoperand(inst.wrapperRef.LibraryHandle, inst.Ref, operandObject.Ref, (*C.sLib3MFTransform)(unsafe.Pointer(&transform))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// GetOperand returns one operand object and transform from the boolean sequence. +func (inst BooleanObject) GetOperand(index uint32) (MeshObject, Transform, error) { + var operandObject ref + var transform C.sLib3MFTransform + ret := C.CCall_lib3mf_booleanobject_getoperand(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &operandObject, &transform) + if ret != 0 { + return MeshObject{}, Transform{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewMeshObject(operandObject), *(*Transform)(unsafe.Pointer(&transform)), nil +} + +// MergeToMeshObject materializes the boolean shape into a newly created mesh object. +func (inst BooleanObject) MergeToMeshObject() (MeshObject, error) { + var meshObject ref + ret := C.CCall_lib3mf_booleanobject_mergetomeshobject(inst.wrapperRef.LibraryHandle, inst.Ref, &meshObject) + if ret != 0 { + return MeshObject{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewMeshObject(meshObject), nil +} + + // BeamLattice represents a Lib3MF class. type BeamLattice struct { Base @@ -2960,7 +3148,7 @@ func (inst VolumeDataComposite) GetMaterialMappingCount() (uint32, error) { return uint32(count), nil } -// GetMaterialMapping returns MaterialMappting with given index. +// GetMaterialMapping returns MaterialMapping with given index. func (inst VolumeDataComposite) GetMaterialMapping(index uint32) (MaterialMapping, error) { var theMaterialMapping ref ret := C.CCall_lib3mf_volumedatacomposite_getmaterialmapping(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &theMaterialMapping) @@ -2970,7 +3158,7 @@ func (inst VolumeDataComposite) GetMaterialMapping(index uint32) (MaterialMappin return inst.wrapperRef.NewMaterialMapping(theMaterialMapping), nil } -// AddMaterialMapping adds a the MaterialMapping. +// AddMaterialMapping adds a MaterialMapping. func (inst VolumeDataComposite) AddMaterialMapping(transform Transform) (MaterialMapping, error) { var theMaterialMapping ref ret := C.CCall_lib3mf_volumedatacomposite_addmaterialmapping(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFTransform)(unsafe.Pointer(&transform)), &theMaterialMapping) @@ -4102,7 +4290,7 @@ func (inst Attachment) WriteToFile(fileName string) error { return nil } -// ReadFromFile reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +// ReadFromFile reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. func (inst Attachment) ReadFromFile(fileName string) error { ret := C.CCall_lib3mf_attachment_readfromfile(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(fileName)[0]))) if ret != 0 { @@ -4111,7 +4299,7 @@ func (inst Attachment) ReadFromFile(fileName string) error { return nil } -// ReadFromCallback reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +// ReadFromCallback reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. func (inst Attachment) ReadFromCallback(theReadCallback ReadCallbackFunc, streamSize uint64, theSeekCallback SeekCallbackFunc, userData uintptr) error { ret := C.CCall_lib3mf_attachment_readfromcallback(inst.wrapperRef.LibraryHandle, inst.Ref, (C.Lib3MFReadCallback)(unsafe.Pointer(&theReadCallback)), C.uint64_t(streamSize), (C.Lib3MFSeekCallback)(unsafe.Pointer(&theSeekCallback)), (C.Lib3MF_pvoid)(userData)) if ret != 0 { @@ -4149,7 +4337,7 @@ func (inst Attachment) WriteToBuffer(buffer []uint8) ([]uint8, error) { return buffer[:int(neededforbuffer)], nil } -// ReadFromBuffer reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +// ReadFromBuffer reads an attachment from a memory buffer. This buffer is immediately read (in contrast to the ReadFromCallback and ReadFromFile-methods). func (inst Attachment) ReadFromBuffer(buffer []uint8) error { ret := C.CCall_lib3mf_attachment_readfrombuffer(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(buffer)), (*C.uint8_t)(unsafe.Pointer(&buffer[0]))) if ret != 0 { @@ -5717,6 +5905,289 @@ func (inst UnsignedMeshNode) GetOutputDistance() (ImplicitPort, error) { } +// BeamLatticeNode represents a Lib3MF class. +type BeamLatticeNode struct { + ImplicitNode +} + +func (wrapper Wrapper) NewBeamLatticeNode(r ref) BeamLatticeNode { + return BeamLatticeNode{wrapper.NewImplicitNode(r)} +} + +// GetInputBeamLattice retrieves the input for the model resource id of the beam lattice. +func (inst BeamLatticeNode) GetInputBeamLattice() (ImplicitPort, error) { + var beamLattice ref + ret := C.CCall_lib3mf_beamlatticenode_getinputbeamlattice(inst.wrapperRef.LibraryHandle, inst.Ref, &beamLattice) + if ret != 0 { + return ImplicitPort{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewImplicitPort(beamLattice), nil +} + +// GetInputPos retrieves the input for the position. +func (inst BeamLatticeNode) GetInputPos() (ImplicitPort, error) { + var pos ref + ret := C.CCall_lib3mf_beamlatticenode_getinputpos(inst.wrapperRef.LibraryHandle, inst.Ref, &pos) + if ret != 0 { + return ImplicitPort{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewImplicitPort(pos), nil +} + +// GetOutputDistance retrieves the output. +func (inst BeamLatticeNode) GetOutputDistance() (ImplicitPort, error) { + var distance ref + ret := C.CCall_lib3mf_beamlatticenode_getoutputdistance(inst.wrapperRef.LibraryHandle, inst.Ref, &distance) + if ret != 0 { + return ImplicitPort{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewImplicitPort(distance), nil +} + +// SetAccurateRange sets the accurate range for distance computation. +func (inst BeamLatticeNode) SetAccurateRange(accurateRange float64) error { + ret := C.CCall_lib3mf_beamlatticenode_setaccuraterange(inst.wrapperRef.LibraryHandle, inst.Ref, C.double(accurateRange)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// GetAccurateRange retrieves the accurate range for distance computation. +func (inst BeamLatticeNode) GetAccurateRange() (float64, error) { + var accurateRange C.double + ret := C.CCall_lib3mf_beamlatticenode_getaccuraterange(inst.wrapperRef.LibraryHandle, inst.Ref, &accurateRange) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return float64(accurateRange), nil +} + + +// FunctionGradientNode represents a Lib3MF class. +type FunctionGradientNode struct { + ImplicitNode +} + +func (wrapper Wrapper) NewFunctionGradientNode(r ref) FunctionGradientNode { + return FunctionGradientNode{wrapper.NewImplicitNode(r)} +} + +// GetInputFunctionID retrieves the input for the function id. +func (inst FunctionGradientNode) GetInputFunctionID() (ImplicitPort, error) { + var function ref + ret := C.CCall_lib3mf_functiongradientnode_getinputfunctionid(inst.wrapperRef.LibraryHandle, inst.Ref, &function) + if ret != 0 { + return ImplicitPort{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewImplicitPort(function), nil +} + +// GetInputPos retrieves the input for the position. +func (inst FunctionGradientNode) GetInputPos() (ImplicitPort, error) { + var pos ref + ret := C.CCall_lib3mf_functiongradientnode_getinputpos(inst.wrapperRef.LibraryHandle, inst.Ref, &pos) + if ret != 0 { + return ImplicitPort{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewImplicitPort(pos), nil +} + +// GetInputStep retrieves the input for the finite difference step. +func (inst FunctionGradientNode) GetInputStep() (ImplicitPort, error) { + var step ref + ret := C.CCall_lib3mf_functiongradientnode_getinputstep(inst.wrapperRef.LibraryHandle, inst.Ref, &step) + if ret != 0 { + return ImplicitPort{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewImplicitPort(step), nil +} + +// SetScalarOutputName sets the name of the referenced scalar output. +func (inst FunctionGradientNode) SetScalarOutputName(scalarOutputName string) error { + ret := C.CCall_lib3mf_functiongradientnode_setscalaroutputname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(scalarOutputName)[0]))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// GetScalarOutputName retrieves the name of the referenced scalar output. +func (inst FunctionGradientNode) GetScalarOutputName() (string, error) { + var neededforscalarOutputName C.uint32_t + var filledinscalarOutputName C.uint32_t + ret := C.CCall_lib3mf_functiongradientnode_getscalaroutputname(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforscalarOutputName, nil) + if ret != 0 { + return "", makeError(uint32(ret)) + } + bufferSizescalarOutputName := neededforscalarOutputName + bufferscalarOutputName := make([]byte, bufferSizescalarOutputName) + ret = C.CCall_lib3mf_functiongradientnode_getscalaroutputname(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizescalarOutputName, &filledinscalarOutputName, (*C.char)(unsafe.Pointer(&bufferscalarOutputName[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(bufferscalarOutputName[:(filledinscalarOutputName-1)]), nil +} + +// SetVectorInputName sets the name of the referenced vector input. +func (inst FunctionGradientNode) SetVectorInputName(vectorInputName string) error { + ret := C.CCall_lib3mf_functiongradientnode_setvectorinputname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(vectorInputName)[0]))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// GetVectorInputName retrieves the name of the referenced vector input. +func (inst FunctionGradientNode) GetVectorInputName() (string, error) { + var neededforvectorInputName C.uint32_t + var filledinvectorInputName C.uint32_t + ret := C.CCall_lib3mf_functiongradientnode_getvectorinputname(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforvectorInputName, nil) + if ret != 0 { + return "", makeError(uint32(ret)) + } + bufferSizevectorInputName := neededforvectorInputName + buffervectorInputName := make([]byte, bufferSizevectorInputName) + ret = C.CCall_lib3mf_functiongradientnode_getvectorinputname(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizevectorInputName, &filledinvectorInputName, (*C.char)(unsafe.Pointer(&buffervectorInputName[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(buffervectorInputName[:(filledinvectorInputName-1)]), nil +} + +// GetOutputNormalizedGradient retrieves the normalized gradient output. +func (inst FunctionGradientNode) GetOutputNormalizedGradient() (ImplicitPort, error) { + var normalizedGradient ref + ret := C.CCall_lib3mf_functiongradientnode_getoutputnormalizedgradient(inst.wrapperRef.LibraryHandle, inst.Ref, &normalizedGradient) + if ret != 0 { + return ImplicitPort{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewImplicitPort(normalizedGradient), nil +} + +// GetOutputGradient retrieves the raw gradient output. +func (inst FunctionGradientNode) GetOutputGradient() (ImplicitPort, error) { + var gradient ref + ret := C.CCall_lib3mf_functiongradientnode_getoutputgradient(inst.wrapperRef.LibraryHandle, inst.Ref, &gradient) + if ret != 0 { + return ImplicitPort{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewImplicitPort(gradient), nil +} + +// GetOutputMagnitude retrieves the gradient magnitude output. +func (inst FunctionGradientNode) GetOutputMagnitude() (ImplicitPort, error) { + var magnitude ref + ret := C.CCall_lib3mf_functiongradientnode_getoutputmagnitude(inst.wrapperRef.LibraryHandle, inst.Ref, &magnitude) + if ret != 0 { + return ImplicitPort{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewImplicitPort(magnitude), nil +} + + +// NormalizeDistanceNode represents a Lib3MF class. +type NormalizeDistanceNode struct { + ImplicitNode +} + +func (wrapper Wrapper) NewNormalizeDistanceNode(r ref) NormalizeDistanceNode { + return NormalizeDistanceNode{wrapper.NewImplicitNode(r)} +} + +// GetInputFunctionID retrieves the input for the function id. +func (inst NormalizeDistanceNode) GetInputFunctionID() (ImplicitPort, error) { + var function ref + ret := C.CCall_lib3mf_normalizedistancenode_getinputfunctionid(inst.wrapperRef.LibraryHandle, inst.Ref, &function) + if ret != 0 { + return ImplicitPort{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewImplicitPort(function), nil +} + +// GetInputPos retrieves the input for the position. +func (inst NormalizeDistanceNode) GetInputPos() (ImplicitPort, error) { + var pos ref + ret := C.CCall_lib3mf_normalizedistancenode_getinputpos(inst.wrapperRef.LibraryHandle, inst.Ref, &pos) + if ret != 0 { + return ImplicitPort{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewImplicitPort(pos), nil +} + +// GetInputStep retrieves the input for the finite difference step. +func (inst NormalizeDistanceNode) GetInputStep() (ImplicitPort, error) { + var step ref + ret := C.CCall_lib3mf_normalizedistancenode_getinputstep(inst.wrapperRef.LibraryHandle, inst.Ref, &step) + if ret != 0 { + return ImplicitPort{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewImplicitPort(step), nil +} + +// SetScalarOutputName sets the name of the referenced scalar output. +func (inst NormalizeDistanceNode) SetScalarOutputName(scalarOutputName string) error { + ret := C.CCall_lib3mf_normalizedistancenode_setscalaroutputname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(scalarOutputName)[0]))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// GetScalarOutputName retrieves the name of the referenced scalar output. +func (inst NormalizeDistanceNode) GetScalarOutputName() (string, error) { + var neededforscalarOutputName C.uint32_t + var filledinscalarOutputName C.uint32_t + ret := C.CCall_lib3mf_normalizedistancenode_getscalaroutputname(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforscalarOutputName, nil) + if ret != 0 { + return "", makeError(uint32(ret)) + } + bufferSizescalarOutputName := neededforscalarOutputName + bufferscalarOutputName := make([]byte, bufferSizescalarOutputName) + ret = C.CCall_lib3mf_normalizedistancenode_getscalaroutputname(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizescalarOutputName, &filledinscalarOutputName, (*C.char)(unsafe.Pointer(&bufferscalarOutputName[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(bufferscalarOutputName[:(filledinscalarOutputName-1)]), nil +} + +// SetVectorInputName sets the name of the referenced vector input. +func (inst NormalizeDistanceNode) SetVectorInputName(vectorInputName string) error { + ret := C.CCall_lib3mf_normalizedistancenode_setvectorinputname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(vectorInputName)[0]))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// GetVectorInputName retrieves the name of the referenced vector input. +func (inst NormalizeDistanceNode) GetVectorInputName() (string, error) { + var neededforvectorInputName C.uint32_t + var filledinvectorInputName C.uint32_t + ret := C.CCall_lib3mf_normalizedistancenode_getvectorinputname(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforvectorInputName, nil) + if ret != 0 { + return "", makeError(uint32(ret)) + } + bufferSizevectorInputName := neededforvectorInputName + buffervectorInputName := make([]byte, bufferSizevectorInputName) + ret = C.CCall_lib3mf_normalizedistancenode_getvectorinputname(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizevectorInputName, &filledinvectorInputName, (*C.char)(unsafe.Pointer(&buffervectorInputName[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(buffervectorInputName[:(filledinvectorInputName-1)]), nil +} + +// GetOutputResult retrieves the normalized result output. +func (inst NormalizeDistanceNode) GetOutputResult() (ImplicitPort, error) { + var result ref + ret := C.CCall_lib3mf_normalizedistancenode_getoutputresult(inst.wrapperRef.LibraryHandle, inst.Ref, &result) + if ret != 0 { + return ImplicitPort{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewImplicitPort(result), nil +} + + // FunctionCallNode represents a Lib3MF class. type FunctionCallNode struct { ImplicitNode @@ -6396,6 +6867,36 @@ func (inst ImplicitFunction) AddUnsignedMeshNode(identifier string, displayName return inst.wrapperRef.NewUnsignedMeshNode(node), nil } +// AddBeamLatticeNode add a BeamLatticeNode. +func (inst ImplicitFunction) AddBeamLatticeNode(identifier string, displayName string, tag string) (BeamLatticeNode, error) { + var node ref + ret := C.CCall_lib3mf_implicitfunction_addbeamlatticenode(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(identifier)[0])), (*C.char)(unsafe.Pointer(&[]byte(displayName)[0])), (*C.char)(unsafe.Pointer(&[]byte(tag)[0])), &node) + if ret != 0 { + return BeamLatticeNode{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewBeamLatticeNode(node), nil +} + +// AddFunctionGradientNode add a FunctionGradientNode. +func (inst ImplicitFunction) AddFunctionGradientNode(identifier string, displayName string, tag string) (FunctionGradientNode, error) { + var node ref + ret := C.CCall_lib3mf_implicitfunction_addfunctiongradientnode(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(identifier)[0])), (*C.char)(unsafe.Pointer(&[]byte(displayName)[0])), (*C.char)(unsafe.Pointer(&[]byte(tag)[0])), &node) + if ret != 0 { + return FunctionGradientNode{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewFunctionGradientNode(node), nil +} + +// AddNormalizeDistanceNode add a NormalizeDistanceNode. +func (inst ImplicitFunction) AddNormalizeDistanceNode(identifier string, displayName string, tag string) (NormalizeDistanceNode, error) { + var node ref + ret := C.CCall_lib3mf_implicitfunction_addnormalizedistancenode(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(identifier)[0])), (*C.char)(unsafe.Pointer(&[]byte(displayName)[0])), (*C.char)(unsafe.Pointer(&[]byte(tag)[0])), &node) + if ret != 0 { + return NormalizeDistanceNode{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewNormalizeDistanceNode(node), nil +} + // AddFunctionCallNode add a FunctionCallNode. func (inst ImplicitFunction) AddFunctionCallNode(identifier string, displayName string, tag string) (FunctionCallNode, error) { var node ref @@ -7723,6 +8224,16 @@ func (inst Model) GetComponentsObjectByID(uniqueResourceID uint32) (ComponentsOb return inst.wrapperRef.NewComponentsObject(componentsObjectInstance), nil } +// GetBooleanObjectByID finds a boolean object by its UniqueResourceID. +func (inst Model) GetBooleanObjectByID(uniqueResourceID uint32) (BooleanObject, error) { + var booleanObjectInstance ref + ret := C.CCall_lib3mf_model_getbooleanobjectbyid(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(uniqueResourceID), &booleanObjectInstance) + if ret != 0 { + return BooleanObject{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewBooleanObject(booleanObjectInstance), nil +} + // GetColorGroupByID finds a model color group by its UniqueResourceID. func (inst Model) GetColorGroupByID(uniqueResourceID uint32) (ColorGroup, error) { var colorGroupInstance ref @@ -7840,6 +8351,16 @@ func (inst Model) GetComponentsObjects() (ComponentsObjectIterator, error) { return inst.wrapperRef.NewComponentsObjectIterator(resourceIterator), nil } +// GetBooleanObjects creates a resource iterator instance with all boolean object resources. +func (inst Model) GetBooleanObjects() (BooleanObjectIterator, error) { + var resourceIterator ref + ret := C.CCall_lib3mf_model_getbooleanobjects(inst.wrapperRef.LibraryHandle, inst.Ref, &resourceIterator) + if ret != 0 { + return BooleanObjectIterator{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewBooleanObjectIterator(resourceIterator), nil +} + // GetTexture2Ds creates a Texture2DIterator instance with all texture2d resources. func (inst Model) GetTexture2Ds() (Texture2DIterator, error) { var resourceIterator ref @@ -7959,6 +8480,16 @@ func (inst Model) AddComponentsObject() (ComponentsObject, error) { return inst.wrapperRef.NewComponentsObject(componentsObjectInstance), nil } +// AddBooleanObject adds an empty boolean object to the model. +func (inst Model) AddBooleanObject() (BooleanObject, error) { + var booleanObjectInstance ref + ret := C.CCall_lib3mf_model_addbooleanobject(inst.wrapperRef.LibraryHandle, inst.Ref, &booleanObjectInstance) + if ret != 0 { + return BooleanObject{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewBooleanObject(booleanObjectInstance), nil +} + // AddSliceStack creates a new model slicestack by its id. func (inst Model) AddSliceStack(zBottom float64) (SliceStack, error) { var sliceStackInstance ref @@ -8517,7 +9048,7 @@ func (wrapper Wrapper) releaseC(r *ref) error { func (wrapper Wrapper) CheckBinaryVersion() error { var nBindingMajor uint32 = 2; - var nBindingMinor uint32 = 4; + var nBindingMinor uint32 = 6; nMajor, nMinor, _, err := wrapper.GetLibraryVersion() if err != nil { return err; diff --git a/Autogenerated/Bindings/Go/lib3mf_dynamic.c b/Autogenerated/Bindings/Go/lib3mf_dynamic.c index a70355820..57be86800 100644 --- a/Autogenerated/Bindings/Go/lib3mf_dynamic.c +++ b/Autogenerated/Bindings/Go/lib3mf_dynamic.c @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated plain C Header file in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -90,6 +90,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_ObjectIterator_GetCurrentObject = NULL; pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = NULL; pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = NULL; + pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject = NULL; pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = NULL; pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = NULL; pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = NULL; @@ -138,6 +139,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Object_IsMeshObject = NULL; pWrapperTable->m_Object_IsComponentsObject = NULL; pWrapperTable->m_Object_IsLevelSetObject = NULL; + pWrapperTable->m_Object_IsBooleanObject = NULL; pWrapperTable->m_Object_IsValid = NULL; pWrapperTable->m_Object_SetAttachmentAsThumbnail = NULL; pWrapperTable->m_Object_GetThumbnailAttachment = NULL; @@ -195,6 +197,20 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_LevelSet_GetMesh = NULL; pWrapperTable->m_LevelSet_GetVolumeData = NULL; pWrapperTable->m_LevelSet_SetVolumeData = NULL; + pWrapperTable->m_BooleanObject_SetBaseObject = NULL; + pWrapperTable->m_BooleanObject_GetBaseObject = NULL; + pWrapperTable->m_BooleanObject_SetBaseTransform = NULL; + pWrapperTable->m_BooleanObject_GetBaseTransform = NULL; + pWrapperTable->m_BooleanObject_SetOperation = NULL; + pWrapperTable->m_BooleanObject_GetOperation = NULL; + pWrapperTable->m_BooleanObject_SetCSGModeEnabled = NULL; + pWrapperTable->m_BooleanObject_GetCSGModeEnabled = NULL; + pWrapperTable->m_BooleanObject_SetExtractionGridResolution = NULL; + pWrapperTable->m_BooleanObject_GetExtractionGridResolution = NULL; + pWrapperTable->m_BooleanObject_GetOperandCount = NULL; + pWrapperTable->m_BooleanObject_AddOperand = NULL; + pWrapperTable->m_BooleanObject_GetOperand = NULL; + pWrapperTable->m_BooleanObject_MergeToMeshObject = NULL; pWrapperTable->m_BeamLattice_GetMinLength = NULL; pWrapperTable->m_BeamLattice_SetMinLength = NULL; pWrapperTable->m_BeamLattice_GetClipping = NULL; @@ -422,6 +438,29 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_UnsignedMeshNode_GetInputMesh = NULL; pWrapperTable->m_UnsignedMeshNode_GetInputPos = NULL; pWrapperTable->m_UnsignedMeshNode_GetOutputDistance = NULL; + pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice = NULL; + pWrapperTable->m_BeamLatticeNode_GetInputPos = NULL; + pWrapperTable->m_BeamLatticeNode_GetOutputDistance = NULL; + pWrapperTable->m_BeamLatticeNode_SetAccurateRange = NULL; + pWrapperTable->m_BeamLatticeNode_GetAccurateRange = NULL; + pWrapperTable->m_FunctionGradientNode_GetInputFunctionID = NULL; + pWrapperTable->m_FunctionGradientNode_GetInputPos = NULL; + pWrapperTable->m_FunctionGradientNode_GetInputStep = NULL; + pWrapperTable->m_FunctionGradientNode_SetScalarOutputName = NULL; + pWrapperTable->m_FunctionGradientNode_GetScalarOutputName = NULL; + pWrapperTable->m_FunctionGradientNode_SetVectorInputName = NULL; + pWrapperTable->m_FunctionGradientNode_GetVectorInputName = NULL; + pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient = NULL; + pWrapperTable->m_FunctionGradientNode_GetOutputGradient = NULL; + pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetInputPos = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetInputStep = NULL; + pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName = NULL; + pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetOutputResult = NULL; pWrapperTable->m_FunctionCallNode_GetInputFunctionID = NULL; pWrapperTable->m_NodeIterator_GetCurrent = NULL; pWrapperTable->m_Function_GetDisplayName = NULL; @@ -485,6 +524,9 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_ImplicitFunction_AddConstMatNode = NULL; pWrapperTable->m_ImplicitFunction_AddMeshNode = NULL; pWrapperTable->m_ImplicitFunction_AddUnsignedMeshNode = NULL; + pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode = NULL; + pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode = NULL; + pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode = NULL; pWrapperTable->m_ImplicitFunction_AddFunctionCallNode = NULL; pWrapperTable->m_ImplicitFunction_GetNodes = NULL; pWrapperTable->m_ImplicitFunction_RemoveNode = NULL; @@ -594,6 +636,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_GetMultiPropertyGroupByID = NULL; pWrapperTable->m_Model_GetMeshObjectByID = NULL; pWrapperTable->m_Model_GetComponentsObjectByID = NULL; + pWrapperTable->m_Model_GetBooleanObjectByID = NULL; pWrapperTable->m_Model_GetColorGroupByID = NULL; pWrapperTable->m_Model_GetSliceStackByID = NULL; pWrapperTable->m_Model_GetLevelSetByID = NULL; @@ -605,6 +648,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_GetObjects = NULL; pWrapperTable->m_Model_GetMeshObjects = NULL; pWrapperTable->m_Model_GetComponentsObjects = NULL; + pWrapperTable->m_Model_GetBooleanObjects = NULL; pWrapperTable->m_Model_GetTexture2Ds = NULL; pWrapperTable->m_Model_GetBaseMaterialGroups = NULL; pWrapperTable->m_Model_GetColorGroups = NULL; @@ -617,6 +661,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_MergeFromModel = NULL; pWrapperTable->m_Model_AddMeshObject = NULL; pWrapperTable->m_Model_AddComponentsObject = NULL; + pWrapperTable->m_Model_AddBooleanObject = NULL; pWrapperTable->m_Model_AddSliceStack = NULL; pWrapperTable->m_Model_AddTexture2DFromAttachment = NULL; pWrapperTable->m_Model_AddBaseMaterialGroup = NULL; @@ -1100,6 +1145,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject = (PLib3MFBooleanObjectIterator_GetCurrentBooleanObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobjectiterator_getcurrentbooleanobject"); + #else // _WIN32 + pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject = (PLib3MFBooleanObjectIterator_GetCurrentBooleanObjectPtr) dlsym(hLibrary, "lib3mf_booleanobjectiterator_getcurrentbooleanobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); #else // _WIN32 @@ -1532,6 +1586,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Object_IsLevelSetObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Object_IsBooleanObject = (PLib3MFObject_IsBooleanObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_isbooleanobject"); + #else // _WIN32 + pWrapperTable->m_Object_IsBooleanObject = (PLib3MFObject_IsBooleanObjectPtr) dlsym(hLibrary, "lib3mf_object_isbooleanobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_IsBooleanObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) GetProcAddress(hLibrary, "lib3mf_object_isvalid"); #else // _WIN32 @@ -2045,6 +2108,132 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_LevelSet_SetVolumeData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetBaseObject = (PLib3MFBooleanObject_SetBaseObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setbaseobject"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetBaseObject = (PLib3MFBooleanObject_SetBaseObjectPtr) dlsym(hLibrary, "lib3mf_booleanobject_setbaseobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetBaseObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetBaseObject = (PLib3MFBooleanObject_GetBaseObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getbaseobject"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetBaseObject = (PLib3MFBooleanObject_GetBaseObjectPtr) dlsym(hLibrary, "lib3mf_booleanobject_getbaseobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetBaseObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetBaseTransform = (PLib3MFBooleanObject_SetBaseTransformPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setbasetransform"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetBaseTransform = (PLib3MFBooleanObject_SetBaseTransformPtr) dlsym(hLibrary, "lib3mf_booleanobject_setbasetransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetBaseTransform == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetBaseTransform = (PLib3MFBooleanObject_GetBaseTransformPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getbasetransform"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetBaseTransform = (PLib3MFBooleanObject_GetBaseTransformPtr) dlsym(hLibrary, "lib3mf_booleanobject_getbasetransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetBaseTransform == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetOperation = (PLib3MFBooleanObject_SetOperationPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setoperation"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetOperation = (PLib3MFBooleanObject_SetOperationPtr) dlsym(hLibrary, "lib3mf_booleanobject_setoperation"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetOperation == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetOperation = (PLib3MFBooleanObject_GetOperationPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getoperation"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetOperation = (PLib3MFBooleanObject_GetOperationPtr) dlsym(hLibrary, "lib3mf_booleanobject_getoperation"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetOperation == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetCSGModeEnabled = (PLib3MFBooleanObject_SetCSGModeEnabledPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setcsgmodeenabled"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetCSGModeEnabled = (PLib3MFBooleanObject_SetCSGModeEnabledPtr) dlsym(hLibrary, "lib3mf_booleanobject_setcsgmodeenabled"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetCSGModeEnabled == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetCSGModeEnabled = (PLib3MFBooleanObject_GetCSGModeEnabledPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getcsgmodeenabled"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetCSGModeEnabled = (PLib3MFBooleanObject_GetCSGModeEnabledPtr) dlsym(hLibrary, "lib3mf_booleanobject_getcsgmodeenabled"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetCSGModeEnabled == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetExtractionGridResolution = (PLib3MFBooleanObject_SetExtractionGridResolutionPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setextractiongridresolution"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetExtractionGridResolution = (PLib3MFBooleanObject_SetExtractionGridResolutionPtr) dlsym(hLibrary, "lib3mf_booleanobject_setextractiongridresolution"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetExtractionGridResolution == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetExtractionGridResolution = (PLib3MFBooleanObject_GetExtractionGridResolutionPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getextractiongridresolution"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetExtractionGridResolution = (PLib3MFBooleanObject_GetExtractionGridResolutionPtr) dlsym(hLibrary, "lib3mf_booleanobject_getextractiongridresolution"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetExtractionGridResolution == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetOperandCount = (PLib3MFBooleanObject_GetOperandCountPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getoperandcount"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetOperandCount = (PLib3MFBooleanObject_GetOperandCountPtr) dlsym(hLibrary, "lib3mf_booleanobject_getoperandcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetOperandCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_AddOperand = (PLib3MFBooleanObject_AddOperandPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_addoperand"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_AddOperand = (PLib3MFBooleanObject_AddOperandPtr) dlsym(hLibrary, "lib3mf_booleanobject_addoperand"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_AddOperand == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetOperand = (PLib3MFBooleanObject_GetOperandPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getoperand"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetOperand = (PLib3MFBooleanObject_GetOperandPtr) dlsym(hLibrary, "lib3mf_booleanobject_getoperand"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetOperand == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_MergeToMeshObject = (PLib3MFBooleanObject_MergeToMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_mergetomeshobject"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_MergeToMeshObject = (PLib3MFBooleanObject_MergeToMeshObjectPtr) dlsym(hLibrary, "lib3mf_booleanobject_mergetomeshobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_MergeToMeshObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getminlength"); #else // _WIN32 @@ -4088,6 +4277,213 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_UnsignedMeshNode_GetOutputDistance == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice = (PLib3MFBeamLatticeNode_GetInputBeamLatticePtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_getinputbeamlattice"); + #else // _WIN32 + pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice = (PLib3MFBeamLatticeNode_GetInputBeamLatticePtr) dlsym(hLibrary, "lib3mf_beamlatticenode_getinputbeamlattice"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLatticeNode_GetInputPos = (PLib3MFBeamLatticeNode_GetInputPosPtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_getinputpos"); + #else // _WIN32 + pWrapperTable->m_BeamLatticeNode_GetInputPos = (PLib3MFBeamLatticeNode_GetInputPosPtr) dlsym(hLibrary, "lib3mf_beamlatticenode_getinputpos"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLatticeNode_GetInputPos == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLatticeNode_GetOutputDistance = (PLib3MFBeamLatticeNode_GetOutputDistancePtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_getoutputdistance"); + #else // _WIN32 + pWrapperTable->m_BeamLatticeNode_GetOutputDistance = (PLib3MFBeamLatticeNode_GetOutputDistancePtr) dlsym(hLibrary, "lib3mf_beamlatticenode_getoutputdistance"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLatticeNode_GetOutputDistance == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLatticeNode_SetAccurateRange = (PLib3MFBeamLatticeNode_SetAccurateRangePtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_setaccuraterange"); + #else // _WIN32 + pWrapperTable->m_BeamLatticeNode_SetAccurateRange = (PLib3MFBeamLatticeNode_SetAccurateRangePtr) dlsym(hLibrary, "lib3mf_beamlatticenode_setaccuraterange"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLatticeNode_SetAccurateRange == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLatticeNode_GetAccurateRange = (PLib3MFBeamLatticeNode_GetAccurateRangePtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_getaccuraterange"); + #else // _WIN32 + pWrapperTable->m_BeamLatticeNode_GetAccurateRange = (PLib3MFBeamLatticeNode_GetAccurateRangePtr) dlsym(hLibrary, "lib3mf_beamlatticenode_getaccuraterange"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLatticeNode_GetAccurateRange == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputFunctionID = (PLib3MFFunctionGradientNode_GetInputFunctionIDPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getinputfunctionid"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputFunctionID = (PLib3MFFunctionGradientNode_GetInputFunctionIDPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getinputfunctionid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetInputFunctionID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputPos = (PLib3MFFunctionGradientNode_GetInputPosPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getinputpos"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputPos = (PLib3MFFunctionGradientNode_GetInputPosPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getinputpos"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetInputPos == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputStep = (PLib3MFFunctionGradientNode_GetInputStepPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getinputstep"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputStep = (PLib3MFFunctionGradientNode_GetInputStepPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getinputstep"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetInputStep == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_SetScalarOutputName = (PLib3MFFunctionGradientNode_SetScalarOutputNamePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_setscalaroutputname"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_SetScalarOutputName = (PLib3MFFunctionGradientNode_SetScalarOutputNamePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_setscalaroutputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_SetScalarOutputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetScalarOutputName = (PLib3MFFunctionGradientNode_GetScalarOutputNamePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getscalaroutputname"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetScalarOutputName = (PLib3MFFunctionGradientNode_GetScalarOutputNamePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getscalaroutputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetScalarOutputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_SetVectorInputName = (PLib3MFFunctionGradientNode_SetVectorInputNamePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_setvectorinputname"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_SetVectorInputName = (PLib3MFFunctionGradientNode_SetVectorInputNamePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_setvectorinputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_SetVectorInputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetVectorInputName = (PLib3MFFunctionGradientNode_GetVectorInputNamePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getvectorinputname"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetVectorInputName = (PLib3MFFunctionGradientNode_GetVectorInputNamePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getvectorinputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetVectorInputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient = (PLib3MFFunctionGradientNode_GetOutputNormalizedGradientPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getoutputnormalizedgradient"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient = (PLib3MFFunctionGradientNode_GetOutputNormalizedGradientPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getoutputnormalizedgradient"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputGradient = (PLib3MFFunctionGradientNode_GetOutputGradientPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getoutputgradient"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputGradient = (PLib3MFFunctionGradientNode_GetOutputGradientPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getoutputgradient"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetOutputGradient == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude = (PLib3MFFunctionGradientNode_GetOutputMagnitudePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getoutputmagnitude"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude = (PLib3MFFunctionGradientNode_GetOutputMagnitudePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getoutputmagnitude"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID = (PLib3MFNormalizeDistanceNode_GetInputFunctionIDPtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getinputfunctionid"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID = (PLib3MFNormalizeDistanceNode_GetInputFunctionIDPtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getinputfunctionid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputPos = (PLib3MFNormalizeDistanceNode_GetInputPosPtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getinputpos"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputPos = (PLib3MFNormalizeDistanceNode_GetInputPosPtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getinputpos"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetInputPos == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputStep = (PLib3MFNormalizeDistanceNode_GetInputStepPtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getinputstep"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputStep = (PLib3MFNormalizeDistanceNode_GetInputStepPtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getinputstep"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetInputStep == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName = (PLib3MFNormalizeDistanceNode_SetScalarOutputNamePtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_setscalaroutputname"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName = (PLib3MFNormalizeDistanceNode_SetScalarOutputNamePtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_setscalaroutputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName = (PLib3MFNormalizeDistanceNode_GetScalarOutputNamePtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getscalaroutputname"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName = (PLib3MFNormalizeDistanceNode_GetScalarOutputNamePtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getscalaroutputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName = (PLib3MFNormalizeDistanceNode_SetVectorInputNamePtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_setvectorinputname"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName = (PLib3MFNormalizeDistanceNode_SetVectorInputNamePtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_setvectorinputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName = (PLib3MFNormalizeDistanceNode_GetVectorInputNamePtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getvectorinputname"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName = (PLib3MFNormalizeDistanceNode_GetVectorInputNamePtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getvectorinputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetOutputResult = (PLib3MFNormalizeDistanceNode_GetOutputResultPtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getoutputresult"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetOutputResult = (PLib3MFNormalizeDistanceNode_GetOutputResultPtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getoutputresult"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetOutputResult == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_FunctionCallNode_GetInputFunctionID = (PLib3MFFunctionCallNode_GetInputFunctionIDPtr) GetProcAddress(hLibrary, "lib3mf_functioncallnode_getinputfunctionid"); #else // _WIN32 @@ -4655,6 +5051,33 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_ImplicitFunction_AddUnsignedMeshNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode = (PLib3MFImplicitFunction_AddBeamLatticeNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addbeamlatticenode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode = (PLib3MFImplicitFunction_AddBeamLatticeNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addbeamlatticenode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode = (PLib3MFImplicitFunction_AddFunctionGradientNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addfunctiongradientnode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode = (PLib3MFImplicitFunction_AddFunctionGradientNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addfunctiongradientnode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode = (PLib3MFImplicitFunction_AddNormalizeDistanceNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addnormalizedistancenode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode = (PLib3MFImplicitFunction_AddNormalizeDistanceNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addnormalizedistancenode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_ImplicitFunction_AddFunctionCallNode = (PLib3MFImplicitFunction_AddFunctionCallNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addfunctioncallnode"); #else // _WIN32 @@ -5637,16 +6060,25 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetColorGroupByID = (PLib3MFModel_GetColorGroupByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getcolorgroupbyid"); + pWrapperTable->m_Model_GetBooleanObjectByID = (PLib3MFModel_GetBooleanObjectByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getbooleanobjectbyid"); #else // _WIN32 - pWrapperTable->m_Model_GetColorGroupByID = (PLib3MFModel_GetColorGroupByIDPtr) dlsym(hLibrary, "lib3mf_model_getcolorgroupbyid"); + pWrapperTable->m_Model_GetBooleanObjectByID = (PLib3MFModel_GetBooleanObjectByIDPtr) dlsym(hLibrary, "lib3mf_model_getbooleanobjectbyid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetColorGroupByID == NULL) + if (pWrapperTable->m_Model_GetBooleanObjectByID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetSliceStackByID = (PLib3MFModel_GetSliceStackByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getslicestackbyid"); + pWrapperTable->m_Model_GetColorGroupByID = (PLib3MFModel_GetColorGroupByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getcolorgroupbyid"); + #else // _WIN32 + pWrapperTable->m_Model_GetColorGroupByID = (PLib3MFModel_GetColorGroupByIDPtr) dlsym(hLibrary, "lib3mf_model_getcolorgroupbyid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetColorGroupByID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Model_GetSliceStackByID = (PLib3MFModel_GetSliceStackByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getslicestackbyid"); #else // _WIN32 pWrapperTable->m_Model_GetSliceStackByID = (PLib3MFModel_GetSliceStackByIDPtr) dlsym(hLibrary, "lib3mf_model_getslicestackbyid"); dlerror(); @@ -5735,6 +6167,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Model_GetComponentsObjects == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_GetBooleanObjects = (PLib3MFModel_GetBooleanObjectsPtr) GetProcAddress(hLibrary, "lib3mf_model_getbooleanobjects"); + #else // _WIN32 + pWrapperTable->m_Model_GetBooleanObjects = (PLib3MFModel_GetBooleanObjectsPtr) dlsym(hLibrary, "lib3mf_model_getbooleanobjects"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetBooleanObjects == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Model_GetTexture2Ds = (PLib3MFModel_GetTexture2DsPtr) GetProcAddress(hLibrary, "lib3mf_model_gettexture2ds"); #else // _WIN32 @@ -5843,6 +6284,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Model_AddComponentsObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_AddBooleanObject = (PLib3MFModel_AddBooleanObjectPtr) GetProcAddress(hLibrary, "lib3mf_model_addbooleanobject"); + #else // _WIN32 + pWrapperTable->m_Model_AddBooleanObject = (PLib3MFModel_AddBooleanObjectPtr) dlsym(hLibrary, "lib3mf_model_addbooleanobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddBooleanObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Model_AddSliceStack = (PLib3MFModel_AddSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_model_addslicestack"); #else // _WIN32 @@ -6715,6 +7165,15 @@ Lib3MFResult CCall_lib3mf_componentsobjectiterator_getcurrentcomponentsobject(Li } +Lib3MFResult CCall_lib3mf_booleanobjectiterator_getcurrentbooleanobject(Lib3MFHandle libraryHandle, Lib3MF_BooleanObjectIterator pBooleanObjectIterator, Lib3MF_BooleanObject * pResource) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject (pBooleanObjectIterator, pResource); +} + + Lib3MFResult CCall_lib3mf_texture2diterator_getcurrenttexture2d(Lib3MFHandle libraryHandle, Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource) { if (libraryHandle == 0) @@ -7147,6 +7606,15 @@ Lib3MFResult CCall_lib3mf_object_islevelsetobject(Lib3MFHandle libraryHandle, Li } +Lib3MFResult CCall_lib3mf_object_isbooleanobject(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, bool * pIsBooleanObject) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Object_IsBooleanObject (pObject, pIsBooleanObject); +} + + Lib3MFResult CCall_lib3mf_object_isvalid(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, bool * pIsValid) { if (libraryHandle == 0) @@ -7660,6 +8128,132 @@ Lib3MFResult CCall_lib3mf_levelset_setvolumedata(Lib3MFHandle libraryHandle, Lib } +Lib3MFResult CCall_lib3mf_booleanobject_setbaseobject(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object pBaseObject, const sLib3MFTransform * pTransform) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BooleanObject_SetBaseObject (pBooleanObject, pBaseObject, pTransform); +} + + +Lib3MFResult CCall_lib3mf_booleanobject_getbaseobject(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object * pBaseObject) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BooleanObject_GetBaseObject (pBooleanObject, pBaseObject); +} + + +Lib3MFResult CCall_lib3mf_booleanobject_setbasetransform(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, const sLib3MFTransform * pTransform) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BooleanObject_SetBaseTransform (pBooleanObject, pTransform); +} + + +Lib3MFResult CCall_lib3mf_booleanobject_getbasetransform(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, sLib3MFTransform * pTransform) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BooleanObject_GetBaseTransform (pBooleanObject, pTransform); +} + + +Lib3MFResult CCall_lib3mf_booleanobject_setoperation(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, eLib3MFBooleanOperation eOperation) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BooleanObject_SetOperation (pBooleanObject, eOperation); +} + + +Lib3MFResult CCall_lib3mf_booleanobject_getoperation(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, eLib3MFBooleanOperation * pOperation) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BooleanObject_GetOperation (pBooleanObject, pOperation); +} + + +Lib3MFResult CCall_lib3mf_booleanobject_setcsgmodeenabled(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, bool bCSGModeEnabled) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BooleanObject_SetCSGModeEnabled (pBooleanObject, bCSGModeEnabled); +} + + +Lib3MFResult CCall_lib3mf_booleanobject_getcsgmodeenabled(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, bool * pCSGModeEnabled) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BooleanObject_GetCSGModeEnabled (pBooleanObject, pCSGModeEnabled); +} + + +Lib3MFResult CCall_lib3mf_booleanobject_setextractiongridresolution(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nGridResolution) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BooleanObject_SetExtractionGridResolution (pBooleanObject, nGridResolution); +} + + +Lib3MFResult CCall_lib3mf_booleanobject_getextractiongridresolution(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pGridResolution) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BooleanObject_GetExtractionGridResolution (pBooleanObject, pGridResolution); +} + + +Lib3MFResult CCall_lib3mf_booleanobject_getoperandcount(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pCount) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BooleanObject_GetOperandCount (pBooleanObject, pCount); +} + + +Lib3MFResult CCall_lib3mf_booleanobject_addoperand(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject pOperandObject, const sLib3MFTransform * pTransform) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BooleanObject_AddOperand (pBooleanObject, pOperandObject, pTransform); +} + + +Lib3MFResult CCall_lib3mf_booleanobject_getoperand(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nIndex, Lib3MF_MeshObject * pOperandObject, sLib3MFTransform * pTransform) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BooleanObject_GetOperand (pBooleanObject, nIndex, pOperandObject, pTransform); +} + + +Lib3MFResult CCall_lib3mf_booleanobject_mergetomeshobject(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject * pMeshObject) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BooleanObject_MergeToMeshObject (pBooleanObject, pMeshObject); +} + + Lib3MFResult CCall_lib3mf_beamlattice_getminlength(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength) { if (libraryHandle == 0) @@ -9703,6 +10297,213 @@ Lib3MFResult CCall_lib3mf_unsignedmeshnode_getoutputdistance(Lib3MFHandle librar } +Lib3MFResult CCall_lib3mf_beamlatticenode_getinputbeamlattice(Lib3MFHandle libraryHandle, Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pBeamLattice) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BeamLatticeNode_GetInputBeamLattice (pBeamLatticeNode, pBeamLattice); +} + + +Lib3MFResult CCall_lib3mf_beamlatticenode_getinputpos(Lib3MFHandle libraryHandle, Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pPos) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BeamLatticeNode_GetInputPos (pBeamLatticeNode, pPos); +} + + +Lib3MFResult CCall_lib3mf_beamlatticenode_getoutputdistance(Lib3MFHandle libraryHandle, Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pDistance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BeamLatticeNode_GetOutputDistance (pBeamLatticeNode, pDistance); +} + + +Lib3MFResult CCall_lib3mf_beamlatticenode_setaccuraterange(Lib3MFHandle libraryHandle, Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double dAccurateRange) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BeamLatticeNode_SetAccurateRange (pBeamLatticeNode, dAccurateRange); +} + + +Lib3MFResult CCall_lib3mf_beamlatticenode_getaccuraterange(Lib3MFHandle libraryHandle, Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double * pAccurateRange) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BeamLatticeNode_GetAccurateRange (pBeamLatticeNode, pAccurateRange); +} + + +Lib3MFResult CCall_lib3mf_functiongradientnode_getinputfunctionid(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pFunction) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_FunctionGradientNode_GetInputFunctionID (pFunctionGradientNode, pFunction); +} + + +Lib3MFResult CCall_lib3mf_functiongradientnode_getinputpos(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pPos) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_FunctionGradientNode_GetInputPos (pFunctionGradientNode, pPos); +} + + +Lib3MFResult CCall_lib3mf_functiongradientnode_getinputstep(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pStep) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_FunctionGradientNode_GetInputStep (pFunctionGradientNode, pStep); +} + + +Lib3MFResult CCall_lib3mf_functiongradientnode_setscalaroutputname(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pScalarOutputName) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_FunctionGradientNode_SetScalarOutputName (pFunctionGradientNode, pScalarOutputName); +} + + +Lib3MFResult CCall_lib3mf_functiongradientnode_getscalaroutputname(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_FunctionGradientNode_GetScalarOutputName (pFunctionGradientNode, nScalarOutputNameBufferSize, pScalarOutputNameNeededChars, pScalarOutputNameBuffer); +} + + +Lib3MFResult CCall_lib3mf_functiongradientnode_setvectorinputname(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pVectorInputName) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_FunctionGradientNode_SetVectorInputName (pFunctionGradientNode, pVectorInputName); +} + + +Lib3MFResult CCall_lib3mf_functiongradientnode_getvectorinputname(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_FunctionGradientNode_GetVectorInputName (pFunctionGradientNode, nVectorInputNameBufferSize, pVectorInputNameNeededChars, pVectorInputNameBuffer); +} + + +Lib3MFResult CCall_lib3mf_functiongradientnode_getoutputnormalizedgradient(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pNormalizedGradient) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient (pFunctionGradientNode, pNormalizedGradient); +} + + +Lib3MFResult CCall_lib3mf_functiongradientnode_getoutputgradient(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pGradient) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_FunctionGradientNode_GetOutputGradient (pFunctionGradientNode, pGradient); +} + + +Lib3MFResult CCall_lib3mf_functiongradientnode_getoutputmagnitude(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pMagnitude) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_FunctionGradientNode_GetOutputMagnitude (pFunctionGradientNode, pMagnitude); +} + + +Lib3MFResult CCall_lib3mf_normalizedistancenode_getinputfunctionid(Lib3MFHandle libraryHandle, Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pFunction) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_NormalizeDistanceNode_GetInputFunctionID (pNormalizeDistanceNode, pFunction); +} + + +Lib3MFResult CCall_lib3mf_normalizedistancenode_getinputpos(Lib3MFHandle libraryHandle, Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pPos) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_NormalizeDistanceNode_GetInputPos (pNormalizeDistanceNode, pPos); +} + + +Lib3MFResult CCall_lib3mf_normalizedistancenode_getinputstep(Lib3MFHandle libraryHandle, Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pStep) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_NormalizeDistanceNode_GetInputStep (pNormalizeDistanceNode, pStep); +} + + +Lib3MFResult CCall_lib3mf_normalizedistancenode_setscalaroutputname(Lib3MFHandle libraryHandle, Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pScalarOutputName) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_NormalizeDistanceNode_SetScalarOutputName (pNormalizeDistanceNode, pScalarOutputName); +} + + +Lib3MFResult CCall_lib3mf_normalizedistancenode_getscalaroutputname(Lib3MFHandle libraryHandle, Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_NormalizeDistanceNode_GetScalarOutputName (pNormalizeDistanceNode, nScalarOutputNameBufferSize, pScalarOutputNameNeededChars, pScalarOutputNameBuffer); +} + + +Lib3MFResult CCall_lib3mf_normalizedistancenode_setvectorinputname(Lib3MFHandle libraryHandle, Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pVectorInputName) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_NormalizeDistanceNode_SetVectorInputName (pNormalizeDistanceNode, pVectorInputName); +} + + +Lib3MFResult CCall_lib3mf_normalizedistancenode_getvectorinputname(Lib3MFHandle libraryHandle, Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_NormalizeDistanceNode_GetVectorInputName (pNormalizeDistanceNode, nVectorInputNameBufferSize, pVectorInputNameNeededChars, pVectorInputNameBuffer); +} + + +Lib3MFResult CCall_lib3mf_normalizedistancenode_getoutputresult(Lib3MFHandle libraryHandle, Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pResult) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_NormalizeDistanceNode_GetOutputResult (pNormalizeDistanceNode, pResult); +} + + Lib3MFResult CCall_lib3mf_functioncallnode_getinputfunctionid(Lib3MFHandle libraryHandle, Lib3MF_FunctionCallNode pFunctionCallNode, Lib3MF_ImplicitPort * pFunction) { if (libraryHandle == 0) @@ -10270,6 +11071,33 @@ Lib3MFResult CCall_lib3mf_implicitfunction_addunsignedmeshnode(Lib3MFHandle libr } +Lib3MFResult CCall_lib3mf_implicitfunction_addbeamlatticenode(Lib3MFHandle libraryHandle, Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_BeamLatticeNode * pNode) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ImplicitFunction_AddBeamLatticeNode (pImplicitFunction, pIdentifier, pDisplayName, pTag, pNode); +} + + +Lib3MFResult CCall_lib3mf_implicitfunction_addfunctiongradientnode(Lib3MFHandle libraryHandle, Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_FunctionGradientNode * pNode) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ImplicitFunction_AddFunctionGradientNode (pImplicitFunction, pIdentifier, pDisplayName, pTag, pNode); +} + + +Lib3MFResult CCall_lib3mf_implicitfunction_addnormalizedistancenode(Lib3MFHandle libraryHandle, Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_NormalizeDistanceNode * pNode) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode (pImplicitFunction, pIdentifier, pDisplayName, pTag, pNode); +} + + Lib3MFResult CCall_lib3mf_implicitfunction_addfunctioncallnode(Lib3MFHandle libraryHandle, Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_FunctionCallNode * pNode) { if (libraryHandle == 0) @@ -11251,6 +12079,15 @@ Lib3MFResult CCall_lib3mf_model_getcomponentsobjectbyid(Lib3MFHandle libraryHand } +Lib3MFResult CCall_lib3mf_model_getbooleanobjectbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_BooleanObject * pBooleanObjectInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetBooleanObjectByID (pModel, nUniqueResourceID, pBooleanObjectInstance); +} + + Lib3MFResult CCall_lib3mf_model_getcolorgroupbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_ColorGroup * pColorGroupInstance) { if (libraryHandle == 0) @@ -11350,6 +12187,15 @@ Lib3MFResult CCall_lib3mf_model_getcomponentsobjects(Lib3MFHandle libraryHandle, } +Lib3MFResult CCall_lib3mf_model_getbooleanobjects(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_BooleanObjectIterator * pResourceIterator) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetBooleanObjects (pModel, pResourceIterator); +} + + Lib3MFResult CCall_lib3mf_model_gettexture2ds(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Texture2DIterator * pResourceIterator) { if (libraryHandle == 0) @@ -11458,6 +12304,15 @@ Lib3MFResult CCall_lib3mf_model_addcomponentsobject(Lib3MFHandle libraryHandle, } +Lib3MFResult CCall_lib3mf_model_addbooleanobject(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_BooleanObject * pBooleanObjectInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_AddBooleanObject (pModel, pBooleanObjectInstance); +} + + Lib3MFResult CCall_lib3mf_model_addslicestack(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_double dZBottom, Lib3MF_SliceStack * pSliceStackInstance) { if (libraryHandle == 0) diff --git a/Autogenerated/Bindings/Go/lib3mf_dynamic.h b/Autogenerated/Bindings/Go/lib3mf_dynamic.h index 0980d8d19..f0d950a6f 100644 --- a/Autogenerated/Bindings/Go/lib3mf_dynamic.h +++ b/Autogenerated/Bindings/Go/lib3mf_dynamic.h @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated plain C Header file in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -484,6 +484,19 @@ typedef Lib3MFResult (*PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) (Lib3M */ typedef Lib3MFResult (*PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) (Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); +/************************************************************************************************************************* + Class definition for BooleanObjectIterator +**************************************************************************************************************************/ + +/** +* Returns the BooleanObject the iterator points at. +* +* @param[in] pBooleanObjectIterator - BooleanObjectIterator instance. +* @param[out] pResource - returns the BooleanObject instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObjectIterator_GetCurrentBooleanObjectPtr) (Lib3MF_BooleanObjectIterator pBooleanObjectIterator, Lib3MF_BooleanObject * pResource); + /************************************************************************************************************************* Class definition for Texture2DIterator **************************************************************************************************************************/ @@ -998,6 +1011,15 @@ typedef Lib3MFResult (*PLib3MFObject_IsComponentsObjectPtr) (Lib3MF_Object pObje */ typedef Lib3MFResult (*PLib3MFObject_IsLevelSetObjectPtr) (Lib3MF_Object pObject, bool * pIsLevelSetObject); +/** +* Retrieves, if an object is a boolean object +* +* @param[in] pObject - Object instance. +* @param[out] pIsBooleanObject - returns, whether the object is a boolean object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_IsBooleanObjectPtr) (Lib3MF_Object pObject, bool * pIsBooleanObject); + /** * Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * @@ -1548,6 +1570,140 @@ typedef Lib3MFResult (*PLib3MFLevelSet_GetVolumeDataPtr) (Lib3MF_LevelSet pLevel */ typedef Lib3MFResult (*PLib3MFLevelSet_SetVolumeDataPtr) (Lib3MF_LevelSet pLevelSet, Lib3MF_VolumeData pTheVolumeData); +/************************************************************************************************************************* + Class definition for BooleanObject +**************************************************************************************************************************/ + +/** +* Sets the base object and transform for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pBaseObject - base object of the boolean shape +* @param[in] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetBaseObjectPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object pBaseObject, const sLib3MFTransform * pTransform); + +/** +* Returns the base object of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pBaseObject - base object of the boolean shape +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetBaseObjectPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object * pBaseObject); + +/** +* Sets the base transform of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetBaseTransformPtr) (Lib3MF_BooleanObject pBooleanObject, const sLib3MFTransform * pTransform); + +/** +* Returns the base transform of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetBaseTransformPtr) (Lib3MF_BooleanObject pBooleanObject, sLib3MFTransform * pTransform); + +/** +* Sets the boolean operation used for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] eOperation - boolean operation used for the shape +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetOperationPtr) (Lib3MF_BooleanObject pBooleanObject, eLib3MFBooleanOperation eOperation); + +/** +* Returns the boolean operation used for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pOperation - boolean operation used for the shape +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetOperationPtr) (Lib3MF_BooleanObject pBooleanObject, eLib3MFBooleanOperation * pOperation); + +/** +* Enables or disables CSG field evaluation for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] bCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetCSGModeEnabledPtr) (Lib3MF_BooleanObject pBooleanObject, bool bCSGModeEnabled); + +/** +* Returns whether CSG field evaluation is enabled for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetCSGModeEnabledPtr) (Lib3MF_BooleanObject pBooleanObject, bool * pCSGModeEnabled); + +/** +* Sets the extraction grid resolution used for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] nGridResolution - extraction grid resolution for boolean surface extraction +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetExtractionGridResolutionPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nGridResolution); + +/** +* Returns the extraction grid resolution used for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pGridResolution - extraction grid resolution for boolean surface extraction +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetExtractionGridResolutionPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pGridResolution); + +/** +* Returns the number of operands in the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pCount - number of operands in the boolean sequence +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetOperandCountPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pCount); + +/** +* Adds an operand object to the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pOperandObject - mesh object used as operand +* @param[in] pTransform - transform applied to the operand object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_AddOperandPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject pOperandObject, const sLib3MFTransform * pTransform); + +/** +* Returns one operand object and transform from the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] nIndex - index of the operand in the boolean sequence +* @param[out] pOperandObject - mesh object used as operand +* @param[out] pTransform - transform applied to the operand object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetOperandPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nIndex, Lib3MF_MeshObject * pOperandObject, sLib3MFTransform * pTransform); + +/** +* Materializes the boolean shape into a newly created mesh object. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pMeshObject - new mesh object containing the tessellated boolean shape +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_MergeToMeshObjectPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject * pMeshObject); + /************************************************************************************************************************* Class definition for BeamLattice **************************************************************************************************************************/ @@ -1913,7 +2069,7 @@ typedef Lib3MFResult (*PLib3MFVolumeDataComposite_SetBaseMaterialGroupPtr) (Lib3 typedef Lib3MFResult (*PLib3MFVolumeDataComposite_GetMaterialMappingCountPtr) (Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 * pCount); /** -* Returns MaterialMappting with given index +* Returns MaterialMapping with given index * * @param[in] pVolumeDataComposite - VolumeDataComposite instance. * @param[in] nIndex - Index of the MaterialMapping in question. @@ -1923,7 +2079,7 @@ typedef Lib3MFResult (*PLib3MFVolumeDataComposite_GetMaterialMappingCountPtr) (L typedef Lib3MFResult (*PLib3MFVolumeDataComposite_GetMaterialMappingPtr) (Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 nIndex, Lib3MF_MaterialMapping * pTheMaterialMapping); /** -* Adds a the MaterialMapping +* Adds a MaterialMapping * * @param[in] pVolumeDataComposite - VolumeDataComposite instance. * @param[in] pTransform - new transformation matrix @@ -2035,7 +2191,7 @@ typedef Lib3MFResult (*PLib3MFVolumeData_RemoveColorPtr) (Lib3MF_VolumeData pVol * Returns the number of VolumeDataProperty * * @param[in] pVolumeData - VolumeData instance. -* @param[out] pCount - the number of VolumeDataProperty-elements within this VolumdeData +* @param[out] pCount - the number of VolumeDataProperty-elements within this VolumeData * @return error code or 0 (success) */ typedef Lib3MFResult (*PLib3MFVolumeData_GetPropertyCountPtr) (Lib3MF_VolumeData pVolumeData, Lib3MF_uint32 * pCount); @@ -2860,7 +3016,7 @@ typedef Lib3MFResult (*PLib3MFAttachment_SetRelationShipTypePtr) (Lib3MF_Attachm typedef Lib3MFResult (*PLib3MFAttachment_WriteToFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); /** -* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * * @param[in] pAttachment - Attachment instance. * @param[in] pFileName - file to read from. @@ -2869,7 +3025,7 @@ typedef Lib3MFResult (*PLib3MFAttachment_WriteToFilePtr) (Lib3MF_Attachment pAtt typedef Lib3MFResult (*PLib3MFAttachment_ReadFromFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); /** -* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * * @param[in] pAttachment - Attachment instance. * @param[in] pTheReadCallback - Callback to call for reading a data chunk @@ -2901,7 +3057,7 @@ typedef Lib3MFResult (*PLib3MFAttachment_GetStreamSizePtr) (Lib3MF_Attachment pA typedef Lib3MFResult (*PLib3MFAttachment_WriteToBufferPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); /** -* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* Reads an attachment from a memory buffer. This buffer is immediately read (in contrast to the ReadFromCallback and ReadFromFile-methods). * * @param[in] pAttachment - Attachment instance. * @param[in] nBufferBufferSize - Number of elements in buffer @@ -4013,6 +4169,233 @@ typedef Lib3MFResult (*PLib3MFUnsignedMeshNode_GetInputPosPtr) (Lib3MF_UnsignedM */ typedef Lib3MFResult (*PLib3MFUnsignedMeshNode_GetOutputDistancePtr) (Lib3MF_UnsignedMeshNode pUnsignedMeshNode, Lib3MF_ImplicitPort * pDistance); +/************************************************************************************************************************* + Class definition for BeamLatticeNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the model resource id of the beam lattice +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pBeamLattice - the input port for the model resource id of the beam lattice (mesh with beamlattice extension) +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_GetInputBeamLatticePtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pBeamLattice); + +/** +* Retrieves the input for the position +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_GetInputPosPtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the output +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pDistance - the output port for the signed distance to the beam lattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_GetOutputDistancePtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pDistance); + +/** +* Sets the accurate range for distance computation +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[in] dAccurateRange - the accurate range in model units +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_SetAccurateRangePtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double dAccurateRange); + +/** +* Retrieves the accurate range for distance computation +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pAccurateRange - the accurate range in model units +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_GetAccurateRangePtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double * pAccurateRange); + +/************************************************************************************************************************* + Class definition for FunctionGradientNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the function id +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pFunction - the input port for the function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetInputFunctionIDPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pFunction); + +/** +* Retrieves the input for the position +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetInputPosPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the input for the finite difference step +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pStep - the input port for the finite difference step +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetInputStepPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pStep); + +/** +* Sets the name of the referenced scalar output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] pScalarOutputName - the name of the scalar output of the referenced function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_SetScalarOutputNamePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pScalarOutputName); + +/** +* Retrieves the name of the referenced scalar output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetScalarOutputNamePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + +/** +* Sets the name of the referenced vector input +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_SetVectorInputNamePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pVectorInputName); + +/** +* Retrieves the name of the referenced vector input +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetVectorInputNamePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + +/** +* Retrieves the normalized gradient output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pNormalizedGradient - the output port for the normalized gradient +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetOutputNormalizedGradientPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pNormalizedGradient); + +/** +* Retrieves the raw gradient output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pGradient - the output port for the raw gradient +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetOutputGradientPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pGradient); + +/** +* Retrieves the gradient magnitude output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pMagnitude - the output port for the gradient magnitude +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetOutputMagnitudePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pMagnitude); + +/************************************************************************************************************************* + Class definition for NormalizeDistanceNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the function id +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pFunction - the input port for the function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetInputFunctionIDPtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pFunction); + +/** +* Retrieves the input for the position +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pPos - the input port for the position (vector) +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetInputPosPtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the input for the finite difference step +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pStep - the input port for the finite difference step +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetInputStepPtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pStep); + +/** +* Sets the name of the referenced scalar output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] pScalarOutputName - the name of the scalar output of the referenced function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_SetScalarOutputNamePtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pScalarOutputName); + +/** +* Retrieves the name of the referenced scalar output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetScalarOutputNamePtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + +/** +* Sets the name of the referenced vector input +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_SetVectorInputNamePtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pVectorInputName); + +/** +* Retrieves the name of the referenced vector input +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetVectorInputNamePtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + +/** +* Retrieves the normalized result output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pResult - the output port for the normalized distance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetOutputResultPtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pResult); + /************************************************************************************************************************* Class definition for FunctionCallNode **************************************************************************************************************************/ @@ -4788,6 +5171,42 @@ typedef Lib3MFResult (*PLib3MFImplicitFunction_AddMeshNodePtr) (Lib3MF_ImplicitF */ typedef Lib3MFResult (*PLib3MFImplicitFunction_AddUnsignedMeshNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_UnsignedMeshNode * pNode); +/** +* Add a BeamLatticeNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFImplicitFunction_AddBeamLatticeNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_BeamLatticeNode * pNode); + +/** +* Add a FunctionGradientNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFImplicitFunction_AddFunctionGradientNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_FunctionGradientNode * pNode); + +/** +* Add a NormalizeDistanceNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFImplicitFunction_AddNormalizeDistanceNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_NormalizeDistanceNode * pNode); + /** * Add a FunctionCallNode * @@ -5902,6 +6321,16 @@ typedef Lib3MFResult (*PLib3MFModel_GetMeshObjectByIDPtr) (Lib3MF_Model pModel, */ typedef Lib3MFResult (*PLib3MFModel_GetComponentsObjectByIDPtr) (Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_ComponentsObject * pComponentsObjectInstance); +/** +* finds a boolean object by its UniqueResourceID +* +* @param[in] pModel - Model instance. +* @param[in] nUniqueResourceID - UniqueResourceID +* @param[out] pBooleanObjectInstance - returns the boolean object instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_GetBooleanObjectByIDPtr) (Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_BooleanObject * pBooleanObjectInstance); + /** * finds a model color group by its UniqueResourceID * @@ -6007,6 +6436,15 @@ typedef Lib3MFResult (*PLib3MFModel_GetMeshObjectsPtr) (Lib3MF_Model pModel, Lib */ typedef Lib3MFResult (*PLib3MFModel_GetComponentsObjectsPtr) (Lib3MF_Model pModel, Lib3MF_ComponentsObjectIterator * pResourceIterator); +/** +* creates a resource iterator instance with all boolean object resources. +* +* @param[in] pModel - Model instance. +* @param[out] pResourceIterator - returns the iterator instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_GetBooleanObjectsPtr) (Lib3MF_Model pModel, Lib3MF_BooleanObjectIterator * pResourceIterator); + /** * creates a Texture2DIterator instance with all texture2d resources. * @@ -6115,6 +6553,15 @@ typedef Lib3MFResult (*PLib3MFModel_AddMeshObjectPtr) (Lib3MF_Model pModel, Lib3 */ typedef Lib3MFResult (*PLib3MFModel_AddComponentsObjectPtr) (Lib3MF_Model pModel, Lib3MF_ComponentsObject * pComponentsObjectInstance); +/** +* adds an empty boolean object to the model. +* +* @param[in] pModel - Model instance. +* @param[out] pBooleanObjectInstance - returns the boolean object instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_AddBooleanObjectPtr) (Lib3MF_Model pModel, Lib3MF_BooleanObject * pBooleanObjectInstance); + /** * creates a new model slicestack by its id * @@ -6665,6 +7112,7 @@ typedef struct { PLib3MFObjectIterator_GetCurrentObjectPtr m_ObjectIterator_GetCurrentObject; PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr m_MeshObjectIterator_GetCurrentMeshObject; PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr m_ComponentsObjectIterator_GetCurrentComponentsObject; + PLib3MFBooleanObjectIterator_GetCurrentBooleanObjectPtr m_BooleanObjectIterator_GetCurrentBooleanObject; PLib3MFTexture2DIterator_GetCurrentTexture2DPtr m_Texture2DIterator_GetCurrentTexture2D; PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup; PLib3MFColorGroupIterator_GetCurrentColorGroupPtr m_ColorGroupIterator_GetCurrentColorGroup; @@ -6713,6 +7161,7 @@ typedef struct { PLib3MFObject_IsMeshObjectPtr m_Object_IsMeshObject; PLib3MFObject_IsComponentsObjectPtr m_Object_IsComponentsObject; PLib3MFObject_IsLevelSetObjectPtr m_Object_IsLevelSetObject; + PLib3MFObject_IsBooleanObjectPtr m_Object_IsBooleanObject; PLib3MFObject_IsValidPtr m_Object_IsValid; PLib3MFObject_SetAttachmentAsThumbnailPtr m_Object_SetAttachmentAsThumbnail; PLib3MFObject_GetThumbnailAttachmentPtr m_Object_GetThumbnailAttachment; @@ -6770,6 +7219,20 @@ typedef struct { PLib3MFLevelSet_GetMeshPtr m_LevelSet_GetMesh; PLib3MFLevelSet_GetVolumeDataPtr m_LevelSet_GetVolumeData; PLib3MFLevelSet_SetVolumeDataPtr m_LevelSet_SetVolumeData; + PLib3MFBooleanObject_SetBaseObjectPtr m_BooleanObject_SetBaseObject; + PLib3MFBooleanObject_GetBaseObjectPtr m_BooleanObject_GetBaseObject; + PLib3MFBooleanObject_SetBaseTransformPtr m_BooleanObject_SetBaseTransform; + PLib3MFBooleanObject_GetBaseTransformPtr m_BooleanObject_GetBaseTransform; + PLib3MFBooleanObject_SetOperationPtr m_BooleanObject_SetOperation; + PLib3MFBooleanObject_GetOperationPtr m_BooleanObject_GetOperation; + PLib3MFBooleanObject_SetCSGModeEnabledPtr m_BooleanObject_SetCSGModeEnabled; + PLib3MFBooleanObject_GetCSGModeEnabledPtr m_BooleanObject_GetCSGModeEnabled; + PLib3MFBooleanObject_SetExtractionGridResolutionPtr m_BooleanObject_SetExtractionGridResolution; + PLib3MFBooleanObject_GetExtractionGridResolutionPtr m_BooleanObject_GetExtractionGridResolution; + PLib3MFBooleanObject_GetOperandCountPtr m_BooleanObject_GetOperandCount; + PLib3MFBooleanObject_AddOperandPtr m_BooleanObject_AddOperand; + PLib3MFBooleanObject_GetOperandPtr m_BooleanObject_GetOperand; + PLib3MFBooleanObject_MergeToMeshObjectPtr m_BooleanObject_MergeToMeshObject; PLib3MFBeamLattice_GetMinLengthPtr m_BeamLattice_GetMinLength; PLib3MFBeamLattice_SetMinLengthPtr m_BeamLattice_SetMinLength; PLib3MFBeamLattice_GetClippingPtr m_BeamLattice_GetClipping; @@ -6997,6 +7460,29 @@ typedef struct { PLib3MFUnsignedMeshNode_GetInputMeshPtr m_UnsignedMeshNode_GetInputMesh; PLib3MFUnsignedMeshNode_GetInputPosPtr m_UnsignedMeshNode_GetInputPos; PLib3MFUnsignedMeshNode_GetOutputDistancePtr m_UnsignedMeshNode_GetOutputDistance; + PLib3MFBeamLatticeNode_GetInputBeamLatticePtr m_BeamLatticeNode_GetInputBeamLattice; + PLib3MFBeamLatticeNode_GetInputPosPtr m_BeamLatticeNode_GetInputPos; + PLib3MFBeamLatticeNode_GetOutputDistancePtr m_BeamLatticeNode_GetOutputDistance; + PLib3MFBeamLatticeNode_SetAccurateRangePtr m_BeamLatticeNode_SetAccurateRange; + PLib3MFBeamLatticeNode_GetAccurateRangePtr m_BeamLatticeNode_GetAccurateRange; + PLib3MFFunctionGradientNode_GetInputFunctionIDPtr m_FunctionGradientNode_GetInputFunctionID; + PLib3MFFunctionGradientNode_GetInputPosPtr m_FunctionGradientNode_GetInputPos; + PLib3MFFunctionGradientNode_GetInputStepPtr m_FunctionGradientNode_GetInputStep; + PLib3MFFunctionGradientNode_SetScalarOutputNamePtr m_FunctionGradientNode_SetScalarOutputName; + PLib3MFFunctionGradientNode_GetScalarOutputNamePtr m_FunctionGradientNode_GetScalarOutputName; + PLib3MFFunctionGradientNode_SetVectorInputNamePtr m_FunctionGradientNode_SetVectorInputName; + PLib3MFFunctionGradientNode_GetVectorInputNamePtr m_FunctionGradientNode_GetVectorInputName; + PLib3MFFunctionGradientNode_GetOutputNormalizedGradientPtr m_FunctionGradientNode_GetOutputNormalizedGradient; + PLib3MFFunctionGradientNode_GetOutputGradientPtr m_FunctionGradientNode_GetOutputGradient; + PLib3MFFunctionGradientNode_GetOutputMagnitudePtr m_FunctionGradientNode_GetOutputMagnitude; + PLib3MFNormalizeDistanceNode_GetInputFunctionIDPtr m_NormalizeDistanceNode_GetInputFunctionID; + PLib3MFNormalizeDistanceNode_GetInputPosPtr m_NormalizeDistanceNode_GetInputPos; + PLib3MFNormalizeDistanceNode_GetInputStepPtr m_NormalizeDistanceNode_GetInputStep; + PLib3MFNormalizeDistanceNode_SetScalarOutputNamePtr m_NormalizeDistanceNode_SetScalarOutputName; + PLib3MFNormalizeDistanceNode_GetScalarOutputNamePtr m_NormalizeDistanceNode_GetScalarOutputName; + PLib3MFNormalizeDistanceNode_SetVectorInputNamePtr m_NormalizeDistanceNode_SetVectorInputName; + PLib3MFNormalizeDistanceNode_GetVectorInputNamePtr m_NormalizeDistanceNode_GetVectorInputName; + PLib3MFNormalizeDistanceNode_GetOutputResultPtr m_NormalizeDistanceNode_GetOutputResult; PLib3MFFunctionCallNode_GetInputFunctionIDPtr m_FunctionCallNode_GetInputFunctionID; PLib3MFNodeIterator_GetCurrentPtr m_NodeIterator_GetCurrent; PLib3MFFunction_GetDisplayNamePtr m_Function_GetDisplayName; @@ -7060,6 +7546,9 @@ typedef struct { PLib3MFImplicitFunction_AddConstMatNodePtr m_ImplicitFunction_AddConstMatNode; PLib3MFImplicitFunction_AddMeshNodePtr m_ImplicitFunction_AddMeshNode; PLib3MFImplicitFunction_AddUnsignedMeshNodePtr m_ImplicitFunction_AddUnsignedMeshNode; + PLib3MFImplicitFunction_AddBeamLatticeNodePtr m_ImplicitFunction_AddBeamLatticeNode; + PLib3MFImplicitFunction_AddFunctionGradientNodePtr m_ImplicitFunction_AddFunctionGradientNode; + PLib3MFImplicitFunction_AddNormalizeDistanceNodePtr m_ImplicitFunction_AddNormalizeDistanceNode; PLib3MFImplicitFunction_AddFunctionCallNodePtr m_ImplicitFunction_AddFunctionCallNode; PLib3MFImplicitFunction_GetNodesPtr m_ImplicitFunction_GetNodes; PLib3MFImplicitFunction_RemoveNodePtr m_ImplicitFunction_RemoveNode; @@ -7169,6 +7658,7 @@ typedef struct { PLib3MFModel_GetMultiPropertyGroupByIDPtr m_Model_GetMultiPropertyGroupByID; PLib3MFModel_GetMeshObjectByIDPtr m_Model_GetMeshObjectByID; PLib3MFModel_GetComponentsObjectByIDPtr m_Model_GetComponentsObjectByID; + PLib3MFModel_GetBooleanObjectByIDPtr m_Model_GetBooleanObjectByID; PLib3MFModel_GetColorGroupByIDPtr m_Model_GetColorGroupByID; PLib3MFModel_GetSliceStackByIDPtr m_Model_GetSliceStackByID; PLib3MFModel_GetLevelSetByIDPtr m_Model_GetLevelSetByID; @@ -7180,6 +7670,7 @@ typedef struct { PLib3MFModel_GetObjectsPtr m_Model_GetObjects; PLib3MFModel_GetMeshObjectsPtr m_Model_GetMeshObjects; PLib3MFModel_GetComponentsObjectsPtr m_Model_GetComponentsObjects; + PLib3MFModel_GetBooleanObjectsPtr m_Model_GetBooleanObjects; PLib3MFModel_GetTexture2DsPtr m_Model_GetTexture2Ds; PLib3MFModel_GetBaseMaterialGroupsPtr m_Model_GetBaseMaterialGroups; PLib3MFModel_GetColorGroupsPtr m_Model_GetColorGroups; @@ -7192,6 +7683,7 @@ typedef struct { PLib3MFModel_MergeFromModelPtr m_Model_MergeFromModel; PLib3MFModel_AddMeshObjectPtr m_Model_AddMeshObject; PLib3MFModel_AddComponentsObjectPtr m_Model_AddComponentsObject; + PLib3MFModel_AddBooleanObjectPtr m_Model_AddBooleanObject; PLib3MFModel_AddSliceStackPtr m_Model_AddSliceStack; PLib3MFModel_AddTexture2DFromAttachmentPtr m_Model_AddTexture2DFromAttachment; PLib3MFModel_AddBaseMaterialGroupPtr m_Model_AddBaseMaterialGroup; @@ -7384,6 +7876,9 @@ Lib3MFResult CCall_lib3mf_meshobjectiterator_getcurrentmeshobject(Lib3MFHandle l Lib3MFResult CCall_lib3mf_componentsobjectiterator_getcurrentcomponentsobject(Lib3MFHandle libraryHandle, Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); +Lib3MFResult CCall_lib3mf_booleanobjectiterator_getcurrentbooleanobject(Lib3MFHandle libraryHandle, Lib3MF_BooleanObjectIterator pBooleanObjectIterator, Lib3MF_BooleanObject * pResource); + + Lib3MFResult CCall_lib3mf_texture2diterator_getcurrenttexture2d(Lib3MFHandle libraryHandle, Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource); @@ -7528,6 +8023,9 @@ Lib3MFResult CCall_lib3mf_object_iscomponentsobject(Lib3MFHandle libraryHandle, Lib3MFResult CCall_lib3mf_object_islevelsetobject(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, bool * pIsLevelSetObject); +Lib3MFResult CCall_lib3mf_object_isbooleanobject(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, bool * pIsBooleanObject); + + Lib3MFResult CCall_lib3mf_object_isvalid(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, bool * pIsValid); @@ -7699,6 +8197,48 @@ Lib3MFResult CCall_lib3mf_levelset_getvolumedata(Lib3MFHandle libraryHandle, Lib Lib3MFResult CCall_lib3mf_levelset_setvolumedata(Lib3MFHandle libraryHandle, Lib3MF_LevelSet pLevelSet, Lib3MF_VolumeData pTheVolumeData); +Lib3MFResult CCall_lib3mf_booleanobject_setbaseobject(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object pBaseObject, const sLib3MFTransform * pTransform); + + +Lib3MFResult CCall_lib3mf_booleanobject_getbaseobject(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object * pBaseObject); + + +Lib3MFResult CCall_lib3mf_booleanobject_setbasetransform(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, const sLib3MFTransform * pTransform); + + +Lib3MFResult CCall_lib3mf_booleanobject_getbasetransform(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, sLib3MFTransform * pTransform); + + +Lib3MFResult CCall_lib3mf_booleanobject_setoperation(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, eLib3MFBooleanOperation eOperation); + + +Lib3MFResult CCall_lib3mf_booleanobject_getoperation(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, eLib3MFBooleanOperation * pOperation); + + +Lib3MFResult CCall_lib3mf_booleanobject_setcsgmodeenabled(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, bool bCSGModeEnabled); + + +Lib3MFResult CCall_lib3mf_booleanobject_getcsgmodeenabled(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, bool * pCSGModeEnabled); + + +Lib3MFResult CCall_lib3mf_booleanobject_setextractiongridresolution(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nGridResolution); + + +Lib3MFResult CCall_lib3mf_booleanobject_getextractiongridresolution(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pGridResolution); + + +Lib3MFResult CCall_lib3mf_booleanobject_getoperandcount(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pCount); + + +Lib3MFResult CCall_lib3mf_booleanobject_addoperand(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject pOperandObject, const sLib3MFTransform * pTransform); + + +Lib3MFResult CCall_lib3mf_booleanobject_getoperand(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nIndex, Lib3MF_MeshObject * pOperandObject, sLib3MFTransform * pTransform); + + +Lib3MFResult CCall_lib3mf_booleanobject_mergetomeshobject(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject * pMeshObject); + + Lib3MFResult CCall_lib3mf_beamlattice_getminlength(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength); @@ -8380,6 +8920,75 @@ Lib3MFResult CCall_lib3mf_unsignedmeshnode_getinputpos(Lib3MFHandle libraryHandl Lib3MFResult CCall_lib3mf_unsignedmeshnode_getoutputdistance(Lib3MFHandle libraryHandle, Lib3MF_UnsignedMeshNode pUnsignedMeshNode, Lib3MF_ImplicitPort * pDistance); +Lib3MFResult CCall_lib3mf_beamlatticenode_getinputbeamlattice(Lib3MFHandle libraryHandle, Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pBeamLattice); + + +Lib3MFResult CCall_lib3mf_beamlatticenode_getinputpos(Lib3MFHandle libraryHandle, Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pPos); + + +Lib3MFResult CCall_lib3mf_beamlatticenode_getoutputdistance(Lib3MFHandle libraryHandle, Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pDistance); + + +Lib3MFResult CCall_lib3mf_beamlatticenode_setaccuraterange(Lib3MFHandle libraryHandle, Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double dAccurateRange); + + +Lib3MFResult CCall_lib3mf_beamlatticenode_getaccuraterange(Lib3MFHandle libraryHandle, Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double * pAccurateRange); + + +Lib3MFResult CCall_lib3mf_functiongradientnode_getinputfunctionid(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pFunction); + + +Lib3MFResult CCall_lib3mf_functiongradientnode_getinputpos(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pPos); + + +Lib3MFResult CCall_lib3mf_functiongradientnode_getinputstep(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pStep); + + +Lib3MFResult CCall_lib3mf_functiongradientnode_setscalaroutputname(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pScalarOutputName); + + +Lib3MFResult CCall_lib3mf_functiongradientnode_getscalaroutputname(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + + +Lib3MFResult CCall_lib3mf_functiongradientnode_setvectorinputname(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pVectorInputName); + + +Lib3MFResult CCall_lib3mf_functiongradientnode_getvectorinputname(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + + +Lib3MFResult CCall_lib3mf_functiongradientnode_getoutputnormalizedgradient(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pNormalizedGradient); + + +Lib3MFResult CCall_lib3mf_functiongradientnode_getoutputgradient(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pGradient); + + +Lib3MFResult CCall_lib3mf_functiongradientnode_getoutputmagnitude(Lib3MFHandle libraryHandle, Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pMagnitude); + + +Lib3MFResult CCall_lib3mf_normalizedistancenode_getinputfunctionid(Lib3MFHandle libraryHandle, Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pFunction); + + +Lib3MFResult CCall_lib3mf_normalizedistancenode_getinputpos(Lib3MFHandle libraryHandle, Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pPos); + + +Lib3MFResult CCall_lib3mf_normalizedistancenode_getinputstep(Lib3MFHandle libraryHandle, Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pStep); + + +Lib3MFResult CCall_lib3mf_normalizedistancenode_setscalaroutputname(Lib3MFHandle libraryHandle, Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pScalarOutputName); + + +Lib3MFResult CCall_lib3mf_normalizedistancenode_getscalaroutputname(Lib3MFHandle libraryHandle, Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + + +Lib3MFResult CCall_lib3mf_normalizedistancenode_setvectorinputname(Lib3MFHandle libraryHandle, Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pVectorInputName); + + +Lib3MFResult CCall_lib3mf_normalizedistancenode_getvectorinputname(Lib3MFHandle libraryHandle, Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + + +Lib3MFResult CCall_lib3mf_normalizedistancenode_getoutputresult(Lib3MFHandle libraryHandle, Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pResult); + + Lib3MFResult CCall_lib3mf_functioncallnode_getinputfunctionid(Lib3MFHandle libraryHandle, Lib3MF_FunctionCallNode pFunctionCallNode, Lib3MF_ImplicitPort * pFunction); @@ -8569,6 +9178,15 @@ Lib3MFResult CCall_lib3mf_implicitfunction_addmeshnode(Lib3MFHandle libraryHandl Lib3MFResult CCall_lib3mf_implicitfunction_addunsignedmeshnode(Lib3MFHandle libraryHandle, Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_UnsignedMeshNode * pNode); +Lib3MFResult CCall_lib3mf_implicitfunction_addbeamlatticenode(Lib3MFHandle libraryHandle, Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_BeamLatticeNode * pNode); + + +Lib3MFResult CCall_lib3mf_implicitfunction_addfunctiongradientnode(Lib3MFHandle libraryHandle, Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_FunctionGradientNode * pNode); + + +Lib3MFResult CCall_lib3mf_implicitfunction_addnormalizedistancenode(Lib3MFHandle libraryHandle, Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_NormalizeDistanceNode * pNode); + + Lib3MFResult CCall_lib3mf_implicitfunction_addfunctioncallnode(Lib3MFHandle libraryHandle, Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_FunctionCallNode * pNode); @@ -8896,6 +9514,9 @@ Lib3MFResult CCall_lib3mf_model_getmeshobjectbyid(Lib3MFHandle libraryHandle, Li Lib3MFResult CCall_lib3mf_model_getcomponentsobjectbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_ComponentsObject * pComponentsObjectInstance); +Lib3MFResult CCall_lib3mf_model_getbooleanobjectbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_BooleanObject * pBooleanObjectInstance); + + Lib3MFResult CCall_lib3mf_model_getcolorgroupbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_ColorGroup * pColorGroupInstance); @@ -8929,6 +9550,9 @@ Lib3MFResult CCall_lib3mf_model_getmeshobjects(Lib3MFHandle libraryHandle, Lib3M Lib3MFResult CCall_lib3mf_model_getcomponentsobjects(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_ComponentsObjectIterator * pResourceIterator); +Lib3MFResult CCall_lib3mf_model_getbooleanobjects(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_BooleanObjectIterator * pResourceIterator); + + Lib3MFResult CCall_lib3mf_model_gettexture2ds(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Texture2DIterator * pResourceIterator); @@ -8965,6 +9589,9 @@ Lib3MFResult CCall_lib3mf_model_addmeshobject(Lib3MFHandle libraryHandle, Lib3MF Lib3MFResult CCall_lib3mf_model_addcomponentsobject(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_ComponentsObject * pComponentsObjectInstance); +Lib3MFResult CCall_lib3mf_model_addbooleanobject(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_BooleanObject * pBooleanObjectInstance); + + Lib3MFResult CCall_lib3mf_model_addslicestack(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_double dZBottom, Lib3MF_SliceStack * pSliceStackInstance); diff --git a/Autogenerated/Bindings/Go/lib3mf_types.h b/Autogenerated/Bindings/Go/lib3mf_types.h index 5df0da2fd..b9e4aec27 100644 --- a/Autogenerated/Bindings/Go/lib3mf_types.h +++ b/Autogenerated/Bindings/Go/lib3mf_types.h @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated plain C Header file with basic types in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -84,7 +84,7 @@ typedef void * Lib3MF_pvoid; **************************************************************************************************************************/ #define LIB3MF_VERSION_MAJOR 2 -#define LIB3MF_VERSION_MINOR 4 +#define LIB3MF_VERSION_MINOR 6 #define LIB3MF_VERSION_MICRO 0 #define LIB3MF_VERSION_PRERELEASEINFO "" #define LIB3MF_VERSION_BUILDINFO "" @@ -220,6 +220,7 @@ typedef Lib3MFHandle Lib3MF_SliceStackIterator; typedef Lib3MFHandle Lib3MF_ObjectIterator; typedef Lib3MFHandle Lib3MF_MeshObjectIterator; typedef Lib3MFHandle Lib3MF_ComponentsObjectIterator; +typedef Lib3MFHandle Lib3MF_BooleanObjectIterator; typedef Lib3MFHandle Lib3MF_Texture2DIterator; typedef Lib3MFHandle Lib3MF_BaseMaterialGroupIterator; typedef Lib3MFHandle Lib3MF_ColorGroupIterator; @@ -235,6 +236,7 @@ typedef Lib3MFHandle Lib3MF_TriangleSet; typedef Lib3MFHandle Lib3MF_Object; typedef Lib3MFHandle Lib3MF_MeshObject; typedef Lib3MFHandle Lib3MF_LevelSet; +typedef Lib3MFHandle Lib3MF_BooleanObject; typedef Lib3MFHandle Lib3MF_BeamLattice; typedef Lib3MFHandle Lib3MF_FunctionReference; typedef Lib3MFHandle Lib3MF_VolumeDataColor; @@ -310,6 +312,9 @@ typedef Lib3MFHandle Lib3MF_ConstVecNode; typedef Lib3MFHandle Lib3MF_ConstMatNode; typedef Lib3MFHandle Lib3MF_MeshNode; typedef Lib3MFHandle Lib3MF_UnsignedMeshNode; +typedef Lib3MFHandle Lib3MF_BeamLatticeNode; +typedef Lib3MFHandle Lib3MF_FunctionGradientNode; +typedef Lib3MFHandle Lib3MF_NormalizeDistanceNode; typedef Lib3MFHandle Lib3MF_FunctionCallNode; typedef Lib3MFHandle Lib3MF_NodeIterator; typedef Lib3MFHandle Lib3MF_Function; @@ -358,9 +363,16 @@ typedef enum eLib3MFObjectType { eObjectTypeOther = 0, eObjectTypeModel = 1, eObjectTypeSupport = 2, - eObjectTypeSolidSupport = 3 + eObjectTypeSolidSupport = 3, + eObjectTypeSurface = 4 } eLib3MFObjectType; +typedef enum eLib3MFBooleanOperation { + eBooleanOperationUnion = 0, + eBooleanOperationDifference = 1, + eBooleanOperationIntersection = 2 +} eLib3MFBooleanOperation; + typedef enum eLib3MFTextureType { eTextureTypeUnknown = 0, eTextureTypePNG = 1, @@ -472,11 +484,11 @@ typedef enum eLib3MFImplicitNodeType { eImplicitNodeTypeMatVecMultiplication = 14, /** Multiplies a matrix with a vector */ eImplicitNodeTypeTranspose = 15, /** Transposes a matrix */ eImplicitNodeTypeInverse = 16, /** Computes the inverse of a matrix */ - eImplicitNodeTypeSinus = 17, /** Calculates the sinus */ - eImplicitNodeTypeCosinus = 18, /** Calculates the cosinus */ + eImplicitNodeTypeSinus = 17, /** Calculates the sine */ + eImplicitNodeTypeCosinus = 18, /** Calculates the cosine */ eImplicitNodeTypeTan = 19, /** Calculates the tangent */ - eImplicitNodeTypeArcSin = 20, /** Calculates the arcsinus */ - eImplicitNodeTypeArcCos = 21, /** Calculates the arccosinus */ + eImplicitNodeTypeArcSin = 20, /** Calculates the arcsine */ + eImplicitNodeTypeArcCos = 21, /** Calculates the arccosine */ eImplicitNodeTypeArcTan = 22, /** Calculates the arctangent */ eImplicitNodeTypeArcTan2 = 23, /** Calculates the arctangent */ eImplicitNodeTypeMin = 24, /** Calculates the minimum of two values */ @@ -486,9 +498,9 @@ typedef enum eLib3MFImplicitNodeType { eImplicitNodeTypePow = 28, /** Calculates the power A^B */ eImplicitNodeTypeSqrt = 29, /** Calculates the square root */ eImplicitNodeTypeExp = 30, /** Exponential function */ - eImplicitNodeTypeLog = 31, /** Natural logarithmus */ - eImplicitNodeTypeLog2 = 32, /** Logarithmus to the base 2 */ - eImplicitNodeTypeLog10 = 33, /** Logarithmus to the base 10 */ + eImplicitNodeTypeLog = 31, /** Natural logarithm */ + eImplicitNodeTypeLog2 = 32, /** Logarithm to the base 2 */ + eImplicitNodeTypeLog10 = 33, /** Logarithm to the base 10 */ eImplicitNodeTypeSelect = 34, /** If A is less than B returns C, else D */ eImplicitNodeTypeClamp = 35, /** Clamps the input value to min and max */ eImplicitNodeTypeSinh = 36, /** Calculates the hyperbolic sine */ @@ -503,9 +515,12 @@ typedef enum eLib3MFImplicitNodeType { eImplicitNodeTypeMesh = 45, /** Calculates the signed distance to a mesh */ eImplicitNodeTypeLength = 46, /** Calculates the length of a vector */ eImplicitNodeTypeConstResourceID = 47, /** Selects a resource (function, mesh etc.) */ - eImplicitNodeTypeVectorFromScalar = 48, /** Creates a vector from one scalar values */ + eImplicitNodeTypeVectorFromScalar = 48, /** Creates a vector from one scalar value */ eImplicitNodeTypeUnsignedMesh = 49, /** Calculates the unsigned distance to a mesh */ - eImplicitNodeTypeMod = 50 /** Calculates the modulo of two values (same behaviour as glsl mod) */ + eImplicitNodeTypeMod = 50, /** Calculates the modulo of two values (same behaviour as glsl mod) */ + eImplicitNodeTypeBeamLattice = 51, /** Calculates the signed distance to a beam lattice */ + eImplicitNodeTypeFunctionGradient = 52, /** Calculates the gradient of a function */ + eImplicitNodeTypeNormalizeDistance = 53 /** Normalizes a distance field */ } eLib3MFImplicitNodeType; /** @@ -578,6 +593,11 @@ typedef union { int m_code; } structEnumLib3MFObjectType; +typedef union { + eLib3MFBooleanOperation m_enum; + int m_code; +} structEnumLib3MFBooleanOperation; + typedef union { eLib3MFTextureType m_enum; int m_code; diff --git a/Autogenerated/Bindings/Java8/build_jar.sh b/Autogenerated/Bindings/Java8/build_jar.sh new file mode 100644 index 000000000..8bd9d4094 --- /dev/null +++ b/Autogenerated/Bindings/Java8/build_jar.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -euxo pipefail + +cd "$(dirname "$0")" +echo "Download JNA" +[ -f jna-5.5.0.jar ] || curl -O https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.5.0/jna-5.5.0.jar + +echo "Compile Java Bindings" +javac -classpath *.jar lib3mf/* + +echo "Create JAR" +jar cvf lib3mf-2.6.0.jar lib3mf diff --git a/Autogenerated/Bindings/Java8/lib3mf/AbsNode.java b/Autogenerated/Bindings/Java8/lib3mf/AbsNode.java new file mode 100644 index 000000000..0d6fd7cec --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/AbsNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class AbsNode extends OneInputNode { + + public AbsNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/AccessRight.java b/Autogenerated/Bindings/Java8/lib3mf/AccessRight.java new file mode 100644 index 000000000..8f0c00f15 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/AccessRight.java @@ -0,0 +1,110 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class AccessRight extends Base { + + public AccessRight(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Gets the consumer associated with this access right + * + * @return The consumer instance + * @throws Lib3MFException + */ + public Consumer getConsumer() throws Lib3MFException { + Pointer bufferConsumer = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_accessright_getconsumer.invokeInt(new java.lang.Object[]{mHandle, bufferConsumer})); + Pointer valueConsumer = bufferConsumer.getPointer(0); + Consumer consumer = null; + if (valueConsumer == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Consumer was a null pointer"); + } + consumer = mWrapper.PolymorphicFactory(valueConsumer, Consumer.class); + return consumer; + } + + /** + * Gets the associated encryption algorithm + * + * @return The algorithm used for the key in this accessright + * @throws Lib3MFException + */ + public Lib3MFWrapper.WrappingAlgorithm getWrappingAlgorithm() throws Lib3MFException { + Pointer bufferAlgorithm = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_accessright_getwrappingalgorithm.invokeInt(new java.lang.Object[]{mHandle, bufferAlgorithm})); + return Lib3MFWrapper.EnumConversion.convertConstToWrappingAlgorithm(bufferAlgorithm.getInt(0)); + } + + /** + * Gets the associated mask generation function algorithm + * + * @return The MFG1 algorithm + * @throws Lib3MFException + */ + public Lib3MFWrapper.MgfAlgorithm getMgfAlgorithm() throws Lib3MFException { + Pointer bufferAlgorithm = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_accessright_getmgfalgorithm.invokeInt(new java.lang.Object[]{mHandle, bufferAlgorithm})); + return Lib3MFWrapper.EnumConversion.convertConstToMgfAlgorithm(bufferAlgorithm.getInt(0)); + } + + /** + * Gets the digest method assoicated + * + * @return The digest method for this accessright + * @throws Lib3MFException + */ + public Lib3MFWrapper.DigestMethod getDigestMethod() throws Lib3MFException { + Pointer bufferAlgorithm = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_accessright_getdigestmethod.invokeInt(new java.lang.Object[]{mHandle, bufferAlgorithm})); + return Lib3MFWrapper.EnumConversion.convertConstToDigestMethod(bufferAlgorithm.getInt(0)); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/AdditionNode.java b/Autogenerated/Bindings/Java8/lib3mf/AdditionNode.java new file mode 100644 index 000000000..4a7dae3a2 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/AdditionNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class AdditionNode extends TwoInputNode { + + public AdditionNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ArcCosNode.java b/Autogenerated/Bindings/Java8/lib3mf/ArcCosNode.java new file mode 100644 index 000000000..ff5373b94 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ArcCosNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ArcCosNode extends OneInputNode { + + public ArcCosNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ArcSinNode.java b/Autogenerated/Bindings/Java8/lib3mf/ArcSinNode.java new file mode 100644 index 000000000..d856a6d6b --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ArcSinNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ArcSinNode extends OneInputNode { + + public ArcSinNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ArcTan2Node.java b/Autogenerated/Bindings/Java8/lib3mf/ArcTan2Node.java new file mode 100644 index 000000000..c3c69655e --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ArcTan2Node.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ArcTan2Node extends TwoInputNode { + + public ArcTan2Node(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ArcTanNode.java b/Autogenerated/Bindings/Java8/lib3mf/ArcTanNode.java new file mode 100644 index 000000000..8139cd557 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ArcTanNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ArcTanNode extends OneInputNode { + + public ArcTanNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Attachment.java b/Autogenerated/Bindings/Java8/lib3mf/Attachment.java new file mode 100644 index 000000000..d5c0471d3 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Attachment.java @@ -0,0 +1,214 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Attachment extends Base { + + public Attachment(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves an attachment's package path. This function will be removed in a later release. + * + * @return returns the attachment's package path string + * @throws Lib3MFException + */ + public String getPath() throws Lib3MFException { + Pointer bytesNeededPath = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_getpath.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededPath, null})); + int sizePath = bytesNeededPath.getInt(0); + Pointer bufferPath = new Memory(sizePath); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_getpath.invokeInt(new java.lang.Object[]{mHandle, sizePath, bytesNeededPath, bufferPath})); + return new String(bufferPath.getByteArray(0, sizePath - 1), StandardCharsets.UTF_8); + } + + /** + * Sets an attachment's package path. This function will be removed in a later release. + * + * @param path new path of the attachment. + * @throws Lib3MFException + */ + public void setPath(String path) throws Lib3MFException { + byte[] bytesPath = path.getBytes(StandardCharsets.UTF_8); + Memory bufferPath = new Memory(bytesPath.length + 1); + bufferPath.write(0, bytesPath, 0, bytesPath.length); + bufferPath.setByte(bytesPath.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_setpath.invokeInt(new java.lang.Object[]{mHandle, bufferPath})); + } + + /** + * Returns the PackagePart that is this attachment. + * + * @return The PackagePart of this attachment. + * @throws Lib3MFException + */ + public PackagePart packagePart() throws Lib3MFException { + Pointer bufferPackagePart = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_packagepart.invokeInt(new java.lang.Object[]{mHandle, bufferPackagePart})); + Pointer valuePackagePart = bufferPackagePart.getPointer(0); + PackagePart packagePart = null; + if (valuePackagePart == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "PackagePart was a null pointer"); + } + packagePart = mWrapper.PolymorphicFactory(valuePackagePart, PackagePart.class); + return packagePart; + } + + /** + * Retrieves an attachment's relationship type + * + * @return returns the attachment's package relationship type string + * @throws Lib3MFException + */ + public String getRelationShipType() throws Lib3MFException { + Pointer bytesNeededPath = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_getrelationshiptype.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededPath, null})); + int sizePath = bytesNeededPath.getInt(0); + Pointer bufferPath = new Memory(sizePath); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_getrelationshiptype.invokeInt(new java.lang.Object[]{mHandle, sizePath, bytesNeededPath, bufferPath})); + return new String(bufferPath.getByteArray(0, sizePath - 1), StandardCharsets.UTF_8); + } + + /** + * Sets an attachment's relationship type. + * + * @param path new relationship type string. + * @throws Lib3MFException + */ + public void setRelationShipType(String path) throws Lib3MFException { + byte[] bytesPath = path.getBytes(StandardCharsets.UTF_8); + Memory bufferPath = new Memory(bytesPath.length + 1); + bufferPath.write(0, bytesPath, 0, bytesPath.length); + bufferPath.setByte(bytesPath.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_setrelationshiptype.invokeInt(new java.lang.Object[]{mHandle, bufferPath})); + } + + /** + * Writes out the attachment as file. + * + * @param fileName file to write into. + * @throws Lib3MFException + */ + public void writeToFile(String fileName) throws Lib3MFException { + byte[] bytesFileName = fileName.getBytes(StandardCharsets.UTF_8); + Memory bufferFileName = new Memory(bytesFileName.length + 1); + bufferFileName.write(0, bytesFileName, 0, bytesFileName.length); + bufferFileName.setByte(bytesFileName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_writetofile.invokeInt(new java.lang.Object[]{mHandle, bufferFileName})); + } + + /** + * Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. + * + * @param fileName file to read from. + * @throws Lib3MFException + */ + public void readFromFile(String fileName) throws Lib3MFException { + byte[] bytesFileName = fileName.getBytes(StandardCharsets.UTF_8); + Memory bufferFileName = new Memory(bytesFileName.length + 1); + bufferFileName.write(0, bytesFileName, 0, bytesFileName.length); + bufferFileName.setByte(bytesFileName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_readfromfile.invokeInt(new java.lang.Object[]{mHandle, bufferFileName})); + } + + /** + * Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. + * + * @param theReadCallback Callback to call for reading a data chunk + * @param streamSize number of bytes the callback returns + * @param theSeekCallback Callback to call for seeking in the stream. + * @param userData Userdata that is passed to the callback function + * @throws Lib3MFException + */ + public void readFromCallback(Lib3MFWrapper.ReadCallback theReadCallback, long streamSize, Lib3MFWrapper.SeekCallback theSeekCallback, Pointer userData) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_attachment_readfromcallback.invokeInt(new java.lang.Object[]{mHandle, theReadCallback, streamSize, theSeekCallback, userData})); + } + + /** + * Retrieves the size of the attachment stream + * + * @return the stream size + * @throws Lib3MFException + */ + public long getStreamSize() throws Lib3MFException { + Pointer bufferStreamSize = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_getstreamsize.invokeInt(new java.lang.Object[]{mHandle, bufferStreamSize})); + return bufferStreamSize.getLong(0); + } + + /** + * Writes out the attachment into a buffer + * + * @return Buffer to write into + * @throws Lib3MFException + */ + public byte[] writeToBuffer() throws Lib3MFException { + Pointer countNeededBuffer = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_writetobuffer.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededBuffer, Pointer.NULL})); + long countBuffer = countNeededBuffer.getLong(0); + Pointer bufferBuffer = new Memory(Math.max(1, 1 * countBuffer)); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_writetobuffer.invokeInt(new java.lang.Object[]{mHandle, countBuffer, countNeededBuffer, bufferBuffer})); + return bufferBuffer.getByteArray(0, (int)countBuffer); + } + + /** + * Reads an attachment from a memory buffer. This buffer is immediately read (in contrast to the ReadFromCallback and ReadFromFile-methods). + * + * @param buffer Buffer to read from + * @throws Lib3MFException + */ + public void readFromBuffer(byte[] buffer) throws Lib3MFException { + Pointer bufferBuffer = new Memory(Math.max(1, 1 * buffer.length)); + for (int i = 0; i < buffer.length; i++) { + bufferBuffer.setByte(1 * i, buffer[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_attachment_readfrombuffer.invokeInt(new java.lang.Object[]{mHandle, (long) buffer.length, bufferBuffer})); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Ball.java b/Autogenerated/Bindings/Java8/lib3mf/Ball.java new file mode 100644 index 000000000..3862d162f --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Ball.java @@ -0,0 +1,63 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Ball { + + public int Index; + + public double Radius; + + public static final int SIZE = 12; + + public void readFromPointer(Pointer p, long offset) { + Index = p.getInt(offset + 0); + Radius = p.getDouble(offset + 4); + } + + public void writeToPointer(Pointer p, long offset) { + p.setInt(offset + 0, Index); + p.setDouble(offset + 4, Radius); + } + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Base.java b/Autogenerated/Bindings/Java8/lib3mf/Base.java new file mode 100644 index 000000000..b6c3e23b9 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Base.java @@ -0,0 +1,82 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Base { + + protected Pointer mHandle; + + protected Lib3MFWrapper mWrapper; + + public Base(Lib3MFWrapper wrapper, Pointer handle) { + mHandle = handle; + mWrapper = wrapper; + } + + public Pointer getHandle() { + return mHandle; + } + + @Override + protected void finalize() throws Throwable { + super.finalize(); + mWrapper.release(this); + } + /** + * Get Class Type Id + * + * @return Class type as a 64 bits integer + * @throws Lib3MFException + */ + public long classTypeId() throws Lib3MFException { + Pointer bufferClassTypeId = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_base_classtypeid.invokeInt(new java.lang.Object[]{mHandle, bufferClassTypeId})); + return bufferClassTypeId.getLong(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/BaseMaterialGroup.java b/Autogenerated/Bindings/Java8/lib3mf/BaseMaterialGroup.java new file mode 100644 index 000000000..e4af1dae0 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/BaseMaterialGroup.java @@ -0,0 +1,172 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BaseMaterialGroup extends Resource { + + public BaseMaterialGroup(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the count of base materials in the material group. + * + * @return returns the count of base materials. + * @throws Lib3MFException + */ + public int getCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_getcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * returns all the PropertyIDs of all materials in this group + * + * @return PropertyID of the material in the material group. + * @throws Lib3MFException + */ + public int[] getAllPropertyIDs() throws Lib3MFException { + Pointer countNeededPropertyIDs = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededPropertyIDs, Pointer.NULL})); + long countPropertyIDs = countNeededPropertyIDs.getLong(0); + Pointer bufferPropertyIDs = new Memory(Math.max(1, 4 * countPropertyIDs)); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, countPropertyIDs, countNeededPropertyIDs, bufferPropertyIDs})); + return bufferPropertyIDs.getIntArray(0, (int)countPropertyIDs); + } + + /** + * Adds a new material to the material group + * + * @param name new name of the base material. + * @param displayColor Display color of the material + * @return returns new PropertyID of the new material in the material group. + * @throws Lib3MFException + */ + public int addMaterial(String name, Color displayColor) throws Lib3MFException { + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + Pointer bufferDisplayColor = new Memory(Color.SIZE); + displayColor.writeToPointer(bufferDisplayColor, 0); + Pointer bufferPropertyID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_addmaterial.invokeInt(new java.lang.Object[]{mHandle, bufferName, bufferDisplayColor, bufferPropertyID})); + return bufferPropertyID.getInt(0); + } + + /** + * Removes a material from the material group. + * + * @param propertyID PropertyID of the material in the material group. + * @throws Lib3MFException + */ + public void removeMaterial(int propertyID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_removematerial.invokeInt(new java.lang.Object[]{mHandle, propertyID})); + } + + /** + * Returns the base material's name + * + * @param propertyID PropertyID of the material in the material group. + * @return returns the name of the base material. + * @throws Lib3MFException + */ + public String getName(int propertyID) throws Lib3MFException { + Pointer bytesNeededName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_getname.invokeInt(new java.lang.Object[]{mHandle, propertyID, 0, bytesNeededName, null})); + int sizeName = bytesNeededName.getInt(0); + Pointer bufferName = new Memory(sizeName); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_getname.invokeInt(new java.lang.Object[]{mHandle, propertyID, sizeName, bytesNeededName, bufferName})); + return new String(bufferName.getByteArray(0, sizeName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets a base material's name + * + * @param propertyID PropertyID of the material in the material group. + * @param name new name of the base material. + * @throws Lib3MFException + */ + public void setName(int propertyID, String name) throws Lib3MFException { + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_setname.invokeInt(new java.lang.Object[]{mHandle, propertyID, bufferName})); + } + + /** + * Sets a base material's display color. + * + * @param propertyID PropertyID of the material in the material group. + * @param theColor The base material's display color + * @throws Lib3MFException + */ + public void setDisplayColor(int propertyID, Color theColor) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + theColor.writeToPointer(bufferTheColor, 0); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_setdisplaycolor.invokeInt(new java.lang.Object[]{mHandle, propertyID, bufferTheColor})); + } + + /** + * Returns a base material's display color. + * + * @param propertyID PropertyID of the material in the material group. + * @return The base material's display color + * @throws Lib3MFException + */ + public Color getDisplayColor(int propertyID) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_getdisplaycolor.invokeInt(new java.lang.Object[]{mHandle, propertyID, bufferTheColor})); + Color theColor = new Color(); + theColor.readFromPointer(bufferTheColor, 0); + return theColor; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/BaseMaterialGroupIterator.java b/Autogenerated/Bindings/Java8/lib3mf/BaseMaterialGroupIterator.java new file mode 100644 index 000000000..22708aaf6 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/BaseMaterialGroupIterator.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BaseMaterialGroupIterator extends ResourceIterator { + + public BaseMaterialGroupIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the MaterialGroup the iterator points at. + * + * @return returns the BaseMaterialGroup instance. + * @throws Lib3MFException + */ + public BaseMaterialGroup getCurrentBaseMaterialGroup() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + BaseMaterialGroup resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, BaseMaterialGroup.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Beam.java b/Autogenerated/Bindings/Java8/lib3mf/Beam.java new file mode 100644 index 000000000..21817705d --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Beam.java @@ -0,0 +1,73 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Beam { + + public int[] Indices = new int[2]; + + public double[] Radii = new double[2]; + + public int[] CapModes = new int[2]; + + public static final int SIZE = 32; + + public void readFromPointer(Pointer p, long offset) { + Indices[0] = p.getInt(offset + 0); + Indices[1] = p.getInt(offset + 4); + Radii[0] = p.getDouble(offset + 8); + Radii[1] = p.getDouble(offset + 16); + CapModes[0] = p.getInt(offset + 24); + CapModes[1] = p.getInt(offset + 28); + } + + public void writeToPointer(Pointer p, long offset) { + p.setInt(offset + 0, Indices[0]); + p.setInt(offset + 4, Indices[1]); + p.setDouble(offset + 8, Radii[0]); + p.setDouble(offset + 16, Radii[1]); + p.setInt(offset + 24, CapModes[0]); + p.setInt(offset + 28, CapModes[1]); + } + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/BeamLattice.java b/Autogenerated/Bindings/Java8/lib3mf/BeamLattice.java new file mode 100644 index 000000000..662d7e1f9 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/BeamLattice.java @@ -0,0 +1,421 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BeamLattice extends Base { + + public BeamLattice(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the minimal length of beams for the beamlattice. + * + * @return minimal length of beams for the beamlattice + * @throws Lib3MFException + */ + public double getMinLength() throws Lib3MFException { + Pointer bufferMinLength = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getminlength.invokeInt(new java.lang.Object[]{mHandle, bufferMinLength})); + return bufferMinLength.getDouble(0); + } + + /** + * Sets the minimal length of beams for the beamlattice. + * + * @param minLength minimal length of beams for the beamlattice + * @throws Lib3MFException + */ + public void setMinLength(double minLength) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_setminlength.invokeInt(new java.lang.Object[]{mHandle, minLength})); + } + + /** + * Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. + * + * @return GetClipping Result Tuple + * @throws Lib3MFException + */ + public GetClippingResult getClipping() throws Lib3MFException { + Pointer bufferClipMode = new Memory(4); + Pointer bufferUniqueResourceID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getclipping.invokeInt(new java.lang.Object[]{mHandle, bufferClipMode, bufferUniqueResourceID})); + GetClippingResult returnTuple = new GetClippingResult(); + returnTuple.ClipMode = Lib3MFWrapper.EnumConversion.convertConstToBeamLatticeClipMode(bufferClipMode.getInt(0)); + returnTuple.UniqueResourceID = bufferUniqueResourceID.getInt(0); + return returnTuple; + } + + public static class GetClippingResult { + /** + * contains the clip mode of this mesh + */ + public Lib3MFWrapper.BeamLatticeClipMode ClipMode; + + /** + * filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE + */ + public int UniqueResourceID; + + } + /** + * Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. + * + * @param clipMode contains the clip mode of this mesh + * @param uniqueResourceID the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. + * @throws Lib3MFException + */ + public void setClipping(Lib3MFWrapper.BeamLatticeClipMode clipMode, int uniqueResourceID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_setclipping.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertBeamLatticeClipModeToConst(clipMode), uniqueResourceID})); + } + + /** + * Returns the representation-mesh for the beamlattice of this mesh. + * + * @return GetRepresentation Result Tuple + * @throws Lib3MFException + */ + public GetRepresentationResult getRepresentation() throws Lib3MFException { + Pointer bufferHasRepresentation = new Memory(1); + Pointer bufferUniqueResourceID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getrepresentation.invokeInt(new java.lang.Object[]{mHandle, bufferHasRepresentation, bufferUniqueResourceID})); + GetRepresentationResult returnTuple = new GetRepresentationResult(); + returnTuple.HasRepresentation = bufferHasRepresentation.getByte(0) != 0; + returnTuple.UniqueResourceID = bufferUniqueResourceID.getInt(0); + return returnTuple; + } + + public static class GetRepresentationResult { + /** + * flag whether the beamlattice has a representation mesh. + */ + public boolean HasRepresentation; + + /** + * filled with the UniqueResourceID of the clipping mesh-object. + */ + public int UniqueResourceID; + + } + /** + * Sets the representation-mesh for the beamlattice of this mesh. + * + * @param uniqueResourceID the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. + * @throws Lib3MFException + */ + public void setRepresentation(int uniqueResourceID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_setrepresentation.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID})); + } + + /** + * Returns the ball mode and the default ball radius for the beamlattice of this mesh. + * + * @return GetBallOptions Result Tuple + * @throws Lib3MFException + */ + public GetBallOptionsResult getBallOptions() throws Lib3MFException { + Pointer bufferBallMode = new Memory(4); + Pointer bufferBallRadius = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getballoptions.invokeInt(new java.lang.Object[]{mHandle, bufferBallMode, bufferBallRadius})); + GetBallOptionsResult returnTuple = new GetBallOptionsResult(); + returnTuple.BallMode = Lib3MFWrapper.EnumConversion.convertConstToBeamLatticeBallMode(bufferBallMode.getInt(0)); + returnTuple.BallRadius = bufferBallRadius.getDouble(0); + return returnTuple; + } + + public static class GetBallOptionsResult { + /** + * contains the ball mode of this mesh + */ + public Lib3MFWrapper.BeamLatticeBallMode BallMode; + + /** + * default ball radius of balls for the beamlattice + */ + public double BallRadius; + + } + /** + * Sets the ball mode and thedefault ball radius for the beamlattice. + * + * @param ballMode contains the ball mode of this mesh + * @param ballRadius default ball radius of balls for the beamlattice + * @throws Lib3MFException + */ + public void setBallOptions(Lib3MFWrapper.BeamLatticeBallMode ballMode, double ballRadius) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_setballoptions.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertBeamLatticeBallModeToConst(ballMode), ballRadius})); + } + + /** + * Returns the beam count of a mesh object. + * + * @return filled with the beam count. + * @throws Lib3MFException + */ + public int getBeamCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getbeamcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Returns indices, radii and capmodes of a single beam of a mesh object. + * + * @param index Index of the beam (0 to beamcount - 1). + * @return filled with the beam indices, radii and capmodes. + * @throws Lib3MFException + */ + public Beam getBeam(int index) throws Lib3MFException { + Pointer bufferBeamInfo = new Memory(Beam.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getbeam.invokeInt(new java.lang.Object[]{mHandle, index, bufferBeamInfo})); + Beam beamInfo = new Beam(); + beamInfo.readFromPointer(bufferBeamInfo, 0); + return beamInfo; + } + + /** + * Adds a single beam to a mesh object. + * + * @param beamInfo contains the node indices, radii and capmodes. + * @return filled with the new Index of the beam. + * @throws Lib3MFException + */ + public int addBeam(Beam beamInfo) throws Lib3MFException { + Pointer bufferBeamInfo = new Memory(Beam.SIZE); + beamInfo.writeToPointer(bufferBeamInfo, 0); + Pointer bufferIndex = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_addbeam.invokeInt(new java.lang.Object[]{mHandle, bufferBeamInfo, bufferIndex})); + return bufferIndex.getInt(0); + } + + /** + * Sets the indices, radii and capmodes of a single beam of a mesh object. + * + * @param index Index of the beam (0 to beamcount - 1). + * @param beamInfo filled with the beam indices, radii and capmodes. + * @throws Lib3MFException + */ + public void setBeam(int index, Beam beamInfo) throws Lib3MFException { + Pointer bufferBeamInfo = new Memory(Beam.SIZE); + beamInfo.writeToPointer(bufferBeamInfo, 0); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_setbeam.invokeInt(new java.lang.Object[]{mHandle, index, bufferBeamInfo})); + } + + /** + * Sets all beam indices, radii and capmodes of a mesh object. + * + * @param beamInfo contains information of a number of beams + * @throws Lib3MFException + */ + public void setBeams(Beam[] beamInfo) throws Lib3MFException { + Pointer bufferBeamInfo = new Memory(Math.max(1, Beam.SIZE * beamInfo.length)); + for (int i = 0; i < beamInfo.length; i++) { + beamInfo[i].writeToPointer(bufferBeamInfo, i * Beam.SIZE); + } + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_setbeams.invokeInt(new java.lang.Object[]{mHandle, (long) beamInfo.length, bufferBeamInfo})); + } + + /** + * obtains all beam indices, radii and capmodes of a mesh object. + * + * @return contains information of all beams + * @throws Lib3MFException + */ + public Beam[] getBeams() throws Lib3MFException { + Pointer countNeededBeamInfo = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getbeams.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededBeamInfo, null})); + long countBeamInfo = countNeededBeamInfo.getLong(0); + Pointer bufferBeamInfo = new Memory(Math.max(1, countBeamInfo * Beam.SIZE)); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getbeams.invokeInt(new java.lang.Object[]{mHandle, countBeamInfo, countNeededBeamInfo, bufferBeamInfo})); + Beam beamInfo[] = new Beam[(int)countBeamInfo]; + for (int i = 0; i < (int)countBeamInfo; i++) { + beamInfo[i] = new Beam(); + beamInfo[i].readFromPointer(bufferBeamInfo, i * Beam.SIZE); + } + return beamInfo; + } + + /** + * Returns the ball count of a mesh object. + * + * @return filled with the ball count. + * @throws Lib3MFException + */ + public int getBallCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getballcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Returns index and radius of a single ball of a mesh object. + * + * @param index Index of the ball (0 to ballcount - 1). + * @return filled with the ball node index and radius. + * @throws Lib3MFException + */ + public Ball getBall(int index) throws Lib3MFException { + Pointer bufferBallInfo = new Memory(Ball.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getball.invokeInt(new java.lang.Object[]{mHandle, index, bufferBallInfo})); + Ball ballInfo = new Ball(); + ballInfo.readFromPointer(bufferBallInfo, 0); + return ballInfo; + } + + /** + * Adds a single ball to a mesh object. + * + * @param ballInfo contains the node index and radius. + * @return filled with the new Index of the ball. + * @throws Lib3MFException + */ + public int addBall(Ball ballInfo) throws Lib3MFException { + Pointer bufferBallInfo = new Memory(Ball.SIZE); + ballInfo.writeToPointer(bufferBallInfo, 0); + Pointer bufferIndex = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_addball.invokeInt(new java.lang.Object[]{mHandle, bufferBallInfo, bufferIndex})); + return bufferIndex.getInt(0); + } + + /** + * Sets the index and radius of a single ball of a mesh object. + * + * @param index Index of the ball (0 to ballcount - 1). + * @param ballInfo filled with the ball node index and radius. + * @throws Lib3MFException + */ + public void setBall(int index, Ball ballInfo) throws Lib3MFException { + Pointer bufferBallInfo = new Memory(Ball.SIZE); + ballInfo.writeToPointer(bufferBallInfo, 0); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_setball.invokeInt(new java.lang.Object[]{mHandle, index, bufferBallInfo})); + } + + /** + * Sets all ball indices and radii of a mesh object. + * + * @param ballInfo contains information of a number of balls + * @throws Lib3MFException + */ + public void setBalls(Ball[] ballInfo) throws Lib3MFException { + Pointer bufferBallInfo = new Memory(Math.max(1, Ball.SIZE * ballInfo.length)); + for (int i = 0; i < ballInfo.length; i++) { + ballInfo[i].writeToPointer(bufferBallInfo, i * Ball.SIZE); + } + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_setballs.invokeInt(new java.lang.Object[]{mHandle, (long) ballInfo.length, bufferBallInfo})); + } + + /** + * obtains all ball indices and radii of a mesh object. + * + * @return contains information of all balls + * @throws Lib3MFException + */ + public Ball[] getBalls() throws Lib3MFException { + Pointer countNeededBallInfo = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getballs.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededBallInfo, null})); + long countBallInfo = countNeededBallInfo.getLong(0); + Pointer bufferBallInfo = new Memory(Math.max(1, countBallInfo * Ball.SIZE)); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getballs.invokeInt(new java.lang.Object[]{mHandle, countBallInfo, countNeededBallInfo, bufferBallInfo})); + Ball ballInfo[] = new Ball[(int)countBallInfo]; + for (int i = 0; i < (int)countBallInfo; i++) { + ballInfo[i] = new Ball(); + ballInfo[i].readFromPointer(bufferBallInfo, i * Ball.SIZE); + } + return ballInfo; + } + + /** + * Returns the number of beamsets of a mesh object. + * + * @return filled with the beamset count. + * @throws Lib3MFException + */ + public int getBeamSetCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getbeamsetcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Adds an empty beamset to a mesh object + * + * @return the new beamset + * @throws Lib3MFException + */ + public BeamSet addBeamSet() throws Lib3MFException { + Pointer bufferBeamSet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_addbeamset.invokeInt(new java.lang.Object[]{mHandle, bufferBeamSet})); + Pointer valueBeamSet = bufferBeamSet.getPointer(0); + BeamSet beamSet = null; + if (valueBeamSet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BeamSet was a null pointer"); + } + beamSet = mWrapper.PolymorphicFactory(valueBeamSet, BeamSet.class); + return beamSet; + } + + /** + * Returns a beamset of a mesh object + * + * @param index index of the requested beamset (0 ... beamsetcount-1). + * @return the requested beamset + * @throws Lib3MFException + */ + public BeamSet getBeamSet(int index) throws Lib3MFException { + Pointer bufferBeamSet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getbeamset.invokeInt(new java.lang.Object[]{mHandle, index, bufferBeamSet})); + Pointer valueBeamSet = bufferBeamSet.getPointer(0); + BeamSet beamSet = null; + if (valueBeamSet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BeamSet was a null pointer"); + } + beamSet = mWrapper.PolymorphicFactory(valueBeamSet, BeamSet.class); + return beamSet; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/BeamLatticeNode.java b/Autogenerated/Bindings/Java8/lib3mf/BeamLatticeNode.java new file mode 100644 index 000000000..d993e5da1 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/BeamLatticeNode.java @@ -0,0 +1,132 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BeamLatticeNode extends ImplicitNode { + + public BeamLatticeNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the model resource id of the beam lattice + * + * @return the input port for the model resource id of the beam lattice (mesh with beamlattice extension) + * @throws Lib3MFException + */ + public ImplicitPort getInputBeamLattice() throws Lib3MFException { + Pointer bufferBeamLattice = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlatticenode_getinputbeamlattice.invokeInt(new java.lang.Object[]{mHandle, bufferBeamLattice})); + Pointer valueBeamLattice = bufferBeamLattice.getPointer(0); + ImplicitPort beamLattice = null; + if (valueBeamLattice == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BeamLattice was a null pointer"); + } + beamLattice = mWrapper.PolymorphicFactory(valueBeamLattice, ImplicitPort.class); + return beamLattice; + } + + /** + * Retrieves the input for the position + * + * @return the input port for the position + * @throws Lib3MFException + */ + public ImplicitPort getInputPos() throws Lib3MFException { + Pointer bufferPos = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlatticenode_getinputpos.invokeInt(new java.lang.Object[]{mHandle, bufferPos})); + Pointer valuePos = bufferPos.getPointer(0); + ImplicitPort pos = null; + if (valuePos == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Pos was a null pointer"); + } + pos = mWrapper.PolymorphicFactory(valuePos, ImplicitPort.class); + return pos; + } + + /** + * Retrieves the output + * + * @return the output port for the signed distance to the beam lattice + * @throws Lib3MFException + */ + public ImplicitPort getOutputDistance() throws Lib3MFException { + Pointer bufferDistance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlatticenode_getoutputdistance.invokeInt(new java.lang.Object[]{mHandle, bufferDistance})); + Pointer valueDistance = bufferDistance.getPointer(0); + ImplicitPort distance = null; + if (valueDistance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Distance was a null pointer"); + } + distance = mWrapper.PolymorphicFactory(valueDistance, ImplicitPort.class); + return distance; + } + + /** + * Sets the accurate range for distance computation + * + * @param accurateRange the accurate range in model units + * @throws Lib3MFException + */ + public void setAccurateRange(double accurateRange) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_beamlatticenode_setaccuraterange.invokeInt(new java.lang.Object[]{mHandle, accurateRange})); + } + + /** + * Retrieves the accurate range for distance computation + * + * @return the accurate range in model units + * @throws Lib3MFException + */ + public double getAccurateRange() throws Lib3MFException { + Pointer bufferAccurateRange = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlatticenode_getaccuraterange.invokeInt(new java.lang.Object[]{mHandle, bufferAccurateRange})); + return bufferAccurateRange.getDouble(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/BeamSet.java b/Autogenerated/Bindings/Java8/lib3mf/BeamSet.java new file mode 100644 index 000000000..247f99487 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/BeamSet.java @@ -0,0 +1,196 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BeamSet extends Base { + + public BeamSet(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Sets a beamset's name string + * + * @param name new name of the beamset. + * @throws Lib3MFException + */ + public void setName(String name) throws Lib3MFException { + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_setname.invokeInt(new java.lang.Object[]{mHandle, bufferName})); + } + + /** + * Retrieves a beamset's name string + * + * @return returns the name of the beamset. + * @throws Lib3MFException + */ + public String getName() throws Lib3MFException { + Pointer bytesNeededName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededName, null})); + int sizeName = bytesNeededName.getInt(0); + Pointer bufferName = new Memory(sizeName); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getname.invokeInt(new java.lang.Object[]{mHandle, sizeName, bytesNeededName, bufferName})); + return new String(bufferName.getByteArray(0, sizeName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets a beamset's identifier string + * + * @param identifier new name of the beamset. + * @throws Lib3MFException + */ + public void setIdentifier(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_setidentifier.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier})); + } + + /** + * Retrieves a beamset's identifier string + * + * @return returns the identifier of the beamset. + * @throws Lib3MFException + */ + public String getIdentifier() throws Lib3MFException { + Pointer bytesNeededIdentifier = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getidentifier.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededIdentifier, null})); + int sizeIdentifier = bytesNeededIdentifier.getInt(0); + Pointer bufferIdentifier = new Memory(sizeIdentifier); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getidentifier.invokeInt(new java.lang.Object[]{mHandle, sizeIdentifier, bytesNeededIdentifier, bufferIdentifier})); + return new String(bufferIdentifier.getByteArray(0, sizeIdentifier - 1), StandardCharsets.UTF_8); + } + + /** + * Retrieves the reference count of a beamset + * + * @return returns the reference count + * @throws Lib3MFException + */ + public int getReferenceCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getreferencecount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Sets the references of a beamset + * + * @param references the new indices of all beams in this beamset + * @throws Lib3MFException + */ + public void setReferences(int[] references) throws Lib3MFException { + Pointer bufferReferences = new Memory(Math.max(1, 4 * references.length)); + for (int i = 0; i < references.length; i++) { + bufferReferences.setInt(4 * i, references[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_beamset_setreferences.invokeInt(new java.lang.Object[]{mHandle, (long) references.length, bufferReferences})); + } + + /** + * Retrieves the references of a beamset + * + * @return retrieves the indices of all beams in this beamset + * @throws Lib3MFException + */ + public int[] getReferences() throws Lib3MFException { + Pointer countNeededReferences = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getreferences.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededReferences, Pointer.NULL})); + long countReferences = countNeededReferences.getLong(0); + Pointer bufferReferences = new Memory(Math.max(1, 4 * countReferences)); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getreferences.invokeInt(new java.lang.Object[]{mHandle, countReferences, countNeededReferences, bufferReferences})); + return bufferReferences.getIntArray(0, (int)countReferences); + } + + /** + * Retrieves the ball reference count of a beamset + * + * @return returns the ball reference count + * @throws Lib3MFException + */ + public int getBallReferenceCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getballreferencecount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Sets the ball references of a beamset + * + * @param ballReferences the new indices of all balls in this beamset + * @throws Lib3MFException + */ + public void setBallReferences(int[] ballReferences) throws Lib3MFException { + Pointer bufferBallReferences = new Memory(Math.max(1, 4 * ballReferences.length)); + for (int i = 0; i < ballReferences.length; i++) { + bufferBallReferences.setInt(4 * i, ballReferences[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_beamset_setballreferences.invokeInt(new java.lang.Object[]{mHandle, (long) ballReferences.length, bufferBallReferences})); + } + + /** + * Retrieves the ball references of a beamset + * + * @return retrieves the indices of all balls in this beamset + * @throws Lib3MFException + */ + public int[] getBallReferences() throws Lib3MFException { + Pointer countNeededBallReferences = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getballreferences.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededBallReferences, Pointer.NULL})); + long countBallReferences = countNeededBallReferences.getLong(0); + Pointer bufferBallReferences = new Memory(Math.max(1, 4 * countBallReferences)); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getballreferences.invokeInt(new java.lang.Object[]{mHandle, countBallReferences, countNeededBallReferences, bufferBallReferences})); + return bufferBallReferences.getIntArray(0, (int)countBallReferences); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/BooleanObject.java b/Autogenerated/Bindings/Java8/lib3mf/BooleanObject.java new file mode 100644 index 000000000..8340db351 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/BooleanObject.java @@ -0,0 +1,271 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BooleanObject extends Object { + + public BooleanObject(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Sets the base object and transform for the boolean shape. + * + * @param baseObject base object of the boolean shape + * @param transform transform applied to the base object + * @throws Lib3MFException + */ + public void setBaseObject(Object baseObject, Transform transform) throws Lib3MFException { + Pointer baseObjectHandle = null; + if (baseObject != null) { + baseObjectHandle = baseObject.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BaseObject is a null value."); + } + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_setbaseobject.invokeInt(new java.lang.Object[]{mHandle, baseObjectHandle, bufferTransform})); + } + + /** + * Returns the base object of the boolean shape. + * + * @return base object of the boolean shape + * @throws Lib3MFException + */ + public Object getBaseObject() throws Lib3MFException { + Pointer bufferBaseObject = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_getbaseobject.invokeInt(new java.lang.Object[]{mHandle, bufferBaseObject})); + Pointer valueBaseObject = bufferBaseObject.getPointer(0); + Object baseObject = null; + if (valueBaseObject == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BaseObject was a null pointer"); + } + baseObject = mWrapper.PolymorphicFactory(valueBaseObject, Object.class); + return baseObject; + } + + /** + * Sets the base transform of the boolean shape. + * + * @param transform transform applied to the base object + * @throws Lib3MFException + */ + public void setBaseTransform(Transform transform) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_setbasetransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + } + + /** + * Returns the base transform of the boolean shape. + * + * @return transform applied to the base object + * @throws Lib3MFException + */ + public Transform getBaseTransform() throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_getbasetransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * Sets the boolean operation used for the boolean shape. + * + * @param operation boolean operation used for the shape + * @throws Lib3MFException + */ + public void setOperation(Lib3MFWrapper.BooleanOperation operation) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_setoperation.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertBooleanOperationToConst(operation)})); + } + + /** + * Returns the boolean operation used for the boolean shape. + * + * @return boolean operation used for the shape + * @throws Lib3MFException + */ + public Lib3MFWrapper.BooleanOperation getOperation() throws Lib3MFException { + Pointer bufferOperation = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_getoperation.invokeInt(new java.lang.Object[]{mHandle, bufferOperation})); + return Lib3MFWrapper.EnumConversion.convertConstToBooleanOperation(bufferOperation.getInt(0)); + } + + /** + * Enables or disables CSG field evaluation for boolean-to-mesh materialization. + * + * @param cSGModeEnabled if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback + * @throws Lib3MFException + */ + public void setCSGModeEnabled(boolean cSGModeEnabled) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_setcsgmodeenabled.invokeInt(new java.lang.Object[]{mHandle, cSGModeEnabled})); + } + + /** + * Returns whether CSG field evaluation is enabled for boolean-to-mesh materialization. + * + * @return if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback + * @throws Lib3MFException + */ + public boolean getCSGModeEnabled() throws Lib3MFException { + Pointer bufferCSGModeEnabled = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_getcsgmodeenabled.invokeInt(new java.lang.Object[]{mHandle, bufferCSGModeEnabled})); + return bufferCSGModeEnabled.getByte(0) != 0; + } + + /** + * Sets the extraction grid resolution used for boolean-to-mesh materialization. + * + * @param gridResolution extraction grid resolution for boolean surface extraction + * @throws Lib3MFException + */ + public void setExtractionGridResolution(int gridResolution) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_setextractiongridresolution.invokeInt(new java.lang.Object[]{mHandle, gridResolution})); + } + + /** + * Returns the extraction grid resolution used for boolean-to-mesh materialization. + * + * @return extraction grid resolution for boolean surface extraction + * @throws Lib3MFException + */ + public int getExtractionGridResolution() throws Lib3MFException { + Pointer bufferGridResolution = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_getextractiongridresolution.invokeInt(new java.lang.Object[]{mHandle, bufferGridResolution})); + return bufferGridResolution.getInt(0); + } + + /** + * Returns the number of operands in the boolean sequence. + * + * @return number of operands in the boolean sequence + * @throws Lib3MFException + */ + public int getOperandCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_getoperandcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Adds an operand object to the boolean sequence. + * + * @param operandObject mesh object used as operand + * @param transform transform applied to the operand object + * @throws Lib3MFException + */ + public void addOperand(MeshObject operandObject, Transform transform) throws Lib3MFException { + Pointer operandObjectHandle = null; + if (operandObject != null) { + operandObjectHandle = operandObject.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "OperandObject is a null value."); + } + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_addoperand.invokeInt(new java.lang.Object[]{mHandle, operandObjectHandle, bufferTransform})); + } + + /** + * Returns one operand object and transform from the boolean sequence. + * + * @param index index of the operand in the boolean sequence + * @return GetOperand Result Tuple + * @throws Lib3MFException + */ + public GetOperandResult getOperand(int index) throws Lib3MFException { + Pointer bufferOperandObject = new Memory(8); + Pointer bufferTransform = new Memory(Transform.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_getoperand.invokeInt(new java.lang.Object[]{mHandle, index, bufferOperandObject, bufferTransform})); + Pointer valueOperandObject = bufferOperandObject.getPointer(0); + MeshObject operandObject = null; + if (valueOperandObject == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "OperandObject was a null pointer"); + } + operandObject = mWrapper.PolymorphicFactory(valueOperandObject, MeshObject.class); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + GetOperandResult returnTuple = new GetOperandResult(); + returnTuple.OperandObject = operandObject; + returnTuple.Transform = transform; + return returnTuple; + } + + public static class GetOperandResult { + /** + * mesh object used as operand + */ + public MeshObject OperandObject; + + /** + * transform applied to the operand object + */ + public Transform Transform; + + } + /** + * Materializes the boolean shape into a newly created mesh object. + * + * @return new mesh object containing the tessellated boolean shape + * @throws Lib3MFException + */ + public MeshObject mergeToMeshObject() throws Lib3MFException { + Pointer bufferMeshObject = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_mergetomeshobject.invokeInt(new java.lang.Object[]{mHandle, bufferMeshObject})); + Pointer valueMeshObject = bufferMeshObject.getPointer(0); + MeshObject meshObject = null; + if (valueMeshObject == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MeshObject was a null pointer"); + } + meshObject = mWrapper.PolymorphicFactory(valueMeshObject, MeshObject.class); + return meshObject; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/BooleanObjectIterator.java b/Autogenerated/Bindings/Java8/lib3mf/BooleanObjectIterator.java new file mode 100644 index 000000000..badb9bcf6 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/BooleanObjectIterator.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BooleanObjectIterator extends ResourceIterator { + + public BooleanObjectIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the BooleanObject the iterator points at. + * + * @return returns the BooleanObject instance. + * @throws Lib3MFException + */ + public BooleanObject getCurrentBooleanObject() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobjectiterator_getcurrentbooleanobject.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + BooleanObject resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, BooleanObject.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Box.java b/Autogenerated/Bindings/Java8/lib3mf/Box.java new file mode 100644 index 000000000..e07728552 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Box.java @@ -0,0 +1,71 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Box { + + public float[] MinCoordinate = new float[3]; + + public float[] MaxCoordinate = new float[3]; + + public static final int SIZE = 24; + + public void readFromPointer(Pointer p, long offset) { + MinCoordinate[0] = p.getFloat(offset + 0); + MinCoordinate[1] = p.getFloat(offset + 4); + MinCoordinate[2] = p.getFloat(offset + 8); + MaxCoordinate[0] = p.getFloat(offset + 12); + MaxCoordinate[1] = p.getFloat(offset + 16); + MaxCoordinate[2] = p.getFloat(offset + 20); + } + + public void writeToPointer(Pointer p, long offset) { + p.setFloat(offset + 0, MinCoordinate[0]); + p.setFloat(offset + 4, MinCoordinate[1]); + p.setFloat(offset + 8, MinCoordinate[2]); + p.setFloat(offset + 12, MaxCoordinate[0]); + p.setFloat(offset + 16, MaxCoordinate[1]); + p.setFloat(offset + 20, MaxCoordinate[2]); + } + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/BuildItem.java b/Autogenerated/Bindings/Java8/lib3mf/BuildItem.java new file mode 100644 index 000000000..5f2cbfd8c --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/BuildItem.java @@ -0,0 +1,230 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BuildItem extends Base { + + public BuildItem(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the object resource associated to a build item + * + * @return returns the associated resource instance + * @throws Lib3MFException + */ + public Object getObjectResource() throws Lib3MFException { + Pointer bufferObjectResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getobjectresource.invokeInt(new java.lang.Object[]{mHandle, bufferObjectResource})); + Pointer valueObjectResource = bufferObjectResource.getPointer(0); + Object objectResource = null; + if (valueObjectResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ObjectResource was a null pointer"); + } + objectResource = mWrapper.PolymorphicFactory(valueObjectResource, Object.class); + return objectResource; + } + + /** + * returns, whether a build item has a UUID and, if true, the build item's UUID + * + * @return GetUUID Result Tuple + * @throws Lib3MFException + */ + public GetUUIDResult getUUID() throws Lib3MFException { + Pointer bufferHasUUID = new Memory(1); + Pointer bytesNeededUUID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getuuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, 0, bytesNeededUUID, null})); + int sizeUUID = bytesNeededUUID.getInt(0); + Pointer bufferUUID = new Memory(sizeUUID); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getuuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, sizeUUID, bytesNeededUUID, bufferUUID})); + GetUUIDResult returnTuple = new GetUUIDResult(); + returnTuple.HasUUID = bufferHasUUID.getByte(0) != 0; + returnTuple.UUID = new String(bufferUUID.getByteArray(0, sizeUUID - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetUUIDResult { + /** + * flag whether the build item has a UUID + */ + public boolean HasUUID; + + /** + * the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + */ + public String UUID; + + } + /** + * sets the build item's UUID + * + * @param uUID the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * @throws Lib3MFException + */ + public void setUUID(String uUID) throws Lib3MFException { + byte[] bytesUUID = uUID.getBytes(StandardCharsets.UTF_8); + Memory bufferUUID = new Memory(bytesUUID.length + 1); + bufferUUID.write(0, bytesUUID, 0, bytesUUID.length); + bufferUUID.setByte(bytesUUID.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_setuuid.invokeInt(new java.lang.Object[]{mHandle, bufferUUID})); + } + + /** + * Retrieves the object UniqueResourceID associated to a build item + * + * @return returns the UniqueResourceID of the object + * @throws Lib3MFException + */ + public int getObjectResourceID() throws Lib3MFException { + Pointer bufferUniqueResourceID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getobjectresourceid.invokeInt(new java.lang.Object[]{mHandle, bufferUniqueResourceID})); + return bufferUniqueResourceID.getInt(0); + } + + /** + * Checks, if a build item has a non-identity transformation matrix + * + * @return returns true, if the transformation matrix is not the identity + * @throws Lib3MFException + */ + public boolean hasObjectTransform() throws Lib3MFException { + Pointer bufferHasTransform = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_hasobjecttransform.invokeInt(new java.lang.Object[]{mHandle, bufferHasTransform})); + return bufferHasTransform.getByte(0) != 0; + } + + /** + * Retrieves a build item's transformation matrix. + * + * @return returns the transformation matrix + * @throws Lib3MFException + */ + public Transform getObjectTransform() throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getobjecttransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * Sets a build item's transformation matrix. + * + * @param transform new transformation matrix + * @throws Lib3MFException + */ + public void setObjectTransform(Transform transform) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_setobjecttransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + } + + /** + * Retrieves a build item's part number string + * + * @return Returns a build item's part number string + * @throws Lib3MFException + */ + public String getPartNumber() throws Lib3MFException { + Pointer bytesNeededPartNumber = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getpartnumber.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededPartNumber, null})); + int sizePartNumber = bytesNeededPartNumber.getInt(0); + Pointer bufferPartNumber = new Memory(sizePartNumber); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getpartnumber.invokeInt(new java.lang.Object[]{mHandle, sizePartNumber, bytesNeededPartNumber, bufferPartNumber})); + return new String(bufferPartNumber.getByteArray(0, sizePartNumber - 1), StandardCharsets.UTF_8); + } + + /** + * Sets a build item's part number string + * + * @param setPartnumber new part number string for referencing parts from the outside world + * @throws Lib3MFException + */ + public void setPartNumber(String setPartnumber) throws Lib3MFException { + byte[] bytesSetPartnumber = setPartnumber.getBytes(StandardCharsets.UTF_8); + Memory bufferSetPartnumber = new Memory(bytesSetPartnumber.length + 1); + bufferSetPartnumber.write(0, bytesSetPartnumber, 0, bytesSetPartnumber.length); + bufferSetPartnumber.setByte(bytesSetPartnumber.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_setpartnumber.invokeInt(new java.lang.Object[]{mHandle, bufferSetPartnumber})); + } + + /** + * Returns the metadatagroup of this build item + * + * @return returns an Instance of the metadatagroup of this build item + * @throws Lib3MFException + */ + public MetaDataGroup getMetaDataGroup() throws Lib3MFException { + Pointer bufferMetaDataGroup = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getmetadatagroup.invokeInt(new java.lang.Object[]{mHandle, bufferMetaDataGroup})); + Pointer valueMetaDataGroup = bufferMetaDataGroup.getPointer(0); + MetaDataGroup metaDataGroup = null; + if (valueMetaDataGroup == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MetaDataGroup was a null pointer"); + } + metaDataGroup = mWrapper.PolymorphicFactory(valueMetaDataGroup, MetaDataGroup.class); + return metaDataGroup; + } + + /** + * Returns the outbox of a build item + * + * @return Outbox of this build item + * @throws Lib3MFException + */ + public Box getOutbox() throws Lib3MFException { + Pointer bufferOutbox = new Memory(Box.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getoutbox.invokeInt(new java.lang.Object[]{mHandle, bufferOutbox})); + Box outbox = new Box(); + outbox.readFromPointer(bufferOutbox, 0); + return outbox; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/BuildItemIterator.java b/Autogenerated/Bindings/Java8/lib3mf/BuildItemIterator.java new file mode 100644 index 000000000..16a098c61 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/BuildItemIterator.java @@ -0,0 +1,128 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BuildItemIterator extends Base { + + public BuildItemIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Iterates to the next build item in the list. + * + * @return Iterates to the next build item in the list. + * @throws Lib3MFException + */ + public boolean moveNext() throws Lib3MFException { + Pointer bufferHasNext = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_builditemiterator_movenext.invokeInt(new java.lang.Object[]{mHandle, bufferHasNext})); + return bufferHasNext.getByte(0) != 0; + } + + /** + * Iterates to the previous build item in the list. + * + * @return Iterates to the previous build item in the list. + * @throws Lib3MFException + */ + public boolean movePrevious() throws Lib3MFException { + Pointer bufferHasPrevious = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_builditemiterator_moveprevious.invokeInt(new java.lang.Object[]{mHandle, bufferHasPrevious})); + return bufferHasPrevious.getByte(0) != 0; + } + + /** + * Returns the build item the iterator points at. + * + * @return returns the build item instance. + * @throws Lib3MFException + */ + public BuildItem getCurrent() throws Lib3MFException { + Pointer bufferBuildItem = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_builditemiterator_getcurrent.invokeInt(new java.lang.Object[]{mHandle, bufferBuildItem})); + Pointer valueBuildItem = bufferBuildItem.getPointer(0); + BuildItem buildItem = null; + if (valueBuildItem == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BuildItem was a null pointer"); + } + buildItem = mWrapper.PolymorphicFactory(valueBuildItem, BuildItem.class); + return buildItem; + } + + /** + * Creates a new build item iterator with the same build item list. + * + * @return returns the cloned Iterator instance + * @throws Lib3MFException + */ + public BuildItemIterator clone_() throws Lib3MFException { + Pointer bufferOutBuildItemIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_builditemiterator_clone.invokeInt(new java.lang.Object[]{mHandle, bufferOutBuildItemIterator})); + Pointer valueOutBuildItemIterator = bufferOutBuildItemIterator.getPointer(0); + BuildItemIterator outBuildItemIterator = null; + if (valueOutBuildItemIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "OutBuildItemIterator was a null pointer"); + } + outBuildItemIterator = mWrapper.PolymorphicFactory(valueOutBuildItemIterator, BuildItemIterator.class); + return outBuildItemIterator; + } + + /** + * Returns the number of build items the iterator captures. + * + * @return returns the number of build items the iterator captures. + * @throws Lib3MFException + */ + public long count() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_builditemiterator_count.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/CeilNode.java b/Autogenerated/Bindings/Java8/lib3mf/CeilNode.java new file mode 100644 index 000000000..bc450c7b2 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/CeilNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class CeilNode extends OneInputNode { + + public CeilNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ClampNode.java b/Autogenerated/Bindings/Java8/lib3mf/ClampNode.java new file mode 100644 index 000000000..8d625cc15 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ClampNode.java @@ -0,0 +1,92 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ClampNode extends OneInputNode { + + public ClampNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the lower limit + * + * @return the input for the lower limit + * @throws Lib3MFException + */ + public ImplicitPort getInputMin() throws Lib3MFException { + Pointer bufferMin = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_clampnode_getinputmin.invokeInt(new java.lang.Object[]{mHandle, bufferMin})); + Pointer valueMin = bufferMin.getPointer(0); + ImplicitPort min = null; + if (valueMin == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Min was a null pointer"); + } + min = mWrapper.PolymorphicFactory(valueMin, ImplicitPort.class); + return min; + } + + /** + * Retrieves the input for the upper limit + * + * @return the input for the upper limit + * @throws Lib3MFException + */ + public ImplicitPort getInputMax() throws Lib3MFException { + Pointer bufferMax = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_clampnode_getinputmax.invokeInt(new java.lang.Object[]{mHandle, bufferMax})); + Pointer valueMax = bufferMax.getPointer(0); + ImplicitPort max = null; + if (valueMax == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Max was a null pointer"); + } + max = mWrapper.PolymorphicFactory(valueMax, ImplicitPort.class); + return max; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Color.java b/Autogenerated/Bindings/Java8/lib3mf/Color.java new file mode 100644 index 000000000..2530c2382 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Color.java @@ -0,0 +1,71 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Color { + + public byte Red; + + public byte Green; + + public byte Blue; + + public byte Alpha; + + public static final int SIZE = 4; + + public void readFromPointer(Pointer p, long offset) { + Red = p.getByte(offset + 0); + Green = p.getByte(offset + 1); + Blue = p.getByte(offset + 2); + Alpha = p.getByte(offset + 3); + } + + public void writeToPointer(Pointer p, long offset) { + p.setByte(offset + 0, Red); + p.setByte(offset + 1, Green); + p.setByte(offset + 2, Blue); + p.setByte(offset + 3, Alpha); + } + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ColorGroup.java b/Autogenerated/Bindings/Java8/lib3mf/ColorGroup.java new file mode 100644 index 000000000..8fab9d276 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ColorGroup.java @@ -0,0 +1,136 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ColorGroup extends Resource { + + public ColorGroup(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the count of base materials in this Color Group. + * + * @return returns the count of colors within this color group. + * @throws Lib3MFException + */ + public int getCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_colorgroup_getcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * returns all the PropertyIDs of all colors within this group + * + * @return PropertyID of the color in the color group. + * @throws Lib3MFException + */ + public int[] getAllPropertyIDs() throws Lib3MFException { + Pointer countNeededPropertyIDs = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_colorgroup_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededPropertyIDs, Pointer.NULL})); + long countPropertyIDs = countNeededPropertyIDs.getLong(0); + Pointer bufferPropertyIDs = new Memory(Math.max(1, 4 * countPropertyIDs)); + mWrapper.checkError(this, mWrapper.lib3mf_colorgroup_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, countPropertyIDs, countNeededPropertyIDs, bufferPropertyIDs})); + return bufferPropertyIDs.getIntArray(0, (int)countPropertyIDs); + } + + /** + * Adds a new value. + * + * @param theColor The new color + * @return PropertyID of the new color within this color group. + * @throws Lib3MFException + */ + public int addColor(Color theColor) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + theColor.writeToPointer(bufferTheColor, 0); + Pointer bufferPropertyID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_colorgroup_addcolor.invokeInt(new java.lang.Object[]{mHandle, bufferTheColor, bufferPropertyID})); + return bufferPropertyID.getInt(0); + } + + /** + * Removes a color from the color group. + * + * @param propertyID PropertyID of the color to be removed from the color group. + * @throws Lib3MFException + */ + public void removeColor(int propertyID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_colorgroup_removecolor.invokeInt(new java.lang.Object[]{mHandle, propertyID})); + } + + /** + * Sets a color value. + * + * @param propertyID PropertyID of a color within this color group. + * @param theColor The color + * @throws Lib3MFException + */ + public void setColor(int propertyID, Color theColor) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + theColor.writeToPointer(bufferTheColor, 0); + mWrapper.checkError(this, mWrapper.lib3mf_colorgroup_setcolor.invokeInt(new java.lang.Object[]{mHandle, propertyID, bufferTheColor})); + } + + /** + * Sets a color value. + * + * @param propertyID PropertyID of a color within this color group. + * @return The color + * @throws Lib3MFException + */ + public Color getColor(int propertyID) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_colorgroup_getcolor.invokeInt(new java.lang.Object[]{mHandle, propertyID, bufferTheColor})); + Color theColor = new Color(); + theColor.readFromPointer(bufferTheColor, 0); + return theColor; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ColorGroupIterator.java b/Autogenerated/Bindings/Java8/lib3mf/ColorGroupIterator.java new file mode 100644 index 000000000..53d401836 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ColorGroupIterator.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ColorGroupIterator extends ResourceIterator { + + public ColorGroupIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the ColorGroup the iterator points at. + * + * @return returns the ColorGroup instance. + * @throws Lib3MFException + */ + public ColorGroup getCurrentColorGroup() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_colorgroupiterator_getcurrentcolorgroup.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + ColorGroup resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, ColorGroup.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Component.java b/Autogenerated/Bindings/Java8/lib3mf/Component.java new file mode 100644 index 000000000..c81e41b19 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Component.java @@ -0,0 +1,169 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Component extends Base { + + public Component(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the Resource Instance of the component. + * + * @return filled with the Resource Instance. + * @throws Lib3MFException + */ + public Object getObjectResource() throws Lib3MFException { + Pointer bufferObjectResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_component_getobjectresource.invokeInt(new java.lang.Object[]{mHandle, bufferObjectResource})); + Pointer valueObjectResource = bufferObjectResource.getPointer(0); + Object objectResource = null; + if (valueObjectResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ObjectResource was a null pointer"); + } + objectResource = mWrapper.PolymorphicFactory(valueObjectResource, Object.class); + return objectResource; + } + + /** + * Returns the UniqueResourceID of the component. + * + * @return returns the UniqueResourceID. + * @throws Lib3MFException + */ + public int getObjectResourceID() throws Lib3MFException { + Pointer bufferUniqueResourceID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_component_getobjectresourceid.invokeInt(new java.lang.Object[]{mHandle, bufferUniqueResourceID})); + return bufferUniqueResourceID.getInt(0); + } + + /** + * returns, whether a component has a UUID and, if true, the component's UUID + * + * @return GetUUID Result Tuple + * @throws Lib3MFException + */ + public GetUUIDResult getUUID() throws Lib3MFException { + Pointer bufferHasUUID = new Memory(1); + Pointer bytesNeededUUID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_component_getuuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, 0, bytesNeededUUID, null})); + int sizeUUID = bytesNeededUUID.getInt(0); + Pointer bufferUUID = new Memory(sizeUUID); + mWrapper.checkError(this, mWrapper.lib3mf_component_getuuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, sizeUUID, bytesNeededUUID, bufferUUID})); + GetUUIDResult returnTuple = new GetUUIDResult(); + returnTuple.HasUUID = bufferHasUUID.getByte(0) != 0; + returnTuple.UUID = new String(bufferUUID.getByteArray(0, sizeUUID - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetUUIDResult { + /** + * flag whether the component has a UUID + */ + public boolean HasUUID; + + /** + * the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + */ + public String UUID; + + } + /** + * sets the component's UUID + * + * @param uUID the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * @throws Lib3MFException + */ + public void setUUID(String uUID) throws Lib3MFException { + byte[] bytesUUID = uUID.getBytes(StandardCharsets.UTF_8); + Memory bufferUUID = new Memory(bytesUUID.length + 1); + bufferUUID.write(0, bytesUUID, 0, bytesUUID.length); + bufferUUID.setByte(bytesUUID.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_component_setuuid.invokeInt(new java.lang.Object[]{mHandle, bufferUUID})); + } + + /** + * Returns, if the component has a different transformation than the identity matrix + * + * @return if true is returned, the transformation is not equal than the identity + * @throws Lib3MFException + */ + public boolean hasTransform() throws Lib3MFException { + Pointer bufferHasTransform = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_component_hastransform.invokeInt(new java.lang.Object[]{mHandle, bufferHasTransform})); + return bufferHasTransform.getByte(0) != 0; + } + + /** + * Returns the transformation matrix of the component. + * + * @return filled with the component transformation matrix + * @throws Lib3MFException + */ + public Transform getTransform() throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_component_gettransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * Sets the transformation matrix of the component. + * + * @param transform new transformation matrix + * @throws Lib3MFException + */ + public void setTransform(Transform transform) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + mWrapper.checkError(this, mWrapper.lib3mf_component_settransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ComponentsObject.java b/Autogenerated/Bindings/Java8/lib3mf/ComponentsObject.java new file mode 100644 index 000000000..0bef522b1 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ComponentsObject.java @@ -0,0 +1,115 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ComponentsObject extends Object { + + public ComponentsObject(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Adds a new component to a components object. + * + * @param objectResource object to add as component. Must not lead to circular references! + * @param transform optional transform matrix for the component. + * @return new component instance + * @throws Lib3MFException + */ + public Component addComponent(Object objectResource, Transform transform) throws Lib3MFException { + Pointer objectResourceHandle = null; + if (objectResource != null) { + objectResourceHandle = objectResource.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ObjectResource is a null value."); + } + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + Pointer bufferComponentInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_componentsobject_addcomponent.invokeInt(new java.lang.Object[]{mHandle, objectResourceHandle, bufferTransform, bufferComponentInstance})); + Pointer valueComponentInstance = bufferComponentInstance.getPointer(0); + Component componentInstance = null; + if (valueComponentInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ComponentInstance was a null pointer"); + } + componentInstance = mWrapper.PolymorphicFactory(valueComponentInstance, Component.class); + return componentInstance; + } + + /** + * Retrieves a component from a component object. + * + * @param index index of the component to retrieve (0 to componentcount - 1) + * @return component instance + * @throws Lib3MFException + */ + public Component getComponent(int index) throws Lib3MFException { + Pointer bufferComponentInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_componentsobject_getcomponent.invokeInt(new java.lang.Object[]{mHandle, index, bufferComponentInstance})); + Pointer valueComponentInstance = bufferComponentInstance.getPointer(0); + Component componentInstance = null; + if (valueComponentInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ComponentInstance was a null pointer"); + } + componentInstance = mWrapper.PolymorphicFactory(valueComponentInstance, Component.class); + return componentInstance; + } + + /** + * Retrieves a component count of a component object. + * + * @return returns the component count + * @throws Lib3MFException + */ + public int getComponentCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_componentsobject_getcomponentcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ComponentsObjectIterator.java b/Autogenerated/Bindings/Java8/lib3mf/ComponentsObjectIterator.java new file mode 100644 index 000000000..b5da35646 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ComponentsObjectIterator.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ComponentsObjectIterator extends ResourceIterator { + + public ComponentsObjectIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the ComponentsObject the iterator points at. + * + * @return returns the ComponentsObject instance. + * @throws Lib3MFException + */ + public ComponentsObject getCurrentComponentsObject() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_componentsobjectiterator_getcurrentcomponentsobject.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + ComponentsObject resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, ComponentsObject.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ComposeMatrixNode.java b/Autogenerated/Bindings/Java8/lib3mf/ComposeMatrixNode.java new file mode 100644 index 000000000..5d4a4272e --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ComposeMatrixNode.java @@ -0,0 +1,362 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ComposeMatrixNode extends ImplicitNode { + + public ComposeMatrixNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the element 0 0 + * + * @return the input for the m00 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM00() throws Lib3MFException { + Pointer bufferM00 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm00.invokeInt(new java.lang.Object[]{mHandle, bufferM00})); + Pointer valueM00 = bufferM00.getPointer(0); + ImplicitPort m00 = null; + if (valueM00 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M00 was a null pointer"); + } + m00 = mWrapper.PolymorphicFactory(valueM00, ImplicitPort.class); + return m00; + } + + /** + * Retrieves the input for the element 0 1 + * + * @return the input for the m01 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM01() throws Lib3MFException { + Pointer bufferM01 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm01.invokeInt(new java.lang.Object[]{mHandle, bufferM01})); + Pointer valueM01 = bufferM01.getPointer(0); + ImplicitPort m01 = null; + if (valueM01 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M01 was a null pointer"); + } + m01 = mWrapper.PolymorphicFactory(valueM01, ImplicitPort.class); + return m01; + } + + /** + * Retrieves the input for the element 0 2 + * + * @return the input for the m02 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM02() throws Lib3MFException { + Pointer bufferM02 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm02.invokeInt(new java.lang.Object[]{mHandle, bufferM02})); + Pointer valueM02 = bufferM02.getPointer(0); + ImplicitPort m02 = null; + if (valueM02 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M02 was a null pointer"); + } + m02 = mWrapper.PolymorphicFactory(valueM02, ImplicitPort.class); + return m02; + } + + /** + * Retrieves the input for the element 0 3 + * + * @return the input for the m03 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM03() throws Lib3MFException { + Pointer bufferM03 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm03.invokeInt(new java.lang.Object[]{mHandle, bufferM03})); + Pointer valueM03 = bufferM03.getPointer(0); + ImplicitPort m03 = null; + if (valueM03 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M03 was a null pointer"); + } + m03 = mWrapper.PolymorphicFactory(valueM03, ImplicitPort.class); + return m03; + } + + /** + * Retrieves the input for the element 1 0 + * + * @return the input for the m10 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM10() throws Lib3MFException { + Pointer bufferM10 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm10.invokeInt(new java.lang.Object[]{mHandle, bufferM10})); + Pointer valueM10 = bufferM10.getPointer(0); + ImplicitPort m10 = null; + if (valueM10 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M10 was a null pointer"); + } + m10 = mWrapper.PolymorphicFactory(valueM10, ImplicitPort.class); + return m10; + } + + /** + * Retrieves the input for the element 1 1 + * + * @return the input for the m11 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM11() throws Lib3MFException { + Pointer bufferM11 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm11.invokeInt(new java.lang.Object[]{mHandle, bufferM11})); + Pointer valueM11 = bufferM11.getPointer(0); + ImplicitPort m11 = null; + if (valueM11 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M11 was a null pointer"); + } + m11 = mWrapper.PolymorphicFactory(valueM11, ImplicitPort.class); + return m11; + } + + /** + * Retrieves the input for the element 1 2 + * + * @return the input for the m12 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM12() throws Lib3MFException { + Pointer bufferM12 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm12.invokeInt(new java.lang.Object[]{mHandle, bufferM12})); + Pointer valueM12 = bufferM12.getPointer(0); + ImplicitPort m12 = null; + if (valueM12 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M12 was a null pointer"); + } + m12 = mWrapper.PolymorphicFactory(valueM12, ImplicitPort.class); + return m12; + } + + /** + * Retrieves the input for the element 1 3 + * + * @return the input for the m13 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM13() throws Lib3MFException { + Pointer bufferM13 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm13.invokeInt(new java.lang.Object[]{mHandle, bufferM13})); + Pointer valueM13 = bufferM13.getPointer(0); + ImplicitPort m13 = null; + if (valueM13 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M13 was a null pointer"); + } + m13 = mWrapper.PolymorphicFactory(valueM13, ImplicitPort.class); + return m13; + } + + /** + * Retrieves the input for the element 2 0 + * + * @return the input for the m20 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM20() throws Lib3MFException { + Pointer bufferM20 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm20.invokeInt(new java.lang.Object[]{mHandle, bufferM20})); + Pointer valueM20 = bufferM20.getPointer(0); + ImplicitPort m20 = null; + if (valueM20 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M20 was a null pointer"); + } + m20 = mWrapper.PolymorphicFactory(valueM20, ImplicitPort.class); + return m20; + } + + /** + * Retrieves the input for the element 2 1 + * + * @return + * @throws Lib3MFException + */ + public ImplicitPort getInputM21() throws Lib3MFException { + Pointer bufferM21 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm21.invokeInt(new java.lang.Object[]{mHandle, bufferM21})); + Pointer valueM21 = bufferM21.getPointer(0); + ImplicitPort m21 = null; + if (valueM21 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M21 was a null pointer"); + } + m21 = mWrapper.PolymorphicFactory(valueM21, ImplicitPort.class); + return m21; + } + + /** + * Retrieves the input for the element 2 2 + * + * @return the input for the m22 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM22() throws Lib3MFException { + Pointer bufferM22 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm22.invokeInt(new java.lang.Object[]{mHandle, bufferM22})); + Pointer valueM22 = bufferM22.getPointer(0); + ImplicitPort m22 = null; + if (valueM22 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M22 was a null pointer"); + } + m22 = mWrapper.PolymorphicFactory(valueM22, ImplicitPort.class); + return m22; + } + + /** + * Retrieves the input for the element 2 3 + * + * @return the input for the m23 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM23() throws Lib3MFException { + Pointer bufferM23 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm23.invokeInt(new java.lang.Object[]{mHandle, bufferM23})); + Pointer valueM23 = bufferM23.getPointer(0); + ImplicitPort m23 = null; + if (valueM23 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M23 was a null pointer"); + } + m23 = mWrapper.PolymorphicFactory(valueM23, ImplicitPort.class); + return m23; + } + + /** + * Retrieves the input for the element 3 0 + * + * @return the input for the m30 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM30() throws Lib3MFException { + Pointer bufferM30 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm30.invokeInt(new java.lang.Object[]{mHandle, bufferM30})); + Pointer valueM30 = bufferM30.getPointer(0); + ImplicitPort m30 = null; + if (valueM30 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M30 was a null pointer"); + } + m30 = mWrapper.PolymorphicFactory(valueM30, ImplicitPort.class); + return m30; + } + + /** + * Retrieves the input for the element 3 1 + * + * @return the input for the m31 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM31() throws Lib3MFException { + Pointer bufferM31 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm31.invokeInt(new java.lang.Object[]{mHandle, bufferM31})); + Pointer valueM31 = bufferM31.getPointer(0); + ImplicitPort m31 = null; + if (valueM31 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M31 was a null pointer"); + } + m31 = mWrapper.PolymorphicFactory(valueM31, ImplicitPort.class); + return m31; + } + + /** + * Retrieves the input for the element 3 2 + * + * @return the input for the m32 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM32() throws Lib3MFException { + Pointer bufferM32 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm32.invokeInt(new java.lang.Object[]{mHandle, bufferM32})); + Pointer valueM32 = bufferM32.getPointer(0); + ImplicitPort m32 = null; + if (valueM32 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M32 was a null pointer"); + } + m32 = mWrapper.PolymorphicFactory(valueM32, ImplicitPort.class); + return m32; + } + + /** + * Retrieves the input for the element 3 3 + * + * @return the input for the m33 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM33() throws Lib3MFException { + Pointer bufferM33 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm33.invokeInt(new java.lang.Object[]{mHandle, bufferM33})); + Pointer valueM33 = bufferM33.getPointer(0); + ImplicitPort m33 = null; + if (valueM33 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M33 was a null pointer"); + } + m33 = mWrapper.PolymorphicFactory(valueM33, ImplicitPort.class); + return m33; + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputResult() throws Lib3MFException { + Pointer bufferResult = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getoutputresult.invokeInt(new java.lang.Object[]{mHandle, bufferResult})); + Pointer valueResult = bufferResult.getPointer(0); + ImplicitPort result = null; + if (valueResult == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Result was a null pointer"); + } + result = mWrapper.PolymorphicFactory(valueResult, ImplicitPort.class); + return result; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ComposeVectorNode.java b/Autogenerated/Bindings/Java8/lib3mf/ComposeVectorNode.java new file mode 100644 index 000000000..ed987c770 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ComposeVectorNode.java @@ -0,0 +1,128 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ComposeVectorNode extends ImplicitNode { + + public ComposeVectorNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the x component + * + * @return the input for the x component + * @throws Lib3MFException + */ + public ImplicitPort getInputX() throws Lib3MFException { + Pointer bufferX = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composevectornode_getinputx.invokeInt(new java.lang.Object[]{mHandle, bufferX})); + Pointer valueX = bufferX.getPointer(0); + ImplicitPort x = null; + if (valueX == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "X was a null pointer"); + } + x = mWrapper.PolymorphicFactory(valueX, ImplicitPort.class); + return x; + } + + /** + * Retrieves the input for the y component + * + * @return the input for the y component + * @throws Lib3MFException + */ + public ImplicitPort getInputY() throws Lib3MFException { + Pointer bufferY = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composevectornode_getinputy.invokeInt(new java.lang.Object[]{mHandle, bufferY})); + Pointer valueY = bufferY.getPointer(0); + ImplicitPort y = null; + if (valueY == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Y was a null pointer"); + } + y = mWrapper.PolymorphicFactory(valueY, ImplicitPort.class); + return y; + } + + /** + * Retrieves the input for the z component + * + * @return the input for the z component + * @throws Lib3MFException + */ + public ImplicitPort getInputZ() throws Lib3MFException { + Pointer bufferZ = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composevectornode_getinputz.invokeInt(new java.lang.Object[]{mHandle, bufferZ})); + Pointer valueZ = bufferZ.getPointer(0); + ImplicitPort z = null; + if (valueZ == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Z was a null pointer"); + } + z = mWrapper.PolymorphicFactory(valueZ, ImplicitPort.class); + return z; + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputResult() throws Lib3MFException { + Pointer bufferResult = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composevectornode_getoutputresult.invokeInt(new java.lang.Object[]{mHandle, bufferResult})); + Pointer valueResult = bufferResult.getPointer(0); + ImplicitPort result = null; + if (valueResult == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Result was a null pointer"); + } + result = mWrapper.PolymorphicFactory(valueResult, ImplicitPort.class); + return result; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/CompositeConstituent.java b/Autogenerated/Bindings/Java8/lib3mf/CompositeConstituent.java new file mode 100644 index 000000000..a472fb4f1 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/CompositeConstituent.java @@ -0,0 +1,63 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class CompositeConstituent { + + public int PropertyID; + + public double MixingRatio; + + public static final int SIZE = 12; + + public void readFromPointer(Pointer p, long offset) { + PropertyID = p.getInt(offset + 0); + MixingRatio = p.getDouble(offset + 4); + } + + public void writeToPointer(Pointer p, long offset) { + p.setInt(offset + 0, PropertyID); + p.setDouble(offset + 4, MixingRatio); + } + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/CompositeMaterials.java b/Autogenerated/Bindings/Java8/lib3mf/CompositeMaterials.java new file mode 100644 index 000000000..f233f7001 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/CompositeMaterials.java @@ -0,0 +1,149 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class CompositeMaterials extends Resource { + + public CompositeMaterials(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the count of Composite-s in the CompositeMaterials. + * + * @return returns the count of Composite-s + * @throws Lib3MFException + */ + public int getCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_compositematerials_getcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials + * + * @return PropertyID of the Composite-Mixing Values in the CompositeMaterials. + * @throws Lib3MFException + */ + public int[] getAllPropertyIDs() throws Lib3MFException { + Pointer countNeededPropertyIDs = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_compositematerials_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededPropertyIDs, Pointer.NULL})); + long countPropertyIDs = countNeededPropertyIDs.getLong(0); + Pointer bufferPropertyIDs = new Memory(Math.max(1, 4 * countPropertyIDs)); + mWrapper.checkError(this, mWrapper.lib3mf_compositematerials_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, countPropertyIDs, countNeededPropertyIDs, bufferPropertyIDs})); + return bufferPropertyIDs.getIntArray(0, (int)countPropertyIDs); + } + + /** + * Obtains the BaseMaterialGroup instance of this CompositeMaterials. + * + * @return returns the BaseMaterialGroup instance of this CompositeMaterials + * @throws Lib3MFException + */ + public BaseMaterialGroup getBaseMaterialGroup() throws Lib3MFException { + Pointer bufferBaseMaterialGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_compositematerials_getbasematerialgroup.invokeInt(new java.lang.Object[]{mHandle, bufferBaseMaterialGroupInstance})); + Pointer valueBaseMaterialGroupInstance = bufferBaseMaterialGroupInstance.getPointer(0); + BaseMaterialGroup baseMaterialGroupInstance = null; + if (valueBaseMaterialGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BaseMaterialGroupInstance was a null pointer"); + } + baseMaterialGroupInstance = mWrapper.PolymorphicFactory(valueBaseMaterialGroupInstance, BaseMaterialGroup.class); + return baseMaterialGroupInstance; + } + + /** + * Adds a new Composite-Mixing Values to the CompositeMaterials. + * + * @param composite The Composite Constituents to be added as composite + * @return returns new PropertyID of the new Composite in the CompositeMaterials. + * @throws Lib3MFException + */ + public int addComposite(CompositeConstituent[] composite) throws Lib3MFException { + Pointer bufferComposite = new Memory(Math.max(1, CompositeConstituent.SIZE * composite.length)); + for (int i = 0; i < composite.length; i++) { + composite[i].writeToPointer(bufferComposite, i * CompositeConstituent.SIZE); + } + Pointer bufferPropertyID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_compositematerials_addcomposite.invokeInt(new java.lang.Object[]{mHandle, (long) composite.length, bufferComposite, bufferPropertyID})); + return bufferPropertyID.getInt(0); + } + + /** + * Removes a Composite-Maxing Ratio from the CompositeMaterials. + * + * @param propertyID PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. + * @throws Lib3MFException + */ + public void removeComposite(int propertyID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_compositematerials_removecomposite.invokeInt(new java.lang.Object[]{mHandle, propertyID})); + } + + /** + * Obtains a Composite-Maxing Ratio of this CompositeMaterials. + * + * @param propertyID the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. + * @return The Composite-Mixing Values with the given PropertyID + * @throws Lib3MFException + */ + public CompositeConstituent[] getComposite(int propertyID) throws Lib3MFException { + Pointer countNeededComposite = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_compositematerials_getcomposite.invokeInt(new java.lang.Object[]{mHandle, propertyID, 0L, countNeededComposite, null})); + long countComposite = countNeededComposite.getLong(0); + Pointer bufferComposite = new Memory(Math.max(1, countComposite * CompositeConstituent.SIZE)); + mWrapper.checkError(this, mWrapper.lib3mf_compositematerials_getcomposite.invokeInt(new java.lang.Object[]{mHandle, propertyID, countComposite, countNeededComposite, bufferComposite})); + CompositeConstituent composite[] = new CompositeConstituent[(int)countComposite]; + for (int i = 0; i < (int)countComposite; i++) { + composite[i] = new CompositeConstituent(); + composite[i].readFromPointer(bufferComposite, i * CompositeConstituent.SIZE); + } + return composite; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/CompositeMaterialsIterator.java b/Autogenerated/Bindings/Java8/lib3mf/CompositeMaterialsIterator.java new file mode 100644 index 000000000..877d38d30 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/CompositeMaterialsIterator.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class CompositeMaterialsIterator extends ResourceIterator { + + public CompositeMaterialsIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the CompositeMaterials the iterator points at. + * + * @return returns the CompositeMaterials instance. + * @throws Lib3MFException + */ + public CompositeMaterials getCurrentCompositeMaterials() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_compositematerialsiterator_getcurrentcompositematerials.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + CompositeMaterials resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, CompositeMaterials.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ConstMatNode.java b/Autogenerated/Bindings/Java8/lib3mf/ConstMatNode.java new file mode 100644 index 000000000..267bfea30 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ConstMatNode.java @@ -0,0 +1,100 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ConstMatNode extends ImplicitNode { + + public ConstMatNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Sets the matrix value of the node + * + * @param value the value + * @throws Lib3MFException + */ + public void setMatrix(Matrix4x4 value) throws Lib3MFException { + Pointer bufferValue = new Memory(Matrix4x4.SIZE); + value.writeToPointer(bufferValue, 0); + mWrapper.checkError(this, mWrapper.lib3mf_constmatnode_setmatrix.invokeInt(new java.lang.Object[]{mHandle, bufferValue})); + } + + /** + * Retrieves the matrix value of the node + * + * @return the matrix + * @throws Lib3MFException + */ + public Matrix4x4 getMatrix() throws Lib3MFException { + Pointer bufferValue = new Memory(Matrix4x4.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_constmatnode_getmatrix.invokeInt(new java.lang.Object[]{mHandle, bufferValue})); + Matrix4x4 value = new Matrix4x4(); + value.readFromPointer(bufferValue, 0); + return value; + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputMatrix() throws Lib3MFException { + Pointer bufferMatrix = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_constmatnode_getoutputmatrix.invokeInt(new java.lang.Object[]{mHandle, bufferMatrix})); + Pointer valueMatrix = bufferMatrix.getPointer(0); + ImplicitPort matrix = null; + if (valueMatrix == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Matrix was a null pointer"); + } + matrix = mWrapper.PolymorphicFactory(valueMatrix, ImplicitPort.class); + return matrix; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ConstVecNode.java b/Autogenerated/Bindings/Java8/lib3mf/ConstVecNode.java new file mode 100644 index 000000000..6d513e737 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ConstVecNode.java @@ -0,0 +1,100 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ConstVecNode extends ImplicitNode { + + public ConstVecNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Sets the vector value of the node + * + * @param value the value + * @throws Lib3MFException + */ + public void setVector(Vector value) throws Lib3MFException { + Pointer bufferValue = new Memory(Vector.SIZE); + value.writeToPointer(bufferValue, 0); + mWrapper.checkError(this, mWrapper.lib3mf_constvecnode_setvector.invokeInt(new java.lang.Object[]{mHandle, bufferValue})); + } + + /** + * Retrieves the vector value of the node + * + * @return the value + * @throws Lib3MFException + */ + public Vector getVector() throws Lib3MFException { + Pointer bufferValue = new Memory(Vector.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_constvecnode_getvector.invokeInt(new java.lang.Object[]{mHandle, bufferValue})); + Vector value = new Vector(); + value.readFromPointer(bufferValue, 0); + return value; + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputVector() throws Lib3MFException { + Pointer bufferVector = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_constvecnode_getoutputvector.invokeInt(new java.lang.Object[]{mHandle, bufferVector})); + Pointer valueVector = bufferVector.getPointer(0); + ImplicitPort vector = null; + if (valueVector == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Vector was a null pointer"); + } + vector = mWrapper.PolymorphicFactory(valueVector, ImplicitPort.class); + return vector; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ConstantNode.java b/Autogenerated/Bindings/Java8/lib3mf/ConstantNode.java new file mode 100644 index 000000000..594054662 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ConstantNode.java @@ -0,0 +1,96 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ConstantNode extends ImplicitNode { + + public ConstantNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Sets the constant value of the node + * + * @param value the value + * @throws Lib3MFException + */ + public void setConstant(double value) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_constantnode_setconstant.invokeInt(new java.lang.Object[]{mHandle, value})); + } + + /** + * Retrieves the constant value of the node + * + * @return the value + * @throws Lib3MFException + */ + public double getConstant() throws Lib3MFException { + Pointer bufferValue = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_constantnode_getconstant.invokeInt(new java.lang.Object[]{mHandle, bufferValue})); + return bufferValue.getDouble(0); + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputValue() throws Lib3MFException { + Pointer bufferValue = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_constantnode_getoutputvalue.invokeInt(new java.lang.Object[]{mHandle, bufferValue})); + Pointer valueValue = bufferValue.getPointer(0); + ImplicitPort value = null; + if (valueValue == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Value was a null pointer"); + } + value = mWrapper.PolymorphicFactory(valueValue, ImplicitPort.class); + return value; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Consumer.java b/Autogenerated/Bindings/Java8/lib3mf/Consumer.java new file mode 100644 index 000000000..d8b3e80eb --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Consumer.java @@ -0,0 +1,101 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Consumer extends Base { + + public Consumer(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Gets the consumerid + * + * @return A unique identifier for the consumers + * @throws Lib3MFException + */ + public String getConsumerID() throws Lib3MFException { + Pointer bytesNeededConsumerID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_consumer_getconsumerid.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededConsumerID, null})); + int sizeConsumerID = bytesNeededConsumerID.getInt(0); + Pointer bufferConsumerID = new Memory(sizeConsumerID); + mWrapper.checkError(this, mWrapper.lib3mf_consumer_getconsumerid.invokeInt(new java.lang.Object[]{mHandle, sizeConsumerID, bytesNeededConsumerID, bufferConsumerID})); + return new String(bufferConsumerID.getByteArray(0, sizeConsumerID - 1), StandardCharsets.UTF_8); + } + + /** + * Getts the keyid + * + * @return The identifier for the key of this consumer + * @throws Lib3MFException + */ + public String getKeyID() throws Lib3MFException { + Pointer bytesNeededKeyID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_consumer_getkeyid.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededKeyID, null})); + int sizeKeyID = bytesNeededKeyID.getInt(0); + Pointer bufferKeyID = new Memory(sizeKeyID); + mWrapper.checkError(this, mWrapper.lib3mf_consumer_getkeyid.invokeInt(new java.lang.Object[]{mHandle, sizeKeyID, bytesNeededKeyID, bufferKeyID})); + return new String(bufferKeyID.getByteArray(0, sizeKeyID - 1), StandardCharsets.UTF_8); + } + + /** + * Gets the keyvalue associated with this consumer + * + * @return The public key, when available, of this consumer + * @throws Lib3MFException + */ + public String getKeyValue() throws Lib3MFException { + Pointer bytesNeededKeyValue = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_consumer_getkeyvalue.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededKeyValue, null})); + int sizeKeyValue = bytesNeededKeyValue.getInt(0); + Pointer bufferKeyValue = new Memory(sizeKeyValue); + mWrapper.checkError(this, mWrapper.lib3mf_consumer_getkeyvalue.invokeInt(new java.lang.Object[]{mHandle, sizeKeyValue, bytesNeededKeyValue, bufferKeyValue})); + return new String(bufferKeyValue.getByteArray(0, sizeKeyValue - 1), StandardCharsets.UTF_8); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ContentEncryptionParams.java b/Autogenerated/Bindings/Java8/lib3mf/ContentEncryptionParams.java new file mode 100644 index 000000000..6f243f722 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ContentEncryptionParams.java @@ -0,0 +1,169 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ContentEncryptionParams extends Base { + + public ContentEncryptionParams(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the encryption method to be used in this encryption process + * + * @return + * @throws Lib3MFException + */ + public Lib3MFWrapper.EncryptionAlgorithm getEncryptionAlgorithm() throws Lib3MFException { + Pointer bufferAlgorithm = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getencryptionalgorithm.invokeInt(new java.lang.Object[]{mHandle, bufferAlgorithm})); + return Lib3MFWrapper.EnumConversion.convertConstToEncryptionAlgorithm(bufferAlgorithm.getInt(0)); + } + + /** + * Gets the key for the resource associated + * + * @return Pointer to a buffer where to place the key. + * @throws Lib3MFException + */ + public byte[] getKey() throws Lib3MFException { + Pointer countNeededByteData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getkey.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededByteData, Pointer.NULL})); + long countByteData = countNeededByteData.getLong(0); + Pointer bufferByteData = new Memory(Math.max(1, 1 * countByteData)); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getkey.invokeInt(new java.lang.Object[]{mHandle, countByteData, countNeededByteData, bufferByteData})); + return bufferByteData.getByteArray(0, (int)countByteData); + } + + /** + * Gets the IV data + * + * @return Pointer to a buffer where to place the data. + * @throws Lib3MFException + */ + public byte[] getInitializationVector() throws Lib3MFException { + Pointer countNeededByteData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getinitializationvector.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededByteData, Pointer.NULL})); + long countByteData = countNeededByteData.getLong(0); + Pointer bufferByteData = new Memory(Math.max(1, 1 * countByteData)); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getinitializationvector.invokeInt(new java.lang.Object[]{mHandle, countByteData, countNeededByteData, bufferByteData})); + return bufferByteData.getByteArray(0, (int)countByteData); + } + + /** + * A handler descriptor that uniquely identifies the context of the resource. Each resource will be assigned a different value + * + * @return Pointer to a buffer where to place the data. + * @throws Lib3MFException + */ + public byte[] getAuthenticationTag() throws Lib3MFException { + Pointer countNeededByteData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getauthenticationtag.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededByteData, Pointer.NULL})); + long countByteData = countNeededByteData.getLong(0); + Pointer bufferByteData = new Memory(Math.max(1, 1 * countByteData)); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getauthenticationtag.invokeInt(new java.lang.Object[]{mHandle, countByteData, countNeededByteData, bufferByteData})); + return bufferByteData.getByteArray(0, (int)countByteData); + } + + /** + * Sets the authentication tag + * + * @param byteData The authentication tag size + * @throws Lib3MFException + */ + public void setAuthenticationTag(byte[] byteData) throws Lib3MFException { + Pointer bufferByteData = new Memory(Math.max(1, 1 * byteData.length)); + for (int i = 0; i < byteData.length; i++) { + bufferByteData.setByte(1 * i, byteData[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_setauthenticationtag.invokeInt(new java.lang.Object[]{mHandle, (long) byteData.length, bufferByteData})); + } + + /** + * A handler descriptor that uniquely identifies the context of the resource. Each resource will be assigned a different value + * + * @return Buffer where the data will be placed + * @throws Lib3MFException + */ + public byte[] getAdditionalAuthenticationData() throws Lib3MFException { + Pointer countNeededByteData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getadditionalauthenticationdata.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededByteData, Pointer.NULL})); + long countByteData = countNeededByteData.getLong(0); + Pointer bufferByteData = new Memory(Math.max(1, 1 * countByteData)); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getadditionalauthenticationdata.invokeInt(new java.lang.Object[]{mHandle, countByteData, countNeededByteData, bufferByteData})); + return bufferByteData.getByteArray(0, (int)countByteData); + } + + /** + * A handler descriptor that uniquely identifies the context of the resource. Each resource will be assigned a different value + * + * @return + * @throws Lib3MFException + */ + public long getDescriptor() throws Lib3MFException { + Pointer bufferDescriptor = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getdescriptor.invokeInt(new java.lang.Object[]{mHandle, bufferDescriptor})); + return bufferDescriptor.getLong(0); + } + + /** + * Gets the resourcedatagroup keyuuid + * + * @return The resourcedatagroup keyuuid that may be use to reference an external key + * @throws Lib3MFException + */ + public String getKeyUUID() throws Lib3MFException { + Pointer bytesNeededUUID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getkeyuuid.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededUUID, null})); + int sizeUUID = bytesNeededUUID.getInt(0); + Pointer bufferUUID = new Memory(sizeUUID); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getkeyuuid.invokeInt(new java.lang.Object[]{mHandle, sizeUUID, bytesNeededUUID, bufferUUID})); + return new String(bufferUUID.getByteArray(0, sizeUUID - 1), StandardCharsets.UTF_8); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/CosNode.java b/Autogenerated/Bindings/Java8/lib3mf/CosNode.java new file mode 100644 index 000000000..9980980fd --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/CosNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class CosNode extends OneInputNode { + + public CosNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/CoshNode.java b/Autogenerated/Bindings/Java8/lib3mf/CoshNode.java new file mode 100644 index 000000000..67e78fdbc --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/CoshNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class CoshNode extends OneInputNode { + + public CoshNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/CrossNode.java b/Autogenerated/Bindings/Java8/lib3mf/CrossNode.java new file mode 100644 index 000000000..53c927b0b --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/CrossNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class CrossNode extends TwoInputNode { + + public CrossNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/DecomposeVectorNode.java b/Autogenerated/Bindings/Java8/lib3mf/DecomposeVectorNode.java new file mode 100644 index 000000000..9410a166a --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/DecomposeVectorNode.java @@ -0,0 +1,128 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class DecomposeVectorNode extends ImplicitNode { + + public DecomposeVectorNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input + * + * @return the input port for the vector to decompose + * @throws Lib3MFException + */ + public ImplicitPort getInputA() throws Lib3MFException { + Pointer bufferA = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_decomposevectornode_getinputa.invokeInt(new java.lang.Object[]{mHandle, bufferA})); + Pointer valueA = bufferA.getPointer(0); + ImplicitPort a = null; + if (valueA == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "A was a null pointer"); + } + a = mWrapper.PolymorphicFactory(valueA, ImplicitPort.class); + return a; + } + + /** + * Retrieves the output for the x component + * + * @return the output for the x component + * @throws Lib3MFException + */ + public ImplicitPort getOutputX() throws Lib3MFException { + Pointer bufferX = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_decomposevectornode_getoutputx.invokeInt(new java.lang.Object[]{mHandle, bufferX})); + Pointer valueX = bufferX.getPointer(0); + ImplicitPort x = null; + if (valueX == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "X was a null pointer"); + } + x = mWrapper.PolymorphicFactory(valueX, ImplicitPort.class); + return x; + } + + /** + * Retrieves the output for the y component + * + * @return the output for the y component + * @throws Lib3MFException + */ + public ImplicitPort getOutputY() throws Lib3MFException { + Pointer bufferY = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_decomposevectornode_getoutputy.invokeInt(new java.lang.Object[]{mHandle, bufferY})); + Pointer valueY = bufferY.getPointer(0); + ImplicitPort y = null; + if (valueY == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Y was a null pointer"); + } + y = mWrapper.PolymorphicFactory(valueY, ImplicitPort.class); + return y; + } + + /** + * Retrieves the output for the z component + * + * @return the output for the z component + * @throws Lib3MFException + */ + public ImplicitPort getOutputZ() throws Lib3MFException { + Pointer bufferZ = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_decomposevectornode_getoutputz.invokeInt(new java.lang.Object[]{mHandle, bufferZ})); + Pointer valueZ = bufferZ.getPointer(0); + ImplicitPort z = null; + if (valueZ == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Z was a null pointer"); + } + z = mWrapper.PolymorphicFactory(valueZ, ImplicitPort.class); + return z; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/DivisionNode.java b/Autogenerated/Bindings/Java8/lib3mf/DivisionNode.java new file mode 100644 index 000000000..cc8a4ad21 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/DivisionNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class DivisionNode extends TwoInputNode { + + public DivisionNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/DotNode.java b/Autogenerated/Bindings/Java8/lib3mf/DotNode.java new file mode 100644 index 000000000..2ce83c843 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/DotNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class DotNode extends TwoInputNode { + + public DotNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ExpNode.java b/Autogenerated/Bindings/Java8/lib3mf/ExpNode.java new file mode 100644 index 000000000..16eff1e15 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ExpNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ExpNode extends OneInputNode { + + public ExpNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/FloorNode.java b/Autogenerated/Bindings/Java8/lib3mf/FloorNode.java new file mode 100644 index 000000000..396940c56 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/FloorNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class FloorNode extends OneInputNode { + + public FloorNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/FmodNode.java b/Autogenerated/Bindings/Java8/lib3mf/FmodNode.java new file mode 100644 index 000000000..69ee610fb --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/FmodNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class FmodNode extends TwoInputNode { + + public FmodNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/FractNode.java b/Autogenerated/Bindings/Java8/lib3mf/FractNode.java new file mode 100644 index 000000000..6c711f62e --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/FractNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class FractNode extends OneInputNode { + + public FractNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Function.java b/Autogenerated/Bindings/Java8/lib3mf/Function.java new file mode 100644 index 000000000..e76033507 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Function.java @@ -0,0 +1,257 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Function extends Resource { + + public Function(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the display name of the function + * + * @return the display name + * @throws Lib3MFException + */ + public String getDisplayName() throws Lib3MFException { + Pointer bytesNeededDisplayName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_function_getdisplayname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededDisplayName, null})); + int sizeDisplayName = bytesNeededDisplayName.getInt(0); + Pointer bufferDisplayName = new Memory(sizeDisplayName); + mWrapper.checkError(this, mWrapper.lib3mf_function_getdisplayname.invokeInt(new java.lang.Object[]{mHandle, sizeDisplayName, bytesNeededDisplayName, bufferDisplayName})); + return new String(bufferDisplayName.getByteArray(0, sizeDisplayName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the display name of the function + * + * @param displayName the display name + * @throws Lib3MFException + */ + public void setDisplayName(String displayName) throws Lib3MFException { + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_function_setdisplayname.invokeInt(new java.lang.Object[]{mHandle, bufferDisplayName})); + } + + /** + * Add an input + * + * @param identifier the identifier of the input + * @param displayName the display name of the input + * @param type the type of the input + * @return The added input port + * @throws Lib3MFException + */ + public ImplicitPort addInput(String identifier, String displayName, Lib3MFWrapper.ImplicitPortType type) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + Pointer bufferPort = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_function_addinput.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, Lib3MFWrapper.EnumConversion.convertImplicitPortTypeToConst(type), bufferPort})); + Pointer valuePort = bufferPort.getPointer(0); + ImplicitPort port = null; + if (valuePort == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Port was a null pointer"); + } + port = mWrapper.PolymorphicFactory(valuePort, ImplicitPort.class); + return port; + } + + /** + * Retrieves the inputs + * + * @return iterator for the list of inputs + * @throws Lib3MFException + */ + public ImplicitPortIterator getInputs() throws Lib3MFException { + Pointer bufferIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_function_getinputs.invokeInt(new java.lang.Object[]{mHandle, bufferIterator})); + Pointer valueIterator = bufferIterator.getPointer(0); + ImplicitPortIterator iterator = null; + if (valueIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Iterator was a null pointer"); + } + iterator = mWrapper.PolymorphicFactory(valueIterator, ImplicitPortIterator.class); + return iterator; + } + + /** + * Removes an input + * + * @param input The input to be removed + * @throws Lib3MFException + */ + public void removeInput(ImplicitPort input) throws Lib3MFException { + Pointer inputHandle = null; + if (input != null) { + inputHandle = input.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Input is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_function_removeinput.invokeInt(new java.lang.Object[]{mHandle, inputHandle})); + } + + /** + * Add an output + * + * @param identifier the identifier of the output + * @param displayName the display name of the output + * @param type the type of the input + * @return The added input port + * @throws Lib3MFException + */ + public ImplicitPort addOutput(String identifier, String displayName, Lib3MFWrapper.ImplicitPortType type) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + Pointer bufferPort = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_function_addoutput.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, Lib3MFWrapper.EnumConversion.convertImplicitPortTypeToConst(type), bufferPort})); + Pointer valuePort = bufferPort.getPointer(0); + ImplicitPort port = null; + if (valuePort == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Port was a null pointer"); + } + port = mWrapper.PolymorphicFactory(valuePort, ImplicitPort.class); + return port; + } + + /** + * Retrieves the outputs + * + * @return iterator for the outputs + * @throws Lib3MFException + */ + public ImplicitPortIterator getOutputs() throws Lib3MFException { + Pointer bufferIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_function_getoutputs.invokeInt(new java.lang.Object[]{mHandle, bufferIterator})); + Pointer valueIterator = bufferIterator.getPointer(0); + ImplicitPortIterator iterator = null; + if (valueIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Iterator was a null pointer"); + } + iterator = mWrapper.PolymorphicFactory(valueIterator, ImplicitPortIterator.class); + return iterator; + } + + /** + * Removes an output + * + * @param output The output to be removed + * @throws Lib3MFException + */ + public void removeOutput(ImplicitPort output) throws Lib3MFException { + Pointer outputHandle = null; + if (output != null) { + outputHandle = output.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Output is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_function_removeoutput.invokeInt(new java.lang.Object[]{mHandle, outputHandle})); + } + + /** + * Retrieves an input + * + * @param identifier the identifier of the input + * @return the input port + * @throws Lib3MFException + */ + public ImplicitPort findInput(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + Pointer bufferInput = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_function_findinput.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferInput})); + Pointer valueInput = bufferInput.getPointer(0); + ImplicitPort input = null; + if (valueInput == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Input was a null pointer"); + } + input = mWrapper.PolymorphicFactory(valueInput, ImplicitPort.class); + return input; + } + + /** + * Retrieves an output + * + * @param identifier the identifier of the output + * @return the output port + * @throws Lib3MFException + */ + public ImplicitPort findOutput(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + Pointer bufferOutput = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_function_findoutput.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferOutput})); + Pointer valueOutput = bufferOutput.getPointer(0); + ImplicitPort output = null; + if (valueOutput == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Output was a null pointer"); + } + output = mWrapper.PolymorphicFactory(valueOutput, ImplicitPort.class); + return output; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/FunctionCallNode.java b/Autogenerated/Bindings/Java8/lib3mf/FunctionCallNode.java new file mode 100644 index 000000000..7f65f66a9 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/FunctionCallNode.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class FunctionCallNode extends ImplicitNode { + + public FunctionCallNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the function id + * + * @return the input port for the function + * @throws Lib3MFException + */ + public ImplicitPort getInputFunctionID() throws Lib3MFException { + Pointer bufferFunction = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functioncallnode_getinputfunctionid.invokeInt(new java.lang.Object[]{mHandle, bufferFunction})); + Pointer valueFunction = bufferFunction.getPointer(0); + ImplicitPort function = null; + if (valueFunction == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Function was a null pointer"); + } + function = mWrapper.PolymorphicFactory(valueFunction, ImplicitPort.class); + return function; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/FunctionFromImage3D.java b/Autogenerated/Bindings/Java8/lib3mf/FunctionFromImage3D.java new file mode 100644 index 000000000..133d6ea79 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/FunctionFromImage3D.java @@ -0,0 +1,203 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class FunctionFromImage3D extends Function { + + public FunctionFromImage3D(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the selected 3D image. + * + * @return image instance + * @throws Lib3MFException + */ + public Image3D getImage3D() throws Lib3MFException { + Pointer bufferImage3D = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_getimage3d.invokeInt(new java.lang.Object[]{mHandle, bufferImage3D})); + Pointer valueImage3D = bufferImage3D.getPointer(0); + Image3D image3D = null; + if (valueImage3D == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Image3D was a null pointer"); + } + image3D = mWrapper.PolymorphicFactory(valueImage3D, Image3D.class); + return image3D; + } + + /** + * Sets the 3D image of the selector. + * + * @param image3D image instance + * @throws Lib3MFException + */ + public void setImage3D(Image3D image3D) throws Lib3MFException { + Pointer image3DHandle = null; + if (image3D != null) { + image3DHandle = image3D.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Image3D is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_setimage3d.invokeInt(new java.lang.Object[]{mHandle, image3DHandle})); + } + + /** + * Sets the texture filter of the selector. + * + * @param filter texture filter + * @throws Lib3MFException + */ + public void setFilter(Lib3MFWrapper.TextureFilter filter) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_setfilter.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertTextureFilterToConst(filter)})); + } + + /** + * Returns the texture filter of the selector. + * + * @return texture filter + * @throws Lib3MFException + */ + public Lib3MFWrapper.TextureFilter getFilter() throws Lib3MFException { + Pointer bufferFilter = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_getfilter.invokeInt(new java.lang.Object[]{mHandle, bufferFilter})); + return Lib3MFWrapper.EnumConversion.convertConstToTextureFilter(bufferFilter.getInt(0)); + } + + /** + * Sets the tile styles of the selector. + * + * @param tileStyleU tile style in U + * @param tileStyleV tile style in V + * @param tileStyleW tile style in W + * @throws Lib3MFException + */ + public void setTileStyles(Lib3MFWrapper.TextureTileStyle tileStyleU, Lib3MFWrapper.TextureTileStyle tileStyleV, Lib3MFWrapper.TextureTileStyle tileStyleW) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_settilestyles.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertTextureTileStyleToConst(tileStyleU), Lib3MFWrapper.EnumConversion.convertTextureTileStyleToConst(tileStyleV), Lib3MFWrapper.EnumConversion.convertTextureTileStyleToConst(tileStyleW)})); + } + + /** + * Retrieves the tile styles of the selector. + * + * @return GetTileStyles Result Tuple + * @throws Lib3MFException + */ + public GetTileStylesResult getTileStyles() throws Lib3MFException { + Pointer bufferTileStyleU = new Memory(4); + Pointer bufferTileStyleV = new Memory(4); + Pointer bufferTileStyleW = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_gettilestyles.invokeInt(new java.lang.Object[]{mHandle, bufferTileStyleU, bufferTileStyleV, bufferTileStyleW})); + GetTileStylesResult returnTuple = new GetTileStylesResult(); + returnTuple.TileStyleU = Lib3MFWrapper.EnumConversion.convertConstToTextureTileStyle(bufferTileStyleU.getInt(0)); + returnTuple.TileStyleV = Lib3MFWrapper.EnumConversion.convertConstToTextureTileStyle(bufferTileStyleV.getInt(0)); + returnTuple.TileStyleW = Lib3MFWrapper.EnumConversion.convertConstToTextureTileStyle(bufferTileStyleW.getInt(0)); + return returnTuple; + } + + public static class GetTileStylesResult { + /** + * tile style in U + */ + public Lib3MFWrapper.TextureTileStyle TileStyleU; + + /** + * tile style in V + */ + public Lib3MFWrapper.TextureTileStyle TileStyleV; + + /** + * tile style in W + */ + public Lib3MFWrapper.TextureTileStyle TileStyleW; + + } + /** + * returns the offset value for the pixel values in the Image3D + * + * @return the offset value for the pixel values in the Image3D + * @throws Lib3MFException + */ + public double getOffset() throws Lib3MFException { + Pointer bufferOffset = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_getoffset.invokeInt(new java.lang.Object[]{mHandle, bufferOffset})); + return bufferOffset.getDouble(0); + } + + /** + * Sets the offset value for the pixel values in the Image3D + * + * @param offset the offset value for the pixel values in the Image3D + * @throws Lib3MFException + */ + public void setOffset(double offset) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_setoffset.invokeInt(new java.lang.Object[]{mHandle, offset})); + } + + /** + * returns the scale value for the pixel values in the Image3D + * + * @return the scale value for the pixel values in the Image3D + * @throws Lib3MFException + */ + public double getScale() throws Lib3MFException { + Pointer bufferScale = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_getscale.invokeInt(new java.lang.Object[]{mHandle, bufferScale})); + return bufferScale.getDouble(0); + } + + /** + * Sets the scale value for the pixel values in the Image3D + * + * @param scale the scale value for the pixel values in the Image3D + * @throws Lib3MFException + */ + public void setScale(double scale) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_setscale.invokeInt(new java.lang.Object[]{mHandle, scale})); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/FunctionGradientNode.java b/Autogenerated/Bindings/Java8/lib3mf/FunctionGradientNode.java new file mode 100644 index 000000000..5b0cdb6d8 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/FunctionGradientNode.java @@ -0,0 +1,222 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class FunctionGradientNode extends ImplicitNode { + + public FunctionGradientNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the function id + * + * @return the input port for the function + * @throws Lib3MFException + */ + public ImplicitPort getInputFunctionID() throws Lib3MFException { + Pointer bufferFunction = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getinputfunctionid.invokeInt(new java.lang.Object[]{mHandle, bufferFunction})); + Pointer valueFunction = bufferFunction.getPointer(0); + ImplicitPort function = null; + if (valueFunction == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Function was a null pointer"); + } + function = mWrapper.PolymorphicFactory(valueFunction, ImplicitPort.class); + return function; + } + + /** + * Retrieves the input for the position + * + * @return the input port for the position + * @throws Lib3MFException + */ + public ImplicitPort getInputPos() throws Lib3MFException { + Pointer bufferPos = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getinputpos.invokeInt(new java.lang.Object[]{mHandle, bufferPos})); + Pointer valuePos = bufferPos.getPointer(0); + ImplicitPort pos = null; + if (valuePos == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Pos was a null pointer"); + } + pos = mWrapper.PolymorphicFactory(valuePos, ImplicitPort.class); + return pos; + } + + /** + * Retrieves the input for the finite difference step + * + * @return the input port for the finite difference step + * @throws Lib3MFException + */ + public ImplicitPort getInputStep() throws Lib3MFException { + Pointer bufferStep = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getinputstep.invokeInt(new java.lang.Object[]{mHandle, bufferStep})); + Pointer valueStep = bufferStep.getPointer(0); + ImplicitPort step = null; + if (valueStep == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Step was a null pointer"); + } + step = mWrapper.PolymorphicFactory(valueStep, ImplicitPort.class); + return step; + } + + /** + * Sets the name of the referenced scalar output + * + * @param scalarOutputName the name of the scalar output of the referenced function + * @throws Lib3MFException + */ + public void setScalarOutputName(String scalarOutputName) throws Lib3MFException { + byte[] bytesScalarOutputName = scalarOutputName.getBytes(StandardCharsets.UTF_8); + Memory bufferScalarOutputName = new Memory(bytesScalarOutputName.length + 1); + bufferScalarOutputName.write(0, bytesScalarOutputName, 0, bytesScalarOutputName.length); + bufferScalarOutputName.setByte(bytesScalarOutputName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_setscalaroutputname.invokeInt(new java.lang.Object[]{mHandle, bufferScalarOutputName})); + } + + /** + * Retrieves the name of the referenced scalar output + * + * @return the name of the scalar output of the referenced function + * @throws Lib3MFException + */ + public String getScalarOutputName() throws Lib3MFException { + Pointer bytesNeededScalarOutputName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getscalaroutputname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededScalarOutputName, null})); + int sizeScalarOutputName = bytesNeededScalarOutputName.getInt(0); + Pointer bufferScalarOutputName = new Memory(sizeScalarOutputName); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getscalaroutputname.invokeInt(new java.lang.Object[]{mHandle, sizeScalarOutputName, bytesNeededScalarOutputName, bufferScalarOutputName})); + return new String(bufferScalarOutputName.getByteArray(0, sizeScalarOutputName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the name of the referenced vector input + * + * @param vectorInputName the name of the vector input (float3) of the referenced function + * @throws Lib3MFException + */ + public void setVectorInputName(String vectorInputName) throws Lib3MFException { + byte[] bytesVectorInputName = vectorInputName.getBytes(StandardCharsets.UTF_8); + Memory bufferVectorInputName = new Memory(bytesVectorInputName.length + 1); + bufferVectorInputName.write(0, bytesVectorInputName, 0, bytesVectorInputName.length); + bufferVectorInputName.setByte(bytesVectorInputName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_setvectorinputname.invokeInt(new java.lang.Object[]{mHandle, bufferVectorInputName})); + } + + /** + * Retrieves the name of the referenced vector input + * + * @return the name of the vector input (float3) of the referenced function + * @throws Lib3MFException + */ + public String getVectorInputName() throws Lib3MFException { + Pointer bytesNeededVectorInputName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getvectorinputname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededVectorInputName, null})); + int sizeVectorInputName = bytesNeededVectorInputName.getInt(0); + Pointer bufferVectorInputName = new Memory(sizeVectorInputName); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getvectorinputname.invokeInt(new java.lang.Object[]{mHandle, sizeVectorInputName, bytesNeededVectorInputName, bufferVectorInputName})); + return new String(bufferVectorInputName.getByteArray(0, sizeVectorInputName - 1), StandardCharsets.UTF_8); + } + + /** + * Retrieves the normalized gradient output + * + * @return the output port for the normalized gradient + * @throws Lib3MFException + */ + public ImplicitPort getOutputNormalizedGradient() throws Lib3MFException { + Pointer bufferNormalizedGradient = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getoutputnormalizedgradient.invokeInt(new java.lang.Object[]{mHandle, bufferNormalizedGradient})); + Pointer valueNormalizedGradient = bufferNormalizedGradient.getPointer(0); + ImplicitPort normalizedGradient = null; + if (valueNormalizedGradient == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "NormalizedGradient was a null pointer"); + } + normalizedGradient = mWrapper.PolymorphicFactory(valueNormalizedGradient, ImplicitPort.class); + return normalizedGradient; + } + + /** + * Retrieves the raw gradient output + * + * @return the output port for the raw gradient + * @throws Lib3MFException + */ + public ImplicitPort getOutputGradient() throws Lib3MFException { + Pointer bufferGradient = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getoutputgradient.invokeInt(new java.lang.Object[]{mHandle, bufferGradient})); + Pointer valueGradient = bufferGradient.getPointer(0); + ImplicitPort gradient = null; + if (valueGradient == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Gradient was a null pointer"); + } + gradient = mWrapper.PolymorphicFactory(valueGradient, ImplicitPort.class); + return gradient; + } + + /** + * Retrieves the gradient magnitude output + * + * @return the output port for the gradient magnitude + * @throws Lib3MFException + */ + public ImplicitPort getOutputMagnitude() throws Lib3MFException { + Pointer bufferMagnitude = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getoutputmagnitude.invokeInt(new java.lang.Object[]{mHandle, bufferMagnitude})); + Pointer valueMagnitude = bufferMagnitude.getPointer(0); + ImplicitPort magnitude = null; + if (valueMagnitude == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Magnitude was a null pointer"); + } + magnitude = mWrapper.PolymorphicFactory(valueMagnitude, ImplicitPort.class); + return magnitude; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/FunctionIterator.java b/Autogenerated/Bindings/Java8/lib3mf/FunctionIterator.java new file mode 100644 index 000000000..c32c277a0 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/FunctionIterator.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class FunctionIterator extends ResourceIterator { + + public FunctionIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the Function the iterator points at. + * + * @return returns the Function instance. + * @throws Lib3MFException + */ + public Function getCurrentFunction() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functioniterator_getcurrentfunction.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + Function resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, Function.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/FunctionReference.java b/Autogenerated/Bindings/Java8/lib3mf/FunctionReference.java new file mode 100644 index 000000000..f10cb3068 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/FunctionReference.java @@ -0,0 +1,177 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class FunctionReference extends Base { + + public FunctionReference(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the UniqueResourceID of the Function. Only functions with a 'pos'-input are allowed. + * + * @return returns the UniqueResourceID. + * @throws Lib3MFException + */ + public int getFunctionResourceID() throws Lib3MFException { + Pointer bufferUniqueResourceID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_getfunctionresourceid.invokeInt(new java.lang.Object[]{mHandle, bufferUniqueResourceID})); + return bufferUniqueResourceID.getInt(0); + } + + /** + * Sets the UniqueResourceID to refer to. + * + * @param uniqueResourceID UniqueResourceID of the function + * @throws Lib3MFException + */ + public void setFunctionResourceID(int uniqueResourceID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_setfunctionresourceid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID})); + } + + /** + * Returns the transformation matrix into the coordinate system of the referenced Function. + * + * @return the transformation matrix + * @throws Lib3MFException + */ + public Transform getTransform() throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_gettransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * Sets the transformation matrix into the coordinate system of the referenced Function. + * + * @param transform new transformation matrix + * @throws Lib3MFException + */ + public void setTransform(Transform transform) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_settransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + } + + /** + * Returns the name of the function output channel to use. + * + * @return the name of the function output channel + * @throws Lib3MFException + */ + public String getChannelName() throws Lib3MFException { + Pointer bytesNeededChannelName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_getchannelname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededChannelName, null})); + int sizeChannelName = bytesNeededChannelName.getInt(0); + Pointer bufferChannelName = new Memory(sizeChannelName); + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_getchannelname.invokeInt(new java.lang.Object[]{mHandle, sizeChannelName, bytesNeededChannelName, bufferChannelName})); + return new String(bufferChannelName.getByteArray(0, sizeChannelName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the name of the function output channel to use. + * + * @param channelName new name of the function output channel + * @throws Lib3MFException + */ + public void setChannelName(String channelName) throws Lib3MFException { + byte[] bytesChannelName = channelName.getBytes(StandardCharsets.UTF_8); + Memory bufferChannelName = new Memory(bytesChannelName.length + 1); + bufferChannelName.write(0, bytesChannelName, 0, bytesChannelName.length); + bufferChannelName.setByte(bytesChannelName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_setchannelname.invokeInt(new java.lang.Object[]{mHandle, bufferChannelName})); + } + + /** + * Sets the minimal feature size as a hint for the function evaluator + * + * @param minFeatureSize minimal feature size + * @throws Lib3MFException + */ + public void setMinFeatureSize(double minFeatureSize) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_setminfeaturesize.invokeInt(new java.lang.Object[]{mHandle, minFeatureSize})); + } + + /** + * Returns the minimal feature size as a hint for the function evaluator + * + * @return minimal feature size + * @throws Lib3MFException + */ + public double getMinFeatureSize() throws Lib3MFException { + Pointer bufferMinFeatureSize = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_getminfeaturesize.invokeInt(new java.lang.Object[]{mHandle, bufferMinFeatureSize})); + return bufferMinFeatureSize.getDouble(0); + } + + /** + * Sets the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). + * + * @param fallBackValue fallback value + * @throws Lib3MFException + */ + public void setFallBackValue(double fallBackValue) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_setfallbackvalue.invokeInt(new java.lang.Object[]{mHandle, fallBackValue})); + } + + /** + * Returns the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). + * + * @return fallback value + * @throws Lib3MFException + */ + public double getFallBackValue() throws Lib3MFException { + Pointer bufferFallBackValue = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_getfallbackvalue.invokeInt(new java.lang.Object[]{mHandle, bufferFallBackValue})); + return bufferFallBackValue.getDouble(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Image3D.java b/Autogenerated/Bindings/Java8/lib3mf/Image3D.java new file mode 100644 index 000000000..57d546906 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Image3D.java @@ -0,0 +1,97 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Image3D extends Resource { + + public Image3D(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * returns the name of this Image3D + * + * @return the name of this Image3D + * @throws Lib3MFException + */ + public String getName() throws Lib3MFException { + Pointer bytesNeededName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_image3d_getname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededName, null})); + int sizeName = bytesNeededName.getInt(0); + Pointer bufferName = new Memory(sizeName); + mWrapper.checkError(this, mWrapper.lib3mf_image3d_getname.invokeInt(new java.lang.Object[]{mHandle, sizeName, bytesNeededName, bufferName})); + return new String(bufferName.getByteArray(0, sizeName - 1), StandardCharsets.UTF_8); + } + + /** + * sets a new name of this Image3D + * + * @param name the new name of this Image3D + * @throws Lib3MFException + */ + public void setName(String name) throws Lib3MFException { + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_image3d_setname.invokeInt(new java.lang.Object[]{mHandle, bufferName})); + } + + /** + * Retrieves, if this Image3D is a ImageStack + * + * @return returns, whether the Image3D is an ImageStack + * @throws Lib3MFException + */ + public boolean isImageStack() throws Lib3MFException { + Pointer bufferIsImageStack = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_image3d_isimagestack.invokeInt(new java.lang.Object[]{mHandle, bufferIsImageStack})); + return bufferIsImageStack.getByte(0) != 0; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Image3DIterator.java b/Autogenerated/Bindings/Java8/lib3mf/Image3DIterator.java new file mode 100644 index 000000000..176be9f35 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Image3DIterator.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Image3DIterator extends ResourceIterator { + + public Image3DIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the Image3D the iterator points at. + * + * @return returns the Image3D instance. + * @throws Lib3MFException + */ + public Image3D getCurrentImage3D() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_image3diterator_getcurrentimage3d.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + Image3D resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, Image3D.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ImageStack.java b/Autogenerated/Bindings/Java8/lib3mf/ImageStack.java new file mode 100644 index 000000000..38040917b --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ImageStack.java @@ -0,0 +1,230 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ImageStack extends Image3D { + + public ImageStack(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the number of rows in each image of this image3d + * + * @return number of rows + * @throws Lib3MFException + */ + public int getRowCount() throws Lib3MFException { + Pointer bufferRowCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_getrowcount.invokeInt(new java.lang.Object[]{mHandle, bufferRowCount})); + return bufferRowCount.getInt(0); + } + + /** + * Sets the number of rows in each image of this image3d + * + * @param rowCount number of rows + * @throws Lib3MFException + */ + public void setRowCount(int rowCount) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_setrowcount.invokeInt(new java.lang.Object[]{mHandle, rowCount})); + } + + /** + * Retrieves the number of columns in each image of this image3d + * + * @return number of columns + * @throws Lib3MFException + */ + public int getColumnCount() throws Lib3MFException { + Pointer bufferColumnCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_getcolumncount.invokeInt(new java.lang.Object[]{mHandle, bufferColumnCount})); + return bufferColumnCount.getInt(0); + } + + /** + * Sets the number of columns in each image of this image3d + * + * @param columnCount number of columns + * @throws Lib3MFException + */ + public void setColumnCount(int columnCount) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_setcolumncount.invokeInt(new java.lang.Object[]{mHandle, columnCount})); + } + + /** + * Retrieves the number of images in the stack. + * + * @return number of images + * @throws Lib3MFException + */ + public int getSheetCount() throws Lib3MFException { + Pointer bufferSheetCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_getsheetcount.invokeInt(new java.lang.Object[]{mHandle, bufferSheetCount})); + return bufferSheetCount.getInt(0); + } + + /** + * Retrieves a sheet of the stack. Raises an error if sheet is not set. + * + * @param index index of the image (0-based) + * @return attachment containing the image + * @throws Lib3MFException + */ + public Attachment getSheet(int index) throws Lib3MFException { + Pointer bufferSheet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_getsheet.invokeInt(new java.lang.Object[]{mHandle, index, bufferSheet})); + Pointer valueSheet = bufferSheet.getPointer(0); + Attachment sheet = null; + if (valueSheet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Sheet was a null pointer"); + } + sheet = mWrapper.PolymorphicFactory(valueSheet, Attachment.class); + return sheet; + } + + /** + * Sets a sheet to an existing attachment. + * + * @param index index of the image (0-based) + * @param sheet attachment containing the image + * @throws Lib3MFException + */ + public void setSheet(int index, Attachment sheet) throws Lib3MFException { + Pointer sheetHandle = null; + if (sheet != null) { + sheetHandle = sheet.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Sheet is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_setsheet.invokeInt(new java.lang.Object[]{mHandle, index, sheetHandle})); + } + + /** + * Creates a new sheet attachment with empty data. + * + * @param index index of the image (0-based) + * @param path path of part in the package + * @return attachment containing the image + * @throws Lib3MFException + */ + public Attachment createEmptySheet(int index, String path) throws Lib3MFException { + byte[] bytesPath = path.getBytes(StandardCharsets.UTF_8); + Memory bufferPath = new Memory(bytesPath.length + 1); + bufferPath.write(0, bytesPath, 0, bytesPath.length); + bufferPath.setByte(bytesPath.length, (byte)0); + Pointer bufferSheet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_createemptysheet.invokeInt(new java.lang.Object[]{mHandle, index, bufferPath, bufferSheet})); + Pointer valueSheet = bufferSheet.getPointer(0); + Attachment sheet = null; + if (valueSheet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Sheet was a null pointer"); + } + sheet = mWrapper.PolymorphicFactory(valueSheet, Attachment.class); + return sheet; + } + + /** + * Creates a new sheet attachment from a memory buffer. + * + * @param index index of the image (0-based) + * @param path path of part in the package + * @param data binary image data + * @return attachment containing the image + * @throws Lib3MFException + */ + public Attachment createSheetFromBuffer(int index, String path, byte[] data) throws Lib3MFException { + byte[] bytesPath = path.getBytes(StandardCharsets.UTF_8); + Memory bufferPath = new Memory(bytesPath.length + 1); + bufferPath.write(0, bytesPath, 0, bytesPath.length); + bufferPath.setByte(bytesPath.length, (byte)0); + Pointer bufferData = new Memory(Math.max(1, 1 * data.length)); + for (int i = 0; i < data.length; i++) { + bufferData.setByte(1 * i, data[i]); + } + Pointer bufferSheet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_createsheetfrombuffer.invokeInt(new java.lang.Object[]{mHandle, index, bufferPath, (long) data.length, bufferData, bufferSheet})); + Pointer valueSheet = bufferSheet.getPointer(0); + Attachment sheet = null; + if (valueSheet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Sheet was a null pointer"); + } + sheet = mWrapper.PolymorphicFactory(valueSheet, Attachment.class); + return sheet; + } + + /** + * Creates a new sheet attachment from a file on disk. + * + * @param index index of the image (0-based) + * @param path path of part in the package + * @param fileName file name to read from + * @return attachment containing the image + * @throws Lib3MFException + */ + public Attachment createSheetFromFile(int index, String path, String fileName) throws Lib3MFException { + byte[] bytesPath = path.getBytes(StandardCharsets.UTF_8); + Memory bufferPath = new Memory(bytesPath.length + 1); + bufferPath.write(0, bytesPath, 0, bytesPath.length); + bufferPath.setByte(bytesPath.length, (byte)0); + byte[] bytesFileName = fileName.getBytes(StandardCharsets.UTF_8); + Memory bufferFileName = new Memory(bytesFileName.length + 1); + bufferFileName.write(0, bytesFileName, 0, bytesFileName.length); + bufferFileName.setByte(bytesFileName.length, (byte)0); + Pointer bufferSheet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_createsheetfromfile.invokeInt(new java.lang.Object[]{mHandle, index, bufferPath, bufferFileName, bufferSheet})); + Pointer valueSheet = bufferSheet.getPointer(0); + Attachment sheet = null; + if (valueSheet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Sheet was a null pointer"); + } + sheet = mWrapper.PolymorphicFactory(valueSheet, Attachment.class); + return sheet; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ImplicitFunction.java b/Autogenerated/Bindings/Java8/lib3mf/ImplicitFunction.java new file mode 100644 index 000000000..1e9ce2690 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ImplicitFunction.java @@ -0,0 +1,1961 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ImplicitFunction extends Function { + + public ImplicitFunction(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the identifier of the function + * + * @return the identifier + * @throws Lib3MFException + */ + public String getIdentifier() throws Lib3MFException { + Pointer bytesNeededIdentifier = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_getidentifier.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededIdentifier, null})); + int sizeIdentifier = bytesNeededIdentifier.getInt(0); + Pointer bufferIdentifier = new Memory(sizeIdentifier); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_getidentifier.invokeInt(new java.lang.Object[]{mHandle, sizeIdentifier, bytesNeededIdentifier, bufferIdentifier})); + return new String(bufferIdentifier.getByteArray(0, sizeIdentifier - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the identifier of the function + * + * @param identifier the identifier + * @throws Lib3MFException + */ + public void setIdentifier(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_setidentifier.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier})); + } + + /** + * Add a node + * + * @param nodeType the type of the node + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ImplicitNode addNode(Lib3MFWrapper.ImplicitNodeType nodeType, String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addnode.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertImplicitNodeTypeToConst(nodeType), bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ImplicitNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ImplicitNode.class); + return node; + } + + /** + * Add a SinNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public SinNode addSinNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addsinnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + SinNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, SinNode.class); + return node; + } + + /** + * Add a CosNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public CosNode addCosNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addcosnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + CosNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, CosNode.class); + return node; + } + + /** + * Add a TanNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public TanNode addTanNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addtannode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + TanNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, TanNode.class); + return node; + } + + /** + * Add a ArcSinNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ArcSinNode addArcSinNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addarcsinnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ArcSinNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ArcSinNode.class); + return node; + } + + /** + * Add a ArcCosNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ArcCosNode addArcCosNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addarccosnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ArcCosNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ArcCosNode.class); + return node; + } + + /** + * Add a ArcTan2Node + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ArcTan2Node addArcTan2Node(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addarctan2node.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ArcTan2Node node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ArcTan2Node.class); + return node; + } + + /** + * Add a SinhNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public SinhNode addSinhNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addsinhnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + SinhNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, SinhNode.class); + return node; + } + + /** + * Add a CoshNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public CoshNode addCoshNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addcoshnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + CoshNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, CoshNode.class); + return node; + } + + /** + * Add a TanhNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public TanhNode addTanhNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addtanhnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + TanhNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, TanhNode.class); + return node; + } + + /** + * Add a RoundNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public RoundNode addRoundNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addroundnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + RoundNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, RoundNode.class); + return node; + } + + /** + * Add a CeilNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public CeilNode addCeilNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addceilnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + CeilNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, CeilNode.class); + return node; + } + + /** + * Add a FloorNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public FloorNode addFloorNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addfloornode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + FloorNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, FloorNode.class); + return node; + } + + /** + * Add a SignNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public SignNode addSignNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addsignnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + SignNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, SignNode.class); + return node; + } + + /** + * Add a FractNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public FractNode addFractNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addfractnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + FractNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, FractNode.class); + return node; + } + + /** + * Add a AbsNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public AbsNode addAbsNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addabsnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + AbsNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, AbsNode.class); + return node; + } + + /** + * Add a ExpNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ExpNode addExpNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addexpnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ExpNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ExpNode.class); + return node; + } + + /** + * Add a LogNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public LogNode addLogNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addlognode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + LogNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, LogNode.class); + return node; + } + + /** + * Add a Log2Node + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public Log2Node addLog2Node(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addlog2node.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + Log2Node node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, Log2Node.class); + return node; + } + + /** + * Add a Log10Node + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public Log10Node addLog10Node(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addlog10node.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + Log10Node node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, Log10Node.class); + return node; + } + + /** + * Add a LengthNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public LengthNode addLengthNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addlengthnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + LengthNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, LengthNode.class); + return node; + } + + /** + * Add a TransposeNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public TransposeNode addTransposeNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addtransposenode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + TransposeNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, TransposeNode.class); + return node; + } + + /** + * Add a InverseNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public InverseNode addInverseNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addinversenode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + InverseNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, InverseNode.class); + return node; + } + + /** + * Add a SqrtNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public SqrtNode addSqrtNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addsqrtnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + SqrtNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, SqrtNode.class); + return node; + } + + /** + * Add a ResourceIdNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ResourceIdNode addResourceIdNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addresourceidnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ResourceIdNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ResourceIdNode.class); + return node; + } + + /** + * Add an AdditionNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public AdditionNode addAdditionNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addadditionnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + AdditionNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, AdditionNode.class); + return node; + } + + /** + * Add a SubtractionNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public SubtractionNode addSubtractionNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addsubtractionnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + SubtractionNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, SubtractionNode.class); + return node; + } + + /** + * Add a MultiplicationNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public MultiplicationNode addMultiplicationNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addmultiplicationnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + MultiplicationNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, MultiplicationNode.class); + return node; + } + + /** + * Add a DivisionNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public DivisionNode addDivisionNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_adddivisionnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + DivisionNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, DivisionNode.class); + return node; + } + + /** + * Add a DotNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public DotNode addDotNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_adddotnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + DotNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, DotNode.class); + return node; + } + + /** + * Add a CrossNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public CrossNode addCrossNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addcrossnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + CrossNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, CrossNode.class); + return node; + } + + /** + * Add a MatVecMultiplicationNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public MatVecMultiplicationNode addMatVecMultiplicationNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addmatvecmultiplicationnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + MatVecMultiplicationNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, MatVecMultiplicationNode.class); + return node; + } + + /** + * Add a MinNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public MinNode addMinNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addminnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + MinNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, MinNode.class); + return node; + } + + /** + * Add a MaxNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public MaxNode addMaxNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addmaxnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + MaxNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, MaxNode.class); + return node; + } + + /** + * Add a FmodNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public FmodNode addFmodNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addfmodnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + FmodNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, FmodNode.class); + return node; + } + + /** + * Add a PowNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public PowNode addPowNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addpownode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + PowNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, PowNode.class); + return node; + } + + /** + * Add a SelectNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public SelectNode addSelectNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addselectnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + SelectNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, SelectNode.class); + return node; + } + + /** + * Add a ClampNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ClampNode addClampNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addclampnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ClampNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ClampNode.class); + return node; + } + + /** + * Add a ComposeVectorNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ComposeVectorNode addComposeVectorNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addcomposevectornode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ComposeVectorNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ComposeVectorNode.class); + return node; + } + + /** + * Add a VectorFromScalar + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public VectorFromScalarNode addVectorFromScalarNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addvectorfromscalarnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + VectorFromScalarNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, VectorFromScalarNode.class); + return node; + } + + /** + * Add a DecomposeVectorNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public DecomposeVectorNode addDecomposeVectorNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_adddecomposevectornode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + DecomposeVectorNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, DecomposeVectorNode.class); + return node; + } + + /** + * Add a ComposeMatrixNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ComposeMatrixNode addComposeMatrixNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addcomposematrixnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ComposeMatrixNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ComposeMatrixNode.class); + return node; + } + + /** + * Add a MatrixFromRowsNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public MatrixFromRowsNode addMatrixFromRowsNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addmatrixfromrowsnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + MatrixFromRowsNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, MatrixFromRowsNode.class); + return node; + } + + /** + * Add a MatrixFromColumnsNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public MatrixFromColumnsNode addMatrixFromColumnsNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addmatrixfromcolumnsnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + MatrixFromColumnsNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, MatrixFromColumnsNode.class); + return node; + } + + /** + * Add a ConstantNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ConstantNode addConstantNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addconstantnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ConstantNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ConstantNode.class); + return node; + } + + /** + * Add a ConstVecNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ConstVecNode addConstVecNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addconstvecnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ConstVecNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ConstVecNode.class); + return node; + } + + /** + * Add a ConstMatNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ConstMatNode addConstMatNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addconstmatnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ConstMatNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ConstMatNode.class); + return node; + } + + /** + * Add a MeshNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public MeshNode addMeshNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addmeshnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + MeshNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, MeshNode.class); + return node; + } + + /** + * Add a UnsignedMeshNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public UnsignedMeshNode addUnsignedMeshNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addunsignedmeshnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + UnsignedMeshNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, UnsignedMeshNode.class); + return node; + } + + /** + * Add a BeamLatticeNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public BeamLatticeNode addBeamLatticeNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addbeamlatticenode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + BeamLatticeNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, BeamLatticeNode.class); + return node; + } + + /** + * Add a FunctionGradientNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public FunctionGradientNode addFunctionGradientNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addfunctiongradientnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + FunctionGradientNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, FunctionGradientNode.class); + return node; + } + + /** + * Add a NormalizeDistanceNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public NormalizeDistanceNode addNormalizeDistanceNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addnormalizedistancenode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + NormalizeDistanceNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, NormalizeDistanceNode.class); + return node; + } + + /** + * Add a FunctionCallNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public FunctionCallNode addFunctionCallNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addfunctioncallnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + FunctionCallNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, FunctionCallNode.class); + return node; + } + + /** + * Retrieves the nodes + * + * @return iterator for the list of nodes + * @throws Lib3MFException + */ + public NodeIterator getNodes() throws Lib3MFException { + Pointer bufferIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_getnodes.invokeInt(new java.lang.Object[]{mHandle, bufferIterator})); + Pointer valueIterator = bufferIterator.getPointer(0); + NodeIterator iterator = null; + if (valueIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Iterator was a null pointer"); + } + iterator = mWrapper.PolymorphicFactory(valueIterator, NodeIterator.class); + return iterator; + } + + /** + * Removes a node + * + * @param node The node to be removed + * @throws Lib3MFException + */ + public void removeNode(ImplicitNode node) throws Lib3MFException { + Pointer nodeHandle = null; + if (node != null) { + nodeHandle = node.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_removenode.invokeInt(new java.lang.Object[]{mHandle, nodeHandle})); + } + + /** + * Add a link + * + * @param source the source port + * @param target the target port + * @throws Lib3MFException + */ + public void addLink(ImplicitPort source, ImplicitPort target) throws Lib3MFException { + Pointer sourceHandle = null; + if (source != null) { + sourceHandle = source.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Source is a null value."); + } + Pointer targetHandle = null; + if (target != null) { + targetHandle = target.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Target is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addlink.invokeInt(new java.lang.Object[]{mHandle, sourceHandle, targetHandle})); + } + + /** + * Add a link + * + * @param source name of the source port in the format nodename.portname + * @param target name of the target port in the format nodename.portname + * @throws Lib3MFException + */ + public void addLinkByNames(String source, String target) throws Lib3MFException { + byte[] bytesSource = source.getBytes(StandardCharsets.UTF_8); + Memory bufferSource = new Memory(bytesSource.length + 1); + bufferSource.write(0, bytesSource, 0, bytesSource.length); + bufferSource.setByte(bytesSource.length, (byte)0); + byte[] bytesTarget = target.getBytes(StandardCharsets.UTF_8); + Memory bufferTarget = new Memory(bytesTarget.length + 1); + bufferTarget.write(0, bytesTarget, 0, bytesTarget.length); + bufferTarget.setByte(bytesTarget.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addlinkbynames.invokeInt(new java.lang.Object[]{mHandle, bufferSource, bufferTarget})); + } + + /** + * Clears the function + * + * @throws Lib3MFException + */ + public void clear() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_clear.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Sorts the nodes topologically + * + * @throws Lib3MFException + */ + public void sortNodesTopologically() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_sortnodestopologically.invokeInt(new java.lang.Object[]{mHandle})); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ImplicitNode.java b/Autogenerated/Bindings/Java8/lib3mf/ImplicitNode.java new file mode 100644 index 000000000..c107d62b2 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ImplicitNode.java @@ -0,0 +1,303 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ImplicitNode extends Base { + + public ImplicitNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the identifier of the node + * + * @return the identifier + * @throws Lib3MFException + */ + public String getIdentifier() throws Lib3MFException { + Pointer bytesNeededIdentifier = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_getidentifier.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededIdentifier, null})); + int sizeIdentifier = bytesNeededIdentifier.getInt(0); + Pointer bufferIdentifier = new Memory(sizeIdentifier); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_getidentifier.invokeInt(new java.lang.Object[]{mHandle, sizeIdentifier, bytesNeededIdentifier, bufferIdentifier})); + return new String(bufferIdentifier.getByteArray(0, sizeIdentifier - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the identifier of the node + * + * @param identifier the identifier + * @throws Lib3MFException + */ + public void setIdentifier(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_setidentifier.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier})); + } + + /** + * Retrieves the display name of the node + * + * @return the display name + * @throws Lib3MFException + */ + public String getDisplayName() throws Lib3MFException { + Pointer bytesNeededDisplayName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_getdisplayname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededDisplayName, null})); + int sizeDisplayName = bytesNeededDisplayName.getInt(0); + Pointer bufferDisplayName = new Memory(sizeDisplayName); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_getdisplayname.invokeInt(new java.lang.Object[]{mHandle, sizeDisplayName, bytesNeededDisplayName, bufferDisplayName})); + return new String(bufferDisplayName.getByteArray(0, sizeDisplayName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the display name of the node + * + * @param displayName the display name + * @throws Lib3MFException + */ + public void setDisplayName(String displayName) throws Lib3MFException { + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_setdisplayname.invokeInt(new java.lang.Object[]{mHandle, bufferDisplayName})); + } + + /** + * Retrieves the tag of the node + * + * @return the tag + * @throws Lib3MFException + */ + public String getTag() throws Lib3MFException { + Pointer bytesNeededTag = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_gettag.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededTag, null})); + int sizeTag = bytesNeededTag.getInt(0); + Pointer bufferTag = new Memory(sizeTag); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_gettag.invokeInt(new java.lang.Object[]{mHandle, sizeTag, bytesNeededTag, bufferTag})); + return new String(bufferTag.getByteArray(0, sizeTag - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the tag of the node + * + * @param tag the tag + * @throws Lib3MFException + */ + public void setTag(String tag) throws Lib3MFException { + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_settag.invokeInt(new java.lang.Object[]{mHandle, bufferTag})); + } + + /** + * Retrieves the type of the node + * + * @return the type of the node + * @throws Lib3MFException + */ + public Lib3MFWrapper.ImplicitNodeType getNodeType() throws Lib3MFException { + Pointer bufferType = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_getnodetype.invokeInt(new java.lang.Object[]{mHandle, bufferType})); + return Lib3MFWrapper.EnumConversion.convertConstToImplicitNodeType(bufferType.getInt(0)); + } + + /** + * Add an input + * + * @param identifier the identifier of the input + * @param displayName the display name of the input + * @return + * @throws Lib3MFException + */ + public ImplicitPort addInput(String identifier, String displayName) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + Pointer bufferPort = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_addinput.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferPort})); + Pointer valuePort = bufferPort.getPointer(0); + ImplicitPort port = null; + if (valuePort == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Port was a null pointer"); + } + port = mWrapper.PolymorphicFactory(valuePort, ImplicitPort.class); + return port; + } + + /** + * Retrieves the inputs + * + * @return the iterator for the inputs + * @throws Lib3MFException + */ + public ImplicitPortIterator getInputs() throws Lib3MFException { + Pointer bufferIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_getinputs.invokeInt(new java.lang.Object[]{mHandle, bufferIterator})); + Pointer valueIterator = bufferIterator.getPointer(0); + ImplicitPortIterator iterator = null; + if (valueIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Iterator was a null pointer"); + } + iterator = mWrapper.PolymorphicFactory(valueIterator, ImplicitPortIterator.class); + return iterator; + } + + /** + * Add an output + * + * @param identifier the identifier of the output + * @param displayName the display name of the output + * @return + * @throws Lib3MFException + */ + public ImplicitPort addOutput(String identifier, String displayName) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + Pointer bufferPort = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_addoutput.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferPort})); + Pointer valuePort = bufferPort.getPointer(0); + ImplicitPort port = null; + if (valuePort == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Port was a null pointer"); + } + port = mWrapper.PolymorphicFactory(valuePort, ImplicitPort.class); + return port; + } + + /** + * Retrieves the outputs + * + * @return the iterator the outputs + * @throws Lib3MFException + */ + public ImplicitPortIterator getOutputs() throws Lib3MFException { + Pointer bufferIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_getoutputs.invokeInt(new java.lang.Object[]{mHandle, bufferIterator})); + Pointer valueIterator = bufferIterator.getPointer(0); + ImplicitPortIterator iterator = null; + if (valueIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Iterator was a null pointer"); + } + iterator = mWrapper.PolymorphicFactory(valueIterator, ImplicitPortIterator.class); + return iterator; + } + + /** + * Retrieves an input + * + * @param identifier the identifier of the input + * @return the input port + * @throws Lib3MFException + */ + public ImplicitPort findInput(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + Pointer bufferInput = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_findinput.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferInput})); + Pointer valueInput = bufferInput.getPointer(0); + ImplicitPort input = null; + if (valueInput != Pointer.NULL) { + input = mWrapper.PolymorphicFactory(valueInput, ImplicitPort.class); + } + return input; + } + + /** + * Retrieves an output + * + * @param identifier the identifier of the output + * @return the output port + * @throws Lib3MFException + */ + public ImplicitPort findOutput(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + Pointer bufferOutput = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_findoutput.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferOutput})); + Pointer valueOutput = bufferOutput.getPointer(0); + ImplicitPort output = null; + if (valueOutput != Pointer.NULL) { + output = mWrapper.PolymorphicFactory(valueOutput, ImplicitPort.class); + } + return output; + } + + /** + * Checks if the types of the input and output ports are valid for the node type + * + * @return true, if the types are valid + * @throws Lib3MFException + */ + public boolean areTypesValid() throws Lib3MFException { + Pointer bufferValid = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_aretypesvalid.invokeInt(new java.lang.Object[]{mHandle, bufferValid})); + return bufferValid.getByte(0) != 0; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ImplicitPort.java b/Autogenerated/Bindings/Java8/lib3mf/ImplicitPort.java new file mode 100644 index 000000000..9914c1d34 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ImplicitPort.java @@ -0,0 +1,165 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ImplicitPort extends Base { + + public ImplicitPort(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the identifier of the port + * + * @return the identifier + * @throws Lib3MFException + */ + public String getIdentifier() throws Lib3MFException { + Pointer bytesNeededIdentifier = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_getidentifier.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededIdentifier, null})); + int sizeIdentifier = bytesNeededIdentifier.getInt(0); + Pointer bufferIdentifier = new Memory(sizeIdentifier); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_getidentifier.invokeInt(new java.lang.Object[]{mHandle, sizeIdentifier, bytesNeededIdentifier, bufferIdentifier})); + return new String(bufferIdentifier.getByteArray(0, sizeIdentifier - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the identifier of the port + * + * @param identifier the identifier + * @throws Lib3MFException + */ + public void setIdentifier(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_setidentifier.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier})); + } + + /** + * Retrieves the display name of the port + * + * @return the display name + * @throws Lib3MFException + */ + public String getDisplayName() throws Lib3MFException { + Pointer bytesNeededDisplayName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_getdisplayname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededDisplayName, null})); + int sizeDisplayName = bytesNeededDisplayName.getInt(0); + Pointer bufferDisplayName = new Memory(sizeDisplayName); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_getdisplayname.invokeInt(new java.lang.Object[]{mHandle, sizeDisplayName, bytesNeededDisplayName, bufferDisplayName})); + return new String(bufferDisplayName.getByteArray(0, sizeDisplayName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the display name of the port + * + * @param displayName the display name + * @throws Lib3MFException + */ + public void setDisplayName(String displayName) throws Lib3MFException { + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_setdisplayname.invokeInt(new java.lang.Object[]{mHandle, bufferDisplayName})); + } + + /** + * Sets the type of the port + * + * @param implicitPortType the type + * @throws Lib3MFException + */ + public void setType(Lib3MFWrapper.ImplicitPortType implicitPortType) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_settype.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertImplicitPortTypeToConst(implicitPortType)})); + } + + /** + * Retrieves the type of the port + * + * @return the type + * @throws Lib3MFException + */ + public Lib3MFWrapper.ImplicitPortType getType() throws Lib3MFException { + Pointer bufferImplicitPortType = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_gettype.invokeInt(new java.lang.Object[]{mHandle, bufferImplicitPortType})); + return Lib3MFWrapper.EnumConversion.convertConstToImplicitPortType(bufferImplicitPortType.getInt(0)); + } + + /** + * Retrieves the reference of the port, only used for input ports + * + * @return the reference + * @throws Lib3MFException + */ + public String getReference() throws Lib3MFException { + Pointer bytesNeededReference = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_getreference.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededReference, null})); + int sizeReference = bytesNeededReference.getInt(0); + Pointer bufferReference = new Memory(sizeReference); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_getreference.invokeInt(new java.lang.Object[]{mHandle, sizeReference, bytesNeededReference, bufferReference})); + return new String(bufferReference.getByteArray(0, sizeReference - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the reference of the port, only used for input ports + * + * @param reference the reference + * @throws Lib3MFException + */ + public void setReference(String reference) throws Lib3MFException { + byte[] bytesReference = reference.getBytes(StandardCharsets.UTF_8); + Memory bufferReference = new Memory(bytesReference.length + 1); + bufferReference.write(0, bytesReference, 0, bytesReference.length); + bufferReference.setByte(bytesReference.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_setreference.invokeInt(new java.lang.Object[]{mHandle, bufferReference})); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ImplicitPortIterator.java b/Autogenerated/Bindings/Java8/lib3mf/ImplicitPortIterator.java new file mode 100644 index 000000000..7db97344c --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ImplicitPortIterator.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ImplicitPortIterator extends Iterator { + + public ImplicitPortIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the current element + * + * @return The current element + * @throws Lib3MFException + */ + public ImplicitPort getCurrent() throws Lib3MFException { + Pointer bufferPort = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitportiterator_getcurrent.invokeInt(new java.lang.Object[]{mHandle, bufferPort})); + Pointer valuePort = bufferPort.getPointer(0); + ImplicitPort port = null; + if (valuePort == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Port was a null pointer"); + } + port = mWrapper.PolymorphicFactory(valuePort, ImplicitPort.class); + return port; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/InverseNode.java b/Autogenerated/Bindings/Java8/lib3mf/InverseNode.java new file mode 100644 index 000000000..df50d9c85 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/InverseNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class InverseNode extends OneInputNode { + + public InverseNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Iterator.java b/Autogenerated/Bindings/Java8/lib3mf/Iterator.java new file mode 100644 index 000000000..98feff349 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Iterator.java @@ -0,0 +1,92 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Iterator extends Base { + + public Iterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Iterates to the next item in the list. + * + * @return Iterates to the next item in the list. + * @throws Lib3MFException + */ + public boolean moveNext() throws Lib3MFException { + Pointer bufferHasNext = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_iterator_movenext.invokeInt(new java.lang.Object[]{mHandle, bufferHasNext})); + return bufferHasNext.getByte(0) != 0; + } + + /** + * Iterates to the previous item in the list. + * + * @return Iterates to the previous item in the list. + * @throws Lib3MFException + */ + public boolean movePrevious() throws Lib3MFException { + Pointer bufferHasPrevious = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_iterator_moveprevious.invokeInt(new java.lang.Object[]{mHandle, bufferHasPrevious})); + return bufferHasPrevious.getByte(0) != 0; + } + + /** + * Returns the number of items the iterator captures. + * + * @return returns the number of items the iterator captures. + * @throws Lib3MFException + */ + public long count() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_iterator_count.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/KeyStore.java b/Autogenerated/Bindings/Java8/lib3mf/KeyStore.java new file mode 100644 index 000000000..bd0ca4b8f --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/KeyStore.java @@ -0,0 +1,402 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class KeyStore extends Base { + + public KeyStore(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Adds a consumer to the keystore + * + * @param consumerID A unique identifier for the consumer + * @param keyID The id of the key of the consumer + * @param keyValue The public key for this consumer in PEM format + * @return The consumer instance + * @throws Lib3MFException + */ + public Consumer addConsumer(String consumerID, String keyID, String keyValue) throws Lib3MFException { + byte[] bytesConsumerID = consumerID.getBytes(StandardCharsets.UTF_8); + Memory bufferConsumerID = new Memory(bytesConsumerID.length + 1); + bufferConsumerID.write(0, bytesConsumerID, 0, bytesConsumerID.length); + bufferConsumerID.setByte(bytesConsumerID.length, (byte)0); + byte[] bytesKeyID = keyID.getBytes(StandardCharsets.UTF_8); + Memory bufferKeyID = new Memory(bytesKeyID.length + 1); + bufferKeyID.write(0, bytesKeyID, 0, bytesKeyID.length); + bufferKeyID.setByte(bytesKeyID.length, (byte)0); + byte[] bytesKeyValue = keyValue.getBytes(StandardCharsets.UTF_8); + Memory bufferKeyValue = new Memory(bytesKeyValue.length + 1); + bufferKeyValue.write(0, bytesKeyValue, 0, bytesKeyValue.length); + bufferKeyValue.setByte(bytesKeyValue.length, (byte)0); + Pointer bufferConsumer = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_addconsumer.invokeInt(new java.lang.Object[]{mHandle, bufferConsumerID, bufferKeyID, bufferKeyValue, bufferConsumer})); + Pointer valueConsumer = bufferConsumer.getPointer(0); + Consumer consumer = null; + if (valueConsumer == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Consumer was a null pointer"); + } + consumer = mWrapper.PolymorphicFactory(valueConsumer, Consumer.class); + return consumer; + } + + /** + * Gets the number of consumers in the keystore + * + * @return The consumer count + * @throws Lib3MFException + */ + public long getConsumerCount() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_getconsumercount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + /** + * Get a consumer from the keystore + * + * @param consumerIndex The index of the consumer + * @return The consumer instance + * @throws Lib3MFException + */ + public Consumer getConsumer(long consumerIndex) throws Lib3MFException { + Pointer bufferConsumer = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_getconsumer.invokeInt(new java.lang.Object[]{mHandle, consumerIndex, bufferConsumer})); + Pointer valueConsumer = bufferConsumer.getPointer(0); + Consumer consumer = null; + if (valueConsumer == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Consumer was a null pointer"); + } + consumer = mWrapper.PolymorphicFactory(valueConsumer, Consumer.class); + return consumer; + } + + /** + * Removes a consumer from the keystore + * + * @param consumer The consumer instance to remove + * @throws Lib3MFException + */ + public void removeConsumer(Consumer consumer) throws Lib3MFException { + Pointer consumerHandle = null; + if (consumer != null) { + consumerHandle = consumer.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Consumer is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_keystore_removeconsumer.invokeInt(new java.lang.Object[]{mHandle, consumerHandle})); + } + + /** + * Finds a consumer by ID + * + * @param consumerID The ID of the consumer + * @return The consumer instance + * @throws Lib3MFException + */ + public Consumer findConsumer(String consumerID) throws Lib3MFException { + byte[] bytesConsumerID = consumerID.getBytes(StandardCharsets.UTF_8); + Memory bufferConsumerID = new Memory(bytesConsumerID.length + 1); + bufferConsumerID.write(0, bytesConsumerID, 0, bytesConsumerID.length); + bufferConsumerID.setByte(bytesConsumerID.length, (byte)0); + Pointer bufferConsumer = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_findconsumer.invokeInt(new java.lang.Object[]{mHandle, bufferConsumerID, bufferConsumer})); + Pointer valueConsumer = bufferConsumer.getPointer(0); + Consumer consumer = null; + if (valueConsumer != Pointer.NULL) { + consumer = mWrapper.PolymorphicFactory(valueConsumer, Consumer.class); + } + return consumer; + } + + /** + * Gets the number of resource data group in the keysore + * + * @return The number of resource data available + * @throws Lib3MFException + */ + public long getResourceDataGroupCount() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_getresourcedatagroupcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + /** + * Adds a resource data group into the keystore. + * + * @return The resource data group instance + * @throws Lib3MFException + */ + public ResourceDataGroup addResourceDataGroup() throws Lib3MFException { + Pointer bufferResourceDataGroup = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_addresourcedatagroup.invokeInt(new java.lang.Object[]{mHandle, bufferResourceDataGroup})); + Pointer valueResourceDataGroup = bufferResourceDataGroup.getPointer(0); + ResourceDataGroup resourceDataGroup = null; + if (valueResourceDataGroup == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceDataGroup was a null pointer"); + } + resourceDataGroup = mWrapper.PolymorphicFactory(valueResourceDataGroup, ResourceDataGroup.class); + return resourceDataGroup; + } + + /** + * Gets a resource data group + * + * @param resourceDataIndex The index of the resource data + * @return The resource data group instance + * @throws Lib3MFException + */ + public ResourceDataGroup getResourceDataGroup(long resourceDataIndex) throws Lib3MFException { + Pointer bufferResourceDataGroup = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_getresourcedatagroup.invokeInt(new java.lang.Object[]{mHandle, resourceDataIndex, bufferResourceDataGroup})); + Pointer valueResourceDataGroup = bufferResourceDataGroup.getPointer(0); + ResourceDataGroup resourceDataGroup = null; + if (valueResourceDataGroup == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceDataGroup was a null pointer"); + } + resourceDataGroup = mWrapper.PolymorphicFactory(valueResourceDataGroup, ResourceDataGroup.class); + return resourceDataGroup; + } + + /** + * Removes a resource data group + * + * @param resourceDataGroup The resource data group instance + * @throws Lib3MFException + */ + public void removeResourceDataGroup(ResourceDataGroup resourceDataGroup) throws Lib3MFException { + Pointer resourceDataGroupHandle = null; + if (resourceDataGroup != null) { + resourceDataGroupHandle = resourceDataGroup.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceDataGroup is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_keystore_removeresourcedatagroup.invokeInt(new java.lang.Object[]{mHandle, resourceDataGroupHandle})); + } + + /** + * Finds a resource data group that contains a particular resourcedata + * + * @param partPath The target path for the resourcedata hold by the resource data group + * @return The data resource instance + * @throws Lib3MFException + */ + public ResourceDataGroup findResourceDataGroup(PackagePart partPath) throws Lib3MFException { + Pointer partPathHandle = null; + if (partPath != null) { + partPathHandle = partPath.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "PartPath is a null value."); + } + Pointer bufferResourceDataGroup = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_findresourcedatagroup.invokeInt(new java.lang.Object[]{mHandle, partPathHandle, bufferResourceDataGroup})); + Pointer valueResourceDataGroup = bufferResourceDataGroup.getPointer(0); + ResourceDataGroup resourceDataGroup = null; + if (valueResourceDataGroup != Pointer.NULL) { + resourceDataGroup = mWrapper.PolymorphicFactory(valueResourceDataGroup, ResourceDataGroup.class); + } + return resourceDataGroup; + } + + /** + * Add resourcedata to resourcedatagroup element + * + * @param resourceDataGroup The resource data group where to add this resource data + * @param partPath The path of the part to be encrypted + * @param algorithm The encryption algorithm to be used to encrypt this resource + * @param compression Whether compression should be used prior to encryption + * @param additionalAuthenticationData Additional data to be encrypted along the contents for better security + * @return The data resource instance + * @throws Lib3MFException + */ + public ResourceData addResourceData(ResourceDataGroup resourceDataGroup, PackagePart partPath, Lib3MFWrapper.EncryptionAlgorithm algorithm, Lib3MFWrapper.Compression compression, byte[] additionalAuthenticationData) throws Lib3MFException { + Pointer resourceDataGroupHandle = null; + if (resourceDataGroup != null) { + resourceDataGroupHandle = resourceDataGroup.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceDataGroup is a null value."); + } + Pointer partPathHandle = null; + if (partPath != null) { + partPathHandle = partPath.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "PartPath is a null value."); + } + Pointer bufferAdditionalAuthenticationData = new Memory(Math.max(1, 1 * additionalAuthenticationData.length)); + for (int i = 0; i < additionalAuthenticationData.length; i++) { + bufferAdditionalAuthenticationData.setByte(1 * i, additionalAuthenticationData[i]); + } + Pointer bufferResourceData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_addresourcedata.invokeInt(new java.lang.Object[]{mHandle, resourceDataGroupHandle, partPathHandle, Lib3MFWrapper.EnumConversion.convertEncryptionAlgorithmToConst(algorithm), Lib3MFWrapper.EnumConversion.convertCompressionToConst(compression), (long) additionalAuthenticationData.length, bufferAdditionalAuthenticationData, bufferResourceData})); + Pointer valueResourceData = bufferResourceData.getPointer(0); + ResourceData resourceData = null; + if (valueResourceData == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceData was a null pointer"); + } + resourceData = mWrapper.PolymorphicFactory(valueResourceData, ResourceData.class); + return resourceData; + } + + /** + * Removes a resource data + * + * @param resourceData The resource data to be removed + * @throws Lib3MFException + */ + public void removeResourceData(ResourceData resourceData) throws Lib3MFException { + Pointer resourceDataHandle = null; + if (resourceData != null) { + resourceDataHandle = resourceData.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceData is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_keystore_removeresourcedata.invokeInt(new java.lang.Object[]{mHandle, resourceDataHandle})); + } + + /** + * Finds a resource data on this resource group + * + * @param resourcePath The target path for the resourcedata + * @return The resource data instance + * @throws Lib3MFException + */ + public ResourceData findResourceData(PackagePart resourcePath) throws Lib3MFException { + Pointer resourcePathHandle = null; + if (resourcePath != null) { + resourcePathHandle = resourcePath.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourcePath is a null value."); + } + Pointer bufferResourceData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_findresourcedata.invokeInt(new java.lang.Object[]{mHandle, resourcePathHandle, bufferResourceData})); + Pointer valueResourceData = bufferResourceData.getPointer(0); + ResourceData resourceData = null; + if (valueResourceData != Pointer.NULL) { + resourceData = mWrapper.PolymorphicFactory(valueResourceData, ResourceData.class); + } + return resourceData; + } + + /** + * Gets the number of resource data in the keysore + * + * @return The number of resource data available + * @throws Lib3MFException + */ + public long getResourceDataCount() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_getresourcedatacount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + /** + * Gets a resource data + * + * @param resourceDataIndex The index of the resource data + * @return The data resource instance + * @throws Lib3MFException + */ + public ResourceData getResourceData(long resourceDataIndex) throws Lib3MFException { + Pointer bufferResourceData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_getresourcedata.invokeInt(new java.lang.Object[]{mHandle, resourceDataIndex, bufferResourceData})); + Pointer valueResourceData = bufferResourceData.getPointer(0); + ResourceData resourceData = null; + if (valueResourceData == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceData was a null pointer"); + } + resourceData = mWrapper.PolymorphicFactory(valueResourceData, ResourceData.class); + return resourceData; + } + + /** + * Gets the keystore UUID + * + * @return GetUUID Result Tuple + * @throws Lib3MFException + */ + public GetUUIDResult getUUID() throws Lib3MFException { + Pointer bufferHasUUID = new Memory(1); + Pointer bytesNeededUUID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_getuuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, 0, bytesNeededUUID, null})); + int sizeUUID = bytesNeededUUID.getInt(0); + Pointer bufferUUID = new Memory(sizeUUID); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_getuuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, sizeUUID, bytesNeededUUID, bufferUUID})); + GetUUIDResult returnTuple = new GetUUIDResult(); + returnTuple.HasUUID = bufferHasUUID.getByte(0) != 0; + returnTuple.UUID = new String(bufferUUID.getByteArray(0, sizeUUID - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetUUIDResult { + /** + * flag whether the keystore has a UUID + */ + public boolean HasUUID; + + /** + * returns the keystore uuid. + */ + public String UUID; + + } + /** + * Sets the keystore UUID + * + * @param uUID The new keystore uuid. + * @throws Lib3MFException + */ + public void setUUID(String uUID) throws Lib3MFException { + byte[] bytesUUID = uUID.getBytes(StandardCharsets.UTF_8); + Memory bufferUUID = new Memory(bytesUUID.length + 1); + bufferUUID.write(0, bytesUUID, 0, bytesUUID.length); + bufferUUID.setByte(bytesUUID.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_setuuid.invokeInt(new java.lang.Object[]{mHandle, bufferUUID})); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/LengthNode.java b/Autogenerated/Bindings/Java8/lib3mf/LengthNode.java new file mode 100644 index 000000000..751e8665a --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/LengthNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class LengthNode extends OneInputNode { + + public LengthNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/LevelSet.java b/Autogenerated/Bindings/Java8/lib3mf/LevelSet.java new file mode 100644 index 000000000..7b90acc83 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/LevelSet.java @@ -0,0 +1,276 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class LevelSet extends Object { + + public LevelSet(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the function that is used as boundary shape. + * + * @return the function to use as boundary shape + * @throws Lib3MFException + */ + public Function getFunction() throws Lib3MFException { + Pointer bufferTheFunction = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_getfunction.invokeInt(new java.lang.Object[]{mHandle, bufferTheFunction})); + Pointer valueTheFunction = bufferTheFunction.getPointer(0); + Function theFunction = null; + if (valueTheFunction != Pointer.NULL) { + theFunction = mWrapper.PolymorphicFactory(valueTheFunction, Function.class); + } + return theFunction; + } + + /** + * Sets the function to use as boundary shape. + * + * @param theFunction the function to use as boundary shape + * @throws Lib3MFException + */ + public void setFunction(Function theFunction) throws Lib3MFException { + Pointer theFunctionHandle = null; + if (theFunction != null) { + theFunctionHandle = theFunction.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheFunction is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_levelset_setfunction.invokeInt(new java.lang.Object[]{mHandle, theFunctionHandle})); + } + + /** + * Returns the transformation matrix into the coordinate system of the referenced Function. + * + * @return the transformation matrix + * @throws Lib3MFException + */ + public Transform getTransform() throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_gettransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * Sets the transformation matrix into the coordinate system of the referenced Function. + * + * @param transform new transformation matrix + * @throws Lib3MFException + */ + public void setTransform(Transform transform) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_settransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + } + + /** + * Returns the name of the function output channel to use. + * + * @return the name of the function output channel + * @throws Lib3MFException + */ + public String getChannelName() throws Lib3MFException { + Pointer bytesNeededChannelName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_getchannelname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededChannelName, null})); + int sizeChannelName = bytesNeededChannelName.getInt(0); + Pointer bufferChannelName = new Memory(sizeChannelName); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_getchannelname.invokeInt(new java.lang.Object[]{mHandle, sizeChannelName, bytesNeededChannelName, bufferChannelName})); + return new String(bufferChannelName.getByteArray(0, sizeChannelName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the name of the function output channel to use. + * + * @param channelName new name of the function output channel + * @throws Lib3MFException + */ + public void setChannelName(String channelName) throws Lib3MFException { + byte[] bytesChannelName = channelName.getBytes(StandardCharsets.UTF_8); + Memory bufferChannelName = new Memory(bytesChannelName.length + 1); + bufferChannelName.write(0, bytesChannelName, 0, bytesChannelName.length); + bufferChannelName.setByte(bytesChannelName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_setchannelname.invokeInt(new java.lang.Object[]{mHandle, bufferChannelName})); + } + + /** + * Sets the minimal feature size as a hint for the function evaluator + * + * @param minFeatureSize minimal feature size + * @throws Lib3MFException + */ + public void setMinFeatureSize(double minFeatureSize) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_levelset_setminfeaturesize.invokeInt(new java.lang.Object[]{mHandle, minFeatureSize})); + } + + /** + * Returns the minimal feature size as a hint for the function evaluator + * + * @return minimal feature size + * @throws Lib3MFException + */ + public double getMinFeatureSize() throws Lib3MFException { + Pointer bufferMinFeatureSize = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_getminfeaturesize.invokeInt(new java.lang.Object[]{mHandle, bufferMinFeatureSize})); + return bufferMinFeatureSize.getDouble(0); + } + + /** + * Sets the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). + * + * @param fallBackValue fallback value + * @throws Lib3MFException + */ + public void setFallBackValue(double fallBackValue) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_levelset_setfallbackvalue.invokeInt(new java.lang.Object[]{mHandle, fallBackValue})); + } + + /** + * Returns the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). + * + * @return fallback value + * @throws Lib3MFException + */ + public double getFallBackValue() throws Lib3MFException { + Pointer bufferFallBackValue = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_getfallbackvalue.invokeInt(new java.lang.Object[]{mHandle, bufferFallBackValue})); + return bufferFallBackValue.getDouble(0); + } + + /** + * If set only the bounding box of the mesh is intersected with the boundary + * + * @param meshBBoxOnly If set only the bounding box of the mesh is intersected with the boundary + * @throws Lib3MFException + */ + public void setMeshBBoxOnly(boolean meshBBoxOnly) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_levelset_setmeshbboxonly.invokeInt(new java.lang.Object[]{mHandle, meshBBoxOnly})); + } + + /** + * If set only the bounding box of the mesh is intersected with the boundary + * + * @return If set only the bounding box of the mesh is intersected with the boundary + * @throws Lib3MFException + */ + public boolean getMeshBBoxOnly() throws Lib3MFException { + Pointer bufferMeshBBoxOnly = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_getmeshbboxonly.invokeInt(new java.lang.Object[]{mHandle, bufferMeshBBoxOnly})); + return bufferMeshBBoxOnly.getByte(0) != 0; + } + + /** + * Sets the mesh to use as evaluation domain + * + * @param theMesh The mesh + * @throws Lib3MFException + */ + public void setMesh(MeshObject theMesh) throws Lib3MFException { + Pointer theMeshHandle = null; + if (theMesh != null) { + theMeshHandle = theMesh.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheMesh is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_levelset_setmesh.invokeInt(new java.lang.Object[]{mHandle, theMeshHandle})); + } + + /** + * Returns the mesh that is used as evaluation domain + * + * @return The mesh + * @throws Lib3MFException + */ + public MeshObject getMesh() throws Lib3MFException { + Pointer bufferTheMesh = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_getmesh.invokeInt(new java.lang.Object[]{mHandle, bufferTheMesh})); + Pointer valueTheMesh = bufferTheMesh.getPointer(0); + MeshObject theMesh = null; + if (valueTheMesh != Pointer.NULL) { + theMesh = mWrapper.PolymorphicFactory(valueTheMesh, MeshObject.class); + } + return theMesh; + } + + /** + * Retrieves the VolumeData this Object. + * + * @return the VolumeData of this Object + * @throws Lib3MFException + */ + public VolumeData getVolumeData() throws Lib3MFException { + Pointer bufferTheVolumeData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_getvolumedata.invokeInt(new java.lang.Object[]{mHandle, bufferTheVolumeData})); + Pointer valueTheVolumeData = bufferTheVolumeData.getPointer(0); + VolumeData theVolumeData = null; + if (valueTheVolumeData != Pointer.NULL) { + theVolumeData = mWrapper.PolymorphicFactory(valueTheVolumeData, VolumeData.class); + } + return theVolumeData; + } + + /** + * Sets the VolumeData of this LevelSet. + * + * @param theVolumeData the VolumeData of this MeshObject + * @throws Lib3MFException + */ + public void setVolumeData(VolumeData theVolumeData) throws Lib3MFException { + Pointer theVolumeDataHandle = null; + if (theVolumeData != null) { + theVolumeDataHandle = theVolumeData.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheVolumeData is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_levelset_setvolumedata.invokeInt(new java.lang.Object[]{mHandle, theVolumeDataHandle})); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/LevelSetIterator.java b/Autogenerated/Bindings/Java8/lib3mf/LevelSetIterator.java new file mode 100644 index 000000000..90436f8f7 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/LevelSetIterator.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class LevelSetIterator extends ResourceIterator { + + public LevelSetIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the LevelSet the iterator points at. + * + * @return returns the MeshObject instance. + * @throws Lib3MFException + */ + public LevelSet getCurrentLevelSet() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_levelsetiterator_getcurrentlevelset.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + LevelSet resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, LevelSet.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Lib3MFException.java b/Autogenerated/Bindings/Java8/lib3mf/Lib3MFException.java new file mode 100644 index 000000000..55f2739fe --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Lib3MFException.java @@ -0,0 +1,222 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import java.util.HashMap; +import java.util.Map; + +public class Lib3MFException extends Exception { + + // Error Constants for Lib3MF + public static final int LIB3MF_SUCCESS = 0; + public static final int LIB3MF_ERROR_NOTIMPLEMENTED = 1; + public static final int LIB3MF_ERROR_INVALIDPARAM = 2; + public static final int LIB3MF_ERROR_INVALIDCAST = 3; + public static final int LIB3MF_ERROR_BUFFERTOOSMALL = 4; + public static final int LIB3MF_ERROR_GENERICEXCEPTION = 5; + public static final int LIB3MF_ERROR_COULDNOTLOADLIBRARY = 6; + public static final int LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT = 7; + public static final int LIB3MF_ERROR_INCOMPATIBLEBINARYVERSION = 8; + public static final int LIB3MF_ERROR_CALCULATIONABORTED = 10; + public static final int LIB3MF_ERROR_SHOULDNOTBECALLED = 11; + public static final int LIB3MF_ERROR_READERCLASSUNKNOWN = 100; + public static final int LIB3MF_ERROR_WRITERCLASSUNKNOWN = 101; + public static final int LIB3MF_ERROR_ITERATORINVALIDINDEX = 102; + public static final int LIB3MF_ERROR_INVALIDMODELRESOURCE = 103; + public static final int LIB3MF_ERROR_RESOURCENOTFOUND = 104; + public static final int LIB3MF_ERROR_INVALIDMODEL = 105; + public static final int LIB3MF_ERROR_INVALIDOBJECT = 106; + public static final int LIB3MF_ERROR_INVALIDMESHOBJECT = 107; + public static final int LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT = 108; + public static final int LIB3MF_ERROR_INVALIDCOMPONENT = 109; + public static final int LIB3MF_ERROR_INVALIDBUILDITEM = 110; + public static final int LIB3MF_ERROR_INVALIDBASEMATERIALGROUP = 111; + public static final int LIB3MF_ERROR_INVALIDSLICESTACKRESOURCE = 112; + public static final int LIB3MF_ERROR_INVALIDTEXTURERESOURCE = 113; + public static final int LIB3MF_ERROR_INVALIDCOLORGROUP = 114; + public static final int LIB3MF_ERROR_INVALIDTEXTURE2DGROUP = 115; + public static final int LIB3MF_ERROR_INVALIDCOMPOSITEMATERIALS = 116; + public static final int LIB3MF_ERROR_INVALIDMULTIPROPERTYGROUP = 117; + public static final int LIB3MF_ERROR_INVALIDRESOURCEINDEX = 120; + public static final int LIB3MF_ERROR_ATTACHMENTNOTFOUND = 121; + public static final int LIB3MF_ERROR_FORBIDDENCYCLICREFERENCE = 130; + public static final int LIB3MF_ERROR_INVALIDATTACHMENTSTREAM = 131; + public static final int LIB3MF_ERROR_INVALIDPROPERTYCOUNT = 132; + public static final int LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER = 140; + public static final int LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT = 141; + public static final int LIB3MF_ERROR_INVALIDRESOURCE = 142; + public static final int LIB3MF_ERROR_INVALIDLEVELSET = 143; + public static final int LIB3MF_ERROR_COULDNOTFINDTRIANGLESET = 144; + public static final int LIB3MF_ERROR_INVALIDTRIANGLESETINDEX = 145; + public static final int LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE = 2000; + public static final int LIB3MF_ERROR_INVALIDKEYSTORE = 3000; + public static final int LIB3MF_ERROR_INVALIDKEYSTORECONSUMER = 3001; + public static final int LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND = 3002; + public static final int LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND = 3003; + public static final int LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED = 3004; + public static final int LIB3MF_ERROR_INVALIDKEYSIZE = 3005; + public static final int LIB3MF_ERROR_INCOMPATIBLEPORTTYPES = 4000; + public static final int LIB3MF_ERROR_GRAPHISCYCLIC = 4001; + public static final int LIB3MF_ERROR_INPUTNOTSET = 4002; + public static final int LIB3MF_ERROR_INVALIDNODECONFIGURATION = 4003; + + public static final Map ErrorCodeMap = new HashMap(); + public static final Map ErrorDescriptionMap = new HashMap(); + + static { + ErrorCodeMap.put(LIB3MF_ERROR_NOTIMPLEMENTED, "LIB3MF_ERROR_NOTIMPLEMENTED"); + ErrorDescriptionMap.put(LIB3MF_ERROR_NOTIMPLEMENTED, "functionality not implemented"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDPARAM, "LIB3MF_ERROR_INVALIDPARAM"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDPARAM, "an invalid parameter was passed"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDCAST, "LIB3MF_ERROR_INVALIDCAST"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDCAST, "a type cast failed"); + ErrorCodeMap.put(LIB3MF_ERROR_BUFFERTOOSMALL, "LIB3MF_ERROR_BUFFERTOOSMALL"); + ErrorDescriptionMap.put(LIB3MF_ERROR_BUFFERTOOSMALL, "a provided buffer is too small"); + ErrorCodeMap.put(LIB3MF_ERROR_GENERICEXCEPTION, "LIB3MF_ERROR_GENERICEXCEPTION"); + ErrorDescriptionMap.put(LIB3MF_ERROR_GENERICEXCEPTION, "a generic exception occurred"); + ErrorCodeMap.put(LIB3MF_ERROR_COULDNOTLOADLIBRARY, "LIB3MF_ERROR_COULDNOTLOADLIBRARY"); + ErrorDescriptionMap.put(LIB3MF_ERROR_COULDNOTLOADLIBRARY, "the library could not be loaded"); + ErrorCodeMap.put(LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT, "LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT"); + ErrorDescriptionMap.put(LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT, "a required exported symbol could not be found in the library"); + ErrorCodeMap.put(LIB3MF_ERROR_INCOMPATIBLEBINARYVERSION, "LIB3MF_ERROR_INCOMPATIBLEBINARYVERSION"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INCOMPATIBLEBINARYVERSION, "the version of the binary interface does not match the bindings interface"); + ErrorCodeMap.put(LIB3MF_ERROR_CALCULATIONABORTED, "LIB3MF_ERROR_CALCULATIONABORTED"); + ErrorDescriptionMap.put(LIB3MF_ERROR_CALCULATIONABORTED, "a calculation has been aborted"); + ErrorCodeMap.put(LIB3MF_ERROR_SHOULDNOTBECALLED, "LIB3MF_ERROR_SHOULDNOTBECALLED"); + ErrorDescriptionMap.put(LIB3MF_ERROR_SHOULDNOTBECALLED, "functionality should not be called"); + ErrorCodeMap.put(LIB3MF_ERROR_READERCLASSUNKNOWN, "LIB3MF_ERROR_READERCLASSUNKNOWN"); + ErrorDescriptionMap.put(LIB3MF_ERROR_READERCLASSUNKNOWN, "the queried reader class is unknown"); + ErrorCodeMap.put(LIB3MF_ERROR_WRITERCLASSUNKNOWN, "LIB3MF_ERROR_WRITERCLASSUNKNOWN"); + ErrorDescriptionMap.put(LIB3MF_ERROR_WRITERCLASSUNKNOWN, "the queried writer class is unknown"); + ErrorCodeMap.put(LIB3MF_ERROR_ITERATORINVALIDINDEX, "LIB3MF_ERROR_ITERATORINVALIDINDEX"); + ErrorDescriptionMap.put(LIB3MF_ERROR_ITERATORINVALIDINDEX, "the current index of an iterator is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDMODELRESOURCE, "LIB3MF_ERROR_INVALIDMODELRESOURCE"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDMODELRESOURCE, "no Model Resource has been given"); + ErrorCodeMap.put(LIB3MF_ERROR_RESOURCENOTFOUND, "LIB3MF_ERROR_RESOURCENOTFOUND"); + ErrorDescriptionMap.put(LIB3MF_ERROR_RESOURCENOTFOUND, "Resource not found"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDMODEL, "LIB3MF_ERROR_INVALIDMODEL"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDMODEL, "A model is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDOBJECT, "LIB3MF_ERROR_INVALIDOBJECT"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDOBJECT, "An object is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDMESHOBJECT, "LIB3MF_ERROR_INVALIDMESHOBJECT"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDMESHOBJECT, "A mesh object is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT, "LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT, "A components object is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDCOMPONENT, "LIB3MF_ERROR_INVALIDCOMPONENT"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDCOMPONENT, "A component is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDBUILDITEM, "LIB3MF_ERROR_INVALIDBUILDITEM"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDBUILDITEM, "A build item is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDBASEMATERIALGROUP, "LIB3MF_ERROR_INVALIDBASEMATERIALGROUP"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDBASEMATERIALGROUP, "A basematerialgroup is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDSLICESTACKRESOURCE, "LIB3MF_ERROR_INVALIDSLICESTACKRESOURCE"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDSLICESTACKRESOURCE, "A slicestack resource is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDTEXTURERESOURCE, "LIB3MF_ERROR_INVALIDTEXTURERESOURCE"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDTEXTURERESOURCE, "A texture resource is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDCOLORGROUP, "LIB3MF_ERROR_INVALIDCOLORGROUP"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDCOLORGROUP, "A color group resource is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDTEXTURE2DGROUP, "LIB3MF_ERROR_INVALIDTEXTURE2DGROUP"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDTEXTURE2DGROUP, "A texture2d group resource is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDCOMPOSITEMATERIALS, "LIB3MF_ERROR_INVALIDCOMPOSITEMATERIALS"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDCOMPOSITEMATERIALS, "A composite materials resource is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDMULTIPROPERTYGROUP, "LIB3MF_ERROR_INVALIDMULTIPROPERTYGROUP"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDMULTIPROPERTYGROUP, "A MultiPropertyGroup resource is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDRESOURCEINDEX, "LIB3MF_ERROR_INVALIDRESOURCEINDEX"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDRESOURCEINDEX, "A resource index is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_ATTACHMENTNOTFOUND, "LIB3MF_ERROR_ATTACHMENTNOTFOUND"); + ErrorDescriptionMap.put(LIB3MF_ERROR_ATTACHMENTNOTFOUND, "Attachment not found"); + ErrorCodeMap.put(LIB3MF_ERROR_FORBIDDENCYCLICREFERENCE, "LIB3MF_ERROR_FORBIDDENCYCLICREFERENCE"); + ErrorDescriptionMap.put(LIB3MF_ERROR_FORBIDDENCYCLICREFERENCE, "A component references one of its ancestors"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDATTACHMENTSTREAM, "LIB3MF_ERROR_INVALIDATTACHMENTSTREAM"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDATTACHMENTSTREAM, "An attachment stream is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDPROPERTYCOUNT, "LIB3MF_ERROR_INVALIDPROPERTYCOUNT"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDPROPERTYCOUNT, "Invalid property count."); + ErrorCodeMap.put(LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER, "LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER"); + ErrorDescriptionMap.put(LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER, "A progress identifier is unknown"); + ErrorCodeMap.put(LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT, "LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT"); + ErrorDescriptionMap.put(LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT, "An element buffer exceeds its spec limit"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDRESOURCE, "LIB3MF_ERROR_INVALIDRESOURCE"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDRESOURCE, "A resource is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDLEVELSET, "LIB3MF_ERROR_INVALIDLEVELSET"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDLEVELSET, "A level set is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_COULDNOTFINDTRIANGLESET, "LIB3MF_ERROR_COULDNOTFINDTRIANGLESET"); + ErrorDescriptionMap.put(LIB3MF_ERROR_COULDNOTFINDTRIANGLESET, "Could not find triangle set"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDTRIANGLESETINDEX, "LIB3MF_ERROR_INVALIDTRIANGLESETINDEX"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDTRIANGLESETINDEX, "Invalid triangle set index"); + ErrorCodeMap.put(LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE, "LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE"); + ErrorDescriptionMap.put(LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE, "This object type is not valid for beamlattices"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDKEYSTORE, "LIB3MF_ERROR_INVALIDKEYSTORE"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDKEYSTORE, "The keystore object is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDKEYSTORECONSUMER, "LIB3MF_ERROR_INVALIDKEYSTORECONSUMER"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDKEYSTORECONSUMER, "The consumer keystore object is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND, "LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND"); + ErrorDescriptionMap.put(LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND, "A consumer has not been found"); + ErrorCodeMap.put(LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND, "LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND"); + ErrorDescriptionMap.put(LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND, "A resource data has not been found"); + ErrorCodeMap.put(LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED, "LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED"); + ErrorDescriptionMap.put(LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED, "A Key or Conentent encryption callback has not been registered"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDKEYSIZE, "LIB3MF_ERROR_INVALIDKEYSIZE"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDKEYSIZE, "The key size is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INCOMPATIBLEPORTTYPES, "LIB3MF_ERROR_INCOMPATIBLEPORTTYPES"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INCOMPATIBLEPORTTYPES, "Link could not be added, the port types are incompatible"); + ErrorCodeMap.put(LIB3MF_ERROR_GRAPHISCYCLIC, "LIB3MF_ERROR_GRAPHISCYCLIC"); + ErrorDescriptionMap.put(LIB3MF_ERROR_GRAPHISCYCLIC, "The functin graph is cyclic. Only dircected graphs are valid and can be topological sorted."); + ErrorCodeMap.put(LIB3MF_ERROR_INPUTNOTSET, "LIB3MF_ERROR_INPUTNOTSET"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INPUTNOTSET, "The input of a node is not set."); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDNODECONFIGURATION, "LIB3MF_ERROR_INVALIDNODECONFIGURATION"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDNODECONFIGURATION, "The selected node configuration is not supported"); + } + + protected int mErrorCode; + + protected String mErrorString; + + protected String mErrorDescription; + + public Lib3MFException(int errorCode, String message){ + super(message); + mErrorCode = errorCode; + mErrorString = ErrorCodeMap.get(errorCode); + mErrorString = (mErrorString != null) ? mErrorString : "Unknown error code"; + mErrorDescription = ErrorDescriptionMap.get(errorCode); + mErrorDescription = (mErrorDescription != null) ? mErrorDescription : ""; + } + + @Override + public String toString() { + return mErrorCode + ": " + mErrorString + " (" + mErrorDescription + " - " + getMessage() + ")"; + } +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Lib3MFWrapper.java b/Autogenerated/Bindings/Java8/lib3mf/Lib3MFWrapper.java new file mode 100644 index 000000000..6ef31c156 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Lib3MFWrapper.java @@ -0,0 +1,4213 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.*; + +import java.nio.charset.StandardCharsets; + + +public class Lib3MFWrapper { + + public static final int PROPERTYTYPE_NOPROPERTYTYPE = 0; + public static final int PROPERTYTYPE_BASEMATERIAL = 1; + public static final int PROPERTYTYPE_TEXCOORD = 2; + public static final int PROPERTYTYPE_COLORS = 3; + public static final int PROPERTYTYPE_COMPOSITE = 4; + public static final int PROPERTYTYPE_MULTI = 5; + + public enum PropertyType { + eNoPropertyType, + eBaseMaterial, + eTexCoord, + eColors, + eComposite, + eMulti + } + + public static final int SLICESMESHRESOLUTION_FULLRES = 0; + public static final int SLICESMESHRESOLUTION_LOWRES = 1; + + public enum SlicesMeshResolution { + eFullres, + eLowres + } + + public static final int MODELUNIT_MICROMETER = 0; + public static final int MODELUNIT_MILLIMETER = 1; + public static final int MODELUNIT_CENTIMETER = 2; + public static final int MODELUNIT_INCH = 3; + public static final int MODELUNIT_FOOT = 4; + public static final int MODELUNIT_METER = 5; + + public enum ModelUnit { + eMicroMeter, + eMilliMeter, + eCentiMeter, + eInch, + eFoot, + eMeter + } + + public static final int OBJECTTYPE_OTHER = 0; + public static final int OBJECTTYPE_MODEL = 1; + public static final int OBJECTTYPE_SUPPORT = 2; + public static final int OBJECTTYPE_SOLIDSUPPORT = 3; + public static final int OBJECTTYPE_SURFACE = 4; + + public enum ObjectType { + eOther, + eModel, + eSupport, + eSolidSupport, + eSurface + } + + public static final int BOOLEANOPERATION_UNION = 0; + public static final int BOOLEANOPERATION_DIFFERENCE = 1; + public static final int BOOLEANOPERATION_INTERSECTION = 2; + + public enum BooleanOperation { + eUnion, + eDifference, + eIntersection + } + + public static final int TEXTURETYPE_UNKNOWN = 0; + public static final int TEXTURETYPE_PNG = 1; + public static final int TEXTURETYPE_JPEG = 2; + + public enum TextureType { + eUnknown, + ePNG, + eJPEG + } + + public static final int TEXTURETILESTYLE_WRAP = 0; + public static final int TEXTURETILESTYLE_MIRROR = 1; + public static final int TEXTURETILESTYLE_CLAMP = 2; + public static final int TEXTURETILESTYLE_NOTILESTYLE = 3; + + public enum TextureTileStyle { + eWrap, + eMirror, + eClamp, + eNoTileStyle + } + + public static final int TEXTUREFILTER_AUTO = 0; + public static final int TEXTUREFILTER_LINEAR = 1; + public static final int TEXTUREFILTER_NEAREST = 2; + + public enum TextureFilter { + eAuto, + eLinear, + eNearest + } + + public static final int BEAMLATTICECAPMODE_SPHERE = 0; + public static final int BEAMLATTICECAPMODE_HEMISPHERE = 1; + public static final int BEAMLATTICECAPMODE_BUTT = 2; + + public enum BeamLatticeCapMode { + eSphere, + eHemiSphere, + eButt + } + + public static final int BEAMLATTICECLIPMODE_NOCLIPMODE = 0; + public static final int BEAMLATTICECLIPMODE_INSIDE = 1; + public static final int BEAMLATTICECLIPMODE_OUTSIDE = 2; + + public enum BeamLatticeClipMode { + eNoClipMode, + eInside, + eOutside + } + + public static final int BEAMLATTICEBALLMODE_BEAMLATTICEBALLMODENONE = 0; + public static final int BEAMLATTICEBALLMODE_MIXED = 1; + public static final int BEAMLATTICEBALLMODE_ALL = 2; + + public enum BeamLatticeBallMode { + eBeamLatticeBallModeNone, + eMixed, + eAll + } + + public static final int PROGRESSIDENTIFIER_QUERYCANCELED = 0; + public static final int PROGRESSIDENTIFIER_DONE = 1; + public static final int PROGRESSIDENTIFIER_CLEANUP = 2; + public static final int PROGRESSIDENTIFIER_READSTREAM = 3; + public static final int PROGRESSIDENTIFIER_EXTRACTOPCPACKAGE = 4; + public static final int PROGRESSIDENTIFIER_READNONROOTMODELS = 5; + public static final int PROGRESSIDENTIFIER_READROOTMODEL = 6; + public static final int PROGRESSIDENTIFIER_READRESOURCES = 7; + public static final int PROGRESSIDENTIFIER_READMESH = 8; + public static final int PROGRESSIDENTIFIER_READSLICES = 9; + public static final int PROGRESSIDENTIFIER_READBUILD = 10; + public static final int PROGRESSIDENTIFIER_READCUSTOMATTACHMENT = 11; + public static final int PROGRESSIDENTIFIER_READTEXTURETACHMENTS = 12; + public static final int PROGRESSIDENTIFIER_CREATEOPCPACKAGE = 13; + public static final int PROGRESSIDENTIFIER_WRITEMODELSTOSTREAM = 14; + public static final int PROGRESSIDENTIFIER_WRITEROOTMODEL = 15; + public static final int PROGRESSIDENTIFIER_WRITENONROOTMODELS = 16; + public static final int PROGRESSIDENTIFIER_WRITEATTACHMENTS = 17; + public static final int PROGRESSIDENTIFIER_WRITECONTENTTYPES = 18; + public static final int PROGRESSIDENTIFIER_WRITENOBJECTS = 19; + public static final int PROGRESSIDENTIFIER_WRITENODES = 20; + public static final int PROGRESSIDENTIFIER_WRITETRIANGLES = 21; + public static final int PROGRESSIDENTIFIER_WRITESLICES = 22; + public static final int PROGRESSIDENTIFIER_WRITEKEYSTORE = 23; + + public enum ProgressIdentifier { + eQUERYCANCELED, + eDONE, + eCLEANUP, + eREADSTREAM, + eEXTRACTOPCPACKAGE, + eREADNONROOTMODELS, + eREADROOTMODEL, + eREADRESOURCES, + eREADMESH, + eREADSLICES, + eREADBUILD, + eREADCUSTOMATTACHMENT, + eREADTEXTURETACHMENTS, + eCREATEOPCPACKAGE, + eWRITEMODELSTOSTREAM, + eWRITEROOTMODEL, + eWRITENONROOTMODELS, + eWRITEATTACHMENTS, + eWRITECONTENTTYPES, + eWRITENOBJECTS, + eWRITENODES, + eWRITETRIANGLES, + eWRITESLICES, + eWRITEKEYSTORE + } + + public static final int BLENDMETHOD_NOBLENDMETHOD = 0; + public static final int BLENDMETHOD_MIX = 1; + public static final int BLENDMETHOD_MULTIPLY = 2; + + public enum BlendMethod { + eNoBlendMethod, + eMix, + eMultiply + } + + public static final int CHANNELNAME_RED = 0; + public static final int CHANNELNAME_GREEN = 1; + public static final int CHANNELNAME_BLUE = 2; + public static final int CHANNELNAME_ALPHA = 3; + + public enum ChannelName { + eRed, + eGreen, + eBlue, + eAlpha + } + + public static final int COMPOSITIONMETHOD_WEIGHTEDSUM = 0; + public static final int COMPOSITIONMETHOD_MULTIPLY = 1; + public static final int COMPOSITIONMETHOD_MIN = 2; + public static final int COMPOSITIONMETHOD_MAX = 3; + public static final int COMPOSITIONMETHOD_MASK = 4; + + public enum CompositionMethod { + eWeightedSum, + eMultiply, + eMin, + eMax, + eMask + } + + public static final int COMPOSITIONSPACE_RAW = 0; + public static final int COMPOSITIONSPACE_LINEARCOLOR = 1; + + public enum CompositionSpace { + eRaw, + eLinearColor + } + + public static final int IMPLICITNODETYPE_ADDITION = 0; + public static final int IMPLICITNODETYPE_SUBTRACTION = 1; + public static final int IMPLICITNODETYPE_MULTIPLICATION = 2; + public static final int IMPLICITNODETYPE_DIVISION = 3; + public static final int IMPLICITNODETYPE_CONSTANT = 4; + public static final int IMPLICITNODETYPE_CONSTVEC = 5; + public static final int IMPLICITNODETYPE_CONSTMAT = 6; + public static final int IMPLICITNODETYPE_COMPOSEVECTOR = 7; + public static final int IMPLICITNODETYPE_DECOMPOSEVECTOR = 8; + public static final int IMPLICITNODETYPE_COMPOSEMATRIX = 9; + public static final int IMPLICITNODETYPE_MATRIXFROMCOLUMNS = 10; + public static final int IMPLICITNODETYPE_MATRIXFROMROWS = 11; + public static final int IMPLICITNODETYPE_DOT = 12; + public static final int IMPLICITNODETYPE_CROSS = 13; + public static final int IMPLICITNODETYPE_MATVECMULTIPLICATION = 14; + public static final int IMPLICITNODETYPE_TRANSPOSE = 15; + public static final int IMPLICITNODETYPE_INVERSE = 16; + public static final int IMPLICITNODETYPE_SINUS = 17; + public static final int IMPLICITNODETYPE_COSINUS = 18; + public static final int IMPLICITNODETYPE_TAN = 19; + public static final int IMPLICITNODETYPE_ARCSIN = 20; + public static final int IMPLICITNODETYPE_ARCCOS = 21; + public static final int IMPLICITNODETYPE_ARCTAN = 22; + public static final int IMPLICITNODETYPE_ARCTAN2 = 23; + public static final int IMPLICITNODETYPE_MIN = 24; + public static final int IMPLICITNODETYPE_MAX = 25; + public static final int IMPLICITNODETYPE_ABS = 26; + public static final int IMPLICITNODETYPE_FMOD = 27; + public static final int IMPLICITNODETYPE_POW = 28; + public static final int IMPLICITNODETYPE_SQRT = 29; + public static final int IMPLICITNODETYPE_EXP = 30; + public static final int IMPLICITNODETYPE_LOG = 31; + public static final int IMPLICITNODETYPE_LOG2 = 32; + public static final int IMPLICITNODETYPE_LOG10 = 33; + public static final int IMPLICITNODETYPE_SELECT = 34; + public static final int IMPLICITNODETYPE_CLAMP = 35; + public static final int IMPLICITNODETYPE_SINH = 36; + public static final int IMPLICITNODETYPE_COSH = 37; + public static final int IMPLICITNODETYPE_TANH = 38; + public static final int IMPLICITNODETYPE_ROUND = 39; + public static final int IMPLICITNODETYPE_CEIL = 40; + public static final int IMPLICITNODETYPE_FLOOR = 41; + public static final int IMPLICITNODETYPE_SIGN = 42; + public static final int IMPLICITNODETYPE_FRACT = 43; + public static final int IMPLICITNODETYPE_FUNCTIONCALL = 44; + public static final int IMPLICITNODETYPE_MESH = 45; + public static final int IMPLICITNODETYPE_LENGTH = 46; + public static final int IMPLICITNODETYPE_CONSTRESOURCEID = 47; + public static final int IMPLICITNODETYPE_VECTORFROMSCALAR = 48; + public static final int IMPLICITNODETYPE_UNSIGNEDMESH = 49; + public static final int IMPLICITNODETYPE_MOD = 50; + public static final int IMPLICITNODETYPE_BEAMLATTICE = 51; + public static final int IMPLICITNODETYPE_FUNCTIONGRADIENT = 52; + public static final int IMPLICITNODETYPE_NORMALIZEDISTANCE = 53; + + public enum ImplicitNodeType { + eAddition, + eSubtraction, + eMultiplication, + eDivision, + eConstant, + eConstVec, + eConstMat, + eComposeVector, + eDecomposeVector, + eComposeMatrix, + eMatrixFromColumns, + eMatrixFromRows, + eDot, + eCross, + eMatVecMultiplication, + eTranspose, + eInverse, + eSinus, + eCosinus, + eTan, + eArcSin, + eArcCos, + eArcTan, + eArcTan2, + eMin, + eMax, + eAbs, + eFmod, + ePow, + eSqrt, + eExp, + eLog, + eLog2, + eLog10, + eSelect, + eClamp, + eSinh, + eCosh, + eTanh, + eRound, + eCeil, + eFloor, + eSign, + eFract, + eFunctionCall, + eMesh, + eLength, + eConstResourceID, + eVectorFromScalar, + eUnsignedMesh, + eMod, + eBeamLattice, + eFunctionGradient, + eNormalizeDistance + } + + public static final int IMPLICITPORTTYPE_SCALAR = 0; + public static final int IMPLICITPORTTYPE_VECTOR = 1; + public static final int IMPLICITPORTTYPE_MATRIX = 2; + public static final int IMPLICITPORTTYPE_RESOURCEID = 3; + + public enum ImplicitPortType { + eScalar, + eVector, + eMatrix, + eResourceID + } + + public static final int IMPLICITNODECONFIGURATION_DEFAULT = 0; + public static final int IMPLICITNODECONFIGURATION_SCALARTOSCALAR = 1; + public static final int IMPLICITNODECONFIGURATION_VECTORTOVECTOR = 2; + public static final int IMPLICITNODECONFIGURATION_MATRIXTOMATRIX = 3; + + public enum ImplicitNodeConfiguration { + eDefault, + eScalarToScalar, + eVectorToVector, + eMatrixToMatrix + } + + public static final int ENCRYPTIONALGORITHM_AES256_GCM = 1; + + public enum EncryptionAlgorithm { + eAES256_GCM + } + + public static final int WRAPPINGALGORITHM_RSA_OAEP = 0; + + public enum WrappingAlgorithm { + eRSA_OAEP + } + + public static final int MGFALGORITHM_MGF1_SHA1 = 160; + public static final int MGFALGORITHM_MGF1_SHA224 = 224; + public static final int MGFALGORITHM_MGF1_SHA256 = 256; + public static final int MGFALGORITHM_MGF1_SHA384 = 384; + public static final int MGFALGORITHM_MGF1_SHA512 = 512; + + public enum MgfAlgorithm { + eMGF1_SHA1, + eMGF1_SHA224, + eMGF1_SHA256, + eMGF1_SHA384, + eMGF1_SHA512 + } + + public static final int DIGESTMETHOD_SHA1 = 160; + public static final int DIGESTMETHOD_SHA256 = 256; + + public enum DigestMethod { + eSHA1, + eSHA256 + } + + public static final int COMPRESSION_NOCOMPRESSION = 0; + public static final int COMPRESSION_DEFLATE = 1; + + public enum Compression { + eNoCompression, + eDeflate + } + + public static class EnumConversion { + public static int convertPropertyTypeToConst (PropertyType value) throws Lib3MFException { + switch (value) { + case eNoPropertyType: return PROPERTYTYPE_NOPROPERTYTYPE; + case eBaseMaterial: return PROPERTYTYPE_BASEMATERIAL; + case eTexCoord: return PROPERTYTYPE_TEXCOORD; + case eColors: return PROPERTYTYPE_COLORS; + case eComposite: return PROPERTYTYPE_COMPOSITE; + case eMulti: return PROPERTYTYPE_MULTI; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static PropertyType convertConstToPropertyType (int value) throws Lib3MFException { + switch (value) { + case PROPERTYTYPE_NOPROPERTYTYPE: return PropertyType.eNoPropertyType; + case PROPERTYTYPE_BASEMATERIAL: return PropertyType.eBaseMaterial; + case PROPERTYTYPE_TEXCOORD: return PropertyType.eTexCoord; + case PROPERTYTYPE_COLORS: return PropertyType.eColors; + case PROPERTYTYPE_COMPOSITE: return PropertyType.eComposite; + case PROPERTYTYPE_MULTI: return PropertyType.eMulti; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertSlicesMeshResolutionToConst (SlicesMeshResolution value) throws Lib3MFException { + switch (value) { + case eFullres: return SLICESMESHRESOLUTION_FULLRES; + case eLowres: return SLICESMESHRESOLUTION_LOWRES; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static SlicesMeshResolution convertConstToSlicesMeshResolution (int value) throws Lib3MFException { + switch (value) { + case SLICESMESHRESOLUTION_FULLRES: return SlicesMeshResolution.eFullres; + case SLICESMESHRESOLUTION_LOWRES: return SlicesMeshResolution.eLowres; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertModelUnitToConst (ModelUnit value) throws Lib3MFException { + switch (value) { + case eMicroMeter: return MODELUNIT_MICROMETER; + case eMilliMeter: return MODELUNIT_MILLIMETER; + case eCentiMeter: return MODELUNIT_CENTIMETER; + case eInch: return MODELUNIT_INCH; + case eFoot: return MODELUNIT_FOOT; + case eMeter: return MODELUNIT_METER; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static ModelUnit convertConstToModelUnit (int value) throws Lib3MFException { + switch (value) { + case MODELUNIT_MICROMETER: return ModelUnit.eMicroMeter; + case MODELUNIT_MILLIMETER: return ModelUnit.eMilliMeter; + case MODELUNIT_CENTIMETER: return ModelUnit.eCentiMeter; + case MODELUNIT_INCH: return ModelUnit.eInch; + case MODELUNIT_FOOT: return ModelUnit.eFoot; + case MODELUNIT_METER: return ModelUnit.eMeter; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertObjectTypeToConst (ObjectType value) throws Lib3MFException { + switch (value) { + case eOther: return OBJECTTYPE_OTHER; + case eModel: return OBJECTTYPE_MODEL; + case eSupport: return OBJECTTYPE_SUPPORT; + case eSolidSupport: return OBJECTTYPE_SOLIDSUPPORT; + case eSurface: return OBJECTTYPE_SURFACE; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static ObjectType convertConstToObjectType (int value) throws Lib3MFException { + switch (value) { + case OBJECTTYPE_OTHER: return ObjectType.eOther; + case OBJECTTYPE_MODEL: return ObjectType.eModel; + case OBJECTTYPE_SUPPORT: return ObjectType.eSupport; + case OBJECTTYPE_SOLIDSUPPORT: return ObjectType.eSolidSupport; + case OBJECTTYPE_SURFACE: return ObjectType.eSurface; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertBooleanOperationToConst (BooleanOperation value) throws Lib3MFException { + switch (value) { + case eUnion: return BOOLEANOPERATION_UNION; + case eDifference: return BOOLEANOPERATION_DIFFERENCE; + case eIntersection: return BOOLEANOPERATION_INTERSECTION; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static BooleanOperation convertConstToBooleanOperation (int value) throws Lib3MFException { + switch (value) { + case BOOLEANOPERATION_UNION: return BooleanOperation.eUnion; + case BOOLEANOPERATION_DIFFERENCE: return BooleanOperation.eDifference; + case BOOLEANOPERATION_INTERSECTION: return BooleanOperation.eIntersection; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertTextureTypeToConst (TextureType value) throws Lib3MFException { + switch (value) { + case eUnknown: return TEXTURETYPE_UNKNOWN; + case ePNG: return TEXTURETYPE_PNG; + case eJPEG: return TEXTURETYPE_JPEG; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static TextureType convertConstToTextureType (int value) throws Lib3MFException { + switch (value) { + case TEXTURETYPE_UNKNOWN: return TextureType.eUnknown; + case TEXTURETYPE_PNG: return TextureType.ePNG; + case TEXTURETYPE_JPEG: return TextureType.eJPEG; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertTextureTileStyleToConst (TextureTileStyle value) throws Lib3MFException { + switch (value) { + case eWrap: return TEXTURETILESTYLE_WRAP; + case eMirror: return TEXTURETILESTYLE_MIRROR; + case eClamp: return TEXTURETILESTYLE_CLAMP; + case eNoTileStyle: return TEXTURETILESTYLE_NOTILESTYLE; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static TextureTileStyle convertConstToTextureTileStyle (int value) throws Lib3MFException { + switch (value) { + case TEXTURETILESTYLE_WRAP: return TextureTileStyle.eWrap; + case TEXTURETILESTYLE_MIRROR: return TextureTileStyle.eMirror; + case TEXTURETILESTYLE_CLAMP: return TextureTileStyle.eClamp; + case TEXTURETILESTYLE_NOTILESTYLE: return TextureTileStyle.eNoTileStyle; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertTextureFilterToConst (TextureFilter value) throws Lib3MFException { + switch (value) { + case eAuto: return TEXTUREFILTER_AUTO; + case eLinear: return TEXTUREFILTER_LINEAR; + case eNearest: return TEXTUREFILTER_NEAREST; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static TextureFilter convertConstToTextureFilter (int value) throws Lib3MFException { + switch (value) { + case TEXTUREFILTER_AUTO: return TextureFilter.eAuto; + case TEXTUREFILTER_LINEAR: return TextureFilter.eLinear; + case TEXTUREFILTER_NEAREST: return TextureFilter.eNearest; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertBeamLatticeCapModeToConst (BeamLatticeCapMode value) throws Lib3MFException { + switch (value) { + case eSphere: return BEAMLATTICECAPMODE_SPHERE; + case eHemiSphere: return BEAMLATTICECAPMODE_HEMISPHERE; + case eButt: return BEAMLATTICECAPMODE_BUTT; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static BeamLatticeCapMode convertConstToBeamLatticeCapMode (int value) throws Lib3MFException { + switch (value) { + case BEAMLATTICECAPMODE_SPHERE: return BeamLatticeCapMode.eSphere; + case BEAMLATTICECAPMODE_HEMISPHERE: return BeamLatticeCapMode.eHemiSphere; + case BEAMLATTICECAPMODE_BUTT: return BeamLatticeCapMode.eButt; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertBeamLatticeClipModeToConst (BeamLatticeClipMode value) throws Lib3MFException { + switch (value) { + case eNoClipMode: return BEAMLATTICECLIPMODE_NOCLIPMODE; + case eInside: return BEAMLATTICECLIPMODE_INSIDE; + case eOutside: return BEAMLATTICECLIPMODE_OUTSIDE; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static BeamLatticeClipMode convertConstToBeamLatticeClipMode (int value) throws Lib3MFException { + switch (value) { + case BEAMLATTICECLIPMODE_NOCLIPMODE: return BeamLatticeClipMode.eNoClipMode; + case BEAMLATTICECLIPMODE_INSIDE: return BeamLatticeClipMode.eInside; + case BEAMLATTICECLIPMODE_OUTSIDE: return BeamLatticeClipMode.eOutside; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertBeamLatticeBallModeToConst (BeamLatticeBallMode value) throws Lib3MFException { + switch (value) { + case eBeamLatticeBallModeNone: return BEAMLATTICEBALLMODE_BEAMLATTICEBALLMODENONE; + case eMixed: return BEAMLATTICEBALLMODE_MIXED; + case eAll: return BEAMLATTICEBALLMODE_ALL; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static BeamLatticeBallMode convertConstToBeamLatticeBallMode (int value) throws Lib3MFException { + switch (value) { + case BEAMLATTICEBALLMODE_BEAMLATTICEBALLMODENONE: return BeamLatticeBallMode.eBeamLatticeBallModeNone; + case BEAMLATTICEBALLMODE_MIXED: return BeamLatticeBallMode.eMixed; + case BEAMLATTICEBALLMODE_ALL: return BeamLatticeBallMode.eAll; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertProgressIdentifierToConst (ProgressIdentifier value) throws Lib3MFException { + switch (value) { + case eQUERYCANCELED: return PROGRESSIDENTIFIER_QUERYCANCELED; + case eDONE: return PROGRESSIDENTIFIER_DONE; + case eCLEANUP: return PROGRESSIDENTIFIER_CLEANUP; + case eREADSTREAM: return PROGRESSIDENTIFIER_READSTREAM; + case eEXTRACTOPCPACKAGE: return PROGRESSIDENTIFIER_EXTRACTOPCPACKAGE; + case eREADNONROOTMODELS: return PROGRESSIDENTIFIER_READNONROOTMODELS; + case eREADROOTMODEL: return PROGRESSIDENTIFIER_READROOTMODEL; + case eREADRESOURCES: return PROGRESSIDENTIFIER_READRESOURCES; + case eREADMESH: return PROGRESSIDENTIFIER_READMESH; + case eREADSLICES: return PROGRESSIDENTIFIER_READSLICES; + case eREADBUILD: return PROGRESSIDENTIFIER_READBUILD; + case eREADCUSTOMATTACHMENT: return PROGRESSIDENTIFIER_READCUSTOMATTACHMENT; + case eREADTEXTURETACHMENTS: return PROGRESSIDENTIFIER_READTEXTURETACHMENTS; + case eCREATEOPCPACKAGE: return PROGRESSIDENTIFIER_CREATEOPCPACKAGE; + case eWRITEMODELSTOSTREAM: return PROGRESSIDENTIFIER_WRITEMODELSTOSTREAM; + case eWRITEROOTMODEL: return PROGRESSIDENTIFIER_WRITEROOTMODEL; + case eWRITENONROOTMODELS: return PROGRESSIDENTIFIER_WRITENONROOTMODELS; + case eWRITEATTACHMENTS: return PROGRESSIDENTIFIER_WRITEATTACHMENTS; + case eWRITECONTENTTYPES: return PROGRESSIDENTIFIER_WRITECONTENTTYPES; + case eWRITENOBJECTS: return PROGRESSIDENTIFIER_WRITENOBJECTS; + case eWRITENODES: return PROGRESSIDENTIFIER_WRITENODES; + case eWRITETRIANGLES: return PROGRESSIDENTIFIER_WRITETRIANGLES; + case eWRITESLICES: return PROGRESSIDENTIFIER_WRITESLICES; + case eWRITEKEYSTORE: return PROGRESSIDENTIFIER_WRITEKEYSTORE; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static ProgressIdentifier convertConstToProgressIdentifier (int value) throws Lib3MFException { + switch (value) { + case PROGRESSIDENTIFIER_QUERYCANCELED: return ProgressIdentifier.eQUERYCANCELED; + case PROGRESSIDENTIFIER_DONE: return ProgressIdentifier.eDONE; + case PROGRESSIDENTIFIER_CLEANUP: return ProgressIdentifier.eCLEANUP; + case PROGRESSIDENTIFIER_READSTREAM: return ProgressIdentifier.eREADSTREAM; + case PROGRESSIDENTIFIER_EXTRACTOPCPACKAGE: return ProgressIdentifier.eEXTRACTOPCPACKAGE; + case PROGRESSIDENTIFIER_READNONROOTMODELS: return ProgressIdentifier.eREADNONROOTMODELS; + case PROGRESSIDENTIFIER_READROOTMODEL: return ProgressIdentifier.eREADROOTMODEL; + case PROGRESSIDENTIFIER_READRESOURCES: return ProgressIdentifier.eREADRESOURCES; + case PROGRESSIDENTIFIER_READMESH: return ProgressIdentifier.eREADMESH; + case PROGRESSIDENTIFIER_READSLICES: return ProgressIdentifier.eREADSLICES; + case PROGRESSIDENTIFIER_READBUILD: return ProgressIdentifier.eREADBUILD; + case PROGRESSIDENTIFIER_READCUSTOMATTACHMENT: return ProgressIdentifier.eREADCUSTOMATTACHMENT; + case PROGRESSIDENTIFIER_READTEXTURETACHMENTS: return ProgressIdentifier.eREADTEXTURETACHMENTS; + case PROGRESSIDENTIFIER_CREATEOPCPACKAGE: return ProgressIdentifier.eCREATEOPCPACKAGE; + case PROGRESSIDENTIFIER_WRITEMODELSTOSTREAM: return ProgressIdentifier.eWRITEMODELSTOSTREAM; + case PROGRESSIDENTIFIER_WRITEROOTMODEL: return ProgressIdentifier.eWRITEROOTMODEL; + case PROGRESSIDENTIFIER_WRITENONROOTMODELS: return ProgressIdentifier.eWRITENONROOTMODELS; + case PROGRESSIDENTIFIER_WRITEATTACHMENTS: return ProgressIdentifier.eWRITEATTACHMENTS; + case PROGRESSIDENTIFIER_WRITECONTENTTYPES: return ProgressIdentifier.eWRITECONTENTTYPES; + case PROGRESSIDENTIFIER_WRITENOBJECTS: return ProgressIdentifier.eWRITENOBJECTS; + case PROGRESSIDENTIFIER_WRITENODES: return ProgressIdentifier.eWRITENODES; + case PROGRESSIDENTIFIER_WRITETRIANGLES: return ProgressIdentifier.eWRITETRIANGLES; + case PROGRESSIDENTIFIER_WRITESLICES: return ProgressIdentifier.eWRITESLICES; + case PROGRESSIDENTIFIER_WRITEKEYSTORE: return ProgressIdentifier.eWRITEKEYSTORE; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertBlendMethodToConst (BlendMethod value) throws Lib3MFException { + switch (value) { + case eNoBlendMethod: return BLENDMETHOD_NOBLENDMETHOD; + case eMix: return BLENDMETHOD_MIX; + case eMultiply: return BLENDMETHOD_MULTIPLY; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static BlendMethod convertConstToBlendMethod (int value) throws Lib3MFException { + switch (value) { + case BLENDMETHOD_NOBLENDMETHOD: return BlendMethod.eNoBlendMethod; + case BLENDMETHOD_MIX: return BlendMethod.eMix; + case BLENDMETHOD_MULTIPLY: return BlendMethod.eMultiply; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertChannelNameToConst (ChannelName value) throws Lib3MFException { + switch (value) { + case eRed: return CHANNELNAME_RED; + case eGreen: return CHANNELNAME_GREEN; + case eBlue: return CHANNELNAME_BLUE; + case eAlpha: return CHANNELNAME_ALPHA; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static ChannelName convertConstToChannelName (int value) throws Lib3MFException { + switch (value) { + case CHANNELNAME_RED: return ChannelName.eRed; + case CHANNELNAME_GREEN: return ChannelName.eGreen; + case CHANNELNAME_BLUE: return ChannelName.eBlue; + case CHANNELNAME_ALPHA: return ChannelName.eAlpha; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertCompositionMethodToConst (CompositionMethod value) throws Lib3MFException { + switch (value) { + case eWeightedSum: return COMPOSITIONMETHOD_WEIGHTEDSUM; + case eMultiply: return COMPOSITIONMETHOD_MULTIPLY; + case eMin: return COMPOSITIONMETHOD_MIN; + case eMax: return COMPOSITIONMETHOD_MAX; + case eMask: return COMPOSITIONMETHOD_MASK; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static CompositionMethod convertConstToCompositionMethod (int value) throws Lib3MFException { + switch (value) { + case COMPOSITIONMETHOD_WEIGHTEDSUM: return CompositionMethod.eWeightedSum; + case COMPOSITIONMETHOD_MULTIPLY: return CompositionMethod.eMultiply; + case COMPOSITIONMETHOD_MIN: return CompositionMethod.eMin; + case COMPOSITIONMETHOD_MAX: return CompositionMethod.eMax; + case COMPOSITIONMETHOD_MASK: return CompositionMethod.eMask; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertCompositionSpaceToConst (CompositionSpace value) throws Lib3MFException { + switch (value) { + case eRaw: return COMPOSITIONSPACE_RAW; + case eLinearColor: return COMPOSITIONSPACE_LINEARCOLOR; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static CompositionSpace convertConstToCompositionSpace (int value) throws Lib3MFException { + switch (value) { + case COMPOSITIONSPACE_RAW: return CompositionSpace.eRaw; + case COMPOSITIONSPACE_LINEARCOLOR: return CompositionSpace.eLinearColor; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertImplicitNodeTypeToConst (ImplicitNodeType value) throws Lib3MFException { + switch (value) { + case eAddition: return IMPLICITNODETYPE_ADDITION; + case eSubtraction: return IMPLICITNODETYPE_SUBTRACTION; + case eMultiplication: return IMPLICITNODETYPE_MULTIPLICATION; + case eDivision: return IMPLICITNODETYPE_DIVISION; + case eConstant: return IMPLICITNODETYPE_CONSTANT; + case eConstVec: return IMPLICITNODETYPE_CONSTVEC; + case eConstMat: return IMPLICITNODETYPE_CONSTMAT; + case eComposeVector: return IMPLICITNODETYPE_COMPOSEVECTOR; + case eDecomposeVector: return IMPLICITNODETYPE_DECOMPOSEVECTOR; + case eComposeMatrix: return IMPLICITNODETYPE_COMPOSEMATRIX; + case eMatrixFromColumns: return IMPLICITNODETYPE_MATRIXFROMCOLUMNS; + case eMatrixFromRows: return IMPLICITNODETYPE_MATRIXFROMROWS; + case eDot: return IMPLICITNODETYPE_DOT; + case eCross: return IMPLICITNODETYPE_CROSS; + case eMatVecMultiplication: return IMPLICITNODETYPE_MATVECMULTIPLICATION; + case eTranspose: return IMPLICITNODETYPE_TRANSPOSE; + case eInverse: return IMPLICITNODETYPE_INVERSE; + case eSinus: return IMPLICITNODETYPE_SINUS; + case eCosinus: return IMPLICITNODETYPE_COSINUS; + case eTan: return IMPLICITNODETYPE_TAN; + case eArcSin: return IMPLICITNODETYPE_ARCSIN; + case eArcCos: return IMPLICITNODETYPE_ARCCOS; + case eArcTan: return IMPLICITNODETYPE_ARCTAN; + case eArcTan2: return IMPLICITNODETYPE_ARCTAN2; + case eMin: return IMPLICITNODETYPE_MIN; + case eMax: return IMPLICITNODETYPE_MAX; + case eAbs: return IMPLICITNODETYPE_ABS; + case eFmod: return IMPLICITNODETYPE_FMOD; + case ePow: return IMPLICITNODETYPE_POW; + case eSqrt: return IMPLICITNODETYPE_SQRT; + case eExp: return IMPLICITNODETYPE_EXP; + case eLog: return IMPLICITNODETYPE_LOG; + case eLog2: return IMPLICITNODETYPE_LOG2; + case eLog10: return IMPLICITNODETYPE_LOG10; + case eSelect: return IMPLICITNODETYPE_SELECT; + case eClamp: return IMPLICITNODETYPE_CLAMP; + case eSinh: return IMPLICITNODETYPE_SINH; + case eCosh: return IMPLICITNODETYPE_COSH; + case eTanh: return IMPLICITNODETYPE_TANH; + case eRound: return IMPLICITNODETYPE_ROUND; + case eCeil: return IMPLICITNODETYPE_CEIL; + case eFloor: return IMPLICITNODETYPE_FLOOR; + case eSign: return IMPLICITNODETYPE_SIGN; + case eFract: return IMPLICITNODETYPE_FRACT; + case eFunctionCall: return IMPLICITNODETYPE_FUNCTIONCALL; + case eMesh: return IMPLICITNODETYPE_MESH; + case eLength: return IMPLICITNODETYPE_LENGTH; + case eConstResourceID: return IMPLICITNODETYPE_CONSTRESOURCEID; + case eVectorFromScalar: return IMPLICITNODETYPE_VECTORFROMSCALAR; + case eUnsignedMesh: return IMPLICITNODETYPE_UNSIGNEDMESH; + case eMod: return IMPLICITNODETYPE_MOD; + case eBeamLattice: return IMPLICITNODETYPE_BEAMLATTICE; + case eFunctionGradient: return IMPLICITNODETYPE_FUNCTIONGRADIENT; + case eNormalizeDistance: return IMPLICITNODETYPE_NORMALIZEDISTANCE; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static ImplicitNodeType convertConstToImplicitNodeType (int value) throws Lib3MFException { + switch (value) { + case IMPLICITNODETYPE_ADDITION: return ImplicitNodeType.eAddition; + case IMPLICITNODETYPE_SUBTRACTION: return ImplicitNodeType.eSubtraction; + case IMPLICITNODETYPE_MULTIPLICATION: return ImplicitNodeType.eMultiplication; + case IMPLICITNODETYPE_DIVISION: return ImplicitNodeType.eDivision; + case IMPLICITNODETYPE_CONSTANT: return ImplicitNodeType.eConstant; + case IMPLICITNODETYPE_CONSTVEC: return ImplicitNodeType.eConstVec; + case IMPLICITNODETYPE_CONSTMAT: return ImplicitNodeType.eConstMat; + case IMPLICITNODETYPE_COMPOSEVECTOR: return ImplicitNodeType.eComposeVector; + case IMPLICITNODETYPE_DECOMPOSEVECTOR: return ImplicitNodeType.eDecomposeVector; + case IMPLICITNODETYPE_COMPOSEMATRIX: return ImplicitNodeType.eComposeMatrix; + case IMPLICITNODETYPE_MATRIXFROMCOLUMNS: return ImplicitNodeType.eMatrixFromColumns; + case IMPLICITNODETYPE_MATRIXFROMROWS: return ImplicitNodeType.eMatrixFromRows; + case IMPLICITNODETYPE_DOT: return ImplicitNodeType.eDot; + case IMPLICITNODETYPE_CROSS: return ImplicitNodeType.eCross; + case IMPLICITNODETYPE_MATVECMULTIPLICATION: return ImplicitNodeType.eMatVecMultiplication; + case IMPLICITNODETYPE_TRANSPOSE: return ImplicitNodeType.eTranspose; + case IMPLICITNODETYPE_INVERSE: return ImplicitNodeType.eInverse; + case IMPLICITNODETYPE_SINUS: return ImplicitNodeType.eSinus; + case IMPLICITNODETYPE_COSINUS: return ImplicitNodeType.eCosinus; + case IMPLICITNODETYPE_TAN: return ImplicitNodeType.eTan; + case IMPLICITNODETYPE_ARCSIN: return ImplicitNodeType.eArcSin; + case IMPLICITNODETYPE_ARCCOS: return ImplicitNodeType.eArcCos; + case IMPLICITNODETYPE_ARCTAN: return ImplicitNodeType.eArcTan; + case IMPLICITNODETYPE_ARCTAN2: return ImplicitNodeType.eArcTan2; + case IMPLICITNODETYPE_MIN: return ImplicitNodeType.eMin; + case IMPLICITNODETYPE_MAX: return ImplicitNodeType.eMax; + case IMPLICITNODETYPE_ABS: return ImplicitNodeType.eAbs; + case IMPLICITNODETYPE_FMOD: return ImplicitNodeType.eFmod; + case IMPLICITNODETYPE_POW: return ImplicitNodeType.ePow; + case IMPLICITNODETYPE_SQRT: return ImplicitNodeType.eSqrt; + case IMPLICITNODETYPE_EXP: return ImplicitNodeType.eExp; + case IMPLICITNODETYPE_LOG: return ImplicitNodeType.eLog; + case IMPLICITNODETYPE_LOG2: return ImplicitNodeType.eLog2; + case IMPLICITNODETYPE_LOG10: return ImplicitNodeType.eLog10; + case IMPLICITNODETYPE_SELECT: return ImplicitNodeType.eSelect; + case IMPLICITNODETYPE_CLAMP: return ImplicitNodeType.eClamp; + case IMPLICITNODETYPE_SINH: return ImplicitNodeType.eSinh; + case IMPLICITNODETYPE_COSH: return ImplicitNodeType.eCosh; + case IMPLICITNODETYPE_TANH: return ImplicitNodeType.eTanh; + case IMPLICITNODETYPE_ROUND: return ImplicitNodeType.eRound; + case IMPLICITNODETYPE_CEIL: return ImplicitNodeType.eCeil; + case IMPLICITNODETYPE_FLOOR: return ImplicitNodeType.eFloor; + case IMPLICITNODETYPE_SIGN: return ImplicitNodeType.eSign; + case IMPLICITNODETYPE_FRACT: return ImplicitNodeType.eFract; + case IMPLICITNODETYPE_FUNCTIONCALL: return ImplicitNodeType.eFunctionCall; + case IMPLICITNODETYPE_MESH: return ImplicitNodeType.eMesh; + case IMPLICITNODETYPE_LENGTH: return ImplicitNodeType.eLength; + case IMPLICITNODETYPE_CONSTRESOURCEID: return ImplicitNodeType.eConstResourceID; + case IMPLICITNODETYPE_VECTORFROMSCALAR: return ImplicitNodeType.eVectorFromScalar; + case IMPLICITNODETYPE_UNSIGNEDMESH: return ImplicitNodeType.eUnsignedMesh; + case IMPLICITNODETYPE_MOD: return ImplicitNodeType.eMod; + case IMPLICITNODETYPE_BEAMLATTICE: return ImplicitNodeType.eBeamLattice; + case IMPLICITNODETYPE_FUNCTIONGRADIENT: return ImplicitNodeType.eFunctionGradient; + case IMPLICITNODETYPE_NORMALIZEDISTANCE: return ImplicitNodeType.eNormalizeDistance; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertImplicitPortTypeToConst (ImplicitPortType value) throws Lib3MFException { + switch (value) { + case eScalar: return IMPLICITPORTTYPE_SCALAR; + case eVector: return IMPLICITPORTTYPE_VECTOR; + case eMatrix: return IMPLICITPORTTYPE_MATRIX; + case eResourceID: return IMPLICITPORTTYPE_RESOURCEID; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static ImplicitPortType convertConstToImplicitPortType (int value) throws Lib3MFException { + switch (value) { + case IMPLICITPORTTYPE_SCALAR: return ImplicitPortType.eScalar; + case IMPLICITPORTTYPE_VECTOR: return ImplicitPortType.eVector; + case IMPLICITPORTTYPE_MATRIX: return ImplicitPortType.eMatrix; + case IMPLICITPORTTYPE_RESOURCEID: return ImplicitPortType.eResourceID; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertImplicitNodeConfigurationToConst (ImplicitNodeConfiguration value) throws Lib3MFException { + switch (value) { + case eDefault: return IMPLICITNODECONFIGURATION_DEFAULT; + case eScalarToScalar: return IMPLICITNODECONFIGURATION_SCALARTOSCALAR; + case eVectorToVector: return IMPLICITNODECONFIGURATION_VECTORTOVECTOR; + case eMatrixToMatrix: return IMPLICITNODECONFIGURATION_MATRIXTOMATRIX; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static ImplicitNodeConfiguration convertConstToImplicitNodeConfiguration (int value) throws Lib3MFException { + switch (value) { + case IMPLICITNODECONFIGURATION_DEFAULT: return ImplicitNodeConfiguration.eDefault; + case IMPLICITNODECONFIGURATION_SCALARTOSCALAR: return ImplicitNodeConfiguration.eScalarToScalar; + case IMPLICITNODECONFIGURATION_VECTORTOVECTOR: return ImplicitNodeConfiguration.eVectorToVector; + case IMPLICITNODECONFIGURATION_MATRIXTOMATRIX: return ImplicitNodeConfiguration.eMatrixToMatrix; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertEncryptionAlgorithmToConst (EncryptionAlgorithm value) throws Lib3MFException { + switch (value) { + case eAES256_GCM: return ENCRYPTIONALGORITHM_AES256_GCM; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static EncryptionAlgorithm convertConstToEncryptionAlgorithm (int value) throws Lib3MFException { + switch (value) { + case ENCRYPTIONALGORITHM_AES256_GCM: return EncryptionAlgorithm.eAES256_GCM; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertWrappingAlgorithmToConst (WrappingAlgorithm value) throws Lib3MFException { + switch (value) { + case eRSA_OAEP: return WRAPPINGALGORITHM_RSA_OAEP; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static WrappingAlgorithm convertConstToWrappingAlgorithm (int value) throws Lib3MFException { + switch (value) { + case WRAPPINGALGORITHM_RSA_OAEP: return WrappingAlgorithm.eRSA_OAEP; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertMgfAlgorithmToConst (MgfAlgorithm value) throws Lib3MFException { + switch (value) { + case eMGF1_SHA1: return MGFALGORITHM_MGF1_SHA1; + case eMGF1_SHA224: return MGFALGORITHM_MGF1_SHA224; + case eMGF1_SHA256: return MGFALGORITHM_MGF1_SHA256; + case eMGF1_SHA384: return MGFALGORITHM_MGF1_SHA384; + case eMGF1_SHA512: return MGFALGORITHM_MGF1_SHA512; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static MgfAlgorithm convertConstToMgfAlgorithm (int value) throws Lib3MFException { + switch (value) { + case MGFALGORITHM_MGF1_SHA1: return MgfAlgorithm.eMGF1_SHA1; + case MGFALGORITHM_MGF1_SHA224: return MgfAlgorithm.eMGF1_SHA224; + case MGFALGORITHM_MGF1_SHA256: return MgfAlgorithm.eMGF1_SHA256; + case MGFALGORITHM_MGF1_SHA384: return MgfAlgorithm.eMGF1_SHA384; + case MGFALGORITHM_MGF1_SHA512: return MgfAlgorithm.eMGF1_SHA512; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertDigestMethodToConst (DigestMethod value) throws Lib3MFException { + switch (value) { + case eSHA1: return DIGESTMETHOD_SHA1; + case eSHA256: return DIGESTMETHOD_SHA256; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static DigestMethod convertConstToDigestMethod (int value) throws Lib3MFException { + switch (value) { + case DIGESTMETHOD_SHA1: return DigestMethod.eSHA1; + case DIGESTMETHOD_SHA256: return DigestMethod.eSHA256; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertCompressionToConst (Compression value) throws Lib3MFException { + switch (value) { + case eNoCompression: return COMPRESSION_NOCOMPRESSION; + case eDeflate: return COMPRESSION_DEFLATE; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static Compression convertConstToCompression (int value) throws Lib3MFException { + switch (value) { + case COMPRESSION_NOCOMPRESSION: return Compression.eNoCompression; + case COMPRESSION_DEFLATE: return Compression.eDeflate; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + } + + public interface ProgressCallback extends Callback { + + void progressCallback (Pointer abort, double progressValue, int progressIdentifier, Pointer userData); + + } + + public interface WriteCallback extends Callback { + + void writeCallback (long byteData, long numBytes, Pointer userData); + + } + + public interface ReadCallback extends Callback { + + void readCallback (long byteData, long numBytes, Pointer userData); + + } + + public interface SeekCallback extends Callback { + + void seekCallback (long position, Pointer userData); + + } + + public interface RandomNumberCallback extends Callback { + + void randomNumberCallback (long byteData, long numBytes, Pointer userData, Pointer bytesWritten); + + } + + public interface KeyWrappingCallback extends Callback { + + void keyWrappingCallback (Pointer kEKParams, int inBufferSize, Pointer inBufferBuffer, int outBufferSize, Pointer outBufferNeededSize, Pointer outBufferBuffer, Pointer userData, Pointer status); + + } + + public interface ContentEncryptionCallback extends Callback { + + void contentEncryptionCallback (Pointer cEKParams, int inputSize, Pointer inputBuffer, int outputSize, Pointer outputNeededSize, Pointer outputBuffer, Pointer userData, Pointer status); + + } + + protected com.sun.jna.Function lib3mf_getlibraryversion; + protected com.sun.jna.Function lib3mf_getprereleaseinformation; + protected com.sun.jna.Function lib3mf_getbuildinformation; + protected com.sun.jna.Function lib3mf_getspecificationversion; + protected com.sun.jna.Function lib3mf_createmodel; + protected com.sun.jna.Function lib3mf_release; + protected com.sun.jna.Function lib3mf_acquire; + protected com.sun.jna.Function lib3mf_setjournal; + protected com.sun.jna.Function lib3mf_getlasterror; + protected com.sun.jna.Function lib3mf_getsymbollookupmethod; + protected com.sun.jna.Function lib3mf_retrieveprogressmessage; + protected com.sun.jna.Function lib3mf_rgbatocolor; + protected com.sun.jna.Function lib3mf_floatrgbatocolor; + protected com.sun.jna.Function lib3mf_colortorgba; + protected com.sun.jna.Function lib3mf_colortofloatrgba; + protected com.sun.jna.Function lib3mf_getidentitytransform; + protected com.sun.jna.Function lib3mf_getuniformscaletransform; + protected com.sun.jna.Function lib3mf_getscaletransform; + protected com.sun.jna.Function lib3mf_gettranslationtransform; + protected com.sun.jna.Function lib3mf_base_classtypeid; + protected com.sun.jna.Function lib3mf_writer_writetofile; + protected com.sun.jna.Function lib3mf_writer_getstreamsize; + protected com.sun.jna.Function lib3mf_writer_writetobuffer; + protected com.sun.jna.Function lib3mf_writer_writetocallback; + protected com.sun.jna.Function lib3mf_writer_setprogresscallback; + protected com.sun.jna.Function lib3mf_writer_getdecimalprecision; + protected com.sun.jna.Function lib3mf_writer_setdecimalprecision; + protected com.sun.jna.Function lib3mf_writer_setstrictmodeactive; + protected com.sun.jna.Function lib3mf_writer_getstrictmodeactive; + protected com.sun.jna.Function lib3mf_writer_getwarning; + protected com.sun.jna.Function lib3mf_writer_getwarningcount; + protected com.sun.jna.Function lib3mf_writer_addkeywrappingcallback; + protected com.sun.jna.Function lib3mf_writer_setcontentencryptioncallback; + protected com.sun.jna.Function lib3mf_reader_readfromfile; + protected com.sun.jna.Function lib3mf_reader_readfrombuffer; + protected com.sun.jna.Function lib3mf_reader_readfromcallback; + protected com.sun.jna.Function lib3mf_reader_setprogresscallback; + protected com.sun.jna.Function lib3mf_reader_addrelationtoread; + protected com.sun.jna.Function lib3mf_reader_removerelationtoread; + protected com.sun.jna.Function lib3mf_reader_setstrictmodeactive; + protected com.sun.jna.Function lib3mf_reader_getstrictmodeactive; + protected com.sun.jna.Function lib3mf_reader_getwarning; + protected com.sun.jna.Function lib3mf_reader_getwarningcount; + protected com.sun.jna.Function lib3mf_reader_addkeywrappingcallback; + protected com.sun.jna.Function lib3mf_reader_setcontentencryptioncallback; + protected com.sun.jna.Function lib3mf_packagepart_getpath; + protected com.sun.jna.Function lib3mf_packagepart_setpath; + protected com.sun.jna.Function lib3mf_resource_getresourceid; + protected com.sun.jna.Function lib3mf_resource_getuniqueresourceid; + protected com.sun.jna.Function lib3mf_resource_packagepart; + protected com.sun.jna.Function lib3mf_resource_setpackagepart; + protected com.sun.jna.Function lib3mf_resource_getmodelresourceid; + protected com.sun.jna.Function lib3mf_resourceiterator_movenext; + protected com.sun.jna.Function lib3mf_resourceiterator_moveprevious; + protected com.sun.jna.Function lib3mf_resourceiterator_getcurrent; + protected com.sun.jna.Function lib3mf_resourceiterator_clone; + protected com.sun.jna.Function lib3mf_resourceiterator_count; + protected com.sun.jna.Function lib3mf_slicestackiterator_getcurrentslicestack; + protected com.sun.jna.Function lib3mf_objectiterator_getcurrentobject; + protected com.sun.jna.Function lib3mf_meshobjectiterator_getcurrentmeshobject; + protected com.sun.jna.Function lib3mf_componentsobjectiterator_getcurrentcomponentsobject; + protected com.sun.jna.Function lib3mf_booleanobjectiterator_getcurrentbooleanobject; + protected com.sun.jna.Function lib3mf_texture2diterator_getcurrenttexture2d; + protected com.sun.jna.Function lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup; + protected com.sun.jna.Function lib3mf_colorgroupiterator_getcurrentcolorgroup; + protected com.sun.jna.Function lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup; + protected com.sun.jna.Function lib3mf_compositematerialsiterator_getcurrentcompositematerials; + protected com.sun.jna.Function lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup; + protected com.sun.jna.Function lib3mf_image3diterator_getcurrentimage3d; + protected com.sun.jna.Function lib3mf_functioniterator_getcurrentfunction; + protected com.sun.jna.Function lib3mf_levelsetiterator_getcurrentlevelset; + protected com.sun.jna.Function lib3mf_metadata_getnamespace; + protected com.sun.jna.Function lib3mf_metadata_setnamespace; + protected com.sun.jna.Function lib3mf_metadata_getname; + protected com.sun.jna.Function lib3mf_metadata_setname; + protected com.sun.jna.Function lib3mf_metadata_getkey; + protected com.sun.jna.Function lib3mf_metadata_getmustpreserve; + protected com.sun.jna.Function lib3mf_metadata_setmustpreserve; + protected com.sun.jna.Function lib3mf_metadata_gettype; + protected com.sun.jna.Function lib3mf_metadata_settype; + protected com.sun.jna.Function lib3mf_metadata_getvalue; + protected com.sun.jna.Function lib3mf_metadata_setvalue; + protected com.sun.jna.Function lib3mf_metadatagroup_getmetadatacount; + protected com.sun.jna.Function lib3mf_metadatagroup_getmetadata; + protected com.sun.jna.Function lib3mf_metadatagroup_getmetadatabykey; + protected com.sun.jna.Function lib3mf_metadatagroup_removemetadatabyindex; + protected com.sun.jna.Function lib3mf_metadatagroup_removemetadata; + protected com.sun.jna.Function lib3mf_metadatagroup_addmetadata; + protected com.sun.jna.Function lib3mf_triangleset_setname; + protected com.sun.jna.Function lib3mf_triangleset_getname; + protected com.sun.jna.Function lib3mf_triangleset_setidentifier; + protected com.sun.jna.Function lib3mf_triangleset_getidentifier; + protected com.sun.jna.Function lib3mf_triangleset_addtriangle; + protected com.sun.jna.Function lib3mf_triangleset_removetriangle; + protected com.sun.jna.Function lib3mf_triangleset_clear; + protected com.sun.jna.Function lib3mf_triangleset_settrianglelist; + protected com.sun.jna.Function lib3mf_triangleset_gettrianglelist; + protected com.sun.jna.Function lib3mf_triangleset_addtrianglelist; + protected com.sun.jna.Function lib3mf_triangleset_merge; + protected com.sun.jna.Function lib3mf_triangleset_deleteset; + protected com.sun.jna.Function lib3mf_triangleset_duplicate; + protected com.sun.jna.Function lib3mf_object_gettype; + protected com.sun.jna.Function lib3mf_object_settype; + protected com.sun.jna.Function lib3mf_object_getname; + protected com.sun.jna.Function lib3mf_object_setname; + protected com.sun.jna.Function lib3mf_object_getpartnumber; + protected com.sun.jna.Function lib3mf_object_setpartnumber; + protected com.sun.jna.Function lib3mf_object_ismeshobject; + protected com.sun.jna.Function lib3mf_object_iscomponentsobject; + protected com.sun.jna.Function lib3mf_object_islevelsetobject; + protected com.sun.jna.Function lib3mf_object_isbooleanobject; + protected com.sun.jna.Function lib3mf_object_isvalid; + protected com.sun.jna.Function lib3mf_object_setattachmentasthumbnail; + protected com.sun.jna.Function lib3mf_object_getthumbnailattachment; + protected com.sun.jna.Function lib3mf_object_clearthumbnailattachment; + protected com.sun.jna.Function lib3mf_object_getoutbox; + protected com.sun.jna.Function lib3mf_object_getuuid; + protected com.sun.jna.Function lib3mf_object_setuuid; + protected com.sun.jna.Function lib3mf_object_getmetadatagroup; + protected com.sun.jna.Function lib3mf_object_setslicesmeshresolution; + protected com.sun.jna.Function lib3mf_object_getslicesmeshresolution; + protected com.sun.jna.Function lib3mf_object_hasslices; + protected com.sun.jna.Function lib3mf_object_clearslicestack; + protected com.sun.jna.Function lib3mf_object_getslicestack; + protected com.sun.jna.Function lib3mf_object_assignslicestack; + protected com.sun.jna.Function lib3mf_meshobject_getvertexcount; + protected com.sun.jna.Function lib3mf_meshobject_gettrianglecount; + protected com.sun.jna.Function lib3mf_meshobject_getvertex; + protected com.sun.jna.Function lib3mf_meshobject_setvertex; + protected com.sun.jna.Function lib3mf_meshobject_addvertex; + protected com.sun.jna.Function lib3mf_meshobject_getvertices; + protected com.sun.jna.Function lib3mf_meshobject_gettriangle; + protected com.sun.jna.Function lib3mf_meshobject_settriangle; + protected com.sun.jna.Function lib3mf_meshobject_addtriangle; + protected com.sun.jna.Function lib3mf_meshobject_gettriangleindices; + protected com.sun.jna.Function lib3mf_meshobject_setobjectlevelproperty; + protected com.sun.jna.Function lib3mf_meshobject_getobjectlevelproperty; + protected com.sun.jna.Function lib3mf_meshobject_settriangleproperties; + protected com.sun.jna.Function lib3mf_meshobject_gettriangleproperties; + protected com.sun.jna.Function lib3mf_meshobject_setalltriangleproperties; + protected com.sun.jna.Function lib3mf_meshobject_getalltriangleproperties; + protected com.sun.jna.Function lib3mf_meshobject_clearallproperties; + protected com.sun.jna.Function lib3mf_meshobject_setgeometry; + protected com.sun.jna.Function lib3mf_meshobject_ismanifoldandoriented; + protected com.sun.jna.Function lib3mf_meshobject_beamlattice; + protected com.sun.jna.Function lib3mf_meshobject_getvolumedata; + protected com.sun.jna.Function lib3mf_meshobject_setvolumedata; + protected com.sun.jna.Function lib3mf_meshobject_addtriangleset; + protected com.sun.jna.Function lib3mf_meshobject_hastriangleset; + protected com.sun.jna.Function lib3mf_meshobject_findtriangleset; + protected com.sun.jna.Function lib3mf_meshobject_gettrianglesetcount; + protected com.sun.jna.Function lib3mf_meshobject_gettriangleset; + protected com.sun.jna.Function lib3mf_levelset_getfunction; + protected com.sun.jna.Function lib3mf_levelset_setfunction; + protected com.sun.jna.Function lib3mf_levelset_gettransform; + protected com.sun.jna.Function lib3mf_levelset_settransform; + protected com.sun.jna.Function lib3mf_levelset_getchannelname; + protected com.sun.jna.Function lib3mf_levelset_setchannelname; + protected com.sun.jna.Function lib3mf_levelset_setminfeaturesize; + protected com.sun.jna.Function lib3mf_levelset_getminfeaturesize; + protected com.sun.jna.Function lib3mf_levelset_setfallbackvalue; + protected com.sun.jna.Function lib3mf_levelset_getfallbackvalue; + protected com.sun.jna.Function lib3mf_levelset_setmeshbboxonly; + protected com.sun.jna.Function lib3mf_levelset_getmeshbboxonly; + protected com.sun.jna.Function lib3mf_levelset_setmesh; + protected com.sun.jna.Function lib3mf_levelset_getmesh; + protected com.sun.jna.Function lib3mf_levelset_getvolumedata; + protected com.sun.jna.Function lib3mf_levelset_setvolumedata; + protected com.sun.jna.Function lib3mf_booleanobject_setbaseobject; + protected com.sun.jna.Function lib3mf_booleanobject_getbaseobject; + protected com.sun.jna.Function lib3mf_booleanobject_setbasetransform; + protected com.sun.jna.Function lib3mf_booleanobject_getbasetransform; + protected com.sun.jna.Function lib3mf_booleanobject_setoperation; + protected com.sun.jna.Function lib3mf_booleanobject_getoperation; + protected com.sun.jna.Function lib3mf_booleanobject_setcsgmodeenabled; + protected com.sun.jna.Function lib3mf_booleanobject_getcsgmodeenabled; + protected com.sun.jna.Function lib3mf_booleanobject_setextractiongridresolution; + protected com.sun.jna.Function lib3mf_booleanobject_getextractiongridresolution; + protected com.sun.jna.Function lib3mf_booleanobject_getoperandcount; + protected com.sun.jna.Function lib3mf_booleanobject_addoperand; + protected com.sun.jna.Function lib3mf_booleanobject_getoperand; + protected com.sun.jna.Function lib3mf_booleanobject_mergetomeshobject; + protected com.sun.jna.Function lib3mf_beamlattice_getminlength; + protected com.sun.jna.Function lib3mf_beamlattice_setminlength; + protected com.sun.jna.Function lib3mf_beamlattice_getclipping; + protected com.sun.jna.Function lib3mf_beamlattice_setclipping; + protected com.sun.jna.Function lib3mf_beamlattice_getrepresentation; + protected com.sun.jna.Function lib3mf_beamlattice_setrepresentation; + protected com.sun.jna.Function lib3mf_beamlattice_getballoptions; + protected com.sun.jna.Function lib3mf_beamlattice_setballoptions; + protected com.sun.jna.Function lib3mf_beamlattice_getbeamcount; + protected com.sun.jna.Function lib3mf_beamlattice_getbeam; + protected com.sun.jna.Function lib3mf_beamlattice_addbeam; + protected com.sun.jna.Function lib3mf_beamlattice_setbeam; + protected com.sun.jna.Function lib3mf_beamlattice_setbeams; + protected com.sun.jna.Function lib3mf_beamlattice_getbeams; + protected com.sun.jna.Function lib3mf_beamlattice_getballcount; + protected com.sun.jna.Function lib3mf_beamlattice_getball; + protected com.sun.jna.Function lib3mf_beamlattice_addball; + protected com.sun.jna.Function lib3mf_beamlattice_setball; + protected com.sun.jna.Function lib3mf_beamlattice_setballs; + protected com.sun.jna.Function lib3mf_beamlattice_getballs; + protected com.sun.jna.Function lib3mf_beamlattice_getbeamsetcount; + protected com.sun.jna.Function lib3mf_beamlattice_addbeamset; + protected com.sun.jna.Function lib3mf_beamlattice_getbeamset; + protected com.sun.jna.Function lib3mf_functionreference_getfunctionresourceid; + protected com.sun.jna.Function lib3mf_functionreference_setfunctionresourceid; + protected com.sun.jna.Function lib3mf_functionreference_gettransform; + protected com.sun.jna.Function lib3mf_functionreference_settransform; + protected com.sun.jna.Function lib3mf_functionreference_getchannelname; + protected com.sun.jna.Function lib3mf_functionreference_setchannelname; + protected com.sun.jna.Function lib3mf_functionreference_setminfeaturesize; + protected com.sun.jna.Function lib3mf_functionreference_getminfeaturesize; + protected com.sun.jna.Function lib3mf_functionreference_setfallbackvalue; + protected com.sun.jna.Function lib3mf_functionreference_getfallbackvalue; + protected com.sun.jna.Function lib3mf_volumedatacomposite_getbasematerialgroup; + protected com.sun.jna.Function lib3mf_volumedatacomposite_setbasematerialgroup; + protected com.sun.jna.Function lib3mf_volumedatacomposite_getmaterialmappingcount; + protected com.sun.jna.Function lib3mf_volumedatacomposite_getmaterialmapping; + protected com.sun.jna.Function lib3mf_volumedatacomposite_addmaterialmapping; + protected com.sun.jna.Function lib3mf_volumedatacomposite_removematerialmapping; + protected com.sun.jna.Function lib3mf_volumedataproperty_getname; + protected com.sun.jna.Function lib3mf_volumedataproperty_setisrequired; + protected com.sun.jna.Function lib3mf_volumedataproperty_isrequired; + protected com.sun.jna.Function lib3mf_volumedata_getcomposite; + protected com.sun.jna.Function lib3mf_volumedata_createnewcomposite; + protected com.sun.jna.Function lib3mf_volumedata_removecomposite; + protected com.sun.jna.Function lib3mf_volumedata_getcolor; + protected com.sun.jna.Function lib3mf_volumedata_createnewcolor; + protected com.sun.jna.Function lib3mf_volumedata_removecolor; + protected com.sun.jna.Function lib3mf_volumedata_getpropertycount; + protected com.sun.jna.Function lib3mf_volumedata_getproperty; + protected com.sun.jna.Function lib3mf_volumedata_addpropertyfromfunction; + protected com.sun.jna.Function lib3mf_volumedata_removeproperty; + protected com.sun.jna.Function lib3mf_component_getobjectresource; + protected com.sun.jna.Function lib3mf_component_getobjectresourceid; + protected com.sun.jna.Function lib3mf_component_getuuid; + protected com.sun.jna.Function lib3mf_component_setuuid; + protected com.sun.jna.Function lib3mf_component_hastransform; + protected com.sun.jna.Function lib3mf_component_gettransform; + protected com.sun.jna.Function lib3mf_component_settransform; + protected com.sun.jna.Function lib3mf_componentsobject_addcomponent; + protected com.sun.jna.Function lib3mf_componentsobject_getcomponent; + protected com.sun.jna.Function lib3mf_componentsobject_getcomponentcount; + protected com.sun.jna.Function lib3mf_beamset_setname; + protected com.sun.jna.Function lib3mf_beamset_getname; + protected com.sun.jna.Function lib3mf_beamset_setidentifier; + protected com.sun.jna.Function lib3mf_beamset_getidentifier; + protected com.sun.jna.Function lib3mf_beamset_getreferencecount; + protected com.sun.jna.Function lib3mf_beamset_setreferences; + protected com.sun.jna.Function lib3mf_beamset_getreferences; + protected com.sun.jna.Function lib3mf_beamset_getballreferencecount; + protected com.sun.jna.Function lib3mf_beamset_setballreferences; + protected com.sun.jna.Function lib3mf_beamset_getballreferences; + protected com.sun.jna.Function lib3mf_basematerialgroup_getcount; + protected com.sun.jna.Function lib3mf_basematerialgroup_getallpropertyids; + protected com.sun.jna.Function lib3mf_basematerialgroup_addmaterial; + protected com.sun.jna.Function lib3mf_basematerialgroup_removematerial; + protected com.sun.jna.Function lib3mf_basematerialgroup_getname; + protected com.sun.jna.Function lib3mf_basematerialgroup_setname; + protected com.sun.jna.Function lib3mf_basematerialgroup_setdisplaycolor; + protected com.sun.jna.Function lib3mf_basematerialgroup_getdisplaycolor; + protected com.sun.jna.Function lib3mf_colorgroup_getcount; + protected com.sun.jna.Function lib3mf_colorgroup_getallpropertyids; + protected com.sun.jna.Function lib3mf_colorgroup_addcolor; + protected com.sun.jna.Function lib3mf_colorgroup_removecolor; + protected com.sun.jna.Function lib3mf_colorgroup_setcolor; + protected com.sun.jna.Function lib3mf_colorgroup_getcolor; + protected com.sun.jna.Function lib3mf_texture2dgroup_getcount; + protected com.sun.jna.Function lib3mf_texture2dgroup_getallpropertyids; + protected com.sun.jna.Function lib3mf_texture2dgroup_addtex2coord; + protected com.sun.jna.Function lib3mf_texture2dgroup_gettex2coord; + protected com.sun.jna.Function lib3mf_texture2dgroup_removetex2coord; + protected com.sun.jna.Function lib3mf_texture2dgroup_gettexture2d; + protected com.sun.jna.Function lib3mf_compositematerials_getcount; + protected com.sun.jna.Function lib3mf_compositematerials_getallpropertyids; + protected com.sun.jna.Function lib3mf_compositematerials_getbasematerialgroup; + protected com.sun.jna.Function lib3mf_compositematerials_addcomposite; + protected com.sun.jna.Function lib3mf_compositematerials_removecomposite; + protected com.sun.jna.Function lib3mf_compositematerials_getcomposite; + protected com.sun.jna.Function lib3mf_multipropertygroup_getcount; + protected com.sun.jna.Function lib3mf_multipropertygroup_getallpropertyids; + protected com.sun.jna.Function lib3mf_multipropertygroup_addmultiproperty; + protected com.sun.jna.Function lib3mf_multipropertygroup_setmultiproperty; + protected com.sun.jna.Function lib3mf_multipropertygroup_getmultiproperty; + protected com.sun.jna.Function lib3mf_multipropertygroup_removemultiproperty; + protected com.sun.jna.Function lib3mf_multipropertygroup_getlayercount; + protected com.sun.jna.Function lib3mf_multipropertygroup_addlayer; + protected com.sun.jna.Function lib3mf_multipropertygroup_getlayer; + protected com.sun.jna.Function lib3mf_multipropertygroup_removelayer; + protected com.sun.jna.Function lib3mf_image3d_getname; + protected com.sun.jna.Function lib3mf_image3d_setname; + protected com.sun.jna.Function lib3mf_image3d_isimagestack; + protected com.sun.jna.Function lib3mf_imagestack_getrowcount; + protected com.sun.jna.Function lib3mf_imagestack_setrowcount; + protected com.sun.jna.Function lib3mf_imagestack_getcolumncount; + protected com.sun.jna.Function lib3mf_imagestack_setcolumncount; + protected com.sun.jna.Function lib3mf_imagestack_getsheetcount; + protected com.sun.jna.Function lib3mf_imagestack_getsheet; + protected com.sun.jna.Function lib3mf_imagestack_setsheet; + protected com.sun.jna.Function lib3mf_imagestack_createemptysheet; + protected com.sun.jna.Function lib3mf_imagestack_createsheetfrombuffer; + protected com.sun.jna.Function lib3mf_imagestack_createsheetfromfile; + protected com.sun.jna.Function lib3mf_attachment_getpath; + protected com.sun.jna.Function lib3mf_attachment_setpath; + protected com.sun.jna.Function lib3mf_attachment_packagepart; + protected com.sun.jna.Function lib3mf_attachment_getrelationshiptype; + protected com.sun.jna.Function lib3mf_attachment_setrelationshiptype; + protected com.sun.jna.Function lib3mf_attachment_writetofile; + protected com.sun.jna.Function lib3mf_attachment_readfromfile; + protected com.sun.jna.Function lib3mf_attachment_readfromcallback; + protected com.sun.jna.Function lib3mf_attachment_getstreamsize; + protected com.sun.jna.Function lib3mf_attachment_writetobuffer; + protected com.sun.jna.Function lib3mf_attachment_readfrombuffer; + protected com.sun.jna.Function lib3mf_texture2d_getattachment; + protected com.sun.jna.Function lib3mf_texture2d_setattachment; + protected com.sun.jna.Function lib3mf_texture2d_getcontenttype; + protected com.sun.jna.Function lib3mf_texture2d_setcontenttype; + protected com.sun.jna.Function lib3mf_texture2d_gettilestyleuv; + protected com.sun.jna.Function lib3mf_texture2d_settilestyleuv; + protected com.sun.jna.Function lib3mf_texture2d_getfilter; + protected com.sun.jna.Function lib3mf_texture2d_setfilter; + protected com.sun.jna.Function lib3mf_implicitport_getidentifier; + protected com.sun.jna.Function lib3mf_implicitport_setidentifier; + protected com.sun.jna.Function lib3mf_implicitport_getdisplayname; + protected com.sun.jna.Function lib3mf_implicitport_setdisplayname; + protected com.sun.jna.Function lib3mf_implicitport_settype; + protected com.sun.jna.Function lib3mf_implicitport_gettype; + protected com.sun.jna.Function lib3mf_implicitport_getreference; + protected com.sun.jna.Function lib3mf_implicitport_setreference; + protected com.sun.jna.Function lib3mf_iterator_movenext; + protected com.sun.jna.Function lib3mf_iterator_moveprevious; + protected com.sun.jna.Function lib3mf_iterator_count; + protected com.sun.jna.Function lib3mf_implicitportiterator_getcurrent; + protected com.sun.jna.Function lib3mf_implicitnode_getidentifier; + protected com.sun.jna.Function lib3mf_implicitnode_setidentifier; + protected com.sun.jna.Function lib3mf_implicitnode_getdisplayname; + protected com.sun.jna.Function lib3mf_implicitnode_setdisplayname; + protected com.sun.jna.Function lib3mf_implicitnode_gettag; + protected com.sun.jna.Function lib3mf_implicitnode_settag; + protected com.sun.jna.Function lib3mf_implicitnode_getnodetype; + protected com.sun.jna.Function lib3mf_implicitnode_addinput; + protected com.sun.jna.Function lib3mf_implicitnode_getinputs; + protected com.sun.jna.Function lib3mf_implicitnode_addoutput; + protected com.sun.jna.Function lib3mf_implicitnode_getoutputs; + protected com.sun.jna.Function lib3mf_implicitnode_findinput; + protected com.sun.jna.Function lib3mf_implicitnode_findoutput; + protected com.sun.jna.Function lib3mf_implicitnode_aretypesvalid; + protected com.sun.jna.Function lib3mf_oneinputnode_getinputa; + protected com.sun.jna.Function lib3mf_oneinputnode_getoutputresult; + protected com.sun.jna.Function lib3mf_resourceidnode_setresource; + protected com.sun.jna.Function lib3mf_resourceidnode_getresource; + protected com.sun.jna.Function lib3mf_resourceidnode_getoutputvalue; + protected com.sun.jna.Function lib3mf_twoinputnode_getinputb; + protected com.sun.jna.Function lib3mf_selectnode_getinputb; + protected com.sun.jna.Function lib3mf_selectnode_getinputc; + protected com.sun.jna.Function lib3mf_selectnode_getinputd; + protected com.sun.jna.Function lib3mf_clampnode_getinputmin; + protected com.sun.jna.Function lib3mf_clampnode_getinputmax; + protected com.sun.jna.Function lib3mf_composevectornode_getinputx; + protected com.sun.jna.Function lib3mf_composevectornode_getinputy; + protected com.sun.jna.Function lib3mf_composevectornode_getinputz; + protected com.sun.jna.Function lib3mf_composevectornode_getoutputresult; + protected com.sun.jna.Function lib3mf_decomposevectornode_getinputa; + protected com.sun.jna.Function lib3mf_decomposevectornode_getoutputx; + protected com.sun.jna.Function lib3mf_decomposevectornode_getoutputy; + protected com.sun.jna.Function lib3mf_decomposevectornode_getoutputz; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm00; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm01; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm02; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm03; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm10; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm11; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm12; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm13; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm20; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm21; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm22; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm23; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm30; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm31; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm32; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm33; + protected com.sun.jna.Function lib3mf_composematrixnode_getoutputresult; + protected com.sun.jna.Function lib3mf_matrixfromrowsnode_getinputa; + protected com.sun.jna.Function lib3mf_matrixfromrowsnode_getinputb; + protected com.sun.jna.Function lib3mf_matrixfromrowsnode_getinputc; + protected com.sun.jna.Function lib3mf_matrixfromrowsnode_getinputd; + protected com.sun.jna.Function lib3mf_matrixfromrowsnode_getoutputresult; + protected com.sun.jna.Function lib3mf_matrixfromcolumnsnode_getinputa; + protected com.sun.jna.Function lib3mf_matrixfromcolumnsnode_getinputb; + protected com.sun.jna.Function lib3mf_matrixfromcolumnsnode_getinputc; + protected com.sun.jna.Function lib3mf_matrixfromcolumnsnode_getinputd; + protected com.sun.jna.Function lib3mf_matrixfromcolumnsnode_getoutputresult; + protected com.sun.jna.Function lib3mf_constantnode_setconstant; + protected com.sun.jna.Function lib3mf_constantnode_getconstant; + protected com.sun.jna.Function lib3mf_constantnode_getoutputvalue; + protected com.sun.jna.Function lib3mf_constvecnode_setvector; + protected com.sun.jna.Function lib3mf_constvecnode_getvector; + protected com.sun.jna.Function lib3mf_constvecnode_getoutputvector; + protected com.sun.jna.Function lib3mf_constmatnode_setmatrix; + protected com.sun.jna.Function lib3mf_constmatnode_getmatrix; + protected com.sun.jna.Function lib3mf_constmatnode_getoutputmatrix; + protected com.sun.jna.Function lib3mf_meshnode_getinputmesh; + protected com.sun.jna.Function lib3mf_meshnode_getinputpos; + protected com.sun.jna.Function lib3mf_meshnode_getoutputdistance; + protected com.sun.jna.Function lib3mf_unsignedmeshnode_getinputmesh; + protected com.sun.jna.Function lib3mf_unsignedmeshnode_getinputpos; + protected com.sun.jna.Function lib3mf_unsignedmeshnode_getoutputdistance; + protected com.sun.jna.Function lib3mf_beamlatticenode_getinputbeamlattice; + protected com.sun.jna.Function lib3mf_beamlatticenode_getinputpos; + protected com.sun.jna.Function lib3mf_beamlatticenode_getoutputdistance; + protected com.sun.jna.Function lib3mf_beamlatticenode_setaccuraterange; + protected com.sun.jna.Function lib3mf_beamlatticenode_getaccuraterange; + protected com.sun.jna.Function lib3mf_functiongradientnode_getinputfunctionid; + protected com.sun.jna.Function lib3mf_functiongradientnode_getinputpos; + protected com.sun.jna.Function lib3mf_functiongradientnode_getinputstep; + protected com.sun.jna.Function lib3mf_functiongradientnode_setscalaroutputname; + protected com.sun.jna.Function lib3mf_functiongradientnode_getscalaroutputname; + protected com.sun.jna.Function lib3mf_functiongradientnode_setvectorinputname; + protected com.sun.jna.Function lib3mf_functiongradientnode_getvectorinputname; + protected com.sun.jna.Function lib3mf_functiongradientnode_getoutputnormalizedgradient; + protected com.sun.jna.Function lib3mf_functiongradientnode_getoutputgradient; + protected com.sun.jna.Function lib3mf_functiongradientnode_getoutputmagnitude; + protected com.sun.jna.Function lib3mf_normalizedistancenode_getinputfunctionid; + protected com.sun.jna.Function lib3mf_normalizedistancenode_getinputpos; + protected com.sun.jna.Function lib3mf_normalizedistancenode_getinputstep; + protected com.sun.jna.Function lib3mf_normalizedistancenode_setscalaroutputname; + protected com.sun.jna.Function lib3mf_normalizedistancenode_getscalaroutputname; + protected com.sun.jna.Function lib3mf_normalizedistancenode_setvectorinputname; + protected com.sun.jna.Function lib3mf_normalizedistancenode_getvectorinputname; + protected com.sun.jna.Function lib3mf_normalizedistancenode_getoutputresult; + protected com.sun.jna.Function lib3mf_functioncallnode_getinputfunctionid; + protected com.sun.jna.Function lib3mf_nodeiterator_getcurrent; + protected com.sun.jna.Function lib3mf_function_getdisplayname; + protected com.sun.jna.Function lib3mf_function_setdisplayname; + protected com.sun.jna.Function lib3mf_function_addinput; + protected com.sun.jna.Function lib3mf_function_getinputs; + protected com.sun.jna.Function lib3mf_function_removeinput; + protected com.sun.jna.Function lib3mf_function_addoutput; + protected com.sun.jna.Function lib3mf_function_getoutputs; + protected com.sun.jna.Function lib3mf_function_removeoutput; + protected com.sun.jna.Function lib3mf_function_findinput; + protected com.sun.jna.Function lib3mf_function_findoutput; + protected com.sun.jna.Function lib3mf_implicitfunction_getidentifier; + protected com.sun.jna.Function lib3mf_implicitfunction_setidentifier; + protected com.sun.jna.Function lib3mf_implicitfunction_addnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addsinnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addcosnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addtannode; + protected com.sun.jna.Function lib3mf_implicitfunction_addarcsinnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addarccosnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addarctan2node; + protected com.sun.jna.Function lib3mf_implicitfunction_addsinhnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addcoshnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addtanhnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addroundnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addceilnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addfloornode; + protected com.sun.jna.Function lib3mf_implicitfunction_addsignnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addfractnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addabsnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addexpnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addlognode; + protected com.sun.jna.Function lib3mf_implicitfunction_addlog2node; + protected com.sun.jna.Function lib3mf_implicitfunction_addlog10node; + protected com.sun.jna.Function lib3mf_implicitfunction_addlengthnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addtransposenode; + protected com.sun.jna.Function lib3mf_implicitfunction_addinversenode; + protected com.sun.jna.Function lib3mf_implicitfunction_addsqrtnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addresourceidnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addadditionnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addsubtractionnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addmultiplicationnode; + protected com.sun.jna.Function lib3mf_implicitfunction_adddivisionnode; + protected com.sun.jna.Function lib3mf_implicitfunction_adddotnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addcrossnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addmatvecmultiplicationnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addminnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addmaxnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addfmodnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addpownode; + protected com.sun.jna.Function lib3mf_implicitfunction_addselectnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addclampnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addcomposevectornode; + protected com.sun.jna.Function lib3mf_implicitfunction_addvectorfromscalarnode; + protected com.sun.jna.Function lib3mf_implicitfunction_adddecomposevectornode; + protected com.sun.jna.Function lib3mf_implicitfunction_addcomposematrixnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addmatrixfromrowsnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addmatrixfromcolumnsnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addconstantnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addconstvecnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addconstmatnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addmeshnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addunsignedmeshnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addbeamlatticenode; + protected com.sun.jna.Function lib3mf_implicitfunction_addfunctiongradientnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addnormalizedistancenode; + protected com.sun.jna.Function lib3mf_implicitfunction_addfunctioncallnode; + protected com.sun.jna.Function lib3mf_implicitfunction_getnodes; + protected com.sun.jna.Function lib3mf_implicitfunction_removenode; + protected com.sun.jna.Function lib3mf_implicitfunction_addlink; + protected com.sun.jna.Function lib3mf_implicitfunction_addlinkbynames; + protected com.sun.jna.Function lib3mf_implicitfunction_clear; + protected com.sun.jna.Function lib3mf_implicitfunction_sortnodestopologically; + protected com.sun.jna.Function lib3mf_functionfromimage3d_getimage3d; + protected com.sun.jna.Function lib3mf_functionfromimage3d_setimage3d; + protected com.sun.jna.Function lib3mf_functionfromimage3d_setfilter; + protected com.sun.jna.Function lib3mf_functionfromimage3d_getfilter; + protected com.sun.jna.Function lib3mf_functionfromimage3d_settilestyles; + protected com.sun.jna.Function lib3mf_functionfromimage3d_gettilestyles; + protected com.sun.jna.Function lib3mf_functionfromimage3d_getoffset; + protected com.sun.jna.Function lib3mf_functionfromimage3d_setoffset; + protected com.sun.jna.Function lib3mf_functionfromimage3d_getscale; + protected com.sun.jna.Function lib3mf_functionfromimage3d_setscale; + protected com.sun.jna.Function lib3mf_builditem_getobjectresource; + protected com.sun.jna.Function lib3mf_builditem_getuuid; + protected com.sun.jna.Function lib3mf_builditem_setuuid; + protected com.sun.jna.Function lib3mf_builditem_getobjectresourceid; + protected com.sun.jna.Function lib3mf_builditem_hasobjecttransform; + protected com.sun.jna.Function lib3mf_builditem_getobjecttransform; + protected com.sun.jna.Function lib3mf_builditem_setobjecttransform; + protected com.sun.jna.Function lib3mf_builditem_getpartnumber; + protected com.sun.jna.Function lib3mf_builditem_setpartnumber; + protected com.sun.jna.Function lib3mf_builditem_getmetadatagroup; + protected com.sun.jna.Function lib3mf_builditem_getoutbox; + protected com.sun.jna.Function lib3mf_builditemiterator_movenext; + protected com.sun.jna.Function lib3mf_builditemiterator_moveprevious; + protected com.sun.jna.Function lib3mf_builditemiterator_getcurrent; + protected com.sun.jna.Function lib3mf_builditemiterator_clone; + protected com.sun.jna.Function lib3mf_builditemiterator_count; + protected com.sun.jna.Function lib3mf_slice_setvertices; + protected com.sun.jna.Function lib3mf_slice_getvertices; + protected com.sun.jna.Function lib3mf_slice_getvertexcount; + protected com.sun.jna.Function lib3mf_slice_addpolygon; + protected com.sun.jna.Function lib3mf_slice_getpolygoncount; + protected com.sun.jna.Function lib3mf_slice_setpolygonindices; + protected com.sun.jna.Function lib3mf_slice_getpolygonindices; + protected com.sun.jna.Function lib3mf_slice_getpolygonindexcount; + protected com.sun.jna.Function lib3mf_slice_getztop; + protected com.sun.jna.Function lib3mf_slicestack_getbottomz; + protected com.sun.jna.Function lib3mf_slicestack_getslicecount; + protected com.sun.jna.Function lib3mf_slicestack_getslice; + protected com.sun.jna.Function lib3mf_slicestack_addslice; + protected com.sun.jna.Function lib3mf_slicestack_getslicerefcount; + protected com.sun.jna.Function lib3mf_slicestack_addslicestackreference; + protected com.sun.jna.Function lib3mf_slicestack_getslicestackreference; + protected com.sun.jna.Function lib3mf_slicestack_collapseslicereferences; + protected com.sun.jna.Function lib3mf_slicestack_setownpath; + protected com.sun.jna.Function lib3mf_slicestack_getownpath; + protected com.sun.jna.Function lib3mf_consumer_getconsumerid; + protected com.sun.jna.Function lib3mf_consumer_getkeyid; + protected com.sun.jna.Function lib3mf_consumer_getkeyvalue; + protected com.sun.jna.Function lib3mf_accessright_getconsumer; + protected com.sun.jna.Function lib3mf_accessright_getwrappingalgorithm; + protected com.sun.jna.Function lib3mf_accessright_getmgfalgorithm; + protected com.sun.jna.Function lib3mf_accessright_getdigestmethod; + protected com.sun.jna.Function lib3mf_contentencryptionparams_getencryptionalgorithm; + protected com.sun.jna.Function lib3mf_contentencryptionparams_getkey; + protected com.sun.jna.Function lib3mf_contentencryptionparams_getinitializationvector; + protected com.sun.jna.Function lib3mf_contentencryptionparams_getauthenticationtag; + protected com.sun.jna.Function lib3mf_contentencryptionparams_setauthenticationtag; + protected com.sun.jna.Function lib3mf_contentencryptionparams_getadditionalauthenticationdata; + protected com.sun.jna.Function lib3mf_contentencryptionparams_getdescriptor; + protected com.sun.jna.Function lib3mf_contentencryptionparams_getkeyuuid; + protected com.sun.jna.Function lib3mf_resourcedata_getpath; + protected com.sun.jna.Function lib3mf_resourcedata_getencryptionalgorithm; + protected com.sun.jna.Function lib3mf_resourcedata_getcompression; + protected com.sun.jna.Function lib3mf_resourcedata_getadditionalauthenticationdata; + protected com.sun.jna.Function lib3mf_resourcedatagroup_getkeyuuid; + protected com.sun.jna.Function lib3mf_resourcedatagroup_addaccessright; + protected com.sun.jna.Function lib3mf_resourcedatagroup_findaccessrightbyconsumer; + protected com.sun.jna.Function lib3mf_resourcedatagroup_removeaccessright; + protected com.sun.jna.Function lib3mf_keystore_addconsumer; + protected com.sun.jna.Function lib3mf_keystore_getconsumercount; + protected com.sun.jna.Function lib3mf_keystore_getconsumer; + protected com.sun.jna.Function lib3mf_keystore_removeconsumer; + protected com.sun.jna.Function lib3mf_keystore_findconsumer; + protected com.sun.jna.Function lib3mf_keystore_getresourcedatagroupcount; + protected com.sun.jna.Function lib3mf_keystore_addresourcedatagroup; + protected com.sun.jna.Function lib3mf_keystore_getresourcedatagroup; + protected com.sun.jna.Function lib3mf_keystore_removeresourcedatagroup; + protected com.sun.jna.Function lib3mf_keystore_findresourcedatagroup; + protected com.sun.jna.Function lib3mf_keystore_addresourcedata; + protected com.sun.jna.Function lib3mf_keystore_removeresourcedata; + protected com.sun.jna.Function lib3mf_keystore_findresourcedata; + protected com.sun.jna.Function lib3mf_keystore_getresourcedatacount; + protected com.sun.jna.Function lib3mf_keystore_getresourcedata; + protected com.sun.jna.Function lib3mf_keystore_getuuid; + protected com.sun.jna.Function lib3mf_keystore_setuuid; + protected com.sun.jna.Function lib3mf_model_rootmodelpart; + protected com.sun.jna.Function lib3mf_model_findorcreatepackagepart; + protected com.sun.jna.Function lib3mf_model_setunit; + protected com.sun.jna.Function lib3mf_model_getunit; + protected com.sun.jna.Function lib3mf_model_getlanguage; + protected com.sun.jna.Function lib3mf_model_setlanguage; + protected com.sun.jna.Function lib3mf_model_querywriter; + protected com.sun.jna.Function lib3mf_model_queryreader; + protected com.sun.jna.Function lib3mf_model_getresourcebyid; + protected com.sun.jna.Function lib3mf_model_gettexture2dbyid; + protected com.sun.jna.Function lib3mf_model_getpropertytypebyid; + protected com.sun.jna.Function lib3mf_model_getbasematerialgroupbyid; + protected com.sun.jna.Function lib3mf_model_gettexture2dgroupbyid; + protected com.sun.jna.Function lib3mf_model_getcompositematerialsbyid; + protected com.sun.jna.Function lib3mf_model_getmultipropertygroupbyid; + protected com.sun.jna.Function lib3mf_model_getmeshobjectbyid; + protected com.sun.jna.Function lib3mf_model_getcomponentsobjectbyid; + protected com.sun.jna.Function lib3mf_model_getbooleanobjectbyid; + protected com.sun.jna.Function lib3mf_model_getcolorgroupbyid; + protected com.sun.jna.Function lib3mf_model_getslicestackbyid; + protected com.sun.jna.Function lib3mf_model_getlevelsetbyid; + protected com.sun.jna.Function lib3mf_model_getbuilduuid; + protected com.sun.jna.Function lib3mf_model_setbuilduuid; + protected com.sun.jna.Function lib3mf_model_getbuilditems; + protected com.sun.jna.Function lib3mf_model_getoutbox; + protected com.sun.jna.Function lib3mf_model_getresources; + protected com.sun.jna.Function lib3mf_model_getobjects; + protected com.sun.jna.Function lib3mf_model_getmeshobjects; + protected com.sun.jna.Function lib3mf_model_getcomponentsobjects; + protected com.sun.jna.Function lib3mf_model_getbooleanobjects; + protected com.sun.jna.Function lib3mf_model_gettexture2ds; + protected com.sun.jna.Function lib3mf_model_getbasematerialgroups; + protected com.sun.jna.Function lib3mf_model_getcolorgroups; + protected com.sun.jna.Function lib3mf_model_gettexture2dgroups; + protected com.sun.jna.Function lib3mf_model_getcompositematerials; + protected com.sun.jna.Function lib3mf_model_getmultipropertygroups; + protected com.sun.jna.Function lib3mf_model_getslicestacks; + protected com.sun.jna.Function lib3mf_model_getimage3ds; + protected com.sun.jna.Function lib3mf_model_mergetomodel; + protected com.sun.jna.Function lib3mf_model_mergefrommodel; + protected com.sun.jna.Function lib3mf_model_addmeshobject; + protected com.sun.jna.Function lib3mf_model_addcomponentsobject; + protected com.sun.jna.Function lib3mf_model_addbooleanobject; + protected com.sun.jna.Function lib3mf_model_addslicestack; + protected com.sun.jna.Function lib3mf_model_addtexture2dfromattachment; + protected com.sun.jna.Function lib3mf_model_addbasematerialgroup; + protected com.sun.jna.Function lib3mf_model_addcolorgroup; + protected com.sun.jna.Function lib3mf_model_addtexture2dgroup; + protected com.sun.jna.Function lib3mf_model_addcompositematerials; + protected com.sun.jna.Function lib3mf_model_addmultipropertygroup; + protected com.sun.jna.Function lib3mf_model_addimagestack; + protected com.sun.jna.Function lib3mf_model_getimagestackbyid; + protected com.sun.jna.Function lib3mf_model_addbuilditem; + protected com.sun.jna.Function lib3mf_model_removebuilditem; + protected com.sun.jna.Function lib3mf_model_getmetadatagroup; + protected com.sun.jna.Function lib3mf_model_addattachment; + protected com.sun.jna.Function lib3mf_model_removeattachment; + protected com.sun.jna.Function lib3mf_model_getattachment; + protected com.sun.jna.Function lib3mf_model_findattachment; + protected com.sun.jna.Function lib3mf_model_getattachmentcount; + protected com.sun.jna.Function lib3mf_model_haspackagethumbnailattachment; + protected com.sun.jna.Function lib3mf_model_createpackagethumbnailattachment; + protected com.sun.jna.Function lib3mf_model_getpackagethumbnailattachment; + protected com.sun.jna.Function lib3mf_model_removepackagethumbnailattachment; + protected com.sun.jna.Function lib3mf_model_addcustomcontenttype; + protected com.sun.jna.Function lib3mf_model_removecustomcontenttype; + protected com.sun.jna.Function lib3mf_model_setrandomnumbercallback; + protected com.sun.jna.Function lib3mf_model_getkeystore; + protected com.sun.jna.Function lib3mf_model_getfunctions; + protected com.sun.jna.Function lib3mf_model_addimplicitfunction; + protected com.sun.jna.Function lib3mf_model_addfunctionfromimage3d; + protected com.sun.jna.Function lib3mf_model_addvolumedata; + protected com.sun.jna.Function lib3mf_model_addlevelset; + protected com.sun.jna.Function lib3mf_model_getlevelsets; + protected com.sun.jna.Function lib3mf_model_removeresource; + + protected NativeLibrary mLibrary; + + public Lib3MFWrapper(String libraryPath) { + mLibrary = NativeLibrary.getInstance(libraryPath); + lib3mf_getlibraryversion = mLibrary.getFunction("lib3mf_getlibraryversion"); + lib3mf_getprereleaseinformation = mLibrary.getFunction("lib3mf_getprereleaseinformation"); + lib3mf_getbuildinformation = mLibrary.getFunction("lib3mf_getbuildinformation"); + lib3mf_getspecificationversion = mLibrary.getFunction("lib3mf_getspecificationversion"); + lib3mf_createmodel = mLibrary.getFunction("lib3mf_createmodel"); + lib3mf_release = mLibrary.getFunction("lib3mf_release"); + lib3mf_acquire = mLibrary.getFunction("lib3mf_acquire"); + lib3mf_setjournal = mLibrary.getFunction("lib3mf_setjournal"); + lib3mf_getlasterror = mLibrary.getFunction("lib3mf_getlasterror"); + lib3mf_getsymbollookupmethod = mLibrary.getFunction("lib3mf_getsymbollookupmethod"); + lib3mf_retrieveprogressmessage = mLibrary.getFunction("lib3mf_retrieveprogressmessage"); + lib3mf_rgbatocolor = mLibrary.getFunction("lib3mf_rgbatocolor"); + lib3mf_floatrgbatocolor = mLibrary.getFunction("lib3mf_floatrgbatocolor"); + lib3mf_colortorgba = mLibrary.getFunction("lib3mf_colortorgba"); + lib3mf_colortofloatrgba = mLibrary.getFunction("lib3mf_colortofloatrgba"); + lib3mf_getidentitytransform = mLibrary.getFunction("lib3mf_getidentitytransform"); + lib3mf_getuniformscaletransform = mLibrary.getFunction("lib3mf_getuniformscaletransform"); + lib3mf_getscaletransform = mLibrary.getFunction("lib3mf_getscaletransform"); + lib3mf_gettranslationtransform = mLibrary.getFunction("lib3mf_gettranslationtransform"); + lib3mf_base_classtypeid = mLibrary.getFunction("lib3mf_base_classtypeid"); + lib3mf_writer_writetofile = mLibrary.getFunction("lib3mf_writer_writetofile"); + lib3mf_writer_getstreamsize = mLibrary.getFunction("lib3mf_writer_getstreamsize"); + lib3mf_writer_writetobuffer = mLibrary.getFunction("lib3mf_writer_writetobuffer"); + lib3mf_writer_writetocallback = mLibrary.getFunction("lib3mf_writer_writetocallback"); + lib3mf_writer_setprogresscallback = mLibrary.getFunction("lib3mf_writer_setprogresscallback"); + lib3mf_writer_getdecimalprecision = mLibrary.getFunction("lib3mf_writer_getdecimalprecision"); + lib3mf_writer_setdecimalprecision = mLibrary.getFunction("lib3mf_writer_setdecimalprecision"); + lib3mf_writer_setstrictmodeactive = mLibrary.getFunction("lib3mf_writer_setstrictmodeactive"); + lib3mf_writer_getstrictmodeactive = mLibrary.getFunction("lib3mf_writer_getstrictmodeactive"); + lib3mf_writer_getwarning = mLibrary.getFunction("lib3mf_writer_getwarning"); + lib3mf_writer_getwarningcount = mLibrary.getFunction("lib3mf_writer_getwarningcount"); + lib3mf_writer_addkeywrappingcallback = mLibrary.getFunction("lib3mf_writer_addkeywrappingcallback"); + lib3mf_writer_setcontentencryptioncallback = mLibrary.getFunction("lib3mf_writer_setcontentencryptioncallback"); + lib3mf_reader_readfromfile = mLibrary.getFunction("lib3mf_reader_readfromfile"); + lib3mf_reader_readfrombuffer = mLibrary.getFunction("lib3mf_reader_readfrombuffer"); + lib3mf_reader_readfromcallback = mLibrary.getFunction("lib3mf_reader_readfromcallback"); + lib3mf_reader_setprogresscallback = mLibrary.getFunction("lib3mf_reader_setprogresscallback"); + lib3mf_reader_addrelationtoread = mLibrary.getFunction("lib3mf_reader_addrelationtoread"); + lib3mf_reader_removerelationtoread = mLibrary.getFunction("lib3mf_reader_removerelationtoread"); + lib3mf_reader_setstrictmodeactive = mLibrary.getFunction("lib3mf_reader_setstrictmodeactive"); + lib3mf_reader_getstrictmodeactive = mLibrary.getFunction("lib3mf_reader_getstrictmodeactive"); + lib3mf_reader_getwarning = mLibrary.getFunction("lib3mf_reader_getwarning"); + lib3mf_reader_getwarningcount = mLibrary.getFunction("lib3mf_reader_getwarningcount"); + lib3mf_reader_addkeywrappingcallback = mLibrary.getFunction("lib3mf_reader_addkeywrappingcallback"); + lib3mf_reader_setcontentencryptioncallback = mLibrary.getFunction("lib3mf_reader_setcontentencryptioncallback"); + lib3mf_packagepart_getpath = mLibrary.getFunction("lib3mf_packagepart_getpath"); + lib3mf_packagepart_setpath = mLibrary.getFunction("lib3mf_packagepart_setpath"); + lib3mf_resource_getresourceid = mLibrary.getFunction("lib3mf_resource_getresourceid"); + lib3mf_resource_getuniqueresourceid = mLibrary.getFunction("lib3mf_resource_getuniqueresourceid"); + lib3mf_resource_packagepart = mLibrary.getFunction("lib3mf_resource_packagepart"); + lib3mf_resource_setpackagepart = mLibrary.getFunction("lib3mf_resource_setpackagepart"); + lib3mf_resource_getmodelresourceid = mLibrary.getFunction("lib3mf_resource_getmodelresourceid"); + lib3mf_resourceiterator_movenext = mLibrary.getFunction("lib3mf_resourceiterator_movenext"); + lib3mf_resourceiterator_moveprevious = mLibrary.getFunction("lib3mf_resourceiterator_moveprevious"); + lib3mf_resourceiterator_getcurrent = mLibrary.getFunction("lib3mf_resourceiterator_getcurrent"); + lib3mf_resourceiterator_clone = mLibrary.getFunction("lib3mf_resourceiterator_clone"); + lib3mf_resourceiterator_count = mLibrary.getFunction("lib3mf_resourceiterator_count"); + lib3mf_slicestackiterator_getcurrentslicestack = mLibrary.getFunction("lib3mf_slicestackiterator_getcurrentslicestack"); + lib3mf_objectiterator_getcurrentobject = mLibrary.getFunction("lib3mf_objectiterator_getcurrentobject"); + lib3mf_meshobjectiterator_getcurrentmeshobject = mLibrary.getFunction("lib3mf_meshobjectiterator_getcurrentmeshobject"); + lib3mf_componentsobjectiterator_getcurrentcomponentsobject = mLibrary.getFunction("lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); + lib3mf_booleanobjectiterator_getcurrentbooleanobject = mLibrary.getFunction("lib3mf_booleanobjectiterator_getcurrentbooleanobject"); + lib3mf_texture2diterator_getcurrenttexture2d = mLibrary.getFunction("lib3mf_texture2diterator_getcurrenttexture2d"); + lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup = mLibrary.getFunction("lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); + lib3mf_colorgroupiterator_getcurrentcolorgroup = mLibrary.getFunction("lib3mf_colorgroupiterator_getcurrentcolorgroup"); + lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup = mLibrary.getFunction("lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + lib3mf_compositematerialsiterator_getcurrentcompositematerials = mLibrary.getFunction("lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup = mLibrary.getFunction("lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + lib3mf_image3diterator_getcurrentimage3d = mLibrary.getFunction("lib3mf_image3diterator_getcurrentimage3d"); + lib3mf_functioniterator_getcurrentfunction = mLibrary.getFunction("lib3mf_functioniterator_getcurrentfunction"); + lib3mf_levelsetiterator_getcurrentlevelset = mLibrary.getFunction("lib3mf_levelsetiterator_getcurrentlevelset"); + lib3mf_metadata_getnamespace = mLibrary.getFunction("lib3mf_metadata_getnamespace"); + lib3mf_metadata_setnamespace = mLibrary.getFunction("lib3mf_metadata_setnamespace"); + lib3mf_metadata_getname = mLibrary.getFunction("lib3mf_metadata_getname"); + lib3mf_metadata_setname = mLibrary.getFunction("lib3mf_metadata_setname"); + lib3mf_metadata_getkey = mLibrary.getFunction("lib3mf_metadata_getkey"); + lib3mf_metadata_getmustpreserve = mLibrary.getFunction("lib3mf_metadata_getmustpreserve"); + lib3mf_metadata_setmustpreserve = mLibrary.getFunction("lib3mf_metadata_setmustpreserve"); + lib3mf_metadata_gettype = mLibrary.getFunction("lib3mf_metadata_gettype"); + lib3mf_metadata_settype = mLibrary.getFunction("lib3mf_metadata_settype"); + lib3mf_metadata_getvalue = mLibrary.getFunction("lib3mf_metadata_getvalue"); + lib3mf_metadata_setvalue = mLibrary.getFunction("lib3mf_metadata_setvalue"); + lib3mf_metadatagroup_getmetadatacount = mLibrary.getFunction("lib3mf_metadatagroup_getmetadatacount"); + lib3mf_metadatagroup_getmetadata = mLibrary.getFunction("lib3mf_metadatagroup_getmetadata"); + lib3mf_metadatagroup_getmetadatabykey = mLibrary.getFunction("lib3mf_metadatagroup_getmetadatabykey"); + lib3mf_metadatagroup_removemetadatabyindex = mLibrary.getFunction("lib3mf_metadatagroup_removemetadatabyindex"); + lib3mf_metadatagroup_removemetadata = mLibrary.getFunction("lib3mf_metadatagroup_removemetadata"); + lib3mf_metadatagroup_addmetadata = mLibrary.getFunction("lib3mf_metadatagroup_addmetadata"); + lib3mf_triangleset_setname = mLibrary.getFunction("lib3mf_triangleset_setname"); + lib3mf_triangleset_getname = mLibrary.getFunction("lib3mf_triangleset_getname"); + lib3mf_triangleset_setidentifier = mLibrary.getFunction("lib3mf_triangleset_setidentifier"); + lib3mf_triangleset_getidentifier = mLibrary.getFunction("lib3mf_triangleset_getidentifier"); + lib3mf_triangleset_addtriangle = mLibrary.getFunction("lib3mf_triangleset_addtriangle"); + lib3mf_triangleset_removetriangle = mLibrary.getFunction("lib3mf_triangleset_removetriangle"); + lib3mf_triangleset_clear = mLibrary.getFunction("lib3mf_triangleset_clear"); + lib3mf_triangleset_settrianglelist = mLibrary.getFunction("lib3mf_triangleset_settrianglelist"); + lib3mf_triangleset_gettrianglelist = mLibrary.getFunction("lib3mf_triangleset_gettrianglelist"); + lib3mf_triangleset_addtrianglelist = mLibrary.getFunction("lib3mf_triangleset_addtrianglelist"); + lib3mf_triangleset_merge = mLibrary.getFunction("lib3mf_triangleset_merge"); + lib3mf_triangleset_deleteset = mLibrary.getFunction("lib3mf_triangleset_deleteset"); + lib3mf_triangleset_duplicate = mLibrary.getFunction("lib3mf_triangleset_duplicate"); + lib3mf_object_gettype = mLibrary.getFunction("lib3mf_object_gettype"); + lib3mf_object_settype = mLibrary.getFunction("lib3mf_object_settype"); + lib3mf_object_getname = mLibrary.getFunction("lib3mf_object_getname"); + lib3mf_object_setname = mLibrary.getFunction("lib3mf_object_setname"); + lib3mf_object_getpartnumber = mLibrary.getFunction("lib3mf_object_getpartnumber"); + lib3mf_object_setpartnumber = mLibrary.getFunction("lib3mf_object_setpartnumber"); + lib3mf_object_ismeshobject = mLibrary.getFunction("lib3mf_object_ismeshobject"); + lib3mf_object_iscomponentsobject = mLibrary.getFunction("lib3mf_object_iscomponentsobject"); + lib3mf_object_islevelsetobject = mLibrary.getFunction("lib3mf_object_islevelsetobject"); + lib3mf_object_isbooleanobject = mLibrary.getFunction("lib3mf_object_isbooleanobject"); + lib3mf_object_isvalid = mLibrary.getFunction("lib3mf_object_isvalid"); + lib3mf_object_setattachmentasthumbnail = mLibrary.getFunction("lib3mf_object_setattachmentasthumbnail"); + lib3mf_object_getthumbnailattachment = mLibrary.getFunction("lib3mf_object_getthumbnailattachment"); + lib3mf_object_clearthumbnailattachment = mLibrary.getFunction("lib3mf_object_clearthumbnailattachment"); + lib3mf_object_getoutbox = mLibrary.getFunction("lib3mf_object_getoutbox"); + lib3mf_object_getuuid = mLibrary.getFunction("lib3mf_object_getuuid"); + lib3mf_object_setuuid = mLibrary.getFunction("lib3mf_object_setuuid"); + lib3mf_object_getmetadatagroup = mLibrary.getFunction("lib3mf_object_getmetadatagroup"); + lib3mf_object_setslicesmeshresolution = mLibrary.getFunction("lib3mf_object_setslicesmeshresolution"); + lib3mf_object_getslicesmeshresolution = mLibrary.getFunction("lib3mf_object_getslicesmeshresolution"); + lib3mf_object_hasslices = mLibrary.getFunction("lib3mf_object_hasslices"); + lib3mf_object_clearslicestack = mLibrary.getFunction("lib3mf_object_clearslicestack"); + lib3mf_object_getslicestack = mLibrary.getFunction("lib3mf_object_getslicestack"); + lib3mf_object_assignslicestack = mLibrary.getFunction("lib3mf_object_assignslicestack"); + lib3mf_meshobject_getvertexcount = mLibrary.getFunction("lib3mf_meshobject_getvertexcount"); + lib3mf_meshobject_gettrianglecount = mLibrary.getFunction("lib3mf_meshobject_gettrianglecount"); + lib3mf_meshobject_getvertex = mLibrary.getFunction("lib3mf_meshobject_getvertex"); + lib3mf_meshobject_setvertex = mLibrary.getFunction("lib3mf_meshobject_setvertex"); + lib3mf_meshobject_addvertex = mLibrary.getFunction("lib3mf_meshobject_addvertex"); + lib3mf_meshobject_getvertices = mLibrary.getFunction("lib3mf_meshobject_getvertices"); + lib3mf_meshobject_gettriangle = mLibrary.getFunction("lib3mf_meshobject_gettriangle"); + lib3mf_meshobject_settriangle = mLibrary.getFunction("lib3mf_meshobject_settriangle"); + lib3mf_meshobject_addtriangle = mLibrary.getFunction("lib3mf_meshobject_addtriangle"); + lib3mf_meshobject_gettriangleindices = mLibrary.getFunction("lib3mf_meshobject_gettriangleindices"); + lib3mf_meshobject_setobjectlevelproperty = mLibrary.getFunction("lib3mf_meshobject_setobjectlevelproperty"); + lib3mf_meshobject_getobjectlevelproperty = mLibrary.getFunction("lib3mf_meshobject_getobjectlevelproperty"); + lib3mf_meshobject_settriangleproperties = mLibrary.getFunction("lib3mf_meshobject_settriangleproperties"); + lib3mf_meshobject_gettriangleproperties = mLibrary.getFunction("lib3mf_meshobject_gettriangleproperties"); + lib3mf_meshobject_setalltriangleproperties = mLibrary.getFunction("lib3mf_meshobject_setalltriangleproperties"); + lib3mf_meshobject_getalltriangleproperties = mLibrary.getFunction("lib3mf_meshobject_getalltriangleproperties"); + lib3mf_meshobject_clearallproperties = mLibrary.getFunction("lib3mf_meshobject_clearallproperties"); + lib3mf_meshobject_setgeometry = mLibrary.getFunction("lib3mf_meshobject_setgeometry"); + lib3mf_meshobject_ismanifoldandoriented = mLibrary.getFunction("lib3mf_meshobject_ismanifoldandoriented"); + lib3mf_meshobject_beamlattice = mLibrary.getFunction("lib3mf_meshobject_beamlattice"); + lib3mf_meshobject_getvolumedata = mLibrary.getFunction("lib3mf_meshobject_getvolumedata"); + lib3mf_meshobject_setvolumedata = mLibrary.getFunction("lib3mf_meshobject_setvolumedata"); + lib3mf_meshobject_addtriangleset = mLibrary.getFunction("lib3mf_meshobject_addtriangleset"); + lib3mf_meshobject_hastriangleset = mLibrary.getFunction("lib3mf_meshobject_hastriangleset"); + lib3mf_meshobject_findtriangleset = mLibrary.getFunction("lib3mf_meshobject_findtriangleset"); + lib3mf_meshobject_gettrianglesetcount = mLibrary.getFunction("lib3mf_meshobject_gettrianglesetcount"); + lib3mf_meshobject_gettriangleset = mLibrary.getFunction("lib3mf_meshobject_gettriangleset"); + lib3mf_levelset_getfunction = mLibrary.getFunction("lib3mf_levelset_getfunction"); + lib3mf_levelset_setfunction = mLibrary.getFunction("lib3mf_levelset_setfunction"); + lib3mf_levelset_gettransform = mLibrary.getFunction("lib3mf_levelset_gettransform"); + lib3mf_levelset_settransform = mLibrary.getFunction("lib3mf_levelset_settransform"); + lib3mf_levelset_getchannelname = mLibrary.getFunction("lib3mf_levelset_getchannelname"); + lib3mf_levelset_setchannelname = mLibrary.getFunction("lib3mf_levelset_setchannelname"); + lib3mf_levelset_setminfeaturesize = mLibrary.getFunction("lib3mf_levelset_setminfeaturesize"); + lib3mf_levelset_getminfeaturesize = mLibrary.getFunction("lib3mf_levelset_getminfeaturesize"); + lib3mf_levelset_setfallbackvalue = mLibrary.getFunction("lib3mf_levelset_setfallbackvalue"); + lib3mf_levelset_getfallbackvalue = mLibrary.getFunction("lib3mf_levelset_getfallbackvalue"); + lib3mf_levelset_setmeshbboxonly = mLibrary.getFunction("lib3mf_levelset_setmeshbboxonly"); + lib3mf_levelset_getmeshbboxonly = mLibrary.getFunction("lib3mf_levelset_getmeshbboxonly"); + lib3mf_levelset_setmesh = mLibrary.getFunction("lib3mf_levelset_setmesh"); + lib3mf_levelset_getmesh = mLibrary.getFunction("lib3mf_levelset_getmesh"); + lib3mf_levelset_getvolumedata = mLibrary.getFunction("lib3mf_levelset_getvolumedata"); + lib3mf_levelset_setvolumedata = mLibrary.getFunction("lib3mf_levelset_setvolumedata"); + lib3mf_booleanobject_setbaseobject = mLibrary.getFunction("lib3mf_booleanobject_setbaseobject"); + lib3mf_booleanobject_getbaseobject = mLibrary.getFunction("lib3mf_booleanobject_getbaseobject"); + lib3mf_booleanobject_setbasetransform = mLibrary.getFunction("lib3mf_booleanobject_setbasetransform"); + lib3mf_booleanobject_getbasetransform = mLibrary.getFunction("lib3mf_booleanobject_getbasetransform"); + lib3mf_booleanobject_setoperation = mLibrary.getFunction("lib3mf_booleanobject_setoperation"); + lib3mf_booleanobject_getoperation = mLibrary.getFunction("lib3mf_booleanobject_getoperation"); + lib3mf_booleanobject_setcsgmodeenabled = mLibrary.getFunction("lib3mf_booleanobject_setcsgmodeenabled"); + lib3mf_booleanobject_getcsgmodeenabled = mLibrary.getFunction("lib3mf_booleanobject_getcsgmodeenabled"); + lib3mf_booleanobject_setextractiongridresolution = mLibrary.getFunction("lib3mf_booleanobject_setextractiongridresolution"); + lib3mf_booleanobject_getextractiongridresolution = mLibrary.getFunction("lib3mf_booleanobject_getextractiongridresolution"); + lib3mf_booleanobject_getoperandcount = mLibrary.getFunction("lib3mf_booleanobject_getoperandcount"); + lib3mf_booleanobject_addoperand = mLibrary.getFunction("lib3mf_booleanobject_addoperand"); + lib3mf_booleanobject_getoperand = mLibrary.getFunction("lib3mf_booleanobject_getoperand"); + lib3mf_booleanobject_mergetomeshobject = mLibrary.getFunction("lib3mf_booleanobject_mergetomeshobject"); + lib3mf_beamlattice_getminlength = mLibrary.getFunction("lib3mf_beamlattice_getminlength"); + lib3mf_beamlattice_setminlength = mLibrary.getFunction("lib3mf_beamlattice_setminlength"); + lib3mf_beamlattice_getclipping = mLibrary.getFunction("lib3mf_beamlattice_getclipping"); + lib3mf_beamlattice_setclipping = mLibrary.getFunction("lib3mf_beamlattice_setclipping"); + lib3mf_beamlattice_getrepresentation = mLibrary.getFunction("lib3mf_beamlattice_getrepresentation"); + lib3mf_beamlattice_setrepresentation = mLibrary.getFunction("lib3mf_beamlattice_setrepresentation"); + lib3mf_beamlattice_getballoptions = mLibrary.getFunction("lib3mf_beamlattice_getballoptions"); + lib3mf_beamlattice_setballoptions = mLibrary.getFunction("lib3mf_beamlattice_setballoptions"); + lib3mf_beamlattice_getbeamcount = mLibrary.getFunction("lib3mf_beamlattice_getbeamcount"); + lib3mf_beamlattice_getbeam = mLibrary.getFunction("lib3mf_beamlattice_getbeam"); + lib3mf_beamlattice_addbeam = mLibrary.getFunction("lib3mf_beamlattice_addbeam"); + lib3mf_beamlattice_setbeam = mLibrary.getFunction("lib3mf_beamlattice_setbeam"); + lib3mf_beamlattice_setbeams = mLibrary.getFunction("lib3mf_beamlattice_setbeams"); + lib3mf_beamlattice_getbeams = mLibrary.getFunction("lib3mf_beamlattice_getbeams"); + lib3mf_beamlattice_getballcount = mLibrary.getFunction("lib3mf_beamlattice_getballcount"); + lib3mf_beamlattice_getball = mLibrary.getFunction("lib3mf_beamlattice_getball"); + lib3mf_beamlattice_addball = mLibrary.getFunction("lib3mf_beamlattice_addball"); + lib3mf_beamlattice_setball = mLibrary.getFunction("lib3mf_beamlattice_setball"); + lib3mf_beamlattice_setballs = mLibrary.getFunction("lib3mf_beamlattice_setballs"); + lib3mf_beamlattice_getballs = mLibrary.getFunction("lib3mf_beamlattice_getballs"); + lib3mf_beamlattice_getbeamsetcount = mLibrary.getFunction("lib3mf_beamlattice_getbeamsetcount"); + lib3mf_beamlattice_addbeamset = mLibrary.getFunction("lib3mf_beamlattice_addbeamset"); + lib3mf_beamlattice_getbeamset = mLibrary.getFunction("lib3mf_beamlattice_getbeamset"); + lib3mf_functionreference_getfunctionresourceid = mLibrary.getFunction("lib3mf_functionreference_getfunctionresourceid"); + lib3mf_functionreference_setfunctionresourceid = mLibrary.getFunction("lib3mf_functionreference_setfunctionresourceid"); + lib3mf_functionreference_gettransform = mLibrary.getFunction("lib3mf_functionreference_gettransform"); + lib3mf_functionreference_settransform = mLibrary.getFunction("lib3mf_functionreference_settransform"); + lib3mf_functionreference_getchannelname = mLibrary.getFunction("lib3mf_functionreference_getchannelname"); + lib3mf_functionreference_setchannelname = mLibrary.getFunction("lib3mf_functionreference_setchannelname"); + lib3mf_functionreference_setminfeaturesize = mLibrary.getFunction("lib3mf_functionreference_setminfeaturesize"); + lib3mf_functionreference_getminfeaturesize = mLibrary.getFunction("lib3mf_functionreference_getminfeaturesize"); + lib3mf_functionreference_setfallbackvalue = mLibrary.getFunction("lib3mf_functionreference_setfallbackvalue"); + lib3mf_functionreference_getfallbackvalue = mLibrary.getFunction("lib3mf_functionreference_getfallbackvalue"); + lib3mf_volumedatacomposite_getbasematerialgroup = mLibrary.getFunction("lib3mf_volumedatacomposite_getbasematerialgroup"); + lib3mf_volumedatacomposite_setbasematerialgroup = mLibrary.getFunction("lib3mf_volumedatacomposite_setbasematerialgroup"); + lib3mf_volumedatacomposite_getmaterialmappingcount = mLibrary.getFunction("lib3mf_volumedatacomposite_getmaterialmappingcount"); + lib3mf_volumedatacomposite_getmaterialmapping = mLibrary.getFunction("lib3mf_volumedatacomposite_getmaterialmapping"); + lib3mf_volumedatacomposite_addmaterialmapping = mLibrary.getFunction("lib3mf_volumedatacomposite_addmaterialmapping"); + lib3mf_volumedatacomposite_removematerialmapping = mLibrary.getFunction("lib3mf_volumedatacomposite_removematerialmapping"); + lib3mf_volumedataproperty_getname = mLibrary.getFunction("lib3mf_volumedataproperty_getname"); + lib3mf_volumedataproperty_setisrequired = mLibrary.getFunction("lib3mf_volumedataproperty_setisrequired"); + lib3mf_volumedataproperty_isrequired = mLibrary.getFunction("lib3mf_volumedataproperty_isrequired"); + lib3mf_volumedata_getcomposite = mLibrary.getFunction("lib3mf_volumedata_getcomposite"); + lib3mf_volumedata_createnewcomposite = mLibrary.getFunction("lib3mf_volumedata_createnewcomposite"); + lib3mf_volumedata_removecomposite = mLibrary.getFunction("lib3mf_volumedata_removecomposite"); + lib3mf_volumedata_getcolor = mLibrary.getFunction("lib3mf_volumedata_getcolor"); + lib3mf_volumedata_createnewcolor = mLibrary.getFunction("lib3mf_volumedata_createnewcolor"); + lib3mf_volumedata_removecolor = mLibrary.getFunction("lib3mf_volumedata_removecolor"); + lib3mf_volumedata_getpropertycount = mLibrary.getFunction("lib3mf_volumedata_getpropertycount"); + lib3mf_volumedata_getproperty = mLibrary.getFunction("lib3mf_volumedata_getproperty"); + lib3mf_volumedata_addpropertyfromfunction = mLibrary.getFunction("lib3mf_volumedata_addpropertyfromfunction"); + lib3mf_volumedata_removeproperty = mLibrary.getFunction("lib3mf_volumedata_removeproperty"); + lib3mf_component_getobjectresource = mLibrary.getFunction("lib3mf_component_getobjectresource"); + lib3mf_component_getobjectresourceid = mLibrary.getFunction("lib3mf_component_getobjectresourceid"); + lib3mf_component_getuuid = mLibrary.getFunction("lib3mf_component_getuuid"); + lib3mf_component_setuuid = mLibrary.getFunction("lib3mf_component_setuuid"); + lib3mf_component_hastransform = mLibrary.getFunction("lib3mf_component_hastransform"); + lib3mf_component_gettransform = mLibrary.getFunction("lib3mf_component_gettransform"); + lib3mf_component_settransform = mLibrary.getFunction("lib3mf_component_settransform"); + lib3mf_componentsobject_addcomponent = mLibrary.getFunction("lib3mf_componentsobject_addcomponent"); + lib3mf_componentsobject_getcomponent = mLibrary.getFunction("lib3mf_componentsobject_getcomponent"); + lib3mf_componentsobject_getcomponentcount = mLibrary.getFunction("lib3mf_componentsobject_getcomponentcount"); + lib3mf_beamset_setname = mLibrary.getFunction("lib3mf_beamset_setname"); + lib3mf_beamset_getname = mLibrary.getFunction("lib3mf_beamset_getname"); + lib3mf_beamset_setidentifier = mLibrary.getFunction("lib3mf_beamset_setidentifier"); + lib3mf_beamset_getidentifier = mLibrary.getFunction("lib3mf_beamset_getidentifier"); + lib3mf_beamset_getreferencecount = mLibrary.getFunction("lib3mf_beamset_getreferencecount"); + lib3mf_beamset_setreferences = mLibrary.getFunction("lib3mf_beamset_setreferences"); + lib3mf_beamset_getreferences = mLibrary.getFunction("lib3mf_beamset_getreferences"); + lib3mf_beamset_getballreferencecount = mLibrary.getFunction("lib3mf_beamset_getballreferencecount"); + lib3mf_beamset_setballreferences = mLibrary.getFunction("lib3mf_beamset_setballreferences"); + lib3mf_beamset_getballreferences = mLibrary.getFunction("lib3mf_beamset_getballreferences"); + lib3mf_basematerialgroup_getcount = mLibrary.getFunction("lib3mf_basematerialgroup_getcount"); + lib3mf_basematerialgroup_getallpropertyids = mLibrary.getFunction("lib3mf_basematerialgroup_getallpropertyids"); + lib3mf_basematerialgroup_addmaterial = mLibrary.getFunction("lib3mf_basematerialgroup_addmaterial"); + lib3mf_basematerialgroup_removematerial = mLibrary.getFunction("lib3mf_basematerialgroup_removematerial"); + lib3mf_basematerialgroup_getname = mLibrary.getFunction("lib3mf_basematerialgroup_getname"); + lib3mf_basematerialgroup_setname = mLibrary.getFunction("lib3mf_basematerialgroup_setname"); + lib3mf_basematerialgroup_setdisplaycolor = mLibrary.getFunction("lib3mf_basematerialgroup_setdisplaycolor"); + lib3mf_basematerialgroup_getdisplaycolor = mLibrary.getFunction("lib3mf_basematerialgroup_getdisplaycolor"); + lib3mf_colorgroup_getcount = mLibrary.getFunction("lib3mf_colorgroup_getcount"); + lib3mf_colorgroup_getallpropertyids = mLibrary.getFunction("lib3mf_colorgroup_getallpropertyids"); + lib3mf_colorgroup_addcolor = mLibrary.getFunction("lib3mf_colorgroup_addcolor"); + lib3mf_colorgroup_removecolor = mLibrary.getFunction("lib3mf_colorgroup_removecolor"); + lib3mf_colorgroup_setcolor = mLibrary.getFunction("lib3mf_colorgroup_setcolor"); + lib3mf_colorgroup_getcolor = mLibrary.getFunction("lib3mf_colorgroup_getcolor"); + lib3mf_texture2dgroup_getcount = mLibrary.getFunction("lib3mf_texture2dgroup_getcount"); + lib3mf_texture2dgroup_getallpropertyids = mLibrary.getFunction("lib3mf_texture2dgroup_getallpropertyids"); + lib3mf_texture2dgroup_addtex2coord = mLibrary.getFunction("lib3mf_texture2dgroup_addtex2coord"); + lib3mf_texture2dgroup_gettex2coord = mLibrary.getFunction("lib3mf_texture2dgroup_gettex2coord"); + lib3mf_texture2dgroup_removetex2coord = mLibrary.getFunction("lib3mf_texture2dgroup_removetex2coord"); + lib3mf_texture2dgroup_gettexture2d = mLibrary.getFunction("lib3mf_texture2dgroup_gettexture2d"); + lib3mf_compositematerials_getcount = mLibrary.getFunction("lib3mf_compositematerials_getcount"); + lib3mf_compositematerials_getallpropertyids = mLibrary.getFunction("lib3mf_compositematerials_getallpropertyids"); + lib3mf_compositematerials_getbasematerialgroup = mLibrary.getFunction("lib3mf_compositematerials_getbasematerialgroup"); + lib3mf_compositematerials_addcomposite = mLibrary.getFunction("lib3mf_compositematerials_addcomposite"); + lib3mf_compositematerials_removecomposite = mLibrary.getFunction("lib3mf_compositematerials_removecomposite"); + lib3mf_compositematerials_getcomposite = mLibrary.getFunction("lib3mf_compositematerials_getcomposite"); + lib3mf_multipropertygroup_getcount = mLibrary.getFunction("lib3mf_multipropertygroup_getcount"); + lib3mf_multipropertygroup_getallpropertyids = mLibrary.getFunction("lib3mf_multipropertygroup_getallpropertyids"); + lib3mf_multipropertygroup_addmultiproperty = mLibrary.getFunction("lib3mf_multipropertygroup_addmultiproperty"); + lib3mf_multipropertygroup_setmultiproperty = mLibrary.getFunction("lib3mf_multipropertygroup_setmultiproperty"); + lib3mf_multipropertygroup_getmultiproperty = mLibrary.getFunction("lib3mf_multipropertygroup_getmultiproperty"); + lib3mf_multipropertygroup_removemultiproperty = mLibrary.getFunction("lib3mf_multipropertygroup_removemultiproperty"); + lib3mf_multipropertygroup_getlayercount = mLibrary.getFunction("lib3mf_multipropertygroup_getlayercount"); + lib3mf_multipropertygroup_addlayer = mLibrary.getFunction("lib3mf_multipropertygroup_addlayer"); + lib3mf_multipropertygroup_getlayer = mLibrary.getFunction("lib3mf_multipropertygroup_getlayer"); + lib3mf_multipropertygroup_removelayer = mLibrary.getFunction("lib3mf_multipropertygroup_removelayer"); + lib3mf_image3d_getname = mLibrary.getFunction("lib3mf_image3d_getname"); + lib3mf_image3d_setname = mLibrary.getFunction("lib3mf_image3d_setname"); + lib3mf_image3d_isimagestack = mLibrary.getFunction("lib3mf_image3d_isimagestack"); + lib3mf_imagestack_getrowcount = mLibrary.getFunction("lib3mf_imagestack_getrowcount"); + lib3mf_imagestack_setrowcount = mLibrary.getFunction("lib3mf_imagestack_setrowcount"); + lib3mf_imagestack_getcolumncount = mLibrary.getFunction("lib3mf_imagestack_getcolumncount"); + lib3mf_imagestack_setcolumncount = mLibrary.getFunction("lib3mf_imagestack_setcolumncount"); + lib3mf_imagestack_getsheetcount = mLibrary.getFunction("lib3mf_imagestack_getsheetcount"); + lib3mf_imagestack_getsheet = mLibrary.getFunction("lib3mf_imagestack_getsheet"); + lib3mf_imagestack_setsheet = mLibrary.getFunction("lib3mf_imagestack_setsheet"); + lib3mf_imagestack_createemptysheet = mLibrary.getFunction("lib3mf_imagestack_createemptysheet"); + lib3mf_imagestack_createsheetfrombuffer = mLibrary.getFunction("lib3mf_imagestack_createsheetfrombuffer"); + lib3mf_imagestack_createsheetfromfile = mLibrary.getFunction("lib3mf_imagestack_createsheetfromfile"); + lib3mf_attachment_getpath = mLibrary.getFunction("lib3mf_attachment_getpath"); + lib3mf_attachment_setpath = mLibrary.getFunction("lib3mf_attachment_setpath"); + lib3mf_attachment_packagepart = mLibrary.getFunction("lib3mf_attachment_packagepart"); + lib3mf_attachment_getrelationshiptype = mLibrary.getFunction("lib3mf_attachment_getrelationshiptype"); + lib3mf_attachment_setrelationshiptype = mLibrary.getFunction("lib3mf_attachment_setrelationshiptype"); + lib3mf_attachment_writetofile = mLibrary.getFunction("lib3mf_attachment_writetofile"); + lib3mf_attachment_readfromfile = mLibrary.getFunction("lib3mf_attachment_readfromfile"); + lib3mf_attachment_readfromcallback = mLibrary.getFunction("lib3mf_attachment_readfromcallback"); + lib3mf_attachment_getstreamsize = mLibrary.getFunction("lib3mf_attachment_getstreamsize"); + lib3mf_attachment_writetobuffer = mLibrary.getFunction("lib3mf_attachment_writetobuffer"); + lib3mf_attachment_readfrombuffer = mLibrary.getFunction("lib3mf_attachment_readfrombuffer"); + lib3mf_texture2d_getattachment = mLibrary.getFunction("lib3mf_texture2d_getattachment"); + lib3mf_texture2d_setattachment = mLibrary.getFunction("lib3mf_texture2d_setattachment"); + lib3mf_texture2d_getcontenttype = mLibrary.getFunction("lib3mf_texture2d_getcontenttype"); + lib3mf_texture2d_setcontenttype = mLibrary.getFunction("lib3mf_texture2d_setcontenttype"); + lib3mf_texture2d_gettilestyleuv = mLibrary.getFunction("lib3mf_texture2d_gettilestyleuv"); + lib3mf_texture2d_settilestyleuv = mLibrary.getFunction("lib3mf_texture2d_settilestyleuv"); + lib3mf_texture2d_getfilter = mLibrary.getFunction("lib3mf_texture2d_getfilter"); + lib3mf_texture2d_setfilter = mLibrary.getFunction("lib3mf_texture2d_setfilter"); + lib3mf_implicitport_getidentifier = mLibrary.getFunction("lib3mf_implicitport_getidentifier"); + lib3mf_implicitport_setidentifier = mLibrary.getFunction("lib3mf_implicitport_setidentifier"); + lib3mf_implicitport_getdisplayname = mLibrary.getFunction("lib3mf_implicitport_getdisplayname"); + lib3mf_implicitport_setdisplayname = mLibrary.getFunction("lib3mf_implicitport_setdisplayname"); + lib3mf_implicitport_settype = mLibrary.getFunction("lib3mf_implicitport_settype"); + lib3mf_implicitport_gettype = mLibrary.getFunction("lib3mf_implicitport_gettype"); + lib3mf_implicitport_getreference = mLibrary.getFunction("lib3mf_implicitport_getreference"); + lib3mf_implicitport_setreference = mLibrary.getFunction("lib3mf_implicitport_setreference"); + lib3mf_iterator_movenext = mLibrary.getFunction("lib3mf_iterator_movenext"); + lib3mf_iterator_moveprevious = mLibrary.getFunction("lib3mf_iterator_moveprevious"); + lib3mf_iterator_count = mLibrary.getFunction("lib3mf_iterator_count"); + lib3mf_implicitportiterator_getcurrent = mLibrary.getFunction("lib3mf_implicitportiterator_getcurrent"); + lib3mf_implicitnode_getidentifier = mLibrary.getFunction("lib3mf_implicitnode_getidentifier"); + lib3mf_implicitnode_setidentifier = mLibrary.getFunction("lib3mf_implicitnode_setidentifier"); + lib3mf_implicitnode_getdisplayname = mLibrary.getFunction("lib3mf_implicitnode_getdisplayname"); + lib3mf_implicitnode_setdisplayname = mLibrary.getFunction("lib3mf_implicitnode_setdisplayname"); + lib3mf_implicitnode_gettag = mLibrary.getFunction("lib3mf_implicitnode_gettag"); + lib3mf_implicitnode_settag = mLibrary.getFunction("lib3mf_implicitnode_settag"); + lib3mf_implicitnode_getnodetype = mLibrary.getFunction("lib3mf_implicitnode_getnodetype"); + lib3mf_implicitnode_addinput = mLibrary.getFunction("lib3mf_implicitnode_addinput"); + lib3mf_implicitnode_getinputs = mLibrary.getFunction("lib3mf_implicitnode_getinputs"); + lib3mf_implicitnode_addoutput = mLibrary.getFunction("lib3mf_implicitnode_addoutput"); + lib3mf_implicitnode_getoutputs = mLibrary.getFunction("lib3mf_implicitnode_getoutputs"); + lib3mf_implicitnode_findinput = mLibrary.getFunction("lib3mf_implicitnode_findinput"); + lib3mf_implicitnode_findoutput = mLibrary.getFunction("lib3mf_implicitnode_findoutput"); + lib3mf_implicitnode_aretypesvalid = mLibrary.getFunction("lib3mf_implicitnode_aretypesvalid"); + lib3mf_oneinputnode_getinputa = mLibrary.getFunction("lib3mf_oneinputnode_getinputa"); + lib3mf_oneinputnode_getoutputresult = mLibrary.getFunction("lib3mf_oneinputnode_getoutputresult"); + lib3mf_resourceidnode_setresource = mLibrary.getFunction("lib3mf_resourceidnode_setresource"); + lib3mf_resourceidnode_getresource = mLibrary.getFunction("lib3mf_resourceidnode_getresource"); + lib3mf_resourceidnode_getoutputvalue = mLibrary.getFunction("lib3mf_resourceidnode_getoutputvalue"); + lib3mf_twoinputnode_getinputb = mLibrary.getFunction("lib3mf_twoinputnode_getinputb"); + lib3mf_selectnode_getinputb = mLibrary.getFunction("lib3mf_selectnode_getinputb"); + lib3mf_selectnode_getinputc = mLibrary.getFunction("lib3mf_selectnode_getinputc"); + lib3mf_selectnode_getinputd = mLibrary.getFunction("lib3mf_selectnode_getinputd"); + lib3mf_clampnode_getinputmin = mLibrary.getFunction("lib3mf_clampnode_getinputmin"); + lib3mf_clampnode_getinputmax = mLibrary.getFunction("lib3mf_clampnode_getinputmax"); + lib3mf_composevectornode_getinputx = mLibrary.getFunction("lib3mf_composevectornode_getinputx"); + lib3mf_composevectornode_getinputy = mLibrary.getFunction("lib3mf_composevectornode_getinputy"); + lib3mf_composevectornode_getinputz = mLibrary.getFunction("lib3mf_composevectornode_getinputz"); + lib3mf_composevectornode_getoutputresult = mLibrary.getFunction("lib3mf_composevectornode_getoutputresult"); + lib3mf_decomposevectornode_getinputa = mLibrary.getFunction("lib3mf_decomposevectornode_getinputa"); + lib3mf_decomposevectornode_getoutputx = mLibrary.getFunction("lib3mf_decomposevectornode_getoutputx"); + lib3mf_decomposevectornode_getoutputy = mLibrary.getFunction("lib3mf_decomposevectornode_getoutputy"); + lib3mf_decomposevectornode_getoutputz = mLibrary.getFunction("lib3mf_decomposevectornode_getoutputz"); + lib3mf_composematrixnode_getinputm00 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm00"); + lib3mf_composematrixnode_getinputm01 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm01"); + lib3mf_composematrixnode_getinputm02 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm02"); + lib3mf_composematrixnode_getinputm03 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm03"); + lib3mf_composematrixnode_getinputm10 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm10"); + lib3mf_composematrixnode_getinputm11 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm11"); + lib3mf_composematrixnode_getinputm12 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm12"); + lib3mf_composematrixnode_getinputm13 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm13"); + lib3mf_composematrixnode_getinputm20 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm20"); + lib3mf_composematrixnode_getinputm21 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm21"); + lib3mf_composematrixnode_getinputm22 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm22"); + lib3mf_composematrixnode_getinputm23 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm23"); + lib3mf_composematrixnode_getinputm30 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm30"); + lib3mf_composematrixnode_getinputm31 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm31"); + lib3mf_composematrixnode_getinputm32 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm32"); + lib3mf_composematrixnode_getinputm33 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm33"); + lib3mf_composematrixnode_getoutputresult = mLibrary.getFunction("lib3mf_composematrixnode_getoutputresult"); + lib3mf_matrixfromrowsnode_getinputa = mLibrary.getFunction("lib3mf_matrixfromrowsnode_getinputa"); + lib3mf_matrixfromrowsnode_getinputb = mLibrary.getFunction("lib3mf_matrixfromrowsnode_getinputb"); + lib3mf_matrixfromrowsnode_getinputc = mLibrary.getFunction("lib3mf_matrixfromrowsnode_getinputc"); + lib3mf_matrixfromrowsnode_getinputd = mLibrary.getFunction("lib3mf_matrixfromrowsnode_getinputd"); + lib3mf_matrixfromrowsnode_getoutputresult = mLibrary.getFunction("lib3mf_matrixfromrowsnode_getoutputresult"); + lib3mf_matrixfromcolumnsnode_getinputa = mLibrary.getFunction("lib3mf_matrixfromcolumnsnode_getinputa"); + lib3mf_matrixfromcolumnsnode_getinputb = mLibrary.getFunction("lib3mf_matrixfromcolumnsnode_getinputb"); + lib3mf_matrixfromcolumnsnode_getinputc = mLibrary.getFunction("lib3mf_matrixfromcolumnsnode_getinputc"); + lib3mf_matrixfromcolumnsnode_getinputd = mLibrary.getFunction("lib3mf_matrixfromcolumnsnode_getinputd"); + lib3mf_matrixfromcolumnsnode_getoutputresult = mLibrary.getFunction("lib3mf_matrixfromcolumnsnode_getoutputresult"); + lib3mf_constantnode_setconstant = mLibrary.getFunction("lib3mf_constantnode_setconstant"); + lib3mf_constantnode_getconstant = mLibrary.getFunction("lib3mf_constantnode_getconstant"); + lib3mf_constantnode_getoutputvalue = mLibrary.getFunction("lib3mf_constantnode_getoutputvalue"); + lib3mf_constvecnode_setvector = mLibrary.getFunction("lib3mf_constvecnode_setvector"); + lib3mf_constvecnode_getvector = mLibrary.getFunction("lib3mf_constvecnode_getvector"); + lib3mf_constvecnode_getoutputvector = mLibrary.getFunction("lib3mf_constvecnode_getoutputvector"); + lib3mf_constmatnode_setmatrix = mLibrary.getFunction("lib3mf_constmatnode_setmatrix"); + lib3mf_constmatnode_getmatrix = mLibrary.getFunction("lib3mf_constmatnode_getmatrix"); + lib3mf_constmatnode_getoutputmatrix = mLibrary.getFunction("lib3mf_constmatnode_getoutputmatrix"); + lib3mf_meshnode_getinputmesh = mLibrary.getFunction("lib3mf_meshnode_getinputmesh"); + lib3mf_meshnode_getinputpos = mLibrary.getFunction("lib3mf_meshnode_getinputpos"); + lib3mf_meshnode_getoutputdistance = mLibrary.getFunction("lib3mf_meshnode_getoutputdistance"); + lib3mf_unsignedmeshnode_getinputmesh = mLibrary.getFunction("lib3mf_unsignedmeshnode_getinputmesh"); + lib3mf_unsignedmeshnode_getinputpos = mLibrary.getFunction("lib3mf_unsignedmeshnode_getinputpos"); + lib3mf_unsignedmeshnode_getoutputdistance = mLibrary.getFunction("lib3mf_unsignedmeshnode_getoutputdistance"); + lib3mf_beamlatticenode_getinputbeamlattice = mLibrary.getFunction("lib3mf_beamlatticenode_getinputbeamlattice"); + lib3mf_beamlatticenode_getinputpos = mLibrary.getFunction("lib3mf_beamlatticenode_getinputpos"); + lib3mf_beamlatticenode_getoutputdistance = mLibrary.getFunction("lib3mf_beamlatticenode_getoutputdistance"); + lib3mf_beamlatticenode_setaccuraterange = mLibrary.getFunction("lib3mf_beamlatticenode_setaccuraterange"); + lib3mf_beamlatticenode_getaccuraterange = mLibrary.getFunction("lib3mf_beamlatticenode_getaccuraterange"); + lib3mf_functiongradientnode_getinputfunctionid = mLibrary.getFunction("lib3mf_functiongradientnode_getinputfunctionid"); + lib3mf_functiongradientnode_getinputpos = mLibrary.getFunction("lib3mf_functiongradientnode_getinputpos"); + lib3mf_functiongradientnode_getinputstep = mLibrary.getFunction("lib3mf_functiongradientnode_getinputstep"); + lib3mf_functiongradientnode_setscalaroutputname = mLibrary.getFunction("lib3mf_functiongradientnode_setscalaroutputname"); + lib3mf_functiongradientnode_getscalaroutputname = mLibrary.getFunction("lib3mf_functiongradientnode_getscalaroutputname"); + lib3mf_functiongradientnode_setvectorinputname = mLibrary.getFunction("lib3mf_functiongradientnode_setvectorinputname"); + lib3mf_functiongradientnode_getvectorinputname = mLibrary.getFunction("lib3mf_functiongradientnode_getvectorinputname"); + lib3mf_functiongradientnode_getoutputnormalizedgradient = mLibrary.getFunction("lib3mf_functiongradientnode_getoutputnormalizedgradient"); + lib3mf_functiongradientnode_getoutputgradient = mLibrary.getFunction("lib3mf_functiongradientnode_getoutputgradient"); + lib3mf_functiongradientnode_getoutputmagnitude = mLibrary.getFunction("lib3mf_functiongradientnode_getoutputmagnitude"); + lib3mf_normalizedistancenode_getinputfunctionid = mLibrary.getFunction("lib3mf_normalizedistancenode_getinputfunctionid"); + lib3mf_normalizedistancenode_getinputpos = mLibrary.getFunction("lib3mf_normalizedistancenode_getinputpos"); + lib3mf_normalizedistancenode_getinputstep = mLibrary.getFunction("lib3mf_normalizedistancenode_getinputstep"); + lib3mf_normalizedistancenode_setscalaroutputname = mLibrary.getFunction("lib3mf_normalizedistancenode_setscalaroutputname"); + lib3mf_normalizedistancenode_getscalaroutputname = mLibrary.getFunction("lib3mf_normalizedistancenode_getscalaroutputname"); + lib3mf_normalizedistancenode_setvectorinputname = mLibrary.getFunction("lib3mf_normalizedistancenode_setvectorinputname"); + lib3mf_normalizedistancenode_getvectorinputname = mLibrary.getFunction("lib3mf_normalizedistancenode_getvectorinputname"); + lib3mf_normalizedistancenode_getoutputresult = mLibrary.getFunction("lib3mf_normalizedistancenode_getoutputresult"); + lib3mf_functioncallnode_getinputfunctionid = mLibrary.getFunction("lib3mf_functioncallnode_getinputfunctionid"); + lib3mf_nodeiterator_getcurrent = mLibrary.getFunction("lib3mf_nodeiterator_getcurrent"); + lib3mf_function_getdisplayname = mLibrary.getFunction("lib3mf_function_getdisplayname"); + lib3mf_function_setdisplayname = mLibrary.getFunction("lib3mf_function_setdisplayname"); + lib3mf_function_addinput = mLibrary.getFunction("lib3mf_function_addinput"); + lib3mf_function_getinputs = mLibrary.getFunction("lib3mf_function_getinputs"); + lib3mf_function_removeinput = mLibrary.getFunction("lib3mf_function_removeinput"); + lib3mf_function_addoutput = mLibrary.getFunction("lib3mf_function_addoutput"); + lib3mf_function_getoutputs = mLibrary.getFunction("lib3mf_function_getoutputs"); + lib3mf_function_removeoutput = mLibrary.getFunction("lib3mf_function_removeoutput"); + lib3mf_function_findinput = mLibrary.getFunction("lib3mf_function_findinput"); + lib3mf_function_findoutput = mLibrary.getFunction("lib3mf_function_findoutput"); + lib3mf_implicitfunction_getidentifier = mLibrary.getFunction("lib3mf_implicitfunction_getidentifier"); + lib3mf_implicitfunction_setidentifier = mLibrary.getFunction("lib3mf_implicitfunction_setidentifier"); + lib3mf_implicitfunction_addnode = mLibrary.getFunction("lib3mf_implicitfunction_addnode"); + lib3mf_implicitfunction_addsinnode = mLibrary.getFunction("lib3mf_implicitfunction_addsinnode"); + lib3mf_implicitfunction_addcosnode = mLibrary.getFunction("lib3mf_implicitfunction_addcosnode"); + lib3mf_implicitfunction_addtannode = mLibrary.getFunction("lib3mf_implicitfunction_addtannode"); + lib3mf_implicitfunction_addarcsinnode = mLibrary.getFunction("lib3mf_implicitfunction_addarcsinnode"); + lib3mf_implicitfunction_addarccosnode = mLibrary.getFunction("lib3mf_implicitfunction_addarccosnode"); + lib3mf_implicitfunction_addarctan2node = mLibrary.getFunction("lib3mf_implicitfunction_addarctan2node"); + lib3mf_implicitfunction_addsinhnode = mLibrary.getFunction("lib3mf_implicitfunction_addsinhnode"); + lib3mf_implicitfunction_addcoshnode = mLibrary.getFunction("lib3mf_implicitfunction_addcoshnode"); + lib3mf_implicitfunction_addtanhnode = mLibrary.getFunction("lib3mf_implicitfunction_addtanhnode"); + lib3mf_implicitfunction_addroundnode = mLibrary.getFunction("lib3mf_implicitfunction_addroundnode"); + lib3mf_implicitfunction_addceilnode = mLibrary.getFunction("lib3mf_implicitfunction_addceilnode"); + lib3mf_implicitfunction_addfloornode = mLibrary.getFunction("lib3mf_implicitfunction_addfloornode"); + lib3mf_implicitfunction_addsignnode = mLibrary.getFunction("lib3mf_implicitfunction_addsignnode"); + lib3mf_implicitfunction_addfractnode = mLibrary.getFunction("lib3mf_implicitfunction_addfractnode"); + lib3mf_implicitfunction_addabsnode = mLibrary.getFunction("lib3mf_implicitfunction_addabsnode"); + lib3mf_implicitfunction_addexpnode = mLibrary.getFunction("lib3mf_implicitfunction_addexpnode"); + lib3mf_implicitfunction_addlognode = mLibrary.getFunction("lib3mf_implicitfunction_addlognode"); + lib3mf_implicitfunction_addlog2node = mLibrary.getFunction("lib3mf_implicitfunction_addlog2node"); + lib3mf_implicitfunction_addlog10node = mLibrary.getFunction("lib3mf_implicitfunction_addlog10node"); + lib3mf_implicitfunction_addlengthnode = mLibrary.getFunction("lib3mf_implicitfunction_addlengthnode"); + lib3mf_implicitfunction_addtransposenode = mLibrary.getFunction("lib3mf_implicitfunction_addtransposenode"); + lib3mf_implicitfunction_addinversenode = mLibrary.getFunction("lib3mf_implicitfunction_addinversenode"); + lib3mf_implicitfunction_addsqrtnode = mLibrary.getFunction("lib3mf_implicitfunction_addsqrtnode"); + lib3mf_implicitfunction_addresourceidnode = mLibrary.getFunction("lib3mf_implicitfunction_addresourceidnode"); + lib3mf_implicitfunction_addadditionnode = mLibrary.getFunction("lib3mf_implicitfunction_addadditionnode"); + lib3mf_implicitfunction_addsubtractionnode = mLibrary.getFunction("lib3mf_implicitfunction_addsubtractionnode"); + lib3mf_implicitfunction_addmultiplicationnode = mLibrary.getFunction("lib3mf_implicitfunction_addmultiplicationnode"); + lib3mf_implicitfunction_adddivisionnode = mLibrary.getFunction("lib3mf_implicitfunction_adddivisionnode"); + lib3mf_implicitfunction_adddotnode = mLibrary.getFunction("lib3mf_implicitfunction_adddotnode"); + lib3mf_implicitfunction_addcrossnode = mLibrary.getFunction("lib3mf_implicitfunction_addcrossnode"); + lib3mf_implicitfunction_addmatvecmultiplicationnode = mLibrary.getFunction("lib3mf_implicitfunction_addmatvecmultiplicationnode"); + lib3mf_implicitfunction_addminnode = mLibrary.getFunction("lib3mf_implicitfunction_addminnode"); + lib3mf_implicitfunction_addmaxnode = mLibrary.getFunction("lib3mf_implicitfunction_addmaxnode"); + lib3mf_implicitfunction_addfmodnode = mLibrary.getFunction("lib3mf_implicitfunction_addfmodnode"); + lib3mf_implicitfunction_addpownode = mLibrary.getFunction("lib3mf_implicitfunction_addpownode"); + lib3mf_implicitfunction_addselectnode = mLibrary.getFunction("lib3mf_implicitfunction_addselectnode"); + lib3mf_implicitfunction_addclampnode = mLibrary.getFunction("lib3mf_implicitfunction_addclampnode"); + lib3mf_implicitfunction_addcomposevectornode = mLibrary.getFunction("lib3mf_implicitfunction_addcomposevectornode"); + lib3mf_implicitfunction_addvectorfromscalarnode = mLibrary.getFunction("lib3mf_implicitfunction_addvectorfromscalarnode"); + lib3mf_implicitfunction_adddecomposevectornode = mLibrary.getFunction("lib3mf_implicitfunction_adddecomposevectornode"); + lib3mf_implicitfunction_addcomposematrixnode = mLibrary.getFunction("lib3mf_implicitfunction_addcomposematrixnode"); + lib3mf_implicitfunction_addmatrixfromrowsnode = mLibrary.getFunction("lib3mf_implicitfunction_addmatrixfromrowsnode"); + lib3mf_implicitfunction_addmatrixfromcolumnsnode = mLibrary.getFunction("lib3mf_implicitfunction_addmatrixfromcolumnsnode"); + lib3mf_implicitfunction_addconstantnode = mLibrary.getFunction("lib3mf_implicitfunction_addconstantnode"); + lib3mf_implicitfunction_addconstvecnode = mLibrary.getFunction("lib3mf_implicitfunction_addconstvecnode"); + lib3mf_implicitfunction_addconstmatnode = mLibrary.getFunction("lib3mf_implicitfunction_addconstmatnode"); + lib3mf_implicitfunction_addmeshnode = mLibrary.getFunction("lib3mf_implicitfunction_addmeshnode"); + lib3mf_implicitfunction_addunsignedmeshnode = mLibrary.getFunction("lib3mf_implicitfunction_addunsignedmeshnode"); + lib3mf_implicitfunction_addbeamlatticenode = mLibrary.getFunction("lib3mf_implicitfunction_addbeamlatticenode"); + lib3mf_implicitfunction_addfunctiongradientnode = mLibrary.getFunction("lib3mf_implicitfunction_addfunctiongradientnode"); + lib3mf_implicitfunction_addnormalizedistancenode = mLibrary.getFunction("lib3mf_implicitfunction_addnormalizedistancenode"); + lib3mf_implicitfunction_addfunctioncallnode = mLibrary.getFunction("lib3mf_implicitfunction_addfunctioncallnode"); + lib3mf_implicitfunction_getnodes = mLibrary.getFunction("lib3mf_implicitfunction_getnodes"); + lib3mf_implicitfunction_removenode = mLibrary.getFunction("lib3mf_implicitfunction_removenode"); + lib3mf_implicitfunction_addlink = mLibrary.getFunction("lib3mf_implicitfunction_addlink"); + lib3mf_implicitfunction_addlinkbynames = mLibrary.getFunction("lib3mf_implicitfunction_addlinkbynames"); + lib3mf_implicitfunction_clear = mLibrary.getFunction("lib3mf_implicitfunction_clear"); + lib3mf_implicitfunction_sortnodestopologically = mLibrary.getFunction("lib3mf_implicitfunction_sortnodestopologically"); + lib3mf_functionfromimage3d_getimage3d = mLibrary.getFunction("lib3mf_functionfromimage3d_getimage3d"); + lib3mf_functionfromimage3d_setimage3d = mLibrary.getFunction("lib3mf_functionfromimage3d_setimage3d"); + lib3mf_functionfromimage3d_setfilter = mLibrary.getFunction("lib3mf_functionfromimage3d_setfilter"); + lib3mf_functionfromimage3d_getfilter = mLibrary.getFunction("lib3mf_functionfromimage3d_getfilter"); + lib3mf_functionfromimage3d_settilestyles = mLibrary.getFunction("lib3mf_functionfromimage3d_settilestyles"); + lib3mf_functionfromimage3d_gettilestyles = mLibrary.getFunction("lib3mf_functionfromimage3d_gettilestyles"); + lib3mf_functionfromimage3d_getoffset = mLibrary.getFunction("lib3mf_functionfromimage3d_getoffset"); + lib3mf_functionfromimage3d_setoffset = mLibrary.getFunction("lib3mf_functionfromimage3d_setoffset"); + lib3mf_functionfromimage3d_getscale = mLibrary.getFunction("lib3mf_functionfromimage3d_getscale"); + lib3mf_functionfromimage3d_setscale = mLibrary.getFunction("lib3mf_functionfromimage3d_setscale"); + lib3mf_builditem_getobjectresource = mLibrary.getFunction("lib3mf_builditem_getobjectresource"); + lib3mf_builditem_getuuid = mLibrary.getFunction("lib3mf_builditem_getuuid"); + lib3mf_builditem_setuuid = mLibrary.getFunction("lib3mf_builditem_setuuid"); + lib3mf_builditem_getobjectresourceid = mLibrary.getFunction("lib3mf_builditem_getobjectresourceid"); + lib3mf_builditem_hasobjecttransform = mLibrary.getFunction("lib3mf_builditem_hasobjecttransform"); + lib3mf_builditem_getobjecttransform = mLibrary.getFunction("lib3mf_builditem_getobjecttransform"); + lib3mf_builditem_setobjecttransform = mLibrary.getFunction("lib3mf_builditem_setobjecttransform"); + lib3mf_builditem_getpartnumber = mLibrary.getFunction("lib3mf_builditem_getpartnumber"); + lib3mf_builditem_setpartnumber = mLibrary.getFunction("lib3mf_builditem_setpartnumber"); + lib3mf_builditem_getmetadatagroup = mLibrary.getFunction("lib3mf_builditem_getmetadatagroup"); + lib3mf_builditem_getoutbox = mLibrary.getFunction("lib3mf_builditem_getoutbox"); + lib3mf_builditemiterator_movenext = mLibrary.getFunction("lib3mf_builditemiterator_movenext"); + lib3mf_builditemiterator_moveprevious = mLibrary.getFunction("lib3mf_builditemiterator_moveprevious"); + lib3mf_builditemiterator_getcurrent = mLibrary.getFunction("lib3mf_builditemiterator_getcurrent"); + lib3mf_builditemiterator_clone = mLibrary.getFunction("lib3mf_builditemiterator_clone"); + lib3mf_builditemiterator_count = mLibrary.getFunction("lib3mf_builditemiterator_count"); + lib3mf_slice_setvertices = mLibrary.getFunction("lib3mf_slice_setvertices"); + lib3mf_slice_getvertices = mLibrary.getFunction("lib3mf_slice_getvertices"); + lib3mf_slice_getvertexcount = mLibrary.getFunction("lib3mf_slice_getvertexcount"); + lib3mf_slice_addpolygon = mLibrary.getFunction("lib3mf_slice_addpolygon"); + lib3mf_slice_getpolygoncount = mLibrary.getFunction("lib3mf_slice_getpolygoncount"); + lib3mf_slice_setpolygonindices = mLibrary.getFunction("lib3mf_slice_setpolygonindices"); + lib3mf_slice_getpolygonindices = mLibrary.getFunction("lib3mf_slice_getpolygonindices"); + lib3mf_slice_getpolygonindexcount = mLibrary.getFunction("lib3mf_slice_getpolygonindexcount"); + lib3mf_slice_getztop = mLibrary.getFunction("lib3mf_slice_getztop"); + lib3mf_slicestack_getbottomz = mLibrary.getFunction("lib3mf_slicestack_getbottomz"); + lib3mf_slicestack_getslicecount = mLibrary.getFunction("lib3mf_slicestack_getslicecount"); + lib3mf_slicestack_getslice = mLibrary.getFunction("lib3mf_slicestack_getslice"); + lib3mf_slicestack_addslice = mLibrary.getFunction("lib3mf_slicestack_addslice"); + lib3mf_slicestack_getslicerefcount = mLibrary.getFunction("lib3mf_slicestack_getslicerefcount"); + lib3mf_slicestack_addslicestackreference = mLibrary.getFunction("lib3mf_slicestack_addslicestackreference"); + lib3mf_slicestack_getslicestackreference = mLibrary.getFunction("lib3mf_slicestack_getslicestackreference"); + lib3mf_slicestack_collapseslicereferences = mLibrary.getFunction("lib3mf_slicestack_collapseslicereferences"); + lib3mf_slicestack_setownpath = mLibrary.getFunction("lib3mf_slicestack_setownpath"); + lib3mf_slicestack_getownpath = mLibrary.getFunction("lib3mf_slicestack_getownpath"); + lib3mf_consumer_getconsumerid = mLibrary.getFunction("lib3mf_consumer_getconsumerid"); + lib3mf_consumer_getkeyid = mLibrary.getFunction("lib3mf_consumer_getkeyid"); + lib3mf_consumer_getkeyvalue = mLibrary.getFunction("lib3mf_consumer_getkeyvalue"); + lib3mf_accessright_getconsumer = mLibrary.getFunction("lib3mf_accessright_getconsumer"); + lib3mf_accessright_getwrappingalgorithm = mLibrary.getFunction("lib3mf_accessright_getwrappingalgorithm"); + lib3mf_accessright_getmgfalgorithm = mLibrary.getFunction("lib3mf_accessright_getmgfalgorithm"); + lib3mf_accessright_getdigestmethod = mLibrary.getFunction("lib3mf_accessright_getdigestmethod"); + lib3mf_contentencryptionparams_getencryptionalgorithm = mLibrary.getFunction("lib3mf_contentencryptionparams_getencryptionalgorithm"); + lib3mf_contentencryptionparams_getkey = mLibrary.getFunction("lib3mf_contentencryptionparams_getkey"); + lib3mf_contentencryptionparams_getinitializationvector = mLibrary.getFunction("lib3mf_contentencryptionparams_getinitializationvector"); + lib3mf_contentencryptionparams_getauthenticationtag = mLibrary.getFunction("lib3mf_contentencryptionparams_getauthenticationtag"); + lib3mf_contentencryptionparams_setauthenticationtag = mLibrary.getFunction("lib3mf_contentencryptionparams_setauthenticationtag"); + lib3mf_contentencryptionparams_getadditionalauthenticationdata = mLibrary.getFunction("lib3mf_contentencryptionparams_getadditionalauthenticationdata"); + lib3mf_contentencryptionparams_getdescriptor = mLibrary.getFunction("lib3mf_contentencryptionparams_getdescriptor"); + lib3mf_contentencryptionparams_getkeyuuid = mLibrary.getFunction("lib3mf_contentencryptionparams_getkeyuuid"); + lib3mf_resourcedata_getpath = mLibrary.getFunction("lib3mf_resourcedata_getpath"); + lib3mf_resourcedata_getencryptionalgorithm = mLibrary.getFunction("lib3mf_resourcedata_getencryptionalgorithm"); + lib3mf_resourcedata_getcompression = mLibrary.getFunction("lib3mf_resourcedata_getcompression"); + lib3mf_resourcedata_getadditionalauthenticationdata = mLibrary.getFunction("lib3mf_resourcedata_getadditionalauthenticationdata"); + lib3mf_resourcedatagroup_getkeyuuid = mLibrary.getFunction("lib3mf_resourcedatagroup_getkeyuuid"); + lib3mf_resourcedatagroup_addaccessright = mLibrary.getFunction("lib3mf_resourcedatagroup_addaccessright"); + lib3mf_resourcedatagroup_findaccessrightbyconsumer = mLibrary.getFunction("lib3mf_resourcedatagroup_findaccessrightbyconsumer"); + lib3mf_resourcedatagroup_removeaccessright = mLibrary.getFunction("lib3mf_resourcedatagroup_removeaccessright"); + lib3mf_keystore_addconsumer = mLibrary.getFunction("lib3mf_keystore_addconsumer"); + lib3mf_keystore_getconsumercount = mLibrary.getFunction("lib3mf_keystore_getconsumercount"); + lib3mf_keystore_getconsumer = mLibrary.getFunction("lib3mf_keystore_getconsumer"); + lib3mf_keystore_removeconsumer = mLibrary.getFunction("lib3mf_keystore_removeconsumer"); + lib3mf_keystore_findconsumer = mLibrary.getFunction("lib3mf_keystore_findconsumer"); + lib3mf_keystore_getresourcedatagroupcount = mLibrary.getFunction("lib3mf_keystore_getresourcedatagroupcount"); + lib3mf_keystore_addresourcedatagroup = mLibrary.getFunction("lib3mf_keystore_addresourcedatagroup"); + lib3mf_keystore_getresourcedatagroup = mLibrary.getFunction("lib3mf_keystore_getresourcedatagroup"); + lib3mf_keystore_removeresourcedatagroup = mLibrary.getFunction("lib3mf_keystore_removeresourcedatagroup"); + lib3mf_keystore_findresourcedatagroup = mLibrary.getFunction("lib3mf_keystore_findresourcedatagroup"); + lib3mf_keystore_addresourcedata = mLibrary.getFunction("lib3mf_keystore_addresourcedata"); + lib3mf_keystore_removeresourcedata = mLibrary.getFunction("lib3mf_keystore_removeresourcedata"); + lib3mf_keystore_findresourcedata = mLibrary.getFunction("lib3mf_keystore_findresourcedata"); + lib3mf_keystore_getresourcedatacount = mLibrary.getFunction("lib3mf_keystore_getresourcedatacount"); + lib3mf_keystore_getresourcedata = mLibrary.getFunction("lib3mf_keystore_getresourcedata"); + lib3mf_keystore_getuuid = mLibrary.getFunction("lib3mf_keystore_getuuid"); + lib3mf_keystore_setuuid = mLibrary.getFunction("lib3mf_keystore_setuuid"); + lib3mf_model_rootmodelpart = mLibrary.getFunction("lib3mf_model_rootmodelpart"); + lib3mf_model_findorcreatepackagepart = mLibrary.getFunction("lib3mf_model_findorcreatepackagepart"); + lib3mf_model_setunit = mLibrary.getFunction("lib3mf_model_setunit"); + lib3mf_model_getunit = mLibrary.getFunction("lib3mf_model_getunit"); + lib3mf_model_getlanguage = mLibrary.getFunction("lib3mf_model_getlanguage"); + lib3mf_model_setlanguage = mLibrary.getFunction("lib3mf_model_setlanguage"); + lib3mf_model_querywriter = mLibrary.getFunction("lib3mf_model_querywriter"); + lib3mf_model_queryreader = mLibrary.getFunction("lib3mf_model_queryreader"); + lib3mf_model_getresourcebyid = mLibrary.getFunction("lib3mf_model_getresourcebyid"); + lib3mf_model_gettexture2dbyid = mLibrary.getFunction("lib3mf_model_gettexture2dbyid"); + lib3mf_model_getpropertytypebyid = mLibrary.getFunction("lib3mf_model_getpropertytypebyid"); + lib3mf_model_getbasematerialgroupbyid = mLibrary.getFunction("lib3mf_model_getbasematerialgroupbyid"); + lib3mf_model_gettexture2dgroupbyid = mLibrary.getFunction("lib3mf_model_gettexture2dgroupbyid"); + lib3mf_model_getcompositematerialsbyid = mLibrary.getFunction("lib3mf_model_getcompositematerialsbyid"); + lib3mf_model_getmultipropertygroupbyid = mLibrary.getFunction("lib3mf_model_getmultipropertygroupbyid"); + lib3mf_model_getmeshobjectbyid = mLibrary.getFunction("lib3mf_model_getmeshobjectbyid"); + lib3mf_model_getcomponentsobjectbyid = mLibrary.getFunction("lib3mf_model_getcomponentsobjectbyid"); + lib3mf_model_getbooleanobjectbyid = mLibrary.getFunction("lib3mf_model_getbooleanobjectbyid"); + lib3mf_model_getcolorgroupbyid = mLibrary.getFunction("lib3mf_model_getcolorgroupbyid"); + lib3mf_model_getslicestackbyid = mLibrary.getFunction("lib3mf_model_getslicestackbyid"); + lib3mf_model_getlevelsetbyid = mLibrary.getFunction("lib3mf_model_getlevelsetbyid"); + lib3mf_model_getbuilduuid = mLibrary.getFunction("lib3mf_model_getbuilduuid"); + lib3mf_model_setbuilduuid = mLibrary.getFunction("lib3mf_model_setbuilduuid"); + lib3mf_model_getbuilditems = mLibrary.getFunction("lib3mf_model_getbuilditems"); + lib3mf_model_getoutbox = mLibrary.getFunction("lib3mf_model_getoutbox"); + lib3mf_model_getresources = mLibrary.getFunction("lib3mf_model_getresources"); + lib3mf_model_getobjects = mLibrary.getFunction("lib3mf_model_getobjects"); + lib3mf_model_getmeshobjects = mLibrary.getFunction("lib3mf_model_getmeshobjects"); + lib3mf_model_getcomponentsobjects = mLibrary.getFunction("lib3mf_model_getcomponentsobjects"); + lib3mf_model_getbooleanobjects = mLibrary.getFunction("lib3mf_model_getbooleanobjects"); + lib3mf_model_gettexture2ds = mLibrary.getFunction("lib3mf_model_gettexture2ds"); + lib3mf_model_getbasematerialgroups = mLibrary.getFunction("lib3mf_model_getbasematerialgroups"); + lib3mf_model_getcolorgroups = mLibrary.getFunction("lib3mf_model_getcolorgroups"); + lib3mf_model_gettexture2dgroups = mLibrary.getFunction("lib3mf_model_gettexture2dgroups"); + lib3mf_model_getcompositematerials = mLibrary.getFunction("lib3mf_model_getcompositematerials"); + lib3mf_model_getmultipropertygroups = mLibrary.getFunction("lib3mf_model_getmultipropertygroups"); + lib3mf_model_getslicestacks = mLibrary.getFunction("lib3mf_model_getslicestacks"); + lib3mf_model_getimage3ds = mLibrary.getFunction("lib3mf_model_getimage3ds"); + lib3mf_model_mergetomodel = mLibrary.getFunction("lib3mf_model_mergetomodel"); + lib3mf_model_mergefrommodel = mLibrary.getFunction("lib3mf_model_mergefrommodel"); + lib3mf_model_addmeshobject = mLibrary.getFunction("lib3mf_model_addmeshobject"); + lib3mf_model_addcomponentsobject = mLibrary.getFunction("lib3mf_model_addcomponentsobject"); + lib3mf_model_addbooleanobject = mLibrary.getFunction("lib3mf_model_addbooleanobject"); + lib3mf_model_addslicestack = mLibrary.getFunction("lib3mf_model_addslicestack"); + lib3mf_model_addtexture2dfromattachment = mLibrary.getFunction("lib3mf_model_addtexture2dfromattachment"); + lib3mf_model_addbasematerialgroup = mLibrary.getFunction("lib3mf_model_addbasematerialgroup"); + lib3mf_model_addcolorgroup = mLibrary.getFunction("lib3mf_model_addcolorgroup"); + lib3mf_model_addtexture2dgroup = mLibrary.getFunction("lib3mf_model_addtexture2dgroup"); + lib3mf_model_addcompositematerials = mLibrary.getFunction("lib3mf_model_addcompositematerials"); + lib3mf_model_addmultipropertygroup = mLibrary.getFunction("lib3mf_model_addmultipropertygroup"); + lib3mf_model_addimagestack = mLibrary.getFunction("lib3mf_model_addimagestack"); + lib3mf_model_getimagestackbyid = mLibrary.getFunction("lib3mf_model_getimagestackbyid"); + lib3mf_model_addbuilditem = mLibrary.getFunction("lib3mf_model_addbuilditem"); + lib3mf_model_removebuilditem = mLibrary.getFunction("lib3mf_model_removebuilditem"); + lib3mf_model_getmetadatagroup = mLibrary.getFunction("lib3mf_model_getmetadatagroup"); + lib3mf_model_addattachment = mLibrary.getFunction("lib3mf_model_addattachment"); + lib3mf_model_removeattachment = mLibrary.getFunction("lib3mf_model_removeattachment"); + lib3mf_model_getattachment = mLibrary.getFunction("lib3mf_model_getattachment"); + lib3mf_model_findattachment = mLibrary.getFunction("lib3mf_model_findattachment"); + lib3mf_model_getattachmentcount = mLibrary.getFunction("lib3mf_model_getattachmentcount"); + lib3mf_model_haspackagethumbnailattachment = mLibrary.getFunction("lib3mf_model_haspackagethumbnailattachment"); + lib3mf_model_createpackagethumbnailattachment = mLibrary.getFunction("lib3mf_model_createpackagethumbnailattachment"); + lib3mf_model_getpackagethumbnailattachment = mLibrary.getFunction("lib3mf_model_getpackagethumbnailattachment"); + lib3mf_model_removepackagethumbnailattachment = mLibrary.getFunction("lib3mf_model_removepackagethumbnailattachment"); + lib3mf_model_addcustomcontenttype = mLibrary.getFunction("lib3mf_model_addcustomcontenttype"); + lib3mf_model_removecustomcontenttype = mLibrary.getFunction("lib3mf_model_removecustomcontenttype"); + lib3mf_model_setrandomnumbercallback = mLibrary.getFunction("lib3mf_model_setrandomnumbercallback"); + lib3mf_model_getkeystore = mLibrary.getFunction("lib3mf_model_getkeystore"); + lib3mf_model_getfunctions = mLibrary.getFunction("lib3mf_model_getfunctions"); + lib3mf_model_addimplicitfunction = mLibrary.getFunction("lib3mf_model_addimplicitfunction"); + lib3mf_model_addfunctionfromimage3d = mLibrary.getFunction("lib3mf_model_addfunctionfromimage3d"); + lib3mf_model_addvolumedata = mLibrary.getFunction("lib3mf_model_addvolumedata"); + lib3mf_model_addlevelset = mLibrary.getFunction("lib3mf_model_addlevelset"); + lib3mf_model_getlevelsets = mLibrary.getFunction("lib3mf_model_getlevelsets"); + lib3mf_model_removeresource = mLibrary.getFunction("lib3mf_model_removeresource"); + } + + public Lib3MFWrapper(Pointer lookupPointer) throws Lib3MFException { + com.sun.jna.Function lookupMethod = com.sun.jna.Function.getFunction(lookupPointer); + lib3mf_getlibraryversion = loadFunctionByLookup(lookupMethod, "lib3mf_getlibraryversion"); + lib3mf_getprereleaseinformation = loadFunctionByLookup(lookupMethod, "lib3mf_getprereleaseinformation"); + lib3mf_getbuildinformation = loadFunctionByLookup(lookupMethod, "lib3mf_getbuildinformation"); + lib3mf_getspecificationversion = loadFunctionByLookup(lookupMethod, "lib3mf_getspecificationversion"); + lib3mf_createmodel = loadFunctionByLookup(lookupMethod, "lib3mf_createmodel"); + lib3mf_release = loadFunctionByLookup(lookupMethod, "lib3mf_release"); + lib3mf_acquire = loadFunctionByLookup(lookupMethod, "lib3mf_acquire"); + lib3mf_setjournal = loadFunctionByLookup(lookupMethod, "lib3mf_setjournal"); + lib3mf_getlasterror = loadFunctionByLookup(lookupMethod, "lib3mf_getlasterror"); + lib3mf_getsymbollookupmethod = loadFunctionByLookup(lookupMethod, "lib3mf_getsymbollookupmethod"); + lib3mf_retrieveprogressmessage = loadFunctionByLookup(lookupMethod, "lib3mf_retrieveprogressmessage"); + lib3mf_rgbatocolor = loadFunctionByLookup(lookupMethod, "lib3mf_rgbatocolor"); + lib3mf_floatrgbatocolor = loadFunctionByLookup(lookupMethod, "lib3mf_floatrgbatocolor"); + lib3mf_colortorgba = loadFunctionByLookup(lookupMethod, "lib3mf_colortorgba"); + lib3mf_colortofloatrgba = loadFunctionByLookup(lookupMethod, "lib3mf_colortofloatrgba"); + lib3mf_getidentitytransform = loadFunctionByLookup(lookupMethod, "lib3mf_getidentitytransform"); + lib3mf_getuniformscaletransform = loadFunctionByLookup(lookupMethod, "lib3mf_getuniformscaletransform"); + lib3mf_getscaletransform = loadFunctionByLookup(lookupMethod, "lib3mf_getscaletransform"); + lib3mf_gettranslationtransform = loadFunctionByLookup(lookupMethod, "lib3mf_gettranslationtransform"); + lib3mf_base_classtypeid = loadFunctionByLookup(lookupMethod, "lib3mf_base_classtypeid"); + lib3mf_writer_writetofile = loadFunctionByLookup(lookupMethod, "lib3mf_writer_writetofile"); + lib3mf_writer_getstreamsize = loadFunctionByLookup(lookupMethod, "lib3mf_writer_getstreamsize"); + lib3mf_writer_writetobuffer = loadFunctionByLookup(lookupMethod, "lib3mf_writer_writetobuffer"); + lib3mf_writer_writetocallback = loadFunctionByLookup(lookupMethod, "lib3mf_writer_writetocallback"); + lib3mf_writer_setprogresscallback = loadFunctionByLookup(lookupMethod, "lib3mf_writer_setprogresscallback"); + lib3mf_writer_getdecimalprecision = loadFunctionByLookup(lookupMethod, "lib3mf_writer_getdecimalprecision"); + lib3mf_writer_setdecimalprecision = loadFunctionByLookup(lookupMethod, "lib3mf_writer_setdecimalprecision"); + lib3mf_writer_setstrictmodeactive = loadFunctionByLookup(lookupMethod, "lib3mf_writer_setstrictmodeactive"); + lib3mf_writer_getstrictmodeactive = loadFunctionByLookup(lookupMethod, "lib3mf_writer_getstrictmodeactive"); + lib3mf_writer_getwarning = loadFunctionByLookup(lookupMethod, "lib3mf_writer_getwarning"); + lib3mf_writer_getwarningcount = loadFunctionByLookup(lookupMethod, "lib3mf_writer_getwarningcount"); + lib3mf_writer_addkeywrappingcallback = loadFunctionByLookup(lookupMethod, "lib3mf_writer_addkeywrappingcallback"); + lib3mf_writer_setcontentencryptioncallback = loadFunctionByLookup(lookupMethod, "lib3mf_writer_setcontentencryptioncallback"); + lib3mf_reader_readfromfile = loadFunctionByLookup(lookupMethod, "lib3mf_reader_readfromfile"); + lib3mf_reader_readfrombuffer = loadFunctionByLookup(lookupMethod, "lib3mf_reader_readfrombuffer"); + lib3mf_reader_readfromcallback = loadFunctionByLookup(lookupMethod, "lib3mf_reader_readfromcallback"); + lib3mf_reader_setprogresscallback = loadFunctionByLookup(lookupMethod, "lib3mf_reader_setprogresscallback"); + lib3mf_reader_addrelationtoread = loadFunctionByLookup(lookupMethod, "lib3mf_reader_addrelationtoread"); + lib3mf_reader_removerelationtoread = loadFunctionByLookup(lookupMethod, "lib3mf_reader_removerelationtoread"); + lib3mf_reader_setstrictmodeactive = loadFunctionByLookup(lookupMethod, "lib3mf_reader_setstrictmodeactive"); + lib3mf_reader_getstrictmodeactive = loadFunctionByLookup(lookupMethod, "lib3mf_reader_getstrictmodeactive"); + lib3mf_reader_getwarning = loadFunctionByLookup(lookupMethod, "lib3mf_reader_getwarning"); + lib3mf_reader_getwarningcount = loadFunctionByLookup(lookupMethod, "lib3mf_reader_getwarningcount"); + lib3mf_reader_addkeywrappingcallback = loadFunctionByLookup(lookupMethod, "lib3mf_reader_addkeywrappingcallback"); + lib3mf_reader_setcontentencryptioncallback = loadFunctionByLookup(lookupMethod, "lib3mf_reader_setcontentencryptioncallback"); + lib3mf_packagepart_getpath = loadFunctionByLookup(lookupMethod, "lib3mf_packagepart_getpath"); + lib3mf_packagepart_setpath = loadFunctionByLookup(lookupMethod, "lib3mf_packagepart_setpath"); + lib3mf_resource_getresourceid = loadFunctionByLookup(lookupMethod, "lib3mf_resource_getresourceid"); + lib3mf_resource_getuniqueresourceid = loadFunctionByLookup(lookupMethod, "lib3mf_resource_getuniqueresourceid"); + lib3mf_resource_packagepart = loadFunctionByLookup(lookupMethod, "lib3mf_resource_packagepart"); + lib3mf_resource_setpackagepart = loadFunctionByLookup(lookupMethod, "lib3mf_resource_setpackagepart"); + lib3mf_resource_getmodelresourceid = loadFunctionByLookup(lookupMethod, "lib3mf_resource_getmodelresourceid"); + lib3mf_resourceiterator_movenext = loadFunctionByLookup(lookupMethod, "lib3mf_resourceiterator_movenext"); + lib3mf_resourceiterator_moveprevious = loadFunctionByLookup(lookupMethod, "lib3mf_resourceiterator_moveprevious"); + lib3mf_resourceiterator_getcurrent = loadFunctionByLookup(lookupMethod, "lib3mf_resourceiterator_getcurrent"); + lib3mf_resourceiterator_clone = loadFunctionByLookup(lookupMethod, "lib3mf_resourceiterator_clone"); + lib3mf_resourceiterator_count = loadFunctionByLookup(lookupMethod, "lib3mf_resourceiterator_count"); + lib3mf_slicestackiterator_getcurrentslicestack = loadFunctionByLookup(lookupMethod, "lib3mf_slicestackiterator_getcurrentslicestack"); + lib3mf_objectiterator_getcurrentobject = loadFunctionByLookup(lookupMethod, "lib3mf_objectiterator_getcurrentobject"); + lib3mf_meshobjectiterator_getcurrentmeshobject = loadFunctionByLookup(lookupMethod, "lib3mf_meshobjectiterator_getcurrentmeshobject"); + lib3mf_componentsobjectiterator_getcurrentcomponentsobject = loadFunctionByLookup(lookupMethod, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); + lib3mf_booleanobjectiterator_getcurrentbooleanobject = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobjectiterator_getcurrentbooleanobject"); + lib3mf_texture2diterator_getcurrenttexture2d = loadFunctionByLookup(lookupMethod, "lib3mf_texture2diterator_getcurrenttexture2d"); + lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); + lib3mf_colorgroupiterator_getcurrentcolorgroup = loadFunctionByLookup(lookupMethod, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); + lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup = loadFunctionByLookup(lookupMethod, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + lib3mf_compositematerialsiterator_getcurrentcompositematerials = loadFunctionByLookup(lookupMethod, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + lib3mf_image3diterator_getcurrentimage3d = loadFunctionByLookup(lookupMethod, "lib3mf_image3diterator_getcurrentimage3d"); + lib3mf_functioniterator_getcurrentfunction = loadFunctionByLookup(lookupMethod, "lib3mf_functioniterator_getcurrentfunction"); + lib3mf_levelsetiterator_getcurrentlevelset = loadFunctionByLookup(lookupMethod, "lib3mf_levelsetiterator_getcurrentlevelset"); + lib3mf_metadata_getnamespace = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_getnamespace"); + lib3mf_metadata_setnamespace = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_setnamespace"); + lib3mf_metadata_getname = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_getname"); + lib3mf_metadata_setname = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_setname"); + lib3mf_metadata_getkey = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_getkey"); + lib3mf_metadata_getmustpreserve = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_getmustpreserve"); + lib3mf_metadata_setmustpreserve = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_setmustpreserve"); + lib3mf_metadata_gettype = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_gettype"); + lib3mf_metadata_settype = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_settype"); + lib3mf_metadata_getvalue = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_getvalue"); + lib3mf_metadata_setvalue = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_setvalue"); + lib3mf_metadatagroup_getmetadatacount = loadFunctionByLookup(lookupMethod, "lib3mf_metadatagroup_getmetadatacount"); + lib3mf_metadatagroup_getmetadata = loadFunctionByLookup(lookupMethod, "lib3mf_metadatagroup_getmetadata"); + lib3mf_metadatagroup_getmetadatabykey = loadFunctionByLookup(lookupMethod, "lib3mf_metadatagroup_getmetadatabykey"); + lib3mf_metadatagroup_removemetadatabyindex = loadFunctionByLookup(lookupMethod, "lib3mf_metadatagroup_removemetadatabyindex"); + lib3mf_metadatagroup_removemetadata = loadFunctionByLookup(lookupMethod, "lib3mf_metadatagroup_removemetadata"); + lib3mf_metadatagroup_addmetadata = loadFunctionByLookup(lookupMethod, "lib3mf_metadatagroup_addmetadata"); + lib3mf_triangleset_setname = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_setname"); + lib3mf_triangleset_getname = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_getname"); + lib3mf_triangleset_setidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_setidentifier"); + lib3mf_triangleset_getidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_getidentifier"); + lib3mf_triangleset_addtriangle = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_addtriangle"); + lib3mf_triangleset_removetriangle = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_removetriangle"); + lib3mf_triangleset_clear = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_clear"); + lib3mf_triangleset_settrianglelist = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_settrianglelist"); + lib3mf_triangleset_gettrianglelist = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_gettrianglelist"); + lib3mf_triangleset_addtrianglelist = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_addtrianglelist"); + lib3mf_triangleset_merge = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_merge"); + lib3mf_triangleset_deleteset = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_deleteset"); + lib3mf_triangleset_duplicate = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_duplicate"); + lib3mf_object_gettype = loadFunctionByLookup(lookupMethod, "lib3mf_object_gettype"); + lib3mf_object_settype = loadFunctionByLookup(lookupMethod, "lib3mf_object_settype"); + lib3mf_object_getname = loadFunctionByLookup(lookupMethod, "lib3mf_object_getname"); + lib3mf_object_setname = loadFunctionByLookup(lookupMethod, "lib3mf_object_setname"); + lib3mf_object_getpartnumber = loadFunctionByLookup(lookupMethod, "lib3mf_object_getpartnumber"); + lib3mf_object_setpartnumber = loadFunctionByLookup(lookupMethod, "lib3mf_object_setpartnumber"); + lib3mf_object_ismeshobject = loadFunctionByLookup(lookupMethod, "lib3mf_object_ismeshobject"); + lib3mf_object_iscomponentsobject = loadFunctionByLookup(lookupMethod, "lib3mf_object_iscomponentsobject"); + lib3mf_object_islevelsetobject = loadFunctionByLookup(lookupMethod, "lib3mf_object_islevelsetobject"); + lib3mf_object_isbooleanobject = loadFunctionByLookup(lookupMethod, "lib3mf_object_isbooleanobject"); + lib3mf_object_isvalid = loadFunctionByLookup(lookupMethod, "lib3mf_object_isvalid"); + lib3mf_object_setattachmentasthumbnail = loadFunctionByLookup(lookupMethod, "lib3mf_object_setattachmentasthumbnail"); + lib3mf_object_getthumbnailattachment = loadFunctionByLookup(lookupMethod, "lib3mf_object_getthumbnailattachment"); + lib3mf_object_clearthumbnailattachment = loadFunctionByLookup(lookupMethod, "lib3mf_object_clearthumbnailattachment"); + lib3mf_object_getoutbox = loadFunctionByLookup(lookupMethod, "lib3mf_object_getoutbox"); + lib3mf_object_getuuid = loadFunctionByLookup(lookupMethod, "lib3mf_object_getuuid"); + lib3mf_object_setuuid = loadFunctionByLookup(lookupMethod, "lib3mf_object_setuuid"); + lib3mf_object_getmetadatagroup = loadFunctionByLookup(lookupMethod, "lib3mf_object_getmetadatagroup"); + lib3mf_object_setslicesmeshresolution = loadFunctionByLookup(lookupMethod, "lib3mf_object_setslicesmeshresolution"); + lib3mf_object_getslicesmeshresolution = loadFunctionByLookup(lookupMethod, "lib3mf_object_getslicesmeshresolution"); + lib3mf_object_hasslices = loadFunctionByLookup(lookupMethod, "lib3mf_object_hasslices"); + lib3mf_object_clearslicestack = loadFunctionByLookup(lookupMethod, "lib3mf_object_clearslicestack"); + lib3mf_object_getslicestack = loadFunctionByLookup(lookupMethod, "lib3mf_object_getslicestack"); + lib3mf_object_assignslicestack = loadFunctionByLookup(lookupMethod, "lib3mf_object_assignslicestack"); + lib3mf_meshobject_getvertexcount = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_getvertexcount"); + lib3mf_meshobject_gettrianglecount = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_gettrianglecount"); + lib3mf_meshobject_getvertex = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_getvertex"); + lib3mf_meshobject_setvertex = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_setvertex"); + lib3mf_meshobject_addvertex = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_addvertex"); + lib3mf_meshobject_getvertices = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_getvertices"); + lib3mf_meshobject_gettriangle = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_gettriangle"); + lib3mf_meshobject_settriangle = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_settriangle"); + lib3mf_meshobject_addtriangle = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_addtriangle"); + lib3mf_meshobject_gettriangleindices = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_gettriangleindices"); + lib3mf_meshobject_setobjectlevelproperty = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_setobjectlevelproperty"); + lib3mf_meshobject_getobjectlevelproperty = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_getobjectlevelproperty"); + lib3mf_meshobject_settriangleproperties = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_settriangleproperties"); + lib3mf_meshobject_gettriangleproperties = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_gettriangleproperties"); + lib3mf_meshobject_setalltriangleproperties = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_setalltriangleproperties"); + lib3mf_meshobject_getalltriangleproperties = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_getalltriangleproperties"); + lib3mf_meshobject_clearallproperties = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_clearallproperties"); + lib3mf_meshobject_setgeometry = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_setgeometry"); + lib3mf_meshobject_ismanifoldandoriented = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_ismanifoldandoriented"); + lib3mf_meshobject_beamlattice = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_beamlattice"); + lib3mf_meshobject_getvolumedata = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_getvolumedata"); + lib3mf_meshobject_setvolumedata = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_setvolumedata"); + lib3mf_meshobject_addtriangleset = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_addtriangleset"); + lib3mf_meshobject_hastriangleset = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_hastriangleset"); + lib3mf_meshobject_findtriangleset = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_findtriangleset"); + lib3mf_meshobject_gettrianglesetcount = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_gettrianglesetcount"); + lib3mf_meshobject_gettriangleset = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_gettriangleset"); + lib3mf_levelset_getfunction = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_getfunction"); + lib3mf_levelset_setfunction = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_setfunction"); + lib3mf_levelset_gettransform = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_gettransform"); + lib3mf_levelset_settransform = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_settransform"); + lib3mf_levelset_getchannelname = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_getchannelname"); + lib3mf_levelset_setchannelname = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_setchannelname"); + lib3mf_levelset_setminfeaturesize = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_setminfeaturesize"); + lib3mf_levelset_getminfeaturesize = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_getminfeaturesize"); + lib3mf_levelset_setfallbackvalue = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_setfallbackvalue"); + lib3mf_levelset_getfallbackvalue = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_getfallbackvalue"); + lib3mf_levelset_setmeshbboxonly = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_setmeshbboxonly"); + lib3mf_levelset_getmeshbboxonly = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_getmeshbboxonly"); + lib3mf_levelset_setmesh = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_setmesh"); + lib3mf_levelset_getmesh = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_getmesh"); + lib3mf_levelset_getvolumedata = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_getvolumedata"); + lib3mf_levelset_setvolumedata = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_setvolumedata"); + lib3mf_booleanobject_setbaseobject = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_setbaseobject"); + lib3mf_booleanobject_getbaseobject = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_getbaseobject"); + lib3mf_booleanobject_setbasetransform = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_setbasetransform"); + lib3mf_booleanobject_getbasetransform = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_getbasetransform"); + lib3mf_booleanobject_setoperation = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_setoperation"); + lib3mf_booleanobject_getoperation = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_getoperation"); + lib3mf_booleanobject_setcsgmodeenabled = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_setcsgmodeenabled"); + lib3mf_booleanobject_getcsgmodeenabled = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_getcsgmodeenabled"); + lib3mf_booleanobject_setextractiongridresolution = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_setextractiongridresolution"); + lib3mf_booleanobject_getextractiongridresolution = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_getextractiongridresolution"); + lib3mf_booleanobject_getoperandcount = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_getoperandcount"); + lib3mf_booleanobject_addoperand = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_addoperand"); + lib3mf_booleanobject_getoperand = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_getoperand"); + lib3mf_booleanobject_mergetomeshobject = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_mergetomeshobject"); + lib3mf_beamlattice_getminlength = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getminlength"); + lib3mf_beamlattice_setminlength = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_setminlength"); + lib3mf_beamlattice_getclipping = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getclipping"); + lib3mf_beamlattice_setclipping = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_setclipping"); + lib3mf_beamlattice_getrepresentation = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getrepresentation"); + lib3mf_beamlattice_setrepresentation = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_setrepresentation"); + lib3mf_beamlattice_getballoptions = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getballoptions"); + lib3mf_beamlattice_setballoptions = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_setballoptions"); + lib3mf_beamlattice_getbeamcount = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getbeamcount"); + lib3mf_beamlattice_getbeam = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getbeam"); + lib3mf_beamlattice_addbeam = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_addbeam"); + lib3mf_beamlattice_setbeam = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_setbeam"); + lib3mf_beamlattice_setbeams = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_setbeams"); + lib3mf_beamlattice_getbeams = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getbeams"); + lib3mf_beamlattice_getballcount = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getballcount"); + lib3mf_beamlattice_getball = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getball"); + lib3mf_beamlattice_addball = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_addball"); + lib3mf_beamlattice_setball = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_setball"); + lib3mf_beamlattice_setballs = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_setballs"); + lib3mf_beamlattice_getballs = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getballs"); + lib3mf_beamlattice_getbeamsetcount = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getbeamsetcount"); + lib3mf_beamlattice_addbeamset = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_addbeamset"); + lib3mf_beamlattice_getbeamset = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getbeamset"); + lib3mf_functionreference_getfunctionresourceid = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_getfunctionresourceid"); + lib3mf_functionreference_setfunctionresourceid = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_setfunctionresourceid"); + lib3mf_functionreference_gettransform = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_gettransform"); + lib3mf_functionreference_settransform = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_settransform"); + lib3mf_functionreference_getchannelname = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_getchannelname"); + lib3mf_functionreference_setchannelname = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_setchannelname"); + lib3mf_functionreference_setminfeaturesize = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_setminfeaturesize"); + lib3mf_functionreference_getminfeaturesize = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_getminfeaturesize"); + lib3mf_functionreference_setfallbackvalue = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_setfallbackvalue"); + lib3mf_functionreference_getfallbackvalue = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_getfallbackvalue"); + lib3mf_volumedatacomposite_getbasematerialgroup = loadFunctionByLookup(lookupMethod, "lib3mf_volumedatacomposite_getbasematerialgroup"); + lib3mf_volumedatacomposite_setbasematerialgroup = loadFunctionByLookup(lookupMethod, "lib3mf_volumedatacomposite_setbasematerialgroup"); + lib3mf_volumedatacomposite_getmaterialmappingcount = loadFunctionByLookup(lookupMethod, "lib3mf_volumedatacomposite_getmaterialmappingcount"); + lib3mf_volumedatacomposite_getmaterialmapping = loadFunctionByLookup(lookupMethod, "lib3mf_volumedatacomposite_getmaterialmapping"); + lib3mf_volumedatacomposite_addmaterialmapping = loadFunctionByLookup(lookupMethod, "lib3mf_volumedatacomposite_addmaterialmapping"); + lib3mf_volumedatacomposite_removematerialmapping = loadFunctionByLookup(lookupMethod, "lib3mf_volumedatacomposite_removematerialmapping"); + lib3mf_volumedataproperty_getname = loadFunctionByLookup(lookupMethod, "lib3mf_volumedataproperty_getname"); + lib3mf_volumedataproperty_setisrequired = loadFunctionByLookup(lookupMethod, "lib3mf_volumedataproperty_setisrequired"); + lib3mf_volumedataproperty_isrequired = loadFunctionByLookup(lookupMethod, "lib3mf_volumedataproperty_isrequired"); + lib3mf_volumedata_getcomposite = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_getcomposite"); + lib3mf_volumedata_createnewcomposite = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_createnewcomposite"); + lib3mf_volumedata_removecomposite = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_removecomposite"); + lib3mf_volumedata_getcolor = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_getcolor"); + lib3mf_volumedata_createnewcolor = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_createnewcolor"); + lib3mf_volumedata_removecolor = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_removecolor"); + lib3mf_volumedata_getpropertycount = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_getpropertycount"); + lib3mf_volumedata_getproperty = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_getproperty"); + lib3mf_volumedata_addpropertyfromfunction = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_addpropertyfromfunction"); + lib3mf_volumedata_removeproperty = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_removeproperty"); + lib3mf_component_getobjectresource = loadFunctionByLookup(lookupMethod, "lib3mf_component_getobjectresource"); + lib3mf_component_getobjectresourceid = loadFunctionByLookup(lookupMethod, "lib3mf_component_getobjectresourceid"); + lib3mf_component_getuuid = loadFunctionByLookup(lookupMethod, "lib3mf_component_getuuid"); + lib3mf_component_setuuid = loadFunctionByLookup(lookupMethod, "lib3mf_component_setuuid"); + lib3mf_component_hastransform = loadFunctionByLookup(lookupMethod, "lib3mf_component_hastransform"); + lib3mf_component_gettransform = loadFunctionByLookup(lookupMethod, "lib3mf_component_gettransform"); + lib3mf_component_settransform = loadFunctionByLookup(lookupMethod, "lib3mf_component_settransform"); + lib3mf_componentsobject_addcomponent = loadFunctionByLookup(lookupMethod, "lib3mf_componentsobject_addcomponent"); + lib3mf_componentsobject_getcomponent = loadFunctionByLookup(lookupMethod, "lib3mf_componentsobject_getcomponent"); + lib3mf_componentsobject_getcomponentcount = loadFunctionByLookup(lookupMethod, "lib3mf_componentsobject_getcomponentcount"); + lib3mf_beamset_setname = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_setname"); + lib3mf_beamset_getname = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_getname"); + lib3mf_beamset_setidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_setidentifier"); + lib3mf_beamset_getidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_getidentifier"); + lib3mf_beamset_getreferencecount = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_getreferencecount"); + lib3mf_beamset_setreferences = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_setreferences"); + lib3mf_beamset_getreferences = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_getreferences"); + lib3mf_beamset_getballreferencecount = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_getballreferencecount"); + lib3mf_beamset_setballreferences = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_setballreferences"); + lib3mf_beamset_getballreferences = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_getballreferences"); + lib3mf_basematerialgroup_getcount = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroup_getcount"); + lib3mf_basematerialgroup_getallpropertyids = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroup_getallpropertyids"); + lib3mf_basematerialgroup_addmaterial = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroup_addmaterial"); + lib3mf_basematerialgroup_removematerial = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroup_removematerial"); + lib3mf_basematerialgroup_getname = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroup_getname"); + lib3mf_basematerialgroup_setname = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroup_setname"); + lib3mf_basematerialgroup_setdisplaycolor = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroup_setdisplaycolor"); + lib3mf_basematerialgroup_getdisplaycolor = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroup_getdisplaycolor"); + lib3mf_colorgroup_getcount = loadFunctionByLookup(lookupMethod, "lib3mf_colorgroup_getcount"); + lib3mf_colorgroup_getallpropertyids = loadFunctionByLookup(lookupMethod, "lib3mf_colorgroup_getallpropertyids"); + lib3mf_colorgroup_addcolor = loadFunctionByLookup(lookupMethod, "lib3mf_colorgroup_addcolor"); + lib3mf_colorgroup_removecolor = loadFunctionByLookup(lookupMethod, "lib3mf_colorgroup_removecolor"); + lib3mf_colorgroup_setcolor = loadFunctionByLookup(lookupMethod, "lib3mf_colorgroup_setcolor"); + lib3mf_colorgroup_getcolor = loadFunctionByLookup(lookupMethod, "lib3mf_colorgroup_getcolor"); + lib3mf_texture2dgroup_getcount = loadFunctionByLookup(lookupMethod, "lib3mf_texture2dgroup_getcount"); + lib3mf_texture2dgroup_getallpropertyids = loadFunctionByLookup(lookupMethod, "lib3mf_texture2dgroup_getallpropertyids"); + lib3mf_texture2dgroup_addtex2coord = loadFunctionByLookup(lookupMethod, "lib3mf_texture2dgroup_addtex2coord"); + lib3mf_texture2dgroup_gettex2coord = loadFunctionByLookup(lookupMethod, "lib3mf_texture2dgroup_gettex2coord"); + lib3mf_texture2dgroup_removetex2coord = loadFunctionByLookup(lookupMethod, "lib3mf_texture2dgroup_removetex2coord"); + lib3mf_texture2dgroup_gettexture2d = loadFunctionByLookup(lookupMethod, "lib3mf_texture2dgroup_gettexture2d"); + lib3mf_compositematerials_getcount = loadFunctionByLookup(lookupMethod, "lib3mf_compositematerials_getcount"); + lib3mf_compositematerials_getallpropertyids = loadFunctionByLookup(lookupMethod, "lib3mf_compositematerials_getallpropertyids"); + lib3mf_compositematerials_getbasematerialgroup = loadFunctionByLookup(lookupMethod, "lib3mf_compositematerials_getbasematerialgroup"); + lib3mf_compositematerials_addcomposite = loadFunctionByLookup(lookupMethod, "lib3mf_compositematerials_addcomposite"); + lib3mf_compositematerials_removecomposite = loadFunctionByLookup(lookupMethod, "lib3mf_compositematerials_removecomposite"); + lib3mf_compositematerials_getcomposite = loadFunctionByLookup(lookupMethod, "lib3mf_compositematerials_getcomposite"); + lib3mf_multipropertygroup_getcount = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_getcount"); + lib3mf_multipropertygroup_getallpropertyids = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_getallpropertyids"); + lib3mf_multipropertygroup_addmultiproperty = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_addmultiproperty"); + lib3mf_multipropertygroup_setmultiproperty = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_setmultiproperty"); + lib3mf_multipropertygroup_getmultiproperty = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_getmultiproperty"); + lib3mf_multipropertygroup_removemultiproperty = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_removemultiproperty"); + lib3mf_multipropertygroup_getlayercount = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_getlayercount"); + lib3mf_multipropertygroup_addlayer = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_addlayer"); + lib3mf_multipropertygroup_getlayer = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_getlayer"); + lib3mf_multipropertygroup_removelayer = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_removelayer"); + lib3mf_image3d_getname = loadFunctionByLookup(lookupMethod, "lib3mf_image3d_getname"); + lib3mf_image3d_setname = loadFunctionByLookup(lookupMethod, "lib3mf_image3d_setname"); + lib3mf_image3d_isimagestack = loadFunctionByLookup(lookupMethod, "lib3mf_image3d_isimagestack"); + lib3mf_imagestack_getrowcount = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_getrowcount"); + lib3mf_imagestack_setrowcount = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_setrowcount"); + lib3mf_imagestack_getcolumncount = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_getcolumncount"); + lib3mf_imagestack_setcolumncount = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_setcolumncount"); + lib3mf_imagestack_getsheetcount = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_getsheetcount"); + lib3mf_imagestack_getsheet = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_getsheet"); + lib3mf_imagestack_setsheet = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_setsheet"); + lib3mf_imagestack_createemptysheet = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_createemptysheet"); + lib3mf_imagestack_createsheetfrombuffer = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_createsheetfrombuffer"); + lib3mf_imagestack_createsheetfromfile = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_createsheetfromfile"); + lib3mf_attachment_getpath = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_getpath"); + lib3mf_attachment_setpath = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_setpath"); + lib3mf_attachment_packagepart = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_packagepart"); + lib3mf_attachment_getrelationshiptype = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_getrelationshiptype"); + lib3mf_attachment_setrelationshiptype = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_setrelationshiptype"); + lib3mf_attachment_writetofile = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_writetofile"); + lib3mf_attachment_readfromfile = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_readfromfile"); + lib3mf_attachment_readfromcallback = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_readfromcallback"); + lib3mf_attachment_getstreamsize = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_getstreamsize"); + lib3mf_attachment_writetobuffer = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_writetobuffer"); + lib3mf_attachment_readfrombuffer = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_readfrombuffer"); + lib3mf_texture2d_getattachment = loadFunctionByLookup(lookupMethod, "lib3mf_texture2d_getattachment"); + lib3mf_texture2d_setattachment = loadFunctionByLookup(lookupMethod, "lib3mf_texture2d_setattachment"); + lib3mf_texture2d_getcontenttype = loadFunctionByLookup(lookupMethod, "lib3mf_texture2d_getcontenttype"); + lib3mf_texture2d_setcontenttype = loadFunctionByLookup(lookupMethod, "lib3mf_texture2d_setcontenttype"); + lib3mf_texture2d_gettilestyleuv = loadFunctionByLookup(lookupMethod, "lib3mf_texture2d_gettilestyleuv"); + lib3mf_texture2d_settilestyleuv = loadFunctionByLookup(lookupMethod, "lib3mf_texture2d_settilestyleuv"); + lib3mf_texture2d_getfilter = loadFunctionByLookup(lookupMethod, "lib3mf_texture2d_getfilter"); + lib3mf_texture2d_setfilter = loadFunctionByLookup(lookupMethod, "lib3mf_texture2d_setfilter"); + lib3mf_implicitport_getidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_implicitport_getidentifier"); + lib3mf_implicitport_setidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_implicitport_setidentifier"); + lib3mf_implicitport_getdisplayname = loadFunctionByLookup(lookupMethod, "lib3mf_implicitport_getdisplayname"); + lib3mf_implicitport_setdisplayname = loadFunctionByLookup(lookupMethod, "lib3mf_implicitport_setdisplayname"); + lib3mf_implicitport_settype = loadFunctionByLookup(lookupMethod, "lib3mf_implicitport_settype"); + lib3mf_implicitport_gettype = loadFunctionByLookup(lookupMethod, "lib3mf_implicitport_gettype"); + lib3mf_implicitport_getreference = loadFunctionByLookup(lookupMethod, "lib3mf_implicitport_getreference"); + lib3mf_implicitport_setreference = loadFunctionByLookup(lookupMethod, "lib3mf_implicitport_setreference"); + lib3mf_iterator_movenext = loadFunctionByLookup(lookupMethod, "lib3mf_iterator_movenext"); + lib3mf_iterator_moveprevious = loadFunctionByLookup(lookupMethod, "lib3mf_iterator_moveprevious"); + lib3mf_iterator_count = loadFunctionByLookup(lookupMethod, "lib3mf_iterator_count"); + lib3mf_implicitportiterator_getcurrent = loadFunctionByLookup(lookupMethod, "lib3mf_implicitportiterator_getcurrent"); + lib3mf_implicitnode_getidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_getidentifier"); + lib3mf_implicitnode_setidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_setidentifier"); + lib3mf_implicitnode_getdisplayname = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_getdisplayname"); + lib3mf_implicitnode_setdisplayname = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_setdisplayname"); + lib3mf_implicitnode_gettag = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_gettag"); + lib3mf_implicitnode_settag = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_settag"); + lib3mf_implicitnode_getnodetype = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_getnodetype"); + lib3mf_implicitnode_addinput = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_addinput"); + lib3mf_implicitnode_getinputs = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_getinputs"); + lib3mf_implicitnode_addoutput = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_addoutput"); + lib3mf_implicitnode_getoutputs = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_getoutputs"); + lib3mf_implicitnode_findinput = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_findinput"); + lib3mf_implicitnode_findoutput = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_findoutput"); + lib3mf_implicitnode_aretypesvalid = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_aretypesvalid"); + lib3mf_oneinputnode_getinputa = loadFunctionByLookup(lookupMethod, "lib3mf_oneinputnode_getinputa"); + lib3mf_oneinputnode_getoutputresult = loadFunctionByLookup(lookupMethod, "lib3mf_oneinputnode_getoutputresult"); + lib3mf_resourceidnode_setresource = loadFunctionByLookup(lookupMethod, "lib3mf_resourceidnode_setresource"); + lib3mf_resourceidnode_getresource = loadFunctionByLookup(lookupMethod, "lib3mf_resourceidnode_getresource"); + lib3mf_resourceidnode_getoutputvalue = loadFunctionByLookup(lookupMethod, "lib3mf_resourceidnode_getoutputvalue"); + lib3mf_twoinputnode_getinputb = loadFunctionByLookup(lookupMethod, "lib3mf_twoinputnode_getinputb"); + lib3mf_selectnode_getinputb = loadFunctionByLookup(lookupMethod, "lib3mf_selectnode_getinputb"); + lib3mf_selectnode_getinputc = loadFunctionByLookup(lookupMethod, "lib3mf_selectnode_getinputc"); + lib3mf_selectnode_getinputd = loadFunctionByLookup(lookupMethod, "lib3mf_selectnode_getinputd"); + lib3mf_clampnode_getinputmin = loadFunctionByLookup(lookupMethod, "lib3mf_clampnode_getinputmin"); + lib3mf_clampnode_getinputmax = loadFunctionByLookup(lookupMethod, "lib3mf_clampnode_getinputmax"); + lib3mf_composevectornode_getinputx = loadFunctionByLookup(lookupMethod, "lib3mf_composevectornode_getinputx"); + lib3mf_composevectornode_getinputy = loadFunctionByLookup(lookupMethod, "lib3mf_composevectornode_getinputy"); + lib3mf_composevectornode_getinputz = loadFunctionByLookup(lookupMethod, "lib3mf_composevectornode_getinputz"); + lib3mf_composevectornode_getoutputresult = loadFunctionByLookup(lookupMethod, "lib3mf_composevectornode_getoutputresult"); + lib3mf_decomposevectornode_getinputa = loadFunctionByLookup(lookupMethod, "lib3mf_decomposevectornode_getinputa"); + lib3mf_decomposevectornode_getoutputx = loadFunctionByLookup(lookupMethod, "lib3mf_decomposevectornode_getoutputx"); + lib3mf_decomposevectornode_getoutputy = loadFunctionByLookup(lookupMethod, "lib3mf_decomposevectornode_getoutputy"); + lib3mf_decomposevectornode_getoutputz = loadFunctionByLookup(lookupMethod, "lib3mf_decomposevectornode_getoutputz"); + lib3mf_composematrixnode_getinputm00 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm00"); + lib3mf_composematrixnode_getinputm01 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm01"); + lib3mf_composematrixnode_getinputm02 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm02"); + lib3mf_composematrixnode_getinputm03 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm03"); + lib3mf_composematrixnode_getinputm10 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm10"); + lib3mf_composematrixnode_getinputm11 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm11"); + lib3mf_composematrixnode_getinputm12 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm12"); + lib3mf_composematrixnode_getinputm13 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm13"); + lib3mf_composematrixnode_getinputm20 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm20"); + lib3mf_composematrixnode_getinputm21 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm21"); + lib3mf_composematrixnode_getinputm22 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm22"); + lib3mf_composematrixnode_getinputm23 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm23"); + lib3mf_composematrixnode_getinputm30 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm30"); + lib3mf_composematrixnode_getinputm31 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm31"); + lib3mf_composematrixnode_getinputm32 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm32"); + lib3mf_composematrixnode_getinputm33 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm33"); + lib3mf_composematrixnode_getoutputresult = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getoutputresult"); + lib3mf_matrixfromrowsnode_getinputa = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromrowsnode_getinputa"); + lib3mf_matrixfromrowsnode_getinputb = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromrowsnode_getinputb"); + lib3mf_matrixfromrowsnode_getinputc = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromrowsnode_getinputc"); + lib3mf_matrixfromrowsnode_getinputd = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromrowsnode_getinputd"); + lib3mf_matrixfromrowsnode_getoutputresult = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromrowsnode_getoutputresult"); + lib3mf_matrixfromcolumnsnode_getinputa = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromcolumnsnode_getinputa"); + lib3mf_matrixfromcolumnsnode_getinputb = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromcolumnsnode_getinputb"); + lib3mf_matrixfromcolumnsnode_getinputc = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromcolumnsnode_getinputc"); + lib3mf_matrixfromcolumnsnode_getinputd = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromcolumnsnode_getinputd"); + lib3mf_matrixfromcolumnsnode_getoutputresult = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromcolumnsnode_getoutputresult"); + lib3mf_constantnode_setconstant = loadFunctionByLookup(lookupMethod, "lib3mf_constantnode_setconstant"); + lib3mf_constantnode_getconstant = loadFunctionByLookup(lookupMethod, "lib3mf_constantnode_getconstant"); + lib3mf_constantnode_getoutputvalue = loadFunctionByLookup(lookupMethod, "lib3mf_constantnode_getoutputvalue"); + lib3mf_constvecnode_setvector = loadFunctionByLookup(lookupMethod, "lib3mf_constvecnode_setvector"); + lib3mf_constvecnode_getvector = loadFunctionByLookup(lookupMethod, "lib3mf_constvecnode_getvector"); + lib3mf_constvecnode_getoutputvector = loadFunctionByLookup(lookupMethod, "lib3mf_constvecnode_getoutputvector"); + lib3mf_constmatnode_setmatrix = loadFunctionByLookup(lookupMethod, "lib3mf_constmatnode_setmatrix"); + lib3mf_constmatnode_getmatrix = loadFunctionByLookup(lookupMethod, "lib3mf_constmatnode_getmatrix"); + lib3mf_constmatnode_getoutputmatrix = loadFunctionByLookup(lookupMethod, "lib3mf_constmatnode_getoutputmatrix"); + lib3mf_meshnode_getinputmesh = loadFunctionByLookup(lookupMethod, "lib3mf_meshnode_getinputmesh"); + lib3mf_meshnode_getinputpos = loadFunctionByLookup(lookupMethod, "lib3mf_meshnode_getinputpos"); + lib3mf_meshnode_getoutputdistance = loadFunctionByLookup(lookupMethod, "lib3mf_meshnode_getoutputdistance"); + lib3mf_unsignedmeshnode_getinputmesh = loadFunctionByLookup(lookupMethod, "lib3mf_unsignedmeshnode_getinputmesh"); + lib3mf_unsignedmeshnode_getinputpos = loadFunctionByLookup(lookupMethod, "lib3mf_unsignedmeshnode_getinputpos"); + lib3mf_unsignedmeshnode_getoutputdistance = loadFunctionByLookup(lookupMethod, "lib3mf_unsignedmeshnode_getoutputdistance"); + lib3mf_beamlatticenode_getinputbeamlattice = loadFunctionByLookup(lookupMethod, "lib3mf_beamlatticenode_getinputbeamlattice"); + lib3mf_beamlatticenode_getinputpos = loadFunctionByLookup(lookupMethod, "lib3mf_beamlatticenode_getinputpos"); + lib3mf_beamlatticenode_getoutputdistance = loadFunctionByLookup(lookupMethod, "lib3mf_beamlatticenode_getoutputdistance"); + lib3mf_beamlatticenode_setaccuraterange = loadFunctionByLookup(lookupMethod, "lib3mf_beamlatticenode_setaccuraterange"); + lib3mf_beamlatticenode_getaccuraterange = loadFunctionByLookup(lookupMethod, "lib3mf_beamlatticenode_getaccuraterange"); + lib3mf_functiongradientnode_getinputfunctionid = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_getinputfunctionid"); + lib3mf_functiongradientnode_getinputpos = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_getinputpos"); + lib3mf_functiongradientnode_getinputstep = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_getinputstep"); + lib3mf_functiongradientnode_setscalaroutputname = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_setscalaroutputname"); + lib3mf_functiongradientnode_getscalaroutputname = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_getscalaroutputname"); + lib3mf_functiongradientnode_setvectorinputname = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_setvectorinputname"); + lib3mf_functiongradientnode_getvectorinputname = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_getvectorinputname"); + lib3mf_functiongradientnode_getoutputnormalizedgradient = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_getoutputnormalizedgradient"); + lib3mf_functiongradientnode_getoutputgradient = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_getoutputgradient"); + lib3mf_functiongradientnode_getoutputmagnitude = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_getoutputmagnitude"); + lib3mf_normalizedistancenode_getinputfunctionid = loadFunctionByLookup(lookupMethod, "lib3mf_normalizedistancenode_getinputfunctionid"); + lib3mf_normalizedistancenode_getinputpos = loadFunctionByLookup(lookupMethod, "lib3mf_normalizedistancenode_getinputpos"); + lib3mf_normalizedistancenode_getinputstep = loadFunctionByLookup(lookupMethod, "lib3mf_normalizedistancenode_getinputstep"); + lib3mf_normalizedistancenode_setscalaroutputname = loadFunctionByLookup(lookupMethod, "lib3mf_normalizedistancenode_setscalaroutputname"); + lib3mf_normalizedistancenode_getscalaroutputname = loadFunctionByLookup(lookupMethod, "lib3mf_normalizedistancenode_getscalaroutputname"); + lib3mf_normalizedistancenode_setvectorinputname = loadFunctionByLookup(lookupMethod, "lib3mf_normalizedistancenode_setvectorinputname"); + lib3mf_normalizedistancenode_getvectorinputname = loadFunctionByLookup(lookupMethod, "lib3mf_normalizedistancenode_getvectorinputname"); + lib3mf_normalizedistancenode_getoutputresult = loadFunctionByLookup(lookupMethod, "lib3mf_normalizedistancenode_getoutputresult"); + lib3mf_functioncallnode_getinputfunctionid = loadFunctionByLookup(lookupMethod, "lib3mf_functioncallnode_getinputfunctionid"); + lib3mf_nodeiterator_getcurrent = loadFunctionByLookup(lookupMethod, "lib3mf_nodeiterator_getcurrent"); + lib3mf_function_getdisplayname = loadFunctionByLookup(lookupMethod, "lib3mf_function_getdisplayname"); + lib3mf_function_setdisplayname = loadFunctionByLookup(lookupMethod, "lib3mf_function_setdisplayname"); + lib3mf_function_addinput = loadFunctionByLookup(lookupMethod, "lib3mf_function_addinput"); + lib3mf_function_getinputs = loadFunctionByLookup(lookupMethod, "lib3mf_function_getinputs"); + lib3mf_function_removeinput = loadFunctionByLookup(lookupMethod, "lib3mf_function_removeinput"); + lib3mf_function_addoutput = loadFunctionByLookup(lookupMethod, "lib3mf_function_addoutput"); + lib3mf_function_getoutputs = loadFunctionByLookup(lookupMethod, "lib3mf_function_getoutputs"); + lib3mf_function_removeoutput = loadFunctionByLookup(lookupMethod, "lib3mf_function_removeoutput"); + lib3mf_function_findinput = loadFunctionByLookup(lookupMethod, "lib3mf_function_findinput"); + lib3mf_function_findoutput = loadFunctionByLookup(lookupMethod, "lib3mf_function_findoutput"); + lib3mf_implicitfunction_getidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_getidentifier"); + lib3mf_implicitfunction_setidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_setidentifier"); + lib3mf_implicitfunction_addnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addnode"); + lib3mf_implicitfunction_addsinnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addsinnode"); + lib3mf_implicitfunction_addcosnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addcosnode"); + lib3mf_implicitfunction_addtannode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addtannode"); + lib3mf_implicitfunction_addarcsinnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addarcsinnode"); + lib3mf_implicitfunction_addarccosnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addarccosnode"); + lib3mf_implicitfunction_addarctan2node = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addarctan2node"); + lib3mf_implicitfunction_addsinhnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addsinhnode"); + lib3mf_implicitfunction_addcoshnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addcoshnode"); + lib3mf_implicitfunction_addtanhnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addtanhnode"); + lib3mf_implicitfunction_addroundnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addroundnode"); + lib3mf_implicitfunction_addceilnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addceilnode"); + lib3mf_implicitfunction_addfloornode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addfloornode"); + lib3mf_implicitfunction_addsignnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addsignnode"); + lib3mf_implicitfunction_addfractnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addfractnode"); + lib3mf_implicitfunction_addabsnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addabsnode"); + lib3mf_implicitfunction_addexpnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addexpnode"); + lib3mf_implicitfunction_addlognode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addlognode"); + lib3mf_implicitfunction_addlog2node = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addlog2node"); + lib3mf_implicitfunction_addlog10node = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addlog10node"); + lib3mf_implicitfunction_addlengthnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addlengthnode"); + lib3mf_implicitfunction_addtransposenode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addtransposenode"); + lib3mf_implicitfunction_addinversenode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addinversenode"); + lib3mf_implicitfunction_addsqrtnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addsqrtnode"); + lib3mf_implicitfunction_addresourceidnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addresourceidnode"); + lib3mf_implicitfunction_addadditionnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addadditionnode"); + lib3mf_implicitfunction_addsubtractionnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addsubtractionnode"); + lib3mf_implicitfunction_addmultiplicationnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addmultiplicationnode"); + lib3mf_implicitfunction_adddivisionnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_adddivisionnode"); + lib3mf_implicitfunction_adddotnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_adddotnode"); + lib3mf_implicitfunction_addcrossnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addcrossnode"); + lib3mf_implicitfunction_addmatvecmultiplicationnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addmatvecmultiplicationnode"); + lib3mf_implicitfunction_addminnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addminnode"); + lib3mf_implicitfunction_addmaxnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addmaxnode"); + lib3mf_implicitfunction_addfmodnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addfmodnode"); + lib3mf_implicitfunction_addpownode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addpownode"); + lib3mf_implicitfunction_addselectnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addselectnode"); + lib3mf_implicitfunction_addclampnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addclampnode"); + lib3mf_implicitfunction_addcomposevectornode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addcomposevectornode"); + lib3mf_implicitfunction_addvectorfromscalarnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addvectorfromscalarnode"); + lib3mf_implicitfunction_adddecomposevectornode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_adddecomposevectornode"); + lib3mf_implicitfunction_addcomposematrixnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addcomposematrixnode"); + lib3mf_implicitfunction_addmatrixfromrowsnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addmatrixfromrowsnode"); + lib3mf_implicitfunction_addmatrixfromcolumnsnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addmatrixfromcolumnsnode"); + lib3mf_implicitfunction_addconstantnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addconstantnode"); + lib3mf_implicitfunction_addconstvecnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addconstvecnode"); + lib3mf_implicitfunction_addconstmatnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addconstmatnode"); + lib3mf_implicitfunction_addmeshnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addmeshnode"); + lib3mf_implicitfunction_addunsignedmeshnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addunsignedmeshnode"); + lib3mf_implicitfunction_addbeamlatticenode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addbeamlatticenode"); + lib3mf_implicitfunction_addfunctiongradientnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addfunctiongradientnode"); + lib3mf_implicitfunction_addnormalizedistancenode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addnormalizedistancenode"); + lib3mf_implicitfunction_addfunctioncallnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addfunctioncallnode"); + lib3mf_implicitfunction_getnodes = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_getnodes"); + lib3mf_implicitfunction_removenode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_removenode"); + lib3mf_implicitfunction_addlink = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addlink"); + lib3mf_implicitfunction_addlinkbynames = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addlinkbynames"); + lib3mf_implicitfunction_clear = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_clear"); + lib3mf_implicitfunction_sortnodestopologically = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_sortnodestopologically"); + lib3mf_functionfromimage3d_getimage3d = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_getimage3d"); + lib3mf_functionfromimage3d_setimage3d = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_setimage3d"); + lib3mf_functionfromimage3d_setfilter = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_setfilter"); + lib3mf_functionfromimage3d_getfilter = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_getfilter"); + lib3mf_functionfromimage3d_settilestyles = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_settilestyles"); + lib3mf_functionfromimage3d_gettilestyles = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_gettilestyles"); + lib3mf_functionfromimage3d_getoffset = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_getoffset"); + lib3mf_functionfromimage3d_setoffset = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_setoffset"); + lib3mf_functionfromimage3d_getscale = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_getscale"); + lib3mf_functionfromimage3d_setscale = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_setscale"); + lib3mf_builditem_getobjectresource = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_getobjectresource"); + lib3mf_builditem_getuuid = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_getuuid"); + lib3mf_builditem_setuuid = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_setuuid"); + lib3mf_builditem_getobjectresourceid = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_getobjectresourceid"); + lib3mf_builditem_hasobjecttransform = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_hasobjecttransform"); + lib3mf_builditem_getobjecttransform = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_getobjecttransform"); + lib3mf_builditem_setobjecttransform = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_setobjecttransform"); + lib3mf_builditem_getpartnumber = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_getpartnumber"); + lib3mf_builditem_setpartnumber = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_setpartnumber"); + lib3mf_builditem_getmetadatagroup = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_getmetadatagroup"); + lib3mf_builditem_getoutbox = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_getoutbox"); + lib3mf_builditemiterator_movenext = loadFunctionByLookup(lookupMethod, "lib3mf_builditemiterator_movenext"); + lib3mf_builditemiterator_moveprevious = loadFunctionByLookup(lookupMethod, "lib3mf_builditemiterator_moveprevious"); + lib3mf_builditemiterator_getcurrent = loadFunctionByLookup(lookupMethod, "lib3mf_builditemiterator_getcurrent"); + lib3mf_builditemiterator_clone = loadFunctionByLookup(lookupMethod, "lib3mf_builditemiterator_clone"); + lib3mf_builditemiterator_count = loadFunctionByLookup(lookupMethod, "lib3mf_builditemiterator_count"); + lib3mf_slice_setvertices = loadFunctionByLookup(lookupMethod, "lib3mf_slice_setvertices"); + lib3mf_slice_getvertices = loadFunctionByLookup(lookupMethod, "lib3mf_slice_getvertices"); + lib3mf_slice_getvertexcount = loadFunctionByLookup(lookupMethod, "lib3mf_slice_getvertexcount"); + lib3mf_slice_addpolygon = loadFunctionByLookup(lookupMethod, "lib3mf_slice_addpolygon"); + lib3mf_slice_getpolygoncount = loadFunctionByLookup(lookupMethod, "lib3mf_slice_getpolygoncount"); + lib3mf_slice_setpolygonindices = loadFunctionByLookup(lookupMethod, "lib3mf_slice_setpolygonindices"); + lib3mf_slice_getpolygonindices = loadFunctionByLookup(lookupMethod, "lib3mf_slice_getpolygonindices"); + lib3mf_slice_getpolygonindexcount = loadFunctionByLookup(lookupMethod, "lib3mf_slice_getpolygonindexcount"); + lib3mf_slice_getztop = loadFunctionByLookup(lookupMethod, "lib3mf_slice_getztop"); + lib3mf_slicestack_getbottomz = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_getbottomz"); + lib3mf_slicestack_getslicecount = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_getslicecount"); + lib3mf_slicestack_getslice = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_getslice"); + lib3mf_slicestack_addslice = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_addslice"); + lib3mf_slicestack_getslicerefcount = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_getslicerefcount"); + lib3mf_slicestack_addslicestackreference = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_addslicestackreference"); + lib3mf_slicestack_getslicestackreference = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_getslicestackreference"); + lib3mf_slicestack_collapseslicereferences = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_collapseslicereferences"); + lib3mf_slicestack_setownpath = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_setownpath"); + lib3mf_slicestack_getownpath = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_getownpath"); + lib3mf_consumer_getconsumerid = loadFunctionByLookup(lookupMethod, "lib3mf_consumer_getconsumerid"); + lib3mf_consumer_getkeyid = loadFunctionByLookup(lookupMethod, "lib3mf_consumer_getkeyid"); + lib3mf_consumer_getkeyvalue = loadFunctionByLookup(lookupMethod, "lib3mf_consumer_getkeyvalue"); + lib3mf_accessright_getconsumer = loadFunctionByLookup(lookupMethod, "lib3mf_accessright_getconsumer"); + lib3mf_accessright_getwrappingalgorithm = loadFunctionByLookup(lookupMethod, "lib3mf_accessright_getwrappingalgorithm"); + lib3mf_accessright_getmgfalgorithm = loadFunctionByLookup(lookupMethod, "lib3mf_accessright_getmgfalgorithm"); + lib3mf_accessright_getdigestmethod = loadFunctionByLookup(lookupMethod, "lib3mf_accessright_getdigestmethod"); + lib3mf_contentencryptionparams_getencryptionalgorithm = loadFunctionByLookup(lookupMethod, "lib3mf_contentencryptionparams_getencryptionalgorithm"); + lib3mf_contentencryptionparams_getkey = loadFunctionByLookup(lookupMethod, "lib3mf_contentencryptionparams_getkey"); + lib3mf_contentencryptionparams_getinitializationvector = loadFunctionByLookup(lookupMethod, "lib3mf_contentencryptionparams_getinitializationvector"); + lib3mf_contentencryptionparams_getauthenticationtag = loadFunctionByLookup(lookupMethod, "lib3mf_contentencryptionparams_getauthenticationtag"); + lib3mf_contentencryptionparams_setauthenticationtag = loadFunctionByLookup(lookupMethod, "lib3mf_contentencryptionparams_setauthenticationtag"); + lib3mf_contentencryptionparams_getadditionalauthenticationdata = loadFunctionByLookup(lookupMethod, "lib3mf_contentencryptionparams_getadditionalauthenticationdata"); + lib3mf_contentencryptionparams_getdescriptor = loadFunctionByLookup(lookupMethod, "lib3mf_contentencryptionparams_getdescriptor"); + lib3mf_contentencryptionparams_getkeyuuid = loadFunctionByLookup(lookupMethod, "lib3mf_contentencryptionparams_getkeyuuid"); + lib3mf_resourcedata_getpath = loadFunctionByLookup(lookupMethod, "lib3mf_resourcedata_getpath"); + lib3mf_resourcedata_getencryptionalgorithm = loadFunctionByLookup(lookupMethod, "lib3mf_resourcedata_getencryptionalgorithm"); + lib3mf_resourcedata_getcompression = loadFunctionByLookup(lookupMethod, "lib3mf_resourcedata_getcompression"); + lib3mf_resourcedata_getadditionalauthenticationdata = loadFunctionByLookup(lookupMethod, "lib3mf_resourcedata_getadditionalauthenticationdata"); + lib3mf_resourcedatagroup_getkeyuuid = loadFunctionByLookup(lookupMethod, "lib3mf_resourcedatagroup_getkeyuuid"); + lib3mf_resourcedatagroup_addaccessright = loadFunctionByLookup(lookupMethod, "lib3mf_resourcedatagroup_addaccessright"); + lib3mf_resourcedatagroup_findaccessrightbyconsumer = loadFunctionByLookup(lookupMethod, "lib3mf_resourcedatagroup_findaccessrightbyconsumer"); + lib3mf_resourcedatagroup_removeaccessright = loadFunctionByLookup(lookupMethod, "lib3mf_resourcedatagroup_removeaccessright"); + lib3mf_keystore_addconsumer = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_addconsumer"); + lib3mf_keystore_getconsumercount = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_getconsumercount"); + lib3mf_keystore_getconsumer = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_getconsumer"); + lib3mf_keystore_removeconsumer = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_removeconsumer"); + lib3mf_keystore_findconsumer = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_findconsumer"); + lib3mf_keystore_getresourcedatagroupcount = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_getresourcedatagroupcount"); + lib3mf_keystore_addresourcedatagroup = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_addresourcedatagroup"); + lib3mf_keystore_getresourcedatagroup = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_getresourcedatagroup"); + lib3mf_keystore_removeresourcedatagroup = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_removeresourcedatagroup"); + lib3mf_keystore_findresourcedatagroup = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_findresourcedatagroup"); + lib3mf_keystore_addresourcedata = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_addresourcedata"); + lib3mf_keystore_removeresourcedata = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_removeresourcedata"); + lib3mf_keystore_findresourcedata = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_findresourcedata"); + lib3mf_keystore_getresourcedatacount = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_getresourcedatacount"); + lib3mf_keystore_getresourcedata = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_getresourcedata"); + lib3mf_keystore_getuuid = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_getuuid"); + lib3mf_keystore_setuuid = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_setuuid"); + lib3mf_model_rootmodelpart = loadFunctionByLookup(lookupMethod, "lib3mf_model_rootmodelpart"); + lib3mf_model_findorcreatepackagepart = loadFunctionByLookup(lookupMethod, "lib3mf_model_findorcreatepackagepart"); + lib3mf_model_setunit = loadFunctionByLookup(lookupMethod, "lib3mf_model_setunit"); + lib3mf_model_getunit = loadFunctionByLookup(lookupMethod, "lib3mf_model_getunit"); + lib3mf_model_getlanguage = loadFunctionByLookup(lookupMethod, "lib3mf_model_getlanguage"); + lib3mf_model_setlanguage = loadFunctionByLookup(lookupMethod, "lib3mf_model_setlanguage"); + lib3mf_model_querywriter = loadFunctionByLookup(lookupMethod, "lib3mf_model_querywriter"); + lib3mf_model_queryreader = loadFunctionByLookup(lookupMethod, "lib3mf_model_queryreader"); + lib3mf_model_getresourcebyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getresourcebyid"); + lib3mf_model_gettexture2dbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_gettexture2dbyid"); + lib3mf_model_getpropertytypebyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getpropertytypebyid"); + lib3mf_model_getbasematerialgroupbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getbasematerialgroupbyid"); + lib3mf_model_gettexture2dgroupbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_gettexture2dgroupbyid"); + lib3mf_model_getcompositematerialsbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getcompositematerialsbyid"); + lib3mf_model_getmultipropertygroupbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getmultipropertygroupbyid"); + lib3mf_model_getmeshobjectbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getmeshobjectbyid"); + lib3mf_model_getcomponentsobjectbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getcomponentsobjectbyid"); + lib3mf_model_getbooleanobjectbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getbooleanobjectbyid"); + lib3mf_model_getcolorgroupbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getcolorgroupbyid"); + lib3mf_model_getslicestackbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getslicestackbyid"); + lib3mf_model_getlevelsetbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getlevelsetbyid"); + lib3mf_model_getbuilduuid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getbuilduuid"); + lib3mf_model_setbuilduuid = loadFunctionByLookup(lookupMethod, "lib3mf_model_setbuilduuid"); + lib3mf_model_getbuilditems = loadFunctionByLookup(lookupMethod, "lib3mf_model_getbuilditems"); + lib3mf_model_getoutbox = loadFunctionByLookup(lookupMethod, "lib3mf_model_getoutbox"); + lib3mf_model_getresources = loadFunctionByLookup(lookupMethod, "lib3mf_model_getresources"); + lib3mf_model_getobjects = loadFunctionByLookup(lookupMethod, "lib3mf_model_getobjects"); + lib3mf_model_getmeshobjects = loadFunctionByLookup(lookupMethod, "lib3mf_model_getmeshobjects"); + lib3mf_model_getcomponentsobjects = loadFunctionByLookup(lookupMethod, "lib3mf_model_getcomponentsobjects"); + lib3mf_model_getbooleanobjects = loadFunctionByLookup(lookupMethod, "lib3mf_model_getbooleanobjects"); + lib3mf_model_gettexture2ds = loadFunctionByLookup(lookupMethod, "lib3mf_model_gettexture2ds"); + lib3mf_model_getbasematerialgroups = loadFunctionByLookup(lookupMethod, "lib3mf_model_getbasematerialgroups"); + lib3mf_model_getcolorgroups = loadFunctionByLookup(lookupMethod, "lib3mf_model_getcolorgroups"); + lib3mf_model_gettexture2dgroups = loadFunctionByLookup(lookupMethod, "lib3mf_model_gettexture2dgroups"); + lib3mf_model_getcompositematerials = loadFunctionByLookup(lookupMethod, "lib3mf_model_getcompositematerials"); + lib3mf_model_getmultipropertygroups = loadFunctionByLookup(lookupMethod, "lib3mf_model_getmultipropertygroups"); + lib3mf_model_getslicestacks = loadFunctionByLookup(lookupMethod, "lib3mf_model_getslicestacks"); + lib3mf_model_getimage3ds = loadFunctionByLookup(lookupMethod, "lib3mf_model_getimage3ds"); + lib3mf_model_mergetomodel = loadFunctionByLookup(lookupMethod, "lib3mf_model_mergetomodel"); + lib3mf_model_mergefrommodel = loadFunctionByLookup(lookupMethod, "lib3mf_model_mergefrommodel"); + lib3mf_model_addmeshobject = loadFunctionByLookup(lookupMethod, "lib3mf_model_addmeshobject"); + lib3mf_model_addcomponentsobject = loadFunctionByLookup(lookupMethod, "lib3mf_model_addcomponentsobject"); + lib3mf_model_addbooleanobject = loadFunctionByLookup(lookupMethod, "lib3mf_model_addbooleanobject"); + lib3mf_model_addslicestack = loadFunctionByLookup(lookupMethod, "lib3mf_model_addslicestack"); + lib3mf_model_addtexture2dfromattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_addtexture2dfromattachment"); + lib3mf_model_addbasematerialgroup = loadFunctionByLookup(lookupMethod, "lib3mf_model_addbasematerialgroup"); + lib3mf_model_addcolorgroup = loadFunctionByLookup(lookupMethod, "lib3mf_model_addcolorgroup"); + lib3mf_model_addtexture2dgroup = loadFunctionByLookup(lookupMethod, "lib3mf_model_addtexture2dgroup"); + lib3mf_model_addcompositematerials = loadFunctionByLookup(lookupMethod, "lib3mf_model_addcompositematerials"); + lib3mf_model_addmultipropertygroup = loadFunctionByLookup(lookupMethod, "lib3mf_model_addmultipropertygroup"); + lib3mf_model_addimagestack = loadFunctionByLookup(lookupMethod, "lib3mf_model_addimagestack"); + lib3mf_model_getimagestackbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getimagestackbyid"); + lib3mf_model_addbuilditem = loadFunctionByLookup(lookupMethod, "lib3mf_model_addbuilditem"); + lib3mf_model_removebuilditem = loadFunctionByLookup(lookupMethod, "lib3mf_model_removebuilditem"); + lib3mf_model_getmetadatagroup = loadFunctionByLookup(lookupMethod, "lib3mf_model_getmetadatagroup"); + lib3mf_model_addattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_addattachment"); + lib3mf_model_removeattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_removeattachment"); + lib3mf_model_getattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_getattachment"); + lib3mf_model_findattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_findattachment"); + lib3mf_model_getattachmentcount = loadFunctionByLookup(lookupMethod, "lib3mf_model_getattachmentcount"); + lib3mf_model_haspackagethumbnailattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_haspackagethumbnailattachment"); + lib3mf_model_createpackagethumbnailattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_createpackagethumbnailattachment"); + lib3mf_model_getpackagethumbnailattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_getpackagethumbnailattachment"); + lib3mf_model_removepackagethumbnailattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_removepackagethumbnailattachment"); + lib3mf_model_addcustomcontenttype = loadFunctionByLookup(lookupMethod, "lib3mf_model_addcustomcontenttype"); + lib3mf_model_removecustomcontenttype = loadFunctionByLookup(lookupMethod, "lib3mf_model_removecustomcontenttype"); + lib3mf_model_setrandomnumbercallback = loadFunctionByLookup(lookupMethod, "lib3mf_model_setrandomnumbercallback"); + lib3mf_model_getkeystore = loadFunctionByLookup(lookupMethod, "lib3mf_model_getkeystore"); + lib3mf_model_getfunctions = loadFunctionByLookup(lookupMethod, "lib3mf_model_getfunctions"); + lib3mf_model_addimplicitfunction = loadFunctionByLookup(lookupMethod, "lib3mf_model_addimplicitfunction"); + lib3mf_model_addfunctionfromimage3d = loadFunctionByLookup(lookupMethod, "lib3mf_model_addfunctionfromimage3d"); + lib3mf_model_addvolumedata = loadFunctionByLookup(lookupMethod, "lib3mf_model_addvolumedata"); + lib3mf_model_addlevelset = loadFunctionByLookup(lookupMethod, "lib3mf_model_addlevelset"); + lib3mf_model_getlevelsets = loadFunctionByLookup(lookupMethod, "lib3mf_model_getlevelsets"); + lib3mf_model_removeresource = loadFunctionByLookup(lookupMethod, "lib3mf_model_removeresource"); + } + + protected void checkError(Base instance, int errorCode) throws Lib3MFException { + if (instance != null && instance.mWrapper != this) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDCAST, "invalid wrapper call"); + } + if (errorCode != Lib3MFException.LIB3MF_SUCCESS) { + if (instance != null) { + GetLastErrorResult result = getLastError(instance); + throw new Lib3MFException(errorCode, result.LastErrorString); + } else { + throw new Lib3MFException(errorCode, ""); + } + } + } + + private com.sun.jna.Function loadFunctionByLookup(com.sun.jna.Function lookupMethod, String functionName) throws Lib3MFException { + byte[] bytes = functionName.getBytes(StandardCharsets.UTF_8); + Memory name = new Memory(bytes.length+1); + name.write(0, bytes, 0, bytes.length); + name.setByte(bytes.length, (byte)0); + Pointer address = new Memory(8); + java.lang.Object[] addressParam = new java.lang.Object[]{name, address}; + checkError(null, lookupMethod.invokeInt(addressParam)); + return com.sun.jna.Function.getFunction(address.getPointer(0)); + } + + /** + * retrieves the binary version of this library. + * + * @return GetLibraryVersion Result Tuple + * @throws Lib3MFException + */ + public GetLibraryVersionResult getLibraryVersion() throws Lib3MFException { + Pointer bufferMajor = new Memory(4); + Pointer bufferMinor = new Memory(4); + Pointer bufferMicro = new Memory(4); + checkError(null, lib3mf_getlibraryversion.invokeInt(new java.lang.Object[]{bufferMajor, bufferMinor, bufferMicro})); + GetLibraryVersionResult returnTuple = new GetLibraryVersionResult(); + returnTuple.Major = bufferMajor.getInt(0); + returnTuple.Minor = bufferMinor.getInt(0); + returnTuple.Micro = bufferMicro.getInt(0); + return returnTuple; + } + + public static class GetLibraryVersionResult { + /** + * returns the major version of this library + */ + public int Major; + + /** + * returns the minor version of this library + */ + public int Minor; + + /** + * returns the micro version of this library + */ + public int Micro; + + } + /** + * retrieves prerelease information of this library. + * + * @return GetPrereleaseInformation Result Tuple + * @throws Lib3MFException + */ + public GetPrereleaseInformationResult getPrereleaseInformation() throws Lib3MFException { + Pointer bufferHasPrereleaseInfo = new Memory(1); + Pointer bytesNeededPrereleaseInfo = new Memory(4); + checkError(null, lib3mf_getprereleaseinformation.invokeInt(new java.lang.Object[]{bufferHasPrereleaseInfo, 0, bytesNeededPrereleaseInfo, null})); + int sizePrereleaseInfo = bytesNeededPrereleaseInfo.getInt(0); + Pointer bufferPrereleaseInfo = new Memory(sizePrereleaseInfo); + checkError(null, lib3mf_getprereleaseinformation.invokeInt(new java.lang.Object[]{bufferHasPrereleaseInfo, sizePrereleaseInfo, bytesNeededPrereleaseInfo, bufferPrereleaseInfo})); + GetPrereleaseInformationResult returnTuple = new GetPrereleaseInformationResult(); + returnTuple.HasPrereleaseInfo = bufferHasPrereleaseInfo.getByte(0) != 0; + returnTuple.PrereleaseInfo = new String(bufferPrereleaseInfo.getByteArray(0, sizePrereleaseInfo - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetPrereleaseInformationResult { + /** + * Does the library provide prerelease version? + */ + public boolean HasPrereleaseInfo; + + /** + * retrieves prerelease information of this library. + */ + public String PrereleaseInfo; + + } + /** + * retrieves build information of this library. + * + * @return GetBuildInformation Result Tuple + * @throws Lib3MFException + */ + public GetBuildInformationResult getBuildInformation() throws Lib3MFException { + Pointer bufferHasBuildInfo = new Memory(1); + Pointer bytesNeededBuildInformation = new Memory(4); + checkError(null, lib3mf_getbuildinformation.invokeInt(new java.lang.Object[]{bufferHasBuildInfo, 0, bytesNeededBuildInformation, null})); + int sizeBuildInformation = bytesNeededBuildInformation.getInt(0); + Pointer bufferBuildInformation = new Memory(sizeBuildInformation); + checkError(null, lib3mf_getbuildinformation.invokeInt(new java.lang.Object[]{bufferHasBuildInfo, sizeBuildInformation, bytesNeededBuildInformation, bufferBuildInformation})); + GetBuildInformationResult returnTuple = new GetBuildInformationResult(); + returnTuple.HasBuildInfo = bufferHasBuildInfo.getByte(0) != 0; + returnTuple.BuildInformation = new String(bufferBuildInformation.getByteArray(0, sizeBuildInformation - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetBuildInformationResult { + /** + * Does the library provide build version? + */ + public boolean HasBuildInfo; + + /** + * retrieves build information of this library. + */ + public String BuildInformation; + + } + /** + * retrieves whether a specification is supported, and if so, which version. + * + * @param specificationURL URL of extension to check + * @return GetSpecificationVersion Result Tuple + * @throws Lib3MFException + */ + public GetSpecificationVersionResult getSpecificationVersion(String specificationURL) throws Lib3MFException { + byte[] bytesSpecificationURL = specificationURL.getBytes(StandardCharsets.UTF_8); + Memory bufferSpecificationURL = new Memory(bytesSpecificationURL.length + 1); + bufferSpecificationURL.write(0, bytesSpecificationURL, 0, bytesSpecificationURL.length); + bufferSpecificationURL.setByte(bytesSpecificationURL.length, (byte)0); + Pointer bufferIsSupported = new Memory(1); + Pointer bufferMajor = new Memory(4); + Pointer bufferMinor = new Memory(4); + Pointer bufferMicro = new Memory(4); + checkError(null, lib3mf_getspecificationversion.invokeInt(new java.lang.Object[]{bufferSpecificationURL, bufferIsSupported, bufferMajor, bufferMinor, bufferMicro})); + GetSpecificationVersionResult returnTuple = new GetSpecificationVersionResult(); + returnTuple.IsSupported = bufferIsSupported.getByte(0) != 0; + returnTuple.Major = bufferMajor.getInt(0); + returnTuple.Minor = bufferMinor.getInt(0); + returnTuple.Micro = bufferMicro.getInt(0); + return returnTuple; + } + + public static class GetSpecificationVersionResult { + /** + * returns whether this specification is supported + */ + public boolean IsSupported; + + /** + * returns the major version of the extension (if IsSupported) + */ + public int Major; + + /** + * returns the minor version of the extension (if IsSupported) + */ + public int Minor; + + /** + * returns the micro version of the extension (if IsSupported) + */ + public int Micro; + + } + /** + * creates an empty model instance. + * + * @return returns an empty model instance + * @throws Lib3MFException + */ + public Model createModel() throws Lib3MFException { + Pointer bufferModel = new Memory(8); + checkError(null, lib3mf_createmodel.invokeInt(new java.lang.Object[]{bufferModel})); + Pointer valueModel = bufferModel.getPointer(0); + Model model = null; + if (valueModel == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Model was a null pointer"); + } + model = this.PolymorphicFactory(valueModel, Model.class); + return model; + } + + /** + * releases shared ownership of an object instance + * + * @param instance the object instance to release + * @throws Lib3MFException + */ + public void release(Base instance) throws Lib3MFException { + Pointer instanceHandle = null; + if (instance != null) { + instanceHandle = instance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Instance is a null value."); + } + checkError(null, lib3mf_release.invokeInt(new java.lang.Object[]{instanceHandle})); + } + + /** + * acquires shared ownership of an object instance + * + * @param instance the object instance to acquire + * @throws Lib3MFException + */ + public void acquire(Base instance) throws Lib3MFException { + Pointer instanceHandle = null; + if (instance != null) { + instanceHandle = instance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Instance is a null value."); + } + checkError(null, lib3mf_acquire.invokeInt(new java.lang.Object[]{instanceHandle})); + } + + /** + * Sets the journal file path + * + * @param journalPath File name of the journal file + * @throws Lib3MFException + */ + public void setJournal(String journalPath) throws Lib3MFException { + byte[] bytesJournalPath = journalPath.getBytes(StandardCharsets.UTF_8); + Memory bufferJournalPath = new Memory(bytesJournalPath.length + 1); + bufferJournalPath.write(0, bytesJournalPath, 0, bytesJournalPath.length); + bufferJournalPath.setByte(bytesJournalPath.length, (byte)0); + checkError(null, lib3mf_setjournal.invokeInt(new java.lang.Object[]{bufferJournalPath})); + } + + /** + * Retrieves the last error string of an instance + * + * @param instance Object where the error occured. + * @return GetLastError Result Tuple + * @throws Lib3MFException + */ + public GetLastErrorResult getLastError(Base instance) throws Lib3MFException { + Pointer instanceHandle = null; + if (instance != null) { + instanceHandle = instance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Instance is a null value."); + } + Pointer bytesNeededLastErrorString = new Memory(4); + Pointer bufferHasLastError = new Memory(1); + checkError(null, lib3mf_getlasterror.invokeInt(new java.lang.Object[]{instanceHandle, 0, bytesNeededLastErrorString, null, bufferHasLastError})); + int sizeLastErrorString = bytesNeededLastErrorString.getInt(0); + Pointer bufferLastErrorString = new Memory(sizeLastErrorString); + checkError(null, lib3mf_getlasterror.invokeInt(new java.lang.Object[]{instanceHandle, sizeLastErrorString, bytesNeededLastErrorString, bufferLastErrorString, bufferHasLastError})); + GetLastErrorResult returnTuple = new GetLastErrorResult(); + returnTuple.LastErrorString = new String(bufferLastErrorString.getByteArray(0, sizeLastErrorString - 1), StandardCharsets.UTF_8); + returnTuple.HasLastError = bufferHasLastError.getByte(0) != 0; + return returnTuple; + } + + public static class GetLastErrorResult { + /** + * Last Error String + */ + public String LastErrorString; + + /** + * Returns if the instance has a last error. + */ + public boolean HasLastError; + + } + /** + * Returns the address of the SymbolLookupMethod + * + * @return Address of the SymbolAddressMethod + * @throws Lib3MFException + */ + public Pointer getSymbolLookupMethod() throws Lib3MFException { + Pointer bufferSymbolLookupMethod = new Memory(8); + checkError(null, lib3mf_getsymbollookupmethod.invokeInt(new java.lang.Object[]{bufferSymbolLookupMethod})); + return bufferSymbolLookupMethod.getPointer(0); + } + + /** + * Return an English text for a progress identifier.|Note: this is the only function you can call from your callback function. + * + * @param theProgressIdentifier the progress identifier that is passed to the callback function + * @return English text for the progress identifier + * @throws Lib3MFException + */ + public String retrieveProgressMessage(Lib3MFWrapper.ProgressIdentifier theProgressIdentifier) throws Lib3MFException { + Pointer bytesNeededProgressMessage = new Memory(4); + checkError(null, lib3mf_retrieveprogressmessage.invokeInt(new java.lang.Object[]{Lib3MFWrapper.EnumConversion.convertProgressIdentifierToConst(theProgressIdentifier), 0, bytesNeededProgressMessage, null})); + int sizeProgressMessage = bytesNeededProgressMessage.getInt(0); + Pointer bufferProgressMessage = new Memory(sizeProgressMessage); + checkError(null, lib3mf_retrieveprogressmessage.invokeInt(new java.lang.Object[]{Lib3MFWrapper.EnumConversion.convertProgressIdentifierToConst(theProgressIdentifier), sizeProgressMessage, bytesNeededProgressMessage, bufferProgressMessage})); + return new String(bufferProgressMessage.getByteArray(0, sizeProgressMessage - 1), StandardCharsets.UTF_8); + } + + /** + * Creates a Color from uint8 RGBA values + * + * @param red Red value of color (0-255) + * @param green Green value of color (0-255) + * @param blue Blue value of color (0-255) + * @param alpha Alpha value of color (0-255) + * @return Assembled color + * @throws Lib3MFException + */ + public Color rGBAToColor(byte red, byte green, byte blue, byte alpha) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + checkError(null, lib3mf_rgbatocolor.invokeInt(new java.lang.Object[]{red, green, blue, alpha, bufferTheColor})); + Color theColor = new Color(); + theColor.readFromPointer(bufferTheColor, 0); + return theColor; + } + + /** + * Creates a Color from uint8 RGBA values + * + * @param red Red value of color (0-1) + * @param green Green value of color (0-1) + * @param blue Blue value of color (0-1) + * @param alpha Alpha value of color (0-1) + * @return Assembled color + * @throws Lib3MFException + */ + public Color floatRGBAToColor(float red, float green, float blue, float alpha) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + checkError(null, lib3mf_floatrgbatocolor.invokeInt(new java.lang.Object[]{red, green, blue, alpha, bufferTheColor})); + Color theColor = new Color(); + theColor.readFromPointer(bufferTheColor, 0); + return theColor; + } + + /** + * Calculates uint8-RGBA-values from a Color + * + * @param theColor Color to handle + * @return ColorToRGBA Result Tuple + * @throws Lib3MFException + */ + public ColorToRGBAResult colorToRGBA(Color theColor) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + theColor.writeToPointer(bufferTheColor, 0); + Pointer bufferRed = new Memory(1); + Pointer bufferGreen = new Memory(1); + Pointer bufferBlue = new Memory(1); + Pointer bufferAlpha = new Memory(1); + checkError(null, lib3mf_colortorgba.invokeInt(new java.lang.Object[]{bufferTheColor, bufferRed, bufferGreen, bufferBlue, bufferAlpha})); + ColorToRGBAResult returnTuple = new ColorToRGBAResult(); + returnTuple.Red = bufferRed.getByte(0); + returnTuple.Green = bufferGreen.getByte(0); + returnTuple.Blue = bufferBlue.getByte(0); + returnTuple.Alpha = bufferAlpha.getByte(0); + return returnTuple; + } + + public static class ColorToRGBAResult { + /** + * Red value of color (0-255) + */ + public byte Red; + + /** + * Green value of color (0-255) + */ + public byte Green; + + /** + * Blue value of color (0-255) + */ + public byte Blue; + + /** + * Alpha value of color (0-255) + */ + public byte Alpha; + + } + /** + * Calculates float-RGBA-values from a Color + * + * @param theColor Color to handle + * @return ColorToFloatRGBA Result Tuple + * @throws Lib3MFException + */ + public ColorToFloatRGBAResult colorToFloatRGBA(Color theColor) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + theColor.writeToPointer(bufferTheColor, 0); + Pointer bufferRed = new Memory(4); + Pointer bufferGreen = new Memory(4); + Pointer bufferBlue = new Memory(4); + Pointer bufferAlpha = new Memory(4); + checkError(null, lib3mf_colortofloatrgba.invokeInt(new java.lang.Object[]{bufferTheColor, bufferRed, bufferGreen, bufferBlue, bufferAlpha})); + ColorToFloatRGBAResult returnTuple = new ColorToFloatRGBAResult(); + returnTuple.Red = bufferRed.getFloat(0); + returnTuple.Green = bufferGreen.getFloat(0); + returnTuple.Blue = bufferBlue.getFloat(0); + returnTuple.Alpha = bufferAlpha.getFloat(0); + return returnTuple; + } + + public static class ColorToFloatRGBAResult { + /** + * Red value of color (0-1) + */ + public float Red; + + /** + * Green value of color (0-1) + */ + public float Green; + + /** + * Blue value of color (0-1) + */ + public float Blue; + + /** + * Alpha value of color (0-1) + */ + public float Alpha; + + } + /** + * Creates an identity transform + * + * @return Transformation matrix. + * @throws Lib3MFException + */ + public Transform getIdentityTransform() throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + checkError(null, lib3mf_getidentitytransform.invokeInt(new java.lang.Object[]{bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * Creates a uniform scale transform + * + * @param factor Factor in X, Y and Z + * @return Transformation matrix. + * @throws Lib3MFException + */ + public Transform getUniformScaleTransform(float factor) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + checkError(null, lib3mf_getuniformscaletransform.invokeInt(new java.lang.Object[]{factor, bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * Creates a scale transform + * + * @param factorX Factor in X + * @param factorY Factor in Y + * @param factorZ Factor in Z + * @return Transformation matrix. + * @throws Lib3MFException + */ + public Transform getScaleTransform(float factorX, float factorY, float factorZ) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + checkError(null, lib3mf_getscaletransform.invokeInt(new java.lang.Object[]{factorX, factorY, factorZ, bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * Creates an translation transform + * + * @param vectorX Translation in X + * @param vectorY Translation in Y + * @param vectorZ Translation in Z + * @return Transformation matrix. + * @throws Lib3MFException + */ + public Transform getTranslationTransform(float vectorX, float vectorY, float vectorZ) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + checkError(null, lib3mf_gettranslationtransform.invokeInt(new java.lang.Object[]{vectorX, vectorY, vectorZ, bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * IMPORTANT: PolymorphicFactory method should not be used by application directly. + * It's designed to be used on Lib3MFHandle object only once. + * If it's used on any existing object as a form of dynamic cast then + * Lib3MFWrapper::acquireInstance(Base object) must be called after instantiating new object. + * This is important to keep reference count matching between application and library sides. + */ + public T PolymorphicFactory(Pointer handle, Class cls) { + if (handle == Pointer.NULL) + return null; + Class[] cArg = new Class[2]; + cArg[0] = Lib3MFWrapper.class; + cArg[1] = Pointer.class; + + try { + T obj = null; + Pointer bufferClassTypeId = new Memory(8); + checkError(null, lib3mf_base_classtypeid.invokeInt(new java.lang.Object[]{handle, bufferClassTypeId})); + long classTypeId = bufferClassTypeId.getLong(0); + + int msbId = (int)(classTypeId >> 32); + int lsbId = (int)classTypeId; + switch(msbId) { + case 0x0070021D: + switch(lsbId) { + case 0x73AA89FD: obj = (T)(new LogNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::LogNode" + } + break; + case 0x0437E27A: + switch(lsbId) { + case 0xEF740121: obj = (T)(new FunctionGradientNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionGradientNode" + } + break; + case 0x073F9103: + switch(lsbId) { + case 0x81BF250D: obj = (T)(new MaxNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MaxNode" + } + break; + case 0x0765C17C: + switch(lsbId) { + case 0x952F24E3: obj = (T)(new FunctionCallNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionCallNode" + } + break; + case 0x0C3B8536: + switch(lsbId) { + case 0x9E9B25D3: obj = (T)(new MetaDataGroup(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MetaDataGroup" + } + break; + case 0x0DCBEAFC: + switch(lsbId) { + case 0xF83F3AAC: obj = (T)(new MatrixFromColumnsNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MatrixFromColumnsNode" + } + break; + case 0x0E55A826: + switch(lsbId) { + case 0xD377483E: obj = (T)(new PackagePart(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::PackagePart" + } + break; + case 0x0F3A4EE9: + switch(lsbId) { + case 0x8F7FEC0C: obj = (T)(new BeamLatticeNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLatticeNode" + } + break; + case 0x10274A17: + switch(lsbId) { + case 0x57C729C0: obj = (T)(new ColorGroupIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroupIterator" + } + break; + case 0x106182D3: + switch(lsbId) { + case 0x8CA5CFE3: obj = (T)(new CrossNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::CrossNode" + } + break; + case 0x1127ED71: + switch(lsbId) { + case 0xE05A9BD4: obj = (T)(new SelectNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::SelectNode" + } + break; + case 0x13A2561F: + switch(lsbId) { + case 0x0CFB712A: obj = (T)(new ImageStack(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ImageStack" + } + break; + case 0x1A47A5E2: + switch(lsbId) { + case 0x58E22EF9: obj = (T)(new ResourceData(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceData" + } + break; + case 0x1CC9E0CC: + switch(lsbId) { + case 0x082253C6: obj = (T)(new KeyStore(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::KeyStore" + } + break; + case 0x1EF703D2: + switch(lsbId) { + case 0x98223F2A: obj = (T)(new FmodNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::FmodNode" + } + break; + case 0x2198BCF4: + switch(lsbId) { + case 0xD8DF9C40: obj = (T)(new Slice(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Slice" + } + break; + case 0x241FE6B4: + switch(lsbId) { + case 0x817C3FE4: obj = (T)(new MaterialMapping(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MaterialMapping" + } + break; + case 0x2614CC57: + switch(lsbId) { + case 0x2AF350B7: obj = (T)(new TanNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::TanNode" + } + break; + case 0x29985A62: + switch(lsbId) { + case 0x8251A9CD: obj = (T)(new UnsignedMeshNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::UnsignedMeshNode" + } + break; + case 0x2D86831D: + switch(lsbId) { + case 0xA59FBE72: obj = (T)(new Reader(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Reader" + } + break; + case 0x2DA2136F: + switch(lsbId) { + case 0x577A779C: obj = (T)(new Object(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Object" + } + break; + case 0x2E417B93: + switch(lsbId) { + case 0x351375E2: obj = (T)(new VectorFromScalarNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::VectorFromScalarNode" + } + break; + case 0x30CCDBE9: + switch(lsbId) { + case 0x0E00B55B: obj = (T)(new BeamSet(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BeamSet" + } + break; + case 0x30D55F4D: + switch(lsbId) { + case 0xB88FE0CA: obj = (T)(new Texture2DGroupIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroupIterator" + } + break; + case 0x3390243A: + switch(lsbId) { + case 0x8E2410F3: obj = (T)(new ExpNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ExpNode" + } + break; + case 0x385C42FC: + switch(lsbId) { + case 0x5609498A: obj = (T)(new AccessRight(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::AccessRight" + } + break; + case 0x392A0F4C: + switch(lsbId) { + case 0x041D249C: obj = (T)(new FloorNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::FloorNode" + } + break; + case 0x3B3A6DC6: + switch(lsbId) { + case 0xEC610497: obj = (T)(new MeshObject(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObject" + } + break; + case 0x3C7756A4: + switch(lsbId) { + case 0x56F2D089: obj = (T)(new SinhNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::SinhNode" + } + break; + case 0x3F8E5D08: + switch(lsbId) { + case 0x2F966B1B: obj = (T)(new ConstantNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ConstantNode" + } + break; + case 0x40E90353: + switch(lsbId) { + case 0x63ACE65E: obj = (T)(new FunctionIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionIterator" + } + break; + case 0x460F3515: + switch(lsbId) { + case 0xE2621DBE: obj = (T)(new ResourceIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceIterator" + } + break; + case 0x46F1DAC4: + switch(lsbId) { + case 0x0581B304: obj = (T)(new VolumeDataComposite(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::VolumeDataComposite" + } + break; + case 0x49C24B88: + switch(lsbId) { + case 0x40C01F7E: obj = (T)(new ComposeVectorNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ComposeVectorNode" + } + break; + case 0x4A993F91: + switch(lsbId) { + case 0xE1DE256D: obj = (T)(new CoshNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::CoshNode" + } + break; + case 0x4BD32B48: + switch(lsbId) { + case 0x70FFC03B: obj = (T)(new Texture2DIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DIterator" + } + break; + case 0x4DF17E76: + switch(lsbId) { + case 0x926221C2: obj = (T)(new FunctionReference(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionReference" + } + break; + case 0x4ECDB6A6: + switch(lsbId) { + case 0xF69F2BEB: obj = (T)(new Component(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Component" + } + break; + case 0x52F06268: + switch(lsbId) { + case 0xCD098EFE: obj = (T)(new Iterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Iterator" + } + break; + case 0x53601FD4: + switch(lsbId) { + case 0x32E3DEF4: obj = (T)(new MeshNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshNode" + } + break; + case 0x53E62FD6: + switch(lsbId) { + case 0x7F4D9A65: obj = (T)(new FractNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::FractNode" + } + break; + case 0x564DE421: + switch(lsbId) { + case 0x7ED7614A: obj = (T)(new ComponentsObjectIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObjectIterator" + } + break; + case 0x57A22369: + switch(lsbId) { + case 0x98DF5248: obj = (T)(new AdditionNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::AdditionNode" + } + break; + case 0x5950BB3E: + switch(lsbId) { + case 0xE8A82090: obj = (T)(new TriangleSet(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::TriangleSet" + } + break; + case 0x59BC328F: + switch(lsbId) { + case 0x6FB5C5FF: obj = (T)(new CosNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::CosNode" + } + break; + case 0x5A8164EC: + switch(lsbId) { + case 0xEDB03F09: obj = (T)(new Model(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Model" + } + break; + case 0x6079B12F: + switch(lsbId) { + case 0xFF345D02: obj = (T)(new SubtractionNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::SubtractionNode" + } + break; + case 0x627E2116: + switch(lsbId) { + case 0x53E11D93: obj = (T)(new CeilNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::CeilNode" + } + break; + case 0x63B3B461: + switch(lsbId) { + case 0xB30B4BA5: obj = (T)(new BeamLattice(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLattice" + } + break; + case 0x6522CF04: + switch(lsbId) { + case 0xEB283FED: obj = (T)(new ComponentsObject(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObject" + } + break; + case 0x6594B031: + switch(lsbId) { + case 0xB6096238: obj = (T)(new SliceStack(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::SliceStack" + } + break; + case 0x65E6EDD9: + switch(lsbId) { + case 0x362C79CB: obj = (T)(new BaseMaterialGroupIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroupIterator" + } + break; + case 0x68FB2D5F: + switch(lsbId) { + case 0xFC4BA12A: obj = (T)(new BuildItem(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItem" + } + break; + case 0x69684DB9: + switch(lsbId) { + case 0x9FA813F6: obj = (T)(new SliceStackIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::SliceStackIterator" + } + break; + case 0x6B641C70: + switch(lsbId) { + case 0x60040BE3: obj = (T)(new AbsNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::AbsNode" + } + break; + case 0x6CE54469: + switch(lsbId) { + case 0xEEA83BC1: obj = (T)(new ImplicitFunction(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ImplicitFunction" + } + break; + case 0x7570C43B: + switch(lsbId) { + case 0x9721D0C0: obj = (T)(new MatVecMultiplicationNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MatVecMultiplicationNode" + } + break; + case 0x7700AA17: + switch(lsbId) { + case 0xCA1AC0F8: obj = (T)(new PowNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::PowNode" + } + break; + case 0x77AF68C9: + switch(lsbId) { + case 0x71B1485F: obj = (T)(new ClampNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ClampNode" + } + break; + case 0x7DE3951B: + switch(lsbId) { + case 0xA4C1064C: obj = (T)(new TwoInputNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::TwoInputNode" + } + break; + case 0x7FB36B91: + switch(lsbId) { + case 0xD4CE4671: obj = (T)(new ContentEncryptionParams(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ContentEncryptionParams" + } + break; + case 0x817D2E56: + switch(lsbId) { + case 0x6E73AA8F: obj = (T)(new NormalizeDistanceNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::NormalizeDistanceNode" + } + break; + case 0x846AFDE9: + switch(lsbId) { + case 0xA091E997: obj = (T)(new MinNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MinNode" + } + break; + case 0x856632D0: + switch(lsbId) { + case 0xBAF1D8B7: obj = (T)(new Base(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Base" + } + break; + case 0x85FA0E88: + switch(lsbId) { + case 0x06B6C357: obj = (T)(new BooleanObject(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BooleanObject" + } + break; + case 0x87740AD5: + switch(lsbId) { + case 0x3454E0DF: obj = (T)(new Log10Node(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Log10Node" + } + break; + case 0x8A45165E: + switch(lsbId) { + case 0x6C9646D7: obj = (T)(new SignNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::SignNode" + } + break; + case 0x8CE7A119: + switch(lsbId) { + case 0x1A63A35D: obj = (T)(new Attachment(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Attachment" + } + break; + case 0x9200586F: + switch(lsbId) { + case 0xB91587A7: obj = (T)(new VolumeData(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::VolumeData" + } + break; + case 0x943AF6AE: + switch(lsbId) { + case 0x0EFD2B8A: obj = (T)(new ArcCosNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ArcCosNode" + } + break; + case 0x9BD7D3C2: + switch(lsbId) { + case 0x026B8CE8: obj = (T)(new FunctionFromImage3D(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionFromImage3D" + } + break; + case 0x9C9363B3: + switch(lsbId) { + case 0xF708D556: obj = (T)(new ConstVecNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ConstVecNode" + } + break; + case 0x9EF9EB54: + switch(lsbId) { + case 0xA53AA40D: obj = (T)(new ComposeMatrixNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ComposeMatrixNode" + } + break; + case 0x9EFB2757: + switch(lsbId) { + case 0xCA1A5231: obj = (T)(new Function(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Function" + } + break; + case 0x9F831944: + switch(lsbId) { + case 0xA3DE31DA: obj = (T)(new SqrtNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::SqrtNode" + } + break; + case 0xA0C005C0: + switch(lsbId) { + case 0x35D5371D: obj = (T)(new LevelSetIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::LevelSetIterator" + } + break; + case 0xA3C27CF5: + switch(lsbId) { + case 0x4C2AA76C: obj = (T)(new MultiplicationNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MultiplicationNode" + } + break; + case 0xA7D21BD3: + switch(lsbId) { + case 0x64910860: obj = (T)(new BuildItemIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItemIterator" + } + break; + case 0xA808B759: + switch(lsbId) { + case 0x9C158CE6: obj = (T)(new TransposeNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::TransposeNode" + } + break; + case 0xA99CC6C3: + switch(lsbId) { + case 0xF70FB6F9: obj = (T)(new CompositeMaterialsIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterialsIterator" + } + break; + case 0xAFF01F51: + switch(lsbId) { + case 0x2E1FF6AE: obj = (T)(new BooleanObjectIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BooleanObjectIterator" + } + break; + case 0xB19B9FDA: + switch(lsbId) { + case 0x94B0A5E7: obj = (T)(new OneInputNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::OneInputNode" + } + break; + case 0xB27D4656: + switch(lsbId) { + case 0xE16609FA: obj = (T)(new BaseMaterialGroup(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroup" + } + break; + case 0xB6153EF5: + switch(lsbId) { + case 0xDE7E5E11: obj = (T)(new ArcTan2Node(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ArcTan2Node" + } + break; + case 0xB896B641: + switch(lsbId) { + case 0x3C08CF39: obj = (T)(new DivisionNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::DivisionNode" + } + break; + case 0xB989E02E: + switch(lsbId) { + case 0x43158FE6: obj = (T)(new MultiPropertyGroup(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroup" + } + break; + case 0xBC120839: + switch(lsbId) { + case 0x7E37055D: obj = (T)(new Texture2DGroup(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroup" + } + break; + case 0xBD938FF2: + switch(lsbId) { + case 0xD2663D61: obj = (T)(new Image3D(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Image3D" + } + break; + case 0xC2BDF5D8: + switch(lsbId) { + case 0xCBBDB1F0: obj = (T)(new MultiPropertyGroupIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroupIterator" + } + break; + case 0xC4B8EC00: + switch(lsbId) { + case 0xA82BF336: obj = (T)(new Image3DIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Image3DIterator" + } + break; + case 0xC62268F2: + switch(lsbId) { + case 0xD7C7012C: obj = (T)(new ImplicitPortIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ImplicitPortIterator" + } + break; + case 0xCA86A77C: + switch(lsbId) { + case 0x71CD3FAE: obj = (T)(new ResourceIdNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceIdNode" + } + break; + case 0xCC4F8D56: + switch(lsbId) { + case 0x1CCE35D4: obj = (T)(new DecomposeVectorNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::DecomposeVectorNode" + } + break; + case 0xCE16224D: + switch(lsbId) { + case 0x688B86F2: obj = (T)(new CompositeMaterials(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterials" + } + break; + case 0xCF077B19: + switch(lsbId) { + case 0xB0B78E9D: obj = (T)(new TanhNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::TanhNode" + } + break; + case 0xD085FB2E: + switch(lsbId) { + case 0x49CDB5B1: obj = (T)(new ColorGroup(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroup" + } + break; + case 0xD17716D0: + switch(lsbId) { + case 0x63DE2C22: obj = (T)(new MetaData(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MetaData" + } + break; + case 0xD5906722: + switch(lsbId) { + case 0x7E428AA4: obj = (T)(new ResourceDataGroup(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceDataGroup" + } + break; + case 0xD5AEA50A: + switch(lsbId) { + case 0x56306722: obj = (T)(new SinNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::SinNode" + } + break; + case 0xD5C49B04: + switch(lsbId) { + case 0xAF1963CD: obj = (T)(new ImplicitPort(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ImplicitPort" + } + break; + case 0xD6DFD0A7: + switch(lsbId) { + case 0xEB64AC33: obj = (T)(new MatrixFromRowsNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MatrixFromRowsNode" + } + break; + case 0xD85889E2: + switch(lsbId) { + case 0x739A74B1: obj = (T)(new LengthNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::LengthNode" + } + break; + case 0xD85B5B61: + switch(lsbId) { + case 0x43E787E3: obj = (T)(new VolumeDataColor(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::VolumeDataColor" + } + break; + case 0xD9E46D5E: + switch(lsbId) { + case 0x6D8118EE: obj = (T)(new Consumer(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Consumer" + } + break; + case 0xD9F5A53C: + switch(lsbId) { + case 0x657765AE: obj = (T)(new RoundNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::RoundNode" + } + break; + case 0xDE92510B: + switch(lsbId) { + case 0xD2112288: obj = (T)(new ObjectIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ObjectIterator" + } + break; + case 0xDFE3889D: + switch(lsbId) { + case 0x1B269CBB: obj = (T)(new Resource(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Resource" + } + break; + case 0xE0441CF9: + switch(lsbId) { + case 0x76B36319: obj = (T)(new Texture2D(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2D" + } + break; + case 0xE47D5476: + switch(lsbId) { + case 0x15816BAD: obj = (T)(new ArcTanNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ArcTanNode" + } + break; + case 0xE554C8A7: + switch(lsbId) { + case 0xE72AAF4D: obj = (T)(new ArcSinNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ArcSinNode" + } + break; + case 0xE72592A7: + switch(lsbId) { + case 0x725AB29B: obj = (T)(new ImplicitNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ImplicitNode" + } + break; + case 0xE76F642F: + switch(lsbId) { + case 0x363FD7E9: obj = (T)(new Writer(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Writer" + } + break; + case 0xE8601F66: + switch(lsbId) { + case 0xA23A0540: obj = (T)(new InverseNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::InverseNode" + } + break; + case 0xE8A7D9C1: + switch(lsbId) { + case 0x92EFD0E2: obj = (T)(new LevelSet(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::LevelSet" + } + break; + case 0xE8C0ABF7: + switch(lsbId) { + case 0xC5DC7068: obj = (T)(new Log2Node(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Log2Node" + } + break; + case 0xEA573358: + switch(lsbId) { + case 0x49379F22: obj = (T)(new ModNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ModNode" + } + break; + case 0xF4196034: + switch(lsbId) { + case 0xE2B9FDE6: obj = (T)(new MeshObjectIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObjectIterator" + } + break; + case 0xF85C90ED: + switch(lsbId) { + case 0xCE6F90A4: obj = (T)(new ConstMatNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ConstMatNode" + } + break; + case 0xFC006BC8: + switch(lsbId) { + case 0x88CAB4D0: obj = (T)(new NodeIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::NodeIterator" + } + break; + case 0xFC368AA4: + switch(lsbId) { + case 0x4ACE42DA: obj = (T)(new VolumeDataProperty(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::VolumeDataProperty" + } + break; + case 0xFE60932A: + switch(lsbId) { + case 0x66375FAD: obj = (T)(new DotNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::DotNode" + } + break; + default: obj = cls.getDeclaredConstructor(cArg).newInstance(this, handle); break; + } + return obj; + } + catch(Exception e) { + return null; + } + } +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Log10Node.java b/Autogenerated/Bindings/Java8/lib3mf/Log10Node.java new file mode 100644 index 000000000..eacfc4723 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Log10Node.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Log10Node extends OneInputNode { + + public Log10Node(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Log2Node.java b/Autogenerated/Bindings/Java8/lib3mf/Log2Node.java new file mode 100644 index 000000000..b2ca38596 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Log2Node.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Log2Node extends OneInputNode { + + public Log2Node(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/LogNode.java b/Autogenerated/Bindings/Java8/lib3mf/LogNode.java new file mode 100644 index 000000000..d6fdecdb0 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/LogNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class LogNode extends OneInputNode { + + public LogNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/MatVecMultiplicationNode.java b/Autogenerated/Bindings/Java8/lib3mf/MatVecMultiplicationNode.java new file mode 100644 index 000000000..b303d30b9 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/MatVecMultiplicationNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MatVecMultiplicationNode extends TwoInputNode { + + public MatVecMultiplicationNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/MaterialMapping.java b/Autogenerated/Bindings/Java8/lib3mf/MaterialMapping.java new file mode 100644 index 000000000..9f37389b3 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/MaterialMapping.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MaterialMapping extends FunctionReference { + + public MaterialMapping(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Matrix4x4.java b/Autogenerated/Bindings/Java8/lib3mf/Matrix4x4.java new file mode 100644 index 000000000..6d6619b25 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Matrix4x4.java @@ -0,0 +1,89 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Matrix4x4 { + + public double[][] Field = new double[4][4]; + + public static final int SIZE = 128; + + public void readFromPointer(Pointer p, long offset) { + Field[0][0] = p.getDouble(offset + 0); + Field[0][1] = p.getDouble(offset + 8); + Field[0][2] = p.getDouble(offset + 16); + Field[0][3] = p.getDouble(offset + 24); + Field[1][0] = p.getDouble(offset + 32); + Field[1][1] = p.getDouble(offset + 40); + Field[1][2] = p.getDouble(offset + 48); + Field[1][3] = p.getDouble(offset + 56); + Field[2][0] = p.getDouble(offset + 64); + Field[2][1] = p.getDouble(offset + 72); + Field[2][2] = p.getDouble(offset + 80); + Field[2][3] = p.getDouble(offset + 88); + Field[3][0] = p.getDouble(offset + 96); + Field[3][1] = p.getDouble(offset + 104); + Field[3][2] = p.getDouble(offset + 112); + Field[3][3] = p.getDouble(offset + 120); + } + + public void writeToPointer(Pointer p, long offset) { + p.setDouble(offset + 0, Field[0][0]); + p.setDouble(offset + 8, Field[0][1]); + p.setDouble(offset + 16, Field[0][2]); + p.setDouble(offset + 24, Field[0][3]); + p.setDouble(offset + 32, Field[1][0]); + p.setDouble(offset + 40, Field[1][1]); + p.setDouble(offset + 48, Field[1][2]); + p.setDouble(offset + 56, Field[1][3]); + p.setDouble(offset + 64, Field[2][0]); + p.setDouble(offset + 72, Field[2][1]); + p.setDouble(offset + 80, Field[2][2]); + p.setDouble(offset + 88, Field[2][3]); + p.setDouble(offset + 96, Field[3][0]); + p.setDouble(offset + 104, Field[3][1]); + p.setDouble(offset + 112, Field[3][2]); + p.setDouble(offset + 120, Field[3][3]); + } + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/MatrixFromColumnsNode.java b/Autogenerated/Bindings/Java8/lib3mf/MatrixFromColumnsNode.java new file mode 100644 index 000000000..5edd99328 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/MatrixFromColumnsNode.java @@ -0,0 +1,146 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MatrixFromColumnsNode extends ImplicitNode { + + public MatrixFromColumnsNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the first column + * + * @return the input for the first column + * @throws Lib3MFException + */ + public ImplicitPort getInputA() throws Lib3MFException { + Pointer bufferColumn0 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromcolumnsnode_getinputa.invokeInt(new java.lang.Object[]{mHandle, bufferColumn0})); + Pointer valueColumn0 = bufferColumn0.getPointer(0); + ImplicitPort column0 = null; + if (valueColumn0 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Column0 was a null pointer"); + } + column0 = mWrapper.PolymorphicFactory(valueColumn0, ImplicitPort.class); + return column0; + } + + /** + * Retrieves the input for the second column + * + * @return the input for the second column + * @throws Lib3MFException + */ + public ImplicitPort getInputB() throws Lib3MFException { + Pointer bufferColumn1 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromcolumnsnode_getinputb.invokeInt(new java.lang.Object[]{mHandle, bufferColumn1})); + Pointer valueColumn1 = bufferColumn1.getPointer(0); + ImplicitPort column1 = null; + if (valueColumn1 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Column1 was a null pointer"); + } + column1 = mWrapper.PolymorphicFactory(valueColumn1, ImplicitPort.class); + return column1; + } + + /** + * Retrieves the input for the third column + * + * @return the input for the third column + * @throws Lib3MFException + */ + public ImplicitPort getInputC() throws Lib3MFException { + Pointer bufferColumn2 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromcolumnsnode_getinputc.invokeInt(new java.lang.Object[]{mHandle, bufferColumn2})); + Pointer valueColumn2 = bufferColumn2.getPointer(0); + ImplicitPort column2 = null; + if (valueColumn2 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Column2 was a null pointer"); + } + column2 = mWrapper.PolymorphicFactory(valueColumn2, ImplicitPort.class); + return column2; + } + + /** + * Retrieves the input for the fourth column + * + * @return the input for the fourth column + * @throws Lib3MFException + */ + public ImplicitPort getInputD() throws Lib3MFException { + Pointer bufferColumn3 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromcolumnsnode_getinputd.invokeInt(new java.lang.Object[]{mHandle, bufferColumn3})); + Pointer valueColumn3 = bufferColumn3.getPointer(0); + ImplicitPort column3 = null; + if (valueColumn3 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Column3 was a null pointer"); + } + column3 = mWrapper.PolymorphicFactory(valueColumn3, ImplicitPort.class); + return column3; + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputResult() throws Lib3MFException { + Pointer bufferResult = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromcolumnsnode_getoutputresult.invokeInt(new java.lang.Object[]{mHandle, bufferResult})); + Pointer valueResult = bufferResult.getPointer(0); + ImplicitPort result = null; + if (valueResult == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Result was a null pointer"); + } + result = mWrapper.PolymorphicFactory(valueResult, ImplicitPort.class); + return result; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/MatrixFromRowsNode.java b/Autogenerated/Bindings/Java8/lib3mf/MatrixFromRowsNode.java new file mode 100644 index 000000000..9b344b600 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/MatrixFromRowsNode.java @@ -0,0 +1,146 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MatrixFromRowsNode extends ImplicitNode { + + public MatrixFromRowsNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the first row + * + * @return the input for the first row + * @throws Lib3MFException + */ + public ImplicitPort getInputA() throws Lib3MFException { + Pointer bufferRow0 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromrowsnode_getinputa.invokeInt(new java.lang.Object[]{mHandle, bufferRow0})); + Pointer valueRow0 = bufferRow0.getPointer(0); + ImplicitPort row0 = null; + if (valueRow0 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Row0 was a null pointer"); + } + row0 = mWrapper.PolymorphicFactory(valueRow0, ImplicitPort.class); + return row0; + } + + /** + * Retrieves the input for the second row + * + * @return the input for the second row + * @throws Lib3MFException + */ + public ImplicitPort getInputB() throws Lib3MFException { + Pointer bufferRow1 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromrowsnode_getinputb.invokeInt(new java.lang.Object[]{mHandle, bufferRow1})); + Pointer valueRow1 = bufferRow1.getPointer(0); + ImplicitPort row1 = null; + if (valueRow1 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Row1 was a null pointer"); + } + row1 = mWrapper.PolymorphicFactory(valueRow1, ImplicitPort.class); + return row1; + } + + /** + * Retrieves the input for the third row + * + * @return the input for the third row + * @throws Lib3MFException + */ + public ImplicitPort getInputC() throws Lib3MFException { + Pointer bufferRow2 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromrowsnode_getinputc.invokeInt(new java.lang.Object[]{mHandle, bufferRow2})); + Pointer valueRow2 = bufferRow2.getPointer(0); + ImplicitPort row2 = null; + if (valueRow2 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Row2 was a null pointer"); + } + row2 = mWrapper.PolymorphicFactory(valueRow2, ImplicitPort.class); + return row2; + } + + /** + * Retrieves the input for the fourth row + * + * @return the input for the fourth row + * @throws Lib3MFException + */ + public ImplicitPort getInputD() throws Lib3MFException { + Pointer bufferRow3 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromrowsnode_getinputd.invokeInt(new java.lang.Object[]{mHandle, bufferRow3})); + Pointer valueRow3 = bufferRow3.getPointer(0); + ImplicitPort row3 = null; + if (valueRow3 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Row3 was a null pointer"); + } + row3 = mWrapper.PolymorphicFactory(valueRow3, ImplicitPort.class); + return row3; + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputResult() throws Lib3MFException { + Pointer bufferResult = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromrowsnode_getoutputresult.invokeInt(new java.lang.Object[]{mHandle, bufferResult})); + Pointer valueResult = bufferResult.getPointer(0); + ImplicitPort result = null; + if (valueResult == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Result was a null pointer"); + } + result = mWrapper.PolymorphicFactory(valueResult, ImplicitPort.class); + return result; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/MaxNode.java b/Autogenerated/Bindings/Java8/lib3mf/MaxNode.java new file mode 100644 index 000000000..04ecb2290 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/MaxNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MaxNode extends TwoInputNode { + + public MaxNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/MeshNode.java b/Autogenerated/Bindings/Java8/lib3mf/MeshNode.java new file mode 100644 index 000000000..7d2ac8801 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/MeshNode.java @@ -0,0 +1,110 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MeshNode extends ImplicitNode { + + public MeshNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the model resource id of the mesh + * + * @return the input port for the model resource id of the mesh + * @throws Lib3MFException + */ + public ImplicitPort getInputMesh() throws Lib3MFException { + Pointer bufferMesh = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshnode_getinputmesh.invokeInt(new java.lang.Object[]{mHandle, bufferMesh})); + Pointer valueMesh = bufferMesh.getPointer(0); + ImplicitPort mesh = null; + if (valueMesh == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Mesh was a null pointer"); + } + mesh = mWrapper.PolymorphicFactory(valueMesh, ImplicitPort.class); + return mesh; + } + + /** + * Retrieves the input for the position + * + * @return the input port for the position + * @throws Lib3MFException + */ + public ImplicitPort getInputPos() throws Lib3MFException { + Pointer bufferPos = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshnode_getinputpos.invokeInt(new java.lang.Object[]{mHandle, bufferPos})); + Pointer valuePos = bufferPos.getPointer(0); + ImplicitPort pos = null; + if (valuePos == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Pos was a null pointer"); + } + pos = mWrapper.PolymorphicFactory(valuePos, ImplicitPort.class); + return pos; + } + + /** + * Retrieves the output + * + * @return the output port for the signed distance to the mesh + * @throws Lib3MFException + */ + public ImplicitPort getOutputDistance() throws Lib3MFException { + Pointer bufferDistance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshnode_getoutputdistance.invokeInt(new java.lang.Object[]{mHandle, bufferDistance})); + Pointer valueDistance = bufferDistance.getPointer(0); + ImplicitPort distance = null; + if (valueDistance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Distance was a null pointer"); + } + distance = mWrapper.PolymorphicFactory(valueDistance, ImplicitPort.class); + return distance; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/MeshObject.java b/Autogenerated/Bindings/Java8/lib3mf/MeshObject.java new file mode 100644 index 000000000..bb8913f5a --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/MeshObject.java @@ -0,0 +1,504 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MeshObject extends Object { + + public MeshObject(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the vertex count of a mesh object. + * + * @return filled with the vertex count. + * @throws Lib3MFException + */ + public int getVertexCount() throws Lib3MFException { + Pointer bufferVertexCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_getvertexcount.invokeInt(new java.lang.Object[]{mHandle, bufferVertexCount})); + return bufferVertexCount.getInt(0); + } + + /** + * Returns the triangle count of a mesh object. + * + * @return filled with the triangle count. + * @throws Lib3MFException + */ + public int getTriangleCount() throws Lib3MFException { + Pointer bufferVertexCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_gettrianglecount.invokeInt(new java.lang.Object[]{mHandle, bufferVertexCount})); + return bufferVertexCount.getInt(0); + } + + /** + * Returns the vertex count of a mesh object. + * + * @param index Index of the vertex (0 to vertexcount - 1) + * @return filled with the vertex coordinates. + * @throws Lib3MFException + */ + public Position getVertex(int index) throws Lib3MFException { + Pointer bufferCoordinates = new Memory(Position.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_getvertex.invokeInt(new java.lang.Object[]{mHandle, index, bufferCoordinates})); + Position coordinates = new Position(); + coordinates.readFromPointer(bufferCoordinates, 0); + return coordinates; + } + + /** + * Sets the coordinates of a single vertex of a mesh object + * + * @param index Index of the vertex (0 to vertexcount - 1) + * @param coordinates contains the vertex coordinates. + * @throws Lib3MFException + */ + public void setVertex(int index, Position coordinates) throws Lib3MFException { + Pointer bufferCoordinates = new Memory(Position.SIZE); + coordinates.writeToPointer(bufferCoordinates, 0); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_setvertex.invokeInt(new java.lang.Object[]{mHandle, index, bufferCoordinates})); + } + + /** + * Adds a single vertex to a mesh object + * + * @param coordinates contains the vertex coordinates. + * @return Index of the new vertex + * @throws Lib3MFException + */ + public int addVertex(Position coordinates) throws Lib3MFException { + Pointer bufferCoordinates = new Memory(Position.SIZE); + coordinates.writeToPointer(bufferCoordinates, 0); + Pointer bufferNewIndex = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_addvertex.invokeInt(new java.lang.Object[]{mHandle, bufferCoordinates, bufferNewIndex})); + return bufferNewIndex.getInt(0); + } + + /** + * Obtains all vertex positions of a mesh object + * + * @return contains the vertex coordinates. + * @throws Lib3MFException + */ + public Position[] getVertices() throws Lib3MFException { + Pointer countNeededVertices = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_getvertices.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededVertices, null})); + long countVertices = countNeededVertices.getLong(0); + Pointer bufferVertices = new Memory(Math.max(1, countVertices * Position.SIZE)); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_getvertices.invokeInt(new java.lang.Object[]{mHandle, countVertices, countNeededVertices, bufferVertices})); + Position vertices[] = new Position[(int)countVertices]; + for (int i = 0; i < (int)countVertices; i++) { + vertices[i] = new Position(); + vertices[i].readFromPointer(bufferVertices, i * Position.SIZE); + } + return vertices; + } + + /** + * Returns indices of a single triangle of a mesh object. + * + * @param index Index of the triangle (0 to trianglecount - 1) + * @return filled with the triangle indices. + * @throws Lib3MFException + */ + public Triangle getTriangle(int index) throws Lib3MFException { + Pointer bufferIndices = new Memory(Triangle.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_gettriangle.invokeInt(new java.lang.Object[]{mHandle, index, bufferIndices})); + Triangle indices = new Triangle(); + indices.readFromPointer(bufferIndices, 0); + return indices; + } + + /** + * Sets the indices of a single triangle of a mesh object. + * + * @param index Index of the triangle (0 to trianglecount - 1) + * @param indices contains the triangle indices. + * @throws Lib3MFException + */ + public void setTriangle(int index, Triangle indices) throws Lib3MFException { + Pointer bufferIndices = new Memory(Triangle.SIZE); + indices.writeToPointer(bufferIndices, 0); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_settriangle.invokeInt(new java.lang.Object[]{mHandle, index, bufferIndices})); + } + + /** + * Adds a single triangle to a mesh object + * + * @param indices contains the triangle indices. + * @return Index of the new triangle + * @throws Lib3MFException + */ + public int addTriangle(Triangle indices) throws Lib3MFException { + Pointer bufferIndices = new Memory(Triangle.SIZE); + indices.writeToPointer(bufferIndices, 0); + Pointer bufferNewIndex = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_addtriangle.invokeInt(new java.lang.Object[]{mHandle, bufferIndices, bufferNewIndex})); + return bufferNewIndex.getInt(0); + } + + /** + * Get all triangles of a mesh object + * + * @return contains the triangle indices. + * @throws Lib3MFException + */ + public Triangle[] getTriangleIndices() throws Lib3MFException { + Pointer countNeededIndices = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_gettriangleindices.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededIndices, null})); + long countIndices = countNeededIndices.getLong(0); + Pointer bufferIndices = new Memory(Math.max(1, countIndices * Triangle.SIZE)); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_gettriangleindices.invokeInt(new java.lang.Object[]{mHandle, countIndices, countNeededIndices, bufferIndices})); + Triangle indices[] = new Triangle[(int)countIndices]; + for (int i = 0; i < (int)countIndices; i++) { + indices[i] = new Triangle(); + indices[i].readFromPointer(bufferIndices, i * Triangle.SIZE); + } + return indices; + } + + /** + * Sets the property at the object-level of the mesh object. + * + * @param uniqueResourceID the object-level Property UniqueResourceID. + * @param propertyID the object-level PropertyID. + * @throws Lib3MFException + */ + public void setObjectLevelProperty(int uniqueResourceID, int propertyID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_setobjectlevelproperty.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, propertyID})); + } + + /** + * Gets the property at the object-level of the mesh object. + * + * @return GetObjectLevelProperty Result Tuple + * @throws Lib3MFException + */ + public GetObjectLevelPropertyResult getObjectLevelProperty() throws Lib3MFException { + Pointer bufferUniqueResourceID = new Memory(4); + Pointer bufferPropertyID = new Memory(4); + Pointer bufferHasObjectLevelProperty = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_getobjectlevelproperty.invokeInt(new java.lang.Object[]{mHandle, bufferUniqueResourceID, bufferPropertyID, bufferHasObjectLevelProperty})); + GetObjectLevelPropertyResult returnTuple = new GetObjectLevelPropertyResult(); + returnTuple.UniqueResourceID = bufferUniqueResourceID.getInt(0); + returnTuple.PropertyID = bufferPropertyID.getInt(0); + returnTuple.HasObjectLevelProperty = bufferHasObjectLevelProperty.getByte(0) != 0; + return returnTuple; + } + + public static class GetObjectLevelPropertyResult { + /** + * the object-level Property UniqueResourceID. + */ + public int UniqueResourceID; + + /** + * the object-level PropertyID. + */ + public int PropertyID; + + /** + * Has an object-level property been specified? + */ + public boolean HasObjectLevelProperty; + + } + /** + * Sets the properties of a single triangle of a mesh object. + * + * @param index Index of the triangle (0 to trianglecount - 1) + * @param properties contains the triangle properties. + * @throws Lib3MFException + */ + public void setTriangleProperties(int index, TriangleProperties properties) throws Lib3MFException { + Pointer bufferProperties = new Memory(TriangleProperties.SIZE); + properties.writeToPointer(bufferProperties, 0); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_settriangleproperties.invokeInt(new java.lang.Object[]{mHandle, index, bufferProperties})); + } + + /** + * Gets the properties of a single triangle of a mesh object. + * + * @param index Index of the triangle (0 to trianglecount - 1) + * @return returns the triangle properties. + * @throws Lib3MFException + */ + public TriangleProperties getTriangleProperties(int index) throws Lib3MFException { + Pointer bufferProperty = new Memory(TriangleProperties.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_gettriangleproperties.invokeInt(new java.lang.Object[]{mHandle, index, bufferProperty})); + TriangleProperties property = new TriangleProperties(); + property.readFromPointer(bufferProperty, 0); + return property; + } + + /** + * Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. + * + * @param propertiesArray contains the triangle properties array. Must have trianglecount elements. + * @throws Lib3MFException + */ + public void setAllTriangleProperties(TriangleProperties[] propertiesArray) throws Lib3MFException { + Pointer bufferPropertiesArray = new Memory(Math.max(1, TriangleProperties.SIZE * propertiesArray.length)); + for (int i = 0; i < propertiesArray.length; i++) { + propertiesArray[i].writeToPointer(bufferPropertiesArray, i * TriangleProperties.SIZE); + } + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_setalltriangleproperties.invokeInt(new java.lang.Object[]{mHandle, (long) propertiesArray.length, bufferPropertiesArray})); + } + + /** + * Gets the properties of all triangles of a mesh object. + * + * @return returns the triangle properties array. Must have trianglecount elements. + * @throws Lib3MFException + */ + public TriangleProperties[] getAllTriangleProperties() throws Lib3MFException { + Pointer countNeededPropertiesArray = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_getalltriangleproperties.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededPropertiesArray, null})); + long countPropertiesArray = countNeededPropertiesArray.getLong(0); + Pointer bufferPropertiesArray = new Memory(Math.max(1, countPropertiesArray * TriangleProperties.SIZE)); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_getalltriangleproperties.invokeInt(new java.lang.Object[]{mHandle, countPropertiesArray, countNeededPropertiesArray, bufferPropertiesArray})); + TriangleProperties propertiesArray[] = new TriangleProperties[(int)countPropertiesArray]; + for (int i = 0; i < (int)countPropertiesArray; i++) { + propertiesArray[i] = new TriangleProperties(); + propertiesArray[i].readFromPointer(bufferPropertiesArray, i * TriangleProperties.SIZE); + } + return propertiesArray; + } + + /** + * Clears all properties of this mesh object (triangle and object-level). + * + * @throws Lib3MFException + */ + public void clearAllProperties() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_clearallproperties.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Set all triangles of a mesh object + * + * @param vertices contains the positions. + * @param indices contains the triangle indices. + * @throws Lib3MFException + */ + public void setGeometry(Position[] vertices, Triangle[] indices) throws Lib3MFException { + Pointer bufferVertices = new Memory(Math.max(1, Position.SIZE * vertices.length)); + for (int i = 0; i < vertices.length; i++) { + vertices[i].writeToPointer(bufferVertices, i * Position.SIZE); + } + Pointer bufferIndices = new Memory(Math.max(1, Triangle.SIZE * indices.length)); + for (int i = 0; i < indices.length; i++) { + indices[i].writeToPointer(bufferIndices, i * Triangle.SIZE); + } + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_setgeometry.invokeInt(new java.lang.Object[]{mHandle, (long) vertices.length, bufferVertices, (long) indices.length, bufferIndices})); + } + + /** + * Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. + * + * @return returns, if the object is oriented and manifold. + * @throws Lib3MFException + */ + public boolean isManifoldAndOriented() throws Lib3MFException { + Pointer bufferIsManifoldAndOriented = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_ismanifoldandoriented.invokeInt(new java.lang.Object[]{mHandle, bufferIsManifoldAndOriented})); + return bufferIsManifoldAndOriented.getByte(0) != 0; + } + + /** + * Retrieves the BeamLattice within this MeshObject. + * + * @return the BeamLattice within this MeshObject + * @throws Lib3MFException + */ + public BeamLattice beamLattice() throws Lib3MFException { + Pointer bufferTheBeamLattice = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_beamlattice.invokeInt(new java.lang.Object[]{mHandle, bufferTheBeamLattice})); + Pointer valueTheBeamLattice = bufferTheBeamLattice.getPointer(0); + BeamLattice theBeamLattice = null; + if (valueTheBeamLattice == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheBeamLattice was a null pointer"); + } + theBeamLattice = mWrapper.PolymorphicFactory(valueTheBeamLattice, BeamLattice.class); + return theBeamLattice; + } + + /** + * Retrieves the VolumeData of this MeshObject. + * + * @return the VolumeData of this MeshObject + * @throws Lib3MFException + */ + public VolumeData getVolumeData() throws Lib3MFException { + Pointer bufferTheVolumeData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_getvolumedata.invokeInt(new java.lang.Object[]{mHandle, bufferTheVolumeData})); + Pointer valueTheVolumeData = bufferTheVolumeData.getPointer(0); + VolumeData theVolumeData = null; + if (valueTheVolumeData != Pointer.NULL) { + theVolumeData = mWrapper.PolymorphicFactory(valueTheVolumeData, VolumeData.class); + } + return theVolumeData; + } + + /** + * Sets the VolumeData of this MeshObject. + * + * @param theVolumeData the VolumeData of this MeshObject + * @throws Lib3MFException + */ + public void setVolumeData(VolumeData theVolumeData) throws Lib3MFException { + Pointer theVolumeDataHandle = null; + if (theVolumeData != null) { + theVolumeDataHandle = theVolumeData.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheVolumeData is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_setvolumedata.invokeInt(new java.lang.Object[]{mHandle, theVolumeDataHandle})); + } + + /** + * Adds a new triangle set. + * + * @param identifier the new identifier. MUST be unique within the mesh. MUST NOT be an empty string + * @param name the human readable name. MUST NOT be an empty string + * @return the new Triangle Set Instance. + * @throws Lib3MFException + */ + public TriangleSet addTriangleSet(String identifier, String name) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + Pointer bufferTheTriangleSet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_addtriangleset.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferName, bufferTheTriangleSet})); + Pointer valueTheTriangleSet = bufferTheTriangleSet.getPointer(0); + TriangleSet theTriangleSet = null; + if (valueTheTriangleSet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheTriangleSet was a null pointer"); + } + theTriangleSet = mWrapper.PolymorphicFactory(valueTheTriangleSet, TriangleSet.class); + return theTriangleSet; + } + + /** + * Checks if a triangle set exists. + * + * @param identifier the identifier to be found. + * @return flag if the triangles set exists. + * @throws Lib3MFException + */ + public boolean hasTriangleSet(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + Pointer bufferTriangleSetExists = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_hastriangleset.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferTriangleSetExists})); + return bufferTriangleSetExists.getByte(0) != 0; + } + + /** + * Finds a new triangle set by identifier. Fails if not existing. + * + * @param identifier the identifier to be found. + * @return the triangle Set Instance. + * @throws Lib3MFException + */ + public TriangleSet findTriangleSet(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + Pointer bufferTheTriangleSet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_findtriangleset.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferTheTriangleSet})); + Pointer valueTheTriangleSet = bufferTheTriangleSet.getPointer(0); + TriangleSet theTriangleSet = null; + if (valueTheTriangleSet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheTriangleSet was a null pointer"); + } + theTriangleSet = mWrapper.PolymorphicFactory(valueTheTriangleSet, TriangleSet.class); + return theTriangleSet; + } + + /** + * Returns number of triangle sets. + * + * @return the number of triangle sets of this mesh. + * @throws Lib3MFException + */ + public int getTriangleSetCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_gettrianglesetcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Returns a specific triangle set by index. + * + * @param index the index of the triangle set. + * @return the triangle Set Instance. + * @throws Lib3MFException + */ + public TriangleSet getTriangleSet(int index) throws Lib3MFException { + Pointer bufferTheTriangleSet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_gettriangleset.invokeInt(new java.lang.Object[]{mHandle, index, bufferTheTriangleSet})); + Pointer valueTheTriangleSet = bufferTheTriangleSet.getPointer(0); + TriangleSet theTriangleSet = null; + if (valueTheTriangleSet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheTriangleSet was a null pointer"); + } + theTriangleSet = mWrapper.PolymorphicFactory(valueTheTriangleSet, TriangleSet.class); + return theTriangleSet; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/MeshObjectIterator.java b/Autogenerated/Bindings/Java8/lib3mf/MeshObjectIterator.java new file mode 100644 index 000000000..df13b641c --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/MeshObjectIterator.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MeshObjectIterator extends ResourceIterator { + + public MeshObjectIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the MeshObject the iterator points at. + * + * @return returns the MeshObject instance. + * @throws Lib3MFException + */ + public MeshObject getCurrentMeshObject() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobjectiterator_getcurrentmeshobject.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + MeshObject resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, MeshObject.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/MetaData.java b/Autogenerated/Bindings/Java8/lib3mf/MetaData.java new file mode 100644 index 000000000..a47864bb9 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/MetaData.java @@ -0,0 +1,209 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MetaData extends Base { + + public MetaData(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * returns the namespace URL of the metadata + * + * @return the namespace URL of the metadata + * @throws Lib3MFException + */ + public String getNameSpace() throws Lib3MFException { + Pointer bytesNeededNameSpace = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getnamespace.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededNameSpace, null})); + int sizeNameSpace = bytesNeededNameSpace.getInt(0); + Pointer bufferNameSpace = new Memory(sizeNameSpace); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getnamespace.invokeInt(new java.lang.Object[]{mHandle, sizeNameSpace, bytesNeededNameSpace, bufferNameSpace})); + return new String(bufferNameSpace.getByteArray(0, sizeNameSpace - 1), StandardCharsets.UTF_8); + } + + /** + * sets a new namespace URL of the metadata + * + * @param nameSpace the new namespace URL of the metadata + * @throws Lib3MFException + */ + public void setNameSpace(String nameSpace) throws Lib3MFException { + byte[] bytesNameSpace = nameSpace.getBytes(StandardCharsets.UTF_8); + Memory bufferNameSpace = new Memory(bytesNameSpace.length + 1); + bufferNameSpace.write(0, bytesNameSpace, 0, bytesNameSpace.length); + bufferNameSpace.setByte(bytesNameSpace.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_setnamespace.invokeInt(new java.lang.Object[]{mHandle, bufferNameSpace})); + } + + /** + * returns the name of a metadata + * + * @return the name of the metadata + * @throws Lib3MFException + */ + public String getName() throws Lib3MFException { + Pointer bytesNeededName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededName, null})); + int sizeName = bytesNeededName.getInt(0); + Pointer bufferName = new Memory(sizeName); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getname.invokeInt(new java.lang.Object[]{mHandle, sizeName, bytesNeededName, bufferName})); + return new String(bufferName.getByteArray(0, sizeName - 1), StandardCharsets.UTF_8); + } + + /** + * sets a new name of a metadata + * + * @param name the new name of the metadata + * @throws Lib3MFException + */ + public void setName(String name) throws Lib3MFException { + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_setname.invokeInt(new java.lang.Object[]{mHandle, bufferName})); + } + + /** + * returns the (namespace+name) of a metadata + * + * @return the key (namespace+name) of the metadata + * @throws Lib3MFException + */ + public String getKey() throws Lib3MFException { + Pointer bytesNeededKey = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getkey.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededKey, null})); + int sizeKey = bytesNeededKey.getInt(0); + Pointer bufferKey = new Memory(sizeKey); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getkey.invokeInt(new java.lang.Object[]{mHandle, sizeKey, bytesNeededKey, bufferKey})); + return new String(bufferKey.getByteArray(0, sizeKey - 1), StandardCharsets.UTF_8); + } + + /** + * returns, whether a metadata must be preserved + * + * @return returns, whether a metadata must be preserved + * @throws Lib3MFException + */ + public boolean getMustPreserve() throws Lib3MFException { + Pointer bufferMustPreserve = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getmustpreserve.invokeInt(new java.lang.Object[]{mHandle, bufferMustPreserve})); + return bufferMustPreserve.getByte(0) != 0; + } + + /** + * sets whether a metadata must be preserved + * + * @param mustPreserve a new value whether a metadata must be preserved + * @throws Lib3MFException + */ + public void setMustPreserve(boolean mustPreserve) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_metadata_setmustpreserve.invokeInt(new java.lang.Object[]{mHandle, mustPreserve})); + } + + /** + * returns the type of a metadata + * + * @return the type of the metadata + * @throws Lib3MFException + */ + public String getType() throws Lib3MFException { + Pointer bytesNeededType = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_gettype.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededType, null})); + int sizeType = bytesNeededType.getInt(0); + Pointer bufferType = new Memory(sizeType); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_gettype.invokeInt(new java.lang.Object[]{mHandle, sizeType, bytesNeededType, bufferType})); + return new String(bufferType.getByteArray(0, sizeType - 1), StandardCharsets.UTF_8); + } + + /** + * sets a new type of a metadata. This must be a simple XML type + * + * @param type a new type of the metadata + * @throws Lib3MFException + */ + public void setType(String type) throws Lib3MFException { + byte[] bytesType = type.getBytes(StandardCharsets.UTF_8); + Memory bufferType = new Memory(bytesType.length + 1); + bufferType.write(0, bytesType, 0, bytesType.length); + bufferType.setByte(bytesType.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_settype.invokeInt(new java.lang.Object[]{mHandle, bufferType})); + } + + /** + * returns the value of the metadata + * + * @return the value of the metadata + * @throws Lib3MFException + */ + public String getValue() throws Lib3MFException { + Pointer bytesNeededValue = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getvalue.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededValue, null})); + int sizeValue = bytesNeededValue.getInt(0); + Pointer bufferValue = new Memory(sizeValue); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getvalue.invokeInt(new java.lang.Object[]{mHandle, sizeValue, bytesNeededValue, bufferValue})); + return new String(bufferValue.getByteArray(0, sizeValue - 1), StandardCharsets.UTF_8); + } + + /** + * sets a new value of the metadata + * + * @param value a new value of the metadata + * @throws Lib3MFException + */ + public void setValue(String value) throws Lib3MFException { + byte[] bytesValue = value.getBytes(StandardCharsets.UTF_8); + Memory bufferValue = new Memory(bytesValue.length + 1); + bufferValue.write(0, bytesValue, 0, bytesValue.length); + bufferValue.setByte(bytesValue.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_setvalue.invokeInt(new java.lang.Object[]{mHandle, bufferValue})); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/MetaDataGroup.java b/Autogenerated/Bindings/Java8/lib3mf/MetaDataGroup.java new file mode 100644 index 000000000..607809d7e --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/MetaDataGroup.java @@ -0,0 +1,180 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MetaDataGroup extends Base { + + public MetaDataGroup(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * returns the number of metadata in this metadatagroup + * + * @return returns the number metadata + * @throws Lib3MFException + */ + public int getMetaDataCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_metadatagroup_getmetadatacount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * returns a metadata value within this metadatagroup + * + * @param index Index of the Metadata. + * @return an instance of the metadata + * @throws Lib3MFException + */ + public MetaData getMetaData(int index) throws Lib3MFException { + Pointer bufferMetaData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_metadatagroup_getmetadata.invokeInt(new java.lang.Object[]{mHandle, index, bufferMetaData})); + Pointer valueMetaData = bufferMetaData.getPointer(0); + MetaData metaData = null; + if (valueMetaData == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MetaData was a null pointer"); + } + metaData = mWrapper.PolymorphicFactory(valueMetaData, MetaData.class); + return metaData; + } + + /** + * returns a metadata value within this metadatagroup + * + * @param nameSpace the namespace of the metadata + * @param name the name of the Metadata + * @return an instance of the metadata + * @throws Lib3MFException + */ + public MetaData getMetaDataByKey(String nameSpace, String name) throws Lib3MFException { + byte[] bytesNameSpace = nameSpace.getBytes(StandardCharsets.UTF_8); + Memory bufferNameSpace = new Memory(bytesNameSpace.length + 1); + bufferNameSpace.write(0, bytesNameSpace, 0, bytesNameSpace.length); + bufferNameSpace.setByte(bytesNameSpace.length, (byte)0); + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + Pointer bufferMetaData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_metadatagroup_getmetadatabykey.invokeInt(new java.lang.Object[]{mHandle, bufferNameSpace, bufferName, bufferMetaData})); + Pointer valueMetaData = bufferMetaData.getPointer(0); + MetaData metaData = null; + if (valueMetaData == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MetaData was a null pointer"); + } + metaData = mWrapper.PolymorphicFactory(valueMetaData, MetaData.class); + return metaData; + } + + /** + * removes metadata by index from the model. + * + * @param index Index of the metadata to remove + * @throws Lib3MFException + */ + public void removeMetaDataByIndex(int index) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_metadatagroup_removemetadatabyindex.invokeInt(new java.lang.Object[]{mHandle, index})); + } + + /** + * removes metadata from the model. + * + * @param theMetaData The metadata to remove + * @throws Lib3MFException + */ + public void removeMetaData(MetaData theMetaData) throws Lib3MFException { + Pointer theMetaDataHandle = null; + if (theMetaData != null) { + theMetaDataHandle = theMetaData.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheMetaData is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_metadatagroup_removemetadata.invokeInt(new java.lang.Object[]{mHandle, theMetaDataHandle})); + } + + /** + * adds a new metadata to this metadatagroup + * + * @param nameSpace the namespace of the metadata + * @param name the name of the metadata + * @param value the value of the metadata + * @param type the type of the metadata + * @param mustPreserve should the metadata be preserved + * @return a new instance of the metadata + * @throws Lib3MFException + */ + public MetaData addMetaData(String nameSpace, String name, String value, String type, boolean mustPreserve) throws Lib3MFException { + byte[] bytesNameSpace = nameSpace.getBytes(StandardCharsets.UTF_8); + Memory bufferNameSpace = new Memory(bytesNameSpace.length + 1); + bufferNameSpace.write(0, bytesNameSpace, 0, bytesNameSpace.length); + bufferNameSpace.setByte(bytesNameSpace.length, (byte)0); + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + byte[] bytesValue = value.getBytes(StandardCharsets.UTF_8); + Memory bufferValue = new Memory(bytesValue.length + 1); + bufferValue.write(0, bytesValue, 0, bytesValue.length); + bufferValue.setByte(bytesValue.length, (byte)0); + byte[] bytesType = type.getBytes(StandardCharsets.UTF_8); + Memory bufferType = new Memory(bytesType.length + 1); + bufferType.write(0, bytesType, 0, bytesType.length); + bufferType.setByte(bytesType.length, (byte)0); + Pointer bufferMetaData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_metadatagroup_addmetadata.invokeInt(new java.lang.Object[]{mHandle, bufferNameSpace, bufferName, bufferValue, bufferType, mustPreserve, bufferMetaData})); + Pointer valueMetaData = bufferMetaData.getPointer(0); + MetaData metaData = null; + if (valueMetaData == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MetaData was a null pointer"); + } + metaData = mWrapper.PolymorphicFactory(valueMetaData, MetaData.class); + return metaData; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/MinNode.java b/Autogenerated/Bindings/Java8/lib3mf/MinNode.java new file mode 100644 index 000000000..1d19cb10e --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/MinNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MinNode extends TwoInputNode { + + public MinNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ModNode.java b/Autogenerated/Bindings/Java8/lib3mf/ModNode.java new file mode 100644 index 000000000..c949f08da --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ModNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ModNode extends TwoInputNode { + + public ModNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Model.java b/Autogenerated/Bindings/Java8/lib3mf/Model.java new file mode 100644 index 000000000..7a12e82c9 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Model.java @@ -0,0 +1,1431 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Model extends Base { + + public Model(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the PackagePart within the OPC package that holds the root model. + * + * @return the PackagePart within the OPC package that holds the model-file + * @throws Lib3MFException + */ + public PackagePart rootModelPart() throws Lib3MFException { + Pointer bufferRootModelPart = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_rootmodelpart.invokeInt(new java.lang.Object[]{mHandle, bufferRootModelPart})); + Pointer valueRootModelPart = bufferRootModelPart.getPointer(0); + PackagePart rootModelPart = null; + if (valueRootModelPart == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "RootModelPart was a null pointer"); + } + rootModelPart = mWrapper.PolymorphicFactory(valueRootModelPart, PackagePart.class); + return rootModelPart; + } + + /** + * Returns a new PackagePart for use within the OPC package. + * + * @param absolutePath the absolute Path (physical location) within the OPC package + * @return the new PackagePart within the OPC package + * @throws Lib3MFException + */ + public PackagePart findOrCreatePackagePart(String absolutePath) throws Lib3MFException { + byte[] bytesAbsolutePath = absolutePath.getBytes(StandardCharsets.UTF_8); + Memory bufferAbsolutePath = new Memory(bytesAbsolutePath.length + 1); + bufferAbsolutePath.write(0, bytesAbsolutePath, 0, bytesAbsolutePath.length); + bufferAbsolutePath.setByte(bytesAbsolutePath.length, (byte)0); + Pointer bufferModelPart = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_findorcreatepackagepart.invokeInt(new java.lang.Object[]{mHandle, bufferAbsolutePath, bufferModelPart})); + Pointer valueModelPart = bufferModelPart.getPointer(0); + PackagePart modelPart = null; + if (valueModelPart == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ModelPart was a null pointer"); + } + modelPart = mWrapper.PolymorphicFactory(valueModelPart, PackagePart.class); + return modelPart; + } + + /** + * sets the units of a model. + * + * @param unit Unit enum value for the model unit + * @throws Lib3MFException + */ + public void setUnit(Lib3MFWrapper.ModelUnit unit) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_model_setunit.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertModelUnitToConst(unit)})); + } + + /** + * returns the units of a model. + * + * @return Unit enum value for the model unit + * @throws Lib3MFException + */ + public Lib3MFWrapper.ModelUnit getUnit() throws Lib3MFException { + Pointer bufferUnit = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_model_getunit.invokeInt(new java.lang.Object[]{mHandle, bufferUnit})); + return Lib3MFWrapper.EnumConversion.convertConstToModelUnit(bufferUnit.getInt(0)); + } + + /** + * retrieves the language of a model + * + * @return language identifier + * @throws Lib3MFException + */ + public String getLanguage() throws Lib3MFException { + Pointer bytesNeededLanguage = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_model_getlanguage.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededLanguage, null})); + int sizeLanguage = bytesNeededLanguage.getInt(0); + Pointer bufferLanguage = new Memory(sizeLanguage); + mWrapper.checkError(this, mWrapper.lib3mf_model_getlanguage.invokeInt(new java.lang.Object[]{mHandle, sizeLanguage, bytesNeededLanguage, bufferLanguage})); + return new String(bufferLanguage.getByteArray(0, sizeLanguage - 1), StandardCharsets.UTF_8); + } + + /** + * sets the language of a model + * + * @param language language identifier + * @throws Lib3MFException + */ + public void setLanguage(String language) throws Lib3MFException { + byte[] bytesLanguage = language.getBytes(StandardCharsets.UTF_8); + Memory bufferLanguage = new Memory(bytesLanguage.length + 1); + bufferLanguage.write(0, bytesLanguage, 0, bytesLanguage.length); + bufferLanguage.setByte(bytesLanguage.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_model_setlanguage.invokeInt(new java.lang.Object[]{mHandle, bufferLanguage})); + } + + /** + * creates a model writer instance for a specific file type + * + * @param writerClass string identifier for the file type + * @return string identifier for the file type + * @throws Lib3MFException + */ + public Writer queryWriter(String writerClass) throws Lib3MFException { + byte[] bytesWriterClass = writerClass.getBytes(StandardCharsets.UTF_8); + Memory bufferWriterClass = new Memory(bytesWriterClass.length + 1); + bufferWriterClass.write(0, bytesWriterClass, 0, bytesWriterClass.length); + bufferWriterClass.setByte(bytesWriterClass.length, (byte)0); + Pointer bufferWriterInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_querywriter.invokeInt(new java.lang.Object[]{mHandle, bufferWriterClass, bufferWriterInstance})); + Pointer valueWriterInstance = bufferWriterInstance.getPointer(0); + Writer writerInstance = null; + if (valueWriterInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "WriterInstance was a null pointer"); + } + writerInstance = mWrapper.PolymorphicFactory(valueWriterInstance, Writer.class); + return writerInstance; + } + + /** + * creates a model reader instance for a specific file type + * + * @param readerClass string identifier for the file type + * @return string identifier for the file type + * @throws Lib3MFException + */ + public Reader queryReader(String readerClass) throws Lib3MFException { + byte[] bytesReaderClass = readerClass.getBytes(StandardCharsets.UTF_8); + Memory bufferReaderClass = new Memory(bytesReaderClass.length + 1); + bufferReaderClass.write(0, bytesReaderClass, 0, bytesReaderClass.length); + bufferReaderClass.setByte(bytesReaderClass.length, (byte)0); + Pointer bufferReaderInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_queryreader.invokeInt(new java.lang.Object[]{mHandle, bufferReaderClass, bufferReaderInstance})); + Pointer valueReaderInstance = bufferReaderInstance.getPointer(0); + Reader readerInstance = null; + if (valueReaderInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ReaderInstance was a null pointer"); + } + readerInstance = mWrapper.PolymorphicFactory(valueReaderInstance, Reader.class); + return readerInstance; + } + + /** + * finds a model resource by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the resource instance + * @throws Lib3MFException + */ + public Resource getResourceByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getresourcebyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + Resource resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, Resource.class); + return resource; + } + + /** + * finds a model texture by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the texture2d instance + * @throws Lib3MFException + */ + public Texture2D getTexture2DByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferTextureInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_gettexture2dbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferTextureInstance})); + Pointer valueTextureInstance = bufferTextureInstance.getPointer(0); + Texture2D textureInstance = null; + if (valueTextureInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TextureInstance was a null pointer"); + } + textureInstance = mWrapper.PolymorphicFactory(valueTextureInstance, Texture2D.class); + return textureInstance; + } + + /** + * returns a Property's type + * + * @param uniqueResourceID Resource ID of the Property to Query + * @return returns a Property's type + * @throws Lib3MFException + */ + public Lib3MFWrapper.PropertyType getPropertyTypeByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferThePropertyType = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_model_getpropertytypebyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferThePropertyType})); + return Lib3MFWrapper.EnumConversion.convertConstToPropertyType(bufferThePropertyType.getInt(0)); + } + + /** + * finds a model base material group by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the BaseMaterialGroup instance + * @throws Lib3MFException + */ + public BaseMaterialGroup getBaseMaterialGroupByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferBaseMaterialGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getbasematerialgroupbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferBaseMaterialGroupInstance})); + Pointer valueBaseMaterialGroupInstance = bufferBaseMaterialGroupInstance.getPointer(0); + BaseMaterialGroup baseMaterialGroupInstance = null; + if (valueBaseMaterialGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BaseMaterialGroupInstance was a null pointer"); + } + baseMaterialGroupInstance = mWrapper.PolymorphicFactory(valueBaseMaterialGroupInstance, BaseMaterialGroup.class); + return baseMaterialGroupInstance; + } + + /** + * finds a model texture2d group by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the Texture2DGroup instance + * @throws Lib3MFException + */ + public Texture2DGroup getTexture2DGroupByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferTexture2DGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_gettexture2dgroupbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferTexture2DGroupInstance})); + Pointer valueTexture2DGroupInstance = bufferTexture2DGroupInstance.getPointer(0); + Texture2DGroup texture2DGroupInstance = null; + if (valueTexture2DGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Texture2DGroupInstance was a null pointer"); + } + texture2DGroupInstance = mWrapper.PolymorphicFactory(valueTexture2DGroupInstance, Texture2DGroup.class); + return texture2DGroupInstance; + } + + /** + * finds a model CompositeMaterials by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the CompositeMaterials instance + * @throws Lib3MFException + */ + public CompositeMaterials getCompositeMaterialsByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferCompositeMaterialsInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getcompositematerialsbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferCompositeMaterialsInstance})); + Pointer valueCompositeMaterialsInstance = bufferCompositeMaterialsInstance.getPointer(0); + CompositeMaterials compositeMaterialsInstance = null; + if (valueCompositeMaterialsInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "CompositeMaterialsInstance was a null pointer"); + } + compositeMaterialsInstance = mWrapper.PolymorphicFactory(valueCompositeMaterialsInstance, CompositeMaterials.class); + return compositeMaterialsInstance; + } + + /** + * finds a model MultiPropertyGroup by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the MultiPropertyGroup instance + * @throws Lib3MFException + */ + public MultiPropertyGroup getMultiPropertyGroupByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferMultiPropertyGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getmultipropertygroupbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferMultiPropertyGroupInstance})); + Pointer valueMultiPropertyGroupInstance = bufferMultiPropertyGroupInstance.getPointer(0); + MultiPropertyGroup multiPropertyGroupInstance = null; + if (valueMultiPropertyGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MultiPropertyGroupInstance was a null pointer"); + } + multiPropertyGroupInstance = mWrapper.PolymorphicFactory(valueMultiPropertyGroupInstance, MultiPropertyGroup.class); + return multiPropertyGroupInstance; + } + + /** + * finds a mesh object by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the mesh object instance + * @throws Lib3MFException + */ + public MeshObject getMeshObjectByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferMeshObjectInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getmeshobjectbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferMeshObjectInstance})); + Pointer valueMeshObjectInstance = bufferMeshObjectInstance.getPointer(0); + MeshObject meshObjectInstance = null; + if (valueMeshObjectInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MeshObjectInstance was a null pointer"); + } + meshObjectInstance = mWrapper.PolymorphicFactory(valueMeshObjectInstance, MeshObject.class); + return meshObjectInstance; + } + + /** + * finds a components object by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the components object instance + * @throws Lib3MFException + */ + public ComponentsObject getComponentsObjectByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferComponentsObjectInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getcomponentsobjectbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferComponentsObjectInstance})); + Pointer valueComponentsObjectInstance = bufferComponentsObjectInstance.getPointer(0); + ComponentsObject componentsObjectInstance = null; + if (valueComponentsObjectInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ComponentsObjectInstance was a null pointer"); + } + componentsObjectInstance = mWrapper.PolymorphicFactory(valueComponentsObjectInstance, ComponentsObject.class); + return componentsObjectInstance; + } + + /** + * finds a boolean object by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the boolean object instance + * @throws Lib3MFException + */ + public BooleanObject getBooleanObjectByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferBooleanObjectInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getbooleanobjectbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferBooleanObjectInstance})); + Pointer valueBooleanObjectInstance = bufferBooleanObjectInstance.getPointer(0); + BooleanObject booleanObjectInstance = null; + if (valueBooleanObjectInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BooleanObjectInstance was a null pointer"); + } + booleanObjectInstance = mWrapper.PolymorphicFactory(valueBooleanObjectInstance, BooleanObject.class); + return booleanObjectInstance; + } + + /** + * finds a model color group by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the ColorGroup instance + * @throws Lib3MFException + */ + public ColorGroup getColorGroupByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferColorGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getcolorgroupbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferColorGroupInstance})); + Pointer valueColorGroupInstance = bufferColorGroupInstance.getPointer(0); + ColorGroup colorGroupInstance = null; + if (valueColorGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ColorGroupInstance was a null pointer"); + } + colorGroupInstance = mWrapper.PolymorphicFactory(valueColorGroupInstance, ColorGroup.class); + return colorGroupInstance; + } + + /** + * finds a model slicestack by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the slicestack instance + * @throws Lib3MFException + */ + public SliceStack getSliceStackByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferSliceStacInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getslicestackbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferSliceStacInstance})); + Pointer valueSliceStacInstance = bufferSliceStacInstance.getPointer(0); + SliceStack sliceStacInstance = null; + if (valueSliceStacInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "SliceStacInstance was a null pointer"); + } + sliceStacInstance = mWrapper.PolymorphicFactory(valueSliceStacInstance, SliceStack.class); + return sliceStacInstance; + } + + /** + * finds a level set object by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the level set object instance + * @throws Lib3MFException + */ + public LevelSet getLevelSetByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferLevelSetObjectInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getlevelsetbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferLevelSetObjectInstance})); + Pointer valueLevelSetObjectInstance = bufferLevelSetObjectInstance.getPointer(0); + LevelSet levelSetObjectInstance = null; + if (valueLevelSetObjectInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "LevelSetObjectInstance was a null pointer"); + } + levelSetObjectInstance = mWrapper.PolymorphicFactory(valueLevelSetObjectInstance, LevelSet.class); + return levelSetObjectInstance; + } + + /** + * returns, whether a build has a UUID and, if true, the build's UUID + * + * @return GetBuildUUID Result Tuple + * @throws Lib3MFException + */ + public GetBuildUUIDResult getBuildUUID() throws Lib3MFException { + Pointer bufferHasUUID = new Memory(1); + Pointer bytesNeededUUID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_model_getbuilduuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, 0, bytesNeededUUID, null})); + int sizeUUID = bytesNeededUUID.getInt(0); + Pointer bufferUUID = new Memory(sizeUUID); + mWrapper.checkError(this, mWrapper.lib3mf_model_getbuilduuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, sizeUUID, bytesNeededUUID, bufferUUID})); + GetBuildUUIDResult returnTuple = new GetBuildUUIDResult(); + returnTuple.HasUUID = bufferHasUUID.getByte(0) != 0; + returnTuple.UUID = new String(bufferUUID.getByteArray(0, sizeUUID - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetBuildUUIDResult { + /** + * flag whether the build has a UUID + */ + public boolean HasUUID; + + /** + * the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + */ + public String UUID; + + } + /** + * sets the build's UUID + * + * @param uUID the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * @throws Lib3MFException + */ + public void setBuildUUID(String uUID) throws Lib3MFException { + byte[] bytesUUID = uUID.getBytes(StandardCharsets.UTF_8); + Memory bufferUUID = new Memory(bytesUUID.length + 1); + bufferUUID.write(0, bytesUUID, 0, bytesUUID.length); + bufferUUID.setByte(bytesUUID.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_model_setbuilduuid.invokeInt(new java.lang.Object[]{mHandle, bufferUUID})); + } + + /** + * creates a build item iterator instance with all build items. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public BuildItemIterator getBuildItems() throws Lib3MFException { + Pointer bufferBuildItemIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getbuilditems.invokeInt(new java.lang.Object[]{mHandle, bufferBuildItemIterator})); + Pointer valueBuildItemIterator = bufferBuildItemIterator.getPointer(0); + BuildItemIterator buildItemIterator = null; + if (valueBuildItemIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BuildItemIterator was a null pointer"); + } + buildItemIterator = mWrapper.PolymorphicFactory(valueBuildItemIterator, BuildItemIterator.class); + return buildItemIterator; + } + + /** + * Returns the outbox of a Model + * + * @return Outbox of this Model + * @throws Lib3MFException + */ + public Box getOutbox() throws Lib3MFException { + Pointer bufferOutbox = new Memory(Box.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_model_getoutbox.invokeInt(new java.lang.Object[]{mHandle, bufferOutbox})); + Box outbox = new Box(); + outbox.readFromPointer(bufferOutbox, 0); + return outbox; + } + + /** + * creates a resource iterator instance with all resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public ResourceIterator getResources() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getresources.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + ResourceIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, ResourceIterator.class); + return resourceIterator; + } + + /** + * creates a resource iterator instance with all object resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public ObjectIterator getObjects() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getobjects.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + ObjectIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, ObjectIterator.class); + return resourceIterator; + } + + /** + * creates a resource iterator instance with all mesh object resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public MeshObjectIterator getMeshObjects() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getmeshobjects.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + MeshObjectIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, MeshObjectIterator.class); + return resourceIterator; + } + + /** + * creates a resource iterator instance with all components object resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public ComponentsObjectIterator getComponentsObjects() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getcomponentsobjects.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + ComponentsObjectIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, ComponentsObjectIterator.class); + return resourceIterator; + } + + /** + * creates a resource iterator instance with all boolean object resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public BooleanObjectIterator getBooleanObjects() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getbooleanobjects.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + BooleanObjectIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, BooleanObjectIterator.class); + return resourceIterator; + } + + /** + * creates a Texture2DIterator instance with all texture2d resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public Texture2DIterator getTexture2Ds() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_gettexture2ds.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + Texture2DIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, Texture2DIterator.class); + return resourceIterator; + } + + /** + * creates a BaseMaterialGroupIterator instance with all base material resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public BaseMaterialGroupIterator getBaseMaterialGroups() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getbasematerialgroups.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + BaseMaterialGroupIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, BaseMaterialGroupIterator.class); + return resourceIterator; + } + + /** + * creates a ColorGroupIterator instance with all ColorGroup resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public ColorGroupIterator getColorGroups() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getcolorgroups.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + ColorGroupIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, ColorGroupIterator.class); + return resourceIterator; + } + + /** + * creates a Texture2DGroupIterator instance with all base material resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public Texture2DGroupIterator getTexture2DGroups() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_gettexture2dgroups.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + Texture2DGroupIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, Texture2DGroupIterator.class); + return resourceIterator; + } + + /** + * creates a CompositeMaterialsIterator instance with all CompositeMaterials resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public CompositeMaterialsIterator getCompositeMaterials() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getcompositematerials.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + CompositeMaterialsIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, CompositeMaterialsIterator.class); + return resourceIterator; + } + + /** + * creates a MultiPropertyGroupsIterator instance with all MultiPropertyGroup resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public MultiPropertyGroupIterator getMultiPropertyGroups() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getmultipropertygroups.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + MultiPropertyGroupIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, MultiPropertyGroupIterator.class); + return resourceIterator; + } + + /** + * creates a resource iterator instance with all slice stack resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public SliceStackIterator getSliceStacks() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getslicestacks.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + SliceStackIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, SliceStackIterator.class); + return resourceIterator; + } + + /** + * creates a resource iterator instance with all image3d resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public Image3DIterator getImage3Ds() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getimage3ds.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + Image3DIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, Image3DIterator.class); + return resourceIterator; + } + + /** + * Merges all components and objects which are referenced by a build item into a mesh. The memory is duplicated and a new model is created. + * + * @return returns the merged model instance + * @throws Lib3MFException + */ + public Model mergeToModel() throws Lib3MFException { + Pointer bufferMergedModelInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_mergetomodel.invokeInt(new java.lang.Object[]{mHandle, bufferMergedModelInstance})); + Pointer valueMergedModelInstance = bufferMergedModelInstance.getPointer(0); + Model mergedModelInstance = null; + if (valueMergedModelInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MergedModelInstance was a null pointer"); + } + mergedModelInstance = mWrapper.PolymorphicFactory(valueMergedModelInstance, Model.class); + return mergedModelInstance; + } + + /** + * Merges the given model into this model. + * + * @param modelInstance model to be merged + * @throws Lib3MFException + */ + public void mergeFromModel(Model modelInstance) throws Lib3MFException { + Pointer modelInstanceHandle = null; + if (modelInstance != null) { + modelInstanceHandle = modelInstance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ModelInstance is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_model_mergefrommodel.invokeInt(new java.lang.Object[]{mHandle, modelInstanceHandle})); + } + + /** + * adds an empty mesh object to the model. + * + * @return returns the mesh object instance + * @throws Lib3MFException + */ + public MeshObject addMeshObject() throws Lib3MFException { + Pointer bufferMeshObjectInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addmeshobject.invokeInt(new java.lang.Object[]{mHandle, bufferMeshObjectInstance})); + Pointer valueMeshObjectInstance = bufferMeshObjectInstance.getPointer(0); + MeshObject meshObjectInstance = null; + if (valueMeshObjectInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MeshObjectInstance was a null pointer"); + } + meshObjectInstance = mWrapper.PolymorphicFactory(valueMeshObjectInstance, MeshObject.class); + return meshObjectInstance; + } + + /** + * adds an empty component object to the model. + * + * @return returns the components object instance + * @throws Lib3MFException + */ + public ComponentsObject addComponentsObject() throws Lib3MFException { + Pointer bufferComponentsObjectInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addcomponentsobject.invokeInt(new java.lang.Object[]{mHandle, bufferComponentsObjectInstance})); + Pointer valueComponentsObjectInstance = bufferComponentsObjectInstance.getPointer(0); + ComponentsObject componentsObjectInstance = null; + if (valueComponentsObjectInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ComponentsObjectInstance was a null pointer"); + } + componentsObjectInstance = mWrapper.PolymorphicFactory(valueComponentsObjectInstance, ComponentsObject.class); + return componentsObjectInstance; + } + + /** + * adds an empty boolean object to the model. + * + * @return returns the boolean object instance + * @throws Lib3MFException + */ + public BooleanObject addBooleanObject() throws Lib3MFException { + Pointer bufferBooleanObjectInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addbooleanobject.invokeInt(new java.lang.Object[]{mHandle, bufferBooleanObjectInstance})); + Pointer valueBooleanObjectInstance = bufferBooleanObjectInstance.getPointer(0); + BooleanObject booleanObjectInstance = null; + if (valueBooleanObjectInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BooleanObjectInstance was a null pointer"); + } + booleanObjectInstance = mWrapper.PolymorphicFactory(valueBooleanObjectInstance, BooleanObject.class); + return booleanObjectInstance; + } + + /** + * creates a new model slicestack by its id + * + * @param zBottom Bottom Z value of the slicestack + * @return returns the new slicestack instance + * @throws Lib3MFException + */ + public SliceStack addSliceStack(double zBottom) throws Lib3MFException { + Pointer bufferSliceStackInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addslicestack.invokeInt(new java.lang.Object[]{mHandle, zBottom, bufferSliceStackInstance})); + Pointer valueSliceStackInstance = bufferSliceStackInstance.getPointer(0); + SliceStack sliceStackInstance = null; + if (valueSliceStackInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "SliceStackInstance was a null pointer"); + } + sliceStackInstance = mWrapper.PolymorphicFactory(valueSliceStackInstance, SliceStack.class); + return sliceStackInstance; + } + + /** + * adds a texture2d resource to the model. Its path is given by that of an existing attachment. + * + * @param textureAttachment attachment containing the image data. + * @return returns the new texture instance. + * @throws Lib3MFException + */ + public Texture2D addTexture2DFromAttachment(Attachment textureAttachment) throws Lib3MFException { + Pointer textureAttachmentHandle = null; + if (textureAttachment != null) { + textureAttachmentHandle = textureAttachment.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TextureAttachment is a null value."); + } + Pointer bufferTexture2DInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addtexture2dfromattachment.invokeInt(new java.lang.Object[]{mHandle, textureAttachmentHandle, bufferTexture2DInstance})); + Pointer valueTexture2DInstance = bufferTexture2DInstance.getPointer(0); + Texture2D texture2DInstance = null; + if (valueTexture2DInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Texture2DInstance was a null pointer"); + } + texture2DInstance = mWrapper.PolymorphicFactory(valueTexture2DInstance, Texture2D.class); + return texture2DInstance; + } + + /** + * adds an empty BaseMaterialGroup resource to the model. + * + * @return returns the new base material instance. + * @throws Lib3MFException + */ + public BaseMaterialGroup addBaseMaterialGroup() throws Lib3MFException { + Pointer bufferBaseMaterialGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addbasematerialgroup.invokeInt(new java.lang.Object[]{mHandle, bufferBaseMaterialGroupInstance})); + Pointer valueBaseMaterialGroupInstance = bufferBaseMaterialGroupInstance.getPointer(0); + BaseMaterialGroup baseMaterialGroupInstance = null; + if (valueBaseMaterialGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BaseMaterialGroupInstance was a null pointer"); + } + baseMaterialGroupInstance = mWrapper.PolymorphicFactory(valueBaseMaterialGroupInstance, BaseMaterialGroup.class); + return baseMaterialGroupInstance; + } + + /** + * adds an empty ColorGroup resource to the model. + * + * @return returns the new ColorGroup instance. + * @throws Lib3MFException + */ + public ColorGroup addColorGroup() throws Lib3MFException { + Pointer bufferColorGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addcolorgroup.invokeInt(new java.lang.Object[]{mHandle, bufferColorGroupInstance})); + Pointer valueColorGroupInstance = bufferColorGroupInstance.getPointer(0); + ColorGroup colorGroupInstance = null; + if (valueColorGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ColorGroupInstance was a null pointer"); + } + colorGroupInstance = mWrapper.PolymorphicFactory(valueColorGroupInstance, ColorGroup.class); + return colorGroupInstance; + } + + /** + * adds an empty Texture2DGroup resource to the model. + * + * @param texture2DInstance The texture2D instance of the created Texture2DGroup. + * @return returns the new Texture2DGroup instance. + * @throws Lib3MFException + */ + public Texture2DGroup addTexture2DGroup(Texture2D texture2DInstance) throws Lib3MFException { + Pointer texture2DInstanceHandle = null; + if (texture2DInstance != null) { + texture2DInstanceHandle = texture2DInstance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Texture2DInstance is a null value."); + } + Pointer bufferTexture2DGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addtexture2dgroup.invokeInt(new java.lang.Object[]{mHandle, texture2DInstanceHandle, bufferTexture2DGroupInstance})); + Pointer valueTexture2DGroupInstance = bufferTexture2DGroupInstance.getPointer(0); + Texture2DGroup texture2DGroupInstance = null; + if (valueTexture2DGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Texture2DGroupInstance was a null pointer"); + } + texture2DGroupInstance = mWrapper.PolymorphicFactory(valueTexture2DGroupInstance, Texture2DGroup.class); + return texture2DGroupInstance; + } + + /** + * adds an empty CompositeMaterials resource to the model. + * + * @param baseMaterialGroupInstance The BaseMaterialGroup instance of the created CompositeMaterials. + * @return returns the new CompositeMaterials instance. + * @throws Lib3MFException + */ + public CompositeMaterials addCompositeMaterials(BaseMaterialGroup baseMaterialGroupInstance) throws Lib3MFException { + Pointer baseMaterialGroupInstanceHandle = null; + if (baseMaterialGroupInstance != null) { + baseMaterialGroupInstanceHandle = baseMaterialGroupInstance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BaseMaterialGroupInstance is a null value."); + } + Pointer bufferCompositeMaterialsInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addcompositematerials.invokeInt(new java.lang.Object[]{mHandle, baseMaterialGroupInstanceHandle, bufferCompositeMaterialsInstance})); + Pointer valueCompositeMaterialsInstance = bufferCompositeMaterialsInstance.getPointer(0); + CompositeMaterials compositeMaterialsInstance = null; + if (valueCompositeMaterialsInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "CompositeMaterialsInstance was a null pointer"); + } + compositeMaterialsInstance = mWrapper.PolymorphicFactory(valueCompositeMaterialsInstance, CompositeMaterials.class); + return compositeMaterialsInstance; + } + + /** + * adds an empty MultiPropertyGroup resource to the model. + * + * @return returns the new MultiPropertyGroup instance. + * @throws Lib3MFException + */ + public MultiPropertyGroup addMultiPropertyGroup() throws Lib3MFException { + Pointer bufferMultiPropertyGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addmultipropertygroup.invokeInt(new java.lang.Object[]{mHandle, bufferMultiPropertyGroupInstance})); + Pointer valueMultiPropertyGroupInstance = bufferMultiPropertyGroupInstance.getPointer(0); + MultiPropertyGroup multiPropertyGroupInstance = null; + if (valueMultiPropertyGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MultiPropertyGroupInstance was a null pointer"); + } + multiPropertyGroupInstance = mWrapper.PolymorphicFactory(valueMultiPropertyGroupInstance, MultiPropertyGroup.class); + return multiPropertyGroupInstance; + } + + /** + * creates a new 3D Image Resource + * + * @param columnCount the number of columns in each sheet. + * @param rowCount the number of rows in each sheet. + * @param sheetCount the number of sheets in the image stack. + * @return returns the new ImageStack instance + * @throws Lib3MFException + */ + public ImageStack addImageStack(int columnCount, int rowCount, int sheetCount) throws Lib3MFException { + Pointer bufferInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addimagestack.invokeInt(new java.lang.Object[]{mHandle, columnCount, rowCount, sheetCount, bufferInstance})); + Pointer valueInstance = bufferInstance.getPointer(0); + ImageStack instance = null; + if (valueInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Instance was a null pointer"); + } + instance = mWrapper.PolymorphicFactory(valueInstance, ImageStack.class); + return instance; + } + + /** + * finds an ImageStack object by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the image stack instance + * @throws Lib3MFException + */ + public ImageStack getImageStackByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferImageStackInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getimagestackbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferImageStackInstance})); + Pointer valueImageStackInstance = bufferImageStackInstance.getPointer(0); + ImageStack imageStackInstance = null; + if (valueImageStackInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ImageStackInstance was a null pointer"); + } + imageStackInstance = mWrapper.PolymorphicFactory(valueImageStackInstance, ImageStack.class); + return imageStackInstance; + } + + /** + * adds a build item to the model. + * + * @param object Object instance. + * @param transform Transformation matrix. + * @return returns the build item instance. + * @throws Lib3MFException + */ + public BuildItem addBuildItem(Object object, Transform transform) throws Lib3MFException { + Pointer objectHandle = null; + if (object != null) { + objectHandle = object.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Object is a null value."); + } + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + Pointer bufferBuildItemInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addbuilditem.invokeInt(new java.lang.Object[]{mHandle, objectHandle, bufferTransform, bufferBuildItemInstance})); + Pointer valueBuildItemInstance = bufferBuildItemInstance.getPointer(0); + BuildItem buildItemInstance = null; + if (valueBuildItemInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BuildItemInstance was a null pointer"); + } + buildItemInstance = mWrapper.PolymorphicFactory(valueBuildItemInstance, BuildItem.class); + return buildItemInstance; + } + + /** + * removes a build item from the model + * + * @param buildItemInstance Build item to remove. + * @throws Lib3MFException + */ + public void removeBuildItem(BuildItem buildItemInstance) throws Lib3MFException { + Pointer buildItemInstanceHandle = null; + if (buildItemInstance != null) { + buildItemInstanceHandle = buildItemInstance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BuildItemInstance is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_model_removebuilditem.invokeInt(new java.lang.Object[]{mHandle, buildItemInstanceHandle})); + } + + /** + * Returns the metadata of the model as MetaDataGroup + * + * @return returns an Instance of the metadatagroup of the model + * @throws Lib3MFException + */ + public MetaDataGroup getMetaDataGroup() throws Lib3MFException { + Pointer bufferTheMetaDataGroup = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getmetadatagroup.invokeInt(new java.lang.Object[]{mHandle, bufferTheMetaDataGroup})); + Pointer valueTheMetaDataGroup = bufferTheMetaDataGroup.getPointer(0); + MetaDataGroup theMetaDataGroup = null; + if (valueTheMetaDataGroup == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheMetaDataGroup was a null pointer"); + } + theMetaDataGroup = mWrapper.PolymorphicFactory(valueTheMetaDataGroup, MetaDataGroup.class); + return theMetaDataGroup; + } + + /** + * adds an attachment stream to the model. The OPC part will be related to the model stream with a certain relationship type. + * + * @param uRI Path of the attachment + * @param relationShipType Relationship type of the attachment + * @return Instance of the attachment object + * @throws Lib3MFException + */ + public Attachment addAttachment(String uRI, String relationShipType) throws Lib3MFException { + byte[] bytesURI = uRI.getBytes(StandardCharsets.UTF_8); + Memory bufferURI = new Memory(bytesURI.length + 1); + bufferURI.write(0, bytesURI, 0, bytesURI.length); + bufferURI.setByte(bytesURI.length, (byte)0); + byte[] bytesRelationShipType = relationShipType.getBytes(StandardCharsets.UTF_8); + Memory bufferRelationShipType = new Memory(bytesRelationShipType.length + 1); + bufferRelationShipType.write(0, bytesRelationShipType, 0, bytesRelationShipType.length); + bufferRelationShipType.setByte(bytesRelationShipType.length, (byte)0); + Pointer bufferAttachmentInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addattachment.invokeInt(new java.lang.Object[]{mHandle, bufferURI, bufferRelationShipType, bufferAttachmentInstance})); + Pointer valueAttachmentInstance = bufferAttachmentInstance.getPointer(0); + Attachment attachmentInstance = null; + if (valueAttachmentInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "AttachmentInstance was a null pointer"); + } + attachmentInstance = mWrapper.PolymorphicFactory(valueAttachmentInstance, Attachment.class); + return attachmentInstance; + } + + /** + * Removes attachment from the model. + * + * @param attachmentInstance Attachment instance to remove + * @throws Lib3MFException + */ + public void removeAttachment(Attachment attachmentInstance) throws Lib3MFException { + Pointer attachmentInstanceHandle = null; + if (attachmentInstance != null) { + attachmentInstanceHandle = attachmentInstance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "AttachmentInstance is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_model_removeattachment.invokeInt(new java.lang.Object[]{mHandle, attachmentInstanceHandle})); + } + + /** + * retrieves an attachment stream object from the model.. + * + * @param index Index of the attachment stream + * @return Instance of the attachment object + * @throws Lib3MFException + */ + public Attachment getAttachment(int index) throws Lib3MFException { + Pointer bufferAttachmentInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getattachment.invokeInt(new java.lang.Object[]{mHandle, index, bufferAttachmentInstance})); + Pointer valueAttachmentInstance = bufferAttachmentInstance.getPointer(0); + Attachment attachmentInstance = null; + if (valueAttachmentInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "AttachmentInstance was a null pointer"); + } + attachmentInstance = mWrapper.PolymorphicFactory(valueAttachmentInstance, Attachment.class); + return attachmentInstance; + } + + /** + * retrieves an attachment stream object from the model. + * + * @param uRI Path URI in the package + * @return Instance of the attachment object + * @throws Lib3MFException + */ + public Attachment findAttachment(String uRI) throws Lib3MFException { + byte[] bytesURI = uRI.getBytes(StandardCharsets.UTF_8); + Memory bufferURI = new Memory(bytesURI.length + 1); + bufferURI.write(0, bytesURI, 0, bytesURI.length); + bufferURI.setByte(bytesURI.length, (byte)0); + Pointer bufferAttachmentInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_findattachment.invokeInt(new java.lang.Object[]{mHandle, bufferURI, bufferAttachmentInstance})); + Pointer valueAttachmentInstance = bufferAttachmentInstance.getPointer(0); + Attachment attachmentInstance = null; + if (valueAttachmentInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "AttachmentInstance was a null pointer"); + } + attachmentInstance = mWrapper.PolymorphicFactory(valueAttachmentInstance, Attachment.class); + return attachmentInstance; + } + + /** + * retrieves the number of attachments of the model. + * + * @return Returns the number of attachments. + * @throws Lib3MFException + */ + public int getAttachmentCount() throws Lib3MFException { + Pointer bufferAttachmentCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_model_getattachmentcount.invokeInt(new java.lang.Object[]{mHandle, bufferAttachmentCount})); + return bufferAttachmentCount.getInt(0); + } + + /** + * Retrieve whether the OPC package contains a package thumbnail. + * + * @return returns whether the OPC package contains a package thumbnail + * @throws Lib3MFException + */ + public boolean hasPackageThumbnailAttachment() throws Lib3MFException { + Pointer bufferHasThumbnail = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_model_haspackagethumbnailattachment.invokeInt(new java.lang.Object[]{mHandle, bufferHasThumbnail})); + return bufferHasThumbnail.getByte(0) != 0; + } + + /** + * Create a new or the existing package thumbnail for the OPC package. + * + * @return Instance of a new or the existing thumbnailattachment object. + * @throws Lib3MFException + */ + public Attachment createPackageThumbnailAttachment() throws Lib3MFException { + Pointer bufferAttachment = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_createpackagethumbnailattachment.invokeInt(new java.lang.Object[]{mHandle, bufferAttachment})); + Pointer valueAttachment = bufferAttachment.getPointer(0); + Attachment attachment = null; + if (valueAttachment == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Attachment was a null pointer"); + } + attachment = mWrapper.PolymorphicFactory(valueAttachment, Attachment.class); + return attachment; + } + + /** + * Get the attachment to the OPC package containing the package thumbnail. + * + * @return Instance of the thumbnailattachment object or NULL. + * @throws Lib3MFException + */ + public Attachment getPackageThumbnailAttachment() throws Lib3MFException { + Pointer bufferAttachment = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getpackagethumbnailattachment.invokeInt(new java.lang.Object[]{mHandle, bufferAttachment})); + Pointer valueAttachment = bufferAttachment.getPointer(0); + Attachment attachment = null; + if (valueAttachment != Pointer.NULL) { + attachment = mWrapper.PolymorphicFactory(valueAttachment, Attachment.class); + } + return attachment; + } + + /** + * Remove the attachment to the OPC package containing the package thumbnail. + * + * @throws Lib3MFException + */ + public void removePackageThumbnailAttachment() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_model_removepackagethumbnailattachment.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Adds a new Content Type to the model. + * + * @param extension File Extension + * @param contentType Content Type Identifier + * @throws Lib3MFException + */ + public void addCustomContentType(String extension, String contentType) throws Lib3MFException { + byte[] bytesExtension = extension.getBytes(StandardCharsets.UTF_8); + Memory bufferExtension = new Memory(bytesExtension.length + 1); + bufferExtension.write(0, bytesExtension, 0, bytesExtension.length); + bufferExtension.setByte(bytesExtension.length, (byte)0); + byte[] bytesContentType = contentType.getBytes(StandardCharsets.UTF_8); + Memory bufferContentType = new Memory(bytesContentType.length + 1); + bufferContentType.write(0, bytesContentType, 0, bytesContentType.length); + bufferContentType.setByte(bytesContentType.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_model_addcustomcontenttype.invokeInt(new java.lang.Object[]{mHandle, bufferExtension, bufferContentType})); + } + + /** + * Removes a custom Content Type from the model (UTF8 version). + * + * @param extension File Extension + * @throws Lib3MFException + */ + public void removeCustomContentType(String extension) throws Lib3MFException { + byte[] bytesExtension = extension.getBytes(StandardCharsets.UTF_8); + Memory bufferExtension = new Memory(bytesExtension.length + 1); + bufferExtension.write(0, bytesExtension, 0, bytesExtension.length); + bufferExtension.setByte(bytesExtension.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_model_removecustomcontenttype.invokeInt(new java.lang.Object[]{mHandle, bufferExtension})); + } + + /** + * Sets the random number generator callback for use in the library + * + * @param theCallback The callback used to generate random numbers + * @param userData Userdata to be passed to the callback function + * @throws Lib3MFException + */ + public void setRandomNumberCallback(Lib3MFWrapper.RandomNumberCallback theCallback, Pointer userData) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_model_setrandomnumbercallback.invokeInt(new java.lang.Object[]{mHandle, theCallback, userData})); + } + + /** + * Gets the keystore associated with this model + * + * @return The package keystore + * @throws Lib3MFException + */ + public KeyStore getKeyStore() throws Lib3MFException { + Pointer bufferKeyStore = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getkeystore.invokeInt(new java.lang.Object[]{mHandle, bufferKeyStore})); + Pointer valueKeyStore = bufferKeyStore.getPointer(0); + KeyStore keyStore = null; + if (valueKeyStore == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "KeyStore was a null pointer"); + } + keyStore = mWrapper.PolymorphicFactory(valueKeyStore, KeyStore.class); + return keyStore; + } + + /** + * creates a resource iterator for all functions + * + * @return returns the resource iterator + * @throws Lib3MFException + */ + public FunctionIterator getFunctions() throws Lib3MFException { + Pointer bufferTheResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getfunctions.invokeInt(new java.lang.Object[]{mHandle, bufferTheResourceIterator})); + Pointer valueTheResourceIterator = bufferTheResourceIterator.getPointer(0); + FunctionIterator theResourceIterator = null; + if (valueTheResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheResourceIterator was a null pointer"); + } + theResourceIterator = mWrapper.PolymorphicFactory(valueTheResourceIterator, FunctionIterator.class); + return theResourceIterator; + } + + /** + * adds a function described by nodes to the model + * + * @return returns the function instance + * @throws Lib3MFException + */ + public ImplicitFunction addImplicitFunction() throws Lib3MFException { + Pointer bufferFunctionInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addimplicitfunction.invokeInt(new java.lang.Object[]{mHandle, bufferFunctionInstance})); + Pointer valueFunctionInstance = bufferFunctionInstance.getPointer(0); + ImplicitFunction functionInstance = null; + if (valueFunctionInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "FunctionInstance was a null pointer"); + } + functionInstance = mWrapper.PolymorphicFactory(valueFunctionInstance, ImplicitFunction.class); + return functionInstance; + } + + /** + * adds a function defined by an image3d to the model + * + * @param image3DInstance the Image3D-instance used for this function + * @return returns the function instance + * @throws Lib3MFException + */ + public FunctionFromImage3D addFunctionFromImage3D(Image3D image3DInstance) throws Lib3MFException { + Pointer image3DInstanceHandle = null; + if (image3DInstance != null) { + image3DInstanceHandle = image3DInstance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Image3DInstance is a null value."); + } + Pointer bufferFunctionInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addfunctionfromimage3d.invokeInt(new java.lang.Object[]{mHandle, image3DInstanceHandle, bufferFunctionInstance})); + Pointer valueFunctionInstance = bufferFunctionInstance.getPointer(0); + FunctionFromImage3D functionInstance = null; + if (valueFunctionInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "FunctionInstance was a null pointer"); + } + functionInstance = mWrapper.PolymorphicFactory(valueFunctionInstance, FunctionFromImage3D.class); + return functionInstance; + } + + /** + * adds a volume data resource to the model. + * + * @return returns the new volume data instance. + * @throws Lib3MFException + */ + public VolumeData addVolumeData() throws Lib3MFException { + Pointer bufferVolumeDataInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addvolumedata.invokeInt(new java.lang.Object[]{mHandle, bufferVolumeDataInstance})); + Pointer valueVolumeDataInstance = bufferVolumeDataInstance.getPointer(0); + VolumeData volumeDataInstance = null; + if (valueVolumeDataInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "VolumeDataInstance was a null pointer"); + } + volumeDataInstance = mWrapper.PolymorphicFactory(valueVolumeDataInstance, VolumeData.class); + return volumeDataInstance; + } + + /** + * adds an empty boundary shape object to the model. + * + * @return returns the mesh object instance + * @throws Lib3MFException + */ + public LevelSet addLevelSet() throws Lib3MFException { + Pointer bufferLevelSetInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addlevelset.invokeInt(new java.lang.Object[]{mHandle, bufferLevelSetInstance})); + Pointer valueLevelSetInstance = bufferLevelSetInstance.getPointer(0); + LevelSet levelSetInstance = null; + if (valueLevelSetInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "LevelSetInstance was a null pointer"); + } + levelSetInstance = mWrapper.PolymorphicFactory(valueLevelSetInstance, LevelSet.class); + return levelSetInstance; + } + + /** + * creates a resource iterator instance with all boundary shape resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public LevelSetIterator getLevelSets() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getlevelsets.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + LevelSetIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, LevelSetIterator.class); + return resourceIterator; + } + + /** + * Removes a resource from the model + * + * @param resource The resource to remove + * @throws Lib3MFException + */ + public void removeResource(Resource resource) throws Lib3MFException { + Pointer resourceHandle = null; + if (resource != null) { + resourceHandle = resource.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_model_removeresource.invokeInt(new java.lang.Object[]{mHandle, resourceHandle})); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/MultiPropertyGroup.java b/Autogenerated/Bindings/Java8/lib3mf/MultiPropertyGroup.java new file mode 100644 index 000000000..ceba02099 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/MultiPropertyGroup.java @@ -0,0 +1,193 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MultiPropertyGroup extends Resource { + + public MultiPropertyGroup(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the count of MultiProperty-s in the MultiPropertyGroup. + * + * @return returns the count of MultiProperty-s + * @throws Lib3MFException + */ + public int getCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_getcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup + * + * @return PropertyID of the MultiProperty-s in the MultiPropertyGroup. + * @throws Lib3MFException + */ + public int[] getAllPropertyIDs() throws Lib3MFException { + Pointer countNeededPropertyIDs = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededPropertyIDs, Pointer.NULL})); + long countPropertyIDs = countNeededPropertyIDs.getLong(0); + Pointer bufferPropertyIDs = new Memory(Math.max(1, 4 * countPropertyIDs)); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, countPropertyIDs, countNeededPropertyIDs, bufferPropertyIDs})); + return bufferPropertyIDs.getIntArray(0, (int)countPropertyIDs); + } + + /** + * Adds a new MultiProperty to the MultiPropertyGroup. + * + * @param propertyIDs The PropertyIDs of the new MultiProperty. + * @return returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. + * @throws Lib3MFException + */ + public int addMultiProperty(int[] propertyIDs) throws Lib3MFException { + Pointer bufferPropertyIDs = new Memory(Math.max(1, 4 * propertyIDs.length)); + for (int i = 0; i < propertyIDs.length; i++) { + bufferPropertyIDs.setInt(4 * i, propertyIDs[i]); + } + Pointer bufferPropertyID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_addmultiproperty.invokeInt(new java.lang.Object[]{mHandle, (long) propertyIDs.length, bufferPropertyIDs, bufferPropertyID})); + return bufferPropertyID.getInt(0); + } + + /** + * Sets the PropertyIDs of a MultiProperty. + * + * @param propertyID the PropertyID of the MultiProperty to be changed. + * @param propertyIDs The new PropertyIDs of the MultiProperty + * @throws Lib3MFException + */ + public void setMultiProperty(int propertyID, int[] propertyIDs) throws Lib3MFException { + Pointer bufferPropertyIDs = new Memory(Math.max(1, 4 * propertyIDs.length)); + for (int i = 0; i < propertyIDs.length; i++) { + bufferPropertyIDs.setInt(4 * i, propertyIDs[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_setmultiproperty.invokeInt(new java.lang.Object[]{mHandle, propertyID, (long) propertyIDs.length, bufferPropertyIDs})); + } + + /** + * Obtains the PropertyIDs of a MultiProperty. + * + * @param propertyID the PropertyID of the MultiProperty to be queried. + * @return The PropertyIDs of the MultiProperty + * @throws Lib3MFException + */ + public int[] getMultiProperty(int propertyID) throws Lib3MFException { + Pointer countNeededPropertyIDs = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_getmultiproperty.invokeInt(new java.lang.Object[]{mHandle, propertyID, 0L, countNeededPropertyIDs, Pointer.NULL})); + long countPropertyIDs = countNeededPropertyIDs.getLong(0); + Pointer bufferPropertyIDs = new Memory(Math.max(1, 4 * countPropertyIDs)); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_getmultiproperty.invokeInt(new java.lang.Object[]{mHandle, propertyID, countPropertyIDs, countNeededPropertyIDs, bufferPropertyIDs})); + return bufferPropertyIDs.getIntArray(0, (int)countPropertyIDs); + } + + /** + * Removes a MultiProperty from this MultiPropertyGroup. + * + * @param propertyID the PropertyID of the MultiProperty to be removed. + * @throws Lib3MFException + */ + public void removeMultiProperty(int propertyID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_removemultiproperty.invokeInt(new java.lang.Object[]{mHandle, propertyID})); + } + + /** + * Retrieves the number of layers of this MultiPropertyGroup. + * + * @return returns the number of layers + * @throws Lib3MFException + */ + public int getLayerCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_getlayercount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Adds a MultiPropertyLayer to this MultiPropertyGroup. + * + * @param theLayer The MultiPropertyLayer to add to this MultiPropertyGroup + * @return returns the index of this MultiPropertyLayer + * @throws Lib3MFException + */ + public int addLayer(MultiPropertyLayer theLayer) throws Lib3MFException { + Pointer bufferTheLayer = new Memory(MultiPropertyLayer.SIZE); + theLayer.writeToPointer(bufferTheLayer, 0); + Pointer bufferLayerIndex = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_addlayer.invokeInt(new java.lang.Object[]{mHandle, bufferTheLayer, bufferLayerIndex})); + return bufferLayerIndex.getInt(0); + } + + /** + * Obtains a MultiPropertyLayer of this MultiPropertyGroup. + * + * @param layerIndex The Index of the MultiPropertyLayer queried + * @return The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup + * @throws Lib3MFException + */ + public MultiPropertyLayer getLayer(int layerIndex) throws Lib3MFException { + Pointer bufferTheLayer = new Memory(MultiPropertyLayer.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_getlayer.invokeInt(new java.lang.Object[]{mHandle, layerIndex, bufferTheLayer})); + MultiPropertyLayer theLayer = new MultiPropertyLayer(); + theLayer.readFromPointer(bufferTheLayer, 0); + return theLayer; + } + + /** + * Removes a MultiPropertyLayer from this MultiPropertyGroup. + * + * @param layerIndex The Index of the MultiPropertyLayer to be removed + * @throws Lib3MFException + */ + public void removeLayer(int layerIndex) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_removelayer.invokeInt(new java.lang.Object[]{mHandle, layerIndex})); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/MultiPropertyGroupIterator.java b/Autogenerated/Bindings/Java8/lib3mf/MultiPropertyGroupIterator.java new file mode 100644 index 000000000..732fad0c1 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/MultiPropertyGroupIterator.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MultiPropertyGroupIterator extends ResourceIterator { + + public MultiPropertyGroupIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the MultiPropertyGroup the iterator points at. + * + * @return returns the MultiPropertyGroup instance. + * @throws Lib3MFException + */ + public MultiPropertyGroup getCurrentMultiPropertyGroup() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + MultiPropertyGroup resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, MultiPropertyGroup.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/MultiPropertyLayer.java b/Autogenerated/Bindings/Java8/lib3mf/MultiPropertyLayer.java new file mode 100644 index 000000000..fd6e38a45 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/MultiPropertyLayer.java @@ -0,0 +1,63 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class MultiPropertyLayer { + + public int ResourceID; + + public int TheBlendMethod; + + public static final int SIZE = 8; + + public void readFromPointer(Pointer p, long offset) { + ResourceID = p.getInt(offset + 0); + TheBlendMethod = p.getInt(offset + 4); + } + + public void writeToPointer(Pointer p, long offset) { + p.setInt(offset + 0, ResourceID); + p.setInt(offset + 4, TheBlendMethod); + } + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/MultiplicationNode.java b/Autogenerated/Bindings/Java8/lib3mf/MultiplicationNode.java new file mode 100644 index 000000000..2510a8c59 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/MultiplicationNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MultiplicationNode extends TwoInputNode { + + public MultiplicationNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/NodeIterator.java b/Autogenerated/Bindings/Java8/lib3mf/NodeIterator.java new file mode 100644 index 000000000..9ac51b5fe --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/NodeIterator.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class NodeIterator extends Iterator { + + public NodeIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the current element + * + * @return The current element + * @throws Lib3MFException + */ + public ImplicitNode getCurrent() throws Lib3MFException { + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_nodeiterator_getcurrent.invokeInt(new java.lang.Object[]{mHandle, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ImplicitNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ImplicitNode.class); + return node; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/NormalizeDistanceNode.java b/Autogenerated/Bindings/Java8/lib3mf/NormalizeDistanceNode.java new file mode 100644 index 000000000..336daf875 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/NormalizeDistanceNode.java @@ -0,0 +1,186 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class NormalizeDistanceNode extends ImplicitNode { + + public NormalizeDistanceNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the function id + * + * @return the input port for the function + * @throws Lib3MFException + */ + public ImplicitPort getInputFunctionID() throws Lib3MFException { + Pointer bufferFunction = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_getinputfunctionid.invokeInt(new java.lang.Object[]{mHandle, bufferFunction})); + Pointer valueFunction = bufferFunction.getPointer(0); + ImplicitPort function = null; + if (valueFunction == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Function was a null pointer"); + } + function = mWrapper.PolymorphicFactory(valueFunction, ImplicitPort.class); + return function; + } + + /** + * Retrieves the input for the position + * + * @return the input port for the position (vector) + * @throws Lib3MFException + */ + public ImplicitPort getInputPos() throws Lib3MFException { + Pointer bufferPos = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_getinputpos.invokeInt(new java.lang.Object[]{mHandle, bufferPos})); + Pointer valuePos = bufferPos.getPointer(0); + ImplicitPort pos = null; + if (valuePos == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Pos was a null pointer"); + } + pos = mWrapper.PolymorphicFactory(valuePos, ImplicitPort.class); + return pos; + } + + /** + * Retrieves the input for the finite difference step + * + * @return the input port for the finite difference step + * @throws Lib3MFException + */ + public ImplicitPort getInputStep() throws Lib3MFException { + Pointer bufferStep = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_getinputstep.invokeInt(new java.lang.Object[]{mHandle, bufferStep})); + Pointer valueStep = bufferStep.getPointer(0); + ImplicitPort step = null; + if (valueStep == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Step was a null pointer"); + } + step = mWrapper.PolymorphicFactory(valueStep, ImplicitPort.class); + return step; + } + + /** + * Sets the name of the referenced scalar output + * + * @param scalarOutputName the name of the scalar output of the referenced function + * @throws Lib3MFException + */ + public void setScalarOutputName(String scalarOutputName) throws Lib3MFException { + byte[] bytesScalarOutputName = scalarOutputName.getBytes(StandardCharsets.UTF_8); + Memory bufferScalarOutputName = new Memory(bytesScalarOutputName.length + 1); + bufferScalarOutputName.write(0, bytesScalarOutputName, 0, bytesScalarOutputName.length); + bufferScalarOutputName.setByte(bytesScalarOutputName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_setscalaroutputname.invokeInt(new java.lang.Object[]{mHandle, bufferScalarOutputName})); + } + + /** + * Retrieves the name of the referenced scalar output + * + * @return the name of the scalar output of the referenced function + * @throws Lib3MFException + */ + public String getScalarOutputName() throws Lib3MFException { + Pointer bytesNeededScalarOutputName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_getscalaroutputname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededScalarOutputName, null})); + int sizeScalarOutputName = bytesNeededScalarOutputName.getInt(0); + Pointer bufferScalarOutputName = new Memory(sizeScalarOutputName); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_getscalaroutputname.invokeInt(new java.lang.Object[]{mHandle, sizeScalarOutputName, bytesNeededScalarOutputName, bufferScalarOutputName})); + return new String(bufferScalarOutputName.getByteArray(0, sizeScalarOutputName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the name of the referenced vector input + * + * @param vectorInputName the name of the vector input (float3) of the referenced function + * @throws Lib3MFException + */ + public void setVectorInputName(String vectorInputName) throws Lib3MFException { + byte[] bytesVectorInputName = vectorInputName.getBytes(StandardCharsets.UTF_8); + Memory bufferVectorInputName = new Memory(bytesVectorInputName.length + 1); + bufferVectorInputName.write(0, bytesVectorInputName, 0, bytesVectorInputName.length); + bufferVectorInputName.setByte(bytesVectorInputName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_setvectorinputname.invokeInt(new java.lang.Object[]{mHandle, bufferVectorInputName})); + } + + /** + * Retrieves the name of the referenced vector input + * + * @return the name of the vector input (float3) of the referenced function + * @throws Lib3MFException + */ + public String getVectorInputName() throws Lib3MFException { + Pointer bytesNeededVectorInputName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_getvectorinputname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededVectorInputName, null})); + int sizeVectorInputName = bytesNeededVectorInputName.getInt(0); + Pointer bufferVectorInputName = new Memory(sizeVectorInputName); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_getvectorinputname.invokeInt(new java.lang.Object[]{mHandle, sizeVectorInputName, bytesNeededVectorInputName, bufferVectorInputName})); + return new String(bufferVectorInputName.getByteArray(0, sizeVectorInputName - 1), StandardCharsets.UTF_8); + } + + /** + * Retrieves the normalized result output + * + * @return the output port for the normalized distance + * @throws Lib3MFException + */ + public ImplicitPort getOutputResult() throws Lib3MFException { + Pointer bufferResult = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_getoutputresult.invokeInt(new java.lang.Object[]{mHandle, bufferResult})); + Pointer valueResult = bufferResult.getPointer(0); + ImplicitPort result = null; + if (valueResult == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Result was a null pointer"); + } + result = mWrapper.PolymorphicFactory(valueResult, ImplicitPort.class); + return result; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Object.java b/Autogenerated/Bindings/Java8/lib3mf/Object.java new file mode 100644 index 000000000..ca875fe42 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Object.java @@ -0,0 +1,393 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Object extends Resource { + + public Object(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves an object's type + * + * @return returns object type enum. + * @throws Lib3MFException + */ + public Lib3MFWrapper.ObjectType getType() throws Lib3MFException { + Pointer bufferObjectType = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_object_gettype.invokeInt(new java.lang.Object[]{mHandle, bufferObjectType})); + return Lib3MFWrapper.EnumConversion.convertConstToObjectType(bufferObjectType.getInt(0)); + } + + /** + * Sets an object's type + * + * @param objectType object type enum. + * @throws Lib3MFException + */ + public void setType(Lib3MFWrapper.ObjectType objectType) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_object_settype.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertObjectTypeToConst(objectType)})); + } + + /** + * Retrieves an object's name + * + * @return returns object name. + * @throws Lib3MFException + */ + public String getName() throws Lib3MFException { + Pointer bytesNeededName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_object_getname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededName, null})); + int sizeName = bytesNeededName.getInt(0); + Pointer bufferName = new Memory(sizeName); + mWrapper.checkError(this, mWrapper.lib3mf_object_getname.invokeInt(new java.lang.Object[]{mHandle, sizeName, bytesNeededName, bufferName})); + return new String(bufferName.getByteArray(0, sizeName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets an object's name string + * + * @param name new object name. + * @throws Lib3MFException + */ + public void setName(String name) throws Lib3MFException { + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_object_setname.invokeInt(new java.lang.Object[]{mHandle, bufferName})); + } + + /** + * Retrieves an object's part number + * + * @return returns object part number. + * @throws Lib3MFException + */ + public String getPartNumber() throws Lib3MFException { + Pointer bytesNeededPartNumber = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_object_getpartnumber.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededPartNumber, null})); + int sizePartNumber = bytesNeededPartNumber.getInt(0); + Pointer bufferPartNumber = new Memory(sizePartNumber); + mWrapper.checkError(this, mWrapper.lib3mf_object_getpartnumber.invokeInt(new java.lang.Object[]{mHandle, sizePartNumber, bytesNeededPartNumber, bufferPartNumber})); + return new String(bufferPartNumber.getByteArray(0, sizePartNumber - 1), StandardCharsets.UTF_8); + } + + /** + * Sets an objects partnumber string + * + * @param partNumber new object part number. + * @throws Lib3MFException + */ + public void setPartNumber(String partNumber) throws Lib3MFException { + byte[] bytesPartNumber = partNumber.getBytes(StandardCharsets.UTF_8); + Memory bufferPartNumber = new Memory(bytesPartNumber.length + 1); + bufferPartNumber.write(0, bytesPartNumber, 0, bytesPartNumber.length); + bufferPartNumber.setByte(bytesPartNumber.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_object_setpartnumber.invokeInt(new java.lang.Object[]{mHandle, bufferPartNumber})); + } + + /** + * Retrieves, if an object is a mesh object + * + * @return returns, whether the object is a mesh object + * @throws Lib3MFException + */ + public boolean isMeshObject() throws Lib3MFException { + Pointer bufferIsMeshObject = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_object_ismeshobject.invokeInt(new java.lang.Object[]{mHandle, bufferIsMeshObject})); + return bufferIsMeshObject.getByte(0) != 0; + } + + /** + * Retrieves, if an object is a components object + * + * @return returns, whether the object is a components object + * @throws Lib3MFException + */ + public boolean isComponentsObject() throws Lib3MFException { + Pointer bufferIsComponentsObject = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_object_iscomponentsobject.invokeInt(new java.lang.Object[]{mHandle, bufferIsComponentsObject})); + return bufferIsComponentsObject.getByte(0) != 0; + } + + /** + * Retrieves, if an object is a level set object + * + * @return returns, whether the object is a level set object + * @throws Lib3MFException + */ + public boolean isLevelSetObject() throws Lib3MFException { + Pointer bufferIsLevelSetObject = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_object_islevelsetobject.invokeInt(new java.lang.Object[]{mHandle, bufferIsLevelSetObject})); + return bufferIsLevelSetObject.getByte(0) != 0; + } + + /** + * Retrieves, if an object is a boolean object + * + * @return returns, whether the object is a boolean object + * @throws Lib3MFException + */ + public boolean isBooleanObject() throws Lib3MFException { + Pointer bufferIsBooleanObject = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_object_isbooleanobject.invokeInt(new java.lang.Object[]{mHandle, bufferIsBooleanObject})); + return bufferIsBooleanObject.getByte(0) != 0; + } + + /** + * Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. + * + * @return returns whether the object is a valid object description + * @throws Lib3MFException + */ + public boolean isValid() throws Lib3MFException { + Pointer bufferIsValid = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_object_isvalid.invokeInt(new java.lang.Object[]{mHandle, bufferIsValid})); + return bufferIsValid.getByte(0) != 0; + } + + /** + * Use an existing attachment as thumbnail for this object + * + * @param attachment Instance of a new or the existing thumbnailattachment object. + * @throws Lib3MFException + */ + public void setAttachmentAsThumbnail(Attachment attachment) throws Lib3MFException { + Pointer attachmentHandle = null; + if (attachment != null) { + attachmentHandle = attachment.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Attachment is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_object_setattachmentasthumbnail.invokeInt(new java.lang.Object[]{mHandle, attachmentHandle})); + } + + /** + * Get the attachment containing the object thumbnail. + * + * @return Instance of the thumbnailattachment object or NULL. + * @throws Lib3MFException + */ + public Attachment getThumbnailAttachment() throws Lib3MFException { + Pointer bufferAttachment = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_object_getthumbnailattachment.invokeInt(new java.lang.Object[]{mHandle, bufferAttachment})); + Pointer valueAttachment = bufferAttachment.getPointer(0); + Attachment attachment = null; + if (valueAttachment != Pointer.NULL) { + attachment = mWrapper.PolymorphicFactory(valueAttachment, Attachment.class); + } + return attachment; + } + + /** + * Clears the attachment. The attachment instance is not removed from the package. + * + * @throws Lib3MFException + */ + public void clearThumbnailAttachment() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_object_clearthumbnailattachment.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Returns the outbox of a build item + * + * @return Outbox of this build item + * @throws Lib3MFException + */ + public Box getOutbox() throws Lib3MFException { + Pointer bufferOutbox = new Memory(Box.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_object_getoutbox.invokeInt(new java.lang.Object[]{mHandle, bufferOutbox})); + Box outbox = new Box(); + outbox.readFromPointer(bufferOutbox, 0); + return outbox; + } + + /** + * Retrieves an object's uuid string (see production extension specification) + * + * @return GetUUID Result Tuple + * @throws Lib3MFException + */ + public GetUUIDResult getUUID() throws Lib3MFException { + Pointer bufferHasUUID = new Memory(1); + Pointer bytesNeededUUID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_object_getuuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, 0, bytesNeededUUID, null})); + int sizeUUID = bytesNeededUUID.getInt(0); + Pointer bufferUUID = new Memory(sizeUUID); + mWrapper.checkError(this, mWrapper.lib3mf_object_getuuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, sizeUUID, bytesNeededUUID, bufferUUID})); + GetUUIDResult returnTuple = new GetUUIDResult(); + returnTuple.HasUUID = bufferHasUUID.getByte(0) != 0; + returnTuple.UUID = new String(bufferUUID.getByteArray(0, sizeUUID - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetUUIDResult { + /** + * flag whether the build item has a UUID + */ + public boolean HasUUID; + + /** + * returns object uuid. + */ + public String UUID; + + } + /** + * Sets a build object's uuid string (see production extension specification) + * + * @param uUID new object uuid string. + * @throws Lib3MFException + */ + public void setUUID(String uUID) throws Lib3MFException { + byte[] bytesUUID = uUID.getBytes(StandardCharsets.UTF_8); + Memory bufferUUID = new Memory(bytesUUID.length + 1); + bufferUUID.write(0, bytesUUID, 0, bytesUUID.length); + bufferUUID.setByte(bytesUUID.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_object_setuuid.invokeInt(new java.lang.Object[]{mHandle, bufferUUID})); + } + + /** + * Returns the metadatagroup of this object + * + * @return returns an Instance of the metadatagroup of this object + * @throws Lib3MFException + */ + public MetaDataGroup getMetaDataGroup() throws Lib3MFException { + Pointer bufferMetaDataGroup = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_object_getmetadatagroup.invokeInt(new java.lang.Object[]{mHandle, bufferMetaDataGroup})); + Pointer valueMetaDataGroup = bufferMetaDataGroup.getPointer(0); + MetaDataGroup metaDataGroup = null; + if (valueMetaDataGroup == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MetaDataGroup was a null pointer"); + } + metaDataGroup = mWrapper.PolymorphicFactory(valueMetaDataGroup, MetaDataGroup.class); + return metaDataGroup; + } + + /** + * set the meshresolution of the mesh object + * + * @param meshResolution meshresolution of this object + * @throws Lib3MFException + */ + public void setSlicesMeshResolution(Lib3MFWrapper.SlicesMeshResolution meshResolution) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_object_setslicesmeshresolution.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertSlicesMeshResolutionToConst(meshResolution)})); + } + + /** + * get the meshresolution of the mesh object + * + * @return meshresolution of this object + * @throws Lib3MFException + */ + public Lib3MFWrapper.SlicesMeshResolution getSlicesMeshResolution() throws Lib3MFException { + Pointer bufferMeshResolution = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_object_getslicesmeshresolution.invokeInt(new java.lang.Object[]{mHandle, bufferMeshResolution})); + return Lib3MFWrapper.EnumConversion.convertConstToSlicesMeshResolution(bufferMeshResolution.getInt(0)); + } + + /** + * returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack + * + * @param recursive check also all referenced objects? + * @return does the object have a slice stack? + * @throws Lib3MFException + */ + public boolean hasSlices(boolean recursive) throws Lib3MFException { + Pointer bufferHasSlices = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_object_hasslices.invokeInt(new java.lang.Object[]{mHandle, recursive, bufferHasSlices})); + return bufferHasSlices.getByte(0) != 0; + } + + /** + * unlinks the attached slicestack from this object. If no slice stack is attached, do noting. + * + * @throws Lib3MFException + */ + public void clearSliceStack() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_object_clearslicestack.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * get the Slicestack attached to the object + * + * @return returns the slicestack instance + * @throws Lib3MFException + */ + public SliceStack getSliceStack() throws Lib3MFException { + Pointer bufferSliceStackInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_object_getslicestack.invokeInt(new java.lang.Object[]{mHandle, bufferSliceStackInstance})); + Pointer valueSliceStackInstance = bufferSliceStackInstance.getPointer(0); + SliceStack sliceStackInstance = null; + if (valueSliceStackInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "SliceStackInstance was a null pointer"); + } + sliceStackInstance = mWrapper.PolymorphicFactory(valueSliceStackInstance, SliceStack.class); + return sliceStackInstance; + } + + /** + * assigns a slicestack to the object + * + * @param sliceStackInstance the new slice stack of this Object + * @throws Lib3MFException + */ + public void assignSliceStack(SliceStack sliceStackInstance) throws Lib3MFException { + Pointer sliceStackInstanceHandle = null; + if (sliceStackInstance != null) { + sliceStackInstanceHandle = sliceStackInstance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "SliceStackInstance is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_object_assignslicestack.invokeInt(new java.lang.Object[]{mHandle, sliceStackInstanceHandle})); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ObjectIterator.java b/Autogenerated/Bindings/Java8/lib3mf/ObjectIterator.java new file mode 100644 index 000000000..79ee9159d --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ObjectIterator.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ObjectIterator extends ResourceIterator { + + public ObjectIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the Object the iterator points at. + * + * @return returns the Object instance. + * @throws Lib3MFException + */ + public Object getCurrentObject() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_objectiterator_getcurrentobject.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + Object resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, Object.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/OneInputNode.java b/Autogenerated/Bindings/Java8/lib3mf/OneInputNode.java new file mode 100644 index 000000000..e6697f333 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/OneInputNode.java @@ -0,0 +1,92 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class OneInputNode extends ImplicitNode { + + public OneInputNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input + * + * @return the input + * @throws Lib3MFException + */ + public ImplicitPort getInputA() throws Lib3MFException { + Pointer bufferInput = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_oneinputnode_getinputa.invokeInt(new java.lang.Object[]{mHandle, bufferInput})); + Pointer valueInput = bufferInput.getPointer(0); + ImplicitPort input = null; + if (valueInput == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Input was a null pointer"); + } + input = mWrapper.PolymorphicFactory(valueInput, ImplicitPort.class); + return input; + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputResult() throws Lib3MFException { + Pointer bufferResult = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_oneinputnode_getoutputresult.invokeInt(new java.lang.Object[]{mHandle, bufferResult})); + Pointer valueResult = bufferResult.getPointer(0); + ImplicitPort result = null; + if (valueResult == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Result was a null pointer"); + } + result = mWrapper.PolymorphicFactory(valueResult, ImplicitPort.class); + return result; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/PackagePart.java b/Autogenerated/Bindings/Java8/lib3mf/PackagePart.java new file mode 100644 index 000000000..b8fa5c2f5 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/PackagePart.java @@ -0,0 +1,85 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class PackagePart extends Base { + + public PackagePart(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the absolute path of this PackagePart. + * + * @return Returns the absolute path of this PackagePart + * @throws Lib3MFException + */ + public String getPath() throws Lib3MFException { + Pointer bytesNeededPath = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_packagepart_getpath.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededPath, null})); + int sizePath = bytesNeededPath.getInt(0); + Pointer bufferPath = new Memory(sizePath); + mWrapper.checkError(this, mWrapper.lib3mf_packagepart_getpath.invokeInt(new java.lang.Object[]{mHandle, sizePath, bytesNeededPath, bufferPath})); + return new String(bufferPath.getByteArray(0, sizePath - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the absolute path of this PackagePart. + * + * @param path Sets the absolute path of this PackagePart. + * @throws Lib3MFException + */ + public void setPath(String path) throws Lib3MFException { + byte[] bytesPath = path.getBytes(StandardCharsets.UTF_8); + Memory bufferPath = new Memory(bytesPath.length + 1); + bufferPath.write(0, bytesPath, 0, bytesPath.length); + bufferPath.setByte(bytesPath.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_packagepart_setpath.invokeInt(new java.lang.Object[]{mHandle, bufferPath})); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Position.java b/Autogenerated/Bindings/Java8/lib3mf/Position.java new file mode 100644 index 000000000..ebf1c4043 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Position.java @@ -0,0 +1,63 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Position { + + public float[] Coordinates = new float[3]; + + public static final int SIZE = 12; + + public void readFromPointer(Pointer p, long offset) { + Coordinates[0] = p.getFloat(offset + 0); + Coordinates[1] = p.getFloat(offset + 4); + Coordinates[2] = p.getFloat(offset + 8); + } + + public void writeToPointer(Pointer p, long offset) { + p.setFloat(offset + 0, Coordinates[0]); + p.setFloat(offset + 4, Coordinates[1]); + p.setFloat(offset + 8, Coordinates[2]); + } + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Position2D.java b/Autogenerated/Bindings/Java8/lib3mf/Position2D.java new file mode 100644 index 000000000..58d86aa67 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Position2D.java @@ -0,0 +1,61 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Position2D { + + public float[] Coordinates = new float[2]; + + public static final int SIZE = 8; + + public void readFromPointer(Pointer p, long offset) { + Coordinates[0] = p.getFloat(offset + 0); + Coordinates[1] = p.getFloat(offset + 4); + } + + public void writeToPointer(Pointer p, long offset) { + p.setFloat(offset + 0, Coordinates[0]); + p.setFloat(offset + 4, Coordinates[1]); + } + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/PowNode.java b/Autogenerated/Bindings/Java8/lib3mf/PowNode.java new file mode 100644 index 000000000..6a1165999 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/PowNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class PowNode extends TwoInputNode { + + public PowNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Reader.java b/Autogenerated/Bindings/Java8/lib3mf/Reader.java new file mode 100644 index 000000000..54bd22870 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Reader.java @@ -0,0 +1,229 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Reader extends Base { + + public Reader(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Reads a model from a file. The file type is specified by the Model Reader class + * + * @param filename Filename to read from + * @throws Lib3MFException + */ + public void readFromFile(String filename) throws Lib3MFException { + byte[] bytesFilename = filename.getBytes(StandardCharsets.UTF_8); + Memory bufferFilename = new Memory(bytesFilename.length + 1); + bufferFilename.write(0, bytesFilename, 0, bytesFilename.length); + bufferFilename.setByte(bytesFilename.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_reader_readfromfile.invokeInt(new java.lang.Object[]{mHandle, bufferFilename})); + } + + /** + * Reads a model from a memory buffer. + * + * @param buffer Buffer to read from + * @throws Lib3MFException + */ + public void readFromBuffer(byte[] buffer) throws Lib3MFException { + Pointer bufferBuffer = new Memory(Math.max(1, 1 * buffer.length)); + for (int i = 0; i < buffer.length; i++) { + bufferBuffer.setByte(1 * i, buffer[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_reader_readfrombuffer.invokeInt(new java.lang.Object[]{mHandle, (long) buffer.length, bufferBuffer})); + } + + /** + * Reads a model and from the data provided by a callback function + * + * @param theReadCallback Callback to call for reading a data chunk + * @param streamSize number of bytes the callback returns + * @param theSeekCallback Callback to call for seeking in the stream. + * @param userData Userdata that is passed to the callback function + * @throws Lib3MFException + */ + public void readFromCallback(Lib3MFWrapper.ReadCallback theReadCallback, long streamSize, Lib3MFWrapper.SeekCallback theSeekCallback, Pointer userData) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_reader_readfromcallback.invokeInt(new java.lang.Object[]{mHandle, theReadCallback, streamSize, theSeekCallback, userData})); + } + + /** + * Set the progress callback for calls to this writer + * + * @param progressCallback pointer to the callback function. + * @param userData pointer to arbitrary user data that is passed without modification to the callback. + * @throws Lib3MFException + */ + public void setProgressCallback(Lib3MFWrapper.ProgressCallback progressCallback, Pointer userData) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_reader_setprogresscallback.invokeInt(new java.lang.Object[]{mHandle, progressCallback, userData})); + } + + /** + * Adds a relationship type which shall be read as attachment in memory while loading + * + * @param relationShipType String of the relationship type + * @throws Lib3MFException + */ + public void addRelationToRead(String relationShipType) throws Lib3MFException { + byte[] bytesRelationShipType = relationShipType.getBytes(StandardCharsets.UTF_8); + Memory bufferRelationShipType = new Memory(bytesRelationShipType.length + 1); + bufferRelationShipType.write(0, bytesRelationShipType, 0, bytesRelationShipType.length); + bufferRelationShipType.setByte(bytesRelationShipType.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_reader_addrelationtoread.invokeInt(new java.lang.Object[]{mHandle, bufferRelationShipType})); + } + + /** + * Removes a relationship type which shall be read as attachment in memory while loading + * + * @param relationShipType String of the relationship type + * @throws Lib3MFException + */ + public void removeRelationToRead(String relationShipType) throws Lib3MFException { + byte[] bytesRelationShipType = relationShipType.getBytes(StandardCharsets.UTF_8); + Memory bufferRelationShipType = new Memory(bytesRelationShipType.length + 1); + bufferRelationShipType.write(0, bytesRelationShipType, 0, bytesRelationShipType.length); + bufferRelationShipType.setByte(bytesRelationShipType.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_reader_removerelationtoread.invokeInt(new java.lang.Object[]{mHandle, bufferRelationShipType})); + } + + /** + * Activates (deactivates) the strict mode of the reader. + * + * @param strictModeActive flag whether strict mode is active or not. + * @throws Lib3MFException + */ + public void setStrictModeActive(boolean strictModeActive) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_reader_setstrictmodeactive.invokeInt(new java.lang.Object[]{mHandle, strictModeActive})); + } + + /** + * Queries whether the strict mode of the reader is active or not + * + * @return returns flag whether strict mode is active or not. + * @throws Lib3MFException + */ + public boolean getStrictModeActive() throws Lib3MFException { + Pointer bufferStrictModeActive = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_reader_getstrictmodeactive.invokeInt(new java.lang.Object[]{mHandle, bufferStrictModeActive})); + return bufferStrictModeActive.getByte(0) != 0; + } + + /** + * Returns Warning and Error Information of the read process + * + * @param index Index of the Warning. Valid values are 0 to WarningCount - 1 + * @return GetWarning Result Tuple + * @throws Lib3MFException + */ + public GetWarningResult getWarning(int index) throws Lib3MFException { + Pointer bufferErrorCode = new Memory(4); + Pointer bytesNeededWarning = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_reader_getwarning.invokeInt(new java.lang.Object[]{mHandle, index, bufferErrorCode, 0, bytesNeededWarning, null})); + int sizeWarning = bytesNeededWarning.getInt(0); + Pointer bufferWarning = new Memory(sizeWarning); + mWrapper.checkError(this, mWrapper.lib3mf_reader_getwarning.invokeInt(new java.lang.Object[]{mHandle, index, bufferErrorCode, sizeWarning, bytesNeededWarning, bufferWarning})); + GetWarningResult returnTuple = new GetWarningResult(); + returnTuple.ErrorCode = bufferErrorCode.getInt(0); + returnTuple.Warning = new String(bufferWarning.getByteArray(0, sizeWarning - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetWarningResult { + /** + * filled with the error code of the warning + */ + public int ErrorCode; + + /** + * the message of the warning + */ + public String Warning; + + } + /** + * Returns Warning and Error Count of the read process + * + * @return filled with the count of the occurred warnings. + * @throws Lib3MFException + */ + public int getWarningCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_reader_getwarningcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Registers a callback to deal with key wrapping mechanism from keystore + * + * @param consumerID The ConsumerID to register for + * @param theCallback The callback used to decrypt data key + * @param userData Userdata that is passed to the callback function + * @throws Lib3MFException + */ + public void addKeyWrappingCallback(String consumerID, Lib3MFWrapper.KeyWrappingCallback theCallback, Pointer userData) throws Lib3MFException { + byte[] bytesConsumerID = consumerID.getBytes(StandardCharsets.UTF_8); + Memory bufferConsumerID = new Memory(bytesConsumerID.length + 1); + bufferConsumerID.write(0, bytesConsumerID, 0, bytesConsumerID.length); + bufferConsumerID.setByte(bytesConsumerID.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_reader_addkeywrappingcallback.invokeInt(new java.lang.Object[]{mHandle, bufferConsumerID, theCallback, userData})); + } + + /** + * Registers a callback to deal with encryption of content + * + * @param theCallback The callback used to encrypt content + * @param userData Userdata that is passed to the callback function + * @throws Lib3MFException + */ + public void setContentEncryptionCallback(Lib3MFWrapper.ContentEncryptionCallback theCallback, Pointer userData) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_reader_setcontentencryptioncallback.invokeInt(new java.lang.Object[]{mHandle, theCallback, userData})); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Resource.java b/Autogenerated/Bindings/Java8/lib3mf/Resource.java new file mode 100644 index 000000000..1bcffe183 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Resource.java @@ -0,0 +1,126 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Resource extends Base { + + public Resource(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the unique id of this resource within a package. This function will be removed in a later release in favor of GetUniqueResourceID + * + * @return Retrieves the unique id of this resource within a package. + * @throws Lib3MFException + */ + public int getResourceID() throws Lib3MFException { + Pointer bufferUniqueResourceID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_resource_getresourceid.invokeInt(new java.lang.Object[]{mHandle, bufferUniqueResourceID})); + return bufferUniqueResourceID.getInt(0); + } + + /** + * Retrieves the unique id of this resource within a package. + * + * @return Retrieves the unique id of this resource within a package. + * @throws Lib3MFException + */ + public int getUniqueResourceID() throws Lib3MFException { + Pointer bufferUniqueResourceID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_resource_getuniqueresourceid.invokeInt(new java.lang.Object[]{mHandle, bufferUniqueResourceID})); + return bufferUniqueResourceID.getInt(0); + } + + /** + * Returns the PackagePart within which this resource resides + * + * @return the PackagePart within which this resource resides. + * @throws Lib3MFException + */ + public PackagePart packagePart() throws Lib3MFException { + Pointer bufferPackagePart = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resource_packagepart.invokeInt(new java.lang.Object[]{mHandle, bufferPackagePart})); + Pointer valuePackagePart = bufferPackagePart.getPointer(0); + PackagePart packagePart = null; + if (valuePackagePart == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "PackagePart was a null pointer"); + } + packagePart = mWrapper.PolymorphicFactory(valuePackagePart, PackagePart.class); + return packagePart; + } + + /** + * Sets the new PackagePart within which this resource resides + * + * @param packagePart the new PackagePart within which this resource resides. + * @throws Lib3MFException + */ + public void setPackagePart(PackagePart packagePart) throws Lib3MFException { + Pointer packagePartHandle = null; + if (packagePart != null) { + packagePartHandle = packagePart.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "PackagePart is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_resource_setpackagepart.invokeInt(new java.lang.Object[]{mHandle, packagePartHandle})); + } + + /** + * Retrieves the id of this resource within a model. + * + * @return Retrieves the id of this resource within a model. + * @throws Lib3MFException + */ + public int getModelResourceID() throws Lib3MFException { + Pointer bufferModelResourceId = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_resource_getmodelresourceid.invokeInt(new java.lang.Object[]{mHandle, bufferModelResourceId})); + return bufferModelResourceId.getInt(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ResourceData.java b/Autogenerated/Bindings/Java8/lib3mf/ResourceData.java new file mode 100644 index 000000000..ab80b4c51 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ResourceData.java @@ -0,0 +1,113 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ResourceData extends Base { + + public ResourceData(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Gets the encrypted part path + * + * @return The part path + * @throws Lib3MFException + */ + public PackagePart getPath() throws Lib3MFException { + Pointer bufferPath = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedata_getpath.invokeInt(new java.lang.Object[]{mHandle, bufferPath})); + Pointer valuePath = bufferPath.getPointer(0); + PackagePart path = null; + if (valuePath == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Path was a null pointer"); + } + path = mWrapper.PolymorphicFactory(valuePath, PackagePart.class); + return path; + } + + /** + * Gets the encryption algorithm used to encrypt this ResourceData + * + * @return The encryption algorithm + * @throws Lib3MFException + */ + public Lib3MFWrapper.EncryptionAlgorithm getEncryptionAlgorithm() throws Lib3MFException { + Pointer bufferEncryptionAlgorithm = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedata_getencryptionalgorithm.invokeInt(new java.lang.Object[]{mHandle, bufferEncryptionAlgorithm})); + return Lib3MFWrapper.EnumConversion.convertConstToEncryptionAlgorithm(bufferEncryptionAlgorithm.getInt(0)); + } + + /** + * Tells whether this ResourceData is compressed or not + * + * @return The compression method + * @throws Lib3MFException + */ + public Lib3MFWrapper.Compression getCompression() throws Lib3MFException { + Pointer bufferCompression = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedata_getcompression.invokeInt(new java.lang.Object[]{mHandle, bufferCompression})); + return Lib3MFWrapper.EnumConversion.convertConstToCompression(bufferCompression.getInt(0)); + } + + /** + * Tells whether this ResourceData is compressed or not + * + * @return The compression method + * @throws Lib3MFException + */ + public byte[] getAdditionalAuthenticationData() throws Lib3MFException { + Pointer countNeededByteData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedata_getadditionalauthenticationdata.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededByteData, Pointer.NULL})); + long countByteData = countNeededByteData.getLong(0); + Pointer bufferByteData = new Memory(Math.max(1, 1 * countByteData)); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedata_getadditionalauthenticationdata.invokeInt(new java.lang.Object[]{mHandle, countByteData, countNeededByteData, bufferByteData})); + return bufferByteData.getByteArray(0, (int)countByteData); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ResourceDataGroup.java b/Autogenerated/Bindings/Java8/lib3mf/ResourceDataGroup.java new file mode 100644 index 000000000..2b70707d4 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ResourceDataGroup.java @@ -0,0 +1,139 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ResourceDataGroup extends Base { + + public ResourceDataGroup(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Sets the resourcedatagroup keyuuid + * + * @return The new resourcedatagroup keyuuid. + * @throws Lib3MFException + */ + public String getKeyUUID() throws Lib3MFException { + Pointer bytesNeededUUID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedatagroup_getkeyuuid.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededUUID, null})); + int sizeUUID = bytesNeededUUID.getInt(0); + Pointer bufferUUID = new Memory(sizeUUID); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedatagroup_getkeyuuid.invokeInt(new java.lang.Object[]{mHandle, sizeUUID, bytesNeededUUID, bufferUUID})); + return new String(bufferUUID.getByteArray(0, sizeUUID - 1), StandardCharsets.UTF_8); + } + + /** + * Add accessright to resourcedatagroup element + * + * @param consumer The Consumer reference + * @param wrappingAlgorithm The key wrapping algorithm to be used + * @param mgfAlgorithm The mask generation function to be used + * @param digestMethod The digest mechanism to be used + * @return The acess right instance + * @throws Lib3MFException + */ + public AccessRight addAccessRight(Consumer consumer, Lib3MFWrapper.WrappingAlgorithm wrappingAlgorithm, Lib3MFWrapper.MgfAlgorithm mgfAlgorithm, Lib3MFWrapper.DigestMethod digestMethod) throws Lib3MFException { + Pointer consumerHandle = null; + if (consumer != null) { + consumerHandle = consumer.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Consumer is a null value."); + } + Pointer bufferTheAccessRight = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedatagroup_addaccessright.invokeInt(new java.lang.Object[]{mHandle, consumerHandle, Lib3MFWrapper.EnumConversion.convertWrappingAlgorithmToConst(wrappingAlgorithm), Lib3MFWrapper.EnumConversion.convertMgfAlgorithmToConst(mgfAlgorithm), Lib3MFWrapper.EnumConversion.convertDigestMethodToConst(digestMethod), bufferTheAccessRight})); + Pointer valueTheAccessRight = bufferTheAccessRight.getPointer(0); + AccessRight theAccessRight = null; + if (valueTheAccessRight == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheAccessRight was a null pointer"); + } + theAccessRight = mWrapper.PolymorphicFactory(valueTheAccessRight, AccessRight.class); + return theAccessRight; + } + + /** + * Finds the AccessRight associated with a Consumer + * + * @param consumer The Consumer instance + * @return The AcessRight instance + * @throws Lib3MFException + */ + public AccessRight findAccessRightByConsumer(Consumer consumer) throws Lib3MFException { + Pointer consumerHandle = null; + if (consumer != null) { + consumerHandle = consumer.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Consumer is a null value."); + } + Pointer bufferTheAccessRight = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedatagroup_findaccessrightbyconsumer.invokeInt(new java.lang.Object[]{mHandle, consumerHandle, bufferTheAccessRight})); + Pointer valueTheAccessRight = bufferTheAccessRight.getPointer(0); + AccessRight theAccessRight = null; + if (valueTheAccessRight != Pointer.NULL) { + theAccessRight = mWrapper.PolymorphicFactory(valueTheAccessRight, AccessRight.class); + } + return theAccessRight; + } + + /** + * Removes access from a Consumer on this resource data group + * + * @param consumer The Consumer instance + * @throws Lib3MFException + */ + public void removeAccessRight(Consumer consumer) throws Lib3MFException { + Pointer consumerHandle = null; + if (consumer != null) { + consumerHandle = consumer.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Consumer is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_resourcedatagroup_removeaccessright.invokeInt(new java.lang.Object[]{mHandle, consumerHandle})); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ResourceIdNode.java b/Autogenerated/Bindings/Java8/lib3mf/ResourceIdNode.java new file mode 100644 index 000000000..810447b69 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ResourceIdNode.java @@ -0,0 +1,108 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ResourceIdNode extends ImplicitNode { + + public ResourceIdNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Sets the Resource that the resourceid attribute of the node will point to + * + * @param resource the resource + * @throws Lib3MFException + */ + public void setResource(Resource resource) throws Lib3MFException { + Pointer resourceHandle = null; + if (resource != null) { + resourceHandle = resource.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_resourceidnode_setresource.invokeInt(new java.lang.Object[]{mHandle, resourceHandle})); + } + + /** + * Retrieves the resource of the node + * + * @return the resource + * @throws Lib3MFException + */ + public Resource getResource() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourceidnode_getresource.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + Resource resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, Resource.class); + return resource; + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputValue() throws Lib3MFException { + Pointer bufferValue = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourceidnode_getoutputvalue.invokeInt(new java.lang.Object[]{mHandle, bufferValue})); + Pointer valueValue = bufferValue.getPointer(0); + ImplicitPort value = null; + if (valueValue == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Value was a null pointer"); + } + value = mWrapper.PolymorphicFactory(valueValue, ImplicitPort.class); + return value; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/ResourceIterator.java b/Autogenerated/Bindings/Java8/lib3mf/ResourceIterator.java new file mode 100644 index 000000000..5330c6ed7 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/ResourceIterator.java @@ -0,0 +1,128 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ResourceIterator extends Base { + + public ResourceIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Iterates to the next resource in the list. + * + * @return Iterates to the next resource in the list. + * @throws Lib3MFException + */ + public boolean moveNext() throws Lib3MFException { + Pointer bufferHasNext = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_resourceiterator_movenext.invokeInt(new java.lang.Object[]{mHandle, bufferHasNext})); + return bufferHasNext.getByte(0) != 0; + } + + /** + * Iterates to the previous resource in the list. + * + * @return Iterates to the previous resource in the list. + * @throws Lib3MFException + */ + public boolean movePrevious() throws Lib3MFException { + Pointer bufferHasPrevious = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_resourceiterator_moveprevious.invokeInt(new java.lang.Object[]{mHandle, bufferHasPrevious})); + return bufferHasPrevious.getByte(0) != 0; + } + + /** + * Returns the resource the iterator points at. + * + * @return returns the resource instance. + * @throws Lib3MFException + */ + public Resource getCurrent() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourceiterator_getcurrent.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + Resource resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, Resource.class); + return resource; + } + + /** + * Creates a new resource iterator with the same resource list. + * + * @return returns the cloned Iterator instance + * @throws Lib3MFException + */ + public ResourceIterator clone_() throws Lib3MFException { + Pointer bufferOutResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourceiterator_clone.invokeInt(new java.lang.Object[]{mHandle, bufferOutResourceIterator})); + Pointer valueOutResourceIterator = bufferOutResourceIterator.getPointer(0); + ResourceIterator outResourceIterator = null; + if (valueOutResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "OutResourceIterator was a null pointer"); + } + outResourceIterator = mWrapper.PolymorphicFactory(valueOutResourceIterator, ResourceIterator.class); + return outResourceIterator; + } + + /** + * Returns the number of resoucres the iterator captures. + * + * @return returns the number of resoucres the iterator captures. + * @throws Lib3MFException + */ + public long count() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourceiterator_count.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/RoundNode.java b/Autogenerated/Bindings/Java8/lib3mf/RoundNode.java new file mode 100644 index 000000000..c0ec1ffad --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/RoundNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class RoundNode extends OneInputNode { + + public RoundNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/SelectNode.java b/Autogenerated/Bindings/Java8/lib3mf/SelectNode.java new file mode 100644 index 000000000..1917b9620 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/SelectNode.java @@ -0,0 +1,110 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class SelectNode extends OneInputNode { + + public SelectNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the second input + * + * @return the second input + * @throws Lib3MFException + */ + public ImplicitPort getInputB() throws Lib3MFException { + Pointer bufferB = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_selectnode_getinputb.invokeInt(new java.lang.Object[]{mHandle, bufferB})); + Pointer valueB = bufferB.getPointer(0); + ImplicitPort b = null; + if (valueB == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "B was a null pointer"); + } + b = mWrapper.PolymorphicFactory(valueB, ImplicitPort.class); + return b; + } + + /** + * Retrieves the third input + * + * @return the third input + * @throws Lib3MFException + */ + public ImplicitPort getInputC() throws Lib3MFException { + Pointer bufferC = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_selectnode_getinputc.invokeInt(new java.lang.Object[]{mHandle, bufferC})); + Pointer valueC = bufferC.getPointer(0); + ImplicitPort c = null; + if (valueC == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "C was a null pointer"); + } + c = mWrapper.PolymorphicFactory(valueC, ImplicitPort.class); + return c; + } + + /** + * Retrieves the fourth input + * + * @return the fourth input + * @throws Lib3MFException + */ + public ImplicitPort getInputD() throws Lib3MFException { + Pointer bufferD = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_selectnode_getinputd.invokeInt(new java.lang.Object[]{mHandle, bufferD})); + Pointer valueD = bufferD.getPointer(0); + ImplicitPort d = null; + if (valueD == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "D was a null pointer"); + } + d = mWrapper.PolymorphicFactory(valueD, ImplicitPort.class); + return d; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/SignNode.java b/Autogenerated/Bindings/Java8/lib3mf/SignNode.java new file mode 100644 index 000000000..58c0d3e8f --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/SignNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class SignNode extends OneInputNode { + + public SignNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/SinNode.java b/Autogenerated/Bindings/Java8/lib3mf/SinNode.java new file mode 100644 index 000000000..0c165eeb7 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/SinNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class SinNode extends OneInputNode { + + public SinNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/SinhNode.java b/Autogenerated/Bindings/Java8/lib3mf/SinhNode.java new file mode 100644 index 000000000..3acbcc163 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/SinhNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class SinhNode extends OneInputNode { + + public SinhNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Slice.java b/Autogenerated/Bindings/Java8/lib3mf/Slice.java new file mode 100644 index 000000000..f82b09c53 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Slice.java @@ -0,0 +1,187 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Slice extends Base { + + public Slice(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Set all vertices of a slice. All polygons will be cleared. + * + * @param vertices contains the positions. + * @throws Lib3MFException + */ + public void setVertices(Position2D[] vertices) throws Lib3MFException { + Pointer bufferVertices = new Memory(Math.max(1, Position2D.SIZE * vertices.length)); + for (int i = 0; i < vertices.length; i++) { + vertices[i].writeToPointer(bufferVertices, i * Position2D.SIZE); + } + mWrapper.checkError(this, mWrapper.lib3mf_slice_setvertices.invokeInt(new java.lang.Object[]{mHandle, (long) vertices.length, bufferVertices})); + } + + /** + * Get all vertices of a slice + * + * @return contains the positions. + * @throws Lib3MFException + */ + public Position2D[] getVertices() throws Lib3MFException { + Pointer countNeededVertices = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slice_getvertices.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededVertices, null})); + long countVertices = countNeededVertices.getLong(0); + Pointer bufferVertices = new Memory(Math.max(1, countVertices * Position2D.SIZE)); + mWrapper.checkError(this, mWrapper.lib3mf_slice_getvertices.invokeInt(new java.lang.Object[]{mHandle, countVertices, countNeededVertices, bufferVertices})); + Position2D vertices[] = new Position2D[(int)countVertices]; + for (int i = 0; i < (int)countVertices; i++) { + vertices[i] = new Position2D(); + vertices[i].readFromPointer(bufferVertices, i * Position2D.SIZE); + } + return vertices; + } + + /** + * Get the number of vertices in a slice + * + * @return the number of vertices in the slice + * @throws Lib3MFException + */ + public long getVertexCount() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slice_getvertexcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + /** + * Add a new polygon to this slice + * + * @param indices the new indices of the new polygon + * @return the index of the new polygon + * @throws Lib3MFException + */ + public long addPolygon(int[] indices) throws Lib3MFException { + Pointer bufferIndices = new Memory(Math.max(1, 4 * indices.length)); + for (int i = 0; i < indices.length; i++) { + bufferIndices.setInt(4 * i, indices[i]); + } + Pointer bufferIndex = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slice_addpolygon.invokeInt(new java.lang.Object[]{mHandle, (long) indices.length, bufferIndices, bufferIndex})); + return bufferIndex.getLong(0); + } + + /** + * Get the number of polygons in the slice + * + * @return the number of polygons in the slice + * @throws Lib3MFException + */ + public long getPolygonCount() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slice_getpolygoncount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + /** + * Set all indices of a polygon + * + * @param index the index of the polygon to manipulate + * @param indices the new indices of the index-th polygon + * @throws Lib3MFException + */ + public void setPolygonIndices(long index, int[] indices) throws Lib3MFException { + Pointer bufferIndices = new Memory(Math.max(1, 4 * indices.length)); + for (int i = 0; i < indices.length; i++) { + bufferIndices.setInt(4 * i, indices[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_slice_setpolygonindices.invokeInt(new java.lang.Object[]{mHandle, index, (long) indices.length, bufferIndices})); + } + + /** + * Get all vertices of a slice + * + * @param index the index of the polygon to manipulate + * @return the indices of the index-th polygon + * @throws Lib3MFException + */ + public int[] getPolygonIndices(long index) throws Lib3MFException { + Pointer countNeededIndices = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slice_getpolygonindices.invokeInt(new java.lang.Object[]{mHandle, index, 0L, countNeededIndices, Pointer.NULL})); + long countIndices = countNeededIndices.getLong(0); + Pointer bufferIndices = new Memory(Math.max(1, 4 * countIndices)); + mWrapper.checkError(this, mWrapper.lib3mf_slice_getpolygonindices.invokeInt(new java.lang.Object[]{mHandle, index, countIndices, countNeededIndices, bufferIndices})); + return bufferIndices.getIntArray(0, (int)countIndices); + } + + /** + * Get the number of vertices in a slice + * + * @param index the index of the polygon to manipulate + * @return the number of indices of the index-th polygon + * @throws Lib3MFException + */ + public long getPolygonIndexCount(long index) throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slice_getpolygonindexcount.invokeInt(new java.lang.Object[]{mHandle, index, bufferCount})); + return bufferCount.getLong(0); + } + + /** + * Get the upper Z-Coordinate of this slice. + * + * @return the upper Z-Coordinate of this slice + * @throws Lib3MFException + */ + public double getZTop() throws Lib3MFException { + Pointer bufferZTop = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slice_getztop.invokeInt(new java.lang.Object[]{mHandle, bufferZTop})); + return bufferZTop.getDouble(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/SliceStack.java b/Autogenerated/Bindings/Java8/lib3mf/SliceStack.java new file mode 100644 index 000000000..ee8728bd8 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/SliceStack.java @@ -0,0 +1,203 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class SliceStack extends Resource { + + public SliceStack(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Get the lower Z-Coordinate of the slice stack. + * + * @return the lower Z-Coordinate the slice stack + * @throws Lib3MFException + */ + public double getBottomZ() throws Lib3MFException { + Pointer bufferZBottom = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_getbottomz.invokeInt(new java.lang.Object[]{mHandle, bufferZBottom})); + return bufferZBottom.getDouble(0); + } + + /** + * Returns the number of slices + * + * @return the number of slices + * @throws Lib3MFException + */ + public long getSliceCount() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_getslicecount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + /** + * Query a slice from the slice stack + * + * @param sliceIndex the index of the slice + * @return the Slice instance + * @throws Lib3MFException + */ + public Slice getSlice(long sliceIndex) throws Lib3MFException { + Pointer bufferTheSlice = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_getslice.invokeInt(new java.lang.Object[]{mHandle, sliceIndex, bufferTheSlice})); + Pointer valueTheSlice = bufferTheSlice.getPointer(0); + Slice theSlice = null; + if (valueTheSlice == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheSlice was a null pointer"); + } + theSlice = mWrapper.PolymorphicFactory(valueTheSlice, Slice.class); + return theSlice; + } + + /** + * Returns the number of slices + * + * @param zTop upper Z coordinate of the slice + * @return a new Slice instance + * @throws Lib3MFException + */ + public Slice addSlice(double zTop) throws Lib3MFException { + Pointer bufferTheSlice = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_addslice.invokeInt(new java.lang.Object[]{mHandle, zTop, bufferTheSlice})); + Pointer valueTheSlice = bufferTheSlice.getPointer(0); + Slice theSlice = null; + if (valueTheSlice == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheSlice was a null pointer"); + } + theSlice = mWrapper.PolymorphicFactory(valueTheSlice, Slice.class); + return theSlice; + } + + /** + * Returns the number of slice refs + * + * @return the number of slicereferences + * @throws Lib3MFException + */ + public long getSliceRefCount() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_getslicerefcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + /** + * Adds another existing slicestack as sliceref in this slicestack + * + * @param theSliceStack the slicestack to use as sliceref + * @throws Lib3MFException + */ + public void addSliceStackReference(SliceStack theSliceStack) throws Lib3MFException { + Pointer theSliceStackHandle = null; + if (theSliceStack != null) { + theSliceStackHandle = theSliceStack.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheSliceStack is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_addslicestackreference.invokeInt(new java.lang.Object[]{mHandle, theSliceStackHandle})); + } + + /** + * Adds another existing slicestack as sliceref in this slicestack + * + * @param sliceRefIndex the index of the slice ref + * @return the slicestack that is used as sliceref + * @throws Lib3MFException + */ + public SliceStack getSliceStackReference(long sliceRefIndex) throws Lib3MFException { + Pointer bufferTheSliceStack = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_getslicestackreference.invokeInt(new java.lang.Object[]{mHandle, sliceRefIndex, bufferTheSliceStack})); + Pointer valueTheSliceStack = bufferTheSliceStack.getPointer(0); + SliceStack theSliceStack = null; + if (valueTheSliceStack == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheSliceStack was a null pointer"); + } + theSliceStack = mWrapper.PolymorphicFactory(valueTheSliceStack, SliceStack.class); + return theSliceStack; + } + + /** + * Removes the indirection of slices via slice-refs, i.e. creates the slices of all slice refs of this SliceStack as actual slices of this SliceStack. All previously existing slices or slicerefs will be removed. + * + * @throws Lib3MFException + */ + public void collapseSliceReferences() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_collapseslicereferences.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Sets the package path where this Slice should be stored. Input an empty string to reset the path + * + * @param path the package path where this Slice should be stored + * @throws Lib3MFException + */ + public void setOwnPath(String path) throws Lib3MFException { + byte[] bytesPath = path.getBytes(StandardCharsets.UTF_8); + Memory bufferPath = new Memory(bytesPath.length + 1); + bufferPath.write(0, bytesPath, 0, bytesPath.length); + bufferPath.setByte(bytesPath.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_setownpath.invokeInt(new java.lang.Object[]{mHandle, bufferPath})); + } + + /** + * Obtains the package path where this Slice should be stored. Returns an empty string if the slicestack is stored within the root model. + * + * @return the package path where this Slice will be stored + * @throws Lib3MFException + */ + public String getOwnPath() throws Lib3MFException { + Pointer bytesNeededPath = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_getownpath.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededPath, null})); + int sizePath = bytesNeededPath.getInt(0); + Pointer bufferPath = new Memory(sizePath); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_getownpath.invokeInt(new java.lang.Object[]{mHandle, sizePath, bytesNeededPath, bufferPath})); + return new String(bufferPath.getByteArray(0, sizePath - 1), StandardCharsets.UTF_8); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/SliceStackIterator.java b/Autogenerated/Bindings/Java8/lib3mf/SliceStackIterator.java new file mode 100644 index 000000000..14303f6bc --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/SliceStackIterator.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class SliceStackIterator extends ResourceIterator { + + public SliceStackIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the SliceStack the iterator points at. + * + * @return returns the SliceStack instance. + * @throws Lib3MFException + */ + public SliceStack getCurrentSliceStack() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slicestackiterator_getcurrentslicestack.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + SliceStack resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, SliceStack.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/SqrtNode.java b/Autogenerated/Bindings/Java8/lib3mf/SqrtNode.java new file mode 100644 index 000000000..5db4eb965 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/SqrtNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class SqrtNode extends OneInputNode { + + public SqrtNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/SubtractionNode.java b/Autogenerated/Bindings/Java8/lib3mf/SubtractionNode.java new file mode 100644 index 000000000..b8dfd1b4f --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/SubtractionNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class SubtractionNode extends TwoInputNode { + + public SubtractionNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/TanNode.java b/Autogenerated/Bindings/Java8/lib3mf/TanNode.java new file mode 100644 index 000000000..3886d14b8 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/TanNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class TanNode extends OneInputNode { + + public TanNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/TanhNode.java b/Autogenerated/Bindings/Java8/lib3mf/TanhNode.java new file mode 100644 index 000000000..ca04c88d2 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/TanhNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class TanhNode extends OneInputNode { + + public TanhNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Tex2Coord.java b/Autogenerated/Bindings/Java8/lib3mf/Tex2Coord.java new file mode 100644 index 000000000..6fafa91a2 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Tex2Coord.java @@ -0,0 +1,63 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Tex2Coord { + + public double U; + + public double V; + + public static final int SIZE = 16; + + public void readFromPointer(Pointer p, long offset) { + U = p.getDouble(offset + 0); + V = p.getDouble(offset + 8); + } + + public void writeToPointer(Pointer p, long offset) { + p.setDouble(offset + 0, U); + p.setDouble(offset + 8, V); + } + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Texture2D.java b/Autogenerated/Bindings/Java8/lib3mf/Texture2D.java new file mode 100644 index 000000000..b008d23b1 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Texture2D.java @@ -0,0 +1,173 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Texture2D extends Resource { + + public Texture2D(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the attachment located at the path of the texture. + * + * @return attachment that holds the texture's image information. + * @throws Lib3MFException + */ + public Attachment getAttachment() throws Lib3MFException { + Pointer bufferAttachment = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_texture2d_getattachment.invokeInt(new java.lang.Object[]{mHandle, bufferAttachment})); + Pointer valueAttachment = bufferAttachment.getPointer(0); + Attachment attachment = null; + if (valueAttachment == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Attachment was a null pointer"); + } + attachment = mWrapper.PolymorphicFactory(valueAttachment, Attachment.class); + return attachment; + } + + /** + * Sets the texture's package path to the path of the attachment. + * + * @param attachment attachment that holds the texture's image information. + * @throws Lib3MFException + */ + public void setAttachment(Attachment attachment) throws Lib3MFException { + Pointer attachmentHandle = null; + if (attachment != null) { + attachmentHandle = attachment.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Attachment is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_texture2d_setattachment.invokeInt(new java.lang.Object[]{mHandle, attachmentHandle})); + } + + /** + * Retrieves a texture's content type. + * + * @return returns content type enum. + * @throws Lib3MFException + */ + public Lib3MFWrapper.TextureType getContentType() throws Lib3MFException { + Pointer bufferContentType = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_texture2d_getcontenttype.invokeInt(new java.lang.Object[]{mHandle, bufferContentType})); + return Lib3MFWrapper.EnumConversion.convertConstToTextureType(bufferContentType.getInt(0)); + } + + /** + * Retrieves a texture's content type. + * + * @param contentType new Content Type + * @throws Lib3MFException + */ + public void setContentType(Lib3MFWrapper.TextureType contentType) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_texture2d_setcontenttype.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertTextureTypeToConst(contentType)})); + } + + /** + * Retrieves a texture's tilestyle type. + * + * @return GetTileStyleUV Result Tuple + * @throws Lib3MFException + */ + public GetTileStyleUVResult getTileStyleUV() throws Lib3MFException { + Pointer bufferTileStyleU = new Memory(4); + Pointer bufferTileStyleV = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_texture2d_gettilestyleuv.invokeInt(new java.lang.Object[]{mHandle, bufferTileStyleU, bufferTileStyleV})); + GetTileStyleUVResult returnTuple = new GetTileStyleUVResult(); + returnTuple.TileStyleU = Lib3MFWrapper.EnumConversion.convertConstToTextureTileStyle(bufferTileStyleU.getInt(0)); + returnTuple.TileStyleV = Lib3MFWrapper.EnumConversion.convertConstToTextureTileStyle(bufferTileStyleV.getInt(0)); + return returnTuple; + } + + public static class GetTileStyleUVResult { + /** + * returns tilestyle type enum. + */ + public Lib3MFWrapper.TextureTileStyle TileStyleU; + + /** + * returns tilestyle type enum. + */ + public Lib3MFWrapper.TextureTileStyle TileStyleV; + + } + /** + * Sets a texture's tilestyle type. + * + * @param tileStyleU new tilestyle type enum. + * @param tileStyleV new tilestyle type enum. + * @throws Lib3MFException + */ + public void setTileStyleUV(Lib3MFWrapper.TextureTileStyle tileStyleU, Lib3MFWrapper.TextureTileStyle tileStyleV) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_texture2d_settilestyleuv.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertTextureTileStyleToConst(tileStyleU), Lib3MFWrapper.EnumConversion.convertTextureTileStyleToConst(tileStyleV)})); + } + + /** + * Retrieves a texture's filter type. + * + * @return returns filter type enum. + * @throws Lib3MFException + */ + public Lib3MFWrapper.TextureFilter getFilter() throws Lib3MFException { + Pointer bufferFilter = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_texture2d_getfilter.invokeInt(new java.lang.Object[]{mHandle, bufferFilter})); + return Lib3MFWrapper.EnumConversion.convertConstToTextureFilter(bufferFilter.getInt(0)); + } + + /** + * Sets a texture's filter type. + * + * @param filter sets new filter type enum. + * @throws Lib3MFException + */ + public void setFilter(Lib3MFWrapper.TextureFilter filter) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_texture2d_setfilter.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertTextureFilterToConst(filter)})); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Texture2DGroup.java b/Autogenerated/Bindings/Java8/lib3mf/Texture2DGroup.java new file mode 100644 index 000000000..2efff6a95 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Texture2DGroup.java @@ -0,0 +1,141 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Texture2DGroup extends Resource { + + public Texture2DGroup(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the count of tex2coords in the Texture2DGroup. + * + * @return returns the count of tex2coords. + * @throws Lib3MFException + */ + public int getCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_texture2dgroup_getcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * returns all the PropertyIDs of all tex2coords in this Texture2DGroup + * + * @return PropertyID of the tex2coords in the Texture2DGroup. + * @throws Lib3MFException + */ + public int[] getAllPropertyIDs() throws Lib3MFException { + Pointer countNeededPropertyIDs = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_texture2dgroup_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededPropertyIDs, Pointer.NULL})); + long countPropertyIDs = countNeededPropertyIDs.getLong(0); + Pointer bufferPropertyIDs = new Memory(Math.max(1, 4 * countPropertyIDs)); + mWrapper.checkError(this, mWrapper.lib3mf_texture2dgroup_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, countPropertyIDs, countNeededPropertyIDs, bufferPropertyIDs})); + return bufferPropertyIDs.getIntArray(0, (int)countPropertyIDs); + } + + /** + * Adds a new tex2coord to the Texture2DGroup + * + * @param uVCoordinate The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. + * @return returns new PropertyID of the new tex2coord in the Texture2DGroup. + * @throws Lib3MFException + */ + public int addTex2Coord(Tex2Coord uVCoordinate) throws Lib3MFException { + Pointer bufferUVCoordinate = new Memory(Tex2Coord.SIZE); + uVCoordinate.writeToPointer(bufferUVCoordinate, 0); + Pointer bufferPropertyID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_texture2dgroup_addtex2coord.invokeInt(new java.lang.Object[]{mHandle, bufferUVCoordinate, bufferPropertyID})); + return bufferPropertyID.getInt(0); + } + + /** + * Obtains a tex2coord to the Texture2DGroup + * + * @param propertyID the PropertyID of the tex2coord in the Texture2DGroup. + * @return The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. + * @throws Lib3MFException + */ + public Tex2Coord getTex2Coord(int propertyID) throws Lib3MFException { + Pointer bufferUVCoordinate = new Memory(Tex2Coord.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_texture2dgroup_gettex2coord.invokeInt(new java.lang.Object[]{mHandle, propertyID, bufferUVCoordinate})); + Tex2Coord uVCoordinate = new Tex2Coord(); + uVCoordinate.readFromPointer(bufferUVCoordinate, 0); + return uVCoordinate; + } + + /** + * Removes a tex2coords from the Texture2DGroup. + * + * @param propertyID PropertyID of the tex2coords in the Texture2DGroup. + * @throws Lib3MFException + */ + public void removeTex2Coord(int propertyID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_texture2dgroup_removetex2coord.invokeInt(new java.lang.Object[]{mHandle, propertyID})); + } + + /** + * Obtains the texture2D instance of this group. + * + * @return the texture2D instance of this group. + * @throws Lib3MFException + */ + public Texture2D getTexture2D() throws Lib3MFException { + Pointer bufferTexture2DInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_texture2dgroup_gettexture2d.invokeInt(new java.lang.Object[]{mHandle, bufferTexture2DInstance})); + Pointer valueTexture2DInstance = bufferTexture2DInstance.getPointer(0); + Texture2D texture2DInstance = null; + if (valueTexture2DInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Texture2DInstance was a null pointer"); + } + texture2DInstance = mWrapper.PolymorphicFactory(valueTexture2DInstance, Texture2D.class); + return texture2DInstance; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Texture2DGroupIterator.java b/Autogenerated/Bindings/Java8/lib3mf/Texture2DGroupIterator.java new file mode 100644 index 000000000..5170b5232 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Texture2DGroupIterator.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Texture2DGroupIterator extends ResourceIterator { + + public Texture2DGroupIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the Texture2DGroup the iterator points at. + * + * @return returns the Texture2DGroup instance. + * @throws Lib3MFException + */ + public Texture2DGroup getCurrentTexture2DGroup() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + Texture2DGroup resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, Texture2DGroup.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Texture2DIterator.java b/Autogenerated/Bindings/Java8/lib3mf/Texture2DIterator.java new file mode 100644 index 000000000..8511ca4f8 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Texture2DIterator.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Texture2DIterator extends ResourceIterator { + + public Texture2DIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the Texture2D the iterator points at. + * + * @return returns the Texture2D instance. + * @throws Lib3MFException + */ + public Texture2D getCurrentTexture2D() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_texture2diterator_getcurrenttexture2d.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + Texture2D resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, Texture2D.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Transform.java b/Autogenerated/Bindings/Java8/lib3mf/Transform.java new file mode 100644 index 000000000..795496b75 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Transform.java @@ -0,0 +1,81 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Transform { + + public float[][] Fields = new float[3][4]; + + public static final int SIZE = 48; + + public void readFromPointer(Pointer p, long offset) { + Fields[0][0] = p.getFloat(offset + 0); + Fields[0][1] = p.getFloat(offset + 4); + Fields[0][2] = p.getFloat(offset + 8); + Fields[0][3] = p.getFloat(offset + 12); + Fields[1][0] = p.getFloat(offset + 16); + Fields[1][1] = p.getFloat(offset + 20); + Fields[1][2] = p.getFloat(offset + 24); + Fields[1][3] = p.getFloat(offset + 28); + Fields[2][0] = p.getFloat(offset + 32); + Fields[2][1] = p.getFloat(offset + 36); + Fields[2][2] = p.getFloat(offset + 40); + Fields[2][3] = p.getFloat(offset + 44); + } + + public void writeToPointer(Pointer p, long offset) { + p.setFloat(offset + 0, Fields[0][0]); + p.setFloat(offset + 4, Fields[0][1]); + p.setFloat(offset + 8, Fields[0][2]); + p.setFloat(offset + 12, Fields[0][3]); + p.setFloat(offset + 16, Fields[1][0]); + p.setFloat(offset + 20, Fields[1][1]); + p.setFloat(offset + 24, Fields[1][2]); + p.setFloat(offset + 28, Fields[1][3]); + p.setFloat(offset + 32, Fields[2][0]); + p.setFloat(offset + 36, Fields[2][1]); + p.setFloat(offset + 40, Fields[2][2]); + p.setFloat(offset + 44, Fields[2][3]); + } + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/TransposeNode.java b/Autogenerated/Bindings/Java8/lib3mf/TransposeNode.java new file mode 100644 index 000000000..ec3c53a7b --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/TransposeNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class TransposeNode extends OneInputNode { + + public TransposeNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Triangle.java b/Autogenerated/Bindings/Java8/lib3mf/Triangle.java new file mode 100644 index 000000000..007400619 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Triangle.java @@ -0,0 +1,63 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Triangle { + + public int[] Indices = new int[3]; + + public static final int SIZE = 12; + + public void readFromPointer(Pointer p, long offset) { + Indices[0] = p.getInt(offset + 0); + Indices[1] = p.getInt(offset + 4); + Indices[2] = p.getInt(offset + 8); + } + + public void writeToPointer(Pointer p, long offset) { + p.setInt(offset + 0, Indices[0]); + p.setInt(offset + 4, Indices[1]); + p.setInt(offset + 8, Indices[2]); + } + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/TriangleProperties.java b/Autogenerated/Bindings/Java8/lib3mf/TriangleProperties.java new file mode 100644 index 000000000..0e44da4e8 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/TriangleProperties.java @@ -0,0 +1,67 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class TriangleProperties { + + public int ResourceID; + + public int[] PropertyIDs = new int[3]; + + public static final int SIZE = 16; + + public void readFromPointer(Pointer p, long offset) { + ResourceID = p.getInt(offset + 0); + PropertyIDs[0] = p.getInt(offset + 4); + PropertyIDs[1] = p.getInt(offset + 8); + PropertyIDs[2] = p.getInt(offset + 12); + } + + public void writeToPointer(Pointer p, long offset) { + p.setInt(offset + 0, ResourceID); + p.setInt(offset + 4, PropertyIDs[0]); + p.setInt(offset + 8, PropertyIDs[1]); + p.setInt(offset + 12, PropertyIDs[2]); + } + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/TriangleSet.java b/Autogenerated/Bindings/Java8/lib3mf/TriangleSet.java new file mode 100644 index 000000000..0363a9803 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/TriangleSet.java @@ -0,0 +1,235 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class TriangleSet extends Base { + + public TriangleSet(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * sets the name of the triangle set + * + * @param name the new name + * @throws Lib3MFException + */ + public void setName(String name) throws Lib3MFException { + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_setname.invokeInt(new java.lang.Object[]{mHandle, bufferName})); + } + + /** + * returns the name of the triangle set + * + * @return returns the name + * @throws Lib3MFException + */ + public String getName() throws Lib3MFException { + Pointer bytesNeededName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_getname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededName, null})); + int sizeName = bytesNeededName.getInt(0); + Pointer bufferName = new Memory(sizeName); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_getname.invokeInt(new java.lang.Object[]{mHandle, sizeName, bytesNeededName, bufferName})); + return new String(bufferName.getByteArray(0, sizeName - 1), StandardCharsets.UTF_8); + } + + /** + * sets the identifier of the triangle set. + * + * @param identifier the new identifier. MUST be unique within the mesh. MUST NOT be an empty string + * @throws Lib3MFException + */ + public void setIdentifier(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_setidentifier.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier})); + } + + /** + * returns the identifier of the triangle set + * + * @return returns the identifier + * @throws Lib3MFException + */ + public String getIdentifier() throws Lib3MFException { + Pointer bytesNeededIdentifier = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_getidentifier.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededIdentifier, null})); + int sizeIdentifier = bytesNeededIdentifier.getInt(0); + Pointer bufferIdentifier = new Memory(sizeIdentifier); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_getidentifier.invokeInt(new java.lang.Object[]{mHandle, sizeIdentifier, bytesNeededIdentifier, bufferIdentifier})); + return new String(bufferIdentifier.getByteArray(0, sizeIdentifier - 1), StandardCharsets.UTF_8); + } + + /** + * adds a triangle to the set. Does nothing if triangle is already in the set. + * + * @param triangleIndex Triangle index to add. MUST be between 0 and TriangleCount - 1. + * @throws Lib3MFException + */ + public void addTriangle(int triangleIndex) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_addtriangle.invokeInt(new java.lang.Object[]{mHandle, triangleIndex})); + } + + /** + * removes a triangle from the set + * + * @param triangleIndex Triangle index to remove. MUST be between 0 and TriangleCount - 1. + * @throws Lib3MFException + */ + public void removeTriangle(int triangleIndex) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_removetriangle.invokeInt(new java.lang.Object[]{mHandle, triangleIndex})); + } + + /** + * clears all triangles from the list + * + * @throws Lib3MFException + */ + public void clear() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_clear.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Sets all triangles in the list, while clearing old values. Duplicates will be merged. + * + * @param triangleIndices Triangle indices to add. Every element MUST be between 0 and TriangleCount - 1. + * @throws Lib3MFException + */ + public void setTriangleList(int[] triangleIndices) throws Lib3MFException { + Pointer bufferTriangleIndices = new Memory(Math.max(1, 4 * triangleIndices.length)); + for (int i = 0; i < triangleIndices.length; i++) { + bufferTriangleIndices.setInt(4 * i, triangleIndices[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_settrianglelist.invokeInt(new java.lang.Object[]{mHandle, (long) triangleIndices.length, bufferTriangleIndices})); + } + + /** + * Retrieves all the triangles in the TriangleSet + * + * @return retrieves the indices of the triangles in this TriangleSet + * @throws Lib3MFException + */ + public int[] getTriangleList() throws Lib3MFException { + Pointer countNeededTriangleIndices = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_gettrianglelist.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededTriangleIndices, Pointer.NULL})); + long countTriangleIndices = countNeededTriangleIndices.getLong(0); + Pointer bufferTriangleIndices = new Memory(Math.max(1, 4 * countTriangleIndices)); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_gettrianglelist.invokeInt(new java.lang.Object[]{mHandle, countTriangleIndices, countNeededTriangleIndices, bufferTriangleIndices})); + return bufferTriangleIndices.getIntArray(0, (int)countTriangleIndices); + } + + /** + * Adds multiple triangles in the list. Duplicates will be merged. + * + * @param triangleIndices Triangle indices to add. Every element MUST be between 0 and TriangleCount - 1. + * @throws Lib3MFException + */ + public void addTriangleList(int[] triangleIndices) throws Lib3MFException { + Pointer bufferTriangleIndices = new Memory(Math.max(1, 4 * triangleIndices.length)); + for (int i = 0; i < triangleIndices.length; i++) { + bufferTriangleIndices.setInt(4 * i, triangleIndices[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_addtrianglelist.invokeInt(new java.lang.Object[]{mHandle, (long) triangleIndices.length, bufferTriangleIndices})); + } + + /** + * Merges another Triangle set. + * + * @param otherTriangleSet Other triangle set to merge. + * @param deleteOther Flag if other triangle set is getting removed. + * @throws Lib3MFException + */ + public void merge(TriangleSet otherTriangleSet, boolean deleteOther) throws Lib3MFException { + Pointer otherTriangleSetHandle = null; + if (otherTriangleSet != null) { + otherTriangleSetHandle = otherTriangleSet.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "OtherTriangleSet is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_merge.invokeInt(new java.lang.Object[]{mHandle, otherTriangleSetHandle, deleteOther})); + } + + /** + * Deletes the whole set from the mesh. + * + * @throws Lib3MFException + */ + public void deleteSet() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_deleteset.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Duplicates the set in the mesh. + * + * @param identifier the new identifier. MUST be unique within the mesh. MUST NOT be an empty string + * @return Copy of the triangle set. + * @throws Lib3MFException + */ + public TriangleSet duplicate(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + Pointer bufferNewSet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_duplicate.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferNewSet})); + Pointer valueNewSet = bufferNewSet.getPointer(0); + TriangleSet newSet = null; + if (valueNewSet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "NewSet was a null pointer"); + } + newSet = mWrapper.PolymorphicFactory(valueNewSet, TriangleSet.class); + return newSet; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/TwoInputNode.java b/Autogenerated/Bindings/Java8/lib3mf/TwoInputNode.java new file mode 100644 index 000000000..7ad69146e --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/TwoInputNode.java @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class TwoInputNode extends OneInputNode { + + public TwoInputNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the second input + * + * @return the second input + * @throws Lib3MFException + */ + public ImplicitPort getInputB() throws Lib3MFException { + Pointer bufferB = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_twoinputnode_getinputb.invokeInt(new java.lang.Object[]{mHandle, bufferB})); + Pointer valueB = bufferB.getPointer(0); + ImplicitPort b = null; + if (valueB == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "B was a null pointer"); + } + b = mWrapper.PolymorphicFactory(valueB, ImplicitPort.class); + return b; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/UnsignedMeshNode.java b/Autogenerated/Bindings/Java8/lib3mf/UnsignedMeshNode.java new file mode 100644 index 000000000..844811c48 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/UnsignedMeshNode.java @@ -0,0 +1,110 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class UnsignedMeshNode extends ImplicitNode { + + public UnsignedMeshNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the model resource id of the mesh + * + * @return the input port for the model resource id of the mesh + * @throws Lib3MFException + */ + public ImplicitPort getInputMesh() throws Lib3MFException { + Pointer bufferMesh = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_unsignedmeshnode_getinputmesh.invokeInt(new java.lang.Object[]{mHandle, bufferMesh})); + Pointer valueMesh = bufferMesh.getPointer(0); + ImplicitPort mesh = null; + if (valueMesh == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Mesh was a null pointer"); + } + mesh = mWrapper.PolymorphicFactory(valueMesh, ImplicitPort.class); + return mesh; + } + + /** + * Retrieves the input for the position + * + * @return the input port for the position + * @throws Lib3MFException + */ + public ImplicitPort getInputPos() throws Lib3MFException { + Pointer bufferPos = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_unsignedmeshnode_getinputpos.invokeInt(new java.lang.Object[]{mHandle, bufferPos})); + Pointer valuePos = bufferPos.getPointer(0); + ImplicitPort pos = null; + if (valuePos == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Pos was a null pointer"); + } + pos = mWrapper.PolymorphicFactory(valuePos, ImplicitPort.class); + return pos; + } + + /** + * Retrieves the output + * + * @return the output port for the unsigned distance to the mesh + * @throws Lib3MFException + */ + public ImplicitPort getOutputDistance() throws Lib3MFException { + Pointer bufferDistance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_unsignedmeshnode_getoutputdistance.invokeInt(new java.lang.Object[]{mHandle, bufferDistance})); + Pointer valueDistance = bufferDistance.getPointer(0); + ImplicitPort distance = null; + if (valueDistance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Distance was a null pointer"); + } + distance = mWrapper.PolymorphicFactory(valueDistance, ImplicitPort.class); + return distance; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Vector.java b/Autogenerated/Bindings/Java8/lib3mf/Vector.java new file mode 100644 index 000000000..4a47a9847 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Vector.java @@ -0,0 +1,63 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Vector { + + public double[] Coordinates = new double[3]; + + public static final int SIZE = 24; + + public void readFromPointer(Pointer p, long offset) { + Coordinates[0] = p.getDouble(offset + 0); + Coordinates[1] = p.getDouble(offset + 8); + Coordinates[2] = p.getDouble(offset + 16); + } + + public void writeToPointer(Pointer p, long offset) { + p.setDouble(offset + 0, Coordinates[0]); + p.setDouble(offset + 8, Coordinates[1]); + p.setDouble(offset + 16, Coordinates[2]); + } + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/VectorFromScalarNode.java b/Autogenerated/Bindings/Java8/lib3mf/VectorFromScalarNode.java new file mode 100644 index 000000000..43793619e --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/VectorFromScalarNode.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class VectorFromScalarNode extends OneInputNode { + + public VectorFromScalarNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/VolumeData.java b/Autogenerated/Bindings/Java8/lib3mf/VolumeData.java new file mode 100644 index 000000000..9eeaedf3f --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/VolumeData.java @@ -0,0 +1,222 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class VolumeData extends Resource { + + public VolumeData(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the VolumeDataComposite of this VolumeData instance + * + * @return filled with the VolumeDataComposite of this VolumeData instance. + * @throws Lib3MFException + */ + public VolumeDataComposite getComposite() throws Lib3MFException { + Pointer bufferTheCompositeData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_getcomposite.invokeInt(new java.lang.Object[]{mHandle, bufferTheCompositeData})); + Pointer valueTheCompositeData = bufferTheCompositeData.getPointer(0); + VolumeDataComposite theCompositeData = null; + if (valueTheCompositeData != Pointer.NULL) { + theCompositeData = mWrapper.PolymorphicFactory(valueTheCompositeData, VolumeDataComposite.class); + } + return theCompositeData; + } + + /** + * Creates a new VolumeDataComposite for this VolumeData instance + * + * @return The new VolumeDataComposite of this VolumeData instance. + * @throws Lib3MFException + */ + public VolumeDataComposite createNewComposite() throws Lib3MFException { + Pointer bufferTheCompositeData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_createnewcomposite.invokeInt(new java.lang.Object[]{mHandle, bufferTheCompositeData})); + Pointer valueTheCompositeData = bufferTheCompositeData.getPointer(0); + VolumeDataComposite theCompositeData = null; + if (valueTheCompositeData == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheCompositeData was a null pointer"); + } + theCompositeData = mWrapper.PolymorphicFactory(valueTheCompositeData, VolumeDataComposite.class); + return theCompositeData; + } + + /** + * Removes the VolumeDataComposite of this VolumeData instance + * + * @throws Lib3MFException + */ + public void removeComposite() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_removecomposite.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Returns the VolumeDataColor of this VolumeData instance + * + * @return filled with the VolumeDataColor of this VolumeData instance. + * @throws Lib3MFException + */ + public VolumeDataColor getColor() throws Lib3MFException { + Pointer bufferTheColorData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_getcolor.invokeInt(new java.lang.Object[]{mHandle, bufferTheColorData})); + Pointer valueTheColorData = bufferTheColorData.getPointer(0); + VolumeDataColor theColorData = null; + if (valueTheColorData != Pointer.NULL) { + theColorData = mWrapper.PolymorphicFactory(valueTheColorData, VolumeDataColor.class); + } + return theColorData; + } + + /** + * Creates a new VolumeDataColor for this VolumeData instance + * + * @param theFunction Function used in this element + * @return The new VolumeDataColor of this VolumeData instance. + * @throws Lib3MFException + */ + public VolumeDataColor createNewColor(Function theFunction) throws Lib3MFException { + Pointer theFunctionHandle = null; + if (theFunction != null) { + theFunctionHandle = theFunction.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheFunction is a null value."); + } + Pointer bufferTheColorData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_createnewcolor.invokeInt(new java.lang.Object[]{mHandle, theFunctionHandle, bufferTheColorData})); + Pointer valueTheColorData = bufferTheColorData.getPointer(0); + VolumeDataColor theColorData = null; + if (valueTheColorData == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheColorData was a null pointer"); + } + theColorData = mWrapper.PolymorphicFactory(valueTheColorData, VolumeDataColor.class); + return theColorData; + } + + /** + * Removes the VolumeDataColor of this VolumeData instance + * + * @throws Lib3MFException + */ + public void removeColor() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_removecolor.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Returns the number of VolumeDataProperty + * + * @return the number of VolumeDataProperty-elements within this VolumeData + * @throws Lib3MFException + */ + public int getPropertyCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_getpropertycount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Returns the VolumeDataProperty at a given Index + * + * @param index the index of the VolumeDataProperty to be returned. + * @return the VolumeDataProperty at the given index. + * @throws Lib3MFException + */ + public VolumeDataProperty getProperty(int index) throws Lib3MFException { + Pointer bufferTheVolumeDataProperty = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_getproperty.invokeInt(new java.lang.Object[]{mHandle, index, bufferTheVolumeDataProperty})); + Pointer valueTheVolumeDataProperty = bufferTheVolumeDataProperty.getPointer(0); + VolumeDataProperty theVolumeDataProperty = null; + if (valueTheVolumeDataProperty == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheVolumeDataProperty was a null pointer"); + } + theVolumeDataProperty = mWrapper.PolymorphicFactory(valueTheVolumeDataProperty, VolumeDataProperty.class); + return theVolumeDataProperty; + } + + /** + * Adds a new VolumeDataProperty from a Function + * + * @param name the qualified name (namespace+name) of the Property + * @param theFunction Function used in this element + * @return the newly created VolumeDataProperty. + * @throws Lib3MFException + */ + public VolumeDataProperty addPropertyFromFunction(String name, Function theFunction) throws Lib3MFException { + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + Pointer theFunctionHandle = null; + if (theFunction != null) { + theFunctionHandle = theFunction.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheFunction is a null value."); + } + Pointer bufferTheVolumeDataProperty = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_addpropertyfromfunction.invokeInt(new java.lang.Object[]{mHandle, bufferName, theFunctionHandle, bufferTheVolumeDataProperty})); + Pointer valueTheVolumeDataProperty = bufferTheVolumeDataProperty.getPointer(0); + VolumeDataProperty theVolumeDataProperty = null; + if (valueTheVolumeDataProperty == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheVolumeDataProperty was a null pointer"); + } + theVolumeDataProperty = mWrapper.PolymorphicFactory(valueTheVolumeDataProperty, VolumeDataProperty.class); + return theVolumeDataProperty; + } + + /** + * Removes the VolumeDataProperty with a given index + * + * @param index the index of the VolumeDataProperty to be removed. + * @throws Lib3MFException + */ + public void removeProperty(int index) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_removeproperty.invokeInt(new java.lang.Object[]{mHandle, index})); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/VolumeDataColor.java b/Autogenerated/Bindings/Java8/lib3mf/VolumeDataColor.java new file mode 100644 index 000000000..c361c342d --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/VolumeDataColor.java @@ -0,0 +1,56 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class VolumeDataColor extends FunctionReference { + + public VolumeDataColor(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/VolumeDataComposite.java b/Autogenerated/Bindings/Java8/lib3mf/VolumeDataComposite.java new file mode 100644 index 000000000..1a60c8aac --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/VolumeDataComposite.java @@ -0,0 +1,152 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class VolumeDataComposite extends Base { + + public VolumeDataComposite(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the BaseMaterialGroup used within this volume data item + * + * @return The BaseMaterialGroup instance of this VolumeDataComposite element + * @throws Lib3MFException + */ + public BaseMaterialGroup getBaseMaterialGroup() throws Lib3MFException { + Pointer bufferBaseMaterialGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedatacomposite_getbasematerialgroup.invokeInt(new java.lang.Object[]{mHandle, bufferBaseMaterialGroupInstance})); + Pointer valueBaseMaterialGroupInstance = bufferBaseMaterialGroupInstance.getPointer(0); + BaseMaterialGroup baseMaterialGroupInstance = null; + if (valueBaseMaterialGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BaseMaterialGroupInstance was a null pointer"); + } + baseMaterialGroupInstance = mWrapper.PolymorphicFactory(valueBaseMaterialGroupInstance, BaseMaterialGroup.class); + return baseMaterialGroupInstance; + } + + /** + * Sets the BaseMaterialGroup to use within this volume data item. + * + * @param baseMaterialGroupInstance The new BaseMaterialGroup instance of this VolumeDataComposite element + * @throws Lib3MFException + */ + public void setBaseMaterialGroup(BaseMaterialGroup baseMaterialGroupInstance) throws Lib3MFException { + Pointer baseMaterialGroupInstanceHandle = null; + if (baseMaterialGroupInstance != null) { + baseMaterialGroupInstanceHandle = baseMaterialGroupInstance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BaseMaterialGroupInstance is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_volumedatacomposite_setbasematerialgroup.invokeInt(new java.lang.Object[]{mHandle, baseMaterialGroupInstanceHandle})); + } + + /** + * Returns the number of material mappings of this VolumeDataComposite element + * + * @return the number of material mappings. + * @throws Lib3MFException + */ + public int getMaterialMappingCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_volumedatacomposite_getmaterialmappingcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Returns MaterialMapping with given index + * + * @param index Index of the MaterialMapping in question. + * @return MaterialMapping used in this element + * @throws Lib3MFException + */ + public MaterialMapping getMaterialMapping(int index) throws Lib3MFException { + Pointer bufferTheMaterialMapping = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedatacomposite_getmaterialmapping.invokeInt(new java.lang.Object[]{mHandle, index, bufferTheMaterialMapping})); + Pointer valueTheMaterialMapping = bufferTheMaterialMapping.getPointer(0); + MaterialMapping theMaterialMapping = null; + if (valueTheMaterialMapping == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheMaterialMapping was a null pointer"); + } + theMaterialMapping = mWrapper.PolymorphicFactory(valueTheMaterialMapping, MaterialMapping.class); + return theMaterialMapping; + } + + /** + * Adds a MaterialMapping + * + * @param transform new transformation matrix + * @return The new MaterialMapping + * @throws Lib3MFException + */ + public MaterialMapping addMaterialMapping(Transform transform) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + Pointer bufferTheMaterialMapping = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedatacomposite_addmaterialmapping.invokeInt(new java.lang.Object[]{mHandle, bufferTransform, bufferTheMaterialMapping})); + Pointer valueTheMaterialMapping = bufferTheMaterialMapping.getPointer(0); + MaterialMapping theMaterialMapping = null; + if (valueTheMaterialMapping == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheMaterialMapping was a null pointer"); + } + theMaterialMapping = mWrapper.PolymorphicFactory(valueTheMaterialMapping, MaterialMapping.class); + return theMaterialMapping; + } + + /** + * Removes the MaterialMapping with given index + * + * @param index The index of the MaterialMapping to be removed. + * @throws Lib3MFException + */ + public void removeMaterialMapping(int index) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_volumedatacomposite_removematerialmapping.invokeInt(new java.lang.Object[]{mHandle, index})); + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/VolumeDataProperty.java b/Autogenerated/Bindings/Java8/lib3mf/VolumeDataProperty.java new file mode 100644 index 000000000..ae66d4746 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/VolumeDataProperty.java @@ -0,0 +1,93 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class VolumeDataProperty extends FunctionReference { + + public VolumeDataProperty(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Gets the qualified name of this property. + * + * @return The qualified name of this property. + * @throws Lib3MFException + */ + public String getName() throws Lib3MFException { + Pointer bytesNeededPropertyName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_volumedataproperty_getname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededPropertyName, null})); + int sizePropertyName = bytesNeededPropertyName.getInt(0); + Pointer bufferPropertyName = new Memory(sizePropertyName); + mWrapper.checkError(this, mWrapper.lib3mf_volumedataproperty_getname.invokeInt(new java.lang.Object[]{mHandle, sizePropertyName, bytesNeededPropertyName, bufferPropertyName})); + return new String(bufferPropertyName.getByteArray(0, sizePropertyName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets whether this property is required to process this 3MF document instance. + * + * @param isRequired New value for whether this property is required to process this 3MF document instance. + * @throws Lib3MFException + */ + public void setIsRequired(boolean isRequired) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_volumedataproperty_setisrequired.invokeInt(new java.lang.Object[]{mHandle, isRequired})); + } + + /** + * Returns whether this property is required to process this 3MF document instance. + * + * @return Is this property required to process this 3MF document instance? + * @throws Lib3MFException + */ + public boolean isRequired() throws Lib3MFException { + Pointer bufferIsRequired = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_volumedataproperty_isrequired.invokeInt(new java.lang.Object[]{mHandle, bufferIsRequired})); + return bufferIsRequired.getByte(0) != 0; + } + + +} + diff --git a/Autogenerated/Bindings/Java8/lib3mf/Writer.java b/Autogenerated/Bindings/Java8/lib3mf/Writer.java new file mode 100644 index 000000000..bb4920518 --- /dev/null +++ b/Autogenerated/Bindings/Java8/lib3mf/Writer.java @@ -0,0 +1,235 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Writer extends Base { + + public Writer(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Writes out the model as file. The file type is specified by the Model Writer class. + * + * @param filename Filename to write into + * @throws Lib3MFException + */ + public void writeToFile(String filename) throws Lib3MFException { + byte[] bytesFilename = filename.getBytes(StandardCharsets.UTF_8); + Memory bufferFilename = new Memory(bytesFilename.length + 1); + bufferFilename.write(0, bytesFilename, 0, bytesFilename.length); + bufferFilename.setByte(bytesFilename.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_writer_writetofile.invokeInt(new java.lang.Object[]{mHandle, bufferFilename})); + } + + /** + * Retrieves the size of the full 3MF file stream. + * + * @return the stream size + * @throws Lib3MFException + */ + public long getStreamSize() throws Lib3MFException { + Pointer bufferStreamSize = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_writer_getstreamsize.invokeInt(new java.lang.Object[]{mHandle, bufferStreamSize})); + return bufferStreamSize.getLong(0); + } + + /** + * Writes out the 3MF file into a memory buffer + * + * @return buffer to write into + * @throws Lib3MFException + */ + public byte[] writeToBuffer() throws Lib3MFException { + Pointer countNeededBuffer = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_writer_writetobuffer.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededBuffer, Pointer.NULL})); + long countBuffer = countNeededBuffer.getLong(0); + Pointer bufferBuffer = new Memory(Math.max(1, 1 * countBuffer)); + mWrapper.checkError(this, mWrapper.lib3mf_writer_writetobuffer.invokeInt(new java.lang.Object[]{mHandle, countBuffer, countNeededBuffer, bufferBuffer})); + return bufferBuffer.getByteArray(0, (int)countBuffer); + } + + /** + * Writes out the model and passes the data to a provided callback function. The file type is specified by the Model Writer class. + * + * @param theWriteCallback Callback to call for writing a data chunk + * @param theSeekCallback Callback to call for seeking in the stream + * @param userData Userdata that is passed to the callback function + * @throws Lib3MFException + */ + public void writeToCallback(Lib3MFWrapper.WriteCallback theWriteCallback, Lib3MFWrapper.SeekCallback theSeekCallback, Pointer userData) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_writer_writetocallback.invokeInt(new java.lang.Object[]{mHandle, theWriteCallback, theSeekCallback, userData})); + } + + /** + * Set the progress callback for calls to this writer + * + * @param progressCallback pointer to the callback function. + * @param userData pointer to arbitrary user data that is passed without modification to the callback. + * @throws Lib3MFException + */ + public void setProgressCallback(Lib3MFWrapper.ProgressCallback progressCallback, Pointer userData) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_writer_setprogresscallback.invokeInt(new java.lang.Object[]{mHandle, progressCallback, userData})); + } + + /** + * Returns the number of digits after the decimal point to be written in each vertex coordinate-value. + * + * @return The number of digits to be written in each vertex coordinate-value after the decimal point. + * @throws Lib3MFException + */ + public int getDecimalPrecision() throws Lib3MFException { + Pointer bufferDecimalPrecision = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_writer_getdecimalprecision.invokeInt(new java.lang.Object[]{mHandle, bufferDecimalPrecision})); + return bufferDecimalPrecision.getInt(0); + } + + /** + * Sets the number of digits after the decimal point to be written in each vertex coordinate-value. + * + * @param decimalPrecision The number of digits to be written in each vertex coordinate-value after the decimal point. + * @throws Lib3MFException + */ + public void setDecimalPrecision(int decimalPrecision) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_writer_setdecimalprecision.invokeInt(new java.lang.Object[]{mHandle, decimalPrecision})); + } + + /** + * Activates (deactivates) the strict mode of the reader. + * + * @param strictModeActive flag whether strict mode is active or not. + * @throws Lib3MFException + */ + public void setStrictModeActive(boolean strictModeActive) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_writer_setstrictmodeactive.invokeInt(new java.lang.Object[]{mHandle, strictModeActive})); + } + + /** + * Queries whether the strict mode of the reader is active or not + * + * @return returns flag whether strict mode is active or not. + * @throws Lib3MFException + */ + public boolean getStrictModeActive() throws Lib3MFException { + Pointer bufferStrictModeActive = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_writer_getstrictmodeactive.invokeInt(new java.lang.Object[]{mHandle, bufferStrictModeActive})); + return bufferStrictModeActive.getByte(0) != 0; + } + + /** + * Returns Warning and Error Information of the read process + * + * @param index Index of the Warning. Valid values are 0 to WarningCount - 1 + * @return GetWarning Result Tuple + * @throws Lib3MFException + */ + public GetWarningResult getWarning(int index) throws Lib3MFException { + Pointer bufferErrorCode = new Memory(4); + Pointer bytesNeededWarning = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_writer_getwarning.invokeInt(new java.lang.Object[]{mHandle, index, bufferErrorCode, 0, bytesNeededWarning, null})); + int sizeWarning = bytesNeededWarning.getInt(0); + Pointer bufferWarning = new Memory(sizeWarning); + mWrapper.checkError(this, mWrapper.lib3mf_writer_getwarning.invokeInt(new java.lang.Object[]{mHandle, index, bufferErrorCode, sizeWarning, bytesNeededWarning, bufferWarning})); + GetWarningResult returnTuple = new GetWarningResult(); + returnTuple.ErrorCode = bufferErrorCode.getInt(0); + returnTuple.Warning = new String(bufferWarning.getByteArray(0, sizeWarning - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetWarningResult { + /** + * filled with the error code of the warning + */ + public int ErrorCode; + + /** + * the message of the warning + */ + public String Warning; + + } + /** + * Returns Warning and Error Count of the read process + * + * @return filled with the count of the occurred warnings. + * @throws Lib3MFException + */ + public int getWarningCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_writer_getwarningcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Registers a callback to deal with data key encryption/decryption from keystore + * + * @param consumerID The ConsumerID to register for + * @param theCallback The callback to be callede for wrapping and encryption key + * @param userData Userdata that is passed to the callback function + * @throws Lib3MFException + */ + public void addKeyWrappingCallback(String consumerID, Lib3MFWrapper.KeyWrappingCallback theCallback, Pointer userData) throws Lib3MFException { + byte[] bytesConsumerID = consumerID.getBytes(StandardCharsets.UTF_8); + Memory bufferConsumerID = new Memory(bytesConsumerID.length + 1); + bufferConsumerID.write(0, bytesConsumerID, 0, bytesConsumerID.length); + bufferConsumerID.setByte(bytesConsumerID.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_writer_addkeywrappingcallback.invokeInt(new java.lang.Object[]{mHandle, bufferConsumerID, theCallback, userData})); + } + + /** + * Registers a callback to deal with encryption of content + * + * @param theCallback The callback used to encrypt content + * @param userData Userdata that is passed to the callback function + * @throws Lib3MFException + */ + public void setContentEncryptionCallback(Lib3MFWrapper.ContentEncryptionCallback theCallback, Pointer userData) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_writer_setcontentencryptioncallback.invokeInt(new java.lang.Object[]{mHandle, theCallback, userData})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/build_jar.sh b/Autogenerated/Bindings/Java9/build_jar.sh new file mode 100644 index 000000000..8bd9d4094 --- /dev/null +++ b/Autogenerated/Bindings/Java9/build_jar.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -euxo pipefail + +cd "$(dirname "$0")" +echo "Download JNA" +[ -f jna-5.5.0.jar ] || curl -O https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.5.0/jna-5.5.0.jar + +echo "Compile Java Bindings" +javac -classpath *.jar lib3mf/* + +echo "Create JAR" +jar cvf lib3mf-2.6.0.jar lib3mf diff --git a/Autogenerated/Bindings/Java9/lib3mf/AbsNode.java b/Autogenerated/Bindings/Java9/lib3mf/AbsNode.java new file mode 100644 index 000000000..5869da07c --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/AbsNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class AbsNode extends OneInputNode { + + public AbsNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/AccessRight.java b/Autogenerated/Bindings/Java9/lib3mf/AccessRight.java new file mode 100644 index 000000000..1053f5d45 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/AccessRight.java @@ -0,0 +1,111 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class AccessRight extends Base { + + public AccessRight(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Gets the consumer associated with this access right + * + * @return The consumer instance + * @throws Lib3MFException + */ + public Consumer getConsumer() throws Lib3MFException { + Pointer bufferConsumer = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_accessright_getconsumer.invokeInt(new java.lang.Object[]{mHandle, bufferConsumer})); + Pointer valueConsumer = bufferConsumer.getPointer(0); + Consumer consumer = null; + if (valueConsumer == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Consumer was a null pointer"); + } + consumer = mWrapper.PolymorphicFactory(valueConsumer, Consumer.class); + return consumer; + } + + /** + * Gets the associated encryption algorithm + * + * @return The algorithm used for the key in this accessright + * @throws Lib3MFException + */ + public Lib3MFWrapper.WrappingAlgorithm getWrappingAlgorithm() throws Lib3MFException { + Pointer bufferAlgorithm = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_accessright_getwrappingalgorithm.invokeInt(new java.lang.Object[]{mHandle, bufferAlgorithm})); + return Lib3MFWrapper.EnumConversion.convertConstToWrappingAlgorithm(bufferAlgorithm.getInt(0)); + } + + /** + * Gets the associated mask generation function algorithm + * + * @return The MFG1 algorithm + * @throws Lib3MFException + */ + public Lib3MFWrapper.MgfAlgorithm getMgfAlgorithm() throws Lib3MFException { + Pointer bufferAlgorithm = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_accessright_getmgfalgorithm.invokeInt(new java.lang.Object[]{mHandle, bufferAlgorithm})); + return Lib3MFWrapper.EnumConversion.convertConstToMgfAlgorithm(bufferAlgorithm.getInt(0)); + } + + /** + * Gets the digest method assoicated + * + * @return The digest method for this accessright + * @throws Lib3MFException + */ + public Lib3MFWrapper.DigestMethod getDigestMethod() throws Lib3MFException { + Pointer bufferAlgorithm = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_accessright_getdigestmethod.invokeInt(new java.lang.Object[]{mHandle, bufferAlgorithm})); + return Lib3MFWrapper.EnumConversion.convertConstToDigestMethod(bufferAlgorithm.getInt(0)); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/AdditionNode.java b/Autogenerated/Bindings/Java9/lib3mf/AdditionNode.java new file mode 100644 index 000000000..1a4f9d37a --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/AdditionNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class AdditionNode extends TwoInputNode { + + public AdditionNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ArcCosNode.java b/Autogenerated/Bindings/Java9/lib3mf/ArcCosNode.java new file mode 100644 index 000000000..50f4deca3 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ArcCosNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ArcCosNode extends OneInputNode { + + public ArcCosNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ArcSinNode.java b/Autogenerated/Bindings/Java9/lib3mf/ArcSinNode.java new file mode 100644 index 000000000..f80a2982a --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ArcSinNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ArcSinNode extends OneInputNode { + + public ArcSinNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ArcTan2Node.java b/Autogenerated/Bindings/Java9/lib3mf/ArcTan2Node.java new file mode 100644 index 000000000..f23e8fd5b --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ArcTan2Node.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ArcTan2Node extends TwoInputNode { + + public ArcTan2Node(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ArcTanNode.java b/Autogenerated/Bindings/Java9/lib3mf/ArcTanNode.java new file mode 100644 index 000000000..dda3e3ab6 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ArcTanNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ArcTanNode extends OneInputNode { + + public ArcTanNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Attachment.java b/Autogenerated/Bindings/Java9/lib3mf/Attachment.java new file mode 100644 index 000000000..30995efdb --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Attachment.java @@ -0,0 +1,215 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Attachment extends Base { + + public Attachment(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves an attachment's package path. This function will be removed in a later release. + * + * @return returns the attachment's package path string + * @throws Lib3MFException + */ + public String getPath() throws Lib3MFException { + Pointer bytesNeededPath = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_getpath.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededPath, null})); + int sizePath = bytesNeededPath.getInt(0); + Pointer bufferPath = new Memory(sizePath); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_getpath.invokeInt(new java.lang.Object[]{mHandle, sizePath, bytesNeededPath, bufferPath})); + return new String(bufferPath.getByteArray(0, sizePath - 1), StandardCharsets.UTF_8); + } + + /** + * Sets an attachment's package path. This function will be removed in a later release. + * + * @param path new path of the attachment. + * @throws Lib3MFException + */ + public void setPath(String path) throws Lib3MFException { + byte[] bytesPath = path.getBytes(StandardCharsets.UTF_8); + Memory bufferPath = new Memory(bytesPath.length + 1); + bufferPath.write(0, bytesPath, 0, bytesPath.length); + bufferPath.setByte(bytesPath.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_setpath.invokeInt(new java.lang.Object[]{mHandle, bufferPath})); + } + + /** + * Returns the PackagePart that is this attachment. + * + * @return The PackagePart of this attachment. + * @throws Lib3MFException + */ + public PackagePart packagePart() throws Lib3MFException { + Pointer bufferPackagePart = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_packagepart.invokeInt(new java.lang.Object[]{mHandle, bufferPackagePart})); + Pointer valuePackagePart = bufferPackagePart.getPointer(0); + PackagePart packagePart = null; + if (valuePackagePart == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "PackagePart was a null pointer"); + } + packagePart = mWrapper.PolymorphicFactory(valuePackagePart, PackagePart.class); + return packagePart; + } + + /** + * Retrieves an attachment's relationship type + * + * @return returns the attachment's package relationship type string + * @throws Lib3MFException + */ + public String getRelationShipType() throws Lib3MFException { + Pointer bytesNeededPath = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_getrelationshiptype.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededPath, null})); + int sizePath = bytesNeededPath.getInt(0); + Pointer bufferPath = new Memory(sizePath); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_getrelationshiptype.invokeInt(new java.lang.Object[]{mHandle, sizePath, bytesNeededPath, bufferPath})); + return new String(bufferPath.getByteArray(0, sizePath - 1), StandardCharsets.UTF_8); + } + + /** + * Sets an attachment's relationship type. + * + * @param path new relationship type string. + * @throws Lib3MFException + */ + public void setRelationShipType(String path) throws Lib3MFException { + byte[] bytesPath = path.getBytes(StandardCharsets.UTF_8); + Memory bufferPath = new Memory(bytesPath.length + 1); + bufferPath.write(0, bytesPath, 0, bytesPath.length); + bufferPath.setByte(bytesPath.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_setrelationshiptype.invokeInt(new java.lang.Object[]{mHandle, bufferPath})); + } + + /** + * Writes out the attachment as file. + * + * @param fileName file to write into. + * @throws Lib3MFException + */ + public void writeToFile(String fileName) throws Lib3MFException { + byte[] bytesFileName = fileName.getBytes(StandardCharsets.UTF_8); + Memory bufferFileName = new Memory(bytesFileName.length + 1); + bufferFileName.write(0, bytesFileName, 0, bytesFileName.length); + bufferFileName.setByte(bytesFileName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_writetofile.invokeInt(new java.lang.Object[]{mHandle, bufferFileName})); + } + + /** + * Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. + * + * @param fileName file to read from. + * @throws Lib3MFException + */ + public void readFromFile(String fileName) throws Lib3MFException { + byte[] bytesFileName = fileName.getBytes(StandardCharsets.UTF_8); + Memory bufferFileName = new Memory(bytesFileName.length + 1); + bufferFileName.write(0, bytesFileName, 0, bytesFileName.length); + bufferFileName.setByte(bytesFileName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_readfromfile.invokeInt(new java.lang.Object[]{mHandle, bufferFileName})); + } + + /** + * Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. + * + * @param theReadCallback Callback to call for reading a data chunk + * @param streamSize number of bytes the callback returns + * @param theSeekCallback Callback to call for seeking in the stream. + * @param userData Userdata that is passed to the callback function + * @throws Lib3MFException + */ + public void readFromCallback(Lib3MFWrapper.ReadCallback theReadCallback, long streamSize, Lib3MFWrapper.SeekCallback theSeekCallback, Pointer userData) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_attachment_readfromcallback.invokeInt(new java.lang.Object[]{mHandle, theReadCallback, streamSize, theSeekCallback, userData})); + } + + /** + * Retrieves the size of the attachment stream + * + * @return the stream size + * @throws Lib3MFException + */ + public long getStreamSize() throws Lib3MFException { + Pointer bufferStreamSize = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_getstreamsize.invokeInt(new java.lang.Object[]{mHandle, bufferStreamSize})); + return bufferStreamSize.getLong(0); + } + + /** + * Writes out the attachment into a buffer + * + * @return Buffer to write into + * @throws Lib3MFException + */ + public byte[] writeToBuffer() throws Lib3MFException { + Pointer countNeededBuffer = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_writetobuffer.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededBuffer, Pointer.NULL})); + long countBuffer = countNeededBuffer.getLong(0); + Pointer bufferBuffer = new Memory(Math.max(1, 1 * countBuffer)); + mWrapper.checkError(this, mWrapper.lib3mf_attachment_writetobuffer.invokeInt(new java.lang.Object[]{mHandle, countBuffer, countNeededBuffer, bufferBuffer})); + return bufferBuffer.getByteArray(0, (int)countBuffer); + } + + /** + * Reads an attachment from a memory buffer. This buffer is immediately read (in contrast to the ReadFromCallback and ReadFromFile-methods). + * + * @param buffer Buffer to read from + * @throws Lib3MFException + */ + public void readFromBuffer(byte[] buffer) throws Lib3MFException { + Pointer bufferBuffer = new Memory(Math.max(1, 1 * buffer.length)); + for (int i = 0; i < buffer.length; i++) { + bufferBuffer.setByte(1 * i, buffer[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_attachment_readfrombuffer.invokeInt(new java.lang.Object[]{mHandle, (long) buffer.length, bufferBuffer})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Ball.java b/Autogenerated/Bindings/Java9/lib3mf/Ball.java new file mode 100644 index 000000000..3862d162f --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Ball.java @@ -0,0 +1,63 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Ball { + + public int Index; + + public double Radius; + + public static final int SIZE = 12; + + public void readFromPointer(Pointer p, long offset) { + Index = p.getInt(offset + 0); + Radius = p.getDouble(offset + 4); + } + + public void writeToPointer(Pointer p, long offset) { + p.setInt(offset + 0, Index); + p.setDouble(offset + 4, Radius); + } + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Base.java b/Autogenerated/Bindings/Java9/lib3mf/Base.java new file mode 100644 index 000000000..6522a1367 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Base.java @@ -0,0 +1,101 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Base { + + protected static final Cleaner mCleaner = Cleaner.create(); + + protected Pointer mHandle; + + protected Lib3MFWrapper mWrapper; + + public Base(Lib3MFWrapper wrapper, Pointer handle) { + mHandle = handle; + mWrapper = wrapper; + mCleaner.register(this, new InstanceReleaser(this)); + } + + public Pointer getHandle() { + return mHandle; + } + + protected static class InstanceReleaser implements Runnable{ + + protected Pointer mHandle; + + protected Lib3MFWrapper mWrapper; + + protected InstanceReleaser(Base instance) { + mHandle = instance.mHandle; + mWrapper = instance.mWrapper; + } + + @Override + public void run() { + try { + mWrapper.checkError(null, mWrapper.lib3mf_release.invokeInt(new java.lang.Object[]{mHandle})); + } catch (Lib3MFException e) { + e.printStackTrace(); + } + } + } + /** + * Get Class Type Id + * + * @return Class type as a 64 bits integer + * @throws Lib3MFException + */ + public long classTypeId() throws Lib3MFException { + Pointer bufferClassTypeId = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_base_classtypeid.invokeInt(new java.lang.Object[]{mHandle, bufferClassTypeId})); + return bufferClassTypeId.getLong(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/BaseMaterialGroup.java b/Autogenerated/Bindings/Java9/lib3mf/BaseMaterialGroup.java new file mode 100644 index 000000000..83132fa0f --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/BaseMaterialGroup.java @@ -0,0 +1,173 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BaseMaterialGroup extends Resource { + + public BaseMaterialGroup(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the count of base materials in the material group. + * + * @return returns the count of base materials. + * @throws Lib3MFException + */ + public int getCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_getcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * returns all the PropertyIDs of all materials in this group + * + * @return PropertyID of the material in the material group. + * @throws Lib3MFException + */ + public int[] getAllPropertyIDs() throws Lib3MFException { + Pointer countNeededPropertyIDs = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededPropertyIDs, Pointer.NULL})); + long countPropertyIDs = countNeededPropertyIDs.getLong(0); + Pointer bufferPropertyIDs = new Memory(Math.max(1, 4 * countPropertyIDs)); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, countPropertyIDs, countNeededPropertyIDs, bufferPropertyIDs})); + return bufferPropertyIDs.getIntArray(0, (int)countPropertyIDs); + } + + /** + * Adds a new material to the material group + * + * @param name new name of the base material. + * @param displayColor Display color of the material + * @return returns new PropertyID of the new material in the material group. + * @throws Lib3MFException + */ + public int addMaterial(String name, Color displayColor) throws Lib3MFException { + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + Pointer bufferDisplayColor = new Memory(Color.SIZE); + displayColor.writeToPointer(bufferDisplayColor, 0); + Pointer bufferPropertyID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_addmaterial.invokeInt(new java.lang.Object[]{mHandle, bufferName, bufferDisplayColor, bufferPropertyID})); + return bufferPropertyID.getInt(0); + } + + /** + * Removes a material from the material group. + * + * @param propertyID PropertyID of the material in the material group. + * @throws Lib3MFException + */ + public void removeMaterial(int propertyID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_removematerial.invokeInt(new java.lang.Object[]{mHandle, propertyID})); + } + + /** + * Returns the base material's name + * + * @param propertyID PropertyID of the material in the material group. + * @return returns the name of the base material. + * @throws Lib3MFException + */ + public String getName(int propertyID) throws Lib3MFException { + Pointer bytesNeededName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_getname.invokeInt(new java.lang.Object[]{mHandle, propertyID, 0, bytesNeededName, null})); + int sizeName = bytesNeededName.getInt(0); + Pointer bufferName = new Memory(sizeName); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_getname.invokeInt(new java.lang.Object[]{mHandle, propertyID, sizeName, bytesNeededName, bufferName})); + return new String(bufferName.getByteArray(0, sizeName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets a base material's name + * + * @param propertyID PropertyID of the material in the material group. + * @param name new name of the base material. + * @throws Lib3MFException + */ + public void setName(int propertyID, String name) throws Lib3MFException { + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_setname.invokeInt(new java.lang.Object[]{mHandle, propertyID, bufferName})); + } + + /** + * Sets a base material's display color. + * + * @param propertyID PropertyID of the material in the material group. + * @param theColor The base material's display color + * @throws Lib3MFException + */ + public void setDisplayColor(int propertyID, Color theColor) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + theColor.writeToPointer(bufferTheColor, 0); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_setdisplaycolor.invokeInt(new java.lang.Object[]{mHandle, propertyID, bufferTheColor})); + } + + /** + * Returns a base material's display color. + * + * @param propertyID PropertyID of the material in the material group. + * @return The base material's display color + * @throws Lib3MFException + */ + public Color getDisplayColor(int propertyID) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroup_getdisplaycolor.invokeInt(new java.lang.Object[]{mHandle, propertyID, bufferTheColor})); + Color theColor = new Color(); + theColor.readFromPointer(bufferTheColor, 0); + return theColor; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/BaseMaterialGroupIterator.java b/Autogenerated/Bindings/Java9/lib3mf/BaseMaterialGroupIterator.java new file mode 100644 index 000000000..08bf85e52 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/BaseMaterialGroupIterator.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BaseMaterialGroupIterator extends ResourceIterator { + + public BaseMaterialGroupIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the MaterialGroup the iterator points at. + * + * @return returns the BaseMaterialGroup instance. + * @throws Lib3MFException + */ + public BaseMaterialGroup getCurrentBaseMaterialGroup() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + BaseMaterialGroup resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, BaseMaterialGroup.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Beam.java b/Autogenerated/Bindings/Java9/lib3mf/Beam.java new file mode 100644 index 000000000..21817705d --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Beam.java @@ -0,0 +1,73 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Beam { + + public int[] Indices = new int[2]; + + public double[] Radii = new double[2]; + + public int[] CapModes = new int[2]; + + public static final int SIZE = 32; + + public void readFromPointer(Pointer p, long offset) { + Indices[0] = p.getInt(offset + 0); + Indices[1] = p.getInt(offset + 4); + Radii[0] = p.getDouble(offset + 8); + Radii[1] = p.getDouble(offset + 16); + CapModes[0] = p.getInt(offset + 24); + CapModes[1] = p.getInt(offset + 28); + } + + public void writeToPointer(Pointer p, long offset) { + p.setInt(offset + 0, Indices[0]); + p.setInt(offset + 4, Indices[1]); + p.setDouble(offset + 8, Radii[0]); + p.setDouble(offset + 16, Radii[1]); + p.setInt(offset + 24, CapModes[0]); + p.setInt(offset + 28, CapModes[1]); + } + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/BeamLattice.java b/Autogenerated/Bindings/Java9/lib3mf/BeamLattice.java new file mode 100644 index 000000000..cd6fc3624 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/BeamLattice.java @@ -0,0 +1,422 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BeamLattice extends Base { + + public BeamLattice(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the minimal length of beams for the beamlattice. + * + * @return minimal length of beams for the beamlattice + * @throws Lib3MFException + */ + public double getMinLength() throws Lib3MFException { + Pointer bufferMinLength = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getminlength.invokeInt(new java.lang.Object[]{mHandle, bufferMinLength})); + return bufferMinLength.getDouble(0); + } + + /** + * Sets the minimal length of beams for the beamlattice. + * + * @param minLength minimal length of beams for the beamlattice + * @throws Lib3MFException + */ + public void setMinLength(double minLength) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_setminlength.invokeInt(new java.lang.Object[]{mHandle, minLength})); + } + + /** + * Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. + * + * @return GetClipping Result Tuple + * @throws Lib3MFException + */ + public GetClippingResult getClipping() throws Lib3MFException { + Pointer bufferClipMode = new Memory(4); + Pointer bufferUniqueResourceID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getclipping.invokeInt(new java.lang.Object[]{mHandle, bufferClipMode, bufferUniqueResourceID})); + GetClippingResult returnTuple = new GetClippingResult(); + returnTuple.ClipMode = Lib3MFWrapper.EnumConversion.convertConstToBeamLatticeClipMode(bufferClipMode.getInt(0)); + returnTuple.UniqueResourceID = bufferUniqueResourceID.getInt(0); + return returnTuple; + } + + public static class GetClippingResult { + /** + * contains the clip mode of this mesh + */ + public Lib3MFWrapper.BeamLatticeClipMode ClipMode; + + /** + * filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE + */ + public int UniqueResourceID; + + } + /** + * Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. + * + * @param clipMode contains the clip mode of this mesh + * @param uniqueResourceID the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. + * @throws Lib3MFException + */ + public void setClipping(Lib3MFWrapper.BeamLatticeClipMode clipMode, int uniqueResourceID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_setclipping.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertBeamLatticeClipModeToConst(clipMode), uniqueResourceID})); + } + + /** + * Returns the representation-mesh for the beamlattice of this mesh. + * + * @return GetRepresentation Result Tuple + * @throws Lib3MFException + */ + public GetRepresentationResult getRepresentation() throws Lib3MFException { + Pointer bufferHasRepresentation = new Memory(1); + Pointer bufferUniqueResourceID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getrepresentation.invokeInt(new java.lang.Object[]{mHandle, bufferHasRepresentation, bufferUniqueResourceID})); + GetRepresentationResult returnTuple = new GetRepresentationResult(); + returnTuple.HasRepresentation = bufferHasRepresentation.getByte(0) != 0; + returnTuple.UniqueResourceID = bufferUniqueResourceID.getInt(0); + return returnTuple; + } + + public static class GetRepresentationResult { + /** + * flag whether the beamlattice has a representation mesh. + */ + public boolean HasRepresentation; + + /** + * filled with the UniqueResourceID of the clipping mesh-object. + */ + public int UniqueResourceID; + + } + /** + * Sets the representation-mesh for the beamlattice of this mesh. + * + * @param uniqueResourceID the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. + * @throws Lib3MFException + */ + public void setRepresentation(int uniqueResourceID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_setrepresentation.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID})); + } + + /** + * Returns the ball mode and the default ball radius for the beamlattice of this mesh. + * + * @return GetBallOptions Result Tuple + * @throws Lib3MFException + */ + public GetBallOptionsResult getBallOptions() throws Lib3MFException { + Pointer bufferBallMode = new Memory(4); + Pointer bufferBallRadius = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getballoptions.invokeInt(new java.lang.Object[]{mHandle, bufferBallMode, bufferBallRadius})); + GetBallOptionsResult returnTuple = new GetBallOptionsResult(); + returnTuple.BallMode = Lib3MFWrapper.EnumConversion.convertConstToBeamLatticeBallMode(bufferBallMode.getInt(0)); + returnTuple.BallRadius = bufferBallRadius.getDouble(0); + return returnTuple; + } + + public static class GetBallOptionsResult { + /** + * contains the ball mode of this mesh + */ + public Lib3MFWrapper.BeamLatticeBallMode BallMode; + + /** + * default ball radius of balls for the beamlattice + */ + public double BallRadius; + + } + /** + * Sets the ball mode and thedefault ball radius for the beamlattice. + * + * @param ballMode contains the ball mode of this mesh + * @param ballRadius default ball radius of balls for the beamlattice + * @throws Lib3MFException + */ + public void setBallOptions(Lib3MFWrapper.BeamLatticeBallMode ballMode, double ballRadius) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_setballoptions.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertBeamLatticeBallModeToConst(ballMode), ballRadius})); + } + + /** + * Returns the beam count of a mesh object. + * + * @return filled with the beam count. + * @throws Lib3MFException + */ + public int getBeamCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getbeamcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Returns indices, radii and capmodes of a single beam of a mesh object. + * + * @param index Index of the beam (0 to beamcount - 1). + * @return filled with the beam indices, radii and capmodes. + * @throws Lib3MFException + */ + public Beam getBeam(int index) throws Lib3MFException { + Pointer bufferBeamInfo = new Memory(Beam.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getbeam.invokeInt(new java.lang.Object[]{mHandle, index, bufferBeamInfo})); + Beam beamInfo = new Beam(); + beamInfo.readFromPointer(bufferBeamInfo, 0); + return beamInfo; + } + + /** + * Adds a single beam to a mesh object. + * + * @param beamInfo contains the node indices, radii and capmodes. + * @return filled with the new Index of the beam. + * @throws Lib3MFException + */ + public int addBeam(Beam beamInfo) throws Lib3MFException { + Pointer bufferBeamInfo = new Memory(Beam.SIZE); + beamInfo.writeToPointer(bufferBeamInfo, 0); + Pointer bufferIndex = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_addbeam.invokeInt(new java.lang.Object[]{mHandle, bufferBeamInfo, bufferIndex})); + return bufferIndex.getInt(0); + } + + /** + * Sets the indices, radii and capmodes of a single beam of a mesh object. + * + * @param index Index of the beam (0 to beamcount - 1). + * @param beamInfo filled with the beam indices, radii and capmodes. + * @throws Lib3MFException + */ + public void setBeam(int index, Beam beamInfo) throws Lib3MFException { + Pointer bufferBeamInfo = new Memory(Beam.SIZE); + beamInfo.writeToPointer(bufferBeamInfo, 0); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_setbeam.invokeInt(new java.lang.Object[]{mHandle, index, bufferBeamInfo})); + } + + /** + * Sets all beam indices, radii and capmodes of a mesh object. + * + * @param beamInfo contains information of a number of beams + * @throws Lib3MFException + */ + public void setBeams(Beam[] beamInfo) throws Lib3MFException { + Pointer bufferBeamInfo = new Memory(Math.max(1, Beam.SIZE * beamInfo.length)); + for (int i = 0; i < beamInfo.length; i++) { + beamInfo[i].writeToPointer(bufferBeamInfo, i * Beam.SIZE); + } + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_setbeams.invokeInt(new java.lang.Object[]{mHandle, (long) beamInfo.length, bufferBeamInfo})); + } + + /** + * obtains all beam indices, radii and capmodes of a mesh object. + * + * @return contains information of all beams + * @throws Lib3MFException + */ + public Beam[] getBeams() throws Lib3MFException { + Pointer countNeededBeamInfo = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getbeams.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededBeamInfo, null})); + long countBeamInfo = countNeededBeamInfo.getLong(0); + Pointer bufferBeamInfo = new Memory(Math.max(1, countBeamInfo * Beam.SIZE)); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getbeams.invokeInt(new java.lang.Object[]{mHandle, countBeamInfo, countNeededBeamInfo, bufferBeamInfo})); + Beam beamInfo[] = new Beam[(int)countBeamInfo]; + for (int i = 0; i < (int)countBeamInfo; i++) { + beamInfo[i] = new Beam(); + beamInfo[i].readFromPointer(bufferBeamInfo, i * Beam.SIZE); + } + return beamInfo; + } + + /** + * Returns the ball count of a mesh object. + * + * @return filled with the ball count. + * @throws Lib3MFException + */ + public int getBallCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getballcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Returns index and radius of a single ball of a mesh object. + * + * @param index Index of the ball (0 to ballcount - 1). + * @return filled with the ball node index and radius. + * @throws Lib3MFException + */ + public Ball getBall(int index) throws Lib3MFException { + Pointer bufferBallInfo = new Memory(Ball.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getball.invokeInt(new java.lang.Object[]{mHandle, index, bufferBallInfo})); + Ball ballInfo = new Ball(); + ballInfo.readFromPointer(bufferBallInfo, 0); + return ballInfo; + } + + /** + * Adds a single ball to a mesh object. + * + * @param ballInfo contains the node index and radius. + * @return filled with the new Index of the ball. + * @throws Lib3MFException + */ + public int addBall(Ball ballInfo) throws Lib3MFException { + Pointer bufferBallInfo = new Memory(Ball.SIZE); + ballInfo.writeToPointer(bufferBallInfo, 0); + Pointer bufferIndex = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_addball.invokeInt(new java.lang.Object[]{mHandle, bufferBallInfo, bufferIndex})); + return bufferIndex.getInt(0); + } + + /** + * Sets the index and radius of a single ball of a mesh object. + * + * @param index Index of the ball (0 to ballcount - 1). + * @param ballInfo filled with the ball node index and radius. + * @throws Lib3MFException + */ + public void setBall(int index, Ball ballInfo) throws Lib3MFException { + Pointer bufferBallInfo = new Memory(Ball.SIZE); + ballInfo.writeToPointer(bufferBallInfo, 0); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_setball.invokeInt(new java.lang.Object[]{mHandle, index, bufferBallInfo})); + } + + /** + * Sets all ball indices and radii of a mesh object. + * + * @param ballInfo contains information of a number of balls + * @throws Lib3MFException + */ + public void setBalls(Ball[] ballInfo) throws Lib3MFException { + Pointer bufferBallInfo = new Memory(Math.max(1, Ball.SIZE * ballInfo.length)); + for (int i = 0; i < ballInfo.length; i++) { + ballInfo[i].writeToPointer(bufferBallInfo, i * Ball.SIZE); + } + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_setballs.invokeInt(new java.lang.Object[]{mHandle, (long) ballInfo.length, bufferBallInfo})); + } + + /** + * obtains all ball indices and radii of a mesh object. + * + * @return contains information of all balls + * @throws Lib3MFException + */ + public Ball[] getBalls() throws Lib3MFException { + Pointer countNeededBallInfo = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getballs.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededBallInfo, null})); + long countBallInfo = countNeededBallInfo.getLong(0); + Pointer bufferBallInfo = new Memory(Math.max(1, countBallInfo * Ball.SIZE)); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getballs.invokeInt(new java.lang.Object[]{mHandle, countBallInfo, countNeededBallInfo, bufferBallInfo})); + Ball ballInfo[] = new Ball[(int)countBallInfo]; + for (int i = 0; i < (int)countBallInfo; i++) { + ballInfo[i] = new Ball(); + ballInfo[i].readFromPointer(bufferBallInfo, i * Ball.SIZE); + } + return ballInfo; + } + + /** + * Returns the number of beamsets of a mesh object. + * + * @return filled with the beamset count. + * @throws Lib3MFException + */ + public int getBeamSetCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getbeamsetcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Adds an empty beamset to a mesh object + * + * @return the new beamset + * @throws Lib3MFException + */ + public BeamSet addBeamSet() throws Lib3MFException { + Pointer bufferBeamSet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_addbeamset.invokeInt(new java.lang.Object[]{mHandle, bufferBeamSet})); + Pointer valueBeamSet = bufferBeamSet.getPointer(0); + BeamSet beamSet = null; + if (valueBeamSet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BeamSet was a null pointer"); + } + beamSet = mWrapper.PolymorphicFactory(valueBeamSet, BeamSet.class); + return beamSet; + } + + /** + * Returns a beamset of a mesh object + * + * @param index index of the requested beamset (0 ... beamsetcount-1). + * @return the requested beamset + * @throws Lib3MFException + */ + public BeamSet getBeamSet(int index) throws Lib3MFException { + Pointer bufferBeamSet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlattice_getbeamset.invokeInt(new java.lang.Object[]{mHandle, index, bufferBeamSet})); + Pointer valueBeamSet = bufferBeamSet.getPointer(0); + BeamSet beamSet = null; + if (valueBeamSet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BeamSet was a null pointer"); + } + beamSet = mWrapper.PolymorphicFactory(valueBeamSet, BeamSet.class); + return beamSet; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/BeamLatticeNode.java b/Autogenerated/Bindings/Java9/lib3mf/BeamLatticeNode.java new file mode 100644 index 000000000..932000ef2 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/BeamLatticeNode.java @@ -0,0 +1,133 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BeamLatticeNode extends ImplicitNode { + + public BeamLatticeNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the model resource id of the beam lattice + * + * @return the input port for the model resource id of the beam lattice (mesh with beamlattice extension) + * @throws Lib3MFException + */ + public ImplicitPort getInputBeamLattice() throws Lib3MFException { + Pointer bufferBeamLattice = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlatticenode_getinputbeamlattice.invokeInt(new java.lang.Object[]{mHandle, bufferBeamLattice})); + Pointer valueBeamLattice = bufferBeamLattice.getPointer(0); + ImplicitPort beamLattice = null; + if (valueBeamLattice == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BeamLattice was a null pointer"); + } + beamLattice = mWrapper.PolymorphicFactory(valueBeamLattice, ImplicitPort.class); + return beamLattice; + } + + /** + * Retrieves the input for the position + * + * @return the input port for the position + * @throws Lib3MFException + */ + public ImplicitPort getInputPos() throws Lib3MFException { + Pointer bufferPos = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlatticenode_getinputpos.invokeInt(new java.lang.Object[]{mHandle, bufferPos})); + Pointer valuePos = bufferPos.getPointer(0); + ImplicitPort pos = null; + if (valuePos == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Pos was a null pointer"); + } + pos = mWrapper.PolymorphicFactory(valuePos, ImplicitPort.class); + return pos; + } + + /** + * Retrieves the output + * + * @return the output port for the signed distance to the beam lattice + * @throws Lib3MFException + */ + public ImplicitPort getOutputDistance() throws Lib3MFException { + Pointer bufferDistance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlatticenode_getoutputdistance.invokeInt(new java.lang.Object[]{mHandle, bufferDistance})); + Pointer valueDistance = bufferDistance.getPointer(0); + ImplicitPort distance = null; + if (valueDistance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Distance was a null pointer"); + } + distance = mWrapper.PolymorphicFactory(valueDistance, ImplicitPort.class); + return distance; + } + + /** + * Sets the accurate range for distance computation + * + * @param accurateRange the accurate range in model units + * @throws Lib3MFException + */ + public void setAccurateRange(double accurateRange) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_beamlatticenode_setaccuraterange.invokeInt(new java.lang.Object[]{mHandle, accurateRange})); + } + + /** + * Retrieves the accurate range for distance computation + * + * @return the accurate range in model units + * @throws Lib3MFException + */ + public double getAccurateRange() throws Lib3MFException { + Pointer bufferAccurateRange = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamlatticenode_getaccuraterange.invokeInt(new java.lang.Object[]{mHandle, bufferAccurateRange})); + return bufferAccurateRange.getDouble(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/BeamSet.java b/Autogenerated/Bindings/Java9/lib3mf/BeamSet.java new file mode 100644 index 000000000..b7214786b --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/BeamSet.java @@ -0,0 +1,197 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BeamSet extends Base { + + public BeamSet(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Sets a beamset's name string + * + * @param name new name of the beamset. + * @throws Lib3MFException + */ + public void setName(String name) throws Lib3MFException { + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_setname.invokeInt(new java.lang.Object[]{mHandle, bufferName})); + } + + /** + * Retrieves a beamset's name string + * + * @return returns the name of the beamset. + * @throws Lib3MFException + */ + public String getName() throws Lib3MFException { + Pointer bytesNeededName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededName, null})); + int sizeName = bytesNeededName.getInt(0); + Pointer bufferName = new Memory(sizeName); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getname.invokeInt(new java.lang.Object[]{mHandle, sizeName, bytesNeededName, bufferName})); + return new String(bufferName.getByteArray(0, sizeName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets a beamset's identifier string + * + * @param identifier new name of the beamset. + * @throws Lib3MFException + */ + public void setIdentifier(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_setidentifier.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier})); + } + + /** + * Retrieves a beamset's identifier string + * + * @return returns the identifier of the beamset. + * @throws Lib3MFException + */ + public String getIdentifier() throws Lib3MFException { + Pointer bytesNeededIdentifier = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getidentifier.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededIdentifier, null})); + int sizeIdentifier = bytesNeededIdentifier.getInt(0); + Pointer bufferIdentifier = new Memory(sizeIdentifier); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getidentifier.invokeInt(new java.lang.Object[]{mHandle, sizeIdentifier, bytesNeededIdentifier, bufferIdentifier})); + return new String(bufferIdentifier.getByteArray(0, sizeIdentifier - 1), StandardCharsets.UTF_8); + } + + /** + * Retrieves the reference count of a beamset + * + * @return returns the reference count + * @throws Lib3MFException + */ + public int getReferenceCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getreferencecount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Sets the references of a beamset + * + * @param references the new indices of all beams in this beamset + * @throws Lib3MFException + */ + public void setReferences(int[] references) throws Lib3MFException { + Pointer bufferReferences = new Memory(Math.max(1, 4 * references.length)); + for (int i = 0; i < references.length; i++) { + bufferReferences.setInt(4 * i, references[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_beamset_setreferences.invokeInt(new java.lang.Object[]{mHandle, (long) references.length, bufferReferences})); + } + + /** + * Retrieves the references of a beamset + * + * @return retrieves the indices of all beams in this beamset + * @throws Lib3MFException + */ + public int[] getReferences() throws Lib3MFException { + Pointer countNeededReferences = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getreferences.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededReferences, Pointer.NULL})); + long countReferences = countNeededReferences.getLong(0); + Pointer bufferReferences = new Memory(Math.max(1, 4 * countReferences)); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getreferences.invokeInt(new java.lang.Object[]{mHandle, countReferences, countNeededReferences, bufferReferences})); + return bufferReferences.getIntArray(0, (int)countReferences); + } + + /** + * Retrieves the ball reference count of a beamset + * + * @return returns the ball reference count + * @throws Lib3MFException + */ + public int getBallReferenceCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getballreferencecount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Sets the ball references of a beamset + * + * @param ballReferences the new indices of all balls in this beamset + * @throws Lib3MFException + */ + public void setBallReferences(int[] ballReferences) throws Lib3MFException { + Pointer bufferBallReferences = new Memory(Math.max(1, 4 * ballReferences.length)); + for (int i = 0; i < ballReferences.length; i++) { + bufferBallReferences.setInt(4 * i, ballReferences[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_beamset_setballreferences.invokeInt(new java.lang.Object[]{mHandle, (long) ballReferences.length, bufferBallReferences})); + } + + /** + * Retrieves the ball references of a beamset + * + * @return retrieves the indices of all balls in this beamset + * @throws Lib3MFException + */ + public int[] getBallReferences() throws Lib3MFException { + Pointer countNeededBallReferences = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getballreferences.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededBallReferences, Pointer.NULL})); + long countBallReferences = countNeededBallReferences.getLong(0); + Pointer bufferBallReferences = new Memory(Math.max(1, 4 * countBallReferences)); + mWrapper.checkError(this, mWrapper.lib3mf_beamset_getballreferences.invokeInt(new java.lang.Object[]{mHandle, countBallReferences, countNeededBallReferences, bufferBallReferences})); + return bufferBallReferences.getIntArray(0, (int)countBallReferences); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/BooleanObject.java b/Autogenerated/Bindings/Java9/lib3mf/BooleanObject.java new file mode 100644 index 000000000..cea50871e --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/BooleanObject.java @@ -0,0 +1,272 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BooleanObject extends Object { + + public BooleanObject(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Sets the base object and transform for the boolean shape. + * + * @param baseObject base object of the boolean shape + * @param transform transform applied to the base object + * @throws Lib3MFException + */ + public void setBaseObject(Object baseObject, Transform transform) throws Lib3MFException { + Pointer baseObjectHandle = null; + if (baseObject != null) { + baseObjectHandle = baseObject.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BaseObject is a null value."); + } + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_setbaseobject.invokeInt(new java.lang.Object[]{mHandle, baseObjectHandle, bufferTransform})); + } + + /** + * Returns the base object of the boolean shape. + * + * @return base object of the boolean shape + * @throws Lib3MFException + */ + public Object getBaseObject() throws Lib3MFException { + Pointer bufferBaseObject = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_getbaseobject.invokeInt(new java.lang.Object[]{mHandle, bufferBaseObject})); + Pointer valueBaseObject = bufferBaseObject.getPointer(0); + Object baseObject = null; + if (valueBaseObject == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BaseObject was a null pointer"); + } + baseObject = mWrapper.PolymorphicFactory(valueBaseObject, Object.class); + return baseObject; + } + + /** + * Sets the base transform of the boolean shape. + * + * @param transform transform applied to the base object + * @throws Lib3MFException + */ + public void setBaseTransform(Transform transform) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_setbasetransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + } + + /** + * Returns the base transform of the boolean shape. + * + * @return transform applied to the base object + * @throws Lib3MFException + */ + public Transform getBaseTransform() throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_getbasetransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * Sets the boolean operation used for the boolean shape. + * + * @param operation boolean operation used for the shape + * @throws Lib3MFException + */ + public void setOperation(Lib3MFWrapper.BooleanOperation operation) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_setoperation.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertBooleanOperationToConst(operation)})); + } + + /** + * Returns the boolean operation used for the boolean shape. + * + * @return boolean operation used for the shape + * @throws Lib3MFException + */ + public Lib3MFWrapper.BooleanOperation getOperation() throws Lib3MFException { + Pointer bufferOperation = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_getoperation.invokeInt(new java.lang.Object[]{mHandle, bufferOperation})); + return Lib3MFWrapper.EnumConversion.convertConstToBooleanOperation(bufferOperation.getInt(0)); + } + + /** + * Enables or disables CSG field evaluation for boolean-to-mesh materialization. + * + * @param cSGModeEnabled if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback + * @throws Lib3MFException + */ + public void setCSGModeEnabled(boolean cSGModeEnabled) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_setcsgmodeenabled.invokeInt(new java.lang.Object[]{mHandle, cSGModeEnabled})); + } + + /** + * Returns whether CSG field evaluation is enabled for boolean-to-mesh materialization. + * + * @return if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback + * @throws Lib3MFException + */ + public boolean getCSGModeEnabled() throws Lib3MFException { + Pointer bufferCSGModeEnabled = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_getcsgmodeenabled.invokeInt(new java.lang.Object[]{mHandle, bufferCSGModeEnabled})); + return bufferCSGModeEnabled.getByte(0) != 0; + } + + /** + * Sets the extraction grid resolution used for boolean-to-mesh materialization. + * + * @param gridResolution extraction grid resolution for boolean surface extraction + * @throws Lib3MFException + */ + public void setExtractionGridResolution(int gridResolution) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_setextractiongridresolution.invokeInt(new java.lang.Object[]{mHandle, gridResolution})); + } + + /** + * Returns the extraction grid resolution used for boolean-to-mesh materialization. + * + * @return extraction grid resolution for boolean surface extraction + * @throws Lib3MFException + */ + public int getExtractionGridResolution() throws Lib3MFException { + Pointer bufferGridResolution = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_getextractiongridresolution.invokeInt(new java.lang.Object[]{mHandle, bufferGridResolution})); + return bufferGridResolution.getInt(0); + } + + /** + * Returns the number of operands in the boolean sequence. + * + * @return number of operands in the boolean sequence + * @throws Lib3MFException + */ + public int getOperandCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_getoperandcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Adds an operand object to the boolean sequence. + * + * @param operandObject mesh object used as operand + * @param transform transform applied to the operand object + * @throws Lib3MFException + */ + public void addOperand(MeshObject operandObject, Transform transform) throws Lib3MFException { + Pointer operandObjectHandle = null; + if (operandObject != null) { + operandObjectHandle = operandObject.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "OperandObject is a null value."); + } + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_addoperand.invokeInt(new java.lang.Object[]{mHandle, operandObjectHandle, bufferTransform})); + } + + /** + * Returns one operand object and transform from the boolean sequence. + * + * @param index index of the operand in the boolean sequence + * @return GetOperand Result Tuple + * @throws Lib3MFException + */ + public GetOperandResult getOperand(int index) throws Lib3MFException { + Pointer bufferOperandObject = new Memory(8); + Pointer bufferTransform = new Memory(Transform.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_getoperand.invokeInt(new java.lang.Object[]{mHandle, index, bufferOperandObject, bufferTransform})); + Pointer valueOperandObject = bufferOperandObject.getPointer(0); + MeshObject operandObject = null; + if (valueOperandObject == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "OperandObject was a null pointer"); + } + operandObject = mWrapper.PolymorphicFactory(valueOperandObject, MeshObject.class); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + GetOperandResult returnTuple = new GetOperandResult(); + returnTuple.OperandObject = operandObject; + returnTuple.Transform = transform; + return returnTuple; + } + + public static class GetOperandResult { + /** + * mesh object used as operand + */ + public MeshObject OperandObject; + + /** + * transform applied to the operand object + */ + public Transform Transform; + + } + /** + * Materializes the boolean shape into a newly created mesh object. + * + * @return new mesh object containing the tessellated boolean shape + * @throws Lib3MFException + */ + public MeshObject mergeToMeshObject() throws Lib3MFException { + Pointer bufferMeshObject = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_mergetomeshobject.invokeInt(new java.lang.Object[]{mHandle, bufferMeshObject})); + Pointer valueMeshObject = bufferMeshObject.getPointer(0); + MeshObject meshObject = null; + if (valueMeshObject == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MeshObject was a null pointer"); + } + meshObject = mWrapper.PolymorphicFactory(valueMeshObject, MeshObject.class); + return meshObject; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/BooleanObjectIterator.java b/Autogenerated/Bindings/Java9/lib3mf/BooleanObjectIterator.java new file mode 100644 index 000000000..ce880a8c2 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/BooleanObjectIterator.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BooleanObjectIterator extends ResourceIterator { + + public BooleanObjectIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the BooleanObject the iterator points at. + * + * @return returns the BooleanObject instance. + * @throws Lib3MFException + */ + public BooleanObject getCurrentBooleanObject() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_booleanobjectiterator_getcurrentbooleanobject.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + BooleanObject resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, BooleanObject.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Box.java b/Autogenerated/Bindings/Java9/lib3mf/Box.java new file mode 100644 index 000000000..e07728552 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Box.java @@ -0,0 +1,71 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Box { + + public float[] MinCoordinate = new float[3]; + + public float[] MaxCoordinate = new float[3]; + + public static final int SIZE = 24; + + public void readFromPointer(Pointer p, long offset) { + MinCoordinate[0] = p.getFloat(offset + 0); + MinCoordinate[1] = p.getFloat(offset + 4); + MinCoordinate[2] = p.getFloat(offset + 8); + MaxCoordinate[0] = p.getFloat(offset + 12); + MaxCoordinate[1] = p.getFloat(offset + 16); + MaxCoordinate[2] = p.getFloat(offset + 20); + } + + public void writeToPointer(Pointer p, long offset) { + p.setFloat(offset + 0, MinCoordinate[0]); + p.setFloat(offset + 4, MinCoordinate[1]); + p.setFloat(offset + 8, MinCoordinate[2]); + p.setFloat(offset + 12, MaxCoordinate[0]); + p.setFloat(offset + 16, MaxCoordinate[1]); + p.setFloat(offset + 20, MaxCoordinate[2]); + } + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/BuildItem.java b/Autogenerated/Bindings/Java9/lib3mf/BuildItem.java new file mode 100644 index 000000000..6f0394b6a --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/BuildItem.java @@ -0,0 +1,231 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BuildItem extends Base { + + public BuildItem(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the object resource associated to a build item + * + * @return returns the associated resource instance + * @throws Lib3MFException + */ + public Object getObjectResource() throws Lib3MFException { + Pointer bufferObjectResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getobjectresource.invokeInt(new java.lang.Object[]{mHandle, bufferObjectResource})); + Pointer valueObjectResource = bufferObjectResource.getPointer(0); + Object objectResource = null; + if (valueObjectResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ObjectResource was a null pointer"); + } + objectResource = mWrapper.PolymorphicFactory(valueObjectResource, Object.class); + return objectResource; + } + + /** + * returns, whether a build item has a UUID and, if true, the build item's UUID + * + * @return GetUUID Result Tuple + * @throws Lib3MFException + */ + public GetUUIDResult getUUID() throws Lib3MFException { + Pointer bufferHasUUID = new Memory(1); + Pointer bytesNeededUUID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getuuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, 0, bytesNeededUUID, null})); + int sizeUUID = bytesNeededUUID.getInt(0); + Pointer bufferUUID = new Memory(sizeUUID); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getuuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, sizeUUID, bytesNeededUUID, bufferUUID})); + GetUUIDResult returnTuple = new GetUUIDResult(); + returnTuple.HasUUID = bufferHasUUID.getByte(0) != 0; + returnTuple.UUID = new String(bufferUUID.getByteArray(0, sizeUUID - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetUUIDResult { + /** + * flag whether the build item has a UUID + */ + public boolean HasUUID; + + /** + * the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + */ + public String UUID; + + } + /** + * sets the build item's UUID + * + * @param uUID the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * @throws Lib3MFException + */ + public void setUUID(String uUID) throws Lib3MFException { + byte[] bytesUUID = uUID.getBytes(StandardCharsets.UTF_8); + Memory bufferUUID = new Memory(bytesUUID.length + 1); + bufferUUID.write(0, bytesUUID, 0, bytesUUID.length); + bufferUUID.setByte(bytesUUID.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_setuuid.invokeInt(new java.lang.Object[]{mHandle, bufferUUID})); + } + + /** + * Retrieves the object UniqueResourceID associated to a build item + * + * @return returns the UniqueResourceID of the object + * @throws Lib3MFException + */ + public int getObjectResourceID() throws Lib3MFException { + Pointer bufferUniqueResourceID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getobjectresourceid.invokeInt(new java.lang.Object[]{mHandle, bufferUniqueResourceID})); + return bufferUniqueResourceID.getInt(0); + } + + /** + * Checks, if a build item has a non-identity transformation matrix + * + * @return returns true, if the transformation matrix is not the identity + * @throws Lib3MFException + */ + public boolean hasObjectTransform() throws Lib3MFException { + Pointer bufferHasTransform = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_hasobjecttransform.invokeInt(new java.lang.Object[]{mHandle, bufferHasTransform})); + return bufferHasTransform.getByte(0) != 0; + } + + /** + * Retrieves a build item's transformation matrix. + * + * @return returns the transformation matrix + * @throws Lib3MFException + */ + public Transform getObjectTransform() throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getobjecttransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * Sets a build item's transformation matrix. + * + * @param transform new transformation matrix + * @throws Lib3MFException + */ + public void setObjectTransform(Transform transform) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_setobjecttransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + } + + /** + * Retrieves a build item's part number string + * + * @return Returns a build item's part number string + * @throws Lib3MFException + */ + public String getPartNumber() throws Lib3MFException { + Pointer bytesNeededPartNumber = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getpartnumber.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededPartNumber, null})); + int sizePartNumber = bytesNeededPartNumber.getInt(0); + Pointer bufferPartNumber = new Memory(sizePartNumber); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getpartnumber.invokeInt(new java.lang.Object[]{mHandle, sizePartNumber, bytesNeededPartNumber, bufferPartNumber})); + return new String(bufferPartNumber.getByteArray(0, sizePartNumber - 1), StandardCharsets.UTF_8); + } + + /** + * Sets a build item's part number string + * + * @param setPartnumber new part number string for referencing parts from the outside world + * @throws Lib3MFException + */ + public void setPartNumber(String setPartnumber) throws Lib3MFException { + byte[] bytesSetPartnumber = setPartnumber.getBytes(StandardCharsets.UTF_8); + Memory bufferSetPartnumber = new Memory(bytesSetPartnumber.length + 1); + bufferSetPartnumber.write(0, bytesSetPartnumber, 0, bytesSetPartnumber.length); + bufferSetPartnumber.setByte(bytesSetPartnumber.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_setpartnumber.invokeInt(new java.lang.Object[]{mHandle, bufferSetPartnumber})); + } + + /** + * Returns the metadatagroup of this build item + * + * @return returns an Instance of the metadatagroup of this build item + * @throws Lib3MFException + */ + public MetaDataGroup getMetaDataGroup() throws Lib3MFException { + Pointer bufferMetaDataGroup = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getmetadatagroup.invokeInt(new java.lang.Object[]{mHandle, bufferMetaDataGroup})); + Pointer valueMetaDataGroup = bufferMetaDataGroup.getPointer(0); + MetaDataGroup metaDataGroup = null; + if (valueMetaDataGroup == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MetaDataGroup was a null pointer"); + } + metaDataGroup = mWrapper.PolymorphicFactory(valueMetaDataGroup, MetaDataGroup.class); + return metaDataGroup; + } + + /** + * Returns the outbox of a build item + * + * @return Outbox of this build item + * @throws Lib3MFException + */ + public Box getOutbox() throws Lib3MFException { + Pointer bufferOutbox = new Memory(Box.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_builditem_getoutbox.invokeInt(new java.lang.Object[]{mHandle, bufferOutbox})); + Box outbox = new Box(); + outbox.readFromPointer(bufferOutbox, 0); + return outbox; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/BuildItemIterator.java b/Autogenerated/Bindings/Java9/lib3mf/BuildItemIterator.java new file mode 100644 index 000000000..250abd1b4 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/BuildItemIterator.java @@ -0,0 +1,129 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class BuildItemIterator extends Base { + + public BuildItemIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Iterates to the next build item in the list. + * + * @return Iterates to the next build item in the list. + * @throws Lib3MFException + */ + public boolean moveNext() throws Lib3MFException { + Pointer bufferHasNext = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_builditemiterator_movenext.invokeInt(new java.lang.Object[]{mHandle, bufferHasNext})); + return bufferHasNext.getByte(0) != 0; + } + + /** + * Iterates to the previous build item in the list. + * + * @return Iterates to the previous build item in the list. + * @throws Lib3MFException + */ + public boolean movePrevious() throws Lib3MFException { + Pointer bufferHasPrevious = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_builditemiterator_moveprevious.invokeInt(new java.lang.Object[]{mHandle, bufferHasPrevious})); + return bufferHasPrevious.getByte(0) != 0; + } + + /** + * Returns the build item the iterator points at. + * + * @return returns the build item instance. + * @throws Lib3MFException + */ + public BuildItem getCurrent() throws Lib3MFException { + Pointer bufferBuildItem = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_builditemiterator_getcurrent.invokeInt(new java.lang.Object[]{mHandle, bufferBuildItem})); + Pointer valueBuildItem = bufferBuildItem.getPointer(0); + BuildItem buildItem = null; + if (valueBuildItem == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BuildItem was a null pointer"); + } + buildItem = mWrapper.PolymorphicFactory(valueBuildItem, BuildItem.class); + return buildItem; + } + + /** + * Creates a new build item iterator with the same build item list. + * + * @return returns the cloned Iterator instance + * @throws Lib3MFException + */ + public BuildItemIterator clone_() throws Lib3MFException { + Pointer bufferOutBuildItemIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_builditemiterator_clone.invokeInt(new java.lang.Object[]{mHandle, bufferOutBuildItemIterator})); + Pointer valueOutBuildItemIterator = bufferOutBuildItemIterator.getPointer(0); + BuildItemIterator outBuildItemIterator = null; + if (valueOutBuildItemIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "OutBuildItemIterator was a null pointer"); + } + outBuildItemIterator = mWrapper.PolymorphicFactory(valueOutBuildItemIterator, BuildItemIterator.class); + return outBuildItemIterator; + } + + /** + * Returns the number of build items the iterator captures. + * + * @return returns the number of build items the iterator captures. + * @throws Lib3MFException + */ + public long count() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_builditemiterator_count.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/CeilNode.java b/Autogenerated/Bindings/Java9/lib3mf/CeilNode.java new file mode 100644 index 000000000..fdc91a3e3 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/CeilNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class CeilNode extends OneInputNode { + + public CeilNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ClampNode.java b/Autogenerated/Bindings/Java9/lib3mf/ClampNode.java new file mode 100644 index 000000000..9798c1f40 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ClampNode.java @@ -0,0 +1,93 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ClampNode extends OneInputNode { + + public ClampNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the lower limit + * + * @return the input for the lower limit + * @throws Lib3MFException + */ + public ImplicitPort getInputMin() throws Lib3MFException { + Pointer bufferMin = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_clampnode_getinputmin.invokeInt(new java.lang.Object[]{mHandle, bufferMin})); + Pointer valueMin = bufferMin.getPointer(0); + ImplicitPort min = null; + if (valueMin == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Min was a null pointer"); + } + min = mWrapper.PolymorphicFactory(valueMin, ImplicitPort.class); + return min; + } + + /** + * Retrieves the input for the upper limit + * + * @return the input for the upper limit + * @throws Lib3MFException + */ + public ImplicitPort getInputMax() throws Lib3MFException { + Pointer bufferMax = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_clampnode_getinputmax.invokeInt(new java.lang.Object[]{mHandle, bufferMax})); + Pointer valueMax = bufferMax.getPointer(0); + ImplicitPort max = null; + if (valueMax == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Max was a null pointer"); + } + max = mWrapper.PolymorphicFactory(valueMax, ImplicitPort.class); + return max; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Color.java b/Autogenerated/Bindings/Java9/lib3mf/Color.java new file mode 100644 index 000000000..2530c2382 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Color.java @@ -0,0 +1,71 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Color { + + public byte Red; + + public byte Green; + + public byte Blue; + + public byte Alpha; + + public static final int SIZE = 4; + + public void readFromPointer(Pointer p, long offset) { + Red = p.getByte(offset + 0); + Green = p.getByte(offset + 1); + Blue = p.getByte(offset + 2); + Alpha = p.getByte(offset + 3); + } + + public void writeToPointer(Pointer p, long offset) { + p.setByte(offset + 0, Red); + p.setByte(offset + 1, Green); + p.setByte(offset + 2, Blue); + p.setByte(offset + 3, Alpha); + } + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ColorGroup.java b/Autogenerated/Bindings/Java9/lib3mf/ColorGroup.java new file mode 100644 index 000000000..118f595d6 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ColorGroup.java @@ -0,0 +1,137 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ColorGroup extends Resource { + + public ColorGroup(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the count of base materials in this Color Group. + * + * @return returns the count of colors within this color group. + * @throws Lib3MFException + */ + public int getCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_colorgroup_getcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * returns all the PropertyIDs of all colors within this group + * + * @return PropertyID of the color in the color group. + * @throws Lib3MFException + */ + public int[] getAllPropertyIDs() throws Lib3MFException { + Pointer countNeededPropertyIDs = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_colorgroup_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededPropertyIDs, Pointer.NULL})); + long countPropertyIDs = countNeededPropertyIDs.getLong(0); + Pointer bufferPropertyIDs = new Memory(Math.max(1, 4 * countPropertyIDs)); + mWrapper.checkError(this, mWrapper.lib3mf_colorgroup_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, countPropertyIDs, countNeededPropertyIDs, bufferPropertyIDs})); + return bufferPropertyIDs.getIntArray(0, (int)countPropertyIDs); + } + + /** + * Adds a new value. + * + * @param theColor The new color + * @return PropertyID of the new color within this color group. + * @throws Lib3MFException + */ + public int addColor(Color theColor) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + theColor.writeToPointer(bufferTheColor, 0); + Pointer bufferPropertyID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_colorgroup_addcolor.invokeInt(new java.lang.Object[]{mHandle, bufferTheColor, bufferPropertyID})); + return bufferPropertyID.getInt(0); + } + + /** + * Removes a color from the color group. + * + * @param propertyID PropertyID of the color to be removed from the color group. + * @throws Lib3MFException + */ + public void removeColor(int propertyID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_colorgroup_removecolor.invokeInt(new java.lang.Object[]{mHandle, propertyID})); + } + + /** + * Sets a color value. + * + * @param propertyID PropertyID of a color within this color group. + * @param theColor The color + * @throws Lib3MFException + */ + public void setColor(int propertyID, Color theColor) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + theColor.writeToPointer(bufferTheColor, 0); + mWrapper.checkError(this, mWrapper.lib3mf_colorgroup_setcolor.invokeInt(new java.lang.Object[]{mHandle, propertyID, bufferTheColor})); + } + + /** + * Sets a color value. + * + * @param propertyID PropertyID of a color within this color group. + * @return The color + * @throws Lib3MFException + */ + public Color getColor(int propertyID) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_colorgroup_getcolor.invokeInt(new java.lang.Object[]{mHandle, propertyID, bufferTheColor})); + Color theColor = new Color(); + theColor.readFromPointer(bufferTheColor, 0); + return theColor; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ColorGroupIterator.java b/Autogenerated/Bindings/Java9/lib3mf/ColorGroupIterator.java new file mode 100644 index 000000000..16d0da86e --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ColorGroupIterator.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ColorGroupIterator extends ResourceIterator { + + public ColorGroupIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the ColorGroup the iterator points at. + * + * @return returns the ColorGroup instance. + * @throws Lib3MFException + */ + public ColorGroup getCurrentColorGroup() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_colorgroupiterator_getcurrentcolorgroup.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + ColorGroup resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, ColorGroup.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Component.java b/Autogenerated/Bindings/Java9/lib3mf/Component.java new file mode 100644 index 000000000..4d44b5ebb --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Component.java @@ -0,0 +1,170 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Component extends Base { + + public Component(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the Resource Instance of the component. + * + * @return filled with the Resource Instance. + * @throws Lib3MFException + */ + public Object getObjectResource() throws Lib3MFException { + Pointer bufferObjectResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_component_getobjectresource.invokeInt(new java.lang.Object[]{mHandle, bufferObjectResource})); + Pointer valueObjectResource = bufferObjectResource.getPointer(0); + Object objectResource = null; + if (valueObjectResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ObjectResource was a null pointer"); + } + objectResource = mWrapper.PolymorphicFactory(valueObjectResource, Object.class); + return objectResource; + } + + /** + * Returns the UniqueResourceID of the component. + * + * @return returns the UniqueResourceID. + * @throws Lib3MFException + */ + public int getObjectResourceID() throws Lib3MFException { + Pointer bufferUniqueResourceID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_component_getobjectresourceid.invokeInt(new java.lang.Object[]{mHandle, bufferUniqueResourceID})); + return bufferUniqueResourceID.getInt(0); + } + + /** + * returns, whether a component has a UUID and, if true, the component's UUID + * + * @return GetUUID Result Tuple + * @throws Lib3MFException + */ + public GetUUIDResult getUUID() throws Lib3MFException { + Pointer bufferHasUUID = new Memory(1); + Pointer bytesNeededUUID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_component_getuuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, 0, bytesNeededUUID, null})); + int sizeUUID = bytesNeededUUID.getInt(0); + Pointer bufferUUID = new Memory(sizeUUID); + mWrapper.checkError(this, mWrapper.lib3mf_component_getuuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, sizeUUID, bytesNeededUUID, bufferUUID})); + GetUUIDResult returnTuple = new GetUUIDResult(); + returnTuple.HasUUID = bufferHasUUID.getByte(0) != 0; + returnTuple.UUID = new String(bufferUUID.getByteArray(0, sizeUUID - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetUUIDResult { + /** + * flag whether the component has a UUID + */ + public boolean HasUUID; + + /** + * the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + */ + public String UUID; + + } + /** + * sets the component's UUID + * + * @param uUID the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * @throws Lib3MFException + */ + public void setUUID(String uUID) throws Lib3MFException { + byte[] bytesUUID = uUID.getBytes(StandardCharsets.UTF_8); + Memory bufferUUID = new Memory(bytesUUID.length + 1); + bufferUUID.write(0, bytesUUID, 0, bytesUUID.length); + bufferUUID.setByte(bytesUUID.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_component_setuuid.invokeInt(new java.lang.Object[]{mHandle, bufferUUID})); + } + + /** + * Returns, if the component has a different transformation than the identity matrix + * + * @return if true is returned, the transformation is not equal than the identity + * @throws Lib3MFException + */ + public boolean hasTransform() throws Lib3MFException { + Pointer bufferHasTransform = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_component_hastransform.invokeInt(new java.lang.Object[]{mHandle, bufferHasTransform})); + return bufferHasTransform.getByte(0) != 0; + } + + /** + * Returns the transformation matrix of the component. + * + * @return filled with the component transformation matrix + * @throws Lib3MFException + */ + public Transform getTransform() throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_component_gettransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * Sets the transformation matrix of the component. + * + * @param transform new transformation matrix + * @throws Lib3MFException + */ + public void setTransform(Transform transform) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + mWrapper.checkError(this, mWrapper.lib3mf_component_settransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ComponentsObject.java b/Autogenerated/Bindings/Java9/lib3mf/ComponentsObject.java new file mode 100644 index 000000000..bdec60e2b --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ComponentsObject.java @@ -0,0 +1,116 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ComponentsObject extends Object { + + public ComponentsObject(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Adds a new component to a components object. + * + * @param objectResource object to add as component. Must not lead to circular references! + * @param transform optional transform matrix for the component. + * @return new component instance + * @throws Lib3MFException + */ + public Component addComponent(Object objectResource, Transform transform) throws Lib3MFException { + Pointer objectResourceHandle = null; + if (objectResource != null) { + objectResourceHandle = objectResource.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ObjectResource is a null value."); + } + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + Pointer bufferComponentInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_componentsobject_addcomponent.invokeInt(new java.lang.Object[]{mHandle, objectResourceHandle, bufferTransform, bufferComponentInstance})); + Pointer valueComponentInstance = bufferComponentInstance.getPointer(0); + Component componentInstance = null; + if (valueComponentInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ComponentInstance was a null pointer"); + } + componentInstance = mWrapper.PolymorphicFactory(valueComponentInstance, Component.class); + return componentInstance; + } + + /** + * Retrieves a component from a component object. + * + * @param index index of the component to retrieve (0 to componentcount - 1) + * @return component instance + * @throws Lib3MFException + */ + public Component getComponent(int index) throws Lib3MFException { + Pointer bufferComponentInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_componentsobject_getcomponent.invokeInt(new java.lang.Object[]{mHandle, index, bufferComponentInstance})); + Pointer valueComponentInstance = bufferComponentInstance.getPointer(0); + Component componentInstance = null; + if (valueComponentInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ComponentInstance was a null pointer"); + } + componentInstance = mWrapper.PolymorphicFactory(valueComponentInstance, Component.class); + return componentInstance; + } + + /** + * Retrieves a component count of a component object. + * + * @return returns the component count + * @throws Lib3MFException + */ + public int getComponentCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_componentsobject_getcomponentcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ComponentsObjectIterator.java b/Autogenerated/Bindings/Java9/lib3mf/ComponentsObjectIterator.java new file mode 100644 index 000000000..200ae2c72 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ComponentsObjectIterator.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ComponentsObjectIterator extends ResourceIterator { + + public ComponentsObjectIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the ComponentsObject the iterator points at. + * + * @return returns the ComponentsObject instance. + * @throws Lib3MFException + */ + public ComponentsObject getCurrentComponentsObject() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_componentsobjectiterator_getcurrentcomponentsobject.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + ComponentsObject resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, ComponentsObject.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ComposeMatrixNode.java b/Autogenerated/Bindings/Java9/lib3mf/ComposeMatrixNode.java new file mode 100644 index 000000000..d5a2a2b58 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ComposeMatrixNode.java @@ -0,0 +1,363 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ComposeMatrixNode extends ImplicitNode { + + public ComposeMatrixNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the element 0 0 + * + * @return the input for the m00 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM00() throws Lib3MFException { + Pointer bufferM00 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm00.invokeInt(new java.lang.Object[]{mHandle, bufferM00})); + Pointer valueM00 = bufferM00.getPointer(0); + ImplicitPort m00 = null; + if (valueM00 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M00 was a null pointer"); + } + m00 = mWrapper.PolymorphicFactory(valueM00, ImplicitPort.class); + return m00; + } + + /** + * Retrieves the input for the element 0 1 + * + * @return the input for the m01 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM01() throws Lib3MFException { + Pointer bufferM01 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm01.invokeInt(new java.lang.Object[]{mHandle, bufferM01})); + Pointer valueM01 = bufferM01.getPointer(0); + ImplicitPort m01 = null; + if (valueM01 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M01 was a null pointer"); + } + m01 = mWrapper.PolymorphicFactory(valueM01, ImplicitPort.class); + return m01; + } + + /** + * Retrieves the input for the element 0 2 + * + * @return the input for the m02 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM02() throws Lib3MFException { + Pointer bufferM02 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm02.invokeInt(new java.lang.Object[]{mHandle, bufferM02})); + Pointer valueM02 = bufferM02.getPointer(0); + ImplicitPort m02 = null; + if (valueM02 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M02 was a null pointer"); + } + m02 = mWrapper.PolymorphicFactory(valueM02, ImplicitPort.class); + return m02; + } + + /** + * Retrieves the input for the element 0 3 + * + * @return the input for the m03 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM03() throws Lib3MFException { + Pointer bufferM03 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm03.invokeInt(new java.lang.Object[]{mHandle, bufferM03})); + Pointer valueM03 = bufferM03.getPointer(0); + ImplicitPort m03 = null; + if (valueM03 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M03 was a null pointer"); + } + m03 = mWrapper.PolymorphicFactory(valueM03, ImplicitPort.class); + return m03; + } + + /** + * Retrieves the input for the element 1 0 + * + * @return the input for the m10 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM10() throws Lib3MFException { + Pointer bufferM10 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm10.invokeInt(new java.lang.Object[]{mHandle, bufferM10})); + Pointer valueM10 = bufferM10.getPointer(0); + ImplicitPort m10 = null; + if (valueM10 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M10 was a null pointer"); + } + m10 = mWrapper.PolymorphicFactory(valueM10, ImplicitPort.class); + return m10; + } + + /** + * Retrieves the input for the element 1 1 + * + * @return the input for the m11 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM11() throws Lib3MFException { + Pointer bufferM11 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm11.invokeInt(new java.lang.Object[]{mHandle, bufferM11})); + Pointer valueM11 = bufferM11.getPointer(0); + ImplicitPort m11 = null; + if (valueM11 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M11 was a null pointer"); + } + m11 = mWrapper.PolymorphicFactory(valueM11, ImplicitPort.class); + return m11; + } + + /** + * Retrieves the input for the element 1 2 + * + * @return the input for the m12 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM12() throws Lib3MFException { + Pointer bufferM12 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm12.invokeInt(new java.lang.Object[]{mHandle, bufferM12})); + Pointer valueM12 = bufferM12.getPointer(0); + ImplicitPort m12 = null; + if (valueM12 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M12 was a null pointer"); + } + m12 = mWrapper.PolymorphicFactory(valueM12, ImplicitPort.class); + return m12; + } + + /** + * Retrieves the input for the element 1 3 + * + * @return the input for the m13 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM13() throws Lib3MFException { + Pointer bufferM13 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm13.invokeInt(new java.lang.Object[]{mHandle, bufferM13})); + Pointer valueM13 = bufferM13.getPointer(0); + ImplicitPort m13 = null; + if (valueM13 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M13 was a null pointer"); + } + m13 = mWrapper.PolymorphicFactory(valueM13, ImplicitPort.class); + return m13; + } + + /** + * Retrieves the input for the element 2 0 + * + * @return the input for the m20 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM20() throws Lib3MFException { + Pointer bufferM20 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm20.invokeInt(new java.lang.Object[]{mHandle, bufferM20})); + Pointer valueM20 = bufferM20.getPointer(0); + ImplicitPort m20 = null; + if (valueM20 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M20 was a null pointer"); + } + m20 = mWrapper.PolymorphicFactory(valueM20, ImplicitPort.class); + return m20; + } + + /** + * Retrieves the input for the element 2 1 + * + * @return + * @throws Lib3MFException + */ + public ImplicitPort getInputM21() throws Lib3MFException { + Pointer bufferM21 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm21.invokeInt(new java.lang.Object[]{mHandle, bufferM21})); + Pointer valueM21 = bufferM21.getPointer(0); + ImplicitPort m21 = null; + if (valueM21 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M21 was a null pointer"); + } + m21 = mWrapper.PolymorphicFactory(valueM21, ImplicitPort.class); + return m21; + } + + /** + * Retrieves the input for the element 2 2 + * + * @return the input for the m22 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM22() throws Lib3MFException { + Pointer bufferM22 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm22.invokeInt(new java.lang.Object[]{mHandle, bufferM22})); + Pointer valueM22 = bufferM22.getPointer(0); + ImplicitPort m22 = null; + if (valueM22 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M22 was a null pointer"); + } + m22 = mWrapper.PolymorphicFactory(valueM22, ImplicitPort.class); + return m22; + } + + /** + * Retrieves the input for the element 2 3 + * + * @return the input for the m23 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM23() throws Lib3MFException { + Pointer bufferM23 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm23.invokeInt(new java.lang.Object[]{mHandle, bufferM23})); + Pointer valueM23 = bufferM23.getPointer(0); + ImplicitPort m23 = null; + if (valueM23 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M23 was a null pointer"); + } + m23 = mWrapper.PolymorphicFactory(valueM23, ImplicitPort.class); + return m23; + } + + /** + * Retrieves the input for the element 3 0 + * + * @return the input for the m30 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM30() throws Lib3MFException { + Pointer bufferM30 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm30.invokeInt(new java.lang.Object[]{mHandle, bufferM30})); + Pointer valueM30 = bufferM30.getPointer(0); + ImplicitPort m30 = null; + if (valueM30 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M30 was a null pointer"); + } + m30 = mWrapper.PolymorphicFactory(valueM30, ImplicitPort.class); + return m30; + } + + /** + * Retrieves the input for the element 3 1 + * + * @return the input for the m31 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM31() throws Lib3MFException { + Pointer bufferM31 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm31.invokeInt(new java.lang.Object[]{mHandle, bufferM31})); + Pointer valueM31 = bufferM31.getPointer(0); + ImplicitPort m31 = null; + if (valueM31 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M31 was a null pointer"); + } + m31 = mWrapper.PolymorphicFactory(valueM31, ImplicitPort.class); + return m31; + } + + /** + * Retrieves the input for the element 3 2 + * + * @return the input for the m32 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM32() throws Lib3MFException { + Pointer bufferM32 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm32.invokeInt(new java.lang.Object[]{mHandle, bufferM32})); + Pointer valueM32 = bufferM32.getPointer(0); + ImplicitPort m32 = null; + if (valueM32 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M32 was a null pointer"); + } + m32 = mWrapper.PolymorphicFactory(valueM32, ImplicitPort.class); + return m32; + } + + /** + * Retrieves the input for the element 3 3 + * + * @return the input for the m33 element + * @throws Lib3MFException + */ + public ImplicitPort getInputM33() throws Lib3MFException { + Pointer bufferM33 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getinputm33.invokeInt(new java.lang.Object[]{mHandle, bufferM33})); + Pointer valueM33 = bufferM33.getPointer(0); + ImplicitPort m33 = null; + if (valueM33 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "M33 was a null pointer"); + } + m33 = mWrapper.PolymorphicFactory(valueM33, ImplicitPort.class); + return m33; + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputResult() throws Lib3MFException { + Pointer bufferResult = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composematrixnode_getoutputresult.invokeInt(new java.lang.Object[]{mHandle, bufferResult})); + Pointer valueResult = bufferResult.getPointer(0); + ImplicitPort result = null; + if (valueResult == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Result was a null pointer"); + } + result = mWrapper.PolymorphicFactory(valueResult, ImplicitPort.class); + return result; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ComposeVectorNode.java b/Autogenerated/Bindings/Java9/lib3mf/ComposeVectorNode.java new file mode 100644 index 000000000..f16462afc --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ComposeVectorNode.java @@ -0,0 +1,129 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ComposeVectorNode extends ImplicitNode { + + public ComposeVectorNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the x component + * + * @return the input for the x component + * @throws Lib3MFException + */ + public ImplicitPort getInputX() throws Lib3MFException { + Pointer bufferX = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composevectornode_getinputx.invokeInt(new java.lang.Object[]{mHandle, bufferX})); + Pointer valueX = bufferX.getPointer(0); + ImplicitPort x = null; + if (valueX == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "X was a null pointer"); + } + x = mWrapper.PolymorphicFactory(valueX, ImplicitPort.class); + return x; + } + + /** + * Retrieves the input for the y component + * + * @return the input for the y component + * @throws Lib3MFException + */ + public ImplicitPort getInputY() throws Lib3MFException { + Pointer bufferY = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composevectornode_getinputy.invokeInt(new java.lang.Object[]{mHandle, bufferY})); + Pointer valueY = bufferY.getPointer(0); + ImplicitPort y = null; + if (valueY == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Y was a null pointer"); + } + y = mWrapper.PolymorphicFactory(valueY, ImplicitPort.class); + return y; + } + + /** + * Retrieves the input for the z component + * + * @return the input for the z component + * @throws Lib3MFException + */ + public ImplicitPort getInputZ() throws Lib3MFException { + Pointer bufferZ = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composevectornode_getinputz.invokeInt(new java.lang.Object[]{mHandle, bufferZ})); + Pointer valueZ = bufferZ.getPointer(0); + ImplicitPort z = null; + if (valueZ == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Z was a null pointer"); + } + z = mWrapper.PolymorphicFactory(valueZ, ImplicitPort.class); + return z; + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputResult() throws Lib3MFException { + Pointer bufferResult = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_composevectornode_getoutputresult.invokeInt(new java.lang.Object[]{mHandle, bufferResult})); + Pointer valueResult = bufferResult.getPointer(0); + ImplicitPort result = null; + if (valueResult == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Result was a null pointer"); + } + result = mWrapper.PolymorphicFactory(valueResult, ImplicitPort.class); + return result; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/CompositeConstituent.java b/Autogenerated/Bindings/Java9/lib3mf/CompositeConstituent.java new file mode 100644 index 000000000..a472fb4f1 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/CompositeConstituent.java @@ -0,0 +1,63 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class CompositeConstituent { + + public int PropertyID; + + public double MixingRatio; + + public static final int SIZE = 12; + + public void readFromPointer(Pointer p, long offset) { + PropertyID = p.getInt(offset + 0); + MixingRatio = p.getDouble(offset + 4); + } + + public void writeToPointer(Pointer p, long offset) { + p.setInt(offset + 0, PropertyID); + p.setDouble(offset + 4, MixingRatio); + } + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/CompositeMaterials.java b/Autogenerated/Bindings/Java9/lib3mf/CompositeMaterials.java new file mode 100644 index 000000000..7b7a6f46b --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/CompositeMaterials.java @@ -0,0 +1,150 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class CompositeMaterials extends Resource { + + public CompositeMaterials(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the count of Composite-s in the CompositeMaterials. + * + * @return returns the count of Composite-s + * @throws Lib3MFException + */ + public int getCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_compositematerials_getcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials + * + * @return PropertyID of the Composite-Mixing Values in the CompositeMaterials. + * @throws Lib3MFException + */ + public int[] getAllPropertyIDs() throws Lib3MFException { + Pointer countNeededPropertyIDs = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_compositematerials_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededPropertyIDs, Pointer.NULL})); + long countPropertyIDs = countNeededPropertyIDs.getLong(0); + Pointer bufferPropertyIDs = new Memory(Math.max(1, 4 * countPropertyIDs)); + mWrapper.checkError(this, mWrapper.lib3mf_compositematerials_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, countPropertyIDs, countNeededPropertyIDs, bufferPropertyIDs})); + return bufferPropertyIDs.getIntArray(0, (int)countPropertyIDs); + } + + /** + * Obtains the BaseMaterialGroup instance of this CompositeMaterials. + * + * @return returns the BaseMaterialGroup instance of this CompositeMaterials + * @throws Lib3MFException + */ + public BaseMaterialGroup getBaseMaterialGroup() throws Lib3MFException { + Pointer bufferBaseMaterialGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_compositematerials_getbasematerialgroup.invokeInt(new java.lang.Object[]{mHandle, bufferBaseMaterialGroupInstance})); + Pointer valueBaseMaterialGroupInstance = bufferBaseMaterialGroupInstance.getPointer(0); + BaseMaterialGroup baseMaterialGroupInstance = null; + if (valueBaseMaterialGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BaseMaterialGroupInstance was a null pointer"); + } + baseMaterialGroupInstance = mWrapper.PolymorphicFactory(valueBaseMaterialGroupInstance, BaseMaterialGroup.class); + return baseMaterialGroupInstance; + } + + /** + * Adds a new Composite-Mixing Values to the CompositeMaterials. + * + * @param composite The Composite Constituents to be added as composite + * @return returns new PropertyID of the new Composite in the CompositeMaterials. + * @throws Lib3MFException + */ + public int addComposite(CompositeConstituent[] composite) throws Lib3MFException { + Pointer bufferComposite = new Memory(Math.max(1, CompositeConstituent.SIZE * composite.length)); + for (int i = 0; i < composite.length; i++) { + composite[i].writeToPointer(bufferComposite, i * CompositeConstituent.SIZE); + } + Pointer bufferPropertyID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_compositematerials_addcomposite.invokeInt(new java.lang.Object[]{mHandle, (long) composite.length, bufferComposite, bufferPropertyID})); + return bufferPropertyID.getInt(0); + } + + /** + * Removes a Composite-Maxing Ratio from the CompositeMaterials. + * + * @param propertyID PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. + * @throws Lib3MFException + */ + public void removeComposite(int propertyID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_compositematerials_removecomposite.invokeInt(new java.lang.Object[]{mHandle, propertyID})); + } + + /** + * Obtains a Composite-Maxing Ratio of this CompositeMaterials. + * + * @param propertyID the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. + * @return The Composite-Mixing Values with the given PropertyID + * @throws Lib3MFException + */ + public CompositeConstituent[] getComposite(int propertyID) throws Lib3MFException { + Pointer countNeededComposite = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_compositematerials_getcomposite.invokeInt(new java.lang.Object[]{mHandle, propertyID, 0L, countNeededComposite, null})); + long countComposite = countNeededComposite.getLong(0); + Pointer bufferComposite = new Memory(Math.max(1, countComposite * CompositeConstituent.SIZE)); + mWrapper.checkError(this, mWrapper.lib3mf_compositematerials_getcomposite.invokeInt(new java.lang.Object[]{mHandle, propertyID, countComposite, countNeededComposite, bufferComposite})); + CompositeConstituent composite[] = new CompositeConstituent[(int)countComposite]; + for (int i = 0; i < (int)countComposite; i++) { + composite[i] = new CompositeConstituent(); + composite[i].readFromPointer(bufferComposite, i * CompositeConstituent.SIZE); + } + return composite; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/CompositeMaterialsIterator.java b/Autogenerated/Bindings/Java9/lib3mf/CompositeMaterialsIterator.java new file mode 100644 index 000000000..76b6f7458 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/CompositeMaterialsIterator.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class CompositeMaterialsIterator extends ResourceIterator { + + public CompositeMaterialsIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the CompositeMaterials the iterator points at. + * + * @return returns the CompositeMaterials instance. + * @throws Lib3MFException + */ + public CompositeMaterials getCurrentCompositeMaterials() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_compositematerialsiterator_getcurrentcompositematerials.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + CompositeMaterials resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, CompositeMaterials.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ConstMatNode.java b/Autogenerated/Bindings/Java9/lib3mf/ConstMatNode.java new file mode 100644 index 000000000..0a520979c --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ConstMatNode.java @@ -0,0 +1,101 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ConstMatNode extends ImplicitNode { + + public ConstMatNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Sets the matrix value of the node + * + * @param value the value + * @throws Lib3MFException + */ + public void setMatrix(Matrix4x4 value) throws Lib3MFException { + Pointer bufferValue = new Memory(Matrix4x4.SIZE); + value.writeToPointer(bufferValue, 0); + mWrapper.checkError(this, mWrapper.lib3mf_constmatnode_setmatrix.invokeInt(new java.lang.Object[]{mHandle, bufferValue})); + } + + /** + * Retrieves the matrix value of the node + * + * @return the matrix + * @throws Lib3MFException + */ + public Matrix4x4 getMatrix() throws Lib3MFException { + Pointer bufferValue = new Memory(Matrix4x4.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_constmatnode_getmatrix.invokeInt(new java.lang.Object[]{mHandle, bufferValue})); + Matrix4x4 value = new Matrix4x4(); + value.readFromPointer(bufferValue, 0); + return value; + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputMatrix() throws Lib3MFException { + Pointer bufferMatrix = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_constmatnode_getoutputmatrix.invokeInt(new java.lang.Object[]{mHandle, bufferMatrix})); + Pointer valueMatrix = bufferMatrix.getPointer(0); + ImplicitPort matrix = null; + if (valueMatrix == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Matrix was a null pointer"); + } + matrix = mWrapper.PolymorphicFactory(valueMatrix, ImplicitPort.class); + return matrix; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ConstVecNode.java b/Autogenerated/Bindings/Java9/lib3mf/ConstVecNode.java new file mode 100644 index 000000000..b7675634c --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ConstVecNode.java @@ -0,0 +1,101 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ConstVecNode extends ImplicitNode { + + public ConstVecNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Sets the vector value of the node + * + * @param value the value + * @throws Lib3MFException + */ + public void setVector(Vector value) throws Lib3MFException { + Pointer bufferValue = new Memory(Vector.SIZE); + value.writeToPointer(bufferValue, 0); + mWrapper.checkError(this, mWrapper.lib3mf_constvecnode_setvector.invokeInt(new java.lang.Object[]{mHandle, bufferValue})); + } + + /** + * Retrieves the vector value of the node + * + * @return the value + * @throws Lib3MFException + */ + public Vector getVector() throws Lib3MFException { + Pointer bufferValue = new Memory(Vector.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_constvecnode_getvector.invokeInt(new java.lang.Object[]{mHandle, bufferValue})); + Vector value = new Vector(); + value.readFromPointer(bufferValue, 0); + return value; + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputVector() throws Lib3MFException { + Pointer bufferVector = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_constvecnode_getoutputvector.invokeInt(new java.lang.Object[]{mHandle, bufferVector})); + Pointer valueVector = bufferVector.getPointer(0); + ImplicitPort vector = null; + if (valueVector == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Vector was a null pointer"); + } + vector = mWrapper.PolymorphicFactory(valueVector, ImplicitPort.class); + return vector; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ConstantNode.java b/Autogenerated/Bindings/Java9/lib3mf/ConstantNode.java new file mode 100644 index 000000000..e273163ec --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ConstantNode.java @@ -0,0 +1,97 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ConstantNode extends ImplicitNode { + + public ConstantNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Sets the constant value of the node + * + * @param value the value + * @throws Lib3MFException + */ + public void setConstant(double value) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_constantnode_setconstant.invokeInt(new java.lang.Object[]{mHandle, value})); + } + + /** + * Retrieves the constant value of the node + * + * @return the value + * @throws Lib3MFException + */ + public double getConstant() throws Lib3MFException { + Pointer bufferValue = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_constantnode_getconstant.invokeInt(new java.lang.Object[]{mHandle, bufferValue})); + return bufferValue.getDouble(0); + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputValue() throws Lib3MFException { + Pointer bufferValue = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_constantnode_getoutputvalue.invokeInt(new java.lang.Object[]{mHandle, bufferValue})); + Pointer valueValue = bufferValue.getPointer(0); + ImplicitPort value = null; + if (valueValue == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Value was a null pointer"); + } + value = mWrapper.PolymorphicFactory(valueValue, ImplicitPort.class); + return value; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Consumer.java b/Autogenerated/Bindings/Java9/lib3mf/Consumer.java new file mode 100644 index 000000000..aa5a00231 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Consumer.java @@ -0,0 +1,102 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Consumer extends Base { + + public Consumer(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Gets the consumerid + * + * @return A unique identifier for the consumers + * @throws Lib3MFException + */ + public String getConsumerID() throws Lib3MFException { + Pointer bytesNeededConsumerID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_consumer_getconsumerid.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededConsumerID, null})); + int sizeConsumerID = bytesNeededConsumerID.getInt(0); + Pointer bufferConsumerID = new Memory(sizeConsumerID); + mWrapper.checkError(this, mWrapper.lib3mf_consumer_getconsumerid.invokeInt(new java.lang.Object[]{mHandle, sizeConsumerID, bytesNeededConsumerID, bufferConsumerID})); + return new String(bufferConsumerID.getByteArray(0, sizeConsumerID - 1), StandardCharsets.UTF_8); + } + + /** + * Getts the keyid + * + * @return The identifier for the key of this consumer + * @throws Lib3MFException + */ + public String getKeyID() throws Lib3MFException { + Pointer bytesNeededKeyID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_consumer_getkeyid.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededKeyID, null})); + int sizeKeyID = bytesNeededKeyID.getInt(0); + Pointer bufferKeyID = new Memory(sizeKeyID); + mWrapper.checkError(this, mWrapper.lib3mf_consumer_getkeyid.invokeInt(new java.lang.Object[]{mHandle, sizeKeyID, bytesNeededKeyID, bufferKeyID})); + return new String(bufferKeyID.getByteArray(0, sizeKeyID - 1), StandardCharsets.UTF_8); + } + + /** + * Gets the keyvalue associated with this consumer + * + * @return The public key, when available, of this consumer + * @throws Lib3MFException + */ + public String getKeyValue() throws Lib3MFException { + Pointer bytesNeededKeyValue = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_consumer_getkeyvalue.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededKeyValue, null})); + int sizeKeyValue = bytesNeededKeyValue.getInt(0); + Pointer bufferKeyValue = new Memory(sizeKeyValue); + mWrapper.checkError(this, mWrapper.lib3mf_consumer_getkeyvalue.invokeInt(new java.lang.Object[]{mHandle, sizeKeyValue, bytesNeededKeyValue, bufferKeyValue})); + return new String(bufferKeyValue.getByteArray(0, sizeKeyValue - 1), StandardCharsets.UTF_8); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ContentEncryptionParams.java b/Autogenerated/Bindings/Java9/lib3mf/ContentEncryptionParams.java new file mode 100644 index 000000000..546689c49 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ContentEncryptionParams.java @@ -0,0 +1,170 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ContentEncryptionParams extends Base { + + public ContentEncryptionParams(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the encryption method to be used in this encryption process + * + * @return + * @throws Lib3MFException + */ + public Lib3MFWrapper.EncryptionAlgorithm getEncryptionAlgorithm() throws Lib3MFException { + Pointer bufferAlgorithm = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getencryptionalgorithm.invokeInt(new java.lang.Object[]{mHandle, bufferAlgorithm})); + return Lib3MFWrapper.EnumConversion.convertConstToEncryptionAlgorithm(bufferAlgorithm.getInt(0)); + } + + /** + * Gets the key for the resource associated + * + * @return Pointer to a buffer where to place the key. + * @throws Lib3MFException + */ + public byte[] getKey() throws Lib3MFException { + Pointer countNeededByteData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getkey.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededByteData, Pointer.NULL})); + long countByteData = countNeededByteData.getLong(0); + Pointer bufferByteData = new Memory(Math.max(1, 1 * countByteData)); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getkey.invokeInt(new java.lang.Object[]{mHandle, countByteData, countNeededByteData, bufferByteData})); + return bufferByteData.getByteArray(0, (int)countByteData); + } + + /** + * Gets the IV data + * + * @return Pointer to a buffer where to place the data. + * @throws Lib3MFException + */ + public byte[] getInitializationVector() throws Lib3MFException { + Pointer countNeededByteData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getinitializationvector.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededByteData, Pointer.NULL})); + long countByteData = countNeededByteData.getLong(0); + Pointer bufferByteData = new Memory(Math.max(1, 1 * countByteData)); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getinitializationvector.invokeInt(new java.lang.Object[]{mHandle, countByteData, countNeededByteData, bufferByteData})); + return bufferByteData.getByteArray(0, (int)countByteData); + } + + /** + * A handler descriptor that uniquely identifies the context of the resource. Each resource will be assigned a different value + * + * @return Pointer to a buffer where to place the data. + * @throws Lib3MFException + */ + public byte[] getAuthenticationTag() throws Lib3MFException { + Pointer countNeededByteData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getauthenticationtag.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededByteData, Pointer.NULL})); + long countByteData = countNeededByteData.getLong(0); + Pointer bufferByteData = new Memory(Math.max(1, 1 * countByteData)); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getauthenticationtag.invokeInt(new java.lang.Object[]{mHandle, countByteData, countNeededByteData, bufferByteData})); + return bufferByteData.getByteArray(0, (int)countByteData); + } + + /** + * Sets the authentication tag + * + * @param byteData The authentication tag size + * @throws Lib3MFException + */ + public void setAuthenticationTag(byte[] byteData) throws Lib3MFException { + Pointer bufferByteData = new Memory(Math.max(1, 1 * byteData.length)); + for (int i = 0; i < byteData.length; i++) { + bufferByteData.setByte(1 * i, byteData[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_setauthenticationtag.invokeInt(new java.lang.Object[]{mHandle, (long) byteData.length, bufferByteData})); + } + + /** + * A handler descriptor that uniquely identifies the context of the resource. Each resource will be assigned a different value + * + * @return Buffer where the data will be placed + * @throws Lib3MFException + */ + public byte[] getAdditionalAuthenticationData() throws Lib3MFException { + Pointer countNeededByteData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getadditionalauthenticationdata.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededByteData, Pointer.NULL})); + long countByteData = countNeededByteData.getLong(0); + Pointer bufferByteData = new Memory(Math.max(1, 1 * countByteData)); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getadditionalauthenticationdata.invokeInt(new java.lang.Object[]{mHandle, countByteData, countNeededByteData, bufferByteData})); + return bufferByteData.getByteArray(0, (int)countByteData); + } + + /** + * A handler descriptor that uniquely identifies the context of the resource. Each resource will be assigned a different value + * + * @return + * @throws Lib3MFException + */ + public long getDescriptor() throws Lib3MFException { + Pointer bufferDescriptor = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getdescriptor.invokeInt(new java.lang.Object[]{mHandle, bufferDescriptor})); + return bufferDescriptor.getLong(0); + } + + /** + * Gets the resourcedatagroup keyuuid + * + * @return The resourcedatagroup keyuuid that may be use to reference an external key + * @throws Lib3MFException + */ + public String getKeyUUID() throws Lib3MFException { + Pointer bytesNeededUUID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getkeyuuid.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededUUID, null})); + int sizeUUID = bytesNeededUUID.getInt(0); + Pointer bufferUUID = new Memory(sizeUUID); + mWrapper.checkError(this, mWrapper.lib3mf_contentencryptionparams_getkeyuuid.invokeInt(new java.lang.Object[]{mHandle, sizeUUID, bytesNeededUUID, bufferUUID})); + return new String(bufferUUID.getByteArray(0, sizeUUID - 1), StandardCharsets.UTF_8); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/CosNode.java b/Autogenerated/Bindings/Java9/lib3mf/CosNode.java new file mode 100644 index 000000000..f9aa1a119 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/CosNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class CosNode extends OneInputNode { + + public CosNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/CoshNode.java b/Autogenerated/Bindings/Java9/lib3mf/CoshNode.java new file mode 100644 index 000000000..4b552510e --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/CoshNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class CoshNode extends OneInputNode { + + public CoshNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/CrossNode.java b/Autogenerated/Bindings/Java9/lib3mf/CrossNode.java new file mode 100644 index 000000000..5b1457c5d --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/CrossNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class CrossNode extends TwoInputNode { + + public CrossNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/DecomposeVectorNode.java b/Autogenerated/Bindings/Java9/lib3mf/DecomposeVectorNode.java new file mode 100644 index 000000000..0ed8ea010 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/DecomposeVectorNode.java @@ -0,0 +1,129 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class DecomposeVectorNode extends ImplicitNode { + + public DecomposeVectorNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input + * + * @return the input port for the vector to decompose + * @throws Lib3MFException + */ + public ImplicitPort getInputA() throws Lib3MFException { + Pointer bufferA = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_decomposevectornode_getinputa.invokeInt(new java.lang.Object[]{mHandle, bufferA})); + Pointer valueA = bufferA.getPointer(0); + ImplicitPort a = null; + if (valueA == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "A was a null pointer"); + } + a = mWrapper.PolymorphicFactory(valueA, ImplicitPort.class); + return a; + } + + /** + * Retrieves the output for the x component + * + * @return the output for the x component + * @throws Lib3MFException + */ + public ImplicitPort getOutputX() throws Lib3MFException { + Pointer bufferX = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_decomposevectornode_getoutputx.invokeInt(new java.lang.Object[]{mHandle, bufferX})); + Pointer valueX = bufferX.getPointer(0); + ImplicitPort x = null; + if (valueX == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "X was a null pointer"); + } + x = mWrapper.PolymorphicFactory(valueX, ImplicitPort.class); + return x; + } + + /** + * Retrieves the output for the y component + * + * @return the output for the y component + * @throws Lib3MFException + */ + public ImplicitPort getOutputY() throws Lib3MFException { + Pointer bufferY = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_decomposevectornode_getoutputy.invokeInt(new java.lang.Object[]{mHandle, bufferY})); + Pointer valueY = bufferY.getPointer(0); + ImplicitPort y = null; + if (valueY == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Y was a null pointer"); + } + y = mWrapper.PolymorphicFactory(valueY, ImplicitPort.class); + return y; + } + + /** + * Retrieves the output for the z component + * + * @return the output for the z component + * @throws Lib3MFException + */ + public ImplicitPort getOutputZ() throws Lib3MFException { + Pointer bufferZ = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_decomposevectornode_getoutputz.invokeInt(new java.lang.Object[]{mHandle, bufferZ})); + Pointer valueZ = bufferZ.getPointer(0); + ImplicitPort z = null; + if (valueZ == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Z was a null pointer"); + } + z = mWrapper.PolymorphicFactory(valueZ, ImplicitPort.class); + return z; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/DivisionNode.java b/Autogenerated/Bindings/Java9/lib3mf/DivisionNode.java new file mode 100644 index 000000000..1b44f99fc --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/DivisionNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class DivisionNode extends TwoInputNode { + + public DivisionNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/DotNode.java b/Autogenerated/Bindings/Java9/lib3mf/DotNode.java new file mode 100644 index 000000000..53a5fbb59 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/DotNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class DotNode extends TwoInputNode { + + public DotNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ExpNode.java b/Autogenerated/Bindings/Java9/lib3mf/ExpNode.java new file mode 100644 index 000000000..91a2179ad --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ExpNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ExpNode extends OneInputNode { + + public ExpNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/FloorNode.java b/Autogenerated/Bindings/Java9/lib3mf/FloorNode.java new file mode 100644 index 000000000..585490b2c --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/FloorNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class FloorNode extends OneInputNode { + + public FloorNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/FmodNode.java b/Autogenerated/Bindings/Java9/lib3mf/FmodNode.java new file mode 100644 index 000000000..edb1b0051 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/FmodNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class FmodNode extends TwoInputNode { + + public FmodNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/FractNode.java b/Autogenerated/Bindings/Java9/lib3mf/FractNode.java new file mode 100644 index 000000000..e4299ba2b --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/FractNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class FractNode extends OneInputNode { + + public FractNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Function.java b/Autogenerated/Bindings/Java9/lib3mf/Function.java new file mode 100644 index 000000000..a15ba3029 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Function.java @@ -0,0 +1,258 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Function extends Resource { + + public Function(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the display name of the function + * + * @return the display name + * @throws Lib3MFException + */ + public String getDisplayName() throws Lib3MFException { + Pointer bytesNeededDisplayName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_function_getdisplayname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededDisplayName, null})); + int sizeDisplayName = bytesNeededDisplayName.getInt(0); + Pointer bufferDisplayName = new Memory(sizeDisplayName); + mWrapper.checkError(this, mWrapper.lib3mf_function_getdisplayname.invokeInt(new java.lang.Object[]{mHandle, sizeDisplayName, bytesNeededDisplayName, bufferDisplayName})); + return new String(bufferDisplayName.getByteArray(0, sizeDisplayName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the display name of the function + * + * @param displayName the display name + * @throws Lib3MFException + */ + public void setDisplayName(String displayName) throws Lib3MFException { + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_function_setdisplayname.invokeInt(new java.lang.Object[]{mHandle, bufferDisplayName})); + } + + /** + * Add an input + * + * @param identifier the identifier of the input + * @param displayName the display name of the input + * @param type the type of the input + * @return The added input port + * @throws Lib3MFException + */ + public ImplicitPort addInput(String identifier, String displayName, Lib3MFWrapper.ImplicitPortType type) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + Pointer bufferPort = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_function_addinput.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, Lib3MFWrapper.EnumConversion.convertImplicitPortTypeToConst(type), bufferPort})); + Pointer valuePort = bufferPort.getPointer(0); + ImplicitPort port = null; + if (valuePort == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Port was a null pointer"); + } + port = mWrapper.PolymorphicFactory(valuePort, ImplicitPort.class); + return port; + } + + /** + * Retrieves the inputs + * + * @return iterator for the list of inputs + * @throws Lib3MFException + */ + public ImplicitPortIterator getInputs() throws Lib3MFException { + Pointer bufferIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_function_getinputs.invokeInt(new java.lang.Object[]{mHandle, bufferIterator})); + Pointer valueIterator = bufferIterator.getPointer(0); + ImplicitPortIterator iterator = null; + if (valueIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Iterator was a null pointer"); + } + iterator = mWrapper.PolymorphicFactory(valueIterator, ImplicitPortIterator.class); + return iterator; + } + + /** + * Removes an input + * + * @param input The input to be removed + * @throws Lib3MFException + */ + public void removeInput(ImplicitPort input) throws Lib3MFException { + Pointer inputHandle = null; + if (input != null) { + inputHandle = input.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Input is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_function_removeinput.invokeInt(new java.lang.Object[]{mHandle, inputHandle})); + } + + /** + * Add an output + * + * @param identifier the identifier of the output + * @param displayName the display name of the output + * @param type the type of the input + * @return The added input port + * @throws Lib3MFException + */ + public ImplicitPort addOutput(String identifier, String displayName, Lib3MFWrapper.ImplicitPortType type) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + Pointer bufferPort = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_function_addoutput.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, Lib3MFWrapper.EnumConversion.convertImplicitPortTypeToConst(type), bufferPort})); + Pointer valuePort = bufferPort.getPointer(0); + ImplicitPort port = null; + if (valuePort == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Port was a null pointer"); + } + port = mWrapper.PolymorphicFactory(valuePort, ImplicitPort.class); + return port; + } + + /** + * Retrieves the outputs + * + * @return iterator for the outputs + * @throws Lib3MFException + */ + public ImplicitPortIterator getOutputs() throws Lib3MFException { + Pointer bufferIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_function_getoutputs.invokeInt(new java.lang.Object[]{mHandle, bufferIterator})); + Pointer valueIterator = bufferIterator.getPointer(0); + ImplicitPortIterator iterator = null; + if (valueIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Iterator was a null pointer"); + } + iterator = mWrapper.PolymorphicFactory(valueIterator, ImplicitPortIterator.class); + return iterator; + } + + /** + * Removes an output + * + * @param output The output to be removed + * @throws Lib3MFException + */ + public void removeOutput(ImplicitPort output) throws Lib3MFException { + Pointer outputHandle = null; + if (output != null) { + outputHandle = output.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Output is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_function_removeoutput.invokeInt(new java.lang.Object[]{mHandle, outputHandle})); + } + + /** + * Retrieves an input + * + * @param identifier the identifier of the input + * @return the input port + * @throws Lib3MFException + */ + public ImplicitPort findInput(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + Pointer bufferInput = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_function_findinput.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferInput})); + Pointer valueInput = bufferInput.getPointer(0); + ImplicitPort input = null; + if (valueInput == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Input was a null pointer"); + } + input = mWrapper.PolymorphicFactory(valueInput, ImplicitPort.class); + return input; + } + + /** + * Retrieves an output + * + * @param identifier the identifier of the output + * @return the output port + * @throws Lib3MFException + */ + public ImplicitPort findOutput(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + Pointer bufferOutput = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_function_findoutput.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferOutput})); + Pointer valueOutput = bufferOutput.getPointer(0); + ImplicitPort output = null; + if (valueOutput == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Output was a null pointer"); + } + output = mWrapper.PolymorphicFactory(valueOutput, ImplicitPort.class); + return output; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/FunctionCallNode.java b/Autogenerated/Bindings/Java9/lib3mf/FunctionCallNode.java new file mode 100644 index 000000000..4e67ed807 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/FunctionCallNode.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class FunctionCallNode extends ImplicitNode { + + public FunctionCallNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the function id + * + * @return the input port for the function + * @throws Lib3MFException + */ + public ImplicitPort getInputFunctionID() throws Lib3MFException { + Pointer bufferFunction = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functioncallnode_getinputfunctionid.invokeInt(new java.lang.Object[]{mHandle, bufferFunction})); + Pointer valueFunction = bufferFunction.getPointer(0); + ImplicitPort function = null; + if (valueFunction == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Function was a null pointer"); + } + function = mWrapper.PolymorphicFactory(valueFunction, ImplicitPort.class); + return function; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/FunctionFromImage3D.java b/Autogenerated/Bindings/Java9/lib3mf/FunctionFromImage3D.java new file mode 100644 index 000000000..c4971991a --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/FunctionFromImage3D.java @@ -0,0 +1,204 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class FunctionFromImage3D extends Function { + + public FunctionFromImage3D(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the selected 3D image. + * + * @return image instance + * @throws Lib3MFException + */ + public Image3D getImage3D() throws Lib3MFException { + Pointer bufferImage3D = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_getimage3d.invokeInt(new java.lang.Object[]{mHandle, bufferImage3D})); + Pointer valueImage3D = bufferImage3D.getPointer(0); + Image3D image3D = null; + if (valueImage3D == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Image3D was a null pointer"); + } + image3D = mWrapper.PolymorphicFactory(valueImage3D, Image3D.class); + return image3D; + } + + /** + * Sets the 3D image of the selector. + * + * @param image3D image instance + * @throws Lib3MFException + */ + public void setImage3D(Image3D image3D) throws Lib3MFException { + Pointer image3DHandle = null; + if (image3D != null) { + image3DHandle = image3D.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Image3D is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_setimage3d.invokeInt(new java.lang.Object[]{mHandle, image3DHandle})); + } + + /** + * Sets the texture filter of the selector. + * + * @param filter texture filter + * @throws Lib3MFException + */ + public void setFilter(Lib3MFWrapper.TextureFilter filter) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_setfilter.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertTextureFilterToConst(filter)})); + } + + /** + * Returns the texture filter of the selector. + * + * @return texture filter + * @throws Lib3MFException + */ + public Lib3MFWrapper.TextureFilter getFilter() throws Lib3MFException { + Pointer bufferFilter = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_getfilter.invokeInt(new java.lang.Object[]{mHandle, bufferFilter})); + return Lib3MFWrapper.EnumConversion.convertConstToTextureFilter(bufferFilter.getInt(0)); + } + + /** + * Sets the tile styles of the selector. + * + * @param tileStyleU tile style in U + * @param tileStyleV tile style in V + * @param tileStyleW tile style in W + * @throws Lib3MFException + */ + public void setTileStyles(Lib3MFWrapper.TextureTileStyle tileStyleU, Lib3MFWrapper.TextureTileStyle tileStyleV, Lib3MFWrapper.TextureTileStyle tileStyleW) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_settilestyles.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertTextureTileStyleToConst(tileStyleU), Lib3MFWrapper.EnumConversion.convertTextureTileStyleToConst(tileStyleV), Lib3MFWrapper.EnumConversion.convertTextureTileStyleToConst(tileStyleW)})); + } + + /** + * Retrieves the tile styles of the selector. + * + * @return GetTileStyles Result Tuple + * @throws Lib3MFException + */ + public GetTileStylesResult getTileStyles() throws Lib3MFException { + Pointer bufferTileStyleU = new Memory(4); + Pointer bufferTileStyleV = new Memory(4); + Pointer bufferTileStyleW = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_gettilestyles.invokeInt(new java.lang.Object[]{mHandle, bufferTileStyleU, bufferTileStyleV, bufferTileStyleW})); + GetTileStylesResult returnTuple = new GetTileStylesResult(); + returnTuple.TileStyleU = Lib3MFWrapper.EnumConversion.convertConstToTextureTileStyle(bufferTileStyleU.getInt(0)); + returnTuple.TileStyleV = Lib3MFWrapper.EnumConversion.convertConstToTextureTileStyle(bufferTileStyleV.getInt(0)); + returnTuple.TileStyleW = Lib3MFWrapper.EnumConversion.convertConstToTextureTileStyle(bufferTileStyleW.getInt(0)); + return returnTuple; + } + + public static class GetTileStylesResult { + /** + * tile style in U + */ + public Lib3MFWrapper.TextureTileStyle TileStyleU; + + /** + * tile style in V + */ + public Lib3MFWrapper.TextureTileStyle TileStyleV; + + /** + * tile style in W + */ + public Lib3MFWrapper.TextureTileStyle TileStyleW; + + } + /** + * returns the offset value for the pixel values in the Image3D + * + * @return the offset value for the pixel values in the Image3D + * @throws Lib3MFException + */ + public double getOffset() throws Lib3MFException { + Pointer bufferOffset = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_getoffset.invokeInt(new java.lang.Object[]{mHandle, bufferOffset})); + return bufferOffset.getDouble(0); + } + + /** + * Sets the offset value for the pixel values in the Image3D + * + * @param offset the offset value for the pixel values in the Image3D + * @throws Lib3MFException + */ + public void setOffset(double offset) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_setoffset.invokeInt(new java.lang.Object[]{mHandle, offset})); + } + + /** + * returns the scale value for the pixel values in the Image3D + * + * @return the scale value for the pixel values in the Image3D + * @throws Lib3MFException + */ + public double getScale() throws Lib3MFException { + Pointer bufferScale = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_getscale.invokeInt(new java.lang.Object[]{mHandle, bufferScale})); + return bufferScale.getDouble(0); + } + + /** + * Sets the scale value for the pixel values in the Image3D + * + * @param scale the scale value for the pixel values in the Image3D + * @throws Lib3MFException + */ + public void setScale(double scale) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_functionfromimage3d_setscale.invokeInt(new java.lang.Object[]{mHandle, scale})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/FunctionGradientNode.java b/Autogenerated/Bindings/Java9/lib3mf/FunctionGradientNode.java new file mode 100644 index 000000000..7f0889c99 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/FunctionGradientNode.java @@ -0,0 +1,223 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class FunctionGradientNode extends ImplicitNode { + + public FunctionGradientNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the function id + * + * @return the input port for the function + * @throws Lib3MFException + */ + public ImplicitPort getInputFunctionID() throws Lib3MFException { + Pointer bufferFunction = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getinputfunctionid.invokeInt(new java.lang.Object[]{mHandle, bufferFunction})); + Pointer valueFunction = bufferFunction.getPointer(0); + ImplicitPort function = null; + if (valueFunction == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Function was a null pointer"); + } + function = mWrapper.PolymorphicFactory(valueFunction, ImplicitPort.class); + return function; + } + + /** + * Retrieves the input for the position + * + * @return the input port for the position + * @throws Lib3MFException + */ + public ImplicitPort getInputPos() throws Lib3MFException { + Pointer bufferPos = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getinputpos.invokeInt(new java.lang.Object[]{mHandle, bufferPos})); + Pointer valuePos = bufferPos.getPointer(0); + ImplicitPort pos = null; + if (valuePos == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Pos was a null pointer"); + } + pos = mWrapper.PolymorphicFactory(valuePos, ImplicitPort.class); + return pos; + } + + /** + * Retrieves the input for the finite difference step + * + * @return the input port for the finite difference step + * @throws Lib3MFException + */ + public ImplicitPort getInputStep() throws Lib3MFException { + Pointer bufferStep = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getinputstep.invokeInt(new java.lang.Object[]{mHandle, bufferStep})); + Pointer valueStep = bufferStep.getPointer(0); + ImplicitPort step = null; + if (valueStep == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Step was a null pointer"); + } + step = mWrapper.PolymorphicFactory(valueStep, ImplicitPort.class); + return step; + } + + /** + * Sets the name of the referenced scalar output + * + * @param scalarOutputName the name of the scalar output of the referenced function + * @throws Lib3MFException + */ + public void setScalarOutputName(String scalarOutputName) throws Lib3MFException { + byte[] bytesScalarOutputName = scalarOutputName.getBytes(StandardCharsets.UTF_8); + Memory bufferScalarOutputName = new Memory(bytesScalarOutputName.length + 1); + bufferScalarOutputName.write(0, bytesScalarOutputName, 0, bytesScalarOutputName.length); + bufferScalarOutputName.setByte(bytesScalarOutputName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_setscalaroutputname.invokeInt(new java.lang.Object[]{mHandle, bufferScalarOutputName})); + } + + /** + * Retrieves the name of the referenced scalar output + * + * @return the name of the scalar output of the referenced function + * @throws Lib3MFException + */ + public String getScalarOutputName() throws Lib3MFException { + Pointer bytesNeededScalarOutputName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getscalaroutputname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededScalarOutputName, null})); + int sizeScalarOutputName = bytesNeededScalarOutputName.getInt(0); + Pointer bufferScalarOutputName = new Memory(sizeScalarOutputName); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getscalaroutputname.invokeInt(new java.lang.Object[]{mHandle, sizeScalarOutputName, bytesNeededScalarOutputName, bufferScalarOutputName})); + return new String(bufferScalarOutputName.getByteArray(0, sizeScalarOutputName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the name of the referenced vector input + * + * @param vectorInputName the name of the vector input (float3) of the referenced function + * @throws Lib3MFException + */ + public void setVectorInputName(String vectorInputName) throws Lib3MFException { + byte[] bytesVectorInputName = vectorInputName.getBytes(StandardCharsets.UTF_8); + Memory bufferVectorInputName = new Memory(bytesVectorInputName.length + 1); + bufferVectorInputName.write(0, bytesVectorInputName, 0, bytesVectorInputName.length); + bufferVectorInputName.setByte(bytesVectorInputName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_setvectorinputname.invokeInt(new java.lang.Object[]{mHandle, bufferVectorInputName})); + } + + /** + * Retrieves the name of the referenced vector input + * + * @return the name of the vector input (float3) of the referenced function + * @throws Lib3MFException + */ + public String getVectorInputName() throws Lib3MFException { + Pointer bytesNeededVectorInputName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getvectorinputname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededVectorInputName, null})); + int sizeVectorInputName = bytesNeededVectorInputName.getInt(0); + Pointer bufferVectorInputName = new Memory(sizeVectorInputName); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getvectorinputname.invokeInt(new java.lang.Object[]{mHandle, sizeVectorInputName, bytesNeededVectorInputName, bufferVectorInputName})); + return new String(bufferVectorInputName.getByteArray(0, sizeVectorInputName - 1), StandardCharsets.UTF_8); + } + + /** + * Retrieves the normalized gradient output + * + * @return the output port for the normalized gradient + * @throws Lib3MFException + */ + public ImplicitPort getOutputNormalizedGradient() throws Lib3MFException { + Pointer bufferNormalizedGradient = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getoutputnormalizedgradient.invokeInt(new java.lang.Object[]{mHandle, bufferNormalizedGradient})); + Pointer valueNormalizedGradient = bufferNormalizedGradient.getPointer(0); + ImplicitPort normalizedGradient = null; + if (valueNormalizedGradient == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "NormalizedGradient was a null pointer"); + } + normalizedGradient = mWrapper.PolymorphicFactory(valueNormalizedGradient, ImplicitPort.class); + return normalizedGradient; + } + + /** + * Retrieves the raw gradient output + * + * @return the output port for the raw gradient + * @throws Lib3MFException + */ + public ImplicitPort getOutputGradient() throws Lib3MFException { + Pointer bufferGradient = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getoutputgradient.invokeInt(new java.lang.Object[]{mHandle, bufferGradient})); + Pointer valueGradient = bufferGradient.getPointer(0); + ImplicitPort gradient = null; + if (valueGradient == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Gradient was a null pointer"); + } + gradient = mWrapper.PolymorphicFactory(valueGradient, ImplicitPort.class); + return gradient; + } + + /** + * Retrieves the gradient magnitude output + * + * @return the output port for the gradient magnitude + * @throws Lib3MFException + */ + public ImplicitPort getOutputMagnitude() throws Lib3MFException { + Pointer bufferMagnitude = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functiongradientnode_getoutputmagnitude.invokeInt(new java.lang.Object[]{mHandle, bufferMagnitude})); + Pointer valueMagnitude = bufferMagnitude.getPointer(0); + ImplicitPort magnitude = null; + if (valueMagnitude == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Magnitude was a null pointer"); + } + magnitude = mWrapper.PolymorphicFactory(valueMagnitude, ImplicitPort.class); + return magnitude; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/FunctionIterator.java b/Autogenerated/Bindings/Java9/lib3mf/FunctionIterator.java new file mode 100644 index 000000000..034d58454 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/FunctionIterator.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class FunctionIterator extends ResourceIterator { + + public FunctionIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the Function the iterator points at. + * + * @return returns the Function instance. + * @throws Lib3MFException + */ + public Function getCurrentFunction() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functioniterator_getcurrentfunction.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + Function resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, Function.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/FunctionReference.java b/Autogenerated/Bindings/Java9/lib3mf/FunctionReference.java new file mode 100644 index 000000000..54cb9fa5d --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/FunctionReference.java @@ -0,0 +1,178 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class FunctionReference extends Base { + + public FunctionReference(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the UniqueResourceID of the Function. Only functions with a 'pos'-input are allowed. + * + * @return returns the UniqueResourceID. + * @throws Lib3MFException + */ + public int getFunctionResourceID() throws Lib3MFException { + Pointer bufferUniqueResourceID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_getfunctionresourceid.invokeInt(new java.lang.Object[]{mHandle, bufferUniqueResourceID})); + return bufferUniqueResourceID.getInt(0); + } + + /** + * Sets the UniqueResourceID to refer to. + * + * @param uniqueResourceID UniqueResourceID of the function + * @throws Lib3MFException + */ + public void setFunctionResourceID(int uniqueResourceID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_setfunctionresourceid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID})); + } + + /** + * Returns the transformation matrix into the coordinate system of the referenced Function. + * + * @return the transformation matrix + * @throws Lib3MFException + */ + public Transform getTransform() throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_gettransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * Sets the transformation matrix into the coordinate system of the referenced Function. + * + * @param transform new transformation matrix + * @throws Lib3MFException + */ + public void setTransform(Transform transform) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_settransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + } + + /** + * Returns the name of the function output channel to use. + * + * @return the name of the function output channel + * @throws Lib3MFException + */ + public String getChannelName() throws Lib3MFException { + Pointer bytesNeededChannelName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_getchannelname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededChannelName, null})); + int sizeChannelName = bytesNeededChannelName.getInt(0); + Pointer bufferChannelName = new Memory(sizeChannelName); + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_getchannelname.invokeInt(new java.lang.Object[]{mHandle, sizeChannelName, bytesNeededChannelName, bufferChannelName})); + return new String(bufferChannelName.getByteArray(0, sizeChannelName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the name of the function output channel to use. + * + * @param channelName new name of the function output channel + * @throws Lib3MFException + */ + public void setChannelName(String channelName) throws Lib3MFException { + byte[] bytesChannelName = channelName.getBytes(StandardCharsets.UTF_8); + Memory bufferChannelName = new Memory(bytesChannelName.length + 1); + bufferChannelName.write(0, bytesChannelName, 0, bytesChannelName.length); + bufferChannelName.setByte(bytesChannelName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_setchannelname.invokeInt(new java.lang.Object[]{mHandle, bufferChannelName})); + } + + /** + * Sets the minimal feature size as a hint for the function evaluator + * + * @param minFeatureSize minimal feature size + * @throws Lib3MFException + */ + public void setMinFeatureSize(double minFeatureSize) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_setminfeaturesize.invokeInt(new java.lang.Object[]{mHandle, minFeatureSize})); + } + + /** + * Returns the minimal feature size as a hint for the function evaluator + * + * @return minimal feature size + * @throws Lib3MFException + */ + public double getMinFeatureSize() throws Lib3MFException { + Pointer bufferMinFeatureSize = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_getminfeaturesize.invokeInt(new java.lang.Object[]{mHandle, bufferMinFeatureSize})); + return bufferMinFeatureSize.getDouble(0); + } + + /** + * Sets the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). + * + * @param fallBackValue fallback value + * @throws Lib3MFException + */ + public void setFallBackValue(double fallBackValue) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_setfallbackvalue.invokeInt(new java.lang.Object[]{mHandle, fallBackValue})); + } + + /** + * Returns the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). + * + * @return fallback value + * @throws Lib3MFException + */ + public double getFallBackValue() throws Lib3MFException { + Pointer bufferFallBackValue = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_functionreference_getfallbackvalue.invokeInt(new java.lang.Object[]{mHandle, bufferFallBackValue})); + return bufferFallBackValue.getDouble(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Image3D.java b/Autogenerated/Bindings/Java9/lib3mf/Image3D.java new file mode 100644 index 000000000..661e165c5 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Image3D.java @@ -0,0 +1,98 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Image3D extends Resource { + + public Image3D(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * returns the name of this Image3D + * + * @return the name of this Image3D + * @throws Lib3MFException + */ + public String getName() throws Lib3MFException { + Pointer bytesNeededName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_image3d_getname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededName, null})); + int sizeName = bytesNeededName.getInt(0); + Pointer bufferName = new Memory(sizeName); + mWrapper.checkError(this, mWrapper.lib3mf_image3d_getname.invokeInt(new java.lang.Object[]{mHandle, sizeName, bytesNeededName, bufferName})); + return new String(bufferName.getByteArray(0, sizeName - 1), StandardCharsets.UTF_8); + } + + /** + * sets a new name of this Image3D + * + * @param name the new name of this Image3D + * @throws Lib3MFException + */ + public void setName(String name) throws Lib3MFException { + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_image3d_setname.invokeInt(new java.lang.Object[]{mHandle, bufferName})); + } + + /** + * Retrieves, if this Image3D is a ImageStack + * + * @return returns, whether the Image3D is an ImageStack + * @throws Lib3MFException + */ + public boolean isImageStack() throws Lib3MFException { + Pointer bufferIsImageStack = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_image3d_isimagestack.invokeInt(new java.lang.Object[]{mHandle, bufferIsImageStack})); + return bufferIsImageStack.getByte(0) != 0; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Image3DIterator.java b/Autogenerated/Bindings/Java9/lib3mf/Image3DIterator.java new file mode 100644 index 000000000..cd8dfdf55 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Image3DIterator.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Image3DIterator extends ResourceIterator { + + public Image3DIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the Image3D the iterator points at. + * + * @return returns the Image3D instance. + * @throws Lib3MFException + */ + public Image3D getCurrentImage3D() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_image3diterator_getcurrentimage3d.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + Image3D resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, Image3D.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ImageStack.java b/Autogenerated/Bindings/Java9/lib3mf/ImageStack.java new file mode 100644 index 000000000..e1aa6ea12 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ImageStack.java @@ -0,0 +1,231 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ImageStack extends Image3D { + + public ImageStack(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the number of rows in each image of this image3d + * + * @return number of rows + * @throws Lib3MFException + */ + public int getRowCount() throws Lib3MFException { + Pointer bufferRowCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_getrowcount.invokeInt(new java.lang.Object[]{mHandle, bufferRowCount})); + return bufferRowCount.getInt(0); + } + + /** + * Sets the number of rows in each image of this image3d + * + * @param rowCount number of rows + * @throws Lib3MFException + */ + public void setRowCount(int rowCount) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_setrowcount.invokeInt(new java.lang.Object[]{mHandle, rowCount})); + } + + /** + * Retrieves the number of columns in each image of this image3d + * + * @return number of columns + * @throws Lib3MFException + */ + public int getColumnCount() throws Lib3MFException { + Pointer bufferColumnCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_getcolumncount.invokeInt(new java.lang.Object[]{mHandle, bufferColumnCount})); + return bufferColumnCount.getInt(0); + } + + /** + * Sets the number of columns in each image of this image3d + * + * @param columnCount number of columns + * @throws Lib3MFException + */ + public void setColumnCount(int columnCount) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_setcolumncount.invokeInt(new java.lang.Object[]{mHandle, columnCount})); + } + + /** + * Retrieves the number of images in the stack. + * + * @return number of images + * @throws Lib3MFException + */ + public int getSheetCount() throws Lib3MFException { + Pointer bufferSheetCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_getsheetcount.invokeInt(new java.lang.Object[]{mHandle, bufferSheetCount})); + return bufferSheetCount.getInt(0); + } + + /** + * Retrieves a sheet of the stack. Raises an error if sheet is not set. + * + * @param index index of the image (0-based) + * @return attachment containing the image + * @throws Lib3MFException + */ + public Attachment getSheet(int index) throws Lib3MFException { + Pointer bufferSheet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_getsheet.invokeInt(new java.lang.Object[]{mHandle, index, bufferSheet})); + Pointer valueSheet = bufferSheet.getPointer(0); + Attachment sheet = null; + if (valueSheet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Sheet was a null pointer"); + } + sheet = mWrapper.PolymorphicFactory(valueSheet, Attachment.class); + return sheet; + } + + /** + * Sets a sheet to an existing attachment. + * + * @param index index of the image (0-based) + * @param sheet attachment containing the image + * @throws Lib3MFException + */ + public void setSheet(int index, Attachment sheet) throws Lib3MFException { + Pointer sheetHandle = null; + if (sheet != null) { + sheetHandle = sheet.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Sheet is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_setsheet.invokeInt(new java.lang.Object[]{mHandle, index, sheetHandle})); + } + + /** + * Creates a new sheet attachment with empty data. + * + * @param index index of the image (0-based) + * @param path path of part in the package + * @return attachment containing the image + * @throws Lib3MFException + */ + public Attachment createEmptySheet(int index, String path) throws Lib3MFException { + byte[] bytesPath = path.getBytes(StandardCharsets.UTF_8); + Memory bufferPath = new Memory(bytesPath.length + 1); + bufferPath.write(0, bytesPath, 0, bytesPath.length); + bufferPath.setByte(bytesPath.length, (byte)0); + Pointer bufferSheet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_createemptysheet.invokeInt(new java.lang.Object[]{mHandle, index, bufferPath, bufferSheet})); + Pointer valueSheet = bufferSheet.getPointer(0); + Attachment sheet = null; + if (valueSheet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Sheet was a null pointer"); + } + sheet = mWrapper.PolymorphicFactory(valueSheet, Attachment.class); + return sheet; + } + + /** + * Creates a new sheet attachment from a memory buffer. + * + * @param index index of the image (0-based) + * @param path path of part in the package + * @param data binary image data + * @return attachment containing the image + * @throws Lib3MFException + */ + public Attachment createSheetFromBuffer(int index, String path, byte[] data) throws Lib3MFException { + byte[] bytesPath = path.getBytes(StandardCharsets.UTF_8); + Memory bufferPath = new Memory(bytesPath.length + 1); + bufferPath.write(0, bytesPath, 0, bytesPath.length); + bufferPath.setByte(bytesPath.length, (byte)0); + Pointer bufferData = new Memory(Math.max(1, 1 * data.length)); + for (int i = 0; i < data.length; i++) { + bufferData.setByte(1 * i, data[i]); + } + Pointer bufferSheet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_createsheetfrombuffer.invokeInt(new java.lang.Object[]{mHandle, index, bufferPath, (long) data.length, bufferData, bufferSheet})); + Pointer valueSheet = bufferSheet.getPointer(0); + Attachment sheet = null; + if (valueSheet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Sheet was a null pointer"); + } + sheet = mWrapper.PolymorphicFactory(valueSheet, Attachment.class); + return sheet; + } + + /** + * Creates a new sheet attachment from a file on disk. + * + * @param index index of the image (0-based) + * @param path path of part in the package + * @param fileName file name to read from + * @return attachment containing the image + * @throws Lib3MFException + */ + public Attachment createSheetFromFile(int index, String path, String fileName) throws Lib3MFException { + byte[] bytesPath = path.getBytes(StandardCharsets.UTF_8); + Memory bufferPath = new Memory(bytesPath.length + 1); + bufferPath.write(0, bytesPath, 0, bytesPath.length); + bufferPath.setByte(bytesPath.length, (byte)0); + byte[] bytesFileName = fileName.getBytes(StandardCharsets.UTF_8); + Memory bufferFileName = new Memory(bytesFileName.length + 1); + bufferFileName.write(0, bytesFileName, 0, bytesFileName.length); + bufferFileName.setByte(bytesFileName.length, (byte)0); + Pointer bufferSheet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_imagestack_createsheetfromfile.invokeInt(new java.lang.Object[]{mHandle, index, bufferPath, bufferFileName, bufferSheet})); + Pointer valueSheet = bufferSheet.getPointer(0); + Attachment sheet = null; + if (valueSheet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Sheet was a null pointer"); + } + sheet = mWrapper.PolymorphicFactory(valueSheet, Attachment.class); + return sheet; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ImplicitFunction.java b/Autogenerated/Bindings/Java9/lib3mf/ImplicitFunction.java new file mode 100644 index 000000000..c3405e7fa --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ImplicitFunction.java @@ -0,0 +1,1962 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ImplicitFunction extends Function { + + public ImplicitFunction(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the identifier of the function + * + * @return the identifier + * @throws Lib3MFException + */ + public String getIdentifier() throws Lib3MFException { + Pointer bytesNeededIdentifier = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_getidentifier.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededIdentifier, null})); + int sizeIdentifier = bytesNeededIdentifier.getInt(0); + Pointer bufferIdentifier = new Memory(sizeIdentifier); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_getidentifier.invokeInt(new java.lang.Object[]{mHandle, sizeIdentifier, bytesNeededIdentifier, bufferIdentifier})); + return new String(bufferIdentifier.getByteArray(0, sizeIdentifier - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the identifier of the function + * + * @param identifier the identifier + * @throws Lib3MFException + */ + public void setIdentifier(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_setidentifier.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier})); + } + + /** + * Add a node + * + * @param nodeType the type of the node + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ImplicitNode addNode(Lib3MFWrapper.ImplicitNodeType nodeType, String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addnode.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertImplicitNodeTypeToConst(nodeType), bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ImplicitNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ImplicitNode.class); + return node; + } + + /** + * Add a SinNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public SinNode addSinNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addsinnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + SinNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, SinNode.class); + return node; + } + + /** + * Add a CosNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public CosNode addCosNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addcosnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + CosNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, CosNode.class); + return node; + } + + /** + * Add a TanNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public TanNode addTanNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addtannode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + TanNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, TanNode.class); + return node; + } + + /** + * Add a ArcSinNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ArcSinNode addArcSinNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addarcsinnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ArcSinNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ArcSinNode.class); + return node; + } + + /** + * Add a ArcCosNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ArcCosNode addArcCosNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addarccosnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ArcCosNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ArcCosNode.class); + return node; + } + + /** + * Add a ArcTan2Node + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ArcTan2Node addArcTan2Node(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addarctan2node.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ArcTan2Node node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ArcTan2Node.class); + return node; + } + + /** + * Add a SinhNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public SinhNode addSinhNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addsinhnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + SinhNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, SinhNode.class); + return node; + } + + /** + * Add a CoshNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public CoshNode addCoshNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addcoshnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + CoshNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, CoshNode.class); + return node; + } + + /** + * Add a TanhNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public TanhNode addTanhNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addtanhnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + TanhNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, TanhNode.class); + return node; + } + + /** + * Add a RoundNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public RoundNode addRoundNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addroundnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + RoundNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, RoundNode.class); + return node; + } + + /** + * Add a CeilNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public CeilNode addCeilNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addceilnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + CeilNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, CeilNode.class); + return node; + } + + /** + * Add a FloorNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public FloorNode addFloorNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addfloornode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + FloorNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, FloorNode.class); + return node; + } + + /** + * Add a SignNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public SignNode addSignNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addsignnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + SignNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, SignNode.class); + return node; + } + + /** + * Add a FractNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public FractNode addFractNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addfractnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + FractNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, FractNode.class); + return node; + } + + /** + * Add a AbsNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public AbsNode addAbsNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addabsnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + AbsNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, AbsNode.class); + return node; + } + + /** + * Add a ExpNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ExpNode addExpNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addexpnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ExpNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ExpNode.class); + return node; + } + + /** + * Add a LogNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public LogNode addLogNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addlognode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + LogNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, LogNode.class); + return node; + } + + /** + * Add a Log2Node + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public Log2Node addLog2Node(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addlog2node.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + Log2Node node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, Log2Node.class); + return node; + } + + /** + * Add a Log10Node + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public Log10Node addLog10Node(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addlog10node.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + Log10Node node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, Log10Node.class); + return node; + } + + /** + * Add a LengthNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public LengthNode addLengthNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addlengthnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + LengthNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, LengthNode.class); + return node; + } + + /** + * Add a TransposeNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public TransposeNode addTransposeNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addtransposenode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + TransposeNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, TransposeNode.class); + return node; + } + + /** + * Add a InverseNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public InverseNode addInverseNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addinversenode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + InverseNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, InverseNode.class); + return node; + } + + /** + * Add a SqrtNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public SqrtNode addSqrtNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addsqrtnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + SqrtNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, SqrtNode.class); + return node; + } + + /** + * Add a ResourceIdNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ResourceIdNode addResourceIdNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addresourceidnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ResourceIdNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ResourceIdNode.class); + return node; + } + + /** + * Add an AdditionNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public AdditionNode addAdditionNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addadditionnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + AdditionNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, AdditionNode.class); + return node; + } + + /** + * Add a SubtractionNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public SubtractionNode addSubtractionNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addsubtractionnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + SubtractionNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, SubtractionNode.class); + return node; + } + + /** + * Add a MultiplicationNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public MultiplicationNode addMultiplicationNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addmultiplicationnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + MultiplicationNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, MultiplicationNode.class); + return node; + } + + /** + * Add a DivisionNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public DivisionNode addDivisionNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_adddivisionnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + DivisionNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, DivisionNode.class); + return node; + } + + /** + * Add a DotNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public DotNode addDotNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_adddotnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + DotNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, DotNode.class); + return node; + } + + /** + * Add a CrossNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public CrossNode addCrossNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addcrossnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + CrossNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, CrossNode.class); + return node; + } + + /** + * Add a MatVecMultiplicationNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public MatVecMultiplicationNode addMatVecMultiplicationNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addmatvecmultiplicationnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + MatVecMultiplicationNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, MatVecMultiplicationNode.class); + return node; + } + + /** + * Add a MinNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public MinNode addMinNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addminnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + MinNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, MinNode.class); + return node; + } + + /** + * Add a MaxNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public MaxNode addMaxNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addmaxnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + MaxNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, MaxNode.class); + return node; + } + + /** + * Add a FmodNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public FmodNode addFmodNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addfmodnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + FmodNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, FmodNode.class); + return node; + } + + /** + * Add a PowNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public PowNode addPowNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addpownode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + PowNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, PowNode.class); + return node; + } + + /** + * Add a SelectNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public SelectNode addSelectNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addselectnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + SelectNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, SelectNode.class); + return node; + } + + /** + * Add a ClampNode + * + * @param identifier the identifier of the node + * @param configuration the configuration of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ClampNode addClampNode(String identifier, Lib3MFWrapper.ImplicitNodeConfiguration configuration, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addclampnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, Lib3MFWrapper.EnumConversion.convertImplicitNodeConfigurationToConst(configuration), bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ClampNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ClampNode.class); + return node; + } + + /** + * Add a ComposeVectorNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ComposeVectorNode addComposeVectorNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addcomposevectornode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ComposeVectorNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ComposeVectorNode.class); + return node; + } + + /** + * Add a VectorFromScalar + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public VectorFromScalarNode addVectorFromScalarNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addvectorfromscalarnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + VectorFromScalarNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, VectorFromScalarNode.class); + return node; + } + + /** + * Add a DecomposeVectorNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public DecomposeVectorNode addDecomposeVectorNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_adddecomposevectornode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + DecomposeVectorNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, DecomposeVectorNode.class); + return node; + } + + /** + * Add a ComposeMatrixNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ComposeMatrixNode addComposeMatrixNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addcomposematrixnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ComposeMatrixNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ComposeMatrixNode.class); + return node; + } + + /** + * Add a MatrixFromRowsNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public MatrixFromRowsNode addMatrixFromRowsNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addmatrixfromrowsnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + MatrixFromRowsNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, MatrixFromRowsNode.class); + return node; + } + + /** + * Add a MatrixFromColumnsNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public MatrixFromColumnsNode addMatrixFromColumnsNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addmatrixfromcolumnsnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + MatrixFromColumnsNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, MatrixFromColumnsNode.class); + return node; + } + + /** + * Add a ConstantNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ConstantNode addConstantNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addconstantnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ConstantNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ConstantNode.class); + return node; + } + + /** + * Add a ConstVecNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ConstVecNode addConstVecNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addconstvecnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ConstVecNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ConstVecNode.class); + return node; + } + + /** + * Add a ConstMatNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public ConstMatNode addConstMatNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addconstmatnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ConstMatNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ConstMatNode.class); + return node; + } + + /** + * Add a MeshNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public MeshNode addMeshNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addmeshnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + MeshNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, MeshNode.class); + return node; + } + + /** + * Add a UnsignedMeshNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public UnsignedMeshNode addUnsignedMeshNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addunsignedmeshnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + UnsignedMeshNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, UnsignedMeshNode.class); + return node; + } + + /** + * Add a BeamLatticeNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public BeamLatticeNode addBeamLatticeNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addbeamlatticenode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + BeamLatticeNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, BeamLatticeNode.class); + return node; + } + + /** + * Add a FunctionGradientNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public FunctionGradientNode addFunctionGradientNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addfunctiongradientnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + FunctionGradientNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, FunctionGradientNode.class); + return node; + } + + /** + * Add a NormalizeDistanceNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public NormalizeDistanceNode addNormalizeDistanceNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addnormalizedistancenode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + NormalizeDistanceNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, NormalizeDistanceNode.class); + return node; + } + + /** + * Add a FunctionCallNode + * + * @param identifier the identifier of the node + * @param displayName the display name of the node + * @param tag the tag of the node + * @return the added node + * @throws Lib3MFException + */ + public FunctionCallNode addFunctionCallNode(String identifier, String displayName, String tag) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addfunctioncallnode.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferTag, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + FunctionCallNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, FunctionCallNode.class); + return node; + } + + /** + * Retrieves the nodes + * + * @return iterator for the list of nodes + * @throws Lib3MFException + */ + public NodeIterator getNodes() throws Lib3MFException { + Pointer bufferIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_getnodes.invokeInt(new java.lang.Object[]{mHandle, bufferIterator})); + Pointer valueIterator = bufferIterator.getPointer(0); + NodeIterator iterator = null; + if (valueIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Iterator was a null pointer"); + } + iterator = mWrapper.PolymorphicFactory(valueIterator, NodeIterator.class); + return iterator; + } + + /** + * Removes a node + * + * @param node The node to be removed + * @throws Lib3MFException + */ + public void removeNode(ImplicitNode node) throws Lib3MFException { + Pointer nodeHandle = null; + if (node != null) { + nodeHandle = node.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_removenode.invokeInt(new java.lang.Object[]{mHandle, nodeHandle})); + } + + /** + * Add a link + * + * @param source the source port + * @param target the target port + * @throws Lib3MFException + */ + public void addLink(ImplicitPort source, ImplicitPort target) throws Lib3MFException { + Pointer sourceHandle = null; + if (source != null) { + sourceHandle = source.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Source is a null value."); + } + Pointer targetHandle = null; + if (target != null) { + targetHandle = target.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Target is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addlink.invokeInt(new java.lang.Object[]{mHandle, sourceHandle, targetHandle})); + } + + /** + * Add a link + * + * @param source name of the source port in the format nodename.portname + * @param target name of the target port in the format nodename.portname + * @throws Lib3MFException + */ + public void addLinkByNames(String source, String target) throws Lib3MFException { + byte[] bytesSource = source.getBytes(StandardCharsets.UTF_8); + Memory bufferSource = new Memory(bytesSource.length + 1); + bufferSource.write(0, bytesSource, 0, bytesSource.length); + bufferSource.setByte(bytesSource.length, (byte)0); + byte[] bytesTarget = target.getBytes(StandardCharsets.UTF_8); + Memory bufferTarget = new Memory(bytesTarget.length + 1); + bufferTarget.write(0, bytesTarget, 0, bytesTarget.length); + bufferTarget.setByte(bytesTarget.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_addlinkbynames.invokeInt(new java.lang.Object[]{mHandle, bufferSource, bufferTarget})); + } + + /** + * Clears the function + * + * @throws Lib3MFException + */ + public void clear() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_clear.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Sorts the nodes topologically + * + * @throws Lib3MFException + */ + public void sortNodesTopologically() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_implicitfunction_sortnodestopologically.invokeInt(new java.lang.Object[]{mHandle})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ImplicitNode.java b/Autogenerated/Bindings/Java9/lib3mf/ImplicitNode.java new file mode 100644 index 000000000..357b2b5a5 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ImplicitNode.java @@ -0,0 +1,304 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ImplicitNode extends Base { + + public ImplicitNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the identifier of the node + * + * @return the identifier + * @throws Lib3MFException + */ + public String getIdentifier() throws Lib3MFException { + Pointer bytesNeededIdentifier = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_getidentifier.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededIdentifier, null})); + int sizeIdentifier = bytesNeededIdentifier.getInt(0); + Pointer bufferIdentifier = new Memory(sizeIdentifier); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_getidentifier.invokeInt(new java.lang.Object[]{mHandle, sizeIdentifier, bytesNeededIdentifier, bufferIdentifier})); + return new String(bufferIdentifier.getByteArray(0, sizeIdentifier - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the identifier of the node + * + * @param identifier the identifier + * @throws Lib3MFException + */ + public void setIdentifier(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_setidentifier.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier})); + } + + /** + * Retrieves the display name of the node + * + * @return the display name + * @throws Lib3MFException + */ + public String getDisplayName() throws Lib3MFException { + Pointer bytesNeededDisplayName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_getdisplayname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededDisplayName, null})); + int sizeDisplayName = bytesNeededDisplayName.getInt(0); + Pointer bufferDisplayName = new Memory(sizeDisplayName); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_getdisplayname.invokeInt(new java.lang.Object[]{mHandle, sizeDisplayName, bytesNeededDisplayName, bufferDisplayName})); + return new String(bufferDisplayName.getByteArray(0, sizeDisplayName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the display name of the node + * + * @param displayName the display name + * @throws Lib3MFException + */ + public void setDisplayName(String displayName) throws Lib3MFException { + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_setdisplayname.invokeInt(new java.lang.Object[]{mHandle, bufferDisplayName})); + } + + /** + * Retrieves the tag of the node + * + * @return the tag + * @throws Lib3MFException + */ + public String getTag() throws Lib3MFException { + Pointer bytesNeededTag = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_gettag.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededTag, null})); + int sizeTag = bytesNeededTag.getInt(0); + Pointer bufferTag = new Memory(sizeTag); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_gettag.invokeInt(new java.lang.Object[]{mHandle, sizeTag, bytesNeededTag, bufferTag})); + return new String(bufferTag.getByteArray(0, sizeTag - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the tag of the node + * + * @param tag the tag + * @throws Lib3MFException + */ + public void setTag(String tag) throws Lib3MFException { + byte[] bytesTag = tag.getBytes(StandardCharsets.UTF_8); + Memory bufferTag = new Memory(bytesTag.length + 1); + bufferTag.write(0, bytesTag, 0, bytesTag.length); + bufferTag.setByte(bytesTag.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_settag.invokeInt(new java.lang.Object[]{mHandle, bufferTag})); + } + + /** + * Retrieves the type of the node + * + * @return the type of the node + * @throws Lib3MFException + */ + public Lib3MFWrapper.ImplicitNodeType getNodeType() throws Lib3MFException { + Pointer bufferType = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_getnodetype.invokeInt(new java.lang.Object[]{mHandle, bufferType})); + return Lib3MFWrapper.EnumConversion.convertConstToImplicitNodeType(bufferType.getInt(0)); + } + + /** + * Add an input + * + * @param identifier the identifier of the input + * @param displayName the display name of the input + * @return + * @throws Lib3MFException + */ + public ImplicitPort addInput(String identifier, String displayName) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + Pointer bufferPort = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_addinput.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferPort})); + Pointer valuePort = bufferPort.getPointer(0); + ImplicitPort port = null; + if (valuePort == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Port was a null pointer"); + } + port = mWrapper.PolymorphicFactory(valuePort, ImplicitPort.class); + return port; + } + + /** + * Retrieves the inputs + * + * @return the iterator for the inputs + * @throws Lib3MFException + */ + public ImplicitPortIterator getInputs() throws Lib3MFException { + Pointer bufferIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_getinputs.invokeInt(new java.lang.Object[]{mHandle, bufferIterator})); + Pointer valueIterator = bufferIterator.getPointer(0); + ImplicitPortIterator iterator = null; + if (valueIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Iterator was a null pointer"); + } + iterator = mWrapper.PolymorphicFactory(valueIterator, ImplicitPortIterator.class); + return iterator; + } + + /** + * Add an output + * + * @param identifier the identifier of the output + * @param displayName the display name of the output + * @return + * @throws Lib3MFException + */ + public ImplicitPort addOutput(String identifier, String displayName) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + Pointer bufferPort = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_addoutput.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferDisplayName, bufferPort})); + Pointer valuePort = bufferPort.getPointer(0); + ImplicitPort port = null; + if (valuePort == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Port was a null pointer"); + } + port = mWrapper.PolymorphicFactory(valuePort, ImplicitPort.class); + return port; + } + + /** + * Retrieves the outputs + * + * @return the iterator the outputs + * @throws Lib3MFException + */ + public ImplicitPortIterator getOutputs() throws Lib3MFException { + Pointer bufferIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_getoutputs.invokeInt(new java.lang.Object[]{mHandle, bufferIterator})); + Pointer valueIterator = bufferIterator.getPointer(0); + ImplicitPortIterator iterator = null; + if (valueIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Iterator was a null pointer"); + } + iterator = mWrapper.PolymorphicFactory(valueIterator, ImplicitPortIterator.class); + return iterator; + } + + /** + * Retrieves an input + * + * @param identifier the identifier of the input + * @return the input port + * @throws Lib3MFException + */ + public ImplicitPort findInput(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + Pointer bufferInput = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_findinput.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferInput})); + Pointer valueInput = bufferInput.getPointer(0); + ImplicitPort input = null; + if (valueInput != Pointer.NULL) { + input = mWrapper.PolymorphicFactory(valueInput, ImplicitPort.class); + } + return input; + } + + /** + * Retrieves an output + * + * @param identifier the identifier of the output + * @return the output port + * @throws Lib3MFException + */ + public ImplicitPort findOutput(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + Pointer bufferOutput = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_findoutput.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferOutput})); + Pointer valueOutput = bufferOutput.getPointer(0); + ImplicitPort output = null; + if (valueOutput != Pointer.NULL) { + output = mWrapper.PolymorphicFactory(valueOutput, ImplicitPort.class); + } + return output; + } + + /** + * Checks if the types of the input and output ports are valid for the node type + * + * @return true, if the types are valid + * @throws Lib3MFException + */ + public boolean areTypesValid() throws Lib3MFException { + Pointer bufferValid = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_implicitnode_aretypesvalid.invokeInt(new java.lang.Object[]{mHandle, bufferValid})); + return bufferValid.getByte(0) != 0; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ImplicitPort.java b/Autogenerated/Bindings/Java9/lib3mf/ImplicitPort.java new file mode 100644 index 000000000..fc376d6e4 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ImplicitPort.java @@ -0,0 +1,166 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ImplicitPort extends Base { + + public ImplicitPort(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the identifier of the port + * + * @return the identifier + * @throws Lib3MFException + */ + public String getIdentifier() throws Lib3MFException { + Pointer bytesNeededIdentifier = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_getidentifier.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededIdentifier, null})); + int sizeIdentifier = bytesNeededIdentifier.getInt(0); + Pointer bufferIdentifier = new Memory(sizeIdentifier); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_getidentifier.invokeInt(new java.lang.Object[]{mHandle, sizeIdentifier, bytesNeededIdentifier, bufferIdentifier})); + return new String(bufferIdentifier.getByteArray(0, sizeIdentifier - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the identifier of the port + * + * @param identifier the identifier + * @throws Lib3MFException + */ + public void setIdentifier(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_setidentifier.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier})); + } + + /** + * Retrieves the display name of the port + * + * @return the display name + * @throws Lib3MFException + */ + public String getDisplayName() throws Lib3MFException { + Pointer bytesNeededDisplayName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_getdisplayname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededDisplayName, null})); + int sizeDisplayName = bytesNeededDisplayName.getInt(0); + Pointer bufferDisplayName = new Memory(sizeDisplayName); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_getdisplayname.invokeInt(new java.lang.Object[]{mHandle, sizeDisplayName, bytesNeededDisplayName, bufferDisplayName})); + return new String(bufferDisplayName.getByteArray(0, sizeDisplayName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the display name of the port + * + * @param displayName the display name + * @throws Lib3MFException + */ + public void setDisplayName(String displayName) throws Lib3MFException { + byte[] bytesDisplayName = displayName.getBytes(StandardCharsets.UTF_8); + Memory bufferDisplayName = new Memory(bytesDisplayName.length + 1); + bufferDisplayName.write(0, bytesDisplayName, 0, bytesDisplayName.length); + bufferDisplayName.setByte(bytesDisplayName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_setdisplayname.invokeInt(new java.lang.Object[]{mHandle, bufferDisplayName})); + } + + /** + * Sets the type of the port + * + * @param implicitPortType the type + * @throws Lib3MFException + */ + public void setType(Lib3MFWrapper.ImplicitPortType implicitPortType) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_settype.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertImplicitPortTypeToConst(implicitPortType)})); + } + + /** + * Retrieves the type of the port + * + * @return the type + * @throws Lib3MFException + */ + public Lib3MFWrapper.ImplicitPortType getType() throws Lib3MFException { + Pointer bufferImplicitPortType = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_gettype.invokeInt(new java.lang.Object[]{mHandle, bufferImplicitPortType})); + return Lib3MFWrapper.EnumConversion.convertConstToImplicitPortType(bufferImplicitPortType.getInt(0)); + } + + /** + * Retrieves the reference of the port, only used for input ports + * + * @return the reference + * @throws Lib3MFException + */ + public String getReference() throws Lib3MFException { + Pointer bytesNeededReference = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_getreference.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededReference, null})); + int sizeReference = bytesNeededReference.getInt(0); + Pointer bufferReference = new Memory(sizeReference); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_getreference.invokeInt(new java.lang.Object[]{mHandle, sizeReference, bytesNeededReference, bufferReference})); + return new String(bufferReference.getByteArray(0, sizeReference - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the reference of the port, only used for input ports + * + * @param reference the reference + * @throws Lib3MFException + */ + public void setReference(String reference) throws Lib3MFException { + byte[] bytesReference = reference.getBytes(StandardCharsets.UTF_8); + Memory bufferReference = new Memory(bytesReference.length + 1); + bufferReference.write(0, bytesReference, 0, bytesReference.length); + bufferReference.setByte(bytesReference.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_implicitport_setreference.invokeInt(new java.lang.Object[]{mHandle, bufferReference})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ImplicitPortIterator.java b/Autogenerated/Bindings/Java9/lib3mf/ImplicitPortIterator.java new file mode 100644 index 000000000..18b71da2d --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ImplicitPortIterator.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ImplicitPortIterator extends Iterator { + + public ImplicitPortIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the current element + * + * @return The current element + * @throws Lib3MFException + */ + public ImplicitPort getCurrent() throws Lib3MFException { + Pointer bufferPort = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_implicitportiterator_getcurrent.invokeInt(new java.lang.Object[]{mHandle, bufferPort})); + Pointer valuePort = bufferPort.getPointer(0); + ImplicitPort port = null; + if (valuePort == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Port was a null pointer"); + } + port = mWrapper.PolymorphicFactory(valuePort, ImplicitPort.class); + return port; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/InverseNode.java b/Autogenerated/Bindings/Java9/lib3mf/InverseNode.java new file mode 100644 index 000000000..1d554817a --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/InverseNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class InverseNode extends OneInputNode { + + public InverseNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Iterator.java b/Autogenerated/Bindings/Java9/lib3mf/Iterator.java new file mode 100644 index 000000000..fab8636c2 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Iterator.java @@ -0,0 +1,93 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Iterator extends Base { + + public Iterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Iterates to the next item in the list. + * + * @return Iterates to the next item in the list. + * @throws Lib3MFException + */ + public boolean moveNext() throws Lib3MFException { + Pointer bufferHasNext = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_iterator_movenext.invokeInt(new java.lang.Object[]{mHandle, bufferHasNext})); + return bufferHasNext.getByte(0) != 0; + } + + /** + * Iterates to the previous item in the list. + * + * @return Iterates to the previous item in the list. + * @throws Lib3MFException + */ + public boolean movePrevious() throws Lib3MFException { + Pointer bufferHasPrevious = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_iterator_moveprevious.invokeInt(new java.lang.Object[]{mHandle, bufferHasPrevious})); + return bufferHasPrevious.getByte(0) != 0; + } + + /** + * Returns the number of items the iterator captures. + * + * @return returns the number of items the iterator captures. + * @throws Lib3MFException + */ + public long count() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_iterator_count.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/KeyStore.java b/Autogenerated/Bindings/Java9/lib3mf/KeyStore.java new file mode 100644 index 000000000..e71b5f9ee --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/KeyStore.java @@ -0,0 +1,403 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class KeyStore extends Base { + + public KeyStore(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Adds a consumer to the keystore + * + * @param consumerID A unique identifier for the consumer + * @param keyID The id of the key of the consumer + * @param keyValue The public key for this consumer in PEM format + * @return The consumer instance + * @throws Lib3MFException + */ + public Consumer addConsumer(String consumerID, String keyID, String keyValue) throws Lib3MFException { + byte[] bytesConsumerID = consumerID.getBytes(StandardCharsets.UTF_8); + Memory bufferConsumerID = new Memory(bytesConsumerID.length + 1); + bufferConsumerID.write(0, bytesConsumerID, 0, bytesConsumerID.length); + bufferConsumerID.setByte(bytesConsumerID.length, (byte)0); + byte[] bytesKeyID = keyID.getBytes(StandardCharsets.UTF_8); + Memory bufferKeyID = new Memory(bytesKeyID.length + 1); + bufferKeyID.write(0, bytesKeyID, 0, bytesKeyID.length); + bufferKeyID.setByte(bytesKeyID.length, (byte)0); + byte[] bytesKeyValue = keyValue.getBytes(StandardCharsets.UTF_8); + Memory bufferKeyValue = new Memory(bytesKeyValue.length + 1); + bufferKeyValue.write(0, bytesKeyValue, 0, bytesKeyValue.length); + bufferKeyValue.setByte(bytesKeyValue.length, (byte)0); + Pointer bufferConsumer = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_addconsumer.invokeInt(new java.lang.Object[]{mHandle, bufferConsumerID, bufferKeyID, bufferKeyValue, bufferConsumer})); + Pointer valueConsumer = bufferConsumer.getPointer(0); + Consumer consumer = null; + if (valueConsumer == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Consumer was a null pointer"); + } + consumer = mWrapper.PolymorphicFactory(valueConsumer, Consumer.class); + return consumer; + } + + /** + * Gets the number of consumers in the keystore + * + * @return The consumer count + * @throws Lib3MFException + */ + public long getConsumerCount() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_getconsumercount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + /** + * Get a consumer from the keystore + * + * @param consumerIndex The index of the consumer + * @return The consumer instance + * @throws Lib3MFException + */ + public Consumer getConsumer(long consumerIndex) throws Lib3MFException { + Pointer bufferConsumer = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_getconsumer.invokeInt(new java.lang.Object[]{mHandle, consumerIndex, bufferConsumer})); + Pointer valueConsumer = bufferConsumer.getPointer(0); + Consumer consumer = null; + if (valueConsumer == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Consumer was a null pointer"); + } + consumer = mWrapper.PolymorphicFactory(valueConsumer, Consumer.class); + return consumer; + } + + /** + * Removes a consumer from the keystore + * + * @param consumer The consumer instance to remove + * @throws Lib3MFException + */ + public void removeConsumer(Consumer consumer) throws Lib3MFException { + Pointer consumerHandle = null; + if (consumer != null) { + consumerHandle = consumer.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Consumer is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_keystore_removeconsumer.invokeInt(new java.lang.Object[]{mHandle, consumerHandle})); + } + + /** + * Finds a consumer by ID + * + * @param consumerID The ID of the consumer + * @return The consumer instance + * @throws Lib3MFException + */ + public Consumer findConsumer(String consumerID) throws Lib3MFException { + byte[] bytesConsumerID = consumerID.getBytes(StandardCharsets.UTF_8); + Memory bufferConsumerID = new Memory(bytesConsumerID.length + 1); + bufferConsumerID.write(0, bytesConsumerID, 0, bytesConsumerID.length); + bufferConsumerID.setByte(bytesConsumerID.length, (byte)0); + Pointer bufferConsumer = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_findconsumer.invokeInt(new java.lang.Object[]{mHandle, bufferConsumerID, bufferConsumer})); + Pointer valueConsumer = bufferConsumer.getPointer(0); + Consumer consumer = null; + if (valueConsumer != Pointer.NULL) { + consumer = mWrapper.PolymorphicFactory(valueConsumer, Consumer.class); + } + return consumer; + } + + /** + * Gets the number of resource data group in the keysore + * + * @return The number of resource data available + * @throws Lib3MFException + */ + public long getResourceDataGroupCount() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_getresourcedatagroupcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + /** + * Adds a resource data group into the keystore. + * + * @return The resource data group instance + * @throws Lib3MFException + */ + public ResourceDataGroup addResourceDataGroup() throws Lib3MFException { + Pointer bufferResourceDataGroup = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_addresourcedatagroup.invokeInt(new java.lang.Object[]{mHandle, bufferResourceDataGroup})); + Pointer valueResourceDataGroup = bufferResourceDataGroup.getPointer(0); + ResourceDataGroup resourceDataGroup = null; + if (valueResourceDataGroup == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceDataGroup was a null pointer"); + } + resourceDataGroup = mWrapper.PolymorphicFactory(valueResourceDataGroup, ResourceDataGroup.class); + return resourceDataGroup; + } + + /** + * Gets a resource data group + * + * @param resourceDataIndex The index of the resource data + * @return The resource data group instance + * @throws Lib3MFException + */ + public ResourceDataGroup getResourceDataGroup(long resourceDataIndex) throws Lib3MFException { + Pointer bufferResourceDataGroup = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_getresourcedatagroup.invokeInt(new java.lang.Object[]{mHandle, resourceDataIndex, bufferResourceDataGroup})); + Pointer valueResourceDataGroup = bufferResourceDataGroup.getPointer(0); + ResourceDataGroup resourceDataGroup = null; + if (valueResourceDataGroup == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceDataGroup was a null pointer"); + } + resourceDataGroup = mWrapper.PolymorphicFactory(valueResourceDataGroup, ResourceDataGroup.class); + return resourceDataGroup; + } + + /** + * Removes a resource data group + * + * @param resourceDataGroup The resource data group instance + * @throws Lib3MFException + */ + public void removeResourceDataGroup(ResourceDataGroup resourceDataGroup) throws Lib3MFException { + Pointer resourceDataGroupHandle = null; + if (resourceDataGroup != null) { + resourceDataGroupHandle = resourceDataGroup.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceDataGroup is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_keystore_removeresourcedatagroup.invokeInt(new java.lang.Object[]{mHandle, resourceDataGroupHandle})); + } + + /** + * Finds a resource data group that contains a particular resourcedata + * + * @param partPath The target path for the resourcedata hold by the resource data group + * @return The data resource instance + * @throws Lib3MFException + */ + public ResourceDataGroup findResourceDataGroup(PackagePart partPath) throws Lib3MFException { + Pointer partPathHandle = null; + if (partPath != null) { + partPathHandle = partPath.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "PartPath is a null value."); + } + Pointer bufferResourceDataGroup = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_findresourcedatagroup.invokeInt(new java.lang.Object[]{mHandle, partPathHandle, bufferResourceDataGroup})); + Pointer valueResourceDataGroup = bufferResourceDataGroup.getPointer(0); + ResourceDataGroup resourceDataGroup = null; + if (valueResourceDataGroup != Pointer.NULL) { + resourceDataGroup = mWrapper.PolymorphicFactory(valueResourceDataGroup, ResourceDataGroup.class); + } + return resourceDataGroup; + } + + /** + * Add resourcedata to resourcedatagroup element + * + * @param resourceDataGroup The resource data group where to add this resource data + * @param partPath The path of the part to be encrypted + * @param algorithm The encryption algorithm to be used to encrypt this resource + * @param compression Whether compression should be used prior to encryption + * @param additionalAuthenticationData Additional data to be encrypted along the contents for better security + * @return The data resource instance + * @throws Lib3MFException + */ + public ResourceData addResourceData(ResourceDataGroup resourceDataGroup, PackagePart partPath, Lib3MFWrapper.EncryptionAlgorithm algorithm, Lib3MFWrapper.Compression compression, byte[] additionalAuthenticationData) throws Lib3MFException { + Pointer resourceDataGroupHandle = null; + if (resourceDataGroup != null) { + resourceDataGroupHandle = resourceDataGroup.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceDataGroup is a null value."); + } + Pointer partPathHandle = null; + if (partPath != null) { + partPathHandle = partPath.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "PartPath is a null value."); + } + Pointer bufferAdditionalAuthenticationData = new Memory(Math.max(1, 1 * additionalAuthenticationData.length)); + for (int i = 0; i < additionalAuthenticationData.length; i++) { + bufferAdditionalAuthenticationData.setByte(1 * i, additionalAuthenticationData[i]); + } + Pointer bufferResourceData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_addresourcedata.invokeInt(new java.lang.Object[]{mHandle, resourceDataGroupHandle, partPathHandle, Lib3MFWrapper.EnumConversion.convertEncryptionAlgorithmToConst(algorithm), Lib3MFWrapper.EnumConversion.convertCompressionToConst(compression), (long) additionalAuthenticationData.length, bufferAdditionalAuthenticationData, bufferResourceData})); + Pointer valueResourceData = bufferResourceData.getPointer(0); + ResourceData resourceData = null; + if (valueResourceData == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceData was a null pointer"); + } + resourceData = mWrapper.PolymorphicFactory(valueResourceData, ResourceData.class); + return resourceData; + } + + /** + * Removes a resource data + * + * @param resourceData The resource data to be removed + * @throws Lib3MFException + */ + public void removeResourceData(ResourceData resourceData) throws Lib3MFException { + Pointer resourceDataHandle = null; + if (resourceData != null) { + resourceDataHandle = resourceData.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceData is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_keystore_removeresourcedata.invokeInt(new java.lang.Object[]{mHandle, resourceDataHandle})); + } + + /** + * Finds a resource data on this resource group + * + * @param resourcePath The target path for the resourcedata + * @return The resource data instance + * @throws Lib3MFException + */ + public ResourceData findResourceData(PackagePart resourcePath) throws Lib3MFException { + Pointer resourcePathHandle = null; + if (resourcePath != null) { + resourcePathHandle = resourcePath.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourcePath is a null value."); + } + Pointer bufferResourceData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_findresourcedata.invokeInt(new java.lang.Object[]{mHandle, resourcePathHandle, bufferResourceData})); + Pointer valueResourceData = bufferResourceData.getPointer(0); + ResourceData resourceData = null; + if (valueResourceData != Pointer.NULL) { + resourceData = mWrapper.PolymorphicFactory(valueResourceData, ResourceData.class); + } + return resourceData; + } + + /** + * Gets the number of resource data in the keysore + * + * @return The number of resource data available + * @throws Lib3MFException + */ + public long getResourceDataCount() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_getresourcedatacount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + /** + * Gets a resource data + * + * @param resourceDataIndex The index of the resource data + * @return The data resource instance + * @throws Lib3MFException + */ + public ResourceData getResourceData(long resourceDataIndex) throws Lib3MFException { + Pointer bufferResourceData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_getresourcedata.invokeInt(new java.lang.Object[]{mHandle, resourceDataIndex, bufferResourceData})); + Pointer valueResourceData = bufferResourceData.getPointer(0); + ResourceData resourceData = null; + if (valueResourceData == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceData was a null pointer"); + } + resourceData = mWrapper.PolymorphicFactory(valueResourceData, ResourceData.class); + return resourceData; + } + + /** + * Gets the keystore UUID + * + * @return GetUUID Result Tuple + * @throws Lib3MFException + */ + public GetUUIDResult getUUID() throws Lib3MFException { + Pointer bufferHasUUID = new Memory(1); + Pointer bytesNeededUUID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_getuuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, 0, bytesNeededUUID, null})); + int sizeUUID = bytesNeededUUID.getInt(0); + Pointer bufferUUID = new Memory(sizeUUID); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_getuuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, sizeUUID, bytesNeededUUID, bufferUUID})); + GetUUIDResult returnTuple = new GetUUIDResult(); + returnTuple.HasUUID = bufferHasUUID.getByte(0) != 0; + returnTuple.UUID = new String(bufferUUID.getByteArray(0, sizeUUID - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetUUIDResult { + /** + * flag whether the keystore has a UUID + */ + public boolean HasUUID; + + /** + * returns the keystore uuid. + */ + public String UUID; + + } + /** + * Sets the keystore UUID + * + * @param uUID The new keystore uuid. + * @throws Lib3MFException + */ + public void setUUID(String uUID) throws Lib3MFException { + byte[] bytesUUID = uUID.getBytes(StandardCharsets.UTF_8); + Memory bufferUUID = new Memory(bytesUUID.length + 1); + bufferUUID.write(0, bytesUUID, 0, bytesUUID.length); + bufferUUID.setByte(bytesUUID.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_keystore_setuuid.invokeInt(new java.lang.Object[]{mHandle, bufferUUID})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/LengthNode.java b/Autogenerated/Bindings/Java9/lib3mf/LengthNode.java new file mode 100644 index 000000000..8d017be47 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/LengthNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class LengthNode extends OneInputNode { + + public LengthNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/LevelSet.java b/Autogenerated/Bindings/Java9/lib3mf/LevelSet.java new file mode 100644 index 000000000..4e40d140f --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/LevelSet.java @@ -0,0 +1,277 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class LevelSet extends Object { + + public LevelSet(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the function that is used as boundary shape. + * + * @return the function to use as boundary shape + * @throws Lib3MFException + */ + public Function getFunction() throws Lib3MFException { + Pointer bufferTheFunction = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_getfunction.invokeInt(new java.lang.Object[]{mHandle, bufferTheFunction})); + Pointer valueTheFunction = bufferTheFunction.getPointer(0); + Function theFunction = null; + if (valueTheFunction != Pointer.NULL) { + theFunction = mWrapper.PolymorphicFactory(valueTheFunction, Function.class); + } + return theFunction; + } + + /** + * Sets the function to use as boundary shape. + * + * @param theFunction the function to use as boundary shape + * @throws Lib3MFException + */ + public void setFunction(Function theFunction) throws Lib3MFException { + Pointer theFunctionHandle = null; + if (theFunction != null) { + theFunctionHandle = theFunction.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheFunction is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_levelset_setfunction.invokeInt(new java.lang.Object[]{mHandle, theFunctionHandle})); + } + + /** + * Returns the transformation matrix into the coordinate system of the referenced Function. + * + * @return the transformation matrix + * @throws Lib3MFException + */ + public Transform getTransform() throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_gettransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * Sets the transformation matrix into the coordinate system of the referenced Function. + * + * @param transform new transformation matrix + * @throws Lib3MFException + */ + public void setTransform(Transform transform) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_settransform.invokeInt(new java.lang.Object[]{mHandle, bufferTransform})); + } + + /** + * Returns the name of the function output channel to use. + * + * @return the name of the function output channel + * @throws Lib3MFException + */ + public String getChannelName() throws Lib3MFException { + Pointer bytesNeededChannelName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_getchannelname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededChannelName, null})); + int sizeChannelName = bytesNeededChannelName.getInt(0); + Pointer bufferChannelName = new Memory(sizeChannelName); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_getchannelname.invokeInt(new java.lang.Object[]{mHandle, sizeChannelName, bytesNeededChannelName, bufferChannelName})); + return new String(bufferChannelName.getByteArray(0, sizeChannelName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the name of the function output channel to use. + * + * @param channelName new name of the function output channel + * @throws Lib3MFException + */ + public void setChannelName(String channelName) throws Lib3MFException { + byte[] bytesChannelName = channelName.getBytes(StandardCharsets.UTF_8); + Memory bufferChannelName = new Memory(bytesChannelName.length + 1); + bufferChannelName.write(0, bytesChannelName, 0, bytesChannelName.length); + bufferChannelName.setByte(bytesChannelName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_setchannelname.invokeInt(new java.lang.Object[]{mHandle, bufferChannelName})); + } + + /** + * Sets the minimal feature size as a hint for the function evaluator + * + * @param minFeatureSize minimal feature size + * @throws Lib3MFException + */ + public void setMinFeatureSize(double minFeatureSize) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_levelset_setminfeaturesize.invokeInt(new java.lang.Object[]{mHandle, minFeatureSize})); + } + + /** + * Returns the minimal feature size as a hint for the function evaluator + * + * @return minimal feature size + * @throws Lib3MFException + */ + public double getMinFeatureSize() throws Lib3MFException { + Pointer bufferMinFeatureSize = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_getminfeaturesize.invokeInt(new java.lang.Object[]{mHandle, bufferMinFeatureSize})); + return bufferMinFeatureSize.getDouble(0); + } + + /** + * Sets the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). + * + * @param fallBackValue fallback value + * @throws Lib3MFException + */ + public void setFallBackValue(double fallBackValue) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_levelset_setfallbackvalue.invokeInt(new java.lang.Object[]{mHandle, fallBackValue})); + } + + /** + * Returns the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). + * + * @return fallback value + * @throws Lib3MFException + */ + public double getFallBackValue() throws Lib3MFException { + Pointer bufferFallBackValue = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_getfallbackvalue.invokeInt(new java.lang.Object[]{mHandle, bufferFallBackValue})); + return bufferFallBackValue.getDouble(0); + } + + /** + * If set only the bounding box of the mesh is intersected with the boundary + * + * @param meshBBoxOnly If set only the bounding box of the mesh is intersected with the boundary + * @throws Lib3MFException + */ + public void setMeshBBoxOnly(boolean meshBBoxOnly) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_levelset_setmeshbboxonly.invokeInt(new java.lang.Object[]{mHandle, meshBBoxOnly})); + } + + /** + * If set only the bounding box of the mesh is intersected with the boundary + * + * @return If set only the bounding box of the mesh is intersected with the boundary + * @throws Lib3MFException + */ + public boolean getMeshBBoxOnly() throws Lib3MFException { + Pointer bufferMeshBBoxOnly = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_getmeshbboxonly.invokeInt(new java.lang.Object[]{mHandle, bufferMeshBBoxOnly})); + return bufferMeshBBoxOnly.getByte(0) != 0; + } + + /** + * Sets the mesh to use as evaluation domain + * + * @param theMesh The mesh + * @throws Lib3MFException + */ + public void setMesh(MeshObject theMesh) throws Lib3MFException { + Pointer theMeshHandle = null; + if (theMesh != null) { + theMeshHandle = theMesh.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheMesh is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_levelset_setmesh.invokeInt(new java.lang.Object[]{mHandle, theMeshHandle})); + } + + /** + * Returns the mesh that is used as evaluation domain + * + * @return The mesh + * @throws Lib3MFException + */ + public MeshObject getMesh() throws Lib3MFException { + Pointer bufferTheMesh = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_getmesh.invokeInt(new java.lang.Object[]{mHandle, bufferTheMesh})); + Pointer valueTheMesh = bufferTheMesh.getPointer(0); + MeshObject theMesh = null; + if (valueTheMesh != Pointer.NULL) { + theMesh = mWrapper.PolymorphicFactory(valueTheMesh, MeshObject.class); + } + return theMesh; + } + + /** + * Retrieves the VolumeData this Object. + * + * @return the VolumeData of this Object + * @throws Lib3MFException + */ + public VolumeData getVolumeData() throws Lib3MFException { + Pointer bufferTheVolumeData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_levelset_getvolumedata.invokeInt(new java.lang.Object[]{mHandle, bufferTheVolumeData})); + Pointer valueTheVolumeData = bufferTheVolumeData.getPointer(0); + VolumeData theVolumeData = null; + if (valueTheVolumeData != Pointer.NULL) { + theVolumeData = mWrapper.PolymorphicFactory(valueTheVolumeData, VolumeData.class); + } + return theVolumeData; + } + + /** + * Sets the VolumeData of this LevelSet. + * + * @param theVolumeData the VolumeData of this MeshObject + * @throws Lib3MFException + */ + public void setVolumeData(VolumeData theVolumeData) throws Lib3MFException { + Pointer theVolumeDataHandle = null; + if (theVolumeData != null) { + theVolumeDataHandle = theVolumeData.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheVolumeData is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_levelset_setvolumedata.invokeInt(new java.lang.Object[]{mHandle, theVolumeDataHandle})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/LevelSetIterator.java b/Autogenerated/Bindings/Java9/lib3mf/LevelSetIterator.java new file mode 100644 index 000000000..05cc5ae90 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/LevelSetIterator.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class LevelSetIterator extends ResourceIterator { + + public LevelSetIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the LevelSet the iterator points at. + * + * @return returns the MeshObject instance. + * @throws Lib3MFException + */ + public LevelSet getCurrentLevelSet() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_levelsetiterator_getcurrentlevelset.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + LevelSet resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, LevelSet.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Lib3MFException.java b/Autogenerated/Bindings/Java9/lib3mf/Lib3MFException.java new file mode 100644 index 000000000..55f2739fe --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Lib3MFException.java @@ -0,0 +1,222 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import java.util.HashMap; +import java.util.Map; + +public class Lib3MFException extends Exception { + + // Error Constants for Lib3MF + public static final int LIB3MF_SUCCESS = 0; + public static final int LIB3MF_ERROR_NOTIMPLEMENTED = 1; + public static final int LIB3MF_ERROR_INVALIDPARAM = 2; + public static final int LIB3MF_ERROR_INVALIDCAST = 3; + public static final int LIB3MF_ERROR_BUFFERTOOSMALL = 4; + public static final int LIB3MF_ERROR_GENERICEXCEPTION = 5; + public static final int LIB3MF_ERROR_COULDNOTLOADLIBRARY = 6; + public static final int LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT = 7; + public static final int LIB3MF_ERROR_INCOMPATIBLEBINARYVERSION = 8; + public static final int LIB3MF_ERROR_CALCULATIONABORTED = 10; + public static final int LIB3MF_ERROR_SHOULDNOTBECALLED = 11; + public static final int LIB3MF_ERROR_READERCLASSUNKNOWN = 100; + public static final int LIB3MF_ERROR_WRITERCLASSUNKNOWN = 101; + public static final int LIB3MF_ERROR_ITERATORINVALIDINDEX = 102; + public static final int LIB3MF_ERROR_INVALIDMODELRESOURCE = 103; + public static final int LIB3MF_ERROR_RESOURCENOTFOUND = 104; + public static final int LIB3MF_ERROR_INVALIDMODEL = 105; + public static final int LIB3MF_ERROR_INVALIDOBJECT = 106; + public static final int LIB3MF_ERROR_INVALIDMESHOBJECT = 107; + public static final int LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT = 108; + public static final int LIB3MF_ERROR_INVALIDCOMPONENT = 109; + public static final int LIB3MF_ERROR_INVALIDBUILDITEM = 110; + public static final int LIB3MF_ERROR_INVALIDBASEMATERIALGROUP = 111; + public static final int LIB3MF_ERROR_INVALIDSLICESTACKRESOURCE = 112; + public static final int LIB3MF_ERROR_INVALIDTEXTURERESOURCE = 113; + public static final int LIB3MF_ERROR_INVALIDCOLORGROUP = 114; + public static final int LIB3MF_ERROR_INVALIDTEXTURE2DGROUP = 115; + public static final int LIB3MF_ERROR_INVALIDCOMPOSITEMATERIALS = 116; + public static final int LIB3MF_ERROR_INVALIDMULTIPROPERTYGROUP = 117; + public static final int LIB3MF_ERROR_INVALIDRESOURCEINDEX = 120; + public static final int LIB3MF_ERROR_ATTACHMENTNOTFOUND = 121; + public static final int LIB3MF_ERROR_FORBIDDENCYCLICREFERENCE = 130; + public static final int LIB3MF_ERROR_INVALIDATTACHMENTSTREAM = 131; + public static final int LIB3MF_ERROR_INVALIDPROPERTYCOUNT = 132; + public static final int LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER = 140; + public static final int LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT = 141; + public static final int LIB3MF_ERROR_INVALIDRESOURCE = 142; + public static final int LIB3MF_ERROR_INVALIDLEVELSET = 143; + public static final int LIB3MF_ERROR_COULDNOTFINDTRIANGLESET = 144; + public static final int LIB3MF_ERROR_INVALIDTRIANGLESETINDEX = 145; + public static final int LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE = 2000; + public static final int LIB3MF_ERROR_INVALIDKEYSTORE = 3000; + public static final int LIB3MF_ERROR_INVALIDKEYSTORECONSUMER = 3001; + public static final int LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND = 3002; + public static final int LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND = 3003; + public static final int LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED = 3004; + public static final int LIB3MF_ERROR_INVALIDKEYSIZE = 3005; + public static final int LIB3MF_ERROR_INCOMPATIBLEPORTTYPES = 4000; + public static final int LIB3MF_ERROR_GRAPHISCYCLIC = 4001; + public static final int LIB3MF_ERROR_INPUTNOTSET = 4002; + public static final int LIB3MF_ERROR_INVALIDNODECONFIGURATION = 4003; + + public static final Map ErrorCodeMap = new HashMap(); + public static final Map ErrorDescriptionMap = new HashMap(); + + static { + ErrorCodeMap.put(LIB3MF_ERROR_NOTIMPLEMENTED, "LIB3MF_ERROR_NOTIMPLEMENTED"); + ErrorDescriptionMap.put(LIB3MF_ERROR_NOTIMPLEMENTED, "functionality not implemented"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDPARAM, "LIB3MF_ERROR_INVALIDPARAM"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDPARAM, "an invalid parameter was passed"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDCAST, "LIB3MF_ERROR_INVALIDCAST"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDCAST, "a type cast failed"); + ErrorCodeMap.put(LIB3MF_ERROR_BUFFERTOOSMALL, "LIB3MF_ERROR_BUFFERTOOSMALL"); + ErrorDescriptionMap.put(LIB3MF_ERROR_BUFFERTOOSMALL, "a provided buffer is too small"); + ErrorCodeMap.put(LIB3MF_ERROR_GENERICEXCEPTION, "LIB3MF_ERROR_GENERICEXCEPTION"); + ErrorDescriptionMap.put(LIB3MF_ERROR_GENERICEXCEPTION, "a generic exception occurred"); + ErrorCodeMap.put(LIB3MF_ERROR_COULDNOTLOADLIBRARY, "LIB3MF_ERROR_COULDNOTLOADLIBRARY"); + ErrorDescriptionMap.put(LIB3MF_ERROR_COULDNOTLOADLIBRARY, "the library could not be loaded"); + ErrorCodeMap.put(LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT, "LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT"); + ErrorDescriptionMap.put(LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT, "a required exported symbol could not be found in the library"); + ErrorCodeMap.put(LIB3MF_ERROR_INCOMPATIBLEBINARYVERSION, "LIB3MF_ERROR_INCOMPATIBLEBINARYVERSION"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INCOMPATIBLEBINARYVERSION, "the version of the binary interface does not match the bindings interface"); + ErrorCodeMap.put(LIB3MF_ERROR_CALCULATIONABORTED, "LIB3MF_ERROR_CALCULATIONABORTED"); + ErrorDescriptionMap.put(LIB3MF_ERROR_CALCULATIONABORTED, "a calculation has been aborted"); + ErrorCodeMap.put(LIB3MF_ERROR_SHOULDNOTBECALLED, "LIB3MF_ERROR_SHOULDNOTBECALLED"); + ErrorDescriptionMap.put(LIB3MF_ERROR_SHOULDNOTBECALLED, "functionality should not be called"); + ErrorCodeMap.put(LIB3MF_ERROR_READERCLASSUNKNOWN, "LIB3MF_ERROR_READERCLASSUNKNOWN"); + ErrorDescriptionMap.put(LIB3MF_ERROR_READERCLASSUNKNOWN, "the queried reader class is unknown"); + ErrorCodeMap.put(LIB3MF_ERROR_WRITERCLASSUNKNOWN, "LIB3MF_ERROR_WRITERCLASSUNKNOWN"); + ErrorDescriptionMap.put(LIB3MF_ERROR_WRITERCLASSUNKNOWN, "the queried writer class is unknown"); + ErrorCodeMap.put(LIB3MF_ERROR_ITERATORINVALIDINDEX, "LIB3MF_ERROR_ITERATORINVALIDINDEX"); + ErrorDescriptionMap.put(LIB3MF_ERROR_ITERATORINVALIDINDEX, "the current index of an iterator is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDMODELRESOURCE, "LIB3MF_ERROR_INVALIDMODELRESOURCE"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDMODELRESOURCE, "no Model Resource has been given"); + ErrorCodeMap.put(LIB3MF_ERROR_RESOURCENOTFOUND, "LIB3MF_ERROR_RESOURCENOTFOUND"); + ErrorDescriptionMap.put(LIB3MF_ERROR_RESOURCENOTFOUND, "Resource not found"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDMODEL, "LIB3MF_ERROR_INVALIDMODEL"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDMODEL, "A model is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDOBJECT, "LIB3MF_ERROR_INVALIDOBJECT"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDOBJECT, "An object is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDMESHOBJECT, "LIB3MF_ERROR_INVALIDMESHOBJECT"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDMESHOBJECT, "A mesh object is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT, "LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT, "A components object is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDCOMPONENT, "LIB3MF_ERROR_INVALIDCOMPONENT"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDCOMPONENT, "A component is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDBUILDITEM, "LIB3MF_ERROR_INVALIDBUILDITEM"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDBUILDITEM, "A build item is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDBASEMATERIALGROUP, "LIB3MF_ERROR_INVALIDBASEMATERIALGROUP"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDBASEMATERIALGROUP, "A basematerialgroup is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDSLICESTACKRESOURCE, "LIB3MF_ERROR_INVALIDSLICESTACKRESOURCE"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDSLICESTACKRESOURCE, "A slicestack resource is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDTEXTURERESOURCE, "LIB3MF_ERROR_INVALIDTEXTURERESOURCE"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDTEXTURERESOURCE, "A texture resource is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDCOLORGROUP, "LIB3MF_ERROR_INVALIDCOLORGROUP"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDCOLORGROUP, "A color group resource is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDTEXTURE2DGROUP, "LIB3MF_ERROR_INVALIDTEXTURE2DGROUP"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDTEXTURE2DGROUP, "A texture2d group resource is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDCOMPOSITEMATERIALS, "LIB3MF_ERROR_INVALIDCOMPOSITEMATERIALS"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDCOMPOSITEMATERIALS, "A composite materials resource is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDMULTIPROPERTYGROUP, "LIB3MF_ERROR_INVALIDMULTIPROPERTYGROUP"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDMULTIPROPERTYGROUP, "A MultiPropertyGroup resource is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDRESOURCEINDEX, "LIB3MF_ERROR_INVALIDRESOURCEINDEX"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDRESOURCEINDEX, "A resource index is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_ATTACHMENTNOTFOUND, "LIB3MF_ERROR_ATTACHMENTNOTFOUND"); + ErrorDescriptionMap.put(LIB3MF_ERROR_ATTACHMENTNOTFOUND, "Attachment not found"); + ErrorCodeMap.put(LIB3MF_ERROR_FORBIDDENCYCLICREFERENCE, "LIB3MF_ERROR_FORBIDDENCYCLICREFERENCE"); + ErrorDescriptionMap.put(LIB3MF_ERROR_FORBIDDENCYCLICREFERENCE, "A component references one of its ancestors"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDATTACHMENTSTREAM, "LIB3MF_ERROR_INVALIDATTACHMENTSTREAM"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDATTACHMENTSTREAM, "An attachment stream is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDPROPERTYCOUNT, "LIB3MF_ERROR_INVALIDPROPERTYCOUNT"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDPROPERTYCOUNT, "Invalid property count."); + ErrorCodeMap.put(LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER, "LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER"); + ErrorDescriptionMap.put(LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER, "A progress identifier is unknown"); + ErrorCodeMap.put(LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT, "LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT"); + ErrorDescriptionMap.put(LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT, "An element buffer exceeds its spec limit"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDRESOURCE, "LIB3MF_ERROR_INVALIDRESOURCE"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDRESOURCE, "A resource is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDLEVELSET, "LIB3MF_ERROR_INVALIDLEVELSET"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDLEVELSET, "A level set is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_COULDNOTFINDTRIANGLESET, "LIB3MF_ERROR_COULDNOTFINDTRIANGLESET"); + ErrorDescriptionMap.put(LIB3MF_ERROR_COULDNOTFINDTRIANGLESET, "Could not find triangle set"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDTRIANGLESETINDEX, "LIB3MF_ERROR_INVALIDTRIANGLESETINDEX"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDTRIANGLESETINDEX, "Invalid triangle set index"); + ErrorCodeMap.put(LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE, "LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE"); + ErrorDescriptionMap.put(LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE, "This object type is not valid for beamlattices"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDKEYSTORE, "LIB3MF_ERROR_INVALIDKEYSTORE"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDKEYSTORE, "The keystore object is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDKEYSTORECONSUMER, "LIB3MF_ERROR_INVALIDKEYSTORECONSUMER"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDKEYSTORECONSUMER, "The consumer keystore object is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND, "LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND"); + ErrorDescriptionMap.put(LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND, "A consumer has not been found"); + ErrorCodeMap.put(LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND, "LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND"); + ErrorDescriptionMap.put(LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND, "A resource data has not been found"); + ErrorCodeMap.put(LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED, "LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED"); + ErrorDescriptionMap.put(LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED, "A Key or Conentent encryption callback has not been registered"); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDKEYSIZE, "LIB3MF_ERROR_INVALIDKEYSIZE"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDKEYSIZE, "The key size is invalid"); + ErrorCodeMap.put(LIB3MF_ERROR_INCOMPATIBLEPORTTYPES, "LIB3MF_ERROR_INCOMPATIBLEPORTTYPES"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INCOMPATIBLEPORTTYPES, "Link could not be added, the port types are incompatible"); + ErrorCodeMap.put(LIB3MF_ERROR_GRAPHISCYCLIC, "LIB3MF_ERROR_GRAPHISCYCLIC"); + ErrorDescriptionMap.put(LIB3MF_ERROR_GRAPHISCYCLIC, "The functin graph is cyclic. Only dircected graphs are valid and can be topological sorted."); + ErrorCodeMap.put(LIB3MF_ERROR_INPUTNOTSET, "LIB3MF_ERROR_INPUTNOTSET"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INPUTNOTSET, "The input of a node is not set."); + ErrorCodeMap.put(LIB3MF_ERROR_INVALIDNODECONFIGURATION, "LIB3MF_ERROR_INVALIDNODECONFIGURATION"); + ErrorDescriptionMap.put(LIB3MF_ERROR_INVALIDNODECONFIGURATION, "The selected node configuration is not supported"); + } + + protected int mErrorCode; + + protected String mErrorString; + + protected String mErrorDescription; + + public Lib3MFException(int errorCode, String message){ + super(message); + mErrorCode = errorCode; + mErrorString = ErrorCodeMap.get(errorCode); + mErrorString = (mErrorString != null) ? mErrorString : "Unknown error code"; + mErrorDescription = ErrorDescriptionMap.get(errorCode); + mErrorDescription = (mErrorDescription != null) ? mErrorDescription : ""; + } + + @Override + public String toString() { + return mErrorCode + ": " + mErrorString + " (" + mErrorDescription + " - " + getMessage() + ")"; + } +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Lib3MFWrapper.java b/Autogenerated/Bindings/Java9/lib3mf/Lib3MFWrapper.java new file mode 100644 index 000000000..6ef31c156 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Lib3MFWrapper.java @@ -0,0 +1,4213 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.*; + +import java.nio.charset.StandardCharsets; + + +public class Lib3MFWrapper { + + public static final int PROPERTYTYPE_NOPROPERTYTYPE = 0; + public static final int PROPERTYTYPE_BASEMATERIAL = 1; + public static final int PROPERTYTYPE_TEXCOORD = 2; + public static final int PROPERTYTYPE_COLORS = 3; + public static final int PROPERTYTYPE_COMPOSITE = 4; + public static final int PROPERTYTYPE_MULTI = 5; + + public enum PropertyType { + eNoPropertyType, + eBaseMaterial, + eTexCoord, + eColors, + eComposite, + eMulti + } + + public static final int SLICESMESHRESOLUTION_FULLRES = 0; + public static final int SLICESMESHRESOLUTION_LOWRES = 1; + + public enum SlicesMeshResolution { + eFullres, + eLowres + } + + public static final int MODELUNIT_MICROMETER = 0; + public static final int MODELUNIT_MILLIMETER = 1; + public static final int MODELUNIT_CENTIMETER = 2; + public static final int MODELUNIT_INCH = 3; + public static final int MODELUNIT_FOOT = 4; + public static final int MODELUNIT_METER = 5; + + public enum ModelUnit { + eMicroMeter, + eMilliMeter, + eCentiMeter, + eInch, + eFoot, + eMeter + } + + public static final int OBJECTTYPE_OTHER = 0; + public static final int OBJECTTYPE_MODEL = 1; + public static final int OBJECTTYPE_SUPPORT = 2; + public static final int OBJECTTYPE_SOLIDSUPPORT = 3; + public static final int OBJECTTYPE_SURFACE = 4; + + public enum ObjectType { + eOther, + eModel, + eSupport, + eSolidSupport, + eSurface + } + + public static final int BOOLEANOPERATION_UNION = 0; + public static final int BOOLEANOPERATION_DIFFERENCE = 1; + public static final int BOOLEANOPERATION_INTERSECTION = 2; + + public enum BooleanOperation { + eUnion, + eDifference, + eIntersection + } + + public static final int TEXTURETYPE_UNKNOWN = 0; + public static final int TEXTURETYPE_PNG = 1; + public static final int TEXTURETYPE_JPEG = 2; + + public enum TextureType { + eUnknown, + ePNG, + eJPEG + } + + public static final int TEXTURETILESTYLE_WRAP = 0; + public static final int TEXTURETILESTYLE_MIRROR = 1; + public static final int TEXTURETILESTYLE_CLAMP = 2; + public static final int TEXTURETILESTYLE_NOTILESTYLE = 3; + + public enum TextureTileStyle { + eWrap, + eMirror, + eClamp, + eNoTileStyle + } + + public static final int TEXTUREFILTER_AUTO = 0; + public static final int TEXTUREFILTER_LINEAR = 1; + public static final int TEXTUREFILTER_NEAREST = 2; + + public enum TextureFilter { + eAuto, + eLinear, + eNearest + } + + public static final int BEAMLATTICECAPMODE_SPHERE = 0; + public static final int BEAMLATTICECAPMODE_HEMISPHERE = 1; + public static final int BEAMLATTICECAPMODE_BUTT = 2; + + public enum BeamLatticeCapMode { + eSphere, + eHemiSphere, + eButt + } + + public static final int BEAMLATTICECLIPMODE_NOCLIPMODE = 0; + public static final int BEAMLATTICECLIPMODE_INSIDE = 1; + public static final int BEAMLATTICECLIPMODE_OUTSIDE = 2; + + public enum BeamLatticeClipMode { + eNoClipMode, + eInside, + eOutside + } + + public static final int BEAMLATTICEBALLMODE_BEAMLATTICEBALLMODENONE = 0; + public static final int BEAMLATTICEBALLMODE_MIXED = 1; + public static final int BEAMLATTICEBALLMODE_ALL = 2; + + public enum BeamLatticeBallMode { + eBeamLatticeBallModeNone, + eMixed, + eAll + } + + public static final int PROGRESSIDENTIFIER_QUERYCANCELED = 0; + public static final int PROGRESSIDENTIFIER_DONE = 1; + public static final int PROGRESSIDENTIFIER_CLEANUP = 2; + public static final int PROGRESSIDENTIFIER_READSTREAM = 3; + public static final int PROGRESSIDENTIFIER_EXTRACTOPCPACKAGE = 4; + public static final int PROGRESSIDENTIFIER_READNONROOTMODELS = 5; + public static final int PROGRESSIDENTIFIER_READROOTMODEL = 6; + public static final int PROGRESSIDENTIFIER_READRESOURCES = 7; + public static final int PROGRESSIDENTIFIER_READMESH = 8; + public static final int PROGRESSIDENTIFIER_READSLICES = 9; + public static final int PROGRESSIDENTIFIER_READBUILD = 10; + public static final int PROGRESSIDENTIFIER_READCUSTOMATTACHMENT = 11; + public static final int PROGRESSIDENTIFIER_READTEXTURETACHMENTS = 12; + public static final int PROGRESSIDENTIFIER_CREATEOPCPACKAGE = 13; + public static final int PROGRESSIDENTIFIER_WRITEMODELSTOSTREAM = 14; + public static final int PROGRESSIDENTIFIER_WRITEROOTMODEL = 15; + public static final int PROGRESSIDENTIFIER_WRITENONROOTMODELS = 16; + public static final int PROGRESSIDENTIFIER_WRITEATTACHMENTS = 17; + public static final int PROGRESSIDENTIFIER_WRITECONTENTTYPES = 18; + public static final int PROGRESSIDENTIFIER_WRITENOBJECTS = 19; + public static final int PROGRESSIDENTIFIER_WRITENODES = 20; + public static final int PROGRESSIDENTIFIER_WRITETRIANGLES = 21; + public static final int PROGRESSIDENTIFIER_WRITESLICES = 22; + public static final int PROGRESSIDENTIFIER_WRITEKEYSTORE = 23; + + public enum ProgressIdentifier { + eQUERYCANCELED, + eDONE, + eCLEANUP, + eREADSTREAM, + eEXTRACTOPCPACKAGE, + eREADNONROOTMODELS, + eREADROOTMODEL, + eREADRESOURCES, + eREADMESH, + eREADSLICES, + eREADBUILD, + eREADCUSTOMATTACHMENT, + eREADTEXTURETACHMENTS, + eCREATEOPCPACKAGE, + eWRITEMODELSTOSTREAM, + eWRITEROOTMODEL, + eWRITENONROOTMODELS, + eWRITEATTACHMENTS, + eWRITECONTENTTYPES, + eWRITENOBJECTS, + eWRITENODES, + eWRITETRIANGLES, + eWRITESLICES, + eWRITEKEYSTORE + } + + public static final int BLENDMETHOD_NOBLENDMETHOD = 0; + public static final int BLENDMETHOD_MIX = 1; + public static final int BLENDMETHOD_MULTIPLY = 2; + + public enum BlendMethod { + eNoBlendMethod, + eMix, + eMultiply + } + + public static final int CHANNELNAME_RED = 0; + public static final int CHANNELNAME_GREEN = 1; + public static final int CHANNELNAME_BLUE = 2; + public static final int CHANNELNAME_ALPHA = 3; + + public enum ChannelName { + eRed, + eGreen, + eBlue, + eAlpha + } + + public static final int COMPOSITIONMETHOD_WEIGHTEDSUM = 0; + public static final int COMPOSITIONMETHOD_MULTIPLY = 1; + public static final int COMPOSITIONMETHOD_MIN = 2; + public static final int COMPOSITIONMETHOD_MAX = 3; + public static final int COMPOSITIONMETHOD_MASK = 4; + + public enum CompositionMethod { + eWeightedSum, + eMultiply, + eMin, + eMax, + eMask + } + + public static final int COMPOSITIONSPACE_RAW = 0; + public static final int COMPOSITIONSPACE_LINEARCOLOR = 1; + + public enum CompositionSpace { + eRaw, + eLinearColor + } + + public static final int IMPLICITNODETYPE_ADDITION = 0; + public static final int IMPLICITNODETYPE_SUBTRACTION = 1; + public static final int IMPLICITNODETYPE_MULTIPLICATION = 2; + public static final int IMPLICITNODETYPE_DIVISION = 3; + public static final int IMPLICITNODETYPE_CONSTANT = 4; + public static final int IMPLICITNODETYPE_CONSTVEC = 5; + public static final int IMPLICITNODETYPE_CONSTMAT = 6; + public static final int IMPLICITNODETYPE_COMPOSEVECTOR = 7; + public static final int IMPLICITNODETYPE_DECOMPOSEVECTOR = 8; + public static final int IMPLICITNODETYPE_COMPOSEMATRIX = 9; + public static final int IMPLICITNODETYPE_MATRIXFROMCOLUMNS = 10; + public static final int IMPLICITNODETYPE_MATRIXFROMROWS = 11; + public static final int IMPLICITNODETYPE_DOT = 12; + public static final int IMPLICITNODETYPE_CROSS = 13; + public static final int IMPLICITNODETYPE_MATVECMULTIPLICATION = 14; + public static final int IMPLICITNODETYPE_TRANSPOSE = 15; + public static final int IMPLICITNODETYPE_INVERSE = 16; + public static final int IMPLICITNODETYPE_SINUS = 17; + public static final int IMPLICITNODETYPE_COSINUS = 18; + public static final int IMPLICITNODETYPE_TAN = 19; + public static final int IMPLICITNODETYPE_ARCSIN = 20; + public static final int IMPLICITNODETYPE_ARCCOS = 21; + public static final int IMPLICITNODETYPE_ARCTAN = 22; + public static final int IMPLICITNODETYPE_ARCTAN2 = 23; + public static final int IMPLICITNODETYPE_MIN = 24; + public static final int IMPLICITNODETYPE_MAX = 25; + public static final int IMPLICITNODETYPE_ABS = 26; + public static final int IMPLICITNODETYPE_FMOD = 27; + public static final int IMPLICITNODETYPE_POW = 28; + public static final int IMPLICITNODETYPE_SQRT = 29; + public static final int IMPLICITNODETYPE_EXP = 30; + public static final int IMPLICITNODETYPE_LOG = 31; + public static final int IMPLICITNODETYPE_LOG2 = 32; + public static final int IMPLICITNODETYPE_LOG10 = 33; + public static final int IMPLICITNODETYPE_SELECT = 34; + public static final int IMPLICITNODETYPE_CLAMP = 35; + public static final int IMPLICITNODETYPE_SINH = 36; + public static final int IMPLICITNODETYPE_COSH = 37; + public static final int IMPLICITNODETYPE_TANH = 38; + public static final int IMPLICITNODETYPE_ROUND = 39; + public static final int IMPLICITNODETYPE_CEIL = 40; + public static final int IMPLICITNODETYPE_FLOOR = 41; + public static final int IMPLICITNODETYPE_SIGN = 42; + public static final int IMPLICITNODETYPE_FRACT = 43; + public static final int IMPLICITNODETYPE_FUNCTIONCALL = 44; + public static final int IMPLICITNODETYPE_MESH = 45; + public static final int IMPLICITNODETYPE_LENGTH = 46; + public static final int IMPLICITNODETYPE_CONSTRESOURCEID = 47; + public static final int IMPLICITNODETYPE_VECTORFROMSCALAR = 48; + public static final int IMPLICITNODETYPE_UNSIGNEDMESH = 49; + public static final int IMPLICITNODETYPE_MOD = 50; + public static final int IMPLICITNODETYPE_BEAMLATTICE = 51; + public static final int IMPLICITNODETYPE_FUNCTIONGRADIENT = 52; + public static final int IMPLICITNODETYPE_NORMALIZEDISTANCE = 53; + + public enum ImplicitNodeType { + eAddition, + eSubtraction, + eMultiplication, + eDivision, + eConstant, + eConstVec, + eConstMat, + eComposeVector, + eDecomposeVector, + eComposeMatrix, + eMatrixFromColumns, + eMatrixFromRows, + eDot, + eCross, + eMatVecMultiplication, + eTranspose, + eInverse, + eSinus, + eCosinus, + eTan, + eArcSin, + eArcCos, + eArcTan, + eArcTan2, + eMin, + eMax, + eAbs, + eFmod, + ePow, + eSqrt, + eExp, + eLog, + eLog2, + eLog10, + eSelect, + eClamp, + eSinh, + eCosh, + eTanh, + eRound, + eCeil, + eFloor, + eSign, + eFract, + eFunctionCall, + eMesh, + eLength, + eConstResourceID, + eVectorFromScalar, + eUnsignedMesh, + eMod, + eBeamLattice, + eFunctionGradient, + eNormalizeDistance + } + + public static final int IMPLICITPORTTYPE_SCALAR = 0; + public static final int IMPLICITPORTTYPE_VECTOR = 1; + public static final int IMPLICITPORTTYPE_MATRIX = 2; + public static final int IMPLICITPORTTYPE_RESOURCEID = 3; + + public enum ImplicitPortType { + eScalar, + eVector, + eMatrix, + eResourceID + } + + public static final int IMPLICITNODECONFIGURATION_DEFAULT = 0; + public static final int IMPLICITNODECONFIGURATION_SCALARTOSCALAR = 1; + public static final int IMPLICITNODECONFIGURATION_VECTORTOVECTOR = 2; + public static final int IMPLICITNODECONFIGURATION_MATRIXTOMATRIX = 3; + + public enum ImplicitNodeConfiguration { + eDefault, + eScalarToScalar, + eVectorToVector, + eMatrixToMatrix + } + + public static final int ENCRYPTIONALGORITHM_AES256_GCM = 1; + + public enum EncryptionAlgorithm { + eAES256_GCM + } + + public static final int WRAPPINGALGORITHM_RSA_OAEP = 0; + + public enum WrappingAlgorithm { + eRSA_OAEP + } + + public static final int MGFALGORITHM_MGF1_SHA1 = 160; + public static final int MGFALGORITHM_MGF1_SHA224 = 224; + public static final int MGFALGORITHM_MGF1_SHA256 = 256; + public static final int MGFALGORITHM_MGF1_SHA384 = 384; + public static final int MGFALGORITHM_MGF1_SHA512 = 512; + + public enum MgfAlgorithm { + eMGF1_SHA1, + eMGF1_SHA224, + eMGF1_SHA256, + eMGF1_SHA384, + eMGF1_SHA512 + } + + public static final int DIGESTMETHOD_SHA1 = 160; + public static final int DIGESTMETHOD_SHA256 = 256; + + public enum DigestMethod { + eSHA1, + eSHA256 + } + + public static final int COMPRESSION_NOCOMPRESSION = 0; + public static final int COMPRESSION_DEFLATE = 1; + + public enum Compression { + eNoCompression, + eDeflate + } + + public static class EnumConversion { + public static int convertPropertyTypeToConst (PropertyType value) throws Lib3MFException { + switch (value) { + case eNoPropertyType: return PROPERTYTYPE_NOPROPERTYTYPE; + case eBaseMaterial: return PROPERTYTYPE_BASEMATERIAL; + case eTexCoord: return PROPERTYTYPE_TEXCOORD; + case eColors: return PROPERTYTYPE_COLORS; + case eComposite: return PROPERTYTYPE_COMPOSITE; + case eMulti: return PROPERTYTYPE_MULTI; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static PropertyType convertConstToPropertyType (int value) throws Lib3MFException { + switch (value) { + case PROPERTYTYPE_NOPROPERTYTYPE: return PropertyType.eNoPropertyType; + case PROPERTYTYPE_BASEMATERIAL: return PropertyType.eBaseMaterial; + case PROPERTYTYPE_TEXCOORD: return PropertyType.eTexCoord; + case PROPERTYTYPE_COLORS: return PropertyType.eColors; + case PROPERTYTYPE_COMPOSITE: return PropertyType.eComposite; + case PROPERTYTYPE_MULTI: return PropertyType.eMulti; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertSlicesMeshResolutionToConst (SlicesMeshResolution value) throws Lib3MFException { + switch (value) { + case eFullres: return SLICESMESHRESOLUTION_FULLRES; + case eLowres: return SLICESMESHRESOLUTION_LOWRES; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static SlicesMeshResolution convertConstToSlicesMeshResolution (int value) throws Lib3MFException { + switch (value) { + case SLICESMESHRESOLUTION_FULLRES: return SlicesMeshResolution.eFullres; + case SLICESMESHRESOLUTION_LOWRES: return SlicesMeshResolution.eLowres; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertModelUnitToConst (ModelUnit value) throws Lib3MFException { + switch (value) { + case eMicroMeter: return MODELUNIT_MICROMETER; + case eMilliMeter: return MODELUNIT_MILLIMETER; + case eCentiMeter: return MODELUNIT_CENTIMETER; + case eInch: return MODELUNIT_INCH; + case eFoot: return MODELUNIT_FOOT; + case eMeter: return MODELUNIT_METER; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static ModelUnit convertConstToModelUnit (int value) throws Lib3MFException { + switch (value) { + case MODELUNIT_MICROMETER: return ModelUnit.eMicroMeter; + case MODELUNIT_MILLIMETER: return ModelUnit.eMilliMeter; + case MODELUNIT_CENTIMETER: return ModelUnit.eCentiMeter; + case MODELUNIT_INCH: return ModelUnit.eInch; + case MODELUNIT_FOOT: return ModelUnit.eFoot; + case MODELUNIT_METER: return ModelUnit.eMeter; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertObjectTypeToConst (ObjectType value) throws Lib3MFException { + switch (value) { + case eOther: return OBJECTTYPE_OTHER; + case eModel: return OBJECTTYPE_MODEL; + case eSupport: return OBJECTTYPE_SUPPORT; + case eSolidSupport: return OBJECTTYPE_SOLIDSUPPORT; + case eSurface: return OBJECTTYPE_SURFACE; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static ObjectType convertConstToObjectType (int value) throws Lib3MFException { + switch (value) { + case OBJECTTYPE_OTHER: return ObjectType.eOther; + case OBJECTTYPE_MODEL: return ObjectType.eModel; + case OBJECTTYPE_SUPPORT: return ObjectType.eSupport; + case OBJECTTYPE_SOLIDSUPPORT: return ObjectType.eSolidSupport; + case OBJECTTYPE_SURFACE: return ObjectType.eSurface; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertBooleanOperationToConst (BooleanOperation value) throws Lib3MFException { + switch (value) { + case eUnion: return BOOLEANOPERATION_UNION; + case eDifference: return BOOLEANOPERATION_DIFFERENCE; + case eIntersection: return BOOLEANOPERATION_INTERSECTION; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static BooleanOperation convertConstToBooleanOperation (int value) throws Lib3MFException { + switch (value) { + case BOOLEANOPERATION_UNION: return BooleanOperation.eUnion; + case BOOLEANOPERATION_DIFFERENCE: return BooleanOperation.eDifference; + case BOOLEANOPERATION_INTERSECTION: return BooleanOperation.eIntersection; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertTextureTypeToConst (TextureType value) throws Lib3MFException { + switch (value) { + case eUnknown: return TEXTURETYPE_UNKNOWN; + case ePNG: return TEXTURETYPE_PNG; + case eJPEG: return TEXTURETYPE_JPEG; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static TextureType convertConstToTextureType (int value) throws Lib3MFException { + switch (value) { + case TEXTURETYPE_UNKNOWN: return TextureType.eUnknown; + case TEXTURETYPE_PNG: return TextureType.ePNG; + case TEXTURETYPE_JPEG: return TextureType.eJPEG; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertTextureTileStyleToConst (TextureTileStyle value) throws Lib3MFException { + switch (value) { + case eWrap: return TEXTURETILESTYLE_WRAP; + case eMirror: return TEXTURETILESTYLE_MIRROR; + case eClamp: return TEXTURETILESTYLE_CLAMP; + case eNoTileStyle: return TEXTURETILESTYLE_NOTILESTYLE; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static TextureTileStyle convertConstToTextureTileStyle (int value) throws Lib3MFException { + switch (value) { + case TEXTURETILESTYLE_WRAP: return TextureTileStyle.eWrap; + case TEXTURETILESTYLE_MIRROR: return TextureTileStyle.eMirror; + case TEXTURETILESTYLE_CLAMP: return TextureTileStyle.eClamp; + case TEXTURETILESTYLE_NOTILESTYLE: return TextureTileStyle.eNoTileStyle; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertTextureFilterToConst (TextureFilter value) throws Lib3MFException { + switch (value) { + case eAuto: return TEXTUREFILTER_AUTO; + case eLinear: return TEXTUREFILTER_LINEAR; + case eNearest: return TEXTUREFILTER_NEAREST; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static TextureFilter convertConstToTextureFilter (int value) throws Lib3MFException { + switch (value) { + case TEXTUREFILTER_AUTO: return TextureFilter.eAuto; + case TEXTUREFILTER_LINEAR: return TextureFilter.eLinear; + case TEXTUREFILTER_NEAREST: return TextureFilter.eNearest; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertBeamLatticeCapModeToConst (BeamLatticeCapMode value) throws Lib3MFException { + switch (value) { + case eSphere: return BEAMLATTICECAPMODE_SPHERE; + case eHemiSphere: return BEAMLATTICECAPMODE_HEMISPHERE; + case eButt: return BEAMLATTICECAPMODE_BUTT; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static BeamLatticeCapMode convertConstToBeamLatticeCapMode (int value) throws Lib3MFException { + switch (value) { + case BEAMLATTICECAPMODE_SPHERE: return BeamLatticeCapMode.eSphere; + case BEAMLATTICECAPMODE_HEMISPHERE: return BeamLatticeCapMode.eHemiSphere; + case BEAMLATTICECAPMODE_BUTT: return BeamLatticeCapMode.eButt; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertBeamLatticeClipModeToConst (BeamLatticeClipMode value) throws Lib3MFException { + switch (value) { + case eNoClipMode: return BEAMLATTICECLIPMODE_NOCLIPMODE; + case eInside: return BEAMLATTICECLIPMODE_INSIDE; + case eOutside: return BEAMLATTICECLIPMODE_OUTSIDE; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static BeamLatticeClipMode convertConstToBeamLatticeClipMode (int value) throws Lib3MFException { + switch (value) { + case BEAMLATTICECLIPMODE_NOCLIPMODE: return BeamLatticeClipMode.eNoClipMode; + case BEAMLATTICECLIPMODE_INSIDE: return BeamLatticeClipMode.eInside; + case BEAMLATTICECLIPMODE_OUTSIDE: return BeamLatticeClipMode.eOutside; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertBeamLatticeBallModeToConst (BeamLatticeBallMode value) throws Lib3MFException { + switch (value) { + case eBeamLatticeBallModeNone: return BEAMLATTICEBALLMODE_BEAMLATTICEBALLMODENONE; + case eMixed: return BEAMLATTICEBALLMODE_MIXED; + case eAll: return BEAMLATTICEBALLMODE_ALL; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static BeamLatticeBallMode convertConstToBeamLatticeBallMode (int value) throws Lib3MFException { + switch (value) { + case BEAMLATTICEBALLMODE_BEAMLATTICEBALLMODENONE: return BeamLatticeBallMode.eBeamLatticeBallModeNone; + case BEAMLATTICEBALLMODE_MIXED: return BeamLatticeBallMode.eMixed; + case BEAMLATTICEBALLMODE_ALL: return BeamLatticeBallMode.eAll; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertProgressIdentifierToConst (ProgressIdentifier value) throws Lib3MFException { + switch (value) { + case eQUERYCANCELED: return PROGRESSIDENTIFIER_QUERYCANCELED; + case eDONE: return PROGRESSIDENTIFIER_DONE; + case eCLEANUP: return PROGRESSIDENTIFIER_CLEANUP; + case eREADSTREAM: return PROGRESSIDENTIFIER_READSTREAM; + case eEXTRACTOPCPACKAGE: return PROGRESSIDENTIFIER_EXTRACTOPCPACKAGE; + case eREADNONROOTMODELS: return PROGRESSIDENTIFIER_READNONROOTMODELS; + case eREADROOTMODEL: return PROGRESSIDENTIFIER_READROOTMODEL; + case eREADRESOURCES: return PROGRESSIDENTIFIER_READRESOURCES; + case eREADMESH: return PROGRESSIDENTIFIER_READMESH; + case eREADSLICES: return PROGRESSIDENTIFIER_READSLICES; + case eREADBUILD: return PROGRESSIDENTIFIER_READBUILD; + case eREADCUSTOMATTACHMENT: return PROGRESSIDENTIFIER_READCUSTOMATTACHMENT; + case eREADTEXTURETACHMENTS: return PROGRESSIDENTIFIER_READTEXTURETACHMENTS; + case eCREATEOPCPACKAGE: return PROGRESSIDENTIFIER_CREATEOPCPACKAGE; + case eWRITEMODELSTOSTREAM: return PROGRESSIDENTIFIER_WRITEMODELSTOSTREAM; + case eWRITEROOTMODEL: return PROGRESSIDENTIFIER_WRITEROOTMODEL; + case eWRITENONROOTMODELS: return PROGRESSIDENTIFIER_WRITENONROOTMODELS; + case eWRITEATTACHMENTS: return PROGRESSIDENTIFIER_WRITEATTACHMENTS; + case eWRITECONTENTTYPES: return PROGRESSIDENTIFIER_WRITECONTENTTYPES; + case eWRITENOBJECTS: return PROGRESSIDENTIFIER_WRITENOBJECTS; + case eWRITENODES: return PROGRESSIDENTIFIER_WRITENODES; + case eWRITETRIANGLES: return PROGRESSIDENTIFIER_WRITETRIANGLES; + case eWRITESLICES: return PROGRESSIDENTIFIER_WRITESLICES; + case eWRITEKEYSTORE: return PROGRESSIDENTIFIER_WRITEKEYSTORE; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static ProgressIdentifier convertConstToProgressIdentifier (int value) throws Lib3MFException { + switch (value) { + case PROGRESSIDENTIFIER_QUERYCANCELED: return ProgressIdentifier.eQUERYCANCELED; + case PROGRESSIDENTIFIER_DONE: return ProgressIdentifier.eDONE; + case PROGRESSIDENTIFIER_CLEANUP: return ProgressIdentifier.eCLEANUP; + case PROGRESSIDENTIFIER_READSTREAM: return ProgressIdentifier.eREADSTREAM; + case PROGRESSIDENTIFIER_EXTRACTOPCPACKAGE: return ProgressIdentifier.eEXTRACTOPCPACKAGE; + case PROGRESSIDENTIFIER_READNONROOTMODELS: return ProgressIdentifier.eREADNONROOTMODELS; + case PROGRESSIDENTIFIER_READROOTMODEL: return ProgressIdentifier.eREADROOTMODEL; + case PROGRESSIDENTIFIER_READRESOURCES: return ProgressIdentifier.eREADRESOURCES; + case PROGRESSIDENTIFIER_READMESH: return ProgressIdentifier.eREADMESH; + case PROGRESSIDENTIFIER_READSLICES: return ProgressIdentifier.eREADSLICES; + case PROGRESSIDENTIFIER_READBUILD: return ProgressIdentifier.eREADBUILD; + case PROGRESSIDENTIFIER_READCUSTOMATTACHMENT: return ProgressIdentifier.eREADCUSTOMATTACHMENT; + case PROGRESSIDENTIFIER_READTEXTURETACHMENTS: return ProgressIdentifier.eREADTEXTURETACHMENTS; + case PROGRESSIDENTIFIER_CREATEOPCPACKAGE: return ProgressIdentifier.eCREATEOPCPACKAGE; + case PROGRESSIDENTIFIER_WRITEMODELSTOSTREAM: return ProgressIdentifier.eWRITEMODELSTOSTREAM; + case PROGRESSIDENTIFIER_WRITEROOTMODEL: return ProgressIdentifier.eWRITEROOTMODEL; + case PROGRESSIDENTIFIER_WRITENONROOTMODELS: return ProgressIdentifier.eWRITENONROOTMODELS; + case PROGRESSIDENTIFIER_WRITEATTACHMENTS: return ProgressIdentifier.eWRITEATTACHMENTS; + case PROGRESSIDENTIFIER_WRITECONTENTTYPES: return ProgressIdentifier.eWRITECONTENTTYPES; + case PROGRESSIDENTIFIER_WRITENOBJECTS: return ProgressIdentifier.eWRITENOBJECTS; + case PROGRESSIDENTIFIER_WRITENODES: return ProgressIdentifier.eWRITENODES; + case PROGRESSIDENTIFIER_WRITETRIANGLES: return ProgressIdentifier.eWRITETRIANGLES; + case PROGRESSIDENTIFIER_WRITESLICES: return ProgressIdentifier.eWRITESLICES; + case PROGRESSIDENTIFIER_WRITEKEYSTORE: return ProgressIdentifier.eWRITEKEYSTORE; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertBlendMethodToConst (BlendMethod value) throws Lib3MFException { + switch (value) { + case eNoBlendMethod: return BLENDMETHOD_NOBLENDMETHOD; + case eMix: return BLENDMETHOD_MIX; + case eMultiply: return BLENDMETHOD_MULTIPLY; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static BlendMethod convertConstToBlendMethod (int value) throws Lib3MFException { + switch (value) { + case BLENDMETHOD_NOBLENDMETHOD: return BlendMethod.eNoBlendMethod; + case BLENDMETHOD_MIX: return BlendMethod.eMix; + case BLENDMETHOD_MULTIPLY: return BlendMethod.eMultiply; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertChannelNameToConst (ChannelName value) throws Lib3MFException { + switch (value) { + case eRed: return CHANNELNAME_RED; + case eGreen: return CHANNELNAME_GREEN; + case eBlue: return CHANNELNAME_BLUE; + case eAlpha: return CHANNELNAME_ALPHA; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static ChannelName convertConstToChannelName (int value) throws Lib3MFException { + switch (value) { + case CHANNELNAME_RED: return ChannelName.eRed; + case CHANNELNAME_GREEN: return ChannelName.eGreen; + case CHANNELNAME_BLUE: return ChannelName.eBlue; + case CHANNELNAME_ALPHA: return ChannelName.eAlpha; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertCompositionMethodToConst (CompositionMethod value) throws Lib3MFException { + switch (value) { + case eWeightedSum: return COMPOSITIONMETHOD_WEIGHTEDSUM; + case eMultiply: return COMPOSITIONMETHOD_MULTIPLY; + case eMin: return COMPOSITIONMETHOD_MIN; + case eMax: return COMPOSITIONMETHOD_MAX; + case eMask: return COMPOSITIONMETHOD_MASK; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static CompositionMethod convertConstToCompositionMethod (int value) throws Lib3MFException { + switch (value) { + case COMPOSITIONMETHOD_WEIGHTEDSUM: return CompositionMethod.eWeightedSum; + case COMPOSITIONMETHOD_MULTIPLY: return CompositionMethod.eMultiply; + case COMPOSITIONMETHOD_MIN: return CompositionMethod.eMin; + case COMPOSITIONMETHOD_MAX: return CompositionMethod.eMax; + case COMPOSITIONMETHOD_MASK: return CompositionMethod.eMask; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertCompositionSpaceToConst (CompositionSpace value) throws Lib3MFException { + switch (value) { + case eRaw: return COMPOSITIONSPACE_RAW; + case eLinearColor: return COMPOSITIONSPACE_LINEARCOLOR; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static CompositionSpace convertConstToCompositionSpace (int value) throws Lib3MFException { + switch (value) { + case COMPOSITIONSPACE_RAW: return CompositionSpace.eRaw; + case COMPOSITIONSPACE_LINEARCOLOR: return CompositionSpace.eLinearColor; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertImplicitNodeTypeToConst (ImplicitNodeType value) throws Lib3MFException { + switch (value) { + case eAddition: return IMPLICITNODETYPE_ADDITION; + case eSubtraction: return IMPLICITNODETYPE_SUBTRACTION; + case eMultiplication: return IMPLICITNODETYPE_MULTIPLICATION; + case eDivision: return IMPLICITNODETYPE_DIVISION; + case eConstant: return IMPLICITNODETYPE_CONSTANT; + case eConstVec: return IMPLICITNODETYPE_CONSTVEC; + case eConstMat: return IMPLICITNODETYPE_CONSTMAT; + case eComposeVector: return IMPLICITNODETYPE_COMPOSEVECTOR; + case eDecomposeVector: return IMPLICITNODETYPE_DECOMPOSEVECTOR; + case eComposeMatrix: return IMPLICITNODETYPE_COMPOSEMATRIX; + case eMatrixFromColumns: return IMPLICITNODETYPE_MATRIXFROMCOLUMNS; + case eMatrixFromRows: return IMPLICITNODETYPE_MATRIXFROMROWS; + case eDot: return IMPLICITNODETYPE_DOT; + case eCross: return IMPLICITNODETYPE_CROSS; + case eMatVecMultiplication: return IMPLICITNODETYPE_MATVECMULTIPLICATION; + case eTranspose: return IMPLICITNODETYPE_TRANSPOSE; + case eInverse: return IMPLICITNODETYPE_INVERSE; + case eSinus: return IMPLICITNODETYPE_SINUS; + case eCosinus: return IMPLICITNODETYPE_COSINUS; + case eTan: return IMPLICITNODETYPE_TAN; + case eArcSin: return IMPLICITNODETYPE_ARCSIN; + case eArcCos: return IMPLICITNODETYPE_ARCCOS; + case eArcTan: return IMPLICITNODETYPE_ARCTAN; + case eArcTan2: return IMPLICITNODETYPE_ARCTAN2; + case eMin: return IMPLICITNODETYPE_MIN; + case eMax: return IMPLICITNODETYPE_MAX; + case eAbs: return IMPLICITNODETYPE_ABS; + case eFmod: return IMPLICITNODETYPE_FMOD; + case ePow: return IMPLICITNODETYPE_POW; + case eSqrt: return IMPLICITNODETYPE_SQRT; + case eExp: return IMPLICITNODETYPE_EXP; + case eLog: return IMPLICITNODETYPE_LOG; + case eLog2: return IMPLICITNODETYPE_LOG2; + case eLog10: return IMPLICITNODETYPE_LOG10; + case eSelect: return IMPLICITNODETYPE_SELECT; + case eClamp: return IMPLICITNODETYPE_CLAMP; + case eSinh: return IMPLICITNODETYPE_SINH; + case eCosh: return IMPLICITNODETYPE_COSH; + case eTanh: return IMPLICITNODETYPE_TANH; + case eRound: return IMPLICITNODETYPE_ROUND; + case eCeil: return IMPLICITNODETYPE_CEIL; + case eFloor: return IMPLICITNODETYPE_FLOOR; + case eSign: return IMPLICITNODETYPE_SIGN; + case eFract: return IMPLICITNODETYPE_FRACT; + case eFunctionCall: return IMPLICITNODETYPE_FUNCTIONCALL; + case eMesh: return IMPLICITNODETYPE_MESH; + case eLength: return IMPLICITNODETYPE_LENGTH; + case eConstResourceID: return IMPLICITNODETYPE_CONSTRESOURCEID; + case eVectorFromScalar: return IMPLICITNODETYPE_VECTORFROMSCALAR; + case eUnsignedMesh: return IMPLICITNODETYPE_UNSIGNEDMESH; + case eMod: return IMPLICITNODETYPE_MOD; + case eBeamLattice: return IMPLICITNODETYPE_BEAMLATTICE; + case eFunctionGradient: return IMPLICITNODETYPE_FUNCTIONGRADIENT; + case eNormalizeDistance: return IMPLICITNODETYPE_NORMALIZEDISTANCE; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static ImplicitNodeType convertConstToImplicitNodeType (int value) throws Lib3MFException { + switch (value) { + case IMPLICITNODETYPE_ADDITION: return ImplicitNodeType.eAddition; + case IMPLICITNODETYPE_SUBTRACTION: return ImplicitNodeType.eSubtraction; + case IMPLICITNODETYPE_MULTIPLICATION: return ImplicitNodeType.eMultiplication; + case IMPLICITNODETYPE_DIVISION: return ImplicitNodeType.eDivision; + case IMPLICITNODETYPE_CONSTANT: return ImplicitNodeType.eConstant; + case IMPLICITNODETYPE_CONSTVEC: return ImplicitNodeType.eConstVec; + case IMPLICITNODETYPE_CONSTMAT: return ImplicitNodeType.eConstMat; + case IMPLICITNODETYPE_COMPOSEVECTOR: return ImplicitNodeType.eComposeVector; + case IMPLICITNODETYPE_DECOMPOSEVECTOR: return ImplicitNodeType.eDecomposeVector; + case IMPLICITNODETYPE_COMPOSEMATRIX: return ImplicitNodeType.eComposeMatrix; + case IMPLICITNODETYPE_MATRIXFROMCOLUMNS: return ImplicitNodeType.eMatrixFromColumns; + case IMPLICITNODETYPE_MATRIXFROMROWS: return ImplicitNodeType.eMatrixFromRows; + case IMPLICITNODETYPE_DOT: return ImplicitNodeType.eDot; + case IMPLICITNODETYPE_CROSS: return ImplicitNodeType.eCross; + case IMPLICITNODETYPE_MATVECMULTIPLICATION: return ImplicitNodeType.eMatVecMultiplication; + case IMPLICITNODETYPE_TRANSPOSE: return ImplicitNodeType.eTranspose; + case IMPLICITNODETYPE_INVERSE: return ImplicitNodeType.eInverse; + case IMPLICITNODETYPE_SINUS: return ImplicitNodeType.eSinus; + case IMPLICITNODETYPE_COSINUS: return ImplicitNodeType.eCosinus; + case IMPLICITNODETYPE_TAN: return ImplicitNodeType.eTan; + case IMPLICITNODETYPE_ARCSIN: return ImplicitNodeType.eArcSin; + case IMPLICITNODETYPE_ARCCOS: return ImplicitNodeType.eArcCos; + case IMPLICITNODETYPE_ARCTAN: return ImplicitNodeType.eArcTan; + case IMPLICITNODETYPE_ARCTAN2: return ImplicitNodeType.eArcTan2; + case IMPLICITNODETYPE_MIN: return ImplicitNodeType.eMin; + case IMPLICITNODETYPE_MAX: return ImplicitNodeType.eMax; + case IMPLICITNODETYPE_ABS: return ImplicitNodeType.eAbs; + case IMPLICITNODETYPE_FMOD: return ImplicitNodeType.eFmod; + case IMPLICITNODETYPE_POW: return ImplicitNodeType.ePow; + case IMPLICITNODETYPE_SQRT: return ImplicitNodeType.eSqrt; + case IMPLICITNODETYPE_EXP: return ImplicitNodeType.eExp; + case IMPLICITNODETYPE_LOG: return ImplicitNodeType.eLog; + case IMPLICITNODETYPE_LOG2: return ImplicitNodeType.eLog2; + case IMPLICITNODETYPE_LOG10: return ImplicitNodeType.eLog10; + case IMPLICITNODETYPE_SELECT: return ImplicitNodeType.eSelect; + case IMPLICITNODETYPE_CLAMP: return ImplicitNodeType.eClamp; + case IMPLICITNODETYPE_SINH: return ImplicitNodeType.eSinh; + case IMPLICITNODETYPE_COSH: return ImplicitNodeType.eCosh; + case IMPLICITNODETYPE_TANH: return ImplicitNodeType.eTanh; + case IMPLICITNODETYPE_ROUND: return ImplicitNodeType.eRound; + case IMPLICITNODETYPE_CEIL: return ImplicitNodeType.eCeil; + case IMPLICITNODETYPE_FLOOR: return ImplicitNodeType.eFloor; + case IMPLICITNODETYPE_SIGN: return ImplicitNodeType.eSign; + case IMPLICITNODETYPE_FRACT: return ImplicitNodeType.eFract; + case IMPLICITNODETYPE_FUNCTIONCALL: return ImplicitNodeType.eFunctionCall; + case IMPLICITNODETYPE_MESH: return ImplicitNodeType.eMesh; + case IMPLICITNODETYPE_LENGTH: return ImplicitNodeType.eLength; + case IMPLICITNODETYPE_CONSTRESOURCEID: return ImplicitNodeType.eConstResourceID; + case IMPLICITNODETYPE_VECTORFROMSCALAR: return ImplicitNodeType.eVectorFromScalar; + case IMPLICITNODETYPE_UNSIGNEDMESH: return ImplicitNodeType.eUnsignedMesh; + case IMPLICITNODETYPE_MOD: return ImplicitNodeType.eMod; + case IMPLICITNODETYPE_BEAMLATTICE: return ImplicitNodeType.eBeamLattice; + case IMPLICITNODETYPE_FUNCTIONGRADIENT: return ImplicitNodeType.eFunctionGradient; + case IMPLICITNODETYPE_NORMALIZEDISTANCE: return ImplicitNodeType.eNormalizeDistance; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertImplicitPortTypeToConst (ImplicitPortType value) throws Lib3MFException { + switch (value) { + case eScalar: return IMPLICITPORTTYPE_SCALAR; + case eVector: return IMPLICITPORTTYPE_VECTOR; + case eMatrix: return IMPLICITPORTTYPE_MATRIX; + case eResourceID: return IMPLICITPORTTYPE_RESOURCEID; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static ImplicitPortType convertConstToImplicitPortType (int value) throws Lib3MFException { + switch (value) { + case IMPLICITPORTTYPE_SCALAR: return ImplicitPortType.eScalar; + case IMPLICITPORTTYPE_VECTOR: return ImplicitPortType.eVector; + case IMPLICITPORTTYPE_MATRIX: return ImplicitPortType.eMatrix; + case IMPLICITPORTTYPE_RESOURCEID: return ImplicitPortType.eResourceID; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertImplicitNodeConfigurationToConst (ImplicitNodeConfiguration value) throws Lib3MFException { + switch (value) { + case eDefault: return IMPLICITNODECONFIGURATION_DEFAULT; + case eScalarToScalar: return IMPLICITNODECONFIGURATION_SCALARTOSCALAR; + case eVectorToVector: return IMPLICITNODECONFIGURATION_VECTORTOVECTOR; + case eMatrixToMatrix: return IMPLICITNODECONFIGURATION_MATRIXTOMATRIX; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static ImplicitNodeConfiguration convertConstToImplicitNodeConfiguration (int value) throws Lib3MFException { + switch (value) { + case IMPLICITNODECONFIGURATION_DEFAULT: return ImplicitNodeConfiguration.eDefault; + case IMPLICITNODECONFIGURATION_SCALARTOSCALAR: return ImplicitNodeConfiguration.eScalarToScalar; + case IMPLICITNODECONFIGURATION_VECTORTOVECTOR: return ImplicitNodeConfiguration.eVectorToVector; + case IMPLICITNODECONFIGURATION_MATRIXTOMATRIX: return ImplicitNodeConfiguration.eMatrixToMatrix; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertEncryptionAlgorithmToConst (EncryptionAlgorithm value) throws Lib3MFException { + switch (value) { + case eAES256_GCM: return ENCRYPTIONALGORITHM_AES256_GCM; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static EncryptionAlgorithm convertConstToEncryptionAlgorithm (int value) throws Lib3MFException { + switch (value) { + case ENCRYPTIONALGORITHM_AES256_GCM: return EncryptionAlgorithm.eAES256_GCM; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertWrappingAlgorithmToConst (WrappingAlgorithm value) throws Lib3MFException { + switch (value) { + case eRSA_OAEP: return WRAPPINGALGORITHM_RSA_OAEP; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static WrappingAlgorithm convertConstToWrappingAlgorithm (int value) throws Lib3MFException { + switch (value) { + case WRAPPINGALGORITHM_RSA_OAEP: return WrappingAlgorithm.eRSA_OAEP; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertMgfAlgorithmToConst (MgfAlgorithm value) throws Lib3MFException { + switch (value) { + case eMGF1_SHA1: return MGFALGORITHM_MGF1_SHA1; + case eMGF1_SHA224: return MGFALGORITHM_MGF1_SHA224; + case eMGF1_SHA256: return MGFALGORITHM_MGF1_SHA256; + case eMGF1_SHA384: return MGFALGORITHM_MGF1_SHA384; + case eMGF1_SHA512: return MGFALGORITHM_MGF1_SHA512; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static MgfAlgorithm convertConstToMgfAlgorithm (int value) throws Lib3MFException { + switch (value) { + case MGFALGORITHM_MGF1_SHA1: return MgfAlgorithm.eMGF1_SHA1; + case MGFALGORITHM_MGF1_SHA224: return MgfAlgorithm.eMGF1_SHA224; + case MGFALGORITHM_MGF1_SHA256: return MgfAlgorithm.eMGF1_SHA256; + case MGFALGORITHM_MGF1_SHA384: return MgfAlgorithm.eMGF1_SHA384; + case MGFALGORITHM_MGF1_SHA512: return MgfAlgorithm.eMGF1_SHA512; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertDigestMethodToConst (DigestMethod value) throws Lib3MFException { + switch (value) { + case eSHA1: return DIGESTMETHOD_SHA1; + case eSHA256: return DIGESTMETHOD_SHA256; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static DigestMethod convertConstToDigestMethod (int value) throws Lib3MFException { + switch (value) { + case DIGESTMETHOD_SHA1: return DigestMethod.eSHA1; + case DIGESTMETHOD_SHA256: return DigestMethod.eSHA256; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + public static int convertCompressionToConst (Compression value) throws Lib3MFException { + switch (value) { + case eNoCompression: return COMPRESSION_NOCOMPRESSION; + case eDeflate: return COMPRESSION_DEFLATE; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum value : " + value); + } + } + + public static Compression convertConstToCompression (int value) throws Lib3MFException { + switch (value) { + case COMPRESSION_NOCOMPRESSION: return Compression.eNoCompression; + case COMPRESSION_DEFLATE: return Compression.eDeflate; + default: throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Unknown enum const : " + value); + } + } + + } + + public interface ProgressCallback extends Callback { + + void progressCallback (Pointer abort, double progressValue, int progressIdentifier, Pointer userData); + + } + + public interface WriteCallback extends Callback { + + void writeCallback (long byteData, long numBytes, Pointer userData); + + } + + public interface ReadCallback extends Callback { + + void readCallback (long byteData, long numBytes, Pointer userData); + + } + + public interface SeekCallback extends Callback { + + void seekCallback (long position, Pointer userData); + + } + + public interface RandomNumberCallback extends Callback { + + void randomNumberCallback (long byteData, long numBytes, Pointer userData, Pointer bytesWritten); + + } + + public interface KeyWrappingCallback extends Callback { + + void keyWrappingCallback (Pointer kEKParams, int inBufferSize, Pointer inBufferBuffer, int outBufferSize, Pointer outBufferNeededSize, Pointer outBufferBuffer, Pointer userData, Pointer status); + + } + + public interface ContentEncryptionCallback extends Callback { + + void contentEncryptionCallback (Pointer cEKParams, int inputSize, Pointer inputBuffer, int outputSize, Pointer outputNeededSize, Pointer outputBuffer, Pointer userData, Pointer status); + + } + + protected com.sun.jna.Function lib3mf_getlibraryversion; + protected com.sun.jna.Function lib3mf_getprereleaseinformation; + protected com.sun.jna.Function lib3mf_getbuildinformation; + protected com.sun.jna.Function lib3mf_getspecificationversion; + protected com.sun.jna.Function lib3mf_createmodel; + protected com.sun.jna.Function lib3mf_release; + protected com.sun.jna.Function lib3mf_acquire; + protected com.sun.jna.Function lib3mf_setjournal; + protected com.sun.jna.Function lib3mf_getlasterror; + protected com.sun.jna.Function lib3mf_getsymbollookupmethod; + protected com.sun.jna.Function lib3mf_retrieveprogressmessage; + protected com.sun.jna.Function lib3mf_rgbatocolor; + protected com.sun.jna.Function lib3mf_floatrgbatocolor; + protected com.sun.jna.Function lib3mf_colortorgba; + protected com.sun.jna.Function lib3mf_colortofloatrgba; + protected com.sun.jna.Function lib3mf_getidentitytransform; + protected com.sun.jna.Function lib3mf_getuniformscaletransform; + protected com.sun.jna.Function lib3mf_getscaletransform; + protected com.sun.jna.Function lib3mf_gettranslationtransform; + protected com.sun.jna.Function lib3mf_base_classtypeid; + protected com.sun.jna.Function lib3mf_writer_writetofile; + protected com.sun.jna.Function lib3mf_writer_getstreamsize; + protected com.sun.jna.Function lib3mf_writer_writetobuffer; + protected com.sun.jna.Function lib3mf_writer_writetocallback; + protected com.sun.jna.Function lib3mf_writer_setprogresscallback; + protected com.sun.jna.Function lib3mf_writer_getdecimalprecision; + protected com.sun.jna.Function lib3mf_writer_setdecimalprecision; + protected com.sun.jna.Function lib3mf_writer_setstrictmodeactive; + protected com.sun.jna.Function lib3mf_writer_getstrictmodeactive; + protected com.sun.jna.Function lib3mf_writer_getwarning; + protected com.sun.jna.Function lib3mf_writer_getwarningcount; + protected com.sun.jna.Function lib3mf_writer_addkeywrappingcallback; + protected com.sun.jna.Function lib3mf_writer_setcontentencryptioncallback; + protected com.sun.jna.Function lib3mf_reader_readfromfile; + protected com.sun.jna.Function lib3mf_reader_readfrombuffer; + protected com.sun.jna.Function lib3mf_reader_readfromcallback; + protected com.sun.jna.Function lib3mf_reader_setprogresscallback; + protected com.sun.jna.Function lib3mf_reader_addrelationtoread; + protected com.sun.jna.Function lib3mf_reader_removerelationtoread; + protected com.sun.jna.Function lib3mf_reader_setstrictmodeactive; + protected com.sun.jna.Function lib3mf_reader_getstrictmodeactive; + protected com.sun.jna.Function lib3mf_reader_getwarning; + protected com.sun.jna.Function lib3mf_reader_getwarningcount; + protected com.sun.jna.Function lib3mf_reader_addkeywrappingcallback; + protected com.sun.jna.Function lib3mf_reader_setcontentencryptioncallback; + protected com.sun.jna.Function lib3mf_packagepart_getpath; + protected com.sun.jna.Function lib3mf_packagepart_setpath; + protected com.sun.jna.Function lib3mf_resource_getresourceid; + protected com.sun.jna.Function lib3mf_resource_getuniqueresourceid; + protected com.sun.jna.Function lib3mf_resource_packagepart; + protected com.sun.jna.Function lib3mf_resource_setpackagepart; + protected com.sun.jna.Function lib3mf_resource_getmodelresourceid; + protected com.sun.jna.Function lib3mf_resourceiterator_movenext; + protected com.sun.jna.Function lib3mf_resourceiterator_moveprevious; + protected com.sun.jna.Function lib3mf_resourceiterator_getcurrent; + protected com.sun.jna.Function lib3mf_resourceiterator_clone; + protected com.sun.jna.Function lib3mf_resourceiterator_count; + protected com.sun.jna.Function lib3mf_slicestackiterator_getcurrentslicestack; + protected com.sun.jna.Function lib3mf_objectiterator_getcurrentobject; + protected com.sun.jna.Function lib3mf_meshobjectiterator_getcurrentmeshobject; + protected com.sun.jna.Function lib3mf_componentsobjectiterator_getcurrentcomponentsobject; + protected com.sun.jna.Function lib3mf_booleanobjectiterator_getcurrentbooleanobject; + protected com.sun.jna.Function lib3mf_texture2diterator_getcurrenttexture2d; + protected com.sun.jna.Function lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup; + protected com.sun.jna.Function lib3mf_colorgroupiterator_getcurrentcolorgroup; + protected com.sun.jna.Function lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup; + protected com.sun.jna.Function lib3mf_compositematerialsiterator_getcurrentcompositematerials; + protected com.sun.jna.Function lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup; + protected com.sun.jna.Function lib3mf_image3diterator_getcurrentimage3d; + protected com.sun.jna.Function lib3mf_functioniterator_getcurrentfunction; + protected com.sun.jna.Function lib3mf_levelsetiterator_getcurrentlevelset; + protected com.sun.jna.Function lib3mf_metadata_getnamespace; + protected com.sun.jna.Function lib3mf_metadata_setnamespace; + protected com.sun.jna.Function lib3mf_metadata_getname; + protected com.sun.jna.Function lib3mf_metadata_setname; + protected com.sun.jna.Function lib3mf_metadata_getkey; + protected com.sun.jna.Function lib3mf_metadata_getmustpreserve; + protected com.sun.jna.Function lib3mf_metadata_setmustpreserve; + protected com.sun.jna.Function lib3mf_metadata_gettype; + protected com.sun.jna.Function lib3mf_metadata_settype; + protected com.sun.jna.Function lib3mf_metadata_getvalue; + protected com.sun.jna.Function lib3mf_metadata_setvalue; + protected com.sun.jna.Function lib3mf_metadatagroup_getmetadatacount; + protected com.sun.jna.Function lib3mf_metadatagroup_getmetadata; + protected com.sun.jna.Function lib3mf_metadatagroup_getmetadatabykey; + protected com.sun.jna.Function lib3mf_metadatagroup_removemetadatabyindex; + protected com.sun.jna.Function lib3mf_metadatagroup_removemetadata; + protected com.sun.jna.Function lib3mf_metadatagroup_addmetadata; + protected com.sun.jna.Function lib3mf_triangleset_setname; + protected com.sun.jna.Function lib3mf_triangleset_getname; + protected com.sun.jna.Function lib3mf_triangleset_setidentifier; + protected com.sun.jna.Function lib3mf_triangleset_getidentifier; + protected com.sun.jna.Function lib3mf_triangleset_addtriangle; + protected com.sun.jna.Function lib3mf_triangleset_removetriangle; + protected com.sun.jna.Function lib3mf_triangleset_clear; + protected com.sun.jna.Function lib3mf_triangleset_settrianglelist; + protected com.sun.jna.Function lib3mf_triangleset_gettrianglelist; + protected com.sun.jna.Function lib3mf_triangleset_addtrianglelist; + protected com.sun.jna.Function lib3mf_triangleset_merge; + protected com.sun.jna.Function lib3mf_triangleset_deleteset; + protected com.sun.jna.Function lib3mf_triangleset_duplicate; + protected com.sun.jna.Function lib3mf_object_gettype; + protected com.sun.jna.Function lib3mf_object_settype; + protected com.sun.jna.Function lib3mf_object_getname; + protected com.sun.jna.Function lib3mf_object_setname; + protected com.sun.jna.Function lib3mf_object_getpartnumber; + protected com.sun.jna.Function lib3mf_object_setpartnumber; + protected com.sun.jna.Function lib3mf_object_ismeshobject; + protected com.sun.jna.Function lib3mf_object_iscomponentsobject; + protected com.sun.jna.Function lib3mf_object_islevelsetobject; + protected com.sun.jna.Function lib3mf_object_isbooleanobject; + protected com.sun.jna.Function lib3mf_object_isvalid; + protected com.sun.jna.Function lib3mf_object_setattachmentasthumbnail; + protected com.sun.jna.Function lib3mf_object_getthumbnailattachment; + protected com.sun.jna.Function lib3mf_object_clearthumbnailattachment; + protected com.sun.jna.Function lib3mf_object_getoutbox; + protected com.sun.jna.Function lib3mf_object_getuuid; + protected com.sun.jna.Function lib3mf_object_setuuid; + protected com.sun.jna.Function lib3mf_object_getmetadatagroup; + protected com.sun.jna.Function lib3mf_object_setslicesmeshresolution; + protected com.sun.jna.Function lib3mf_object_getslicesmeshresolution; + protected com.sun.jna.Function lib3mf_object_hasslices; + protected com.sun.jna.Function lib3mf_object_clearslicestack; + protected com.sun.jna.Function lib3mf_object_getslicestack; + protected com.sun.jna.Function lib3mf_object_assignslicestack; + protected com.sun.jna.Function lib3mf_meshobject_getvertexcount; + protected com.sun.jna.Function lib3mf_meshobject_gettrianglecount; + protected com.sun.jna.Function lib3mf_meshobject_getvertex; + protected com.sun.jna.Function lib3mf_meshobject_setvertex; + protected com.sun.jna.Function lib3mf_meshobject_addvertex; + protected com.sun.jna.Function lib3mf_meshobject_getvertices; + protected com.sun.jna.Function lib3mf_meshobject_gettriangle; + protected com.sun.jna.Function lib3mf_meshobject_settriangle; + protected com.sun.jna.Function lib3mf_meshobject_addtriangle; + protected com.sun.jna.Function lib3mf_meshobject_gettriangleindices; + protected com.sun.jna.Function lib3mf_meshobject_setobjectlevelproperty; + protected com.sun.jna.Function lib3mf_meshobject_getobjectlevelproperty; + protected com.sun.jna.Function lib3mf_meshobject_settriangleproperties; + protected com.sun.jna.Function lib3mf_meshobject_gettriangleproperties; + protected com.sun.jna.Function lib3mf_meshobject_setalltriangleproperties; + protected com.sun.jna.Function lib3mf_meshobject_getalltriangleproperties; + protected com.sun.jna.Function lib3mf_meshobject_clearallproperties; + protected com.sun.jna.Function lib3mf_meshobject_setgeometry; + protected com.sun.jna.Function lib3mf_meshobject_ismanifoldandoriented; + protected com.sun.jna.Function lib3mf_meshobject_beamlattice; + protected com.sun.jna.Function lib3mf_meshobject_getvolumedata; + protected com.sun.jna.Function lib3mf_meshobject_setvolumedata; + protected com.sun.jna.Function lib3mf_meshobject_addtriangleset; + protected com.sun.jna.Function lib3mf_meshobject_hastriangleset; + protected com.sun.jna.Function lib3mf_meshobject_findtriangleset; + protected com.sun.jna.Function lib3mf_meshobject_gettrianglesetcount; + protected com.sun.jna.Function lib3mf_meshobject_gettriangleset; + protected com.sun.jna.Function lib3mf_levelset_getfunction; + protected com.sun.jna.Function lib3mf_levelset_setfunction; + protected com.sun.jna.Function lib3mf_levelset_gettransform; + protected com.sun.jna.Function lib3mf_levelset_settransform; + protected com.sun.jna.Function lib3mf_levelset_getchannelname; + protected com.sun.jna.Function lib3mf_levelset_setchannelname; + protected com.sun.jna.Function lib3mf_levelset_setminfeaturesize; + protected com.sun.jna.Function lib3mf_levelset_getminfeaturesize; + protected com.sun.jna.Function lib3mf_levelset_setfallbackvalue; + protected com.sun.jna.Function lib3mf_levelset_getfallbackvalue; + protected com.sun.jna.Function lib3mf_levelset_setmeshbboxonly; + protected com.sun.jna.Function lib3mf_levelset_getmeshbboxonly; + protected com.sun.jna.Function lib3mf_levelset_setmesh; + protected com.sun.jna.Function lib3mf_levelset_getmesh; + protected com.sun.jna.Function lib3mf_levelset_getvolumedata; + protected com.sun.jna.Function lib3mf_levelset_setvolumedata; + protected com.sun.jna.Function lib3mf_booleanobject_setbaseobject; + protected com.sun.jna.Function lib3mf_booleanobject_getbaseobject; + protected com.sun.jna.Function lib3mf_booleanobject_setbasetransform; + protected com.sun.jna.Function lib3mf_booleanobject_getbasetransform; + protected com.sun.jna.Function lib3mf_booleanobject_setoperation; + protected com.sun.jna.Function lib3mf_booleanobject_getoperation; + protected com.sun.jna.Function lib3mf_booleanobject_setcsgmodeenabled; + protected com.sun.jna.Function lib3mf_booleanobject_getcsgmodeenabled; + protected com.sun.jna.Function lib3mf_booleanobject_setextractiongridresolution; + protected com.sun.jna.Function lib3mf_booleanobject_getextractiongridresolution; + protected com.sun.jna.Function lib3mf_booleanobject_getoperandcount; + protected com.sun.jna.Function lib3mf_booleanobject_addoperand; + protected com.sun.jna.Function lib3mf_booleanobject_getoperand; + protected com.sun.jna.Function lib3mf_booleanobject_mergetomeshobject; + protected com.sun.jna.Function lib3mf_beamlattice_getminlength; + protected com.sun.jna.Function lib3mf_beamlattice_setminlength; + protected com.sun.jna.Function lib3mf_beamlattice_getclipping; + protected com.sun.jna.Function lib3mf_beamlattice_setclipping; + protected com.sun.jna.Function lib3mf_beamlattice_getrepresentation; + protected com.sun.jna.Function lib3mf_beamlattice_setrepresentation; + protected com.sun.jna.Function lib3mf_beamlattice_getballoptions; + protected com.sun.jna.Function lib3mf_beamlattice_setballoptions; + protected com.sun.jna.Function lib3mf_beamlattice_getbeamcount; + protected com.sun.jna.Function lib3mf_beamlattice_getbeam; + protected com.sun.jna.Function lib3mf_beamlattice_addbeam; + protected com.sun.jna.Function lib3mf_beamlattice_setbeam; + protected com.sun.jna.Function lib3mf_beamlattice_setbeams; + protected com.sun.jna.Function lib3mf_beamlattice_getbeams; + protected com.sun.jna.Function lib3mf_beamlattice_getballcount; + protected com.sun.jna.Function lib3mf_beamlattice_getball; + protected com.sun.jna.Function lib3mf_beamlattice_addball; + protected com.sun.jna.Function lib3mf_beamlattice_setball; + protected com.sun.jna.Function lib3mf_beamlattice_setballs; + protected com.sun.jna.Function lib3mf_beamlattice_getballs; + protected com.sun.jna.Function lib3mf_beamlattice_getbeamsetcount; + protected com.sun.jna.Function lib3mf_beamlattice_addbeamset; + protected com.sun.jna.Function lib3mf_beamlattice_getbeamset; + protected com.sun.jna.Function lib3mf_functionreference_getfunctionresourceid; + protected com.sun.jna.Function lib3mf_functionreference_setfunctionresourceid; + protected com.sun.jna.Function lib3mf_functionreference_gettransform; + protected com.sun.jna.Function lib3mf_functionreference_settransform; + protected com.sun.jna.Function lib3mf_functionreference_getchannelname; + protected com.sun.jna.Function lib3mf_functionreference_setchannelname; + protected com.sun.jna.Function lib3mf_functionreference_setminfeaturesize; + protected com.sun.jna.Function lib3mf_functionreference_getminfeaturesize; + protected com.sun.jna.Function lib3mf_functionreference_setfallbackvalue; + protected com.sun.jna.Function lib3mf_functionreference_getfallbackvalue; + protected com.sun.jna.Function lib3mf_volumedatacomposite_getbasematerialgroup; + protected com.sun.jna.Function lib3mf_volumedatacomposite_setbasematerialgroup; + protected com.sun.jna.Function lib3mf_volumedatacomposite_getmaterialmappingcount; + protected com.sun.jna.Function lib3mf_volumedatacomposite_getmaterialmapping; + protected com.sun.jna.Function lib3mf_volumedatacomposite_addmaterialmapping; + protected com.sun.jna.Function lib3mf_volumedatacomposite_removematerialmapping; + protected com.sun.jna.Function lib3mf_volumedataproperty_getname; + protected com.sun.jna.Function lib3mf_volumedataproperty_setisrequired; + protected com.sun.jna.Function lib3mf_volumedataproperty_isrequired; + protected com.sun.jna.Function lib3mf_volumedata_getcomposite; + protected com.sun.jna.Function lib3mf_volumedata_createnewcomposite; + protected com.sun.jna.Function lib3mf_volumedata_removecomposite; + protected com.sun.jna.Function lib3mf_volumedata_getcolor; + protected com.sun.jna.Function lib3mf_volumedata_createnewcolor; + protected com.sun.jna.Function lib3mf_volumedata_removecolor; + protected com.sun.jna.Function lib3mf_volumedata_getpropertycount; + protected com.sun.jna.Function lib3mf_volumedata_getproperty; + protected com.sun.jna.Function lib3mf_volumedata_addpropertyfromfunction; + protected com.sun.jna.Function lib3mf_volumedata_removeproperty; + protected com.sun.jna.Function lib3mf_component_getobjectresource; + protected com.sun.jna.Function lib3mf_component_getobjectresourceid; + protected com.sun.jna.Function lib3mf_component_getuuid; + protected com.sun.jna.Function lib3mf_component_setuuid; + protected com.sun.jna.Function lib3mf_component_hastransform; + protected com.sun.jna.Function lib3mf_component_gettransform; + protected com.sun.jna.Function lib3mf_component_settransform; + protected com.sun.jna.Function lib3mf_componentsobject_addcomponent; + protected com.sun.jna.Function lib3mf_componentsobject_getcomponent; + protected com.sun.jna.Function lib3mf_componentsobject_getcomponentcount; + protected com.sun.jna.Function lib3mf_beamset_setname; + protected com.sun.jna.Function lib3mf_beamset_getname; + protected com.sun.jna.Function lib3mf_beamset_setidentifier; + protected com.sun.jna.Function lib3mf_beamset_getidentifier; + protected com.sun.jna.Function lib3mf_beamset_getreferencecount; + protected com.sun.jna.Function lib3mf_beamset_setreferences; + protected com.sun.jna.Function lib3mf_beamset_getreferences; + protected com.sun.jna.Function lib3mf_beamset_getballreferencecount; + protected com.sun.jna.Function lib3mf_beamset_setballreferences; + protected com.sun.jna.Function lib3mf_beamset_getballreferences; + protected com.sun.jna.Function lib3mf_basematerialgroup_getcount; + protected com.sun.jna.Function lib3mf_basematerialgroup_getallpropertyids; + protected com.sun.jna.Function lib3mf_basematerialgroup_addmaterial; + protected com.sun.jna.Function lib3mf_basematerialgroup_removematerial; + protected com.sun.jna.Function lib3mf_basematerialgroup_getname; + protected com.sun.jna.Function lib3mf_basematerialgroup_setname; + protected com.sun.jna.Function lib3mf_basematerialgroup_setdisplaycolor; + protected com.sun.jna.Function lib3mf_basematerialgroup_getdisplaycolor; + protected com.sun.jna.Function lib3mf_colorgroup_getcount; + protected com.sun.jna.Function lib3mf_colorgroup_getallpropertyids; + protected com.sun.jna.Function lib3mf_colorgroup_addcolor; + protected com.sun.jna.Function lib3mf_colorgroup_removecolor; + protected com.sun.jna.Function lib3mf_colorgroup_setcolor; + protected com.sun.jna.Function lib3mf_colorgroup_getcolor; + protected com.sun.jna.Function lib3mf_texture2dgroup_getcount; + protected com.sun.jna.Function lib3mf_texture2dgroup_getallpropertyids; + protected com.sun.jna.Function lib3mf_texture2dgroup_addtex2coord; + protected com.sun.jna.Function lib3mf_texture2dgroup_gettex2coord; + protected com.sun.jna.Function lib3mf_texture2dgroup_removetex2coord; + protected com.sun.jna.Function lib3mf_texture2dgroup_gettexture2d; + protected com.sun.jna.Function lib3mf_compositematerials_getcount; + protected com.sun.jna.Function lib3mf_compositematerials_getallpropertyids; + protected com.sun.jna.Function lib3mf_compositematerials_getbasematerialgroup; + protected com.sun.jna.Function lib3mf_compositematerials_addcomposite; + protected com.sun.jna.Function lib3mf_compositematerials_removecomposite; + protected com.sun.jna.Function lib3mf_compositematerials_getcomposite; + protected com.sun.jna.Function lib3mf_multipropertygroup_getcount; + protected com.sun.jna.Function lib3mf_multipropertygroup_getallpropertyids; + protected com.sun.jna.Function lib3mf_multipropertygroup_addmultiproperty; + protected com.sun.jna.Function lib3mf_multipropertygroup_setmultiproperty; + protected com.sun.jna.Function lib3mf_multipropertygroup_getmultiproperty; + protected com.sun.jna.Function lib3mf_multipropertygroup_removemultiproperty; + protected com.sun.jna.Function lib3mf_multipropertygroup_getlayercount; + protected com.sun.jna.Function lib3mf_multipropertygroup_addlayer; + protected com.sun.jna.Function lib3mf_multipropertygroup_getlayer; + protected com.sun.jna.Function lib3mf_multipropertygroup_removelayer; + protected com.sun.jna.Function lib3mf_image3d_getname; + protected com.sun.jna.Function lib3mf_image3d_setname; + protected com.sun.jna.Function lib3mf_image3d_isimagestack; + protected com.sun.jna.Function lib3mf_imagestack_getrowcount; + protected com.sun.jna.Function lib3mf_imagestack_setrowcount; + protected com.sun.jna.Function lib3mf_imagestack_getcolumncount; + protected com.sun.jna.Function lib3mf_imagestack_setcolumncount; + protected com.sun.jna.Function lib3mf_imagestack_getsheetcount; + protected com.sun.jna.Function lib3mf_imagestack_getsheet; + protected com.sun.jna.Function lib3mf_imagestack_setsheet; + protected com.sun.jna.Function lib3mf_imagestack_createemptysheet; + protected com.sun.jna.Function lib3mf_imagestack_createsheetfrombuffer; + protected com.sun.jna.Function lib3mf_imagestack_createsheetfromfile; + protected com.sun.jna.Function lib3mf_attachment_getpath; + protected com.sun.jna.Function lib3mf_attachment_setpath; + protected com.sun.jna.Function lib3mf_attachment_packagepart; + protected com.sun.jna.Function lib3mf_attachment_getrelationshiptype; + protected com.sun.jna.Function lib3mf_attachment_setrelationshiptype; + protected com.sun.jna.Function lib3mf_attachment_writetofile; + protected com.sun.jna.Function lib3mf_attachment_readfromfile; + protected com.sun.jna.Function lib3mf_attachment_readfromcallback; + protected com.sun.jna.Function lib3mf_attachment_getstreamsize; + protected com.sun.jna.Function lib3mf_attachment_writetobuffer; + protected com.sun.jna.Function lib3mf_attachment_readfrombuffer; + protected com.sun.jna.Function lib3mf_texture2d_getattachment; + protected com.sun.jna.Function lib3mf_texture2d_setattachment; + protected com.sun.jna.Function lib3mf_texture2d_getcontenttype; + protected com.sun.jna.Function lib3mf_texture2d_setcontenttype; + protected com.sun.jna.Function lib3mf_texture2d_gettilestyleuv; + protected com.sun.jna.Function lib3mf_texture2d_settilestyleuv; + protected com.sun.jna.Function lib3mf_texture2d_getfilter; + protected com.sun.jna.Function lib3mf_texture2d_setfilter; + protected com.sun.jna.Function lib3mf_implicitport_getidentifier; + protected com.sun.jna.Function lib3mf_implicitport_setidentifier; + protected com.sun.jna.Function lib3mf_implicitport_getdisplayname; + protected com.sun.jna.Function lib3mf_implicitport_setdisplayname; + protected com.sun.jna.Function lib3mf_implicitport_settype; + protected com.sun.jna.Function lib3mf_implicitport_gettype; + protected com.sun.jna.Function lib3mf_implicitport_getreference; + protected com.sun.jna.Function lib3mf_implicitport_setreference; + protected com.sun.jna.Function lib3mf_iterator_movenext; + protected com.sun.jna.Function lib3mf_iterator_moveprevious; + protected com.sun.jna.Function lib3mf_iterator_count; + protected com.sun.jna.Function lib3mf_implicitportiterator_getcurrent; + protected com.sun.jna.Function lib3mf_implicitnode_getidentifier; + protected com.sun.jna.Function lib3mf_implicitnode_setidentifier; + protected com.sun.jna.Function lib3mf_implicitnode_getdisplayname; + protected com.sun.jna.Function lib3mf_implicitnode_setdisplayname; + protected com.sun.jna.Function lib3mf_implicitnode_gettag; + protected com.sun.jna.Function lib3mf_implicitnode_settag; + protected com.sun.jna.Function lib3mf_implicitnode_getnodetype; + protected com.sun.jna.Function lib3mf_implicitnode_addinput; + protected com.sun.jna.Function lib3mf_implicitnode_getinputs; + protected com.sun.jna.Function lib3mf_implicitnode_addoutput; + protected com.sun.jna.Function lib3mf_implicitnode_getoutputs; + protected com.sun.jna.Function lib3mf_implicitnode_findinput; + protected com.sun.jna.Function lib3mf_implicitnode_findoutput; + protected com.sun.jna.Function lib3mf_implicitnode_aretypesvalid; + protected com.sun.jna.Function lib3mf_oneinputnode_getinputa; + protected com.sun.jna.Function lib3mf_oneinputnode_getoutputresult; + protected com.sun.jna.Function lib3mf_resourceidnode_setresource; + protected com.sun.jna.Function lib3mf_resourceidnode_getresource; + protected com.sun.jna.Function lib3mf_resourceidnode_getoutputvalue; + protected com.sun.jna.Function lib3mf_twoinputnode_getinputb; + protected com.sun.jna.Function lib3mf_selectnode_getinputb; + protected com.sun.jna.Function lib3mf_selectnode_getinputc; + protected com.sun.jna.Function lib3mf_selectnode_getinputd; + protected com.sun.jna.Function lib3mf_clampnode_getinputmin; + protected com.sun.jna.Function lib3mf_clampnode_getinputmax; + protected com.sun.jna.Function lib3mf_composevectornode_getinputx; + protected com.sun.jna.Function lib3mf_composevectornode_getinputy; + protected com.sun.jna.Function lib3mf_composevectornode_getinputz; + protected com.sun.jna.Function lib3mf_composevectornode_getoutputresult; + protected com.sun.jna.Function lib3mf_decomposevectornode_getinputa; + protected com.sun.jna.Function lib3mf_decomposevectornode_getoutputx; + protected com.sun.jna.Function lib3mf_decomposevectornode_getoutputy; + protected com.sun.jna.Function lib3mf_decomposevectornode_getoutputz; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm00; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm01; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm02; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm03; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm10; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm11; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm12; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm13; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm20; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm21; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm22; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm23; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm30; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm31; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm32; + protected com.sun.jna.Function lib3mf_composematrixnode_getinputm33; + protected com.sun.jna.Function lib3mf_composematrixnode_getoutputresult; + protected com.sun.jna.Function lib3mf_matrixfromrowsnode_getinputa; + protected com.sun.jna.Function lib3mf_matrixfromrowsnode_getinputb; + protected com.sun.jna.Function lib3mf_matrixfromrowsnode_getinputc; + protected com.sun.jna.Function lib3mf_matrixfromrowsnode_getinputd; + protected com.sun.jna.Function lib3mf_matrixfromrowsnode_getoutputresult; + protected com.sun.jna.Function lib3mf_matrixfromcolumnsnode_getinputa; + protected com.sun.jna.Function lib3mf_matrixfromcolumnsnode_getinputb; + protected com.sun.jna.Function lib3mf_matrixfromcolumnsnode_getinputc; + protected com.sun.jna.Function lib3mf_matrixfromcolumnsnode_getinputd; + protected com.sun.jna.Function lib3mf_matrixfromcolumnsnode_getoutputresult; + protected com.sun.jna.Function lib3mf_constantnode_setconstant; + protected com.sun.jna.Function lib3mf_constantnode_getconstant; + protected com.sun.jna.Function lib3mf_constantnode_getoutputvalue; + protected com.sun.jna.Function lib3mf_constvecnode_setvector; + protected com.sun.jna.Function lib3mf_constvecnode_getvector; + protected com.sun.jna.Function lib3mf_constvecnode_getoutputvector; + protected com.sun.jna.Function lib3mf_constmatnode_setmatrix; + protected com.sun.jna.Function lib3mf_constmatnode_getmatrix; + protected com.sun.jna.Function lib3mf_constmatnode_getoutputmatrix; + protected com.sun.jna.Function lib3mf_meshnode_getinputmesh; + protected com.sun.jna.Function lib3mf_meshnode_getinputpos; + protected com.sun.jna.Function lib3mf_meshnode_getoutputdistance; + protected com.sun.jna.Function lib3mf_unsignedmeshnode_getinputmesh; + protected com.sun.jna.Function lib3mf_unsignedmeshnode_getinputpos; + protected com.sun.jna.Function lib3mf_unsignedmeshnode_getoutputdistance; + protected com.sun.jna.Function lib3mf_beamlatticenode_getinputbeamlattice; + protected com.sun.jna.Function lib3mf_beamlatticenode_getinputpos; + protected com.sun.jna.Function lib3mf_beamlatticenode_getoutputdistance; + protected com.sun.jna.Function lib3mf_beamlatticenode_setaccuraterange; + protected com.sun.jna.Function lib3mf_beamlatticenode_getaccuraterange; + protected com.sun.jna.Function lib3mf_functiongradientnode_getinputfunctionid; + protected com.sun.jna.Function lib3mf_functiongradientnode_getinputpos; + protected com.sun.jna.Function lib3mf_functiongradientnode_getinputstep; + protected com.sun.jna.Function lib3mf_functiongradientnode_setscalaroutputname; + protected com.sun.jna.Function lib3mf_functiongradientnode_getscalaroutputname; + protected com.sun.jna.Function lib3mf_functiongradientnode_setvectorinputname; + protected com.sun.jna.Function lib3mf_functiongradientnode_getvectorinputname; + protected com.sun.jna.Function lib3mf_functiongradientnode_getoutputnormalizedgradient; + protected com.sun.jna.Function lib3mf_functiongradientnode_getoutputgradient; + protected com.sun.jna.Function lib3mf_functiongradientnode_getoutputmagnitude; + protected com.sun.jna.Function lib3mf_normalizedistancenode_getinputfunctionid; + protected com.sun.jna.Function lib3mf_normalizedistancenode_getinputpos; + protected com.sun.jna.Function lib3mf_normalizedistancenode_getinputstep; + protected com.sun.jna.Function lib3mf_normalizedistancenode_setscalaroutputname; + protected com.sun.jna.Function lib3mf_normalizedistancenode_getscalaroutputname; + protected com.sun.jna.Function lib3mf_normalizedistancenode_setvectorinputname; + protected com.sun.jna.Function lib3mf_normalizedistancenode_getvectorinputname; + protected com.sun.jna.Function lib3mf_normalizedistancenode_getoutputresult; + protected com.sun.jna.Function lib3mf_functioncallnode_getinputfunctionid; + protected com.sun.jna.Function lib3mf_nodeiterator_getcurrent; + protected com.sun.jna.Function lib3mf_function_getdisplayname; + protected com.sun.jna.Function lib3mf_function_setdisplayname; + protected com.sun.jna.Function lib3mf_function_addinput; + protected com.sun.jna.Function lib3mf_function_getinputs; + protected com.sun.jna.Function lib3mf_function_removeinput; + protected com.sun.jna.Function lib3mf_function_addoutput; + protected com.sun.jna.Function lib3mf_function_getoutputs; + protected com.sun.jna.Function lib3mf_function_removeoutput; + protected com.sun.jna.Function lib3mf_function_findinput; + protected com.sun.jna.Function lib3mf_function_findoutput; + protected com.sun.jna.Function lib3mf_implicitfunction_getidentifier; + protected com.sun.jna.Function lib3mf_implicitfunction_setidentifier; + protected com.sun.jna.Function lib3mf_implicitfunction_addnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addsinnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addcosnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addtannode; + protected com.sun.jna.Function lib3mf_implicitfunction_addarcsinnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addarccosnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addarctan2node; + protected com.sun.jna.Function lib3mf_implicitfunction_addsinhnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addcoshnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addtanhnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addroundnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addceilnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addfloornode; + protected com.sun.jna.Function lib3mf_implicitfunction_addsignnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addfractnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addabsnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addexpnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addlognode; + protected com.sun.jna.Function lib3mf_implicitfunction_addlog2node; + protected com.sun.jna.Function lib3mf_implicitfunction_addlog10node; + protected com.sun.jna.Function lib3mf_implicitfunction_addlengthnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addtransposenode; + protected com.sun.jna.Function lib3mf_implicitfunction_addinversenode; + protected com.sun.jna.Function lib3mf_implicitfunction_addsqrtnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addresourceidnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addadditionnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addsubtractionnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addmultiplicationnode; + protected com.sun.jna.Function lib3mf_implicitfunction_adddivisionnode; + protected com.sun.jna.Function lib3mf_implicitfunction_adddotnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addcrossnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addmatvecmultiplicationnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addminnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addmaxnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addfmodnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addpownode; + protected com.sun.jna.Function lib3mf_implicitfunction_addselectnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addclampnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addcomposevectornode; + protected com.sun.jna.Function lib3mf_implicitfunction_addvectorfromscalarnode; + protected com.sun.jna.Function lib3mf_implicitfunction_adddecomposevectornode; + protected com.sun.jna.Function lib3mf_implicitfunction_addcomposematrixnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addmatrixfromrowsnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addmatrixfromcolumnsnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addconstantnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addconstvecnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addconstmatnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addmeshnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addunsignedmeshnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addbeamlatticenode; + protected com.sun.jna.Function lib3mf_implicitfunction_addfunctiongradientnode; + protected com.sun.jna.Function lib3mf_implicitfunction_addnormalizedistancenode; + protected com.sun.jna.Function lib3mf_implicitfunction_addfunctioncallnode; + protected com.sun.jna.Function lib3mf_implicitfunction_getnodes; + protected com.sun.jna.Function lib3mf_implicitfunction_removenode; + protected com.sun.jna.Function lib3mf_implicitfunction_addlink; + protected com.sun.jna.Function lib3mf_implicitfunction_addlinkbynames; + protected com.sun.jna.Function lib3mf_implicitfunction_clear; + protected com.sun.jna.Function lib3mf_implicitfunction_sortnodestopologically; + protected com.sun.jna.Function lib3mf_functionfromimage3d_getimage3d; + protected com.sun.jna.Function lib3mf_functionfromimage3d_setimage3d; + protected com.sun.jna.Function lib3mf_functionfromimage3d_setfilter; + protected com.sun.jna.Function lib3mf_functionfromimage3d_getfilter; + protected com.sun.jna.Function lib3mf_functionfromimage3d_settilestyles; + protected com.sun.jna.Function lib3mf_functionfromimage3d_gettilestyles; + protected com.sun.jna.Function lib3mf_functionfromimage3d_getoffset; + protected com.sun.jna.Function lib3mf_functionfromimage3d_setoffset; + protected com.sun.jna.Function lib3mf_functionfromimage3d_getscale; + protected com.sun.jna.Function lib3mf_functionfromimage3d_setscale; + protected com.sun.jna.Function lib3mf_builditem_getobjectresource; + protected com.sun.jna.Function lib3mf_builditem_getuuid; + protected com.sun.jna.Function lib3mf_builditem_setuuid; + protected com.sun.jna.Function lib3mf_builditem_getobjectresourceid; + protected com.sun.jna.Function lib3mf_builditem_hasobjecttransform; + protected com.sun.jna.Function lib3mf_builditem_getobjecttransform; + protected com.sun.jna.Function lib3mf_builditem_setobjecttransform; + protected com.sun.jna.Function lib3mf_builditem_getpartnumber; + protected com.sun.jna.Function lib3mf_builditem_setpartnumber; + protected com.sun.jna.Function lib3mf_builditem_getmetadatagroup; + protected com.sun.jna.Function lib3mf_builditem_getoutbox; + protected com.sun.jna.Function lib3mf_builditemiterator_movenext; + protected com.sun.jna.Function lib3mf_builditemiterator_moveprevious; + protected com.sun.jna.Function lib3mf_builditemiterator_getcurrent; + protected com.sun.jna.Function lib3mf_builditemiterator_clone; + protected com.sun.jna.Function lib3mf_builditemiterator_count; + protected com.sun.jna.Function lib3mf_slice_setvertices; + protected com.sun.jna.Function lib3mf_slice_getvertices; + protected com.sun.jna.Function lib3mf_slice_getvertexcount; + protected com.sun.jna.Function lib3mf_slice_addpolygon; + protected com.sun.jna.Function lib3mf_slice_getpolygoncount; + protected com.sun.jna.Function lib3mf_slice_setpolygonindices; + protected com.sun.jna.Function lib3mf_slice_getpolygonindices; + protected com.sun.jna.Function lib3mf_slice_getpolygonindexcount; + protected com.sun.jna.Function lib3mf_slice_getztop; + protected com.sun.jna.Function lib3mf_slicestack_getbottomz; + protected com.sun.jna.Function lib3mf_slicestack_getslicecount; + protected com.sun.jna.Function lib3mf_slicestack_getslice; + protected com.sun.jna.Function lib3mf_slicestack_addslice; + protected com.sun.jna.Function lib3mf_slicestack_getslicerefcount; + protected com.sun.jna.Function lib3mf_slicestack_addslicestackreference; + protected com.sun.jna.Function lib3mf_slicestack_getslicestackreference; + protected com.sun.jna.Function lib3mf_slicestack_collapseslicereferences; + protected com.sun.jna.Function lib3mf_slicestack_setownpath; + protected com.sun.jna.Function lib3mf_slicestack_getownpath; + protected com.sun.jna.Function lib3mf_consumer_getconsumerid; + protected com.sun.jna.Function lib3mf_consumer_getkeyid; + protected com.sun.jna.Function lib3mf_consumer_getkeyvalue; + protected com.sun.jna.Function lib3mf_accessright_getconsumer; + protected com.sun.jna.Function lib3mf_accessright_getwrappingalgorithm; + protected com.sun.jna.Function lib3mf_accessright_getmgfalgorithm; + protected com.sun.jna.Function lib3mf_accessright_getdigestmethod; + protected com.sun.jna.Function lib3mf_contentencryptionparams_getencryptionalgorithm; + protected com.sun.jna.Function lib3mf_contentencryptionparams_getkey; + protected com.sun.jna.Function lib3mf_contentencryptionparams_getinitializationvector; + protected com.sun.jna.Function lib3mf_contentencryptionparams_getauthenticationtag; + protected com.sun.jna.Function lib3mf_contentencryptionparams_setauthenticationtag; + protected com.sun.jna.Function lib3mf_contentencryptionparams_getadditionalauthenticationdata; + protected com.sun.jna.Function lib3mf_contentencryptionparams_getdescriptor; + protected com.sun.jna.Function lib3mf_contentencryptionparams_getkeyuuid; + protected com.sun.jna.Function lib3mf_resourcedata_getpath; + protected com.sun.jna.Function lib3mf_resourcedata_getencryptionalgorithm; + protected com.sun.jna.Function lib3mf_resourcedata_getcompression; + protected com.sun.jna.Function lib3mf_resourcedata_getadditionalauthenticationdata; + protected com.sun.jna.Function lib3mf_resourcedatagroup_getkeyuuid; + protected com.sun.jna.Function lib3mf_resourcedatagroup_addaccessright; + protected com.sun.jna.Function lib3mf_resourcedatagroup_findaccessrightbyconsumer; + protected com.sun.jna.Function lib3mf_resourcedatagroup_removeaccessright; + protected com.sun.jna.Function lib3mf_keystore_addconsumer; + protected com.sun.jna.Function lib3mf_keystore_getconsumercount; + protected com.sun.jna.Function lib3mf_keystore_getconsumer; + protected com.sun.jna.Function lib3mf_keystore_removeconsumer; + protected com.sun.jna.Function lib3mf_keystore_findconsumer; + protected com.sun.jna.Function lib3mf_keystore_getresourcedatagroupcount; + protected com.sun.jna.Function lib3mf_keystore_addresourcedatagroup; + protected com.sun.jna.Function lib3mf_keystore_getresourcedatagroup; + protected com.sun.jna.Function lib3mf_keystore_removeresourcedatagroup; + protected com.sun.jna.Function lib3mf_keystore_findresourcedatagroup; + protected com.sun.jna.Function lib3mf_keystore_addresourcedata; + protected com.sun.jna.Function lib3mf_keystore_removeresourcedata; + protected com.sun.jna.Function lib3mf_keystore_findresourcedata; + protected com.sun.jna.Function lib3mf_keystore_getresourcedatacount; + protected com.sun.jna.Function lib3mf_keystore_getresourcedata; + protected com.sun.jna.Function lib3mf_keystore_getuuid; + protected com.sun.jna.Function lib3mf_keystore_setuuid; + protected com.sun.jna.Function lib3mf_model_rootmodelpart; + protected com.sun.jna.Function lib3mf_model_findorcreatepackagepart; + protected com.sun.jna.Function lib3mf_model_setunit; + protected com.sun.jna.Function lib3mf_model_getunit; + protected com.sun.jna.Function lib3mf_model_getlanguage; + protected com.sun.jna.Function lib3mf_model_setlanguage; + protected com.sun.jna.Function lib3mf_model_querywriter; + protected com.sun.jna.Function lib3mf_model_queryreader; + protected com.sun.jna.Function lib3mf_model_getresourcebyid; + protected com.sun.jna.Function lib3mf_model_gettexture2dbyid; + protected com.sun.jna.Function lib3mf_model_getpropertytypebyid; + protected com.sun.jna.Function lib3mf_model_getbasematerialgroupbyid; + protected com.sun.jna.Function lib3mf_model_gettexture2dgroupbyid; + protected com.sun.jna.Function lib3mf_model_getcompositematerialsbyid; + protected com.sun.jna.Function lib3mf_model_getmultipropertygroupbyid; + protected com.sun.jna.Function lib3mf_model_getmeshobjectbyid; + protected com.sun.jna.Function lib3mf_model_getcomponentsobjectbyid; + protected com.sun.jna.Function lib3mf_model_getbooleanobjectbyid; + protected com.sun.jna.Function lib3mf_model_getcolorgroupbyid; + protected com.sun.jna.Function lib3mf_model_getslicestackbyid; + protected com.sun.jna.Function lib3mf_model_getlevelsetbyid; + protected com.sun.jna.Function lib3mf_model_getbuilduuid; + protected com.sun.jna.Function lib3mf_model_setbuilduuid; + protected com.sun.jna.Function lib3mf_model_getbuilditems; + protected com.sun.jna.Function lib3mf_model_getoutbox; + protected com.sun.jna.Function lib3mf_model_getresources; + protected com.sun.jna.Function lib3mf_model_getobjects; + protected com.sun.jna.Function lib3mf_model_getmeshobjects; + protected com.sun.jna.Function lib3mf_model_getcomponentsobjects; + protected com.sun.jna.Function lib3mf_model_getbooleanobjects; + protected com.sun.jna.Function lib3mf_model_gettexture2ds; + protected com.sun.jna.Function lib3mf_model_getbasematerialgroups; + protected com.sun.jna.Function lib3mf_model_getcolorgroups; + protected com.sun.jna.Function lib3mf_model_gettexture2dgroups; + protected com.sun.jna.Function lib3mf_model_getcompositematerials; + protected com.sun.jna.Function lib3mf_model_getmultipropertygroups; + protected com.sun.jna.Function lib3mf_model_getslicestacks; + protected com.sun.jna.Function lib3mf_model_getimage3ds; + protected com.sun.jna.Function lib3mf_model_mergetomodel; + protected com.sun.jna.Function lib3mf_model_mergefrommodel; + protected com.sun.jna.Function lib3mf_model_addmeshobject; + protected com.sun.jna.Function lib3mf_model_addcomponentsobject; + protected com.sun.jna.Function lib3mf_model_addbooleanobject; + protected com.sun.jna.Function lib3mf_model_addslicestack; + protected com.sun.jna.Function lib3mf_model_addtexture2dfromattachment; + protected com.sun.jna.Function lib3mf_model_addbasematerialgroup; + protected com.sun.jna.Function lib3mf_model_addcolorgroup; + protected com.sun.jna.Function lib3mf_model_addtexture2dgroup; + protected com.sun.jna.Function lib3mf_model_addcompositematerials; + protected com.sun.jna.Function lib3mf_model_addmultipropertygroup; + protected com.sun.jna.Function lib3mf_model_addimagestack; + protected com.sun.jna.Function lib3mf_model_getimagestackbyid; + protected com.sun.jna.Function lib3mf_model_addbuilditem; + protected com.sun.jna.Function lib3mf_model_removebuilditem; + protected com.sun.jna.Function lib3mf_model_getmetadatagroup; + protected com.sun.jna.Function lib3mf_model_addattachment; + protected com.sun.jna.Function lib3mf_model_removeattachment; + protected com.sun.jna.Function lib3mf_model_getattachment; + protected com.sun.jna.Function lib3mf_model_findattachment; + protected com.sun.jna.Function lib3mf_model_getattachmentcount; + protected com.sun.jna.Function lib3mf_model_haspackagethumbnailattachment; + protected com.sun.jna.Function lib3mf_model_createpackagethumbnailattachment; + protected com.sun.jna.Function lib3mf_model_getpackagethumbnailattachment; + protected com.sun.jna.Function lib3mf_model_removepackagethumbnailattachment; + protected com.sun.jna.Function lib3mf_model_addcustomcontenttype; + protected com.sun.jna.Function lib3mf_model_removecustomcontenttype; + protected com.sun.jna.Function lib3mf_model_setrandomnumbercallback; + protected com.sun.jna.Function lib3mf_model_getkeystore; + protected com.sun.jna.Function lib3mf_model_getfunctions; + protected com.sun.jna.Function lib3mf_model_addimplicitfunction; + protected com.sun.jna.Function lib3mf_model_addfunctionfromimage3d; + protected com.sun.jna.Function lib3mf_model_addvolumedata; + protected com.sun.jna.Function lib3mf_model_addlevelset; + protected com.sun.jna.Function lib3mf_model_getlevelsets; + protected com.sun.jna.Function lib3mf_model_removeresource; + + protected NativeLibrary mLibrary; + + public Lib3MFWrapper(String libraryPath) { + mLibrary = NativeLibrary.getInstance(libraryPath); + lib3mf_getlibraryversion = mLibrary.getFunction("lib3mf_getlibraryversion"); + lib3mf_getprereleaseinformation = mLibrary.getFunction("lib3mf_getprereleaseinformation"); + lib3mf_getbuildinformation = mLibrary.getFunction("lib3mf_getbuildinformation"); + lib3mf_getspecificationversion = mLibrary.getFunction("lib3mf_getspecificationversion"); + lib3mf_createmodel = mLibrary.getFunction("lib3mf_createmodel"); + lib3mf_release = mLibrary.getFunction("lib3mf_release"); + lib3mf_acquire = mLibrary.getFunction("lib3mf_acquire"); + lib3mf_setjournal = mLibrary.getFunction("lib3mf_setjournal"); + lib3mf_getlasterror = mLibrary.getFunction("lib3mf_getlasterror"); + lib3mf_getsymbollookupmethod = mLibrary.getFunction("lib3mf_getsymbollookupmethod"); + lib3mf_retrieveprogressmessage = mLibrary.getFunction("lib3mf_retrieveprogressmessage"); + lib3mf_rgbatocolor = mLibrary.getFunction("lib3mf_rgbatocolor"); + lib3mf_floatrgbatocolor = mLibrary.getFunction("lib3mf_floatrgbatocolor"); + lib3mf_colortorgba = mLibrary.getFunction("lib3mf_colortorgba"); + lib3mf_colortofloatrgba = mLibrary.getFunction("lib3mf_colortofloatrgba"); + lib3mf_getidentitytransform = mLibrary.getFunction("lib3mf_getidentitytransform"); + lib3mf_getuniformscaletransform = mLibrary.getFunction("lib3mf_getuniformscaletransform"); + lib3mf_getscaletransform = mLibrary.getFunction("lib3mf_getscaletransform"); + lib3mf_gettranslationtransform = mLibrary.getFunction("lib3mf_gettranslationtransform"); + lib3mf_base_classtypeid = mLibrary.getFunction("lib3mf_base_classtypeid"); + lib3mf_writer_writetofile = mLibrary.getFunction("lib3mf_writer_writetofile"); + lib3mf_writer_getstreamsize = mLibrary.getFunction("lib3mf_writer_getstreamsize"); + lib3mf_writer_writetobuffer = mLibrary.getFunction("lib3mf_writer_writetobuffer"); + lib3mf_writer_writetocallback = mLibrary.getFunction("lib3mf_writer_writetocallback"); + lib3mf_writer_setprogresscallback = mLibrary.getFunction("lib3mf_writer_setprogresscallback"); + lib3mf_writer_getdecimalprecision = mLibrary.getFunction("lib3mf_writer_getdecimalprecision"); + lib3mf_writer_setdecimalprecision = mLibrary.getFunction("lib3mf_writer_setdecimalprecision"); + lib3mf_writer_setstrictmodeactive = mLibrary.getFunction("lib3mf_writer_setstrictmodeactive"); + lib3mf_writer_getstrictmodeactive = mLibrary.getFunction("lib3mf_writer_getstrictmodeactive"); + lib3mf_writer_getwarning = mLibrary.getFunction("lib3mf_writer_getwarning"); + lib3mf_writer_getwarningcount = mLibrary.getFunction("lib3mf_writer_getwarningcount"); + lib3mf_writer_addkeywrappingcallback = mLibrary.getFunction("lib3mf_writer_addkeywrappingcallback"); + lib3mf_writer_setcontentencryptioncallback = mLibrary.getFunction("lib3mf_writer_setcontentencryptioncallback"); + lib3mf_reader_readfromfile = mLibrary.getFunction("lib3mf_reader_readfromfile"); + lib3mf_reader_readfrombuffer = mLibrary.getFunction("lib3mf_reader_readfrombuffer"); + lib3mf_reader_readfromcallback = mLibrary.getFunction("lib3mf_reader_readfromcallback"); + lib3mf_reader_setprogresscallback = mLibrary.getFunction("lib3mf_reader_setprogresscallback"); + lib3mf_reader_addrelationtoread = mLibrary.getFunction("lib3mf_reader_addrelationtoread"); + lib3mf_reader_removerelationtoread = mLibrary.getFunction("lib3mf_reader_removerelationtoread"); + lib3mf_reader_setstrictmodeactive = mLibrary.getFunction("lib3mf_reader_setstrictmodeactive"); + lib3mf_reader_getstrictmodeactive = mLibrary.getFunction("lib3mf_reader_getstrictmodeactive"); + lib3mf_reader_getwarning = mLibrary.getFunction("lib3mf_reader_getwarning"); + lib3mf_reader_getwarningcount = mLibrary.getFunction("lib3mf_reader_getwarningcount"); + lib3mf_reader_addkeywrappingcallback = mLibrary.getFunction("lib3mf_reader_addkeywrappingcallback"); + lib3mf_reader_setcontentencryptioncallback = mLibrary.getFunction("lib3mf_reader_setcontentencryptioncallback"); + lib3mf_packagepart_getpath = mLibrary.getFunction("lib3mf_packagepart_getpath"); + lib3mf_packagepart_setpath = mLibrary.getFunction("lib3mf_packagepart_setpath"); + lib3mf_resource_getresourceid = mLibrary.getFunction("lib3mf_resource_getresourceid"); + lib3mf_resource_getuniqueresourceid = mLibrary.getFunction("lib3mf_resource_getuniqueresourceid"); + lib3mf_resource_packagepart = mLibrary.getFunction("lib3mf_resource_packagepart"); + lib3mf_resource_setpackagepart = mLibrary.getFunction("lib3mf_resource_setpackagepart"); + lib3mf_resource_getmodelresourceid = mLibrary.getFunction("lib3mf_resource_getmodelresourceid"); + lib3mf_resourceiterator_movenext = mLibrary.getFunction("lib3mf_resourceiterator_movenext"); + lib3mf_resourceiterator_moveprevious = mLibrary.getFunction("lib3mf_resourceiterator_moveprevious"); + lib3mf_resourceiterator_getcurrent = mLibrary.getFunction("lib3mf_resourceiterator_getcurrent"); + lib3mf_resourceiterator_clone = mLibrary.getFunction("lib3mf_resourceiterator_clone"); + lib3mf_resourceiterator_count = mLibrary.getFunction("lib3mf_resourceiterator_count"); + lib3mf_slicestackiterator_getcurrentslicestack = mLibrary.getFunction("lib3mf_slicestackiterator_getcurrentslicestack"); + lib3mf_objectiterator_getcurrentobject = mLibrary.getFunction("lib3mf_objectiterator_getcurrentobject"); + lib3mf_meshobjectiterator_getcurrentmeshobject = mLibrary.getFunction("lib3mf_meshobjectiterator_getcurrentmeshobject"); + lib3mf_componentsobjectiterator_getcurrentcomponentsobject = mLibrary.getFunction("lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); + lib3mf_booleanobjectiterator_getcurrentbooleanobject = mLibrary.getFunction("lib3mf_booleanobjectiterator_getcurrentbooleanobject"); + lib3mf_texture2diterator_getcurrenttexture2d = mLibrary.getFunction("lib3mf_texture2diterator_getcurrenttexture2d"); + lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup = mLibrary.getFunction("lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); + lib3mf_colorgroupiterator_getcurrentcolorgroup = mLibrary.getFunction("lib3mf_colorgroupiterator_getcurrentcolorgroup"); + lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup = mLibrary.getFunction("lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + lib3mf_compositematerialsiterator_getcurrentcompositematerials = mLibrary.getFunction("lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup = mLibrary.getFunction("lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + lib3mf_image3diterator_getcurrentimage3d = mLibrary.getFunction("lib3mf_image3diterator_getcurrentimage3d"); + lib3mf_functioniterator_getcurrentfunction = mLibrary.getFunction("lib3mf_functioniterator_getcurrentfunction"); + lib3mf_levelsetiterator_getcurrentlevelset = mLibrary.getFunction("lib3mf_levelsetiterator_getcurrentlevelset"); + lib3mf_metadata_getnamespace = mLibrary.getFunction("lib3mf_metadata_getnamespace"); + lib3mf_metadata_setnamespace = mLibrary.getFunction("lib3mf_metadata_setnamespace"); + lib3mf_metadata_getname = mLibrary.getFunction("lib3mf_metadata_getname"); + lib3mf_metadata_setname = mLibrary.getFunction("lib3mf_metadata_setname"); + lib3mf_metadata_getkey = mLibrary.getFunction("lib3mf_metadata_getkey"); + lib3mf_metadata_getmustpreserve = mLibrary.getFunction("lib3mf_metadata_getmustpreserve"); + lib3mf_metadata_setmustpreserve = mLibrary.getFunction("lib3mf_metadata_setmustpreserve"); + lib3mf_metadata_gettype = mLibrary.getFunction("lib3mf_metadata_gettype"); + lib3mf_metadata_settype = mLibrary.getFunction("lib3mf_metadata_settype"); + lib3mf_metadata_getvalue = mLibrary.getFunction("lib3mf_metadata_getvalue"); + lib3mf_metadata_setvalue = mLibrary.getFunction("lib3mf_metadata_setvalue"); + lib3mf_metadatagroup_getmetadatacount = mLibrary.getFunction("lib3mf_metadatagroup_getmetadatacount"); + lib3mf_metadatagroup_getmetadata = mLibrary.getFunction("lib3mf_metadatagroup_getmetadata"); + lib3mf_metadatagroup_getmetadatabykey = mLibrary.getFunction("lib3mf_metadatagroup_getmetadatabykey"); + lib3mf_metadatagroup_removemetadatabyindex = mLibrary.getFunction("lib3mf_metadatagroup_removemetadatabyindex"); + lib3mf_metadatagroup_removemetadata = mLibrary.getFunction("lib3mf_metadatagroup_removemetadata"); + lib3mf_metadatagroup_addmetadata = mLibrary.getFunction("lib3mf_metadatagroup_addmetadata"); + lib3mf_triangleset_setname = mLibrary.getFunction("lib3mf_triangleset_setname"); + lib3mf_triangleset_getname = mLibrary.getFunction("lib3mf_triangleset_getname"); + lib3mf_triangleset_setidentifier = mLibrary.getFunction("lib3mf_triangleset_setidentifier"); + lib3mf_triangleset_getidentifier = mLibrary.getFunction("lib3mf_triangleset_getidentifier"); + lib3mf_triangleset_addtriangle = mLibrary.getFunction("lib3mf_triangleset_addtriangle"); + lib3mf_triangleset_removetriangle = mLibrary.getFunction("lib3mf_triangleset_removetriangle"); + lib3mf_triangleset_clear = mLibrary.getFunction("lib3mf_triangleset_clear"); + lib3mf_triangleset_settrianglelist = mLibrary.getFunction("lib3mf_triangleset_settrianglelist"); + lib3mf_triangleset_gettrianglelist = mLibrary.getFunction("lib3mf_triangleset_gettrianglelist"); + lib3mf_triangleset_addtrianglelist = mLibrary.getFunction("lib3mf_triangleset_addtrianglelist"); + lib3mf_triangleset_merge = mLibrary.getFunction("lib3mf_triangleset_merge"); + lib3mf_triangleset_deleteset = mLibrary.getFunction("lib3mf_triangleset_deleteset"); + lib3mf_triangleset_duplicate = mLibrary.getFunction("lib3mf_triangleset_duplicate"); + lib3mf_object_gettype = mLibrary.getFunction("lib3mf_object_gettype"); + lib3mf_object_settype = mLibrary.getFunction("lib3mf_object_settype"); + lib3mf_object_getname = mLibrary.getFunction("lib3mf_object_getname"); + lib3mf_object_setname = mLibrary.getFunction("lib3mf_object_setname"); + lib3mf_object_getpartnumber = mLibrary.getFunction("lib3mf_object_getpartnumber"); + lib3mf_object_setpartnumber = mLibrary.getFunction("lib3mf_object_setpartnumber"); + lib3mf_object_ismeshobject = mLibrary.getFunction("lib3mf_object_ismeshobject"); + lib3mf_object_iscomponentsobject = mLibrary.getFunction("lib3mf_object_iscomponentsobject"); + lib3mf_object_islevelsetobject = mLibrary.getFunction("lib3mf_object_islevelsetobject"); + lib3mf_object_isbooleanobject = mLibrary.getFunction("lib3mf_object_isbooleanobject"); + lib3mf_object_isvalid = mLibrary.getFunction("lib3mf_object_isvalid"); + lib3mf_object_setattachmentasthumbnail = mLibrary.getFunction("lib3mf_object_setattachmentasthumbnail"); + lib3mf_object_getthumbnailattachment = mLibrary.getFunction("lib3mf_object_getthumbnailattachment"); + lib3mf_object_clearthumbnailattachment = mLibrary.getFunction("lib3mf_object_clearthumbnailattachment"); + lib3mf_object_getoutbox = mLibrary.getFunction("lib3mf_object_getoutbox"); + lib3mf_object_getuuid = mLibrary.getFunction("lib3mf_object_getuuid"); + lib3mf_object_setuuid = mLibrary.getFunction("lib3mf_object_setuuid"); + lib3mf_object_getmetadatagroup = mLibrary.getFunction("lib3mf_object_getmetadatagroup"); + lib3mf_object_setslicesmeshresolution = mLibrary.getFunction("lib3mf_object_setslicesmeshresolution"); + lib3mf_object_getslicesmeshresolution = mLibrary.getFunction("lib3mf_object_getslicesmeshresolution"); + lib3mf_object_hasslices = mLibrary.getFunction("lib3mf_object_hasslices"); + lib3mf_object_clearslicestack = mLibrary.getFunction("lib3mf_object_clearslicestack"); + lib3mf_object_getslicestack = mLibrary.getFunction("lib3mf_object_getslicestack"); + lib3mf_object_assignslicestack = mLibrary.getFunction("lib3mf_object_assignslicestack"); + lib3mf_meshobject_getvertexcount = mLibrary.getFunction("lib3mf_meshobject_getvertexcount"); + lib3mf_meshobject_gettrianglecount = mLibrary.getFunction("lib3mf_meshobject_gettrianglecount"); + lib3mf_meshobject_getvertex = mLibrary.getFunction("lib3mf_meshobject_getvertex"); + lib3mf_meshobject_setvertex = mLibrary.getFunction("lib3mf_meshobject_setvertex"); + lib3mf_meshobject_addvertex = mLibrary.getFunction("lib3mf_meshobject_addvertex"); + lib3mf_meshobject_getvertices = mLibrary.getFunction("lib3mf_meshobject_getvertices"); + lib3mf_meshobject_gettriangle = mLibrary.getFunction("lib3mf_meshobject_gettriangle"); + lib3mf_meshobject_settriangle = mLibrary.getFunction("lib3mf_meshobject_settriangle"); + lib3mf_meshobject_addtriangle = mLibrary.getFunction("lib3mf_meshobject_addtriangle"); + lib3mf_meshobject_gettriangleindices = mLibrary.getFunction("lib3mf_meshobject_gettriangleindices"); + lib3mf_meshobject_setobjectlevelproperty = mLibrary.getFunction("lib3mf_meshobject_setobjectlevelproperty"); + lib3mf_meshobject_getobjectlevelproperty = mLibrary.getFunction("lib3mf_meshobject_getobjectlevelproperty"); + lib3mf_meshobject_settriangleproperties = mLibrary.getFunction("lib3mf_meshobject_settriangleproperties"); + lib3mf_meshobject_gettriangleproperties = mLibrary.getFunction("lib3mf_meshobject_gettriangleproperties"); + lib3mf_meshobject_setalltriangleproperties = mLibrary.getFunction("lib3mf_meshobject_setalltriangleproperties"); + lib3mf_meshobject_getalltriangleproperties = mLibrary.getFunction("lib3mf_meshobject_getalltriangleproperties"); + lib3mf_meshobject_clearallproperties = mLibrary.getFunction("lib3mf_meshobject_clearallproperties"); + lib3mf_meshobject_setgeometry = mLibrary.getFunction("lib3mf_meshobject_setgeometry"); + lib3mf_meshobject_ismanifoldandoriented = mLibrary.getFunction("lib3mf_meshobject_ismanifoldandoriented"); + lib3mf_meshobject_beamlattice = mLibrary.getFunction("lib3mf_meshobject_beamlattice"); + lib3mf_meshobject_getvolumedata = mLibrary.getFunction("lib3mf_meshobject_getvolumedata"); + lib3mf_meshobject_setvolumedata = mLibrary.getFunction("lib3mf_meshobject_setvolumedata"); + lib3mf_meshobject_addtriangleset = mLibrary.getFunction("lib3mf_meshobject_addtriangleset"); + lib3mf_meshobject_hastriangleset = mLibrary.getFunction("lib3mf_meshobject_hastriangleset"); + lib3mf_meshobject_findtriangleset = mLibrary.getFunction("lib3mf_meshobject_findtriangleset"); + lib3mf_meshobject_gettrianglesetcount = mLibrary.getFunction("lib3mf_meshobject_gettrianglesetcount"); + lib3mf_meshobject_gettriangleset = mLibrary.getFunction("lib3mf_meshobject_gettriangleset"); + lib3mf_levelset_getfunction = mLibrary.getFunction("lib3mf_levelset_getfunction"); + lib3mf_levelset_setfunction = mLibrary.getFunction("lib3mf_levelset_setfunction"); + lib3mf_levelset_gettransform = mLibrary.getFunction("lib3mf_levelset_gettransform"); + lib3mf_levelset_settransform = mLibrary.getFunction("lib3mf_levelset_settransform"); + lib3mf_levelset_getchannelname = mLibrary.getFunction("lib3mf_levelset_getchannelname"); + lib3mf_levelset_setchannelname = mLibrary.getFunction("lib3mf_levelset_setchannelname"); + lib3mf_levelset_setminfeaturesize = mLibrary.getFunction("lib3mf_levelset_setminfeaturesize"); + lib3mf_levelset_getminfeaturesize = mLibrary.getFunction("lib3mf_levelset_getminfeaturesize"); + lib3mf_levelset_setfallbackvalue = mLibrary.getFunction("lib3mf_levelset_setfallbackvalue"); + lib3mf_levelset_getfallbackvalue = mLibrary.getFunction("lib3mf_levelset_getfallbackvalue"); + lib3mf_levelset_setmeshbboxonly = mLibrary.getFunction("lib3mf_levelset_setmeshbboxonly"); + lib3mf_levelset_getmeshbboxonly = mLibrary.getFunction("lib3mf_levelset_getmeshbboxonly"); + lib3mf_levelset_setmesh = mLibrary.getFunction("lib3mf_levelset_setmesh"); + lib3mf_levelset_getmesh = mLibrary.getFunction("lib3mf_levelset_getmesh"); + lib3mf_levelset_getvolumedata = mLibrary.getFunction("lib3mf_levelset_getvolumedata"); + lib3mf_levelset_setvolumedata = mLibrary.getFunction("lib3mf_levelset_setvolumedata"); + lib3mf_booleanobject_setbaseobject = mLibrary.getFunction("lib3mf_booleanobject_setbaseobject"); + lib3mf_booleanobject_getbaseobject = mLibrary.getFunction("lib3mf_booleanobject_getbaseobject"); + lib3mf_booleanobject_setbasetransform = mLibrary.getFunction("lib3mf_booleanobject_setbasetransform"); + lib3mf_booleanobject_getbasetransform = mLibrary.getFunction("lib3mf_booleanobject_getbasetransform"); + lib3mf_booleanobject_setoperation = mLibrary.getFunction("lib3mf_booleanobject_setoperation"); + lib3mf_booleanobject_getoperation = mLibrary.getFunction("lib3mf_booleanobject_getoperation"); + lib3mf_booleanobject_setcsgmodeenabled = mLibrary.getFunction("lib3mf_booleanobject_setcsgmodeenabled"); + lib3mf_booleanobject_getcsgmodeenabled = mLibrary.getFunction("lib3mf_booleanobject_getcsgmodeenabled"); + lib3mf_booleanobject_setextractiongridresolution = mLibrary.getFunction("lib3mf_booleanobject_setextractiongridresolution"); + lib3mf_booleanobject_getextractiongridresolution = mLibrary.getFunction("lib3mf_booleanobject_getextractiongridresolution"); + lib3mf_booleanobject_getoperandcount = mLibrary.getFunction("lib3mf_booleanobject_getoperandcount"); + lib3mf_booleanobject_addoperand = mLibrary.getFunction("lib3mf_booleanobject_addoperand"); + lib3mf_booleanobject_getoperand = mLibrary.getFunction("lib3mf_booleanobject_getoperand"); + lib3mf_booleanobject_mergetomeshobject = mLibrary.getFunction("lib3mf_booleanobject_mergetomeshobject"); + lib3mf_beamlattice_getminlength = mLibrary.getFunction("lib3mf_beamlattice_getminlength"); + lib3mf_beamlattice_setminlength = mLibrary.getFunction("lib3mf_beamlattice_setminlength"); + lib3mf_beamlattice_getclipping = mLibrary.getFunction("lib3mf_beamlattice_getclipping"); + lib3mf_beamlattice_setclipping = mLibrary.getFunction("lib3mf_beamlattice_setclipping"); + lib3mf_beamlattice_getrepresentation = mLibrary.getFunction("lib3mf_beamlattice_getrepresentation"); + lib3mf_beamlattice_setrepresentation = mLibrary.getFunction("lib3mf_beamlattice_setrepresentation"); + lib3mf_beamlattice_getballoptions = mLibrary.getFunction("lib3mf_beamlattice_getballoptions"); + lib3mf_beamlattice_setballoptions = mLibrary.getFunction("lib3mf_beamlattice_setballoptions"); + lib3mf_beamlattice_getbeamcount = mLibrary.getFunction("lib3mf_beamlattice_getbeamcount"); + lib3mf_beamlattice_getbeam = mLibrary.getFunction("lib3mf_beamlattice_getbeam"); + lib3mf_beamlattice_addbeam = mLibrary.getFunction("lib3mf_beamlattice_addbeam"); + lib3mf_beamlattice_setbeam = mLibrary.getFunction("lib3mf_beamlattice_setbeam"); + lib3mf_beamlattice_setbeams = mLibrary.getFunction("lib3mf_beamlattice_setbeams"); + lib3mf_beamlattice_getbeams = mLibrary.getFunction("lib3mf_beamlattice_getbeams"); + lib3mf_beamlattice_getballcount = mLibrary.getFunction("lib3mf_beamlattice_getballcount"); + lib3mf_beamlattice_getball = mLibrary.getFunction("lib3mf_beamlattice_getball"); + lib3mf_beamlattice_addball = mLibrary.getFunction("lib3mf_beamlattice_addball"); + lib3mf_beamlattice_setball = mLibrary.getFunction("lib3mf_beamlattice_setball"); + lib3mf_beamlattice_setballs = mLibrary.getFunction("lib3mf_beamlattice_setballs"); + lib3mf_beamlattice_getballs = mLibrary.getFunction("lib3mf_beamlattice_getballs"); + lib3mf_beamlattice_getbeamsetcount = mLibrary.getFunction("lib3mf_beamlattice_getbeamsetcount"); + lib3mf_beamlattice_addbeamset = mLibrary.getFunction("lib3mf_beamlattice_addbeamset"); + lib3mf_beamlattice_getbeamset = mLibrary.getFunction("lib3mf_beamlattice_getbeamset"); + lib3mf_functionreference_getfunctionresourceid = mLibrary.getFunction("lib3mf_functionreference_getfunctionresourceid"); + lib3mf_functionreference_setfunctionresourceid = mLibrary.getFunction("lib3mf_functionreference_setfunctionresourceid"); + lib3mf_functionreference_gettransform = mLibrary.getFunction("lib3mf_functionreference_gettransform"); + lib3mf_functionreference_settransform = mLibrary.getFunction("lib3mf_functionreference_settransform"); + lib3mf_functionreference_getchannelname = mLibrary.getFunction("lib3mf_functionreference_getchannelname"); + lib3mf_functionreference_setchannelname = mLibrary.getFunction("lib3mf_functionreference_setchannelname"); + lib3mf_functionreference_setminfeaturesize = mLibrary.getFunction("lib3mf_functionreference_setminfeaturesize"); + lib3mf_functionreference_getminfeaturesize = mLibrary.getFunction("lib3mf_functionreference_getminfeaturesize"); + lib3mf_functionreference_setfallbackvalue = mLibrary.getFunction("lib3mf_functionreference_setfallbackvalue"); + lib3mf_functionreference_getfallbackvalue = mLibrary.getFunction("lib3mf_functionreference_getfallbackvalue"); + lib3mf_volumedatacomposite_getbasematerialgroup = mLibrary.getFunction("lib3mf_volumedatacomposite_getbasematerialgroup"); + lib3mf_volumedatacomposite_setbasematerialgroup = mLibrary.getFunction("lib3mf_volumedatacomposite_setbasematerialgroup"); + lib3mf_volumedatacomposite_getmaterialmappingcount = mLibrary.getFunction("lib3mf_volumedatacomposite_getmaterialmappingcount"); + lib3mf_volumedatacomposite_getmaterialmapping = mLibrary.getFunction("lib3mf_volumedatacomposite_getmaterialmapping"); + lib3mf_volumedatacomposite_addmaterialmapping = mLibrary.getFunction("lib3mf_volumedatacomposite_addmaterialmapping"); + lib3mf_volumedatacomposite_removematerialmapping = mLibrary.getFunction("lib3mf_volumedatacomposite_removematerialmapping"); + lib3mf_volumedataproperty_getname = mLibrary.getFunction("lib3mf_volumedataproperty_getname"); + lib3mf_volumedataproperty_setisrequired = mLibrary.getFunction("lib3mf_volumedataproperty_setisrequired"); + lib3mf_volumedataproperty_isrequired = mLibrary.getFunction("lib3mf_volumedataproperty_isrequired"); + lib3mf_volumedata_getcomposite = mLibrary.getFunction("lib3mf_volumedata_getcomposite"); + lib3mf_volumedata_createnewcomposite = mLibrary.getFunction("lib3mf_volumedata_createnewcomposite"); + lib3mf_volumedata_removecomposite = mLibrary.getFunction("lib3mf_volumedata_removecomposite"); + lib3mf_volumedata_getcolor = mLibrary.getFunction("lib3mf_volumedata_getcolor"); + lib3mf_volumedata_createnewcolor = mLibrary.getFunction("lib3mf_volumedata_createnewcolor"); + lib3mf_volumedata_removecolor = mLibrary.getFunction("lib3mf_volumedata_removecolor"); + lib3mf_volumedata_getpropertycount = mLibrary.getFunction("lib3mf_volumedata_getpropertycount"); + lib3mf_volumedata_getproperty = mLibrary.getFunction("lib3mf_volumedata_getproperty"); + lib3mf_volumedata_addpropertyfromfunction = mLibrary.getFunction("lib3mf_volumedata_addpropertyfromfunction"); + lib3mf_volumedata_removeproperty = mLibrary.getFunction("lib3mf_volumedata_removeproperty"); + lib3mf_component_getobjectresource = mLibrary.getFunction("lib3mf_component_getobjectresource"); + lib3mf_component_getobjectresourceid = mLibrary.getFunction("lib3mf_component_getobjectresourceid"); + lib3mf_component_getuuid = mLibrary.getFunction("lib3mf_component_getuuid"); + lib3mf_component_setuuid = mLibrary.getFunction("lib3mf_component_setuuid"); + lib3mf_component_hastransform = mLibrary.getFunction("lib3mf_component_hastransform"); + lib3mf_component_gettransform = mLibrary.getFunction("lib3mf_component_gettransform"); + lib3mf_component_settransform = mLibrary.getFunction("lib3mf_component_settransform"); + lib3mf_componentsobject_addcomponent = mLibrary.getFunction("lib3mf_componentsobject_addcomponent"); + lib3mf_componentsobject_getcomponent = mLibrary.getFunction("lib3mf_componentsobject_getcomponent"); + lib3mf_componentsobject_getcomponentcount = mLibrary.getFunction("lib3mf_componentsobject_getcomponentcount"); + lib3mf_beamset_setname = mLibrary.getFunction("lib3mf_beamset_setname"); + lib3mf_beamset_getname = mLibrary.getFunction("lib3mf_beamset_getname"); + lib3mf_beamset_setidentifier = mLibrary.getFunction("lib3mf_beamset_setidentifier"); + lib3mf_beamset_getidentifier = mLibrary.getFunction("lib3mf_beamset_getidentifier"); + lib3mf_beamset_getreferencecount = mLibrary.getFunction("lib3mf_beamset_getreferencecount"); + lib3mf_beamset_setreferences = mLibrary.getFunction("lib3mf_beamset_setreferences"); + lib3mf_beamset_getreferences = mLibrary.getFunction("lib3mf_beamset_getreferences"); + lib3mf_beamset_getballreferencecount = mLibrary.getFunction("lib3mf_beamset_getballreferencecount"); + lib3mf_beamset_setballreferences = mLibrary.getFunction("lib3mf_beamset_setballreferences"); + lib3mf_beamset_getballreferences = mLibrary.getFunction("lib3mf_beamset_getballreferences"); + lib3mf_basematerialgroup_getcount = mLibrary.getFunction("lib3mf_basematerialgroup_getcount"); + lib3mf_basematerialgroup_getallpropertyids = mLibrary.getFunction("lib3mf_basematerialgroup_getallpropertyids"); + lib3mf_basematerialgroup_addmaterial = mLibrary.getFunction("lib3mf_basematerialgroup_addmaterial"); + lib3mf_basematerialgroup_removematerial = mLibrary.getFunction("lib3mf_basematerialgroup_removematerial"); + lib3mf_basematerialgroup_getname = mLibrary.getFunction("lib3mf_basematerialgroup_getname"); + lib3mf_basematerialgroup_setname = mLibrary.getFunction("lib3mf_basematerialgroup_setname"); + lib3mf_basematerialgroup_setdisplaycolor = mLibrary.getFunction("lib3mf_basematerialgroup_setdisplaycolor"); + lib3mf_basematerialgroup_getdisplaycolor = mLibrary.getFunction("lib3mf_basematerialgroup_getdisplaycolor"); + lib3mf_colorgroup_getcount = mLibrary.getFunction("lib3mf_colorgroup_getcount"); + lib3mf_colorgroup_getallpropertyids = mLibrary.getFunction("lib3mf_colorgroup_getallpropertyids"); + lib3mf_colorgroup_addcolor = mLibrary.getFunction("lib3mf_colorgroup_addcolor"); + lib3mf_colorgroup_removecolor = mLibrary.getFunction("lib3mf_colorgroup_removecolor"); + lib3mf_colorgroup_setcolor = mLibrary.getFunction("lib3mf_colorgroup_setcolor"); + lib3mf_colorgroup_getcolor = mLibrary.getFunction("lib3mf_colorgroup_getcolor"); + lib3mf_texture2dgroup_getcount = mLibrary.getFunction("lib3mf_texture2dgroup_getcount"); + lib3mf_texture2dgroup_getallpropertyids = mLibrary.getFunction("lib3mf_texture2dgroup_getallpropertyids"); + lib3mf_texture2dgroup_addtex2coord = mLibrary.getFunction("lib3mf_texture2dgroup_addtex2coord"); + lib3mf_texture2dgroup_gettex2coord = mLibrary.getFunction("lib3mf_texture2dgroup_gettex2coord"); + lib3mf_texture2dgroup_removetex2coord = mLibrary.getFunction("lib3mf_texture2dgroup_removetex2coord"); + lib3mf_texture2dgroup_gettexture2d = mLibrary.getFunction("lib3mf_texture2dgroup_gettexture2d"); + lib3mf_compositematerials_getcount = mLibrary.getFunction("lib3mf_compositematerials_getcount"); + lib3mf_compositematerials_getallpropertyids = mLibrary.getFunction("lib3mf_compositematerials_getallpropertyids"); + lib3mf_compositematerials_getbasematerialgroup = mLibrary.getFunction("lib3mf_compositematerials_getbasematerialgroup"); + lib3mf_compositematerials_addcomposite = mLibrary.getFunction("lib3mf_compositematerials_addcomposite"); + lib3mf_compositematerials_removecomposite = mLibrary.getFunction("lib3mf_compositematerials_removecomposite"); + lib3mf_compositematerials_getcomposite = mLibrary.getFunction("lib3mf_compositematerials_getcomposite"); + lib3mf_multipropertygroup_getcount = mLibrary.getFunction("lib3mf_multipropertygroup_getcount"); + lib3mf_multipropertygroup_getallpropertyids = mLibrary.getFunction("lib3mf_multipropertygroup_getallpropertyids"); + lib3mf_multipropertygroup_addmultiproperty = mLibrary.getFunction("lib3mf_multipropertygroup_addmultiproperty"); + lib3mf_multipropertygroup_setmultiproperty = mLibrary.getFunction("lib3mf_multipropertygroup_setmultiproperty"); + lib3mf_multipropertygroup_getmultiproperty = mLibrary.getFunction("lib3mf_multipropertygroup_getmultiproperty"); + lib3mf_multipropertygroup_removemultiproperty = mLibrary.getFunction("lib3mf_multipropertygroup_removemultiproperty"); + lib3mf_multipropertygroup_getlayercount = mLibrary.getFunction("lib3mf_multipropertygroup_getlayercount"); + lib3mf_multipropertygroup_addlayer = mLibrary.getFunction("lib3mf_multipropertygroup_addlayer"); + lib3mf_multipropertygroup_getlayer = mLibrary.getFunction("lib3mf_multipropertygroup_getlayer"); + lib3mf_multipropertygroup_removelayer = mLibrary.getFunction("lib3mf_multipropertygroup_removelayer"); + lib3mf_image3d_getname = mLibrary.getFunction("lib3mf_image3d_getname"); + lib3mf_image3d_setname = mLibrary.getFunction("lib3mf_image3d_setname"); + lib3mf_image3d_isimagestack = mLibrary.getFunction("lib3mf_image3d_isimagestack"); + lib3mf_imagestack_getrowcount = mLibrary.getFunction("lib3mf_imagestack_getrowcount"); + lib3mf_imagestack_setrowcount = mLibrary.getFunction("lib3mf_imagestack_setrowcount"); + lib3mf_imagestack_getcolumncount = mLibrary.getFunction("lib3mf_imagestack_getcolumncount"); + lib3mf_imagestack_setcolumncount = mLibrary.getFunction("lib3mf_imagestack_setcolumncount"); + lib3mf_imagestack_getsheetcount = mLibrary.getFunction("lib3mf_imagestack_getsheetcount"); + lib3mf_imagestack_getsheet = mLibrary.getFunction("lib3mf_imagestack_getsheet"); + lib3mf_imagestack_setsheet = mLibrary.getFunction("lib3mf_imagestack_setsheet"); + lib3mf_imagestack_createemptysheet = mLibrary.getFunction("lib3mf_imagestack_createemptysheet"); + lib3mf_imagestack_createsheetfrombuffer = mLibrary.getFunction("lib3mf_imagestack_createsheetfrombuffer"); + lib3mf_imagestack_createsheetfromfile = mLibrary.getFunction("lib3mf_imagestack_createsheetfromfile"); + lib3mf_attachment_getpath = mLibrary.getFunction("lib3mf_attachment_getpath"); + lib3mf_attachment_setpath = mLibrary.getFunction("lib3mf_attachment_setpath"); + lib3mf_attachment_packagepart = mLibrary.getFunction("lib3mf_attachment_packagepart"); + lib3mf_attachment_getrelationshiptype = mLibrary.getFunction("lib3mf_attachment_getrelationshiptype"); + lib3mf_attachment_setrelationshiptype = mLibrary.getFunction("lib3mf_attachment_setrelationshiptype"); + lib3mf_attachment_writetofile = mLibrary.getFunction("lib3mf_attachment_writetofile"); + lib3mf_attachment_readfromfile = mLibrary.getFunction("lib3mf_attachment_readfromfile"); + lib3mf_attachment_readfromcallback = mLibrary.getFunction("lib3mf_attachment_readfromcallback"); + lib3mf_attachment_getstreamsize = mLibrary.getFunction("lib3mf_attachment_getstreamsize"); + lib3mf_attachment_writetobuffer = mLibrary.getFunction("lib3mf_attachment_writetobuffer"); + lib3mf_attachment_readfrombuffer = mLibrary.getFunction("lib3mf_attachment_readfrombuffer"); + lib3mf_texture2d_getattachment = mLibrary.getFunction("lib3mf_texture2d_getattachment"); + lib3mf_texture2d_setattachment = mLibrary.getFunction("lib3mf_texture2d_setattachment"); + lib3mf_texture2d_getcontenttype = mLibrary.getFunction("lib3mf_texture2d_getcontenttype"); + lib3mf_texture2d_setcontenttype = mLibrary.getFunction("lib3mf_texture2d_setcontenttype"); + lib3mf_texture2d_gettilestyleuv = mLibrary.getFunction("lib3mf_texture2d_gettilestyleuv"); + lib3mf_texture2d_settilestyleuv = mLibrary.getFunction("lib3mf_texture2d_settilestyleuv"); + lib3mf_texture2d_getfilter = mLibrary.getFunction("lib3mf_texture2d_getfilter"); + lib3mf_texture2d_setfilter = mLibrary.getFunction("lib3mf_texture2d_setfilter"); + lib3mf_implicitport_getidentifier = mLibrary.getFunction("lib3mf_implicitport_getidentifier"); + lib3mf_implicitport_setidentifier = mLibrary.getFunction("lib3mf_implicitport_setidentifier"); + lib3mf_implicitport_getdisplayname = mLibrary.getFunction("lib3mf_implicitport_getdisplayname"); + lib3mf_implicitport_setdisplayname = mLibrary.getFunction("lib3mf_implicitport_setdisplayname"); + lib3mf_implicitport_settype = mLibrary.getFunction("lib3mf_implicitport_settype"); + lib3mf_implicitport_gettype = mLibrary.getFunction("lib3mf_implicitport_gettype"); + lib3mf_implicitport_getreference = mLibrary.getFunction("lib3mf_implicitport_getreference"); + lib3mf_implicitport_setreference = mLibrary.getFunction("lib3mf_implicitport_setreference"); + lib3mf_iterator_movenext = mLibrary.getFunction("lib3mf_iterator_movenext"); + lib3mf_iterator_moveprevious = mLibrary.getFunction("lib3mf_iterator_moveprevious"); + lib3mf_iterator_count = mLibrary.getFunction("lib3mf_iterator_count"); + lib3mf_implicitportiterator_getcurrent = mLibrary.getFunction("lib3mf_implicitportiterator_getcurrent"); + lib3mf_implicitnode_getidentifier = mLibrary.getFunction("lib3mf_implicitnode_getidentifier"); + lib3mf_implicitnode_setidentifier = mLibrary.getFunction("lib3mf_implicitnode_setidentifier"); + lib3mf_implicitnode_getdisplayname = mLibrary.getFunction("lib3mf_implicitnode_getdisplayname"); + lib3mf_implicitnode_setdisplayname = mLibrary.getFunction("lib3mf_implicitnode_setdisplayname"); + lib3mf_implicitnode_gettag = mLibrary.getFunction("lib3mf_implicitnode_gettag"); + lib3mf_implicitnode_settag = mLibrary.getFunction("lib3mf_implicitnode_settag"); + lib3mf_implicitnode_getnodetype = mLibrary.getFunction("lib3mf_implicitnode_getnodetype"); + lib3mf_implicitnode_addinput = mLibrary.getFunction("lib3mf_implicitnode_addinput"); + lib3mf_implicitnode_getinputs = mLibrary.getFunction("lib3mf_implicitnode_getinputs"); + lib3mf_implicitnode_addoutput = mLibrary.getFunction("lib3mf_implicitnode_addoutput"); + lib3mf_implicitnode_getoutputs = mLibrary.getFunction("lib3mf_implicitnode_getoutputs"); + lib3mf_implicitnode_findinput = mLibrary.getFunction("lib3mf_implicitnode_findinput"); + lib3mf_implicitnode_findoutput = mLibrary.getFunction("lib3mf_implicitnode_findoutput"); + lib3mf_implicitnode_aretypesvalid = mLibrary.getFunction("lib3mf_implicitnode_aretypesvalid"); + lib3mf_oneinputnode_getinputa = mLibrary.getFunction("lib3mf_oneinputnode_getinputa"); + lib3mf_oneinputnode_getoutputresult = mLibrary.getFunction("lib3mf_oneinputnode_getoutputresult"); + lib3mf_resourceidnode_setresource = mLibrary.getFunction("lib3mf_resourceidnode_setresource"); + lib3mf_resourceidnode_getresource = mLibrary.getFunction("lib3mf_resourceidnode_getresource"); + lib3mf_resourceidnode_getoutputvalue = mLibrary.getFunction("lib3mf_resourceidnode_getoutputvalue"); + lib3mf_twoinputnode_getinputb = mLibrary.getFunction("lib3mf_twoinputnode_getinputb"); + lib3mf_selectnode_getinputb = mLibrary.getFunction("lib3mf_selectnode_getinputb"); + lib3mf_selectnode_getinputc = mLibrary.getFunction("lib3mf_selectnode_getinputc"); + lib3mf_selectnode_getinputd = mLibrary.getFunction("lib3mf_selectnode_getinputd"); + lib3mf_clampnode_getinputmin = mLibrary.getFunction("lib3mf_clampnode_getinputmin"); + lib3mf_clampnode_getinputmax = mLibrary.getFunction("lib3mf_clampnode_getinputmax"); + lib3mf_composevectornode_getinputx = mLibrary.getFunction("lib3mf_composevectornode_getinputx"); + lib3mf_composevectornode_getinputy = mLibrary.getFunction("lib3mf_composevectornode_getinputy"); + lib3mf_composevectornode_getinputz = mLibrary.getFunction("lib3mf_composevectornode_getinputz"); + lib3mf_composevectornode_getoutputresult = mLibrary.getFunction("lib3mf_composevectornode_getoutputresult"); + lib3mf_decomposevectornode_getinputa = mLibrary.getFunction("lib3mf_decomposevectornode_getinputa"); + lib3mf_decomposevectornode_getoutputx = mLibrary.getFunction("lib3mf_decomposevectornode_getoutputx"); + lib3mf_decomposevectornode_getoutputy = mLibrary.getFunction("lib3mf_decomposevectornode_getoutputy"); + lib3mf_decomposevectornode_getoutputz = mLibrary.getFunction("lib3mf_decomposevectornode_getoutputz"); + lib3mf_composematrixnode_getinputm00 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm00"); + lib3mf_composematrixnode_getinputm01 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm01"); + lib3mf_composematrixnode_getinputm02 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm02"); + lib3mf_composematrixnode_getinputm03 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm03"); + lib3mf_composematrixnode_getinputm10 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm10"); + lib3mf_composematrixnode_getinputm11 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm11"); + lib3mf_composematrixnode_getinputm12 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm12"); + lib3mf_composematrixnode_getinputm13 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm13"); + lib3mf_composematrixnode_getinputm20 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm20"); + lib3mf_composematrixnode_getinputm21 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm21"); + lib3mf_composematrixnode_getinputm22 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm22"); + lib3mf_composematrixnode_getinputm23 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm23"); + lib3mf_composematrixnode_getinputm30 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm30"); + lib3mf_composematrixnode_getinputm31 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm31"); + lib3mf_composematrixnode_getinputm32 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm32"); + lib3mf_composematrixnode_getinputm33 = mLibrary.getFunction("lib3mf_composematrixnode_getinputm33"); + lib3mf_composematrixnode_getoutputresult = mLibrary.getFunction("lib3mf_composematrixnode_getoutputresult"); + lib3mf_matrixfromrowsnode_getinputa = mLibrary.getFunction("lib3mf_matrixfromrowsnode_getinputa"); + lib3mf_matrixfromrowsnode_getinputb = mLibrary.getFunction("lib3mf_matrixfromrowsnode_getinputb"); + lib3mf_matrixfromrowsnode_getinputc = mLibrary.getFunction("lib3mf_matrixfromrowsnode_getinputc"); + lib3mf_matrixfromrowsnode_getinputd = mLibrary.getFunction("lib3mf_matrixfromrowsnode_getinputd"); + lib3mf_matrixfromrowsnode_getoutputresult = mLibrary.getFunction("lib3mf_matrixfromrowsnode_getoutputresult"); + lib3mf_matrixfromcolumnsnode_getinputa = mLibrary.getFunction("lib3mf_matrixfromcolumnsnode_getinputa"); + lib3mf_matrixfromcolumnsnode_getinputb = mLibrary.getFunction("lib3mf_matrixfromcolumnsnode_getinputb"); + lib3mf_matrixfromcolumnsnode_getinputc = mLibrary.getFunction("lib3mf_matrixfromcolumnsnode_getinputc"); + lib3mf_matrixfromcolumnsnode_getinputd = mLibrary.getFunction("lib3mf_matrixfromcolumnsnode_getinputd"); + lib3mf_matrixfromcolumnsnode_getoutputresult = mLibrary.getFunction("lib3mf_matrixfromcolumnsnode_getoutputresult"); + lib3mf_constantnode_setconstant = mLibrary.getFunction("lib3mf_constantnode_setconstant"); + lib3mf_constantnode_getconstant = mLibrary.getFunction("lib3mf_constantnode_getconstant"); + lib3mf_constantnode_getoutputvalue = mLibrary.getFunction("lib3mf_constantnode_getoutputvalue"); + lib3mf_constvecnode_setvector = mLibrary.getFunction("lib3mf_constvecnode_setvector"); + lib3mf_constvecnode_getvector = mLibrary.getFunction("lib3mf_constvecnode_getvector"); + lib3mf_constvecnode_getoutputvector = mLibrary.getFunction("lib3mf_constvecnode_getoutputvector"); + lib3mf_constmatnode_setmatrix = mLibrary.getFunction("lib3mf_constmatnode_setmatrix"); + lib3mf_constmatnode_getmatrix = mLibrary.getFunction("lib3mf_constmatnode_getmatrix"); + lib3mf_constmatnode_getoutputmatrix = mLibrary.getFunction("lib3mf_constmatnode_getoutputmatrix"); + lib3mf_meshnode_getinputmesh = mLibrary.getFunction("lib3mf_meshnode_getinputmesh"); + lib3mf_meshnode_getinputpos = mLibrary.getFunction("lib3mf_meshnode_getinputpos"); + lib3mf_meshnode_getoutputdistance = mLibrary.getFunction("lib3mf_meshnode_getoutputdistance"); + lib3mf_unsignedmeshnode_getinputmesh = mLibrary.getFunction("lib3mf_unsignedmeshnode_getinputmesh"); + lib3mf_unsignedmeshnode_getinputpos = mLibrary.getFunction("lib3mf_unsignedmeshnode_getinputpos"); + lib3mf_unsignedmeshnode_getoutputdistance = mLibrary.getFunction("lib3mf_unsignedmeshnode_getoutputdistance"); + lib3mf_beamlatticenode_getinputbeamlattice = mLibrary.getFunction("lib3mf_beamlatticenode_getinputbeamlattice"); + lib3mf_beamlatticenode_getinputpos = mLibrary.getFunction("lib3mf_beamlatticenode_getinputpos"); + lib3mf_beamlatticenode_getoutputdistance = mLibrary.getFunction("lib3mf_beamlatticenode_getoutputdistance"); + lib3mf_beamlatticenode_setaccuraterange = mLibrary.getFunction("lib3mf_beamlatticenode_setaccuraterange"); + lib3mf_beamlatticenode_getaccuraterange = mLibrary.getFunction("lib3mf_beamlatticenode_getaccuraterange"); + lib3mf_functiongradientnode_getinputfunctionid = mLibrary.getFunction("lib3mf_functiongradientnode_getinputfunctionid"); + lib3mf_functiongradientnode_getinputpos = mLibrary.getFunction("lib3mf_functiongradientnode_getinputpos"); + lib3mf_functiongradientnode_getinputstep = mLibrary.getFunction("lib3mf_functiongradientnode_getinputstep"); + lib3mf_functiongradientnode_setscalaroutputname = mLibrary.getFunction("lib3mf_functiongradientnode_setscalaroutputname"); + lib3mf_functiongradientnode_getscalaroutputname = mLibrary.getFunction("lib3mf_functiongradientnode_getscalaroutputname"); + lib3mf_functiongradientnode_setvectorinputname = mLibrary.getFunction("lib3mf_functiongradientnode_setvectorinputname"); + lib3mf_functiongradientnode_getvectorinputname = mLibrary.getFunction("lib3mf_functiongradientnode_getvectorinputname"); + lib3mf_functiongradientnode_getoutputnormalizedgradient = mLibrary.getFunction("lib3mf_functiongradientnode_getoutputnormalizedgradient"); + lib3mf_functiongradientnode_getoutputgradient = mLibrary.getFunction("lib3mf_functiongradientnode_getoutputgradient"); + lib3mf_functiongradientnode_getoutputmagnitude = mLibrary.getFunction("lib3mf_functiongradientnode_getoutputmagnitude"); + lib3mf_normalizedistancenode_getinputfunctionid = mLibrary.getFunction("lib3mf_normalizedistancenode_getinputfunctionid"); + lib3mf_normalizedistancenode_getinputpos = mLibrary.getFunction("lib3mf_normalizedistancenode_getinputpos"); + lib3mf_normalizedistancenode_getinputstep = mLibrary.getFunction("lib3mf_normalizedistancenode_getinputstep"); + lib3mf_normalizedistancenode_setscalaroutputname = mLibrary.getFunction("lib3mf_normalizedistancenode_setscalaroutputname"); + lib3mf_normalizedistancenode_getscalaroutputname = mLibrary.getFunction("lib3mf_normalizedistancenode_getscalaroutputname"); + lib3mf_normalizedistancenode_setvectorinputname = mLibrary.getFunction("lib3mf_normalizedistancenode_setvectorinputname"); + lib3mf_normalizedistancenode_getvectorinputname = mLibrary.getFunction("lib3mf_normalizedistancenode_getvectorinputname"); + lib3mf_normalizedistancenode_getoutputresult = mLibrary.getFunction("lib3mf_normalizedistancenode_getoutputresult"); + lib3mf_functioncallnode_getinputfunctionid = mLibrary.getFunction("lib3mf_functioncallnode_getinputfunctionid"); + lib3mf_nodeiterator_getcurrent = mLibrary.getFunction("lib3mf_nodeiterator_getcurrent"); + lib3mf_function_getdisplayname = mLibrary.getFunction("lib3mf_function_getdisplayname"); + lib3mf_function_setdisplayname = mLibrary.getFunction("lib3mf_function_setdisplayname"); + lib3mf_function_addinput = mLibrary.getFunction("lib3mf_function_addinput"); + lib3mf_function_getinputs = mLibrary.getFunction("lib3mf_function_getinputs"); + lib3mf_function_removeinput = mLibrary.getFunction("lib3mf_function_removeinput"); + lib3mf_function_addoutput = mLibrary.getFunction("lib3mf_function_addoutput"); + lib3mf_function_getoutputs = mLibrary.getFunction("lib3mf_function_getoutputs"); + lib3mf_function_removeoutput = mLibrary.getFunction("lib3mf_function_removeoutput"); + lib3mf_function_findinput = mLibrary.getFunction("lib3mf_function_findinput"); + lib3mf_function_findoutput = mLibrary.getFunction("lib3mf_function_findoutput"); + lib3mf_implicitfunction_getidentifier = mLibrary.getFunction("lib3mf_implicitfunction_getidentifier"); + lib3mf_implicitfunction_setidentifier = mLibrary.getFunction("lib3mf_implicitfunction_setidentifier"); + lib3mf_implicitfunction_addnode = mLibrary.getFunction("lib3mf_implicitfunction_addnode"); + lib3mf_implicitfunction_addsinnode = mLibrary.getFunction("lib3mf_implicitfunction_addsinnode"); + lib3mf_implicitfunction_addcosnode = mLibrary.getFunction("lib3mf_implicitfunction_addcosnode"); + lib3mf_implicitfunction_addtannode = mLibrary.getFunction("lib3mf_implicitfunction_addtannode"); + lib3mf_implicitfunction_addarcsinnode = mLibrary.getFunction("lib3mf_implicitfunction_addarcsinnode"); + lib3mf_implicitfunction_addarccosnode = mLibrary.getFunction("lib3mf_implicitfunction_addarccosnode"); + lib3mf_implicitfunction_addarctan2node = mLibrary.getFunction("lib3mf_implicitfunction_addarctan2node"); + lib3mf_implicitfunction_addsinhnode = mLibrary.getFunction("lib3mf_implicitfunction_addsinhnode"); + lib3mf_implicitfunction_addcoshnode = mLibrary.getFunction("lib3mf_implicitfunction_addcoshnode"); + lib3mf_implicitfunction_addtanhnode = mLibrary.getFunction("lib3mf_implicitfunction_addtanhnode"); + lib3mf_implicitfunction_addroundnode = mLibrary.getFunction("lib3mf_implicitfunction_addroundnode"); + lib3mf_implicitfunction_addceilnode = mLibrary.getFunction("lib3mf_implicitfunction_addceilnode"); + lib3mf_implicitfunction_addfloornode = mLibrary.getFunction("lib3mf_implicitfunction_addfloornode"); + lib3mf_implicitfunction_addsignnode = mLibrary.getFunction("lib3mf_implicitfunction_addsignnode"); + lib3mf_implicitfunction_addfractnode = mLibrary.getFunction("lib3mf_implicitfunction_addfractnode"); + lib3mf_implicitfunction_addabsnode = mLibrary.getFunction("lib3mf_implicitfunction_addabsnode"); + lib3mf_implicitfunction_addexpnode = mLibrary.getFunction("lib3mf_implicitfunction_addexpnode"); + lib3mf_implicitfunction_addlognode = mLibrary.getFunction("lib3mf_implicitfunction_addlognode"); + lib3mf_implicitfunction_addlog2node = mLibrary.getFunction("lib3mf_implicitfunction_addlog2node"); + lib3mf_implicitfunction_addlog10node = mLibrary.getFunction("lib3mf_implicitfunction_addlog10node"); + lib3mf_implicitfunction_addlengthnode = mLibrary.getFunction("lib3mf_implicitfunction_addlengthnode"); + lib3mf_implicitfunction_addtransposenode = mLibrary.getFunction("lib3mf_implicitfunction_addtransposenode"); + lib3mf_implicitfunction_addinversenode = mLibrary.getFunction("lib3mf_implicitfunction_addinversenode"); + lib3mf_implicitfunction_addsqrtnode = mLibrary.getFunction("lib3mf_implicitfunction_addsqrtnode"); + lib3mf_implicitfunction_addresourceidnode = mLibrary.getFunction("lib3mf_implicitfunction_addresourceidnode"); + lib3mf_implicitfunction_addadditionnode = mLibrary.getFunction("lib3mf_implicitfunction_addadditionnode"); + lib3mf_implicitfunction_addsubtractionnode = mLibrary.getFunction("lib3mf_implicitfunction_addsubtractionnode"); + lib3mf_implicitfunction_addmultiplicationnode = mLibrary.getFunction("lib3mf_implicitfunction_addmultiplicationnode"); + lib3mf_implicitfunction_adddivisionnode = mLibrary.getFunction("lib3mf_implicitfunction_adddivisionnode"); + lib3mf_implicitfunction_adddotnode = mLibrary.getFunction("lib3mf_implicitfunction_adddotnode"); + lib3mf_implicitfunction_addcrossnode = mLibrary.getFunction("lib3mf_implicitfunction_addcrossnode"); + lib3mf_implicitfunction_addmatvecmultiplicationnode = mLibrary.getFunction("lib3mf_implicitfunction_addmatvecmultiplicationnode"); + lib3mf_implicitfunction_addminnode = mLibrary.getFunction("lib3mf_implicitfunction_addminnode"); + lib3mf_implicitfunction_addmaxnode = mLibrary.getFunction("lib3mf_implicitfunction_addmaxnode"); + lib3mf_implicitfunction_addfmodnode = mLibrary.getFunction("lib3mf_implicitfunction_addfmodnode"); + lib3mf_implicitfunction_addpownode = mLibrary.getFunction("lib3mf_implicitfunction_addpownode"); + lib3mf_implicitfunction_addselectnode = mLibrary.getFunction("lib3mf_implicitfunction_addselectnode"); + lib3mf_implicitfunction_addclampnode = mLibrary.getFunction("lib3mf_implicitfunction_addclampnode"); + lib3mf_implicitfunction_addcomposevectornode = mLibrary.getFunction("lib3mf_implicitfunction_addcomposevectornode"); + lib3mf_implicitfunction_addvectorfromscalarnode = mLibrary.getFunction("lib3mf_implicitfunction_addvectorfromscalarnode"); + lib3mf_implicitfunction_adddecomposevectornode = mLibrary.getFunction("lib3mf_implicitfunction_adddecomposevectornode"); + lib3mf_implicitfunction_addcomposematrixnode = mLibrary.getFunction("lib3mf_implicitfunction_addcomposematrixnode"); + lib3mf_implicitfunction_addmatrixfromrowsnode = mLibrary.getFunction("lib3mf_implicitfunction_addmatrixfromrowsnode"); + lib3mf_implicitfunction_addmatrixfromcolumnsnode = mLibrary.getFunction("lib3mf_implicitfunction_addmatrixfromcolumnsnode"); + lib3mf_implicitfunction_addconstantnode = mLibrary.getFunction("lib3mf_implicitfunction_addconstantnode"); + lib3mf_implicitfunction_addconstvecnode = mLibrary.getFunction("lib3mf_implicitfunction_addconstvecnode"); + lib3mf_implicitfunction_addconstmatnode = mLibrary.getFunction("lib3mf_implicitfunction_addconstmatnode"); + lib3mf_implicitfunction_addmeshnode = mLibrary.getFunction("lib3mf_implicitfunction_addmeshnode"); + lib3mf_implicitfunction_addunsignedmeshnode = mLibrary.getFunction("lib3mf_implicitfunction_addunsignedmeshnode"); + lib3mf_implicitfunction_addbeamlatticenode = mLibrary.getFunction("lib3mf_implicitfunction_addbeamlatticenode"); + lib3mf_implicitfunction_addfunctiongradientnode = mLibrary.getFunction("lib3mf_implicitfunction_addfunctiongradientnode"); + lib3mf_implicitfunction_addnormalizedistancenode = mLibrary.getFunction("lib3mf_implicitfunction_addnormalizedistancenode"); + lib3mf_implicitfunction_addfunctioncallnode = mLibrary.getFunction("lib3mf_implicitfunction_addfunctioncallnode"); + lib3mf_implicitfunction_getnodes = mLibrary.getFunction("lib3mf_implicitfunction_getnodes"); + lib3mf_implicitfunction_removenode = mLibrary.getFunction("lib3mf_implicitfunction_removenode"); + lib3mf_implicitfunction_addlink = mLibrary.getFunction("lib3mf_implicitfunction_addlink"); + lib3mf_implicitfunction_addlinkbynames = mLibrary.getFunction("lib3mf_implicitfunction_addlinkbynames"); + lib3mf_implicitfunction_clear = mLibrary.getFunction("lib3mf_implicitfunction_clear"); + lib3mf_implicitfunction_sortnodestopologically = mLibrary.getFunction("lib3mf_implicitfunction_sortnodestopologically"); + lib3mf_functionfromimage3d_getimage3d = mLibrary.getFunction("lib3mf_functionfromimage3d_getimage3d"); + lib3mf_functionfromimage3d_setimage3d = mLibrary.getFunction("lib3mf_functionfromimage3d_setimage3d"); + lib3mf_functionfromimage3d_setfilter = mLibrary.getFunction("lib3mf_functionfromimage3d_setfilter"); + lib3mf_functionfromimage3d_getfilter = mLibrary.getFunction("lib3mf_functionfromimage3d_getfilter"); + lib3mf_functionfromimage3d_settilestyles = mLibrary.getFunction("lib3mf_functionfromimage3d_settilestyles"); + lib3mf_functionfromimage3d_gettilestyles = mLibrary.getFunction("lib3mf_functionfromimage3d_gettilestyles"); + lib3mf_functionfromimage3d_getoffset = mLibrary.getFunction("lib3mf_functionfromimage3d_getoffset"); + lib3mf_functionfromimage3d_setoffset = mLibrary.getFunction("lib3mf_functionfromimage3d_setoffset"); + lib3mf_functionfromimage3d_getscale = mLibrary.getFunction("lib3mf_functionfromimage3d_getscale"); + lib3mf_functionfromimage3d_setscale = mLibrary.getFunction("lib3mf_functionfromimage3d_setscale"); + lib3mf_builditem_getobjectresource = mLibrary.getFunction("lib3mf_builditem_getobjectresource"); + lib3mf_builditem_getuuid = mLibrary.getFunction("lib3mf_builditem_getuuid"); + lib3mf_builditem_setuuid = mLibrary.getFunction("lib3mf_builditem_setuuid"); + lib3mf_builditem_getobjectresourceid = mLibrary.getFunction("lib3mf_builditem_getobjectresourceid"); + lib3mf_builditem_hasobjecttransform = mLibrary.getFunction("lib3mf_builditem_hasobjecttransform"); + lib3mf_builditem_getobjecttransform = mLibrary.getFunction("lib3mf_builditem_getobjecttransform"); + lib3mf_builditem_setobjecttransform = mLibrary.getFunction("lib3mf_builditem_setobjecttransform"); + lib3mf_builditem_getpartnumber = mLibrary.getFunction("lib3mf_builditem_getpartnumber"); + lib3mf_builditem_setpartnumber = mLibrary.getFunction("lib3mf_builditem_setpartnumber"); + lib3mf_builditem_getmetadatagroup = mLibrary.getFunction("lib3mf_builditem_getmetadatagroup"); + lib3mf_builditem_getoutbox = mLibrary.getFunction("lib3mf_builditem_getoutbox"); + lib3mf_builditemiterator_movenext = mLibrary.getFunction("lib3mf_builditemiterator_movenext"); + lib3mf_builditemiterator_moveprevious = mLibrary.getFunction("lib3mf_builditemiterator_moveprevious"); + lib3mf_builditemiterator_getcurrent = mLibrary.getFunction("lib3mf_builditemiterator_getcurrent"); + lib3mf_builditemiterator_clone = mLibrary.getFunction("lib3mf_builditemiterator_clone"); + lib3mf_builditemiterator_count = mLibrary.getFunction("lib3mf_builditemiterator_count"); + lib3mf_slice_setvertices = mLibrary.getFunction("lib3mf_slice_setvertices"); + lib3mf_slice_getvertices = mLibrary.getFunction("lib3mf_slice_getvertices"); + lib3mf_slice_getvertexcount = mLibrary.getFunction("lib3mf_slice_getvertexcount"); + lib3mf_slice_addpolygon = mLibrary.getFunction("lib3mf_slice_addpolygon"); + lib3mf_slice_getpolygoncount = mLibrary.getFunction("lib3mf_slice_getpolygoncount"); + lib3mf_slice_setpolygonindices = mLibrary.getFunction("lib3mf_slice_setpolygonindices"); + lib3mf_slice_getpolygonindices = mLibrary.getFunction("lib3mf_slice_getpolygonindices"); + lib3mf_slice_getpolygonindexcount = mLibrary.getFunction("lib3mf_slice_getpolygonindexcount"); + lib3mf_slice_getztop = mLibrary.getFunction("lib3mf_slice_getztop"); + lib3mf_slicestack_getbottomz = mLibrary.getFunction("lib3mf_slicestack_getbottomz"); + lib3mf_slicestack_getslicecount = mLibrary.getFunction("lib3mf_slicestack_getslicecount"); + lib3mf_slicestack_getslice = mLibrary.getFunction("lib3mf_slicestack_getslice"); + lib3mf_slicestack_addslice = mLibrary.getFunction("lib3mf_slicestack_addslice"); + lib3mf_slicestack_getslicerefcount = mLibrary.getFunction("lib3mf_slicestack_getslicerefcount"); + lib3mf_slicestack_addslicestackreference = mLibrary.getFunction("lib3mf_slicestack_addslicestackreference"); + lib3mf_slicestack_getslicestackreference = mLibrary.getFunction("lib3mf_slicestack_getslicestackreference"); + lib3mf_slicestack_collapseslicereferences = mLibrary.getFunction("lib3mf_slicestack_collapseslicereferences"); + lib3mf_slicestack_setownpath = mLibrary.getFunction("lib3mf_slicestack_setownpath"); + lib3mf_slicestack_getownpath = mLibrary.getFunction("lib3mf_slicestack_getownpath"); + lib3mf_consumer_getconsumerid = mLibrary.getFunction("lib3mf_consumer_getconsumerid"); + lib3mf_consumer_getkeyid = mLibrary.getFunction("lib3mf_consumer_getkeyid"); + lib3mf_consumer_getkeyvalue = mLibrary.getFunction("lib3mf_consumer_getkeyvalue"); + lib3mf_accessright_getconsumer = mLibrary.getFunction("lib3mf_accessright_getconsumer"); + lib3mf_accessright_getwrappingalgorithm = mLibrary.getFunction("lib3mf_accessright_getwrappingalgorithm"); + lib3mf_accessright_getmgfalgorithm = mLibrary.getFunction("lib3mf_accessright_getmgfalgorithm"); + lib3mf_accessright_getdigestmethod = mLibrary.getFunction("lib3mf_accessright_getdigestmethod"); + lib3mf_contentencryptionparams_getencryptionalgorithm = mLibrary.getFunction("lib3mf_contentencryptionparams_getencryptionalgorithm"); + lib3mf_contentencryptionparams_getkey = mLibrary.getFunction("lib3mf_contentencryptionparams_getkey"); + lib3mf_contentencryptionparams_getinitializationvector = mLibrary.getFunction("lib3mf_contentencryptionparams_getinitializationvector"); + lib3mf_contentencryptionparams_getauthenticationtag = mLibrary.getFunction("lib3mf_contentencryptionparams_getauthenticationtag"); + lib3mf_contentencryptionparams_setauthenticationtag = mLibrary.getFunction("lib3mf_contentencryptionparams_setauthenticationtag"); + lib3mf_contentencryptionparams_getadditionalauthenticationdata = mLibrary.getFunction("lib3mf_contentencryptionparams_getadditionalauthenticationdata"); + lib3mf_contentencryptionparams_getdescriptor = mLibrary.getFunction("lib3mf_contentencryptionparams_getdescriptor"); + lib3mf_contentencryptionparams_getkeyuuid = mLibrary.getFunction("lib3mf_contentencryptionparams_getkeyuuid"); + lib3mf_resourcedata_getpath = mLibrary.getFunction("lib3mf_resourcedata_getpath"); + lib3mf_resourcedata_getencryptionalgorithm = mLibrary.getFunction("lib3mf_resourcedata_getencryptionalgorithm"); + lib3mf_resourcedata_getcompression = mLibrary.getFunction("lib3mf_resourcedata_getcompression"); + lib3mf_resourcedata_getadditionalauthenticationdata = mLibrary.getFunction("lib3mf_resourcedata_getadditionalauthenticationdata"); + lib3mf_resourcedatagroup_getkeyuuid = mLibrary.getFunction("lib3mf_resourcedatagroup_getkeyuuid"); + lib3mf_resourcedatagroup_addaccessright = mLibrary.getFunction("lib3mf_resourcedatagroup_addaccessright"); + lib3mf_resourcedatagroup_findaccessrightbyconsumer = mLibrary.getFunction("lib3mf_resourcedatagroup_findaccessrightbyconsumer"); + lib3mf_resourcedatagroup_removeaccessright = mLibrary.getFunction("lib3mf_resourcedatagroup_removeaccessright"); + lib3mf_keystore_addconsumer = mLibrary.getFunction("lib3mf_keystore_addconsumer"); + lib3mf_keystore_getconsumercount = mLibrary.getFunction("lib3mf_keystore_getconsumercount"); + lib3mf_keystore_getconsumer = mLibrary.getFunction("lib3mf_keystore_getconsumer"); + lib3mf_keystore_removeconsumer = mLibrary.getFunction("lib3mf_keystore_removeconsumer"); + lib3mf_keystore_findconsumer = mLibrary.getFunction("lib3mf_keystore_findconsumer"); + lib3mf_keystore_getresourcedatagroupcount = mLibrary.getFunction("lib3mf_keystore_getresourcedatagroupcount"); + lib3mf_keystore_addresourcedatagroup = mLibrary.getFunction("lib3mf_keystore_addresourcedatagroup"); + lib3mf_keystore_getresourcedatagroup = mLibrary.getFunction("lib3mf_keystore_getresourcedatagroup"); + lib3mf_keystore_removeresourcedatagroup = mLibrary.getFunction("lib3mf_keystore_removeresourcedatagroup"); + lib3mf_keystore_findresourcedatagroup = mLibrary.getFunction("lib3mf_keystore_findresourcedatagroup"); + lib3mf_keystore_addresourcedata = mLibrary.getFunction("lib3mf_keystore_addresourcedata"); + lib3mf_keystore_removeresourcedata = mLibrary.getFunction("lib3mf_keystore_removeresourcedata"); + lib3mf_keystore_findresourcedata = mLibrary.getFunction("lib3mf_keystore_findresourcedata"); + lib3mf_keystore_getresourcedatacount = mLibrary.getFunction("lib3mf_keystore_getresourcedatacount"); + lib3mf_keystore_getresourcedata = mLibrary.getFunction("lib3mf_keystore_getresourcedata"); + lib3mf_keystore_getuuid = mLibrary.getFunction("lib3mf_keystore_getuuid"); + lib3mf_keystore_setuuid = mLibrary.getFunction("lib3mf_keystore_setuuid"); + lib3mf_model_rootmodelpart = mLibrary.getFunction("lib3mf_model_rootmodelpart"); + lib3mf_model_findorcreatepackagepart = mLibrary.getFunction("lib3mf_model_findorcreatepackagepart"); + lib3mf_model_setunit = mLibrary.getFunction("lib3mf_model_setunit"); + lib3mf_model_getunit = mLibrary.getFunction("lib3mf_model_getunit"); + lib3mf_model_getlanguage = mLibrary.getFunction("lib3mf_model_getlanguage"); + lib3mf_model_setlanguage = mLibrary.getFunction("lib3mf_model_setlanguage"); + lib3mf_model_querywriter = mLibrary.getFunction("lib3mf_model_querywriter"); + lib3mf_model_queryreader = mLibrary.getFunction("lib3mf_model_queryreader"); + lib3mf_model_getresourcebyid = mLibrary.getFunction("lib3mf_model_getresourcebyid"); + lib3mf_model_gettexture2dbyid = mLibrary.getFunction("lib3mf_model_gettexture2dbyid"); + lib3mf_model_getpropertytypebyid = mLibrary.getFunction("lib3mf_model_getpropertytypebyid"); + lib3mf_model_getbasematerialgroupbyid = mLibrary.getFunction("lib3mf_model_getbasematerialgroupbyid"); + lib3mf_model_gettexture2dgroupbyid = mLibrary.getFunction("lib3mf_model_gettexture2dgroupbyid"); + lib3mf_model_getcompositematerialsbyid = mLibrary.getFunction("lib3mf_model_getcompositematerialsbyid"); + lib3mf_model_getmultipropertygroupbyid = mLibrary.getFunction("lib3mf_model_getmultipropertygroupbyid"); + lib3mf_model_getmeshobjectbyid = mLibrary.getFunction("lib3mf_model_getmeshobjectbyid"); + lib3mf_model_getcomponentsobjectbyid = mLibrary.getFunction("lib3mf_model_getcomponentsobjectbyid"); + lib3mf_model_getbooleanobjectbyid = mLibrary.getFunction("lib3mf_model_getbooleanobjectbyid"); + lib3mf_model_getcolorgroupbyid = mLibrary.getFunction("lib3mf_model_getcolorgroupbyid"); + lib3mf_model_getslicestackbyid = mLibrary.getFunction("lib3mf_model_getslicestackbyid"); + lib3mf_model_getlevelsetbyid = mLibrary.getFunction("lib3mf_model_getlevelsetbyid"); + lib3mf_model_getbuilduuid = mLibrary.getFunction("lib3mf_model_getbuilduuid"); + lib3mf_model_setbuilduuid = mLibrary.getFunction("lib3mf_model_setbuilduuid"); + lib3mf_model_getbuilditems = mLibrary.getFunction("lib3mf_model_getbuilditems"); + lib3mf_model_getoutbox = mLibrary.getFunction("lib3mf_model_getoutbox"); + lib3mf_model_getresources = mLibrary.getFunction("lib3mf_model_getresources"); + lib3mf_model_getobjects = mLibrary.getFunction("lib3mf_model_getobjects"); + lib3mf_model_getmeshobjects = mLibrary.getFunction("lib3mf_model_getmeshobjects"); + lib3mf_model_getcomponentsobjects = mLibrary.getFunction("lib3mf_model_getcomponentsobjects"); + lib3mf_model_getbooleanobjects = mLibrary.getFunction("lib3mf_model_getbooleanobjects"); + lib3mf_model_gettexture2ds = mLibrary.getFunction("lib3mf_model_gettexture2ds"); + lib3mf_model_getbasematerialgroups = mLibrary.getFunction("lib3mf_model_getbasematerialgroups"); + lib3mf_model_getcolorgroups = mLibrary.getFunction("lib3mf_model_getcolorgroups"); + lib3mf_model_gettexture2dgroups = mLibrary.getFunction("lib3mf_model_gettexture2dgroups"); + lib3mf_model_getcompositematerials = mLibrary.getFunction("lib3mf_model_getcompositematerials"); + lib3mf_model_getmultipropertygroups = mLibrary.getFunction("lib3mf_model_getmultipropertygroups"); + lib3mf_model_getslicestacks = mLibrary.getFunction("lib3mf_model_getslicestacks"); + lib3mf_model_getimage3ds = mLibrary.getFunction("lib3mf_model_getimage3ds"); + lib3mf_model_mergetomodel = mLibrary.getFunction("lib3mf_model_mergetomodel"); + lib3mf_model_mergefrommodel = mLibrary.getFunction("lib3mf_model_mergefrommodel"); + lib3mf_model_addmeshobject = mLibrary.getFunction("lib3mf_model_addmeshobject"); + lib3mf_model_addcomponentsobject = mLibrary.getFunction("lib3mf_model_addcomponentsobject"); + lib3mf_model_addbooleanobject = mLibrary.getFunction("lib3mf_model_addbooleanobject"); + lib3mf_model_addslicestack = mLibrary.getFunction("lib3mf_model_addslicestack"); + lib3mf_model_addtexture2dfromattachment = mLibrary.getFunction("lib3mf_model_addtexture2dfromattachment"); + lib3mf_model_addbasematerialgroup = mLibrary.getFunction("lib3mf_model_addbasematerialgroup"); + lib3mf_model_addcolorgroup = mLibrary.getFunction("lib3mf_model_addcolorgroup"); + lib3mf_model_addtexture2dgroup = mLibrary.getFunction("lib3mf_model_addtexture2dgroup"); + lib3mf_model_addcompositematerials = mLibrary.getFunction("lib3mf_model_addcompositematerials"); + lib3mf_model_addmultipropertygroup = mLibrary.getFunction("lib3mf_model_addmultipropertygroup"); + lib3mf_model_addimagestack = mLibrary.getFunction("lib3mf_model_addimagestack"); + lib3mf_model_getimagestackbyid = mLibrary.getFunction("lib3mf_model_getimagestackbyid"); + lib3mf_model_addbuilditem = mLibrary.getFunction("lib3mf_model_addbuilditem"); + lib3mf_model_removebuilditem = mLibrary.getFunction("lib3mf_model_removebuilditem"); + lib3mf_model_getmetadatagroup = mLibrary.getFunction("lib3mf_model_getmetadatagroup"); + lib3mf_model_addattachment = mLibrary.getFunction("lib3mf_model_addattachment"); + lib3mf_model_removeattachment = mLibrary.getFunction("lib3mf_model_removeattachment"); + lib3mf_model_getattachment = mLibrary.getFunction("lib3mf_model_getattachment"); + lib3mf_model_findattachment = mLibrary.getFunction("lib3mf_model_findattachment"); + lib3mf_model_getattachmentcount = mLibrary.getFunction("lib3mf_model_getattachmentcount"); + lib3mf_model_haspackagethumbnailattachment = mLibrary.getFunction("lib3mf_model_haspackagethumbnailattachment"); + lib3mf_model_createpackagethumbnailattachment = mLibrary.getFunction("lib3mf_model_createpackagethumbnailattachment"); + lib3mf_model_getpackagethumbnailattachment = mLibrary.getFunction("lib3mf_model_getpackagethumbnailattachment"); + lib3mf_model_removepackagethumbnailattachment = mLibrary.getFunction("lib3mf_model_removepackagethumbnailattachment"); + lib3mf_model_addcustomcontenttype = mLibrary.getFunction("lib3mf_model_addcustomcontenttype"); + lib3mf_model_removecustomcontenttype = mLibrary.getFunction("lib3mf_model_removecustomcontenttype"); + lib3mf_model_setrandomnumbercallback = mLibrary.getFunction("lib3mf_model_setrandomnumbercallback"); + lib3mf_model_getkeystore = mLibrary.getFunction("lib3mf_model_getkeystore"); + lib3mf_model_getfunctions = mLibrary.getFunction("lib3mf_model_getfunctions"); + lib3mf_model_addimplicitfunction = mLibrary.getFunction("lib3mf_model_addimplicitfunction"); + lib3mf_model_addfunctionfromimage3d = mLibrary.getFunction("lib3mf_model_addfunctionfromimage3d"); + lib3mf_model_addvolumedata = mLibrary.getFunction("lib3mf_model_addvolumedata"); + lib3mf_model_addlevelset = mLibrary.getFunction("lib3mf_model_addlevelset"); + lib3mf_model_getlevelsets = mLibrary.getFunction("lib3mf_model_getlevelsets"); + lib3mf_model_removeresource = mLibrary.getFunction("lib3mf_model_removeresource"); + } + + public Lib3MFWrapper(Pointer lookupPointer) throws Lib3MFException { + com.sun.jna.Function lookupMethod = com.sun.jna.Function.getFunction(lookupPointer); + lib3mf_getlibraryversion = loadFunctionByLookup(lookupMethod, "lib3mf_getlibraryversion"); + lib3mf_getprereleaseinformation = loadFunctionByLookup(lookupMethod, "lib3mf_getprereleaseinformation"); + lib3mf_getbuildinformation = loadFunctionByLookup(lookupMethod, "lib3mf_getbuildinformation"); + lib3mf_getspecificationversion = loadFunctionByLookup(lookupMethod, "lib3mf_getspecificationversion"); + lib3mf_createmodel = loadFunctionByLookup(lookupMethod, "lib3mf_createmodel"); + lib3mf_release = loadFunctionByLookup(lookupMethod, "lib3mf_release"); + lib3mf_acquire = loadFunctionByLookup(lookupMethod, "lib3mf_acquire"); + lib3mf_setjournal = loadFunctionByLookup(lookupMethod, "lib3mf_setjournal"); + lib3mf_getlasterror = loadFunctionByLookup(lookupMethod, "lib3mf_getlasterror"); + lib3mf_getsymbollookupmethod = loadFunctionByLookup(lookupMethod, "lib3mf_getsymbollookupmethod"); + lib3mf_retrieveprogressmessage = loadFunctionByLookup(lookupMethod, "lib3mf_retrieveprogressmessage"); + lib3mf_rgbatocolor = loadFunctionByLookup(lookupMethod, "lib3mf_rgbatocolor"); + lib3mf_floatrgbatocolor = loadFunctionByLookup(lookupMethod, "lib3mf_floatrgbatocolor"); + lib3mf_colortorgba = loadFunctionByLookup(lookupMethod, "lib3mf_colortorgba"); + lib3mf_colortofloatrgba = loadFunctionByLookup(lookupMethod, "lib3mf_colortofloatrgba"); + lib3mf_getidentitytransform = loadFunctionByLookup(lookupMethod, "lib3mf_getidentitytransform"); + lib3mf_getuniformscaletransform = loadFunctionByLookup(lookupMethod, "lib3mf_getuniformscaletransform"); + lib3mf_getscaletransform = loadFunctionByLookup(lookupMethod, "lib3mf_getscaletransform"); + lib3mf_gettranslationtransform = loadFunctionByLookup(lookupMethod, "lib3mf_gettranslationtransform"); + lib3mf_base_classtypeid = loadFunctionByLookup(lookupMethod, "lib3mf_base_classtypeid"); + lib3mf_writer_writetofile = loadFunctionByLookup(lookupMethod, "lib3mf_writer_writetofile"); + lib3mf_writer_getstreamsize = loadFunctionByLookup(lookupMethod, "lib3mf_writer_getstreamsize"); + lib3mf_writer_writetobuffer = loadFunctionByLookup(lookupMethod, "lib3mf_writer_writetobuffer"); + lib3mf_writer_writetocallback = loadFunctionByLookup(lookupMethod, "lib3mf_writer_writetocallback"); + lib3mf_writer_setprogresscallback = loadFunctionByLookup(lookupMethod, "lib3mf_writer_setprogresscallback"); + lib3mf_writer_getdecimalprecision = loadFunctionByLookup(lookupMethod, "lib3mf_writer_getdecimalprecision"); + lib3mf_writer_setdecimalprecision = loadFunctionByLookup(lookupMethod, "lib3mf_writer_setdecimalprecision"); + lib3mf_writer_setstrictmodeactive = loadFunctionByLookup(lookupMethod, "lib3mf_writer_setstrictmodeactive"); + lib3mf_writer_getstrictmodeactive = loadFunctionByLookup(lookupMethod, "lib3mf_writer_getstrictmodeactive"); + lib3mf_writer_getwarning = loadFunctionByLookup(lookupMethod, "lib3mf_writer_getwarning"); + lib3mf_writer_getwarningcount = loadFunctionByLookup(lookupMethod, "lib3mf_writer_getwarningcount"); + lib3mf_writer_addkeywrappingcallback = loadFunctionByLookup(lookupMethod, "lib3mf_writer_addkeywrappingcallback"); + lib3mf_writer_setcontentencryptioncallback = loadFunctionByLookup(lookupMethod, "lib3mf_writer_setcontentencryptioncallback"); + lib3mf_reader_readfromfile = loadFunctionByLookup(lookupMethod, "lib3mf_reader_readfromfile"); + lib3mf_reader_readfrombuffer = loadFunctionByLookup(lookupMethod, "lib3mf_reader_readfrombuffer"); + lib3mf_reader_readfromcallback = loadFunctionByLookup(lookupMethod, "lib3mf_reader_readfromcallback"); + lib3mf_reader_setprogresscallback = loadFunctionByLookup(lookupMethod, "lib3mf_reader_setprogresscallback"); + lib3mf_reader_addrelationtoread = loadFunctionByLookup(lookupMethod, "lib3mf_reader_addrelationtoread"); + lib3mf_reader_removerelationtoread = loadFunctionByLookup(lookupMethod, "lib3mf_reader_removerelationtoread"); + lib3mf_reader_setstrictmodeactive = loadFunctionByLookup(lookupMethod, "lib3mf_reader_setstrictmodeactive"); + lib3mf_reader_getstrictmodeactive = loadFunctionByLookup(lookupMethod, "lib3mf_reader_getstrictmodeactive"); + lib3mf_reader_getwarning = loadFunctionByLookup(lookupMethod, "lib3mf_reader_getwarning"); + lib3mf_reader_getwarningcount = loadFunctionByLookup(lookupMethod, "lib3mf_reader_getwarningcount"); + lib3mf_reader_addkeywrappingcallback = loadFunctionByLookup(lookupMethod, "lib3mf_reader_addkeywrappingcallback"); + lib3mf_reader_setcontentencryptioncallback = loadFunctionByLookup(lookupMethod, "lib3mf_reader_setcontentencryptioncallback"); + lib3mf_packagepart_getpath = loadFunctionByLookup(lookupMethod, "lib3mf_packagepart_getpath"); + lib3mf_packagepart_setpath = loadFunctionByLookup(lookupMethod, "lib3mf_packagepart_setpath"); + lib3mf_resource_getresourceid = loadFunctionByLookup(lookupMethod, "lib3mf_resource_getresourceid"); + lib3mf_resource_getuniqueresourceid = loadFunctionByLookup(lookupMethod, "lib3mf_resource_getuniqueresourceid"); + lib3mf_resource_packagepart = loadFunctionByLookup(lookupMethod, "lib3mf_resource_packagepart"); + lib3mf_resource_setpackagepart = loadFunctionByLookup(lookupMethod, "lib3mf_resource_setpackagepart"); + lib3mf_resource_getmodelresourceid = loadFunctionByLookup(lookupMethod, "lib3mf_resource_getmodelresourceid"); + lib3mf_resourceiterator_movenext = loadFunctionByLookup(lookupMethod, "lib3mf_resourceiterator_movenext"); + lib3mf_resourceiterator_moveprevious = loadFunctionByLookup(lookupMethod, "lib3mf_resourceiterator_moveprevious"); + lib3mf_resourceiterator_getcurrent = loadFunctionByLookup(lookupMethod, "lib3mf_resourceiterator_getcurrent"); + lib3mf_resourceiterator_clone = loadFunctionByLookup(lookupMethod, "lib3mf_resourceiterator_clone"); + lib3mf_resourceiterator_count = loadFunctionByLookup(lookupMethod, "lib3mf_resourceiterator_count"); + lib3mf_slicestackiterator_getcurrentslicestack = loadFunctionByLookup(lookupMethod, "lib3mf_slicestackiterator_getcurrentslicestack"); + lib3mf_objectiterator_getcurrentobject = loadFunctionByLookup(lookupMethod, "lib3mf_objectiterator_getcurrentobject"); + lib3mf_meshobjectiterator_getcurrentmeshobject = loadFunctionByLookup(lookupMethod, "lib3mf_meshobjectiterator_getcurrentmeshobject"); + lib3mf_componentsobjectiterator_getcurrentcomponentsobject = loadFunctionByLookup(lookupMethod, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); + lib3mf_booleanobjectiterator_getcurrentbooleanobject = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobjectiterator_getcurrentbooleanobject"); + lib3mf_texture2diterator_getcurrenttexture2d = loadFunctionByLookup(lookupMethod, "lib3mf_texture2diterator_getcurrenttexture2d"); + lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); + lib3mf_colorgroupiterator_getcurrentcolorgroup = loadFunctionByLookup(lookupMethod, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); + lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup = loadFunctionByLookup(lookupMethod, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + lib3mf_compositematerialsiterator_getcurrentcompositematerials = loadFunctionByLookup(lookupMethod, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + lib3mf_image3diterator_getcurrentimage3d = loadFunctionByLookup(lookupMethod, "lib3mf_image3diterator_getcurrentimage3d"); + lib3mf_functioniterator_getcurrentfunction = loadFunctionByLookup(lookupMethod, "lib3mf_functioniterator_getcurrentfunction"); + lib3mf_levelsetiterator_getcurrentlevelset = loadFunctionByLookup(lookupMethod, "lib3mf_levelsetiterator_getcurrentlevelset"); + lib3mf_metadata_getnamespace = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_getnamespace"); + lib3mf_metadata_setnamespace = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_setnamespace"); + lib3mf_metadata_getname = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_getname"); + lib3mf_metadata_setname = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_setname"); + lib3mf_metadata_getkey = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_getkey"); + lib3mf_metadata_getmustpreserve = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_getmustpreserve"); + lib3mf_metadata_setmustpreserve = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_setmustpreserve"); + lib3mf_metadata_gettype = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_gettype"); + lib3mf_metadata_settype = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_settype"); + lib3mf_metadata_getvalue = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_getvalue"); + lib3mf_metadata_setvalue = loadFunctionByLookup(lookupMethod, "lib3mf_metadata_setvalue"); + lib3mf_metadatagroup_getmetadatacount = loadFunctionByLookup(lookupMethod, "lib3mf_metadatagroup_getmetadatacount"); + lib3mf_metadatagroup_getmetadata = loadFunctionByLookup(lookupMethod, "lib3mf_metadatagroup_getmetadata"); + lib3mf_metadatagroup_getmetadatabykey = loadFunctionByLookup(lookupMethod, "lib3mf_metadatagroup_getmetadatabykey"); + lib3mf_metadatagroup_removemetadatabyindex = loadFunctionByLookup(lookupMethod, "lib3mf_metadatagroup_removemetadatabyindex"); + lib3mf_metadatagroup_removemetadata = loadFunctionByLookup(lookupMethod, "lib3mf_metadatagroup_removemetadata"); + lib3mf_metadatagroup_addmetadata = loadFunctionByLookup(lookupMethod, "lib3mf_metadatagroup_addmetadata"); + lib3mf_triangleset_setname = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_setname"); + lib3mf_triangleset_getname = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_getname"); + lib3mf_triangleset_setidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_setidentifier"); + lib3mf_triangleset_getidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_getidentifier"); + lib3mf_triangleset_addtriangle = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_addtriangle"); + lib3mf_triangleset_removetriangle = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_removetriangle"); + lib3mf_triangleset_clear = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_clear"); + lib3mf_triangleset_settrianglelist = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_settrianglelist"); + lib3mf_triangleset_gettrianglelist = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_gettrianglelist"); + lib3mf_triangleset_addtrianglelist = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_addtrianglelist"); + lib3mf_triangleset_merge = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_merge"); + lib3mf_triangleset_deleteset = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_deleteset"); + lib3mf_triangleset_duplicate = loadFunctionByLookup(lookupMethod, "lib3mf_triangleset_duplicate"); + lib3mf_object_gettype = loadFunctionByLookup(lookupMethod, "lib3mf_object_gettype"); + lib3mf_object_settype = loadFunctionByLookup(lookupMethod, "lib3mf_object_settype"); + lib3mf_object_getname = loadFunctionByLookup(lookupMethod, "lib3mf_object_getname"); + lib3mf_object_setname = loadFunctionByLookup(lookupMethod, "lib3mf_object_setname"); + lib3mf_object_getpartnumber = loadFunctionByLookup(lookupMethod, "lib3mf_object_getpartnumber"); + lib3mf_object_setpartnumber = loadFunctionByLookup(lookupMethod, "lib3mf_object_setpartnumber"); + lib3mf_object_ismeshobject = loadFunctionByLookup(lookupMethod, "lib3mf_object_ismeshobject"); + lib3mf_object_iscomponentsobject = loadFunctionByLookup(lookupMethod, "lib3mf_object_iscomponentsobject"); + lib3mf_object_islevelsetobject = loadFunctionByLookup(lookupMethod, "lib3mf_object_islevelsetobject"); + lib3mf_object_isbooleanobject = loadFunctionByLookup(lookupMethod, "lib3mf_object_isbooleanobject"); + lib3mf_object_isvalid = loadFunctionByLookup(lookupMethod, "lib3mf_object_isvalid"); + lib3mf_object_setattachmentasthumbnail = loadFunctionByLookup(lookupMethod, "lib3mf_object_setattachmentasthumbnail"); + lib3mf_object_getthumbnailattachment = loadFunctionByLookup(lookupMethod, "lib3mf_object_getthumbnailattachment"); + lib3mf_object_clearthumbnailattachment = loadFunctionByLookup(lookupMethod, "lib3mf_object_clearthumbnailattachment"); + lib3mf_object_getoutbox = loadFunctionByLookup(lookupMethod, "lib3mf_object_getoutbox"); + lib3mf_object_getuuid = loadFunctionByLookup(lookupMethod, "lib3mf_object_getuuid"); + lib3mf_object_setuuid = loadFunctionByLookup(lookupMethod, "lib3mf_object_setuuid"); + lib3mf_object_getmetadatagroup = loadFunctionByLookup(lookupMethod, "lib3mf_object_getmetadatagroup"); + lib3mf_object_setslicesmeshresolution = loadFunctionByLookup(lookupMethod, "lib3mf_object_setslicesmeshresolution"); + lib3mf_object_getslicesmeshresolution = loadFunctionByLookup(lookupMethod, "lib3mf_object_getslicesmeshresolution"); + lib3mf_object_hasslices = loadFunctionByLookup(lookupMethod, "lib3mf_object_hasslices"); + lib3mf_object_clearslicestack = loadFunctionByLookup(lookupMethod, "lib3mf_object_clearslicestack"); + lib3mf_object_getslicestack = loadFunctionByLookup(lookupMethod, "lib3mf_object_getslicestack"); + lib3mf_object_assignslicestack = loadFunctionByLookup(lookupMethod, "lib3mf_object_assignslicestack"); + lib3mf_meshobject_getvertexcount = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_getvertexcount"); + lib3mf_meshobject_gettrianglecount = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_gettrianglecount"); + lib3mf_meshobject_getvertex = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_getvertex"); + lib3mf_meshobject_setvertex = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_setvertex"); + lib3mf_meshobject_addvertex = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_addvertex"); + lib3mf_meshobject_getvertices = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_getvertices"); + lib3mf_meshobject_gettriangle = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_gettriangle"); + lib3mf_meshobject_settriangle = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_settriangle"); + lib3mf_meshobject_addtriangle = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_addtriangle"); + lib3mf_meshobject_gettriangleindices = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_gettriangleindices"); + lib3mf_meshobject_setobjectlevelproperty = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_setobjectlevelproperty"); + lib3mf_meshobject_getobjectlevelproperty = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_getobjectlevelproperty"); + lib3mf_meshobject_settriangleproperties = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_settriangleproperties"); + lib3mf_meshobject_gettriangleproperties = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_gettriangleproperties"); + lib3mf_meshobject_setalltriangleproperties = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_setalltriangleproperties"); + lib3mf_meshobject_getalltriangleproperties = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_getalltriangleproperties"); + lib3mf_meshobject_clearallproperties = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_clearallproperties"); + lib3mf_meshobject_setgeometry = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_setgeometry"); + lib3mf_meshobject_ismanifoldandoriented = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_ismanifoldandoriented"); + lib3mf_meshobject_beamlattice = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_beamlattice"); + lib3mf_meshobject_getvolumedata = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_getvolumedata"); + lib3mf_meshobject_setvolumedata = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_setvolumedata"); + lib3mf_meshobject_addtriangleset = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_addtriangleset"); + lib3mf_meshobject_hastriangleset = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_hastriangleset"); + lib3mf_meshobject_findtriangleset = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_findtriangleset"); + lib3mf_meshobject_gettrianglesetcount = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_gettrianglesetcount"); + lib3mf_meshobject_gettriangleset = loadFunctionByLookup(lookupMethod, "lib3mf_meshobject_gettriangleset"); + lib3mf_levelset_getfunction = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_getfunction"); + lib3mf_levelset_setfunction = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_setfunction"); + lib3mf_levelset_gettransform = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_gettransform"); + lib3mf_levelset_settransform = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_settransform"); + lib3mf_levelset_getchannelname = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_getchannelname"); + lib3mf_levelset_setchannelname = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_setchannelname"); + lib3mf_levelset_setminfeaturesize = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_setminfeaturesize"); + lib3mf_levelset_getminfeaturesize = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_getminfeaturesize"); + lib3mf_levelset_setfallbackvalue = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_setfallbackvalue"); + lib3mf_levelset_getfallbackvalue = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_getfallbackvalue"); + lib3mf_levelset_setmeshbboxonly = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_setmeshbboxonly"); + lib3mf_levelset_getmeshbboxonly = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_getmeshbboxonly"); + lib3mf_levelset_setmesh = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_setmesh"); + lib3mf_levelset_getmesh = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_getmesh"); + lib3mf_levelset_getvolumedata = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_getvolumedata"); + lib3mf_levelset_setvolumedata = loadFunctionByLookup(lookupMethod, "lib3mf_levelset_setvolumedata"); + lib3mf_booleanobject_setbaseobject = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_setbaseobject"); + lib3mf_booleanobject_getbaseobject = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_getbaseobject"); + lib3mf_booleanobject_setbasetransform = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_setbasetransform"); + lib3mf_booleanobject_getbasetransform = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_getbasetransform"); + lib3mf_booleanobject_setoperation = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_setoperation"); + lib3mf_booleanobject_getoperation = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_getoperation"); + lib3mf_booleanobject_setcsgmodeenabled = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_setcsgmodeenabled"); + lib3mf_booleanobject_getcsgmodeenabled = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_getcsgmodeenabled"); + lib3mf_booleanobject_setextractiongridresolution = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_setextractiongridresolution"); + lib3mf_booleanobject_getextractiongridresolution = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_getextractiongridresolution"); + lib3mf_booleanobject_getoperandcount = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_getoperandcount"); + lib3mf_booleanobject_addoperand = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_addoperand"); + lib3mf_booleanobject_getoperand = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_getoperand"); + lib3mf_booleanobject_mergetomeshobject = loadFunctionByLookup(lookupMethod, "lib3mf_booleanobject_mergetomeshobject"); + lib3mf_beamlattice_getminlength = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getminlength"); + lib3mf_beamlattice_setminlength = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_setminlength"); + lib3mf_beamlattice_getclipping = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getclipping"); + lib3mf_beamlattice_setclipping = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_setclipping"); + lib3mf_beamlattice_getrepresentation = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getrepresentation"); + lib3mf_beamlattice_setrepresentation = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_setrepresentation"); + lib3mf_beamlattice_getballoptions = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getballoptions"); + lib3mf_beamlattice_setballoptions = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_setballoptions"); + lib3mf_beamlattice_getbeamcount = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getbeamcount"); + lib3mf_beamlattice_getbeam = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getbeam"); + lib3mf_beamlattice_addbeam = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_addbeam"); + lib3mf_beamlattice_setbeam = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_setbeam"); + lib3mf_beamlattice_setbeams = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_setbeams"); + lib3mf_beamlattice_getbeams = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getbeams"); + lib3mf_beamlattice_getballcount = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getballcount"); + lib3mf_beamlattice_getball = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getball"); + lib3mf_beamlattice_addball = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_addball"); + lib3mf_beamlattice_setball = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_setball"); + lib3mf_beamlattice_setballs = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_setballs"); + lib3mf_beamlattice_getballs = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getballs"); + lib3mf_beamlattice_getbeamsetcount = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getbeamsetcount"); + lib3mf_beamlattice_addbeamset = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_addbeamset"); + lib3mf_beamlattice_getbeamset = loadFunctionByLookup(lookupMethod, "lib3mf_beamlattice_getbeamset"); + lib3mf_functionreference_getfunctionresourceid = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_getfunctionresourceid"); + lib3mf_functionreference_setfunctionresourceid = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_setfunctionresourceid"); + lib3mf_functionreference_gettransform = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_gettransform"); + lib3mf_functionreference_settransform = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_settransform"); + lib3mf_functionreference_getchannelname = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_getchannelname"); + lib3mf_functionreference_setchannelname = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_setchannelname"); + lib3mf_functionreference_setminfeaturesize = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_setminfeaturesize"); + lib3mf_functionreference_getminfeaturesize = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_getminfeaturesize"); + lib3mf_functionreference_setfallbackvalue = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_setfallbackvalue"); + lib3mf_functionreference_getfallbackvalue = loadFunctionByLookup(lookupMethod, "lib3mf_functionreference_getfallbackvalue"); + lib3mf_volumedatacomposite_getbasematerialgroup = loadFunctionByLookup(lookupMethod, "lib3mf_volumedatacomposite_getbasematerialgroup"); + lib3mf_volumedatacomposite_setbasematerialgroup = loadFunctionByLookup(lookupMethod, "lib3mf_volumedatacomposite_setbasematerialgroup"); + lib3mf_volumedatacomposite_getmaterialmappingcount = loadFunctionByLookup(lookupMethod, "lib3mf_volumedatacomposite_getmaterialmappingcount"); + lib3mf_volumedatacomposite_getmaterialmapping = loadFunctionByLookup(lookupMethod, "lib3mf_volumedatacomposite_getmaterialmapping"); + lib3mf_volumedatacomposite_addmaterialmapping = loadFunctionByLookup(lookupMethod, "lib3mf_volumedatacomposite_addmaterialmapping"); + lib3mf_volumedatacomposite_removematerialmapping = loadFunctionByLookup(lookupMethod, "lib3mf_volumedatacomposite_removematerialmapping"); + lib3mf_volumedataproperty_getname = loadFunctionByLookup(lookupMethod, "lib3mf_volumedataproperty_getname"); + lib3mf_volumedataproperty_setisrequired = loadFunctionByLookup(lookupMethod, "lib3mf_volumedataproperty_setisrequired"); + lib3mf_volumedataproperty_isrequired = loadFunctionByLookup(lookupMethod, "lib3mf_volumedataproperty_isrequired"); + lib3mf_volumedata_getcomposite = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_getcomposite"); + lib3mf_volumedata_createnewcomposite = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_createnewcomposite"); + lib3mf_volumedata_removecomposite = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_removecomposite"); + lib3mf_volumedata_getcolor = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_getcolor"); + lib3mf_volumedata_createnewcolor = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_createnewcolor"); + lib3mf_volumedata_removecolor = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_removecolor"); + lib3mf_volumedata_getpropertycount = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_getpropertycount"); + lib3mf_volumedata_getproperty = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_getproperty"); + lib3mf_volumedata_addpropertyfromfunction = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_addpropertyfromfunction"); + lib3mf_volumedata_removeproperty = loadFunctionByLookup(lookupMethod, "lib3mf_volumedata_removeproperty"); + lib3mf_component_getobjectresource = loadFunctionByLookup(lookupMethod, "lib3mf_component_getobjectresource"); + lib3mf_component_getobjectresourceid = loadFunctionByLookup(lookupMethod, "lib3mf_component_getobjectresourceid"); + lib3mf_component_getuuid = loadFunctionByLookup(lookupMethod, "lib3mf_component_getuuid"); + lib3mf_component_setuuid = loadFunctionByLookup(lookupMethod, "lib3mf_component_setuuid"); + lib3mf_component_hastransform = loadFunctionByLookup(lookupMethod, "lib3mf_component_hastransform"); + lib3mf_component_gettransform = loadFunctionByLookup(lookupMethod, "lib3mf_component_gettransform"); + lib3mf_component_settransform = loadFunctionByLookup(lookupMethod, "lib3mf_component_settransform"); + lib3mf_componentsobject_addcomponent = loadFunctionByLookup(lookupMethod, "lib3mf_componentsobject_addcomponent"); + lib3mf_componentsobject_getcomponent = loadFunctionByLookup(lookupMethod, "lib3mf_componentsobject_getcomponent"); + lib3mf_componentsobject_getcomponentcount = loadFunctionByLookup(lookupMethod, "lib3mf_componentsobject_getcomponentcount"); + lib3mf_beamset_setname = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_setname"); + lib3mf_beamset_getname = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_getname"); + lib3mf_beamset_setidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_setidentifier"); + lib3mf_beamset_getidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_getidentifier"); + lib3mf_beamset_getreferencecount = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_getreferencecount"); + lib3mf_beamset_setreferences = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_setreferences"); + lib3mf_beamset_getreferences = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_getreferences"); + lib3mf_beamset_getballreferencecount = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_getballreferencecount"); + lib3mf_beamset_setballreferences = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_setballreferences"); + lib3mf_beamset_getballreferences = loadFunctionByLookup(lookupMethod, "lib3mf_beamset_getballreferences"); + lib3mf_basematerialgroup_getcount = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroup_getcount"); + lib3mf_basematerialgroup_getallpropertyids = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroup_getallpropertyids"); + lib3mf_basematerialgroup_addmaterial = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroup_addmaterial"); + lib3mf_basematerialgroup_removematerial = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroup_removematerial"); + lib3mf_basematerialgroup_getname = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroup_getname"); + lib3mf_basematerialgroup_setname = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroup_setname"); + lib3mf_basematerialgroup_setdisplaycolor = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroup_setdisplaycolor"); + lib3mf_basematerialgroup_getdisplaycolor = loadFunctionByLookup(lookupMethod, "lib3mf_basematerialgroup_getdisplaycolor"); + lib3mf_colorgroup_getcount = loadFunctionByLookup(lookupMethod, "lib3mf_colorgroup_getcount"); + lib3mf_colorgroup_getallpropertyids = loadFunctionByLookup(lookupMethod, "lib3mf_colorgroup_getallpropertyids"); + lib3mf_colorgroup_addcolor = loadFunctionByLookup(lookupMethod, "lib3mf_colorgroup_addcolor"); + lib3mf_colorgroup_removecolor = loadFunctionByLookup(lookupMethod, "lib3mf_colorgroup_removecolor"); + lib3mf_colorgroup_setcolor = loadFunctionByLookup(lookupMethod, "lib3mf_colorgroup_setcolor"); + lib3mf_colorgroup_getcolor = loadFunctionByLookup(lookupMethod, "lib3mf_colorgroup_getcolor"); + lib3mf_texture2dgroup_getcount = loadFunctionByLookup(lookupMethod, "lib3mf_texture2dgroup_getcount"); + lib3mf_texture2dgroup_getallpropertyids = loadFunctionByLookup(lookupMethod, "lib3mf_texture2dgroup_getallpropertyids"); + lib3mf_texture2dgroup_addtex2coord = loadFunctionByLookup(lookupMethod, "lib3mf_texture2dgroup_addtex2coord"); + lib3mf_texture2dgroup_gettex2coord = loadFunctionByLookup(lookupMethod, "lib3mf_texture2dgroup_gettex2coord"); + lib3mf_texture2dgroup_removetex2coord = loadFunctionByLookup(lookupMethod, "lib3mf_texture2dgroup_removetex2coord"); + lib3mf_texture2dgroup_gettexture2d = loadFunctionByLookup(lookupMethod, "lib3mf_texture2dgroup_gettexture2d"); + lib3mf_compositematerials_getcount = loadFunctionByLookup(lookupMethod, "lib3mf_compositematerials_getcount"); + lib3mf_compositematerials_getallpropertyids = loadFunctionByLookup(lookupMethod, "lib3mf_compositematerials_getallpropertyids"); + lib3mf_compositematerials_getbasematerialgroup = loadFunctionByLookup(lookupMethod, "lib3mf_compositematerials_getbasematerialgroup"); + lib3mf_compositematerials_addcomposite = loadFunctionByLookup(lookupMethod, "lib3mf_compositematerials_addcomposite"); + lib3mf_compositematerials_removecomposite = loadFunctionByLookup(lookupMethod, "lib3mf_compositematerials_removecomposite"); + lib3mf_compositematerials_getcomposite = loadFunctionByLookup(lookupMethod, "lib3mf_compositematerials_getcomposite"); + lib3mf_multipropertygroup_getcount = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_getcount"); + lib3mf_multipropertygroup_getallpropertyids = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_getallpropertyids"); + lib3mf_multipropertygroup_addmultiproperty = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_addmultiproperty"); + lib3mf_multipropertygroup_setmultiproperty = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_setmultiproperty"); + lib3mf_multipropertygroup_getmultiproperty = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_getmultiproperty"); + lib3mf_multipropertygroup_removemultiproperty = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_removemultiproperty"); + lib3mf_multipropertygroup_getlayercount = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_getlayercount"); + lib3mf_multipropertygroup_addlayer = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_addlayer"); + lib3mf_multipropertygroup_getlayer = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_getlayer"); + lib3mf_multipropertygroup_removelayer = loadFunctionByLookup(lookupMethod, "lib3mf_multipropertygroup_removelayer"); + lib3mf_image3d_getname = loadFunctionByLookup(lookupMethod, "lib3mf_image3d_getname"); + lib3mf_image3d_setname = loadFunctionByLookup(lookupMethod, "lib3mf_image3d_setname"); + lib3mf_image3d_isimagestack = loadFunctionByLookup(lookupMethod, "lib3mf_image3d_isimagestack"); + lib3mf_imagestack_getrowcount = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_getrowcount"); + lib3mf_imagestack_setrowcount = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_setrowcount"); + lib3mf_imagestack_getcolumncount = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_getcolumncount"); + lib3mf_imagestack_setcolumncount = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_setcolumncount"); + lib3mf_imagestack_getsheetcount = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_getsheetcount"); + lib3mf_imagestack_getsheet = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_getsheet"); + lib3mf_imagestack_setsheet = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_setsheet"); + lib3mf_imagestack_createemptysheet = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_createemptysheet"); + lib3mf_imagestack_createsheetfrombuffer = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_createsheetfrombuffer"); + lib3mf_imagestack_createsheetfromfile = loadFunctionByLookup(lookupMethod, "lib3mf_imagestack_createsheetfromfile"); + lib3mf_attachment_getpath = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_getpath"); + lib3mf_attachment_setpath = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_setpath"); + lib3mf_attachment_packagepart = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_packagepart"); + lib3mf_attachment_getrelationshiptype = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_getrelationshiptype"); + lib3mf_attachment_setrelationshiptype = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_setrelationshiptype"); + lib3mf_attachment_writetofile = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_writetofile"); + lib3mf_attachment_readfromfile = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_readfromfile"); + lib3mf_attachment_readfromcallback = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_readfromcallback"); + lib3mf_attachment_getstreamsize = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_getstreamsize"); + lib3mf_attachment_writetobuffer = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_writetobuffer"); + lib3mf_attachment_readfrombuffer = loadFunctionByLookup(lookupMethod, "lib3mf_attachment_readfrombuffer"); + lib3mf_texture2d_getattachment = loadFunctionByLookup(lookupMethod, "lib3mf_texture2d_getattachment"); + lib3mf_texture2d_setattachment = loadFunctionByLookup(lookupMethod, "lib3mf_texture2d_setattachment"); + lib3mf_texture2d_getcontenttype = loadFunctionByLookup(lookupMethod, "lib3mf_texture2d_getcontenttype"); + lib3mf_texture2d_setcontenttype = loadFunctionByLookup(lookupMethod, "lib3mf_texture2d_setcontenttype"); + lib3mf_texture2d_gettilestyleuv = loadFunctionByLookup(lookupMethod, "lib3mf_texture2d_gettilestyleuv"); + lib3mf_texture2d_settilestyleuv = loadFunctionByLookup(lookupMethod, "lib3mf_texture2d_settilestyleuv"); + lib3mf_texture2d_getfilter = loadFunctionByLookup(lookupMethod, "lib3mf_texture2d_getfilter"); + lib3mf_texture2d_setfilter = loadFunctionByLookup(lookupMethod, "lib3mf_texture2d_setfilter"); + lib3mf_implicitport_getidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_implicitport_getidentifier"); + lib3mf_implicitport_setidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_implicitport_setidentifier"); + lib3mf_implicitport_getdisplayname = loadFunctionByLookup(lookupMethod, "lib3mf_implicitport_getdisplayname"); + lib3mf_implicitport_setdisplayname = loadFunctionByLookup(lookupMethod, "lib3mf_implicitport_setdisplayname"); + lib3mf_implicitport_settype = loadFunctionByLookup(lookupMethod, "lib3mf_implicitport_settype"); + lib3mf_implicitport_gettype = loadFunctionByLookup(lookupMethod, "lib3mf_implicitport_gettype"); + lib3mf_implicitport_getreference = loadFunctionByLookup(lookupMethod, "lib3mf_implicitport_getreference"); + lib3mf_implicitport_setreference = loadFunctionByLookup(lookupMethod, "lib3mf_implicitport_setreference"); + lib3mf_iterator_movenext = loadFunctionByLookup(lookupMethod, "lib3mf_iterator_movenext"); + lib3mf_iterator_moveprevious = loadFunctionByLookup(lookupMethod, "lib3mf_iterator_moveprevious"); + lib3mf_iterator_count = loadFunctionByLookup(lookupMethod, "lib3mf_iterator_count"); + lib3mf_implicitportiterator_getcurrent = loadFunctionByLookup(lookupMethod, "lib3mf_implicitportiterator_getcurrent"); + lib3mf_implicitnode_getidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_getidentifier"); + lib3mf_implicitnode_setidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_setidentifier"); + lib3mf_implicitnode_getdisplayname = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_getdisplayname"); + lib3mf_implicitnode_setdisplayname = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_setdisplayname"); + lib3mf_implicitnode_gettag = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_gettag"); + lib3mf_implicitnode_settag = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_settag"); + lib3mf_implicitnode_getnodetype = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_getnodetype"); + lib3mf_implicitnode_addinput = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_addinput"); + lib3mf_implicitnode_getinputs = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_getinputs"); + lib3mf_implicitnode_addoutput = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_addoutput"); + lib3mf_implicitnode_getoutputs = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_getoutputs"); + lib3mf_implicitnode_findinput = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_findinput"); + lib3mf_implicitnode_findoutput = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_findoutput"); + lib3mf_implicitnode_aretypesvalid = loadFunctionByLookup(lookupMethod, "lib3mf_implicitnode_aretypesvalid"); + lib3mf_oneinputnode_getinputa = loadFunctionByLookup(lookupMethod, "lib3mf_oneinputnode_getinputa"); + lib3mf_oneinputnode_getoutputresult = loadFunctionByLookup(lookupMethod, "lib3mf_oneinputnode_getoutputresult"); + lib3mf_resourceidnode_setresource = loadFunctionByLookup(lookupMethod, "lib3mf_resourceidnode_setresource"); + lib3mf_resourceidnode_getresource = loadFunctionByLookup(lookupMethod, "lib3mf_resourceidnode_getresource"); + lib3mf_resourceidnode_getoutputvalue = loadFunctionByLookup(lookupMethod, "lib3mf_resourceidnode_getoutputvalue"); + lib3mf_twoinputnode_getinputb = loadFunctionByLookup(lookupMethod, "lib3mf_twoinputnode_getinputb"); + lib3mf_selectnode_getinputb = loadFunctionByLookup(lookupMethod, "lib3mf_selectnode_getinputb"); + lib3mf_selectnode_getinputc = loadFunctionByLookup(lookupMethod, "lib3mf_selectnode_getinputc"); + lib3mf_selectnode_getinputd = loadFunctionByLookup(lookupMethod, "lib3mf_selectnode_getinputd"); + lib3mf_clampnode_getinputmin = loadFunctionByLookup(lookupMethod, "lib3mf_clampnode_getinputmin"); + lib3mf_clampnode_getinputmax = loadFunctionByLookup(lookupMethod, "lib3mf_clampnode_getinputmax"); + lib3mf_composevectornode_getinputx = loadFunctionByLookup(lookupMethod, "lib3mf_composevectornode_getinputx"); + lib3mf_composevectornode_getinputy = loadFunctionByLookup(lookupMethod, "lib3mf_composevectornode_getinputy"); + lib3mf_composevectornode_getinputz = loadFunctionByLookup(lookupMethod, "lib3mf_composevectornode_getinputz"); + lib3mf_composevectornode_getoutputresult = loadFunctionByLookup(lookupMethod, "lib3mf_composevectornode_getoutputresult"); + lib3mf_decomposevectornode_getinputa = loadFunctionByLookup(lookupMethod, "lib3mf_decomposevectornode_getinputa"); + lib3mf_decomposevectornode_getoutputx = loadFunctionByLookup(lookupMethod, "lib3mf_decomposevectornode_getoutputx"); + lib3mf_decomposevectornode_getoutputy = loadFunctionByLookup(lookupMethod, "lib3mf_decomposevectornode_getoutputy"); + lib3mf_decomposevectornode_getoutputz = loadFunctionByLookup(lookupMethod, "lib3mf_decomposevectornode_getoutputz"); + lib3mf_composematrixnode_getinputm00 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm00"); + lib3mf_composematrixnode_getinputm01 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm01"); + lib3mf_composematrixnode_getinputm02 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm02"); + lib3mf_composematrixnode_getinputm03 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm03"); + lib3mf_composematrixnode_getinputm10 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm10"); + lib3mf_composematrixnode_getinputm11 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm11"); + lib3mf_composematrixnode_getinputm12 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm12"); + lib3mf_composematrixnode_getinputm13 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm13"); + lib3mf_composematrixnode_getinputm20 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm20"); + lib3mf_composematrixnode_getinputm21 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm21"); + lib3mf_composematrixnode_getinputm22 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm22"); + lib3mf_composematrixnode_getinputm23 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm23"); + lib3mf_composematrixnode_getinputm30 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm30"); + lib3mf_composematrixnode_getinputm31 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm31"); + lib3mf_composematrixnode_getinputm32 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm32"); + lib3mf_composematrixnode_getinputm33 = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getinputm33"); + lib3mf_composematrixnode_getoutputresult = loadFunctionByLookup(lookupMethod, "lib3mf_composematrixnode_getoutputresult"); + lib3mf_matrixfromrowsnode_getinputa = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromrowsnode_getinputa"); + lib3mf_matrixfromrowsnode_getinputb = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromrowsnode_getinputb"); + lib3mf_matrixfromrowsnode_getinputc = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromrowsnode_getinputc"); + lib3mf_matrixfromrowsnode_getinputd = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromrowsnode_getinputd"); + lib3mf_matrixfromrowsnode_getoutputresult = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromrowsnode_getoutputresult"); + lib3mf_matrixfromcolumnsnode_getinputa = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromcolumnsnode_getinputa"); + lib3mf_matrixfromcolumnsnode_getinputb = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromcolumnsnode_getinputb"); + lib3mf_matrixfromcolumnsnode_getinputc = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromcolumnsnode_getinputc"); + lib3mf_matrixfromcolumnsnode_getinputd = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromcolumnsnode_getinputd"); + lib3mf_matrixfromcolumnsnode_getoutputresult = loadFunctionByLookup(lookupMethod, "lib3mf_matrixfromcolumnsnode_getoutputresult"); + lib3mf_constantnode_setconstant = loadFunctionByLookup(lookupMethod, "lib3mf_constantnode_setconstant"); + lib3mf_constantnode_getconstant = loadFunctionByLookup(lookupMethod, "lib3mf_constantnode_getconstant"); + lib3mf_constantnode_getoutputvalue = loadFunctionByLookup(lookupMethod, "lib3mf_constantnode_getoutputvalue"); + lib3mf_constvecnode_setvector = loadFunctionByLookup(lookupMethod, "lib3mf_constvecnode_setvector"); + lib3mf_constvecnode_getvector = loadFunctionByLookup(lookupMethod, "lib3mf_constvecnode_getvector"); + lib3mf_constvecnode_getoutputvector = loadFunctionByLookup(lookupMethod, "lib3mf_constvecnode_getoutputvector"); + lib3mf_constmatnode_setmatrix = loadFunctionByLookup(lookupMethod, "lib3mf_constmatnode_setmatrix"); + lib3mf_constmatnode_getmatrix = loadFunctionByLookup(lookupMethod, "lib3mf_constmatnode_getmatrix"); + lib3mf_constmatnode_getoutputmatrix = loadFunctionByLookup(lookupMethod, "lib3mf_constmatnode_getoutputmatrix"); + lib3mf_meshnode_getinputmesh = loadFunctionByLookup(lookupMethod, "lib3mf_meshnode_getinputmesh"); + lib3mf_meshnode_getinputpos = loadFunctionByLookup(lookupMethod, "lib3mf_meshnode_getinputpos"); + lib3mf_meshnode_getoutputdistance = loadFunctionByLookup(lookupMethod, "lib3mf_meshnode_getoutputdistance"); + lib3mf_unsignedmeshnode_getinputmesh = loadFunctionByLookup(lookupMethod, "lib3mf_unsignedmeshnode_getinputmesh"); + lib3mf_unsignedmeshnode_getinputpos = loadFunctionByLookup(lookupMethod, "lib3mf_unsignedmeshnode_getinputpos"); + lib3mf_unsignedmeshnode_getoutputdistance = loadFunctionByLookup(lookupMethod, "lib3mf_unsignedmeshnode_getoutputdistance"); + lib3mf_beamlatticenode_getinputbeamlattice = loadFunctionByLookup(lookupMethod, "lib3mf_beamlatticenode_getinputbeamlattice"); + lib3mf_beamlatticenode_getinputpos = loadFunctionByLookup(lookupMethod, "lib3mf_beamlatticenode_getinputpos"); + lib3mf_beamlatticenode_getoutputdistance = loadFunctionByLookup(lookupMethod, "lib3mf_beamlatticenode_getoutputdistance"); + lib3mf_beamlatticenode_setaccuraterange = loadFunctionByLookup(lookupMethod, "lib3mf_beamlatticenode_setaccuraterange"); + lib3mf_beamlatticenode_getaccuraterange = loadFunctionByLookup(lookupMethod, "lib3mf_beamlatticenode_getaccuraterange"); + lib3mf_functiongradientnode_getinputfunctionid = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_getinputfunctionid"); + lib3mf_functiongradientnode_getinputpos = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_getinputpos"); + lib3mf_functiongradientnode_getinputstep = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_getinputstep"); + lib3mf_functiongradientnode_setscalaroutputname = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_setscalaroutputname"); + lib3mf_functiongradientnode_getscalaroutputname = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_getscalaroutputname"); + lib3mf_functiongradientnode_setvectorinputname = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_setvectorinputname"); + lib3mf_functiongradientnode_getvectorinputname = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_getvectorinputname"); + lib3mf_functiongradientnode_getoutputnormalizedgradient = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_getoutputnormalizedgradient"); + lib3mf_functiongradientnode_getoutputgradient = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_getoutputgradient"); + lib3mf_functiongradientnode_getoutputmagnitude = loadFunctionByLookup(lookupMethod, "lib3mf_functiongradientnode_getoutputmagnitude"); + lib3mf_normalizedistancenode_getinputfunctionid = loadFunctionByLookup(lookupMethod, "lib3mf_normalizedistancenode_getinputfunctionid"); + lib3mf_normalizedistancenode_getinputpos = loadFunctionByLookup(lookupMethod, "lib3mf_normalizedistancenode_getinputpos"); + lib3mf_normalizedistancenode_getinputstep = loadFunctionByLookup(lookupMethod, "lib3mf_normalizedistancenode_getinputstep"); + lib3mf_normalizedistancenode_setscalaroutputname = loadFunctionByLookup(lookupMethod, "lib3mf_normalizedistancenode_setscalaroutputname"); + lib3mf_normalizedistancenode_getscalaroutputname = loadFunctionByLookup(lookupMethod, "lib3mf_normalizedistancenode_getscalaroutputname"); + lib3mf_normalizedistancenode_setvectorinputname = loadFunctionByLookup(lookupMethod, "lib3mf_normalizedistancenode_setvectorinputname"); + lib3mf_normalizedistancenode_getvectorinputname = loadFunctionByLookup(lookupMethod, "lib3mf_normalizedistancenode_getvectorinputname"); + lib3mf_normalizedistancenode_getoutputresult = loadFunctionByLookup(lookupMethod, "lib3mf_normalizedistancenode_getoutputresult"); + lib3mf_functioncallnode_getinputfunctionid = loadFunctionByLookup(lookupMethod, "lib3mf_functioncallnode_getinputfunctionid"); + lib3mf_nodeiterator_getcurrent = loadFunctionByLookup(lookupMethod, "lib3mf_nodeiterator_getcurrent"); + lib3mf_function_getdisplayname = loadFunctionByLookup(lookupMethod, "lib3mf_function_getdisplayname"); + lib3mf_function_setdisplayname = loadFunctionByLookup(lookupMethod, "lib3mf_function_setdisplayname"); + lib3mf_function_addinput = loadFunctionByLookup(lookupMethod, "lib3mf_function_addinput"); + lib3mf_function_getinputs = loadFunctionByLookup(lookupMethod, "lib3mf_function_getinputs"); + lib3mf_function_removeinput = loadFunctionByLookup(lookupMethod, "lib3mf_function_removeinput"); + lib3mf_function_addoutput = loadFunctionByLookup(lookupMethod, "lib3mf_function_addoutput"); + lib3mf_function_getoutputs = loadFunctionByLookup(lookupMethod, "lib3mf_function_getoutputs"); + lib3mf_function_removeoutput = loadFunctionByLookup(lookupMethod, "lib3mf_function_removeoutput"); + lib3mf_function_findinput = loadFunctionByLookup(lookupMethod, "lib3mf_function_findinput"); + lib3mf_function_findoutput = loadFunctionByLookup(lookupMethod, "lib3mf_function_findoutput"); + lib3mf_implicitfunction_getidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_getidentifier"); + lib3mf_implicitfunction_setidentifier = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_setidentifier"); + lib3mf_implicitfunction_addnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addnode"); + lib3mf_implicitfunction_addsinnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addsinnode"); + lib3mf_implicitfunction_addcosnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addcosnode"); + lib3mf_implicitfunction_addtannode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addtannode"); + lib3mf_implicitfunction_addarcsinnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addarcsinnode"); + lib3mf_implicitfunction_addarccosnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addarccosnode"); + lib3mf_implicitfunction_addarctan2node = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addarctan2node"); + lib3mf_implicitfunction_addsinhnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addsinhnode"); + lib3mf_implicitfunction_addcoshnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addcoshnode"); + lib3mf_implicitfunction_addtanhnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addtanhnode"); + lib3mf_implicitfunction_addroundnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addroundnode"); + lib3mf_implicitfunction_addceilnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addceilnode"); + lib3mf_implicitfunction_addfloornode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addfloornode"); + lib3mf_implicitfunction_addsignnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addsignnode"); + lib3mf_implicitfunction_addfractnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addfractnode"); + lib3mf_implicitfunction_addabsnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addabsnode"); + lib3mf_implicitfunction_addexpnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addexpnode"); + lib3mf_implicitfunction_addlognode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addlognode"); + lib3mf_implicitfunction_addlog2node = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addlog2node"); + lib3mf_implicitfunction_addlog10node = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addlog10node"); + lib3mf_implicitfunction_addlengthnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addlengthnode"); + lib3mf_implicitfunction_addtransposenode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addtransposenode"); + lib3mf_implicitfunction_addinversenode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addinversenode"); + lib3mf_implicitfunction_addsqrtnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addsqrtnode"); + lib3mf_implicitfunction_addresourceidnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addresourceidnode"); + lib3mf_implicitfunction_addadditionnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addadditionnode"); + lib3mf_implicitfunction_addsubtractionnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addsubtractionnode"); + lib3mf_implicitfunction_addmultiplicationnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addmultiplicationnode"); + lib3mf_implicitfunction_adddivisionnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_adddivisionnode"); + lib3mf_implicitfunction_adddotnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_adddotnode"); + lib3mf_implicitfunction_addcrossnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addcrossnode"); + lib3mf_implicitfunction_addmatvecmultiplicationnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addmatvecmultiplicationnode"); + lib3mf_implicitfunction_addminnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addminnode"); + lib3mf_implicitfunction_addmaxnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addmaxnode"); + lib3mf_implicitfunction_addfmodnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addfmodnode"); + lib3mf_implicitfunction_addpownode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addpownode"); + lib3mf_implicitfunction_addselectnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addselectnode"); + lib3mf_implicitfunction_addclampnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addclampnode"); + lib3mf_implicitfunction_addcomposevectornode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addcomposevectornode"); + lib3mf_implicitfunction_addvectorfromscalarnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addvectorfromscalarnode"); + lib3mf_implicitfunction_adddecomposevectornode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_adddecomposevectornode"); + lib3mf_implicitfunction_addcomposematrixnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addcomposematrixnode"); + lib3mf_implicitfunction_addmatrixfromrowsnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addmatrixfromrowsnode"); + lib3mf_implicitfunction_addmatrixfromcolumnsnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addmatrixfromcolumnsnode"); + lib3mf_implicitfunction_addconstantnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addconstantnode"); + lib3mf_implicitfunction_addconstvecnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addconstvecnode"); + lib3mf_implicitfunction_addconstmatnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addconstmatnode"); + lib3mf_implicitfunction_addmeshnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addmeshnode"); + lib3mf_implicitfunction_addunsignedmeshnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addunsignedmeshnode"); + lib3mf_implicitfunction_addbeamlatticenode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addbeamlatticenode"); + lib3mf_implicitfunction_addfunctiongradientnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addfunctiongradientnode"); + lib3mf_implicitfunction_addnormalizedistancenode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addnormalizedistancenode"); + lib3mf_implicitfunction_addfunctioncallnode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addfunctioncallnode"); + lib3mf_implicitfunction_getnodes = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_getnodes"); + lib3mf_implicitfunction_removenode = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_removenode"); + lib3mf_implicitfunction_addlink = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addlink"); + lib3mf_implicitfunction_addlinkbynames = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_addlinkbynames"); + lib3mf_implicitfunction_clear = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_clear"); + lib3mf_implicitfunction_sortnodestopologically = loadFunctionByLookup(lookupMethod, "lib3mf_implicitfunction_sortnodestopologically"); + lib3mf_functionfromimage3d_getimage3d = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_getimage3d"); + lib3mf_functionfromimage3d_setimage3d = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_setimage3d"); + lib3mf_functionfromimage3d_setfilter = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_setfilter"); + lib3mf_functionfromimage3d_getfilter = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_getfilter"); + lib3mf_functionfromimage3d_settilestyles = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_settilestyles"); + lib3mf_functionfromimage3d_gettilestyles = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_gettilestyles"); + lib3mf_functionfromimage3d_getoffset = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_getoffset"); + lib3mf_functionfromimage3d_setoffset = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_setoffset"); + lib3mf_functionfromimage3d_getscale = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_getscale"); + lib3mf_functionfromimage3d_setscale = loadFunctionByLookup(lookupMethod, "lib3mf_functionfromimage3d_setscale"); + lib3mf_builditem_getobjectresource = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_getobjectresource"); + lib3mf_builditem_getuuid = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_getuuid"); + lib3mf_builditem_setuuid = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_setuuid"); + lib3mf_builditem_getobjectresourceid = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_getobjectresourceid"); + lib3mf_builditem_hasobjecttransform = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_hasobjecttransform"); + lib3mf_builditem_getobjecttransform = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_getobjecttransform"); + lib3mf_builditem_setobjecttransform = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_setobjecttransform"); + lib3mf_builditem_getpartnumber = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_getpartnumber"); + lib3mf_builditem_setpartnumber = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_setpartnumber"); + lib3mf_builditem_getmetadatagroup = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_getmetadatagroup"); + lib3mf_builditem_getoutbox = loadFunctionByLookup(lookupMethod, "lib3mf_builditem_getoutbox"); + lib3mf_builditemiterator_movenext = loadFunctionByLookup(lookupMethod, "lib3mf_builditemiterator_movenext"); + lib3mf_builditemiterator_moveprevious = loadFunctionByLookup(lookupMethod, "lib3mf_builditemiterator_moveprevious"); + lib3mf_builditemiterator_getcurrent = loadFunctionByLookup(lookupMethod, "lib3mf_builditemiterator_getcurrent"); + lib3mf_builditemiterator_clone = loadFunctionByLookup(lookupMethod, "lib3mf_builditemiterator_clone"); + lib3mf_builditemiterator_count = loadFunctionByLookup(lookupMethod, "lib3mf_builditemiterator_count"); + lib3mf_slice_setvertices = loadFunctionByLookup(lookupMethod, "lib3mf_slice_setvertices"); + lib3mf_slice_getvertices = loadFunctionByLookup(lookupMethod, "lib3mf_slice_getvertices"); + lib3mf_slice_getvertexcount = loadFunctionByLookup(lookupMethod, "lib3mf_slice_getvertexcount"); + lib3mf_slice_addpolygon = loadFunctionByLookup(lookupMethod, "lib3mf_slice_addpolygon"); + lib3mf_slice_getpolygoncount = loadFunctionByLookup(lookupMethod, "lib3mf_slice_getpolygoncount"); + lib3mf_slice_setpolygonindices = loadFunctionByLookup(lookupMethod, "lib3mf_slice_setpolygonindices"); + lib3mf_slice_getpolygonindices = loadFunctionByLookup(lookupMethod, "lib3mf_slice_getpolygonindices"); + lib3mf_slice_getpolygonindexcount = loadFunctionByLookup(lookupMethod, "lib3mf_slice_getpolygonindexcount"); + lib3mf_slice_getztop = loadFunctionByLookup(lookupMethod, "lib3mf_slice_getztop"); + lib3mf_slicestack_getbottomz = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_getbottomz"); + lib3mf_slicestack_getslicecount = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_getslicecount"); + lib3mf_slicestack_getslice = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_getslice"); + lib3mf_slicestack_addslice = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_addslice"); + lib3mf_slicestack_getslicerefcount = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_getslicerefcount"); + lib3mf_slicestack_addslicestackreference = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_addslicestackreference"); + lib3mf_slicestack_getslicestackreference = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_getslicestackreference"); + lib3mf_slicestack_collapseslicereferences = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_collapseslicereferences"); + lib3mf_slicestack_setownpath = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_setownpath"); + lib3mf_slicestack_getownpath = loadFunctionByLookup(lookupMethod, "lib3mf_slicestack_getownpath"); + lib3mf_consumer_getconsumerid = loadFunctionByLookup(lookupMethod, "lib3mf_consumer_getconsumerid"); + lib3mf_consumer_getkeyid = loadFunctionByLookup(lookupMethod, "lib3mf_consumer_getkeyid"); + lib3mf_consumer_getkeyvalue = loadFunctionByLookup(lookupMethod, "lib3mf_consumer_getkeyvalue"); + lib3mf_accessright_getconsumer = loadFunctionByLookup(lookupMethod, "lib3mf_accessright_getconsumer"); + lib3mf_accessright_getwrappingalgorithm = loadFunctionByLookup(lookupMethod, "lib3mf_accessright_getwrappingalgorithm"); + lib3mf_accessright_getmgfalgorithm = loadFunctionByLookup(lookupMethod, "lib3mf_accessright_getmgfalgorithm"); + lib3mf_accessright_getdigestmethod = loadFunctionByLookup(lookupMethod, "lib3mf_accessright_getdigestmethod"); + lib3mf_contentencryptionparams_getencryptionalgorithm = loadFunctionByLookup(lookupMethod, "lib3mf_contentencryptionparams_getencryptionalgorithm"); + lib3mf_contentencryptionparams_getkey = loadFunctionByLookup(lookupMethod, "lib3mf_contentencryptionparams_getkey"); + lib3mf_contentencryptionparams_getinitializationvector = loadFunctionByLookup(lookupMethod, "lib3mf_contentencryptionparams_getinitializationvector"); + lib3mf_contentencryptionparams_getauthenticationtag = loadFunctionByLookup(lookupMethod, "lib3mf_contentencryptionparams_getauthenticationtag"); + lib3mf_contentencryptionparams_setauthenticationtag = loadFunctionByLookup(lookupMethod, "lib3mf_contentencryptionparams_setauthenticationtag"); + lib3mf_contentencryptionparams_getadditionalauthenticationdata = loadFunctionByLookup(lookupMethod, "lib3mf_contentencryptionparams_getadditionalauthenticationdata"); + lib3mf_contentencryptionparams_getdescriptor = loadFunctionByLookup(lookupMethod, "lib3mf_contentencryptionparams_getdescriptor"); + lib3mf_contentencryptionparams_getkeyuuid = loadFunctionByLookup(lookupMethod, "lib3mf_contentencryptionparams_getkeyuuid"); + lib3mf_resourcedata_getpath = loadFunctionByLookup(lookupMethod, "lib3mf_resourcedata_getpath"); + lib3mf_resourcedata_getencryptionalgorithm = loadFunctionByLookup(lookupMethod, "lib3mf_resourcedata_getencryptionalgorithm"); + lib3mf_resourcedata_getcompression = loadFunctionByLookup(lookupMethod, "lib3mf_resourcedata_getcompression"); + lib3mf_resourcedata_getadditionalauthenticationdata = loadFunctionByLookup(lookupMethod, "lib3mf_resourcedata_getadditionalauthenticationdata"); + lib3mf_resourcedatagroup_getkeyuuid = loadFunctionByLookup(lookupMethod, "lib3mf_resourcedatagroup_getkeyuuid"); + lib3mf_resourcedatagroup_addaccessright = loadFunctionByLookup(lookupMethod, "lib3mf_resourcedatagroup_addaccessright"); + lib3mf_resourcedatagroup_findaccessrightbyconsumer = loadFunctionByLookup(lookupMethod, "lib3mf_resourcedatagroup_findaccessrightbyconsumer"); + lib3mf_resourcedatagroup_removeaccessright = loadFunctionByLookup(lookupMethod, "lib3mf_resourcedatagroup_removeaccessright"); + lib3mf_keystore_addconsumer = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_addconsumer"); + lib3mf_keystore_getconsumercount = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_getconsumercount"); + lib3mf_keystore_getconsumer = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_getconsumer"); + lib3mf_keystore_removeconsumer = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_removeconsumer"); + lib3mf_keystore_findconsumer = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_findconsumer"); + lib3mf_keystore_getresourcedatagroupcount = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_getresourcedatagroupcount"); + lib3mf_keystore_addresourcedatagroup = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_addresourcedatagroup"); + lib3mf_keystore_getresourcedatagroup = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_getresourcedatagroup"); + lib3mf_keystore_removeresourcedatagroup = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_removeresourcedatagroup"); + lib3mf_keystore_findresourcedatagroup = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_findresourcedatagroup"); + lib3mf_keystore_addresourcedata = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_addresourcedata"); + lib3mf_keystore_removeresourcedata = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_removeresourcedata"); + lib3mf_keystore_findresourcedata = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_findresourcedata"); + lib3mf_keystore_getresourcedatacount = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_getresourcedatacount"); + lib3mf_keystore_getresourcedata = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_getresourcedata"); + lib3mf_keystore_getuuid = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_getuuid"); + lib3mf_keystore_setuuid = loadFunctionByLookup(lookupMethod, "lib3mf_keystore_setuuid"); + lib3mf_model_rootmodelpart = loadFunctionByLookup(lookupMethod, "lib3mf_model_rootmodelpart"); + lib3mf_model_findorcreatepackagepart = loadFunctionByLookup(lookupMethod, "lib3mf_model_findorcreatepackagepart"); + lib3mf_model_setunit = loadFunctionByLookup(lookupMethod, "lib3mf_model_setunit"); + lib3mf_model_getunit = loadFunctionByLookup(lookupMethod, "lib3mf_model_getunit"); + lib3mf_model_getlanguage = loadFunctionByLookup(lookupMethod, "lib3mf_model_getlanguage"); + lib3mf_model_setlanguage = loadFunctionByLookup(lookupMethod, "lib3mf_model_setlanguage"); + lib3mf_model_querywriter = loadFunctionByLookup(lookupMethod, "lib3mf_model_querywriter"); + lib3mf_model_queryreader = loadFunctionByLookup(lookupMethod, "lib3mf_model_queryreader"); + lib3mf_model_getresourcebyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getresourcebyid"); + lib3mf_model_gettexture2dbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_gettexture2dbyid"); + lib3mf_model_getpropertytypebyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getpropertytypebyid"); + lib3mf_model_getbasematerialgroupbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getbasematerialgroupbyid"); + lib3mf_model_gettexture2dgroupbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_gettexture2dgroupbyid"); + lib3mf_model_getcompositematerialsbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getcompositematerialsbyid"); + lib3mf_model_getmultipropertygroupbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getmultipropertygroupbyid"); + lib3mf_model_getmeshobjectbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getmeshobjectbyid"); + lib3mf_model_getcomponentsobjectbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getcomponentsobjectbyid"); + lib3mf_model_getbooleanobjectbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getbooleanobjectbyid"); + lib3mf_model_getcolorgroupbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getcolorgroupbyid"); + lib3mf_model_getslicestackbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getslicestackbyid"); + lib3mf_model_getlevelsetbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getlevelsetbyid"); + lib3mf_model_getbuilduuid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getbuilduuid"); + lib3mf_model_setbuilduuid = loadFunctionByLookup(lookupMethod, "lib3mf_model_setbuilduuid"); + lib3mf_model_getbuilditems = loadFunctionByLookup(lookupMethod, "lib3mf_model_getbuilditems"); + lib3mf_model_getoutbox = loadFunctionByLookup(lookupMethod, "lib3mf_model_getoutbox"); + lib3mf_model_getresources = loadFunctionByLookup(lookupMethod, "lib3mf_model_getresources"); + lib3mf_model_getobjects = loadFunctionByLookup(lookupMethod, "lib3mf_model_getobjects"); + lib3mf_model_getmeshobjects = loadFunctionByLookup(lookupMethod, "lib3mf_model_getmeshobjects"); + lib3mf_model_getcomponentsobjects = loadFunctionByLookup(lookupMethod, "lib3mf_model_getcomponentsobjects"); + lib3mf_model_getbooleanobjects = loadFunctionByLookup(lookupMethod, "lib3mf_model_getbooleanobjects"); + lib3mf_model_gettexture2ds = loadFunctionByLookup(lookupMethod, "lib3mf_model_gettexture2ds"); + lib3mf_model_getbasematerialgroups = loadFunctionByLookup(lookupMethod, "lib3mf_model_getbasematerialgroups"); + lib3mf_model_getcolorgroups = loadFunctionByLookup(lookupMethod, "lib3mf_model_getcolorgroups"); + lib3mf_model_gettexture2dgroups = loadFunctionByLookup(lookupMethod, "lib3mf_model_gettexture2dgroups"); + lib3mf_model_getcompositematerials = loadFunctionByLookup(lookupMethod, "lib3mf_model_getcompositematerials"); + lib3mf_model_getmultipropertygroups = loadFunctionByLookup(lookupMethod, "lib3mf_model_getmultipropertygroups"); + lib3mf_model_getslicestacks = loadFunctionByLookup(lookupMethod, "lib3mf_model_getslicestacks"); + lib3mf_model_getimage3ds = loadFunctionByLookup(lookupMethod, "lib3mf_model_getimage3ds"); + lib3mf_model_mergetomodel = loadFunctionByLookup(lookupMethod, "lib3mf_model_mergetomodel"); + lib3mf_model_mergefrommodel = loadFunctionByLookup(lookupMethod, "lib3mf_model_mergefrommodel"); + lib3mf_model_addmeshobject = loadFunctionByLookup(lookupMethod, "lib3mf_model_addmeshobject"); + lib3mf_model_addcomponentsobject = loadFunctionByLookup(lookupMethod, "lib3mf_model_addcomponentsobject"); + lib3mf_model_addbooleanobject = loadFunctionByLookup(lookupMethod, "lib3mf_model_addbooleanobject"); + lib3mf_model_addslicestack = loadFunctionByLookup(lookupMethod, "lib3mf_model_addslicestack"); + lib3mf_model_addtexture2dfromattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_addtexture2dfromattachment"); + lib3mf_model_addbasematerialgroup = loadFunctionByLookup(lookupMethod, "lib3mf_model_addbasematerialgroup"); + lib3mf_model_addcolorgroup = loadFunctionByLookup(lookupMethod, "lib3mf_model_addcolorgroup"); + lib3mf_model_addtexture2dgroup = loadFunctionByLookup(lookupMethod, "lib3mf_model_addtexture2dgroup"); + lib3mf_model_addcompositematerials = loadFunctionByLookup(lookupMethod, "lib3mf_model_addcompositematerials"); + lib3mf_model_addmultipropertygroup = loadFunctionByLookup(lookupMethod, "lib3mf_model_addmultipropertygroup"); + lib3mf_model_addimagestack = loadFunctionByLookup(lookupMethod, "lib3mf_model_addimagestack"); + lib3mf_model_getimagestackbyid = loadFunctionByLookup(lookupMethod, "lib3mf_model_getimagestackbyid"); + lib3mf_model_addbuilditem = loadFunctionByLookup(lookupMethod, "lib3mf_model_addbuilditem"); + lib3mf_model_removebuilditem = loadFunctionByLookup(lookupMethod, "lib3mf_model_removebuilditem"); + lib3mf_model_getmetadatagroup = loadFunctionByLookup(lookupMethod, "lib3mf_model_getmetadatagroup"); + lib3mf_model_addattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_addattachment"); + lib3mf_model_removeattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_removeattachment"); + lib3mf_model_getattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_getattachment"); + lib3mf_model_findattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_findattachment"); + lib3mf_model_getattachmentcount = loadFunctionByLookup(lookupMethod, "lib3mf_model_getattachmentcount"); + lib3mf_model_haspackagethumbnailattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_haspackagethumbnailattachment"); + lib3mf_model_createpackagethumbnailattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_createpackagethumbnailattachment"); + lib3mf_model_getpackagethumbnailattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_getpackagethumbnailattachment"); + lib3mf_model_removepackagethumbnailattachment = loadFunctionByLookup(lookupMethod, "lib3mf_model_removepackagethumbnailattachment"); + lib3mf_model_addcustomcontenttype = loadFunctionByLookup(lookupMethod, "lib3mf_model_addcustomcontenttype"); + lib3mf_model_removecustomcontenttype = loadFunctionByLookup(lookupMethod, "lib3mf_model_removecustomcontenttype"); + lib3mf_model_setrandomnumbercallback = loadFunctionByLookup(lookupMethod, "lib3mf_model_setrandomnumbercallback"); + lib3mf_model_getkeystore = loadFunctionByLookup(lookupMethod, "lib3mf_model_getkeystore"); + lib3mf_model_getfunctions = loadFunctionByLookup(lookupMethod, "lib3mf_model_getfunctions"); + lib3mf_model_addimplicitfunction = loadFunctionByLookup(lookupMethod, "lib3mf_model_addimplicitfunction"); + lib3mf_model_addfunctionfromimage3d = loadFunctionByLookup(lookupMethod, "lib3mf_model_addfunctionfromimage3d"); + lib3mf_model_addvolumedata = loadFunctionByLookup(lookupMethod, "lib3mf_model_addvolumedata"); + lib3mf_model_addlevelset = loadFunctionByLookup(lookupMethod, "lib3mf_model_addlevelset"); + lib3mf_model_getlevelsets = loadFunctionByLookup(lookupMethod, "lib3mf_model_getlevelsets"); + lib3mf_model_removeresource = loadFunctionByLookup(lookupMethod, "lib3mf_model_removeresource"); + } + + protected void checkError(Base instance, int errorCode) throws Lib3MFException { + if (instance != null && instance.mWrapper != this) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDCAST, "invalid wrapper call"); + } + if (errorCode != Lib3MFException.LIB3MF_SUCCESS) { + if (instance != null) { + GetLastErrorResult result = getLastError(instance); + throw new Lib3MFException(errorCode, result.LastErrorString); + } else { + throw new Lib3MFException(errorCode, ""); + } + } + } + + private com.sun.jna.Function loadFunctionByLookup(com.sun.jna.Function lookupMethod, String functionName) throws Lib3MFException { + byte[] bytes = functionName.getBytes(StandardCharsets.UTF_8); + Memory name = new Memory(bytes.length+1); + name.write(0, bytes, 0, bytes.length); + name.setByte(bytes.length, (byte)0); + Pointer address = new Memory(8); + java.lang.Object[] addressParam = new java.lang.Object[]{name, address}; + checkError(null, lookupMethod.invokeInt(addressParam)); + return com.sun.jna.Function.getFunction(address.getPointer(0)); + } + + /** + * retrieves the binary version of this library. + * + * @return GetLibraryVersion Result Tuple + * @throws Lib3MFException + */ + public GetLibraryVersionResult getLibraryVersion() throws Lib3MFException { + Pointer bufferMajor = new Memory(4); + Pointer bufferMinor = new Memory(4); + Pointer bufferMicro = new Memory(4); + checkError(null, lib3mf_getlibraryversion.invokeInt(new java.lang.Object[]{bufferMajor, bufferMinor, bufferMicro})); + GetLibraryVersionResult returnTuple = new GetLibraryVersionResult(); + returnTuple.Major = bufferMajor.getInt(0); + returnTuple.Minor = bufferMinor.getInt(0); + returnTuple.Micro = bufferMicro.getInt(0); + return returnTuple; + } + + public static class GetLibraryVersionResult { + /** + * returns the major version of this library + */ + public int Major; + + /** + * returns the minor version of this library + */ + public int Minor; + + /** + * returns the micro version of this library + */ + public int Micro; + + } + /** + * retrieves prerelease information of this library. + * + * @return GetPrereleaseInformation Result Tuple + * @throws Lib3MFException + */ + public GetPrereleaseInformationResult getPrereleaseInformation() throws Lib3MFException { + Pointer bufferHasPrereleaseInfo = new Memory(1); + Pointer bytesNeededPrereleaseInfo = new Memory(4); + checkError(null, lib3mf_getprereleaseinformation.invokeInt(new java.lang.Object[]{bufferHasPrereleaseInfo, 0, bytesNeededPrereleaseInfo, null})); + int sizePrereleaseInfo = bytesNeededPrereleaseInfo.getInt(0); + Pointer bufferPrereleaseInfo = new Memory(sizePrereleaseInfo); + checkError(null, lib3mf_getprereleaseinformation.invokeInt(new java.lang.Object[]{bufferHasPrereleaseInfo, sizePrereleaseInfo, bytesNeededPrereleaseInfo, bufferPrereleaseInfo})); + GetPrereleaseInformationResult returnTuple = new GetPrereleaseInformationResult(); + returnTuple.HasPrereleaseInfo = bufferHasPrereleaseInfo.getByte(0) != 0; + returnTuple.PrereleaseInfo = new String(bufferPrereleaseInfo.getByteArray(0, sizePrereleaseInfo - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetPrereleaseInformationResult { + /** + * Does the library provide prerelease version? + */ + public boolean HasPrereleaseInfo; + + /** + * retrieves prerelease information of this library. + */ + public String PrereleaseInfo; + + } + /** + * retrieves build information of this library. + * + * @return GetBuildInformation Result Tuple + * @throws Lib3MFException + */ + public GetBuildInformationResult getBuildInformation() throws Lib3MFException { + Pointer bufferHasBuildInfo = new Memory(1); + Pointer bytesNeededBuildInformation = new Memory(4); + checkError(null, lib3mf_getbuildinformation.invokeInt(new java.lang.Object[]{bufferHasBuildInfo, 0, bytesNeededBuildInformation, null})); + int sizeBuildInformation = bytesNeededBuildInformation.getInt(0); + Pointer bufferBuildInformation = new Memory(sizeBuildInformation); + checkError(null, lib3mf_getbuildinformation.invokeInt(new java.lang.Object[]{bufferHasBuildInfo, sizeBuildInformation, bytesNeededBuildInformation, bufferBuildInformation})); + GetBuildInformationResult returnTuple = new GetBuildInformationResult(); + returnTuple.HasBuildInfo = bufferHasBuildInfo.getByte(0) != 0; + returnTuple.BuildInformation = new String(bufferBuildInformation.getByteArray(0, sizeBuildInformation - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetBuildInformationResult { + /** + * Does the library provide build version? + */ + public boolean HasBuildInfo; + + /** + * retrieves build information of this library. + */ + public String BuildInformation; + + } + /** + * retrieves whether a specification is supported, and if so, which version. + * + * @param specificationURL URL of extension to check + * @return GetSpecificationVersion Result Tuple + * @throws Lib3MFException + */ + public GetSpecificationVersionResult getSpecificationVersion(String specificationURL) throws Lib3MFException { + byte[] bytesSpecificationURL = specificationURL.getBytes(StandardCharsets.UTF_8); + Memory bufferSpecificationURL = new Memory(bytesSpecificationURL.length + 1); + bufferSpecificationURL.write(0, bytesSpecificationURL, 0, bytesSpecificationURL.length); + bufferSpecificationURL.setByte(bytesSpecificationURL.length, (byte)0); + Pointer bufferIsSupported = new Memory(1); + Pointer bufferMajor = new Memory(4); + Pointer bufferMinor = new Memory(4); + Pointer bufferMicro = new Memory(4); + checkError(null, lib3mf_getspecificationversion.invokeInt(new java.lang.Object[]{bufferSpecificationURL, bufferIsSupported, bufferMajor, bufferMinor, bufferMicro})); + GetSpecificationVersionResult returnTuple = new GetSpecificationVersionResult(); + returnTuple.IsSupported = bufferIsSupported.getByte(0) != 0; + returnTuple.Major = bufferMajor.getInt(0); + returnTuple.Minor = bufferMinor.getInt(0); + returnTuple.Micro = bufferMicro.getInt(0); + return returnTuple; + } + + public static class GetSpecificationVersionResult { + /** + * returns whether this specification is supported + */ + public boolean IsSupported; + + /** + * returns the major version of the extension (if IsSupported) + */ + public int Major; + + /** + * returns the minor version of the extension (if IsSupported) + */ + public int Minor; + + /** + * returns the micro version of the extension (if IsSupported) + */ + public int Micro; + + } + /** + * creates an empty model instance. + * + * @return returns an empty model instance + * @throws Lib3MFException + */ + public Model createModel() throws Lib3MFException { + Pointer bufferModel = new Memory(8); + checkError(null, lib3mf_createmodel.invokeInt(new java.lang.Object[]{bufferModel})); + Pointer valueModel = bufferModel.getPointer(0); + Model model = null; + if (valueModel == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Model was a null pointer"); + } + model = this.PolymorphicFactory(valueModel, Model.class); + return model; + } + + /** + * releases shared ownership of an object instance + * + * @param instance the object instance to release + * @throws Lib3MFException + */ + public void release(Base instance) throws Lib3MFException { + Pointer instanceHandle = null; + if (instance != null) { + instanceHandle = instance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Instance is a null value."); + } + checkError(null, lib3mf_release.invokeInt(new java.lang.Object[]{instanceHandle})); + } + + /** + * acquires shared ownership of an object instance + * + * @param instance the object instance to acquire + * @throws Lib3MFException + */ + public void acquire(Base instance) throws Lib3MFException { + Pointer instanceHandle = null; + if (instance != null) { + instanceHandle = instance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Instance is a null value."); + } + checkError(null, lib3mf_acquire.invokeInt(new java.lang.Object[]{instanceHandle})); + } + + /** + * Sets the journal file path + * + * @param journalPath File name of the journal file + * @throws Lib3MFException + */ + public void setJournal(String journalPath) throws Lib3MFException { + byte[] bytesJournalPath = journalPath.getBytes(StandardCharsets.UTF_8); + Memory bufferJournalPath = new Memory(bytesJournalPath.length + 1); + bufferJournalPath.write(0, bytesJournalPath, 0, bytesJournalPath.length); + bufferJournalPath.setByte(bytesJournalPath.length, (byte)0); + checkError(null, lib3mf_setjournal.invokeInt(new java.lang.Object[]{bufferJournalPath})); + } + + /** + * Retrieves the last error string of an instance + * + * @param instance Object where the error occured. + * @return GetLastError Result Tuple + * @throws Lib3MFException + */ + public GetLastErrorResult getLastError(Base instance) throws Lib3MFException { + Pointer instanceHandle = null; + if (instance != null) { + instanceHandle = instance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Instance is a null value."); + } + Pointer bytesNeededLastErrorString = new Memory(4); + Pointer bufferHasLastError = new Memory(1); + checkError(null, lib3mf_getlasterror.invokeInt(new java.lang.Object[]{instanceHandle, 0, bytesNeededLastErrorString, null, bufferHasLastError})); + int sizeLastErrorString = bytesNeededLastErrorString.getInt(0); + Pointer bufferLastErrorString = new Memory(sizeLastErrorString); + checkError(null, lib3mf_getlasterror.invokeInt(new java.lang.Object[]{instanceHandle, sizeLastErrorString, bytesNeededLastErrorString, bufferLastErrorString, bufferHasLastError})); + GetLastErrorResult returnTuple = new GetLastErrorResult(); + returnTuple.LastErrorString = new String(bufferLastErrorString.getByteArray(0, sizeLastErrorString - 1), StandardCharsets.UTF_8); + returnTuple.HasLastError = bufferHasLastError.getByte(0) != 0; + return returnTuple; + } + + public static class GetLastErrorResult { + /** + * Last Error String + */ + public String LastErrorString; + + /** + * Returns if the instance has a last error. + */ + public boolean HasLastError; + + } + /** + * Returns the address of the SymbolLookupMethod + * + * @return Address of the SymbolAddressMethod + * @throws Lib3MFException + */ + public Pointer getSymbolLookupMethod() throws Lib3MFException { + Pointer bufferSymbolLookupMethod = new Memory(8); + checkError(null, lib3mf_getsymbollookupmethod.invokeInt(new java.lang.Object[]{bufferSymbolLookupMethod})); + return bufferSymbolLookupMethod.getPointer(0); + } + + /** + * Return an English text for a progress identifier.|Note: this is the only function you can call from your callback function. + * + * @param theProgressIdentifier the progress identifier that is passed to the callback function + * @return English text for the progress identifier + * @throws Lib3MFException + */ + public String retrieveProgressMessage(Lib3MFWrapper.ProgressIdentifier theProgressIdentifier) throws Lib3MFException { + Pointer bytesNeededProgressMessage = new Memory(4); + checkError(null, lib3mf_retrieveprogressmessage.invokeInt(new java.lang.Object[]{Lib3MFWrapper.EnumConversion.convertProgressIdentifierToConst(theProgressIdentifier), 0, bytesNeededProgressMessage, null})); + int sizeProgressMessage = bytesNeededProgressMessage.getInt(0); + Pointer bufferProgressMessage = new Memory(sizeProgressMessage); + checkError(null, lib3mf_retrieveprogressmessage.invokeInt(new java.lang.Object[]{Lib3MFWrapper.EnumConversion.convertProgressIdentifierToConst(theProgressIdentifier), sizeProgressMessage, bytesNeededProgressMessage, bufferProgressMessage})); + return new String(bufferProgressMessage.getByteArray(0, sizeProgressMessage - 1), StandardCharsets.UTF_8); + } + + /** + * Creates a Color from uint8 RGBA values + * + * @param red Red value of color (0-255) + * @param green Green value of color (0-255) + * @param blue Blue value of color (0-255) + * @param alpha Alpha value of color (0-255) + * @return Assembled color + * @throws Lib3MFException + */ + public Color rGBAToColor(byte red, byte green, byte blue, byte alpha) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + checkError(null, lib3mf_rgbatocolor.invokeInt(new java.lang.Object[]{red, green, blue, alpha, bufferTheColor})); + Color theColor = new Color(); + theColor.readFromPointer(bufferTheColor, 0); + return theColor; + } + + /** + * Creates a Color from uint8 RGBA values + * + * @param red Red value of color (0-1) + * @param green Green value of color (0-1) + * @param blue Blue value of color (0-1) + * @param alpha Alpha value of color (0-1) + * @return Assembled color + * @throws Lib3MFException + */ + public Color floatRGBAToColor(float red, float green, float blue, float alpha) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + checkError(null, lib3mf_floatrgbatocolor.invokeInt(new java.lang.Object[]{red, green, blue, alpha, bufferTheColor})); + Color theColor = new Color(); + theColor.readFromPointer(bufferTheColor, 0); + return theColor; + } + + /** + * Calculates uint8-RGBA-values from a Color + * + * @param theColor Color to handle + * @return ColorToRGBA Result Tuple + * @throws Lib3MFException + */ + public ColorToRGBAResult colorToRGBA(Color theColor) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + theColor.writeToPointer(bufferTheColor, 0); + Pointer bufferRed = new Memory(1); + Pointer bufferGreen = new Memory(1); + Pointer bufferBlue = new Memory(1); + Pointer bufferAlpha = new Memory(1); + checkError(null, lib3mf_colortorgba.invokeInt(new java.lang.Object[]{bufferTheColor, bufferRed, bufferGreen, bufferBlue, bufferAlpha})); + ColorToRGBAResult returnTuple = new ColorToRGBAResult(); + returnTuple.Red = bufferRed.getByte(0); + returnTuple.Green = bufferGreen.getByte(0); + returnTuple.Blue = bufferBlue.getByte(0); + returnTuple.Alpha = bufferAlpha.getByte(0); + return returnTuple; + } + + public static class ColorToRGBAResult { + /** + * Red value of color (0-255) + */ + public byte Red; + + /** + * Green value of color (0-255) + */ + public byte Green; + + /** + * Blue value of color (0-255) + */ + public byte Blue; + + /** + * Alpha value of color (0-255) + */ + public byte Alpha; + + } + /** + * Calculates float-RGBA-values from a Color + * + * @param theColor Color to handle + * @return ColorToFloatRGBA Result Tuple + * @throws Lib3MFException + */ + public ColorToFloatRGBAResult colorToFloatRGBA(Color theColor) throws Lib3MFException { + Pointer bufferTheColor = new Memory(Color.SIZE); + theColor.writeToPointer(bufferTheColor, 0); + Pointer bufferRed = new Memory(4); + Pointer bufferGreen = new Memory(4); + Pointer bufferBlue = new Memory(4); + Pointer bufferAlpha = new Memory(4); + checkError(null, lib3mf_colortofloatrgba.invokeInt(new java.lang.Object[]{bufferTheColor, bufferRed, bufferGreen, bufferBlue, bufferAlpha})); + ColorToFloatRGBAResult returnTuple = new ColorToFloatRGBAResult(); + returnTuple.Red = bufferRed.getFloat(0); + returnTuple.Green = bufferGreen.getFloat(0); + returnTuple.Blue = bufferBlue.getFloat(0); + returnTuple.Alpha = bufferAlpha.getFloat(0); + return returnTuple; + } + + public static class ColorToFloatRGBAResult { + /** + * Red value of color (0-1) + */ + public float Red; + + /** + * Green value of color (0-1) + */ + public float Green; + + /** + * Blue value of color (0-1) + */ + public float Blue; + + /** + * Alpha value of color (0-1) + */ + public float Alpha; + + } + /** + * Creates an identity transform + * + * @return Transformation matrix. + * @throws Lib3MFException + */ + public Transform getIdentityTransform() throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + checkError(null, lib3mf_getidentitytransform.invokeInt(new java.lang.Object[]{bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * Creates a uniform scale transform + * + * @param factor Factor in X, Y and Z + * @return Transformation matrix. + * @throws Lib3MFException + */ + public Transform getUniformScaleTransform(float factor) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + checkError(null, lib3mf_getuniformscaletransform.invokeInt(new java.lang.Object[]{factor, bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * Creates a scale transform + * + * @param factorX Factor in X + * @param factorY Factor in Y + * @param factorZ Factor in Z + * @return Transformation matrix. + * @throws Lib3MFException + */ + public Transform getScaleTransform(float factorX, float factorY, float factorZ) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + checkError(null, lib3mf_getscaletransform.invokeInt(new java.lang.Object[]{factorX, factorY, factorZ, bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * Creates an translation transform + * + * @param vectorX Translation in X + * @param vectorY Translation in Y + * @param vectorZ Translation in Z + * @return Transformation matrix. + * @throws Lib3MFException + */ + public Transform getTranslationTransform(float vectorX, float vectorY, float vectorZ) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + checkError(null, lib3mf_gettranslationtransform.invokeInt(new java.lang.Object[]{vectorX, vectorY, vectorZ, bufferTransform})); + Transform transform = new Transform(); + transform.readFromPointer(bufferTransform, 0); + return transform; + } + + /** + * IMPORTANT: PolymorphicFactory method should not be used by application directly. + * It's designed to be used on Lib3MFHandle object only once. + * If it's used on any existing object as a form of dynamic cast then + * Lib3MFWrapper::acquireInstance(Base object) must be called after instantiating new object. + * This is important to keep reference count matching between application and library sides. + */ + public T PolymorphicFactory(Pointer handle, Class cls) { + if (handle == Pointer.NULL) + return null; + Class[] cArg = new Class[2]; + cArg[0] = Lib3MFWrapper.class; + cArg[1] = Pointer.class; + + try { + T obj = null; + Pointer bufferClassTypeId = new Memory(8); + checkError(null, lib3mf_base_classtypeid.invokeInt(new java.lang.Object[]{handle, bufferClassTypeId})); + long classTypeId = bufferClassTypeId.getLong(0); + + int msbId = (int)(classTypeId >> 32); + int lsbId = (int)classTypeId; + switch(msbId) { + case 0x0070021D: + switch(lsbId) { + case 0x73AA89FD: obj = (T)(new LogNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::LogNode" + } + break; + case 0x0437E27A: + switch(lsbId) { + case 0xEF740121: obj = (T)(new FunctionGradientNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionGradientNode" + } + break; + case 0x073F9103: + switch(lsbId) { + case 0x81BF250D: obj = (T)(new MaxNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MaxNode" + } + break; + case 0x0765C17C: + switch(lsbId) { + case 0x952F24E3: obj = (T)(new FunctionCallNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionCallNode" + } + break; + case 0x0C3B8536: + switch(lsbId) { + case 0x9E9B25D3: obj = (T)(new MetaDataGroup(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MetaDataGroup" + } + break; + case 0x0DCBEAFC: + switch(lsbId) { + case 0xF83F3AAC: obj = (T)(new MatrixFromColumnsNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MatrixFromColumnsNode" + } + break; + case 0x0E55A826: + switch(lsbId) { + case 0xD377483E: obj = (T)(new PackagePart(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::PackagePart" + } + break; + case 0x0F3A4EE9: + switch(lsbId) { + case 0x8F7FEC0C: obj = (T)(new BeamLatticeNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLatticeNode" + } + break; + case 0x10274A17: + switch(lsbId) { + case 0x57C729C0: obj = (T)(new ColorGroupIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroupIterator" + } + break; + case 0x106182D3: + switch(lsbId) { + case 0x8CA5CFE3: obj = (T)(new CrossNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::CrossNode" + } + break; + case 0x1127ED71: + switch(lsbId) { + case 0xE05A9BD4: obj = (T)(new SelectNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::SelectNode" + } + break; + case 0x13A2561F: + switch(lsbId) { + case 0x0CFB712A: obj = (T)(new ImageStack(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ImageStack" + } + break; + case 0x1A47A5E2: + switch(lsbId) { + case 0x58E22EF9: obj = (T)(new ResourceData(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceData" + } + break; + case 0x1CC9E0CC: + switch(lsbId) { + case 0x082253C6: obj = (T)(new KeyStore(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::KeyStore" + } + break; + case 0x1EF703D2: + switch(lsbId) { + case 0x98223F2A: obj = (T)(new FmodNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::FmodNode" + } + break; + case 0x2198BCF4: + switch(lsbId) { + case 0xD8DF9C40: obj = (T)(new Slice(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Slice" + } + break; + case 0x241FE6B4: + switch(lsbId) { + case 0x817C3FE4: obj = (T)(new MaterialMapping(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MaterialMapping" + } + break; + case 0x2614CC57: + switch(lsbId) { + case 0x2AF350B7: obj = (T)(new TanNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::TanNode" + } + break; + case 0x29985A62: + switch(lsbId) { + case 0x8251A9CD: obj = (T)(new UnsignedMeshNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::UnsignedMeshNode" + } + break; + case 0x2D86831D: + switch(lsbId) { + case 0xA59FBE72: obj = (T)(new Reader(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Reader" + } + break; + case 0x2DA2136F: + switch(lsbId) { + case 0x577A779C: obj = (T)(new Object(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Object" + } + break; + case 0x2E417B93: + switch(lsbId) { + case 0x351375E2: obj = (T)(new VectorFromScalarNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::VectorFromScalarNode" + } + break; + case 0x30CCDBE9: + switch(lsbId) { + case 0x0E00B55B: obj = (T)(new BeamSet(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BeamSet" + } + break; + case 0x30D55F4D: + switch(lsbId) { + case 0xB88FE0CA: obj = (T)(new Texture2DGroupIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroupIterator" + } + break; + case 0x3390243A: + switch(lsbId) { + case 0x8E2410F3: obj = (T)(new ExpNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ExpNode" + } + break; + case 0x385C42FC: + switch(lsbId) { + case 0x5609498A: obj = (T)(new AccessRight(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::AccessRight" + } + break; + case 0x392A0F4C: + switch(lsbId) { + case 0x041D249C: obj = (T)(new FloorNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::FloorNode" + } + break; + case 0x3B3A6DC6: + switch(lsbId) { + case 0xEC610497: obj = (T)(new MeshObject(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObject" + } + break; + case 0x3C7756A4: + switch(lsbId) { + case 0x56F2D089: obj = (T)(new SinhNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::SinhNode" + } + break; + case 0x3F8E5D08: + switch(lsbId) { + case 0x2F966B1B: obj = (T)(new ConstantNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ConstantNode" + } + break; + case 0x40E90353: + switch(lsbId) { + case 0x63ACE65E: obj = (T)(new FunctionIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionIterator" + } + break; + case 0x460F3515: + switch(lsbId) { + case 0xE2621DBE: obj = (T)(new ResourceIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceIterator" + } + break; + case 0x46F1DAC4: + switch(lsbId) { + case 0x0581B304: obj = (T)(new VolumeDataComposite(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::VolumeDataComposite" + } + break; + case 0x49C24B88: + switch(lsbId) { + case 0x40C01F7E: obj = (T)(new ComposeVectorNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ComposeVectorNode" + } + break; + case 0x4A993F91: + switch(lsbId) { + case 0xE1DE256D: obj = (T)(new CoshNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::CoshNode" + } + break; + case 0x4BD32B48: + switch(lsbId) { + case 0x70FFC03B: obj = (T)(new Texture2DIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DIterator" + } + break; + case 0x4DF17E76: + switch(lsbId) { + case 0x926221C2: obj = (T)(new FunctionReference(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionReference" + } + break; + case 0x4ECDB6A6: + switch(lsbId) { + case 0xF69F2BEB: obj = (T)(new Component(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Component" + } + break; + case 0x52F06268: + switch(lsbId) { + case 0xCD098EFE: obj = (T)(new Iterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Iterator" + } + break; + case 0x53601FD4: + switch(lsbId) { + case 0x32E3DEF4: obj = (T)(new MeshNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshNode" + } + break; + case 0x53E62FD6: + switch(lsbId) { + case 0x7F4D9A65: obj = (T)(new FractNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::FractNode" + } + break; + case 0x564DE421: + switch(lsbId) { + case 0x7ED7614A: obj = (T)(new ComponentsObjectIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObjectIterator" + } + break; + case 0x57A22369: + switch(lsbId) { + case 0x98DF5248: obj = (T)(new AdditionNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::AdditionNode" + } + break; + case 0x5950BB3E: + switch(lsbId) { + case 0xE8A82090: obj = (T)(new TriangleSet(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::TriangleSet" + } + break; + case 0x59BC328F: + switch(lsbId) { + case 0x6FB5C5FF: obj = (T)(new CosNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::CosNode" + } + break; + case 0x5A8164EC: + switch(lsbId) { + case 0xEDB03F09: obj = (T)(new Model(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Model" + } + break; + case 0x6079B12F: + switch(lsbId) { + case 0xFF345D02: obj = (T)(new SubtractionNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::SubtractionNode" + } + break; + case 0x627E2116: + switch(lsbId) { + case 0x53E11D93: obj = (T)(new CeilNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::CeilNode" + } + break; + case 0x63B3B461: + switch(lsbId) { + case 0xB30B4BA5: obj = (T)(new BeamLattice(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLattice" + } + break; + case 0x6522CF04: + switch(lsbId) { + case 0xEB283FED: obj = (T)(new ComponentsObject(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObject" + } + break; + case 0x6594B031: + switch(lsbId) { + case 0xB6096238: obj = (T)(new SliceStack(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::SliceStack" + } + break; + case 0x65E6EDD9: + switch(lsbId) { + case 0x362C79CB: obj = (T)(new BaseMaterialGroupIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroupIterator" + } + break; + case 0x68FB2D5F: + switch(lsbId) { + case 0xFC4BA12A: obj = (T)(new BuildItem(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItem" + } + break; + case 0x69684DB9: + switch(lsbId) { + case 0x9FA813F6: obj = (T)(new SliceStackIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::SliceStackIterator" + } + break; + case 0x6B641C70: + switch(lsbId) { + case 0x60040BE3: obj = (T)(new AbsNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::AbsNode" + } + break; + case 0x6CE54469: + switch(lsbId) { + case 0xEEA83BC1: obj = (T)(new ImplicitFunction(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ImplicitFunction" + } + break; + case 0x7570C43B: + switch(lsbId) { + case 0x9721D0C0: obj = (T)(new MatVecMultiplicationNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MatVecMultiplicationNode" + } + break; + case 0x7700AA17: + switch(lsbId) { + case 0xCA1AC0F8: obj = (T)(new PowNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::PowNode" + } + break; + case 0x77AF68C9: + switch(lsbId) { + case 0x71B1485F: obj = (T)(new ClampNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ClampNode" + } + break; + case 0x7DE3951B: + switch(lsbId) { + case 0xA4C1064C: obj = (T)(new TwoInputNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::TwoInputNode" + } + break; + case 0x7FB36B91: + switch(lsbId) { + case 0xD4CE4671: obj = (T)(new ContentEncryptionParams(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ContentEncryptionParams" + } + break; + case 0x817D2E56: + switch(lsbId) { + case 0x6E73AA8F: obj = (T)(new NormalizeDistanceNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::NormalizeDistanceNode" + } + break; + case 0x846AFDE9: + switch(lsbId) { + case 0xA091E997: obj = (T)(new MinNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MinNode" + } + break; + case 0x856632D0: + switch(lsbId) { + case 0xBAF1D8B7: obj = (T)(new Base(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Base" + } + break; + case 0x85FA0E88: + switch(lsbId) { + case 0x06B6C357: obj = (T)(new BooleanObject(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BooleanObject" + } + break; + case 0x87740AD5: + switch(lsbId) { + case 0x3454E0DF: obj = (T)(new Log10Node(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Log10Node" + } + break; + case 0x8A45165E: + switch(lsbId) { + case 0x6C9646D7: obj = (T)(new SignNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::SignNode" + } + break; + case 0x8CE7A119: + switch(lsbId) { + case 0x1A63A35D: obj = (T)(new Attachment(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Attachment" + } + break; + case 0x9200586F: + switch(lsbId) { + case 0xB91587A7: obj = (T)(new VolumeData(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::VolumeData" + } + break; + case 0x943AF6AE: + switch(lsbId) { + case 0x0EFD2B8A: obj = (T)(new ArcCosNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ArcCosNode" + } + break; + case 0x9BD7D3C2: + switch(lsbId) { + case 0x026B8CE8: obj = (T)(new FunctionFromImage3D(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionFromImage3D" + } + break; + case 0x9C9363B3: + switch(lsbId) { + case 0xF708D556: obj = (T)(new ConstVecNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ConstVecNode" + } + break; + case 0x9EF9EB54: + switch(lsbId) { + case 0xA53AA40D: obj = (T)(new ComposeMatrixNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ComposeMatrixNode" + } + break; + case 0x9EFB2757: + switch(lsbId) { + case 0xCA1A5231: obj = (T)(new Function(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Function" + } + break; + case 0x9F831944: + switch(lsbId) { + case 0xA3DE31DA: obj = (T)(new SqrtNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::SqrtNode" + } + break; + case 0xA0C005C0: + switch(lsbId) { + case 0x35D5371D: obj = (T)(new LevelSetIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::LevelSetIterator" + } + break; + case 0xA3C27CF5: + switch(lsbId) { + case 0x4C2AA76C: obj = (T)(new MultiplicationNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MultiplicationNode" + } + break; + case 0xA7D21BD3: + switch(lsbId) { + case 0x64910860: obj = (T)(new BuildItemIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItemIterator" + } + break; + case 0xA808B759: + switch(lsbId) { + case 0x9C158CE6: obj = (T)(new TransposeNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::TransposeNode" + } + break; + case 0xA99CC6C3: + switch(lsbId) { + case 0xF70FB6F9: obj = (T)(new CompositeMaterialsIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterialsIterator" + } + break; + case 0xAFF01F51: + switch(lsbId) { + case 0x2E1FF6AE: obj = (T)(new BooleanObjectIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BooleanObjectIterator" + } + break; + case 0xB19B9FDA: + switch(lsbId) { + case 0x94B0A5E7: obj = (T)(new OneInputNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::OneInputNode" + } + break; + case 0xB27D4656: + switch(lsbId) { + case 0xE16609FA: obj = (T)(new BaseMaterialGroup(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroup" + } + break; + case 0xB6153EF5: + switch(lsbId) { + case 0xDE7E5E11: obj = (T)(new ArcTan2Node(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ArcTan2Node" + } + break; + case 0xB896B641: + switch(lsbId) { + case 0x3C08CF39: obj = (T)(new DivisionNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::DivisionNode" + } + break; + case 0xB989E02E: + switch(lsbId) { + case 0x43158FE6: obj = (T)(new MultiPropertyGroup(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroup" + } + break; + case 0xBC120839: + switch(lsbId) { + case 0x7E37055D: obj = (T)(new Texture2DGroup(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroup" + } + break; + case 0xBD938FF2: + switch(lsbId) { + case 0xD2663D61: obj = (T)(new Image3D(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Image3D" + } + break; + case 0xC2BDF5D8: + switch(lsbId) { + case 0xCBBDB1F0: obj = (T)(new MultiPropertyGroupIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroupIterator" + } + break; + case 0xC4B8EC00: + switch(lsbId) { + case 0xA82BF336: obj = (T)(new Image3DIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Image3DIterator" + } + break; + case 0xC62268F2: + switch(lsbId) { + case 0xD7C7012C: obj = (T)(new ImplicitPortIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ImplicitPortIterator" + } + break; + case 0xCA86A77C: + switch(lsbId) { + case 0x71CD3FAE: obj = (T)(new ResourceIdNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceIdNode" + } + break; + case 0xCC4F8D56: + switch(lsbId) { + case 0x1CCE35D4: obj = (T)(new DecomposeVectorNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::DecomposeVectorNode" + } + break; + case 0xCE16224D: + switch(lsbId) { + case 0x688B86F2: obj = (T)(new CompositeMaterials(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterials" + } + break; + case 0xCF077B19: + switch(lsbId) { + case 0xB0B78E9D: obj = (T)(new TanhNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::TanhNode" + } + break; + case 0xD085FB2E: + switch(lsbId) { + case 0x49CDB5B1: obj = (T)(new ColorGroup(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroup" + } + break; + case 0xD17716D0: + switch(lsbId) { + case 0x63DE2C22: obj = (T)(new MetaData(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MetaData" + } + break; + case 0xD5906722: + switch(lsbId) { + case 0x7E428AA4: obj = (T)(new ResourceDataGroup(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceDataGroup" + } + break; + case 0xD5AEA50A: + switch(lsbId) { + case 0x56306722: obj = (T)(new SinNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::SinNode" + } + break; + case 0xD5C49B04: + switch(lsbId) { + case 0xAF1963CD: obj = (T)(new ImplicitPort(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ImplicitPort" + } + break; + case 0xD6DFD0A7: + switch(lsbId) { + case 0xEB64AC33: obj = (T)(new MatrixFromRowsNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MatrixFromRowsNode" + } + break; + case 0xD85889E2: + switch(lsbId) { + case 0x739A74B1: obj = (T)(new LengthNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::LengthNode" + } + break; + case 0xD85B5B61: + switch(lsbId) { + case 0x43E787E3: obj = (T)(new VolumeDataColor(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::VolumeDataColor" + } + break; + case 0xD9E46D5E: + switch(lsbId) { + case 0x6D8118EE: obj = (T)(new Consumer(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Consumer" + } + break; + case 0xD9F5A53C: + switch(lsbId) { + case 0x657765AE: obj = (T)(new RoundNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::RoundNode" + } + break; + case 0xDE92510B: + switch(lsbId) { + case 0xD2112288: obj = (T)(new ObjectIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ObjectIterator" + } + break; + case 0xDFE3889D: + switch(lsbId) { + case 0x1B269CBB: obj = (T)(new Resource(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Resource" + } + break; + case 0xE0441CF9: + switch(lsbId) { + case 0x76B36319: obj = (T)(new Texture2D(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2D" + } + break; + case 0xE47D5476: + switch(lsbId) { + case 0x15816BAD: obj = (T)(new ArcTanNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ArcTanNode" + } + break; + case 0xE554C8A7: + switch(lsbId) { + case 0xE72AAF4D: obj = (T)(new ArcSinNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ArcSinNode" + } + break; + case 0xE72592A7: + switch(lsbId) { + case 0x725AB29B: obj = (T)(new ImplicitNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ImplicitNode" + } + break; + case 0xE76F642F: + switch(lsbId) { + case 0x363FD7E9: obj = (T)(new Writer(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Writer" + } + break; + case 0xE8601F66: + switch(lsbId) { + case 0xA23A0540: obj = (T)(new InverseNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::InverseNode" + } + break; + case 0xE8A7D9C1: + switch(lsbId) { + case 0x92EFD0E2: obj = (T)(new LevelSet(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::LevelSet" + } + break; + case 0xE8C0ABF7: + switch(lsbId) { + case 0xC5DC7068: obj = (T)(new Log2Node(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::Log2Node" + } + break; + case 0xEA573358: + switch(lsbId) { + case 0x49379F22: obj = (T)(new ModNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ModNode" + } + break; + case 0xF4196034: + switch(lsbId) { + case 0xE2B9FDE6: obj = (T)(new MeshObjectIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObjectIterator" + } + break; + case 0xF85C90ED: + switch(lsbId) { + case 0xCE6F90A4: obj = (T)(new ConstMatNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::ConstMatNode" + } + break; + case 0xFC006BC8: + switch(lsbId) { + case 0x88CAB4D0: obj = (T)(new NodeIterator(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::NodeIterator" + } + break; + case 0xFC368AA4: + switch(lsbId) { + case 0x4ACE42DA: obj = (T)(new VolumeDataProperty(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::VolumeDataProperty" + } + break; + case 0xFE60932A: + switch(lsbId) { + case 0x66375FAD: obj = (T)(new DotNode(this, handle)); break; // First 64 bits of SHA1 of a string: "Lib3MF::DotNode" + } + break; + default: obj = cls.getDeclaredConstructor(cArg).newInstance(this, handle); break; + } + return obj; + } + catch(Exception e) { + return null; + } + } +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Log10Node.java b/Autogenerated/Bindings/Java9/lib3mf/Log10Node.java new file mode 100644 index 000000000..55a643f21 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Log10Node.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Log10Node extends OneInputNode { + + public Log10Node(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Log2Node.java b/Autogenerated/Bindings/Java9/lib3mf/Log2Node.java new file mode 100644 index 000000000..92441cf21 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Log2Node.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Log2Node extends OneInputNode { + + public Log2Node(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/LogNode.java b/Autogenerated/Bindings/Java9/lib3mf/LogNode.java new file mode 100644 index 000000000..aecc51d9f --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/LogNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class LogNode extends OneInputNode { + + public LogNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/MatVecMultiplicationNode.java b/Autogenerated/Bindings/Java9/lib3mf/MatVecMultiplicationNode.java new file mode 100644 index 000000000..93c24e283 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/MatVecMultiplicationNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MatVecMultiplicationNode extends TwoInputNode { + + public MatVecMultiplicationNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/MaterialMapping.java b/Autogenerated/Bindings/Java9/lib3mf/MaterialMapping.java new file mode 100644 index 000000000..53fc29b43 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/MaterialMapping.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MaterialMapping extends FunctionReference { + + public MaterialMapping(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Matrix4x4.java b/Autogenerated/Bindings/Java9/lib3mf/Matrix4x4.java new file mode 100644 index 000000000..6d6619b25 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Matrix4x4.java @@ -0,0 +1,89 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Matrix4x4 { + + public double[][] Field = new double[4][4]; + + public static final int SIZE = 128; + + public void readFromPointer(Pointer p, long offset) { + Field[0][0] = p.getDouble(offset + 0); + Field[0][1] = p.getDouble(offset + 8); + Field[0][2] = p.getDouble(offset + 16); + Field[0][3] = p.getDouble(offset + 24); + Field[1][0] = p.getDouble(offset + 32); + Field[1][1] = p.getDouble(offset + 40); + Field[1][2] = p.getDouble(offset + 48); + Field[1][3] = p.getDouble(offset + 56); + Field[2][0] = p.getDouble(offset + 64); + Field[2][1] = p.getDouble(offset + 72); + Field[2][2] = p.getDouble(offset + 80); + Field[2][3] = p.getDouble(offset + 88); + Field[3][0] = p.getDouble(offset + 96); + Field[3][1] = p.getDouble(offset + 104); + Field[3][2] = p.getDouble(offset + 112); + Field[3][3] = p.getDouble(offset + 120); + } + + public void writeToPointer(Pointer p, long offset) { + p.setDouble(offset + 0, Field[0][0]); + p.setDouble(offset + 8, Field[0][1]); + p.setDouble(offset + 16, Field[0][2]); + p.setDouble(offset + 24, Field[0][3]); + p.setDouble(offset + 32, Field[1][0]); + p.setDouble(offset + 40, Field[1][1]); + p.setDouble(offset + 48, Field[1][2]); + p.setDouble(offset + 56, Field[1][3]); + p.setDouble(offset + 64, Field[2][0]); + p.setDouble(offset + 72, Field[2][1]); + p.setDouble(offset + 80, Field[2][2]); + p.setDouble(offset + 88, Field[2][3]); + p.setDouble(offset + 96, Field[3][0]); + p.setDouble(offset + 104, Field[3][1]); + p.setDouble(offset + 112, Field[3][2]); + p.setDouble(offset + 120, Field[3][3]); + } + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/MatrixFromColumnsNode.java b/Autogenerated/Bindings/Java9/lib3mf/MatrixFromColumnsNode.java new file mode 100644 index 000000000..00ce7b82f --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/MatrixFromColumnsNode.java @@ -0,0 +1,147 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MatrixFromColumnsNode extends ImplicitNode { + + public MatrixFromColumnsNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the first column + * + * @return the input for the first column + * @throws Lib3MFException + */ + public ImplicitPort getInputA() throws Lib3MFException { + Pointer bufferColumn0 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromcolumnsnode_getinputa.invokeInt(new java.lang.Object[]{mHandle, bufferColumn0})); + Pointer valueColumn0 = bufferColumn0.getPointer(0); + ImplicitPort column0 = null; + if (valueColumn0 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Column0 was a null pointer"); + } + column0 = mWrapper.PolymorphicFactory(valueColumn0, ImplicitPort.class); + return column0; + } + + /** + * Retrieves the input for the second column + * + * @return the input for the second column + * @throws Lib3MFException + */ + public ImplicitPort getInputB() throws Lib3MFException { + Pointer bufferColumn1 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromcolumnsnode_getinputb.invokeInt(new java.lang.Object[]{mHandle, bufferColumn1})); + Pointer valueColumn1 = bufferColumn1.getPointer(0); + ImplicitPort column1 = null; + if (valueColumn1 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Column1 was a null pointer"); + } + column1 = mWrapper.PolymorphicFactory(valueColumn1, ImplicitPort.class); + return column1; + } + + /** + * Retrieves the input for the third column + * + * @return the input for the third column + * @throws Lib3MFException + */ + public ImplicitPort getInputC() throws Lib3MFException { + Pointer bufferColumn2 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromcolumnsnode_getinputc.invokeInt(new java.lang.Object[]{mHandle, bufferColumn2})); + Pointer valueColumn2 = bufferColumn2.getPointer(0); + ImplicitPort column2 = null; + if (valueColumn2 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Column2 was a null pointer"); + } + column2 = mWrapper.PolymorphicFactory(valueColumn2, ImplicitPort.class); + return column2; + } + + /** + * Retrieves the input for the fourth column + * + * @return the input for the fourth column + * @throws Lib3MFException + */ + public ImplicitPort getInputD() throws Lib3MFException { + Pointer bufferColumn3 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromcolumnsnode_getinputd.invokeInt(new java.lang.Object[]{mHandle, bufferColumn3})); + Pointer valueColumn3 = bufferColumn3.getPointer(0); + ImplicitPort column3 = null; + if (valueColumn3 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Column3 was a null pointer"); + } + column3 = mWrapper.PolymorphicFactory(valueColumn3, ImplicitPort.class); + return column3; + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputResult() throws Lib3MFException { + Pointer bufferResult = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromcolumnsnode_getoutputresult.invokeInt(new java.lang.Object[]{mHandle, bufferResult})); + Pointer valueResult = bufferResult.getPointer(0); + ImplicitPort result = null; + if (valueResult == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Result was a null pointer"); + } + result = mWrapper.PolymorphicFactory(valueResult, ImplicitPort.class); + return result; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/MatrixFromRowsNode.java b/Autogenerated/Bindings/Java9/lib3mf/MatrixFromRowsNode.java new file mode 100644 index 000000000..a75634870 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/MatrixFromRowsNode.java @@ -0,0 +1,147 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MatrixFromRowsNode extends ImplicitNode { + + public MatrixFromRowsNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the first row + * + * @return the input for the first row + * @throws Lib3MFException + */ + public ImplicitPort getInputA() throws Lib3MFException { + Pointer bufferRow0 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromrowsnode_getinputa.invokeInt(new java.lang.Object[]{mHandle, bufferRow0})); + Pointer valueRow0 = bufferRow0.getPointer(0); + ImplicitPort row0 = null; + if (valueRow0 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Row0 was a null pointer"); + } + row0 = mWrapper.PolymorphicFactory(valueRow0, ImplicitPort.class); + return row0; + } + + /** + * Retrieves the input for the second row + * + * @return the input for the second row + * @throws Lib3MFException + */ + public ImplicitPort getInputB() throws Lib3MFException { + Pointer bufferRow1 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromrowsnode_getinputb.invokeInt(new java.lang.Object[]{mHandle, bufferRow1})); + Pointer valueRow1 = bufferRow1.getPointer(0); + ImplicitPort row1 = null; + if (valueRow1 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Row1 was a null pointer"); + } + row1 = mWrapper.PolymorphicFactory(valueRow1, ImplicitPort.class); + return row1; + } + + /** + * Retrieves the input for the third row + * + * @return the input for the third row + * @throws Lib3MFException + */ + public ImplicitPort getInputC() throws Lib3MFException { + Pointer bufferRow2 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromrowsnode_getinputc.invokeInt(new java.lang.Object[]{mHandle, bufferRow2})); + Pointer valueRow2 = bufferRow2.getPointer(0); + ImplicitPort row2 = null; + if (valueRow2 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Row2 was a null pointer"); + } + row2 = mWrapper.PolymorphicFactory(valueRow2, ImplicitPort.class); + return row2; + } + + /** + * Retrieves the input for the fourth row + * + * @return the input for the fourth row + * @throws Lib3MFException + */ + public ImplicitPort getInputD() throws Lib3MFException { + Pointer bufferRow3 = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromrowsnode_getinputd.invokeInt(new java.lang.Object[]{mHandle, bufferRow3})); + Pointer valueRow3 = bufferRow3.getPointer(0); + ImplicitPort row3 = null; + if (valueRow3 == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Row3 was a null pointer"); + } + row3 = mWrapper.PolymorphicFactory(valueRow3, ImplicitPort.class); + return row3; + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputResult() throws Lib3MFException { + Pointer bufferResult = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_matrixfromrowsnode_getoutputresult.invokeInt(new java.lang.Object[]{mHandle, bufferResult})); + Pointer valueResult = bufferResult.getPointer(0); + ImplicitPort result = null; + if (valueResult == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Result was a null pointer"); + } + result = mWrapper.PolymorphicFactory(valueResult, ImplicitPort.class); + return result; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/MaxNode.java b/Autogenerated/Bindings/Java9/lib3mf/MaxNode.java new file mode 100644 index 000000000..24f097140 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/MaxNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MaxNode extends TwoInputNode { + + public MaxNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/MeshNode.java b/Autogenerated/Bindings/Java9/lib3mf/MeshNode.java new file mode 100644 index 000000000..3abafe80e --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/MeshNode.java @@ -0,0 +1,111 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MeshNode extends ImplicitNode { + + public MeshNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the model resource id of the mesh + * + * @return the input port for the model resource id of the mesh + * @throws Lib3MFException + */ + public ImplicitPort getInputMesh() throws Lib3MFException { + Pointer bufferMesh = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshnode_getinputmesh.invokeInt(new java.lang.Object[]{mHandle, bufferMesh})); + Pointer valueMesh = bufferMesh.getPointer(0); + ImplicitPort mesh = null; + if (valueMesh == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Mesh was a null pointer"); + } + mesh = mWrapper.PolymorphicFactory(valueMesh, ImplicitPort.class); + return mesh; + } + + /** + * Retrieves the input for the position + * + * @return the input port for the position + * @throws Lib3MFException + */ + public ImplicitPort getInputPos() throws Lib3MFException { + Pointer bufferPos = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshnode_getinputpos.invokeInt(new java.lang.Object[]{mHandle, bufferPos})); + Pointer valuePos = bufferPos.getPointer(0); + ImplicitPort pos = null; + if (valuePos == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Pos was a null pointer"); + } + pos = mWrapper.PolymorphicFactory(valuePos, ImplicitPort.class); + return pos; + } + + /** + * Retrieves the output + * + * @return the output port for the signed distance to the mesh + * @throws Lib3MFException + */ + public ImplicitPort getOutputDistance() throws Lib3MFException { + Pointer bufferDistance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshnode_getoutputdistance.invokeInt(new java.lang.Object[]{mHandle, bufferDistance})); + Pointer valueDistance = bufferDistance.getPointer(0); + ImplicitPort distance = null; + if (valueDistance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Distance was a null pointer"); + } + distance = mWrapper.PolymorphicFactory(valueDistance, ImplicitPort.class); + return distance; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/MeshObject.java b/Autogenerated/Bindings/Java9/lib3mf/MeshObject.java new file mode 100644 index 000000000..a5c29d9dc --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/MeshObject.java @@ -0,0 +1,505 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MeshObject extends Object { + + public MeshObject(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the vertex count of a mesh object. + * + * @return filled with the vertex count. + * @throws Lib3MFException + */ + public int getVertexCount() throws Lib3MFException { + Pointer bufferVertexCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_getvertexcount.invokeInt(new java.lang.Object[]{mHandle, bufferVertexCount})); + return bufferVertexCount.getInt(0); + } + + /** + * Returns the triangle count of a mesh object. + * + * @return filled with the triangle count. + * @throws Lib3MFException + */ + public int getTriangleCount() throws Lib3MFException { + Pointer bufferVertexCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_gettrianglecount.invokeInt(new java.lang.Object[]{mHandle, bufferVertexCount})); + return bufferVertexCount.getInt(0); + } + + /** + * Returns the vertex count of a mesh object. + * + * @param index Index of the vertex (0 to vertexcount - 1) + * @return filled with the vertex coordinates. + * @throws Lib3MFException + */ + public Position getVertex(int index) throws Lib3MFException { + Pointer bufferCoordinates = new Memory(Position.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_getvertex.invokeInt(new java.lang.Object[]{mHandle, index, bufferCoordinates})); + Position coordinates = new Position(); + coordinates.readFromPointer(bufferCoordinates, 0); + return coordinates; + } + + /** + * Sets the coordinates of a single vertex of a mesh object + * + * @param index Index of the vertex (0 to vertexcount - 1) + * @param coordinates contains the vertex coordinates. + * @throws Lib3MFException + */ + public void setVertex(int index, Position coordinates) throws Lib3MFException { + Pointer bufferCoordinates = new Memory(Position.SIZE); + coordinates.writeToPointer(bufferCoordinates, 0); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_setvertex.invokeInt(new java.lang.Object[]{mHandle, index, bufferCoordinates})); + } + + /** + * Adds a single vertex to a mesh object + * + * @param coordinates contains the vertex coordinates. + * @return Index of the new vertex + * @throws Lib3MFException + */ + public int addVertex(Position coordinates) throws Lib3MFException { + Pointer bufferCoordinates = new Memory(Position.SIZE); + coordinates.writeToPointer(bufferCoordinates, 0); + Pointer bufferNewIndex = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_addvertex.invokeInt(new java.lang.Object[]{mHandle, bufferCoordinates, bufferNewIndex})); + return bufferNewIndex.getInt(0); + } + + /** + * Obtains all vertex positions of a mesh object + * + * @return contains the vertex coordinates. + * @throws Lib3MFException + */ + public Position[] getVertices() throws Lib3MFException { + Pointer countNeededVertices = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_getvertices.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededVertices, null})); + long countVertices = countNeededVertices.getLong(0); + Pointer bufferVertices = new Memory(Math.max(1, countVertices * Position.SIZE)); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_getvertices.invokeInt(new java.lang.Object[]{mHandle, countVertices, countNeededVertices, bufferVertices})); + Position vertices[] = new Position[(int)countVertices]; + for (int i = 0; i < (int)countVertices; i++) { + vertices[i] = new Position(); + vertices[i].readFromPointer(bufferVertices, i * Position.SIZE); + } + return vertices; + } + + /** + * Returns indices of a single triangle of a mesh object. + * + * @param index Index of the triangle (0 to trianglecount - 1) + * @return filled with the triangle indices. + * @throws Lib3MFException + */ + public Triangle getTriangle(int index) throws Lib3MFException { + Pointer bufferIndices = new Memory(Triangle.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_gettriangle.invokeInt(new java.lang.Object[]{mHandle, index, bufferIndices})); + Triangle indices = new Triangle(); + indices.readFromPointer(bufferIndices, 0); + return indices; + } + + /** + * Sets the indices of a single triangle of a mesh object. + * + * @param index Index of the triangle (0 to trianglecount - 1) + * @param indices contains the triangle indices. + * @throws Lib3MFException + */ + public void setTriangle(int index, Triangle indices) throws Lib3MFException { + Pointer bufferIndices = new Memory(Triangle.SIZE); + indices.writeToPointer(bufferIndices, 0); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_settriangle.invokeInt(new java.lang.Object[]{mHandle, index, bufferIndices})); + } + + /** + * Adds a single triangle to a mesh object + * + * @param indices contains the triangle indices. + * @return Index of the new triangle + * @throws Lib3MFException + */ + public int addTriangle(Triangle indices) throws Lib3MFException { + Pointer bufferIndices = new Memory(Triangle.SIZE); + indices.writeToPointer(bufferIndices, 0); + Pointer bufferNewIndex = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_addtriangle.invokeInt(new java.lang.Object[]{mHandle, bufferIndices, bufferNewIndex})); + return bufferNewIndex.getInt(0); + } + + /** + * Get all triangles of a mesh object + * + * @return contains the triangle indices. + * @throws Lib3MFException + */ + public Triangle[] getTriangleIndices() throws Lib3MFException { + Pointer countNeededIndices = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_gettriangleindices.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededIndices, null})); + long countIndices = countNeededIndices.getLong(0); + Pointer bufferIndices = new Memory(Math.max(1, countIndices * Triangle.SIZE)); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_gettriangleindices.invokeInt(new java.lang.Object[]{mHandle, countIndices, countNeededIndices, bufferIndices})); + Triangle indices[] = new Triangle[(int)countIndices]; + for (int i = 0; i < (int)countIndices; i++) { + indices[i] = new Triangle(); + indices[i].readFromPointer(bufferIndices, i * Triangle.SIZE); + } + return indices; + } + + /** + * Sets the property at the object-level of the mesh object. + * + * @param uniqueResourceID the object-level Property UniqueResourceID. + * @param propertyID the object-level PropertyID. + * @throws Lib3MFException + */ + public void setObjectLevelProperty(int uniqueResourceID, int propertyID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_setobjectlevelproperty.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, propertyID})); + } + + /** + * Gets the property at the object-level of the mesh object. + * + * @return GetObjectLevelProperty Result Tuple + * @throws Lib3MFException + */ + public GetObjectLevelPropertyResult getObjectLevelProperty() throws Lib3MFException { + Pointer bufferUniqueResourceID = new Memory(4); + Pointer bufferPropertyID = new Memory(4); + Pointer bufferHasObjectLevelProperty = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_getobjectlevelproperty.invokeInt(new java.lang.Object[]{mHandle, bufferUniqueResourceID, bufferPropertyID, bufferHasObjectLevelProperty})); + GetObjectLevelPropertyResult returnTuple = new GetObjectLevelPropertyResult(); + returnTuple.UniqueResourceID = bufferUniqueResourceID.getInt(0); + returnTuple.PropertyID = bufferPropertyID.getInt(0); + returnTuple.HasObjectLevelProperty = bufferHasObjectLevelProperty.getByte(0) != 0; + return returnTuple; + } + + public static class GetObjectLevelPropertyResult { + /** + * the object-level Property UniqueResourceID. + */ + public int UniqueResourceID; + + /** + * the object-level PropertyID. + */ + public int PropertyID; + + /** + * Has an object-level property been specified? + */ + public boolean HasObjectLevelProperty; + + } + /** + * Sets the properties of a single triangle of a mesh object. + * + * @param index Index of the triangle (0 to trianglecount - 1) + * @param properties contains the triangle properties. + * @throws Lib3MFException + */ + public void setTriangleProperties(int index, TriangleProperties properties) throws Lib3MFException { + Pointer bufferProperties = new Memory(TriangleProperties.SIZE); + properties.writeToPointer(bufferProperties, 0); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_settriangleproperties.invokeInt(new java.lang.Object[]{mHandle, index, bufferProperties})); + } + + /** + * Gets the properties of a single triangle of a mesh object. + * + * @param index Index of the triangle (0 to trianglecount - 1) + * @return returns the triangle properties. + * @throws Lib3MFException + */ + public TriangleProperties getTriangleProperties(int index) throws Lib3MFException { + Pointer bufferProperty = new Memory(TriangleProperties.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_gettriangleproperties.invokeInt(new java.lang.Object[]{mHandle, index, bufferProperty})); + TriangleProperties property = new TriangleProperties(); + property.readFromPointer(bufferProperty, 0); + return property; + } + + /** + * Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. + * + * @param propertiesArray contains the triangle properties array. Must have trianglecount elements. + * @throws Lib3MFException + */ + public void setAllTriangleProperties(TriangleProperties[] propertiesArray) throws Lib3MFException { + Pointer bufferPropertiesArray = new Memory(Math.max(1, TriangleProperties.SIZE * propertiesArray.length)); + for (int i = 0; i < propertiesArray.length; i++) { + propertiesArray[i].writeToPointer(bufferPropertiesArray, i * TriangleProperties.SIZE); + } + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_setalltriangleproperties.invokeInt(new java.lang.Object[]{mHandle, (long) propertiesArray.length, bufferPropertiesArray})); + } + + /** + * Gets the properties of all triangles of a mesh object. + * + * @return returns the triangle properties array. Must have trianglecount elements. + * @throws Lib3MFException + */ + public TriangleProperties[] getAllTriangleProperties() throws Lib3MFException { + Pointer countNeededPropertiesArray = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_getalltriangleproperties.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededPropertiesArray, null})); + long countPropertiesArray = countNeededPropertiesArray.getLong(0); + Pointer bufferPropertiesArray = new Memory(Math.max(1, countPropertiesArray * TriangleProperties.SIZE)); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_getalltriangleproperties.invokeInt(new java.lang.Object[]{mHandle, countPropertiesArray, countNeededPropertiesArray, bufferPropertiesArray})); + TriangleProperties propertiesArray[] = new TriangleProperties[(int)countPropertiesArray]; + for (int i = 0; i < (int)countPropertiesArray; i++) { + propertiesArray[i] = new TriangleProperties(); + propertiesArray[i].readFromPointer(bufferPropertiesArray, i * TriangleProperties.SIZE); + } + return propertiesArray; + } + + /** + * Clears all properties of this mesh object (triangle and object-level). + * + * @throws Lib3MFException + */ + public void clearAllProperties() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_clearallproperties.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Set all triangles of a mesh object + * + * @param vertices contains the positions. + * @param indices contains the triangle indices. + * @throws Lib3MFException + */ + public void setGeometry(Position[] vertices, Triangle[] indices) throws Lib3MFException { + Pointer bufferVertices = new Memory(Math.max(1, Position.SIZE * vertices.length)); + for (int i = 0; i < vertices.length; i++) { + vertices[i].writeToPointer(bufferVertices, i * Position.SIZE); + } + Pointer bufferIndices = new Memory(Math.max(1, Triangle.SIZE * indices.length)); + for (int i = 0; i < indices.length; i++) { + indices[i].writeToPointer(bufferIndices, i * Triangle.SIZE); + } + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_setgeometry.invokeInt(new java.lang.Object[]{mHandle, (long) vertices.length, bufferVertices, (long) indices.length, bufferIndices})); + } + + /** + * Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. + * + * @return returns, if the object is oriented and manifold. + * @throws Lib3MFException + */ + public boolean isManifoldAndOriented() throws Lib3MFException { + Pointer bufferIsManifoldAndOriented = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_ismanifoldandoriented.invokeInt(new java.lang.Object[]{mHandle, bufferIsManifoldAndOriented})); + return bufferIsManifoldAndOriented.getByte(0) != 0; + } + + /** + * Retrieves the BeamLattice within this MeshObject. + * + * @return the BeamLattice within this MeshObject + * @throws Lib3MFException + */ + public BeamLattice beamLattice() throws Lib3MFException { + Pointer bufferTheBeamLattice = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_beamlattice.invokeInt(new java.lang.Object[]{mHandle, bufferTheBeamLattice})); + Pointer valueTheBeamLattice = bufferTheBeamLattice.getPointer(0); + BeamLattice theBeamLattice = null; + if (valueTheBeamLattice == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheBeamLattice was a null pointer"); + } + theBeamLattice = mWrapper.PolymorphicFactory(valueTheBeamLattice, BeamLattice.class); + return theBeamLattice; + } + + /** + * Retrieves the VolumeData of this MeshObject. + * + * @return the VolumeData of this MeshObject + * @throws Lib3MFException + */ + public VolumeData getVolumeData() throws Lib3MFException { + Pointer bufferTheVolumeData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_getvolumedata.invokeInt(new java.lang.Object[]{mHandle, bufferTheVolumeData})); + Pointer valueTheVolumeData = bufferTheVolumeData.getPointer(0); + VolumeData theVolumeData = null; + if (valueTheVolumeData != Pointer.NULL) { + theVolumeData = mWrapper.PolymorphicFactory(valueTheVolumeData, VolumeData.class); + } + return theVolumeData; + } + + /** + * Sets the VolumeData of this MeshObject. + * + * @param theVolumeData the VolumeData of this MeshObject + * @throws Lib3MFException + */ + public void setVolumeData(VolumeData theVolumeData) throws Lib3MFException { + Pointer theVolumeDataHandle = null; + if (theVolumeData != null) { + theVolumeDataHandle = theVolumeData.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheVolumeData is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_setvolumedata.invokeInt(new java.lang.Object[]{mHandle, theVolumeDataHandle})); + } + + /** + * Adds a new triangle set. + * + * @param identifier the new identifier. MUST be unique within the mesh. MUST NOT be an empty string + * @param name the human readable name. MUST NOT be an empty string + * @return the new Triangle Set Instance. + * @throws Lib3MFException + */ + public TriangleSet addTriangleSet(String identifier, String name) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + Pointer bufferTheTriangleSet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_addtriangleset.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferName, bufferTheTriangleSet})); + Pointer valueTheTriangleSet = bufferTheTriangleSet.getPointer(0); + TriangleSet theTriangleSet = null; + if (valueTheTriangleSet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheTriangleSet was a null pointer"); + } + theTriangleSet = mWrapper.PolymorphicFactory(valueTheTriangleSet, TriangleSet.class); + return theTriangleSet; + } + + /** + * Checks if a triangle set exists. + * + * @param identifier the identifier to be found. + * @return flag if the triangles set exists. + * @throws Lib3MFException + */ + public boolean hasTriangleSet(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + Pointer bufferTriangleSetExists = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_hastriangleset.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferTriangleSetExists})); + return bufferTriangleSetExists.getByte(0) != 0; + } + + /** + * Finds a new triangle set by identifier. Fails if not existing. + * + * @param identifier the identifier to be found. + * @return the triangle Set Instance. + * @throws Lib3MFException + */ + public TriangleSet findTriangleSet(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + Pointer bufferTheTriangleSet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_findtriangleset.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferTheTriangleSet})); + Pointer valueTheTriangleSet = bufferTheTriangleSet.getPointer(0); + TriangleSet theTriangleSet = null; + if (valueTheTriangleSet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheTriangleSet was a null pointer"); + } + theTriangleSet = mWrapper.PolymorphicFactory(valueTheTriangleSet, TriangleSet.class); + return theTriangleSet; + } + + /** + * Returns number of triangle sets. + * + * @return the number of triangle sets of this mesh. + * @throws Lib3MFException + */ + public int getTriangleSetCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_gettrianglesetcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Returns a specific triangle set by index. + * + * @param index the index of the triangle set. + * @return the triangle Set Instance. + * @throws Lib3MFException + */ + public TriangleSet getTriangleSet(int index) throws Lib3MFException { + Pointer bufferTheTriangleSet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobject_gettriangleset.invokeInt(new java.lang.Object[]{mHandle, index, bufferTheTriangleSet})); + Pointer valueTheTriangleSet = bufferTheTriangleSet.getPointer(0); + TriangleSet theTriangleSet = null; + if (valueTheTriangleSet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheTriangleSet was a null pointer"); + } + theTriangleSet = mWrapper.PolymorphicFactory(valueTheTriangleSet, TriangleSet.class); + return theTriangleSet; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/MeshObjectIterator.java b/Autogenerated/Bindings/Java9/lib3mf/MeshObjectIterator.java new file mode 100644 index 000000000..6320032e9 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/MeshObjectIterator.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MeshObjectIterator extends ResourceIterator { + + public MeshObjectIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the MeshObject the iterator points at. + * + * @return returns the MeshObject instance. + * @throws Lib3MFException + */ + public MeshObject getCurrentMeshObject() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_meshobjectiterator_getcurrentmeshobject.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + MeshObject resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, MeshObject.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/MetaData.java b/Autogenerated/Bindings/Java9/lib3mf/MetaData.java new file mode 100644 index 000000000..188b1efdc --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/MetaData.java @@ -0,0 +1,210 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MetaData extends Base { + + public MetaData(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * returns the namespace URL of the metadata + * + * @return the namespace URL of the metadata + * @throws Lib3MFException + */ + public String getNameSpace() throws Lib3MFException { + Pointer bytesNeededNameSpace = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getnamespace.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededNameSpace, null})); + int sizeNameSpace = bytesNeededNameSpace.getInt(0); + Pointer bufferNameSpace = new Memory(sizeNameSpace); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getnamespace.invokeInt(new java.lang.Object[]{mHandle, sizeNameSpace, bytesNeededNameSpace, bufferNameSpace})); + return new String(bufferNameSpace.getByteArray(0, sizeNameSpace - 1), StandardCharsets.UTF_8); + } + + /** + * sets a new namespace URL of the metadata + * + * @param nameSpace the new namespace URL of the metadata + * @throws Lib3MFException + */ + public void setNameSpace(String nameSpace) throws Lib3MFException { + byte[] bytesNameSpace = nameSpace.getBytes(StandardCharsets.UTF_8); + Memory bufferNameSpace = new Memory(bytesNameSpace.length + 1); + bufferNameSpace.write(0, bytesNameSpace, 0, bytesNameSpace.length); + bufferNameSpace.setByte(bytesNameSpace.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_setnamespace.invokeInt(new java.lang.Object[]{mHandle, bufferNameSpace})); + } + + /** + * returns the name of a metadata + * + * @return the name of the metadata + * @throws Lib3MFException + */ + public String getName() throws Lib3MFException { + Pointer bytesNeededName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededName, null})); + int sizeName = bytesNeededName.getInt(0); + Pointer bufferName = new Memory(sizeName); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getname.invokeInt(new java.lang.Object[]{mHandle, sizeName, bytesNeededName, bufferName})); + return new String(bufferName.getByteArray(0, sizeName - 1), StandardCharsets.UTF_8); + } + + /** + * sets a new name of a metadata + * + * @param name the new name of the metadata + * @throws Lib3MFException + */ + public void setName(String name) throws Lib3MFException { + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_setname.invokeInt(new java.lang.Object[]{mHandle, bufferName})); + } + + /** + * returns the (namespace+name) of a metadata + * + * @return the key (namespace+name) of the metadata + * @throws Lib3MFException + */ + public String getKey() throws Lib3MFException { + Pointer bytesNeededKey = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getkey.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededKey, null})); + int sizeKey = bytesNeededKey.getInt(0); + Pointer bufferKey = new Memory(sizeKey); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getkey.invokeInt(new java.lang.Object[]{mHandle, sizeKey, bytesNeededKey, bufferKey})); + return new String(bufferKey.getByteArray(0, sizeKey - 1), StandardCharsets.UTF_8); + } + + /** + * returns, whether a metadata must be preserved + * + * @return returns, whether a metadata must be preserved + * @throws Lib3MFException + */ + public boolean getMustPreserve() throws Lib3MFException { + Pointer bufferMustPreserve = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getmustpreserve.invokeInt(new java.lang.Object[]{mHandle, bufferMustPreserve})); + return bufferMustPreserve.getByte(0) != 0; + } + + /** + * sets whether a metadata must be preserved + * + * @param mustPreserve a new value whether a metadata must be preserved + * @throws Lib3MFException + */ + public void setMustPreserve(boolean mustPreserve) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_metadata_setmustpreserve.invokeInt(new java.lang.Object[]{mHandle, mustPreserve})); + } + + /** + * returns the type of a metadata + * + * @return the type of the metadata + * @throws Lib3MFException + */ + public String getType() throws Lib3MFException { + Pointer bytesNeededType = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_gettype.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededType, null})); + int sizeType = bytesNeededType.getInt(0); + Pointer bufferType = new Memory(sizeType); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_gettype.invokeInt(new java.lang.Object[]{mHandle, sizeType, bytesNeededType, bufferType})); + return new String(bufferType.getByteArray(0, sizeType - 1), StandardCharsets.UTF_8); + } + + /** + * sets a new type of a metadata. This must be a simple XML type + * + * @param type a new type of the metadata + * @throws Lib3MFException + */ + public void setType(String type) throws Lib3MFException { + byte[] bytesType = type.getBytes(StandardCharsets.UTF_8); + Memory bufferType = new Memory(bytesType.length + 1); + bufferType.write(0, bytesType, 0, bytesType.length); + bufferType.setByte(bytesType.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_settype.invokeInt(new java.lang.Object[]{mHandle, bufferType})); + } + + /** + * returns the value of the metadata + * + * @return the value of the metadata + * @throws Lib3MFException + */ + public String getValue() throws Lib3MFException { + Pointer bytesNeededValue = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getvalue.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededValue, null})); + int sizeValue = bytesNeededValue.getInt(0); + Pointer bufferValue = new Memory(sizeValue); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_getvalue.invokeInt(new java.lang.Object[]{mHandle, sizeValue, bytesNeededValue, bufferValue})); + return new String(bufferValue.getByteArray(0, sizeValue - 1), StandardCharsets.UTF_8); + } + + /** + * sets a new value of the metadata + * + * @param value a new value of the metadata + * @throws Lib3MFException + */ + public void setValue(String value) throws Lib3MFException { + byte[] bytesValue = value.getBytes(StandardCharsets.UTF_8); + Memory bufferValue = new Memory(bytesValue.length + 1); + bufferValue.write(0, bytesValue, 0, bytesValue.length); + bufferValue.setByte(bytesValue.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_metadata_setvalue.invokeInt(new java.lang.Object[]{mHandle, bufferValue})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/MetaDataGroup.java b/Autogenerated/Bindings/Java9/lib3mf/MetaDataGroup.java new file mode 100644 index 000000000..dd713b50a --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/MetaDataGroup.java @@ -0,0 +1,181 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MetaDataGroup extends Base { + + public MetaDataGroup(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * returns the number of metadata in this metadatagroup + * + * @return returns the number metadata + * @throws Lib3MFException + */ + public int getMetaDataCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_metadatagroup_getmetadatacount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * returns a metadata value within this metadatagroup + * + * @param index Index of the Metadata. + * @return an instance of the metadata + * @throws Lib3MFException + */ + public MetaData getMetaData(int index) throws Lib3MFException { + Pointer bufferMetaData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_metadatagroup_getmetadata.invokeInt(new java.lang.Object[]{mHandle, index, bufferMetaData})); + Pointer valueMetaData = bufferMetaData.getPointer(0); + MetaData metaData = null; + if (valueMetaData == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MetaData was a null pointer"); + } + metaData = mWrapper.PolymorphicFactory(valueMetaData, MetaData.class); + return metaData; + } + + /** + * returns a metadata value within this metadatagroup + * + * @param nameSpace the namespace of the metadata + * @param name the name of the Metadata + * @return an instance of the metadata + * @throws Lib3MFException + */ + public MetaData getMetaDataByKey(String nameSpace, String name) throws Lib3MFException { + byte[] bytesNameSpace = nameSpace.getBytes(StandardCharsets.UTF_8); + Memory bufferNameSpace = new Memory(bytesNameSpace.length + 1); + bufferNameSpace.write(0, bytesNameSpace, 0, bytesNameSpace.length); + bufferNameSpace.setByte(bytesNameSpace.length, (byte)0); + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + Pointer bufferMetaData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_metadatagroup_getmetadatabykey.invokeInt(new java.lang.Object[]{mHandle, bufferNameSpace, bufferName, bufferMetaData})); + Pointer valueMetaData = bufferMetaData.getPointer(0); + MetaData metaData = null; + if (valueMetaData == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MetaData was a null pointer"); + } + metaData = mWrapper.PolymorphicFactory(valueMetaData, MetaData.class); + return metaData; + } + + /** + * removes metadata by index from the model. + * + * @param index Index of the metadata to remove + * @throws Lib3MFException + */ + public void removeMetaDataByIndex(int index) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_metadatagroup_removemetadatabyindex.invokeInt(new java.lang.Object[]{mHandle, index})); + } + + /** + * removes metadata from the model. + * + * @param theMetaData The metadata to remove + * @throws Lib3MFException + */ + public void removeMetaData(MetaData theMetaData) throws Lib3MFException { + Pointer theMetaDataHandle = null; + if (theMetaData != null) { + theMetaDataHandle = theMetaData.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheMetaData is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_metadatagroup_removemetadata.invokeInt(new java.lang.Object[]{mHandle, theMetaDataHandle})); + } + + /** + * adds a new metadata to this metadatagroup + * + * @param nameSpace the namespace of the metadata + * @param name the name of the metadata + * @param value the value of the metadata + * @param type the type of the metadata + * @param mustPreserve should the metadata be preserved + * @return a new instance of the metadata + * @throws Lib3MFException + */ + public MetaData addMetaData(String nameSpace, String name, String value, String type, boolean mustPreserve) throws Lib3MFException { + byte[] bytesNameSpace = nameSpace.getBytes(StandardCharsets.UTF_8); + Memory bufferNameSpace = new Memory(bytesNameSpace.length + 1); + bufferNameSpace.write(0, bytesNameSpace, 0, bytesNameSpace.length); + bufferNameSpace.setByte(bytesNameSpace.length, (byte)0); + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + byte[] bytesValue = value.getBytes(StandardCharsets.UTF_8); + Memory bufferValue = new Memory(bytesValue.length + 1); + bufferValue.write(0, bytesValue, 0, bytesValue.length); + bufferValue.setByte(bytesValue.length, (byte)0); + byte[] bytesType = type.getBytes(StandardCharsets.UTF_8); + Memory bufferType = new Memory(bytesType.length + 1); + bufferType.write(0, bytesType, 0, bytesType.length); + bufferType.setByte(bytesType.length, (byte)0); + Pointer bufferMetaData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_metadatagroup_addmetadata.invokeInt(new java.lang.Object[]{mHandle, bufferNameSpace, bufferName, bufferValue, bufferType, mustPreserve, bufferMetaData})); + Pointer valueMetaData = bufferMetaData.getPointer(0); + MetaData metaData = null; + if (valueMetaData == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MetaData was a null pointer"); + } + metaData = mWrapper.PolymorphicFactory(valueMetaData, MetaData.class); + return metaData; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/MinNode.java b/Autogenerated/Bindings/Java9/lib3mf/MinNode.java new file mode 100644 index 000000000..6774e2867 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/MinNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MinNode extends TwoInputNode { + + public MinNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ModNode.java b/Autogenerated/Bindings/Java9/lib3mf/ModNode.java new file mode 100644 index 000000000..3a555dfa8 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ModNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ModNode extends TwoInputNode { + + public ModNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Model.java b/Autogenerated/Bindings/Java9/lib3mf/Model.java new file mode 100644 index 000000000..a4bc985c4 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Model.java @@ -0,0 +1,1432 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Model extends Base { + + public Model(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the PackagePart within the OPC package that holds the root model. + * + * @return the PackagePart within the OPC package that holds the model-file + * @throws Lib3MFException + */ + public PackagePart rootModelPart() throws Lib3MFException { + Pointer bufferRootModelPart = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_rootmodelpart.invokeInt(new java.lang.Object[]{mHandle, bufferRootModelPart})); + Pointer valueRootModelPart = bufferRootModelPart.getPointer(0); + PackagePart rootModelPart = null; + if (valueRootModelPart == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "RootModelPart was a null pointer"); + } + rootModelPart = mWrapper.PolymorphicFactory(valueRootModelPart, PackagePart.class); + return rootModelPart; + } + + /** + * Returns a new PackagePart for use within the OPC package. + * + * @param absolutePath the absolute Path (physical location) within the OPC package + * @return the new PackagePart within the OPC package + * @throws Lib3MFException + */ + public PackagePart findOrCreatePackagePart(String absolutePath) throws Lib3MFException { + byte[] bytesAbsolutePath = absolutePath.getBytes(StandardCharsets.UTF_8); + Memory bufferAbsolutePath = new Memory(bytesAbsolutePath.length + 1); + bufferAbsolutePath.write(0, bytesAbsolutePath, 0, bytesAbsolutePath.length); + bufferAbsolutePath.setByte(bytesAbsolutePath.length, (byte)0); + Pointer bufferModelPart = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_findorcreatepackagepart.invokeInt(new java.lang.Object[]{mHandle, bufferAbsolutePath, bufferModelPart})); + Pointer valueModelPart = bufferModelPart.getPointer(0); + PackagePart modelPart = null; + if (valueModelPart == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ModelPart was a null pointer"); + } + modelPart = mWrapper.PolymorphicFactory(valueModelPart, PackagePart.class); + return modelPart; + } + + /** + * sets the units of a model. + * + * @param unit Unit enum value for the model unit + * @throws Lib3MFException + */ + public void setUnit(Lib3MFWrapper.ModelUnit unit) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_model_setunit.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertModelUnitToConst(unit)})); + } + + /** + * returns the units of a model. + * + * @return Unit enum value for the model unit + * @throws Lib3MFException + */ + public Lib3MFWrapper.ModelUnit getUnit() throws Lib3MFException { + Pointer bufferUnit = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_model_getunit.invokeInt(new java.lang.Object[]{mHandle, bufferUnit})); + return Lib3MFWrapper.EnumConversion.convertConstToModelUnit(bufferUnit.getInt(0)); + } + + /** + * retrieves the language of a model + * + * @return language identifier + * @throws Lib3MFException + */ + public String getLanguage() throws Lib3MFException { + Pointer bytesNeededLanguage = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_model_getlanguage.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededLanguage, null})); + int sizeLanguage = bytesNeededLanguage.getInt(0); + Pointer bufferLanguage = new Memory(sizeLanguage); + mWrapper.checkError(this, mWrapper.lib3mf_model_getlanguage.invokeInt(new java.lang.Object[]{mHandle, sizeLanguage, bytesNeededLanguage, bufferLanguage})); + return new String(bufferLanguage.getByteArray(0, sizeLanguage - 1), StandardCharsets.UTF_8); + } + + /** + * sets the language of a model + * + * @param language language identifier + * @throws Lib3MFException + */ + public void setLanguage(String language) throws Lib3MFException { + byte[] bytesLanguage = language.getBytes(StandardCharsets.UTF_8); + Memory bufferLanguage = new Memory(bytesLanguage.length + 1); + bufferLanguage.write(0, bytesLanguage, 0, bytesLanguage.length); + bufferLanguage.setByte(bytesLanguage.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_model_setlanguage.invokeInt(new java.lang.Object[]{mHandle, bufferLanguage})); + } + + /** + * creates a model writer instance for a specific file type + * + * @param writerClass string identifier for the file type + * @return string identifier for the file type + * @throws Lib3MFException + */ + public Writer queryWriter(String writerClass) throws Lib3MFException { + byte[] bytesWriterClass = writerClass.getBytes(StandardCharsets.UTF_8); + Memory bufferWriterClass = new Memory(bytesWriterClass.length + 1); + bufferWriterClass.write(0, bytesWriterClass, 0, bytesWriterClass.length); + bufferWriterClass.setByte(bytesWriterClass.length, (byte)0); + Pointer bufferWriterInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_querywriter.invokeInt(new java.lang.Object[]{mHandle, bufferWriterClass, bufferWriterInstance})); + Pointer valueWriterInstance = bufferWriterInstance.getPointer(0); + Writer writerInstance = null; + if (valueWriterInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "WriterInstance was a null pointer"); + } + writerInstance = mWrapper.PolymorphicFactory(valueWriterInstance, Writer.class); + return writerInstance; + } + + /** + * creates a model reader instance for a specific file type + * + * @param readerClass string identifier for the file type + * @return string identifier for the file type + * @throws Lib3MFException + */ + public Reader queryReader(String readerClass) throws Lib3MFException { + byte[] bytesReaderClass = readerClass.getBytes(StandardCharsets.UTF_8); + Memory bufferReaderClass = new Memory(bytesReaderClass.length + 1); + bufferReaderClass.write(0, bytesReaderClass, 0, bytesReaderClass.length); + bufferReaderClass.setByte(bytesReaderClass.length, (byte)0); + Pointer bufferReaderInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_queryreader.invokeInt(new java.lang.Object[]{mHandle, bufferReaderClass, bufferReaderInstance})); + Pointer valueReaderInstance = bufferReaderInstance.getPointer(0); + Reader readerInstance = null; + if (valueReaderInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ReaderInstance was a null pointer"); + } + readerInstance = mWrapper.PolymorphicFactory(valueReaderInstance, Reader.class); + return readerInstance; + } + + /** + * finds a model resource by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the resource instance + * @throws Lib3MFException + */ + public Resource getResourceByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getresourcebyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + Resource resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, Resource.class); + return resource; + } + + /** + * finds a model texture by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the texture2d instance + * @throws Lib3MFException + */ + public Texture2D getTexture2DByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferTextureInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_gettexture2dbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferTextureInstance})); + Pointer valueTextureInstance = bufferTextureInstance.getPointer(0); + Texture2D textureInstance = null; + if (valueTextureInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TextureInstance was a null pointer"); + } + textureInstance = mWrapper.PolymorphicFactory(valueTextureInstance, Texture2D.class); + return textureInstance; + } + + /** + * returns a Property's type + * + * @param uniqueResourceID Resource ID of the Property to Query + * @return returns a Property's type + * @throws Lib3MFException + */ + public Lib3MFWrapper.PropertyType getPropertyTypeByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferThePropertyType = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_model_getpropertytypebyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferThePropertyType})); + return Lib3MFWrapper.EnumConversion.convertConstToPropertyType(bufferThePropertyType.getInt(0)); + } + + /** + * finds a model base material group by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the BaseMaterialGroup instance + * @throws Lib3MFException + */ + public BaseMaterialGroup getBaseMaterialGroupByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferBaseMaterialGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getbasematerialgroupbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferBaseMaterialGroupInstance})); + Pointer valueBaseMaterialGroupInstance = bufferBaseMaterialGroupInstance.getPointer(0); + BaseMaterialGroup baseMaterialGroupInstance = null; + if (valueBaseMaterialGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BaseMaterialGroupInstance was a null pointer"); + } + baseMaterialGroupInstance = mWrapper.PolymorphicFactory(valueBaseMaterialGroupInstance, BaseMaterialGroup.class); + return baseMaterialGroupInstance; + } + + /** + * finds a model texture2d group by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the Texture2DGroup instance + * @throws Lib3MFException + */ + public Texture2DGroup getTexture2DGroupByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferTexture2DGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_gettexture2dgroupbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferTexture2DGroupInstance})); + Pointer valueTexture2DGroupInstance = bufferTexture2DGroupInstance.getPointer(0); + Texture2DGroup texture2DGroupInstance = null; + if (valueTexture2DGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Texture2DGroupInstance was a null pointer"); + } + texture2DGroupInstance = mWrapper.PolymorphicFactory(valueTexture2DGroupInstance, Texture2DGroup.class); + return texture2DGroupInstance; + } + + /** + * finds a model CompositeMaterials by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the CompositeMaterials instance + * @throws Lib3MFException + */ + public CompositeMaterials getCompositeMaterialsByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferCompositeMaterialsInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getcompositematerialsbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferCompositeMaterialsInstance})); + Pointer valueCompositeMaterialsInstance = bufferCompositeMaterialsInstance.getPointer(0); + CompositeMaterials compositeMaterialsInstance = null; + if (valueCompositeMaterialsInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "CompositeMaterialsInstance was a null pointer"); + } + compositeMaterialsInstance = mWrapper.PolymorphicFactory(valueCompositeMaterialsInstance, CompositeMaterials.class); + return compositeMaterialsInstance; + } + + /** + * finds a model MultiPropertyGroup by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the MultiPropertyGroup instance + * @throws Lib3MFException + */ + public MultiPropertyGroup getMultiPropertyGroupByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferMultiPropertyGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getmultipropertygroupbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferMultiPropertyGroupInstance})); + Pointer valueMultiPropertyGroupInstance = bufferMultiPropertyGroupInstance.getPointer(0); + MultiPropertyGroup multiPropertyGroupInstance = null; + if (valueMultiPropertyGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MultiPropertyGroupInstance was a null pointer"); + } + multiPropertyGroupInstance = mWrapper.PolymorphicFactory(valueMultiPropertyGroupInstance, MultiPropertyGroup.class); + return multiPropertyGroupInstance; + } + + /** + * finds a mesh object by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the mesh object instance + * @throws Lib3MFException + */ + public MeshObject getMeshObjectByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferMeshObjectInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getmeshobjectbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferMeshObjectInstance})); + Pointer valueMeshObjectInstance = bufferMeshObjectInstance.getPointer(0); + MeshObject meshObjectInstance = null; + if (valueMeshObjectInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MeshObjectInstance was a null pointer"); + } + meshObjectInstance = mWrapper.PolymorphicFactory(valueMeshObjectInstance, MeshObject.class); + return meshObjectInstance; + } + + /** + * finds a components object by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the components object instance + * @throws Lib3MFException + */ + public ComponentsObject getComponentsObjectByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferComponentsObjectInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getcomponentsobjectbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferComponentsObjectInstance})); + Pointer valueComponentsObjectInstance = bufferComponentsObjectInstance.getPointer(0); + ComponentsObject componentsObjectInstance = null; + if (valueComponentsObjectInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ComponentsObjectInstance was a null pointer"); + } + componentsObjectInstance = mWrapper.PolymorphicFactory(valueComponentsObjectInstance, ComponentsObject.class); + return componentsObjectInstance; + } + + /** + * finds a boolean object by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the boolean object instance + * @throws Lib3MFException + */ + public BooleanObject getBooleanObjectByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferBooleanObjectInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getbooleanobjectbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferBooleanObjectInstance})); + Pointer valueBooleanObjectInstance = bufferBooleanObjectInstance.getPointer(0); + BooleanObject booleanObjectInstance = null; + if (valueBooleanObjectInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BooleanObjectInstance was a null pointer"); + } + booleanObjectInstance = mWrapper.PolymorphicFactory(valueBooleanObjectInstance, BooleanObject.class); + return booleanObjectInstance; + } + + /** + * finds a model color group by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the ColorGroup instance + * @throws Lib3MFException + */ + public ColorGroup getColorGroupByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferColorGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getcolorgroupbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferColorGroupInstance})); + Pointer valueColorGroupInstance = bufferColorGroupInstance.getPointer(0); + ColorGroup colorGroupInstance = null; + if (valueColorGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ColorGroupInstance was a null pointer"); + } + colorGroupInstance = mWrapper.PolymorphicFactory(valueColorGroupInstance, ColorGroup.class); + return colorGroupInstance; + } + + /** + * finds a model slicestack by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the slicestack instance + * @throws Lib3MFException + */ + public SliceStack getSliceStackByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferSliceStacInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getslicestackbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferSliceStacInstance})); + Pointer valueSliceStacInstance = bufferSliceStacInstance.getPointer(0); + SliceStack sliceStacInstance = null; + if (valueSliceStacInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "SliceStacInstance was a null pointer"); + } + sliceStacInstance = mWrapper.PolymorphicFactory(valueSliceStacInstance, SliceStack.class); + return sliceStacInstance; + } + + /** + * finds a level set object by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the level set object instance + * @throws Lib3MFException + */ + public LevelSet getLevelSetByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferLevelSetObjectInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getlevelsetbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferLevelSetObjectInstance})); + Pointer valueLevelSetObjectInstance = bufferLevelSetObjectInstance.getPointer(0); + LevelSet levelSetObjectInstance = null; + if (valueLevelSetObjectInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "LevelSetObjectInstance was a null pointer"); + } + levelSetObjectInstance = mWrapper.PolymorphicFactory(valueLevelSetObjectInstance, LevelSet.class); + return levelSetObjectInstance; + } + + /** + * returns, whether a build has a UUID and, if true, the build's UUID + * + * @return GetBuildUUID Result Tuple + * @throws Lib3MFException + */ + public GetBuildUUIDResult getBuildUUID() throws Lib3MFException { + Pointer bufferHasUUID = new Memory(1); + Pointer bytesNeededUUID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_model_getbuilduuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, 0, bytesNeededUUID, null})); + int sizeUUID = bytesNeededUUID.getInt(0); + Pointer bufferUUID = new Memory(sizeUUID); + mWrapper.checkError(this, mWrapper.lib3mf_model_getbuilduuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, sizeUUID, bytesNeededUUID, bufferUUID})); + GetBuildUUIDResult returnTuple = new GetBuildUUIDResult(); + returnTuple.HasUUID = bufferHasUUID.getByte(0) != 0; + returnTuple.UUID = new String(bufferUUID.getByteArray(0, sizeUUID - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetBuildUUIDResult { + /** + * flag whether the build has a UUID + */ + public boolean HasUUID; + + /** + * the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + */ + public String UUID; + + } + /** + * sets the build's UUID + * + * @param uUID the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * @throws Lib3MFException + */ + public void setBuildUUID(String uUID) throws Lib3MFException { + byte[] bytesUUID = uUID.getBytes(StandardCharsets.UTF_8); + Memory bufferUUID = new Memory(bytesUUID.length + 1); + bufferUUID.write(0, bytesUUID, 0, bytesUUID.length); + bufferUUID.setByte(bytesUUID.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_model_setbuilduuid.invokeInt(new java.lang.Object[]{mHandle, bufferUUID})); + } + + /** + * creates a build item iterator instance with all build items. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public BuildItemIterator getBuildItems() throws Lib3MFException { + Pointer bufferBuildItemIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getbuilditems.invokeInt(new java.lang.Object[]{mHandle, bufferBuildItemIterator})); + Pointer valueBuildItemIterator = bufferBuildItemIterator.getPointer(0); + BuildItemIterator buildItemIterator = null; + if (valueBuildItemIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BuildItemIterator was a null pointer"); + } + buildItemIterator = mWrapper.PolymorphicFactory(valueBuildItemIterator, BuildItemIterator.class); + return buildItemIterator; + } + + /** + * Returns the outbox of a Model + * + * @return Outbox of this Model + * @throws Lib3MFException + */ + public Box getOutbox() throws Lib3MFException { + Pointer bufferOutbox = new Memory(Box.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_model_getoutbox.invokeInt(new java.lang.Object[]{mHandle, bufferOutbox})); + Box outbox = new Box(); + outbox.readFromPointer(bufferOutbox, 0); + return outbox; + } + + /** + * creates a resource iterator instance with all resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public ResourceIterator getResources() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getresources.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + ResourceIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, ResourceIterator.class); + return resourceIterator; + } + + /** + * creates a resource iterator instance with all object resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public ObjectIterator getObjects() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getobjects.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + ObjectIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, ObjectIterator.class); + return resourceIterator; + } + + /** + * creates a resource iterator instance with all mesh object resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public MeshObjectIterator getMeshObjects() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getmeshobjects.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + MeshObjectIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, MeshObjectIterator.class); + return resourceIterator; + } + + /** + * creates a resource iterator instance with all components object resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public ComponentsObjectIterator getComponentsObjects() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getcomponentsobjects.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + ComponentsObjectIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, ComponentsObjectIterator.class); + return resourceIterator; + } + + /** + * creates a resource iterator instance with all boolean object resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public BooleanObjectIterator getBooleanObjects() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getbooleanobjects.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + BooleanObjectIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, BooleanObjectIterator.class); + return resourceIterator; + } + + /** + * creates a Texture2DIterator instance with all texture2d resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public Texture2DIterator getTexture2Ds() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_gettexture2ds.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + Texture2DIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, Texture2DIterator.class); + return resourceIterator; + } + + /** + * creates a BaseMaterialGroupIterator instance with all base material resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public BaseMaterialGroupIterator getBaseMaterialGroups() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getbasematerialgroups.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + BaseMaterialGroupIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, BaseMaterialGroupIterator.class); + return resourceIterator; + } + + /** + * creates a ColorGroupIterator instance with all ColorGroup resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public ColorGroupIterator getColorGroups() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getcolorgroups.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + ColorGroupIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, ColorGroupIterator.class); + return resourceIterator; + } + + /** + * creates a Texture2DGroupIterator instance with all base material resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public Texture2DGroupIterator getTexture2DGroups() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_gettexture2dgroups.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + Texture2DGroupIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, Texture2DGroupIterator.class); + return resourceIterator; + } + + /** + * creates a CompositeMaterialsIterator instance with all CompositeMaterials resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public CompositeMaterialsIterator getCompositeMaterials() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getcompositematerials.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + CompositeMaterialsIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, CompositeMaterialsIterator.class); + return resourceIterator; + } + + /** + * creates a MultiPropertyGroupsIterator instance with all MultiPropertyGroup resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public MultiPropertyGroupIterator getMultiPropertyGroups() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getmultipropertygroups.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + MultiPropertyGroupIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, MultiPropertyGroupIterator.class); + return resourceIterator; + } + + /** + * creates a resource iterator instance with all slice stack resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public SliceStackIterator getSliceStacks() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getslicestacks.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + SliceStackIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, SliceStackIterator.class); + return resourceIterator; + } + + /** + * creates a resource iterator instance with all image3d resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public Image3DIterator getImage3Ds() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getimage3ds.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + Image3DIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, Image3DIterator.class); + return resourceIterator; + } + + /** + * Merges all components and objects which are referenced by a build item into a mesh. The memory is duplicated and a new model is created. + * + * @return returns the merged model instance + * @throws Lib3MFException + */ + public Model mergeToModel() throws Lib3MFException { + Pointer bufferMergedModelInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_mergetomodel.invokeInt(new java.lang.Object[]{mHandle, bufferMergedModelInstance})); + Pointer valueMergedModelInstance = bufferMergedModelInstance.getPointer(0); + Model mergedModelInstance = null; + if (valueMergedModelInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MergedModelInstance was a null pointer"); + } + mergedModelInstance = mWrapper.PolymorphicFactory(valueMergedModelInstance, Model.class); + return mergedModelInstance; + } + + /** + * Merges the given model into this model. + * + * @param modelInstance model to be merged + * @throws Lib3MFException + */ + public void mergeFromModel(Model modelInstance) throws Lib3MFException { + Pointer modelInstanceHandle = null; + if (modelInstance != null) { + modelInstanceHandle = modelInstance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ModelInstance is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_model_mergefrommodel.invokeInt(new java.lang.Object[]{mHandle, modelInstanceHandle})); + } + + /** + * adds an empty mesh object to the model. + * + * @return returns the mesh object instance + * @throws Lib3MFException + */ + public MeshObject addMeshObject() throws Lib3MFException { + Pointer bufferMeshObjectInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addmeshobject.invokeInt(new java.lang.Object[]{mHandle, bufferMeshObjectInstance})); + Pointer valueMeshObjectInstance = bufferMeshObjectInstance.getPointer(0); + MeshObject meshObjectInstance = null; + if (valueMeshObjectInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MeshObjectInstance was a null pointer"); + } + meshObjectInstance = mWrapper.PolymorphicFactory(valueMeshObjectInstance, MeshObject.class); + return meshObjectInstance; + } + + /** + * adds an empty component object to the model. + * + * @return returns the components object instance + * @throws Lib3MFException + */ + public ComponentsObject addComponentsObject() throws Lib3MFException { + Pointer bufferComponentsObjectInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addcomponentsobject.invokeInt(new java.lang.Object[]{mHandle, bufferComponentsObjectInstance})); + Pointer valueComponentsObjectInstance = bufferComponentsObjectInstance.getPointer(0); + ComponentsObject componentsObjectInstance = null; + if (valueComponentsObjectInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ComponentsObjectInstance was a null pointer"); + } + componentsObjectInstance = mWrapper.PolymorphicFactory(valueComponentsObjectInstance, ComponentsObject.class); + return componentsObjectInstance; + } + + /** + * adds an empty boolean object to the model. + * + * @return returns the boolean object instance + * @throws Lib3MFException + */ + public BooleanObject addBooleanObject() throws Lib3MFException { + Pointer bufferBooleanObjectInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addbooleanobject.invokeInt(new java.lang.Object[]{mHandle, bufferBooleanObjectInstance})); + Pointer valueBooleanObjectInstance = bufferBooleanObjectInstance.getPointer(0); + BooleanObject booleanObjectInstance = null; + if (valueBooleanObjectInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BooleanObjectInstance was a null pointer"); + } + booleanObjectInstance = mWrapper.PolymorphicFactory(valueBooleanObjectInstance, BooleanObject.class); + return booleanObjectInstance; + } + + /** + * creates a new model slicestack by its id + * + * @param zBottom Bottom Z value of the slicestack + * @return returns the new slicestack instance + * @throws Lib3MFException + */ + public SliceStack addSliceStack(double zBottom) throws Lib3MFException { + Pointer bufferSliceStackInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addslicestack.invokeInt(new java.lang.Object[]{mHandle, zBottom, bufferSliceStackInstance})); + Pointer valueSliceStackInstance = bufferSliceStackInstance.getPointer(0); + SliceStack sliceStackInstance = null; + if (valueSliceStackInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "SliceStackInstance was a null pointer"); + } + sliceStackInstance = mWrapper.PolymorphicFactory(valueSliceStackInstance, SliceStack.class); + return sliceStackInstance; + } + + /** + * adds a texture2d resource to the model. Its path is given by that of an existing attachment. + * + * @param textureAttachment attachment containing the image data. + * @return returns the new texture instance. + * @throws Lib3MFException + */ + public Texture2D addTexture2DFromAttachment(Attachment textureAttachment) throws Lib3MFException { + Pointer textureAttachmentHandle = null; + if (textureAttachment != null) { + textureAttachmentHandle = textureAttachment.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TextureAttachment is a null value."); + } + Pointer bufferTexture2DInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addtexture2dfromattachment.invokeInt(new java.lang.Object[]{mHandle, textureAttachmentHandle, bufferTexture2DInstance})); + Pointer valueTexture2DInstance = bufferTexture2DInstance.getPointer(0); + Texture2D texture2DInstance = null; + if (valueTexture2DInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Texture2DInstance was a null pointer"); + } + texture2DInstance = mWrapper.PolymorphicFactory(valueTexture2DInstance, Texture2D.class); + return texture2DInstance; + } + + /** + * adds an empty BaseMaterialGroup resource to the model. + * + * @return returns the new base material instance. + * @throws Lib3MFException + */ + public BaseMaterialGroup addBaseMaterialGroup() throws Lib3MFException { + Pointer bufferBaseMaterialGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addbasematerialgroup.invokeInt(new java.lang.Object[]{mHandle, bufferBaseMaterialGroupInstance})); + Pointer valueBaseMaterialGroupInstance = bufferBaseMaterialGroupInstance.getPointer(0); + BaseMaterialGroup baseMaterialGroupInstance = null; + if (valueBaseMaterialGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BaseMaterialGroupInstance was a null pointer"); + } + baseMaterialGroupInstance = mWrapper.PolymorphicFactory(valueBaseMaterialGroupInstance, BaseMaterialGroup.class); + return baseMaterialGroupInstance; + } + + /** + * adds an empty ColorGroup resource to the model. + * + * @return returns the new ColorGroup instance. + * @throws Lib3MFException + */ + public ColorGroup addColorGroup() throws Lib3MFException { + Pointer bufferColorGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addcolorgroup.invokeInt(new java.lang.Object[]{mHandle, bufferColorGroupInstance})); + Pointer valueColorGroupInstance = bufferColorGroupInstance.getPointer(0); + ColorGroup colorGroupInstance = null; + if (valueColorGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ColorGroupInstance was a null pointer"); + } + colorGroupInstance = mWrapper.PolymorphicFactory(valueColorGroupInstance, ColorGroup.class); + return colorGroupInstance; + } + + /** + * adds an empty Texture2DGroup resource to the model. + * + * @param texture2DInstance The texture2D instance of the created Texture2DGroup. + * @return returns the new Texture2DGroup instance. + * @throws Lib3MFException + */ + public Texture2DGroup addTexture2DGroup(Texture2D texture2DInstance) throws Lib3MFException { + Pointer texture2DInstanceHandle = null; + if (texture2DInstance != null) { + texture2DInstanceHandle = texture2DInstance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Texture2DInstance is a null value."); + } + Pointer bufferTexture2DGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addtexture2dgroup.invokeInt(new java.lang.Object[]{mHandle, texture2DInstanceHandle, bufferTexture2DGroupInstance})); + Pointer valueTexture2DGroupInstance = bufferTexture2DGroupInstance.getPointer(0); + Texture2DGroup texture2DGroupInstance = null; + if (valueTexture2DGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Texture2DGroupInstance was a null pointer"); + } + texture2DGroupInstance = mWrapper.PolymorphicFactory(valueTexture2DGroupInstance, Texture2DGroup.class); + return texture2DGroupInstance; + } + + /** + * adds an empty CompositeMaterials resource to the model. + * + * @param baseMaterialGroupInstance The BaseMaterialGroup instance of the created CompositeMaterials. + * @return returns the new CompositeMaterials instance. + * @throws Lib3MFException + */ + public CompositeMaterials addCompositeMaterials(BaseMaterialGroup baseMaterialGroupInstance) throws Lib3MFException { + Pointer baseMaterialGroupInstanceHandle = null; + if (baseMaterialGroupInstance != null) { + baseMaterialGroupInstanceHandle = baseMaterialGroupInstance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BaseMaterialGroupInstance is a null value."); + } + Pointer bufferCompositeMaterialsInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addcompositematerials.invokeInt(new java.lang.Object[]{mHandle, baseMaterialGroupInstanceHandle, bufferCompositeMaterialsInstance})); + Pointer valueCompositeMaterialsInstance = bufferCompositeMaterialsInstance.getPointer(0); + CompositeMaterials compositeMaterialsInstance = null; + if (valueCompositeMaterialsInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "CompositeMaterialsInstance was a null pointer"); + } + compositeMaterialsInstance = mWrapper.PolymorphicFactory(valueCompositeMaterialsInstance, CompositeMaterials.class); + return compositeMaterialsInstance; + } + + /** + * adds an empty MultiPropertyGroup resource to the model. + * + * @return returns the new MultiPropertyGroup instance. + * @throws Lib3MFException + */ + public MultiPropertyGroup addMultiPropertyGroup() throws Lib3MFException { + Pointer bufferMultiPropertyGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addmultipropertygroup.invokeInt(new java.lang.Object[]{mHandle, bufferMultiPropertyGroupInstance})); + Pointer valueMultiPropertyGroupInstance = bufferMultiPropertyGroupInstance.getPointer(0); + MultiPropertyGroup multiPropertyGroupInstance = null; + if (valueMultiPropertyGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MultiPropertyGroupInstance was a null pointer"); + } + multiPropertyGroupInstance = mWrapper.PolymorphicFactory(valueMultiPropertyGroupInstance, MultiPropertyGroup.class); + return multiPropertyGroupInstance; + } + + /** + * creates a new 3D Image Resource + * + * @param columnCount the number of columns in each sheet. + * @param rowCount the number of rows in each sheet. + * @param sheetCount the number of sheets in the image stack. + * @return returns the new ImageStack instance + * @throws Lib3MFException + */ + public ImageStack addImageStack(int columnCount, int rowCount, int sheetCount) throws Lib3MFException { + Pointer bufferInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addimagestack.invokeInt(new java.lang.Object[]{mHandle, columnCount, rowCount, sheetCount, bufferInstance})); + Pointer valueInstance = bufferInstance.getPointer(0); + ImageStack instance = null; + if (valueInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Instance was a null pointer"); + } + instance = mWrapper.PolymorphicFactory(valueInstance, ImageStack.class); + return instance; + } + + /** + * finds an ImageStack object by its UniqueResourceID + * + * @param uniqueResourceID UniqueResourceID + * @return returns the image stack instance + * @throws Lib3MFException + */ + public ImageStack getImageStackByID(int uniqueResourceID) throws Lib3MFException { + Pointer bufferImageStackInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getimagestackbyid.invokeInt(new java.lang.Object[]{mHandle, uniqueResourceID, bufferImageStackInstance})); + Pointer valueImageStackInstance = bufferImageStackInstance.getPointer(0); + ImageStack imageStackInstance = null; + if (valueImageStackInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ImageStackInstance was a null pointer"); + } + imageStackInstance = mWrapper.PolymorphicFactory(valueImageStackInstance, ImageStack.class); + return imageStackInstance; + } + + /** + * adds a build item to the model. + * + * @param object Object instance. + * @param transform Transformation matrix. + * @return returns the build item instance. + * @throws Lib3MFException + */ + public BuildItem addBuildItem(Object object, Transform transform) throws Lib3MFException { + Pointer objectHandle = null; + if (object != null) { + objectHandle = object.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Object is a null value."); + } + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + Pointer bufferBuildItemInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addbuilditem.invokeInt(new java.lang.Object[]{mHandle, objectHandle, bufferTransform, bufferBuildItemInstance})); + Pointer valueBuildItemInstance = bufferBuildItemInstance.getPointer(0); + BuildItem buildItemInstance = null; + if (valueBuildItemInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BuildItemInstance was a null pointer"); + } + buildItemInstance = mWrapper.PolymorphicFactory(valueBuildItemInstance, BuildItem.class); + return buildItemInstance; + } + + /** + * removes a build item from the model + * + * @param buildItemInstance Build item to remove. + * @throws Lib3MFException + */ + public void removeBuildItem(BuildItem buildItemInstance) throws Lib3MFException { + Pointer buildItemInstanceHandle = null; + if (buildItemInstance != null) { + buildItemInstanceHandle = buildItemInstance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BuildItemInstance is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_model_removebuilditem.invokeInt(new java.lang.Object[]{mHandle, buildItemInstanceHandle})); + } + + /** + * Returns the metadata of the model as MetaDataGroup + * + * @return returns an Instance of the metadatagroup of the model + * @throws Lib3MFException + */ + public MetaDataGroup getMetaDataGroup() throws Lib3MFException { + Pointer bufferTheMetaDataGroup = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getmetadatagroup.invokeInt(new java.lang.Object[]{mHandle, bufferTheMetaDataGroup})); + Pointer valueTheMetaDataGroup = bufferTheMetaDataGroup.getPointer(0); + MetaDataGroup theMetaDataGroup = null; + if (valueTheMetaDataGroup == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheMetaDataGroup was a null pointer"); + } + theMetaDataGroup = mWrapper.PolymorphicFactory(valueTheMetaDataGroup, MetaDataGroup.class); + return theMetaDataGroup; + } + + /** + * adds an attachment stream to the model. The OPC part will be related to the model stream with a certain relationship type. + * + * @param uRI Path of the attachment + * @param relationShipType Relationship type of the attachment + * @return Instance of the attachment object + * @throws Lib3MFException + */ + public Attachment addAttachment(String uRI, String relationShipType) throws Lib3MFException { + byte[] bytesURI = uRI.getBytes(StandardCharsets.UTF_8); + Memory bufferURI = new Memory(bytesURI.length + 1); + bufferURI.write(0, bytesURI, 0, bytesURI.length); + bufferURI.setByte(bytesURI.length, (byte)0); + byte[] bytesRelationShipType = relationShipType.getBytes(StandardCharsets.UTF_8); + Memory bufferRelationShipType = new Memory(bytesRelationShipType.length + 1); + bufferRelationShipType.write(0, bytesRelationShipType, 0, bytesRelationShipType.length); + bufferRelationShipType.setByte(bytesRelationShipType.length, (byte)0); + Pointer bufferAttachmentInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addattachment.invokeInt(new java.lang.Object[]{mHandle, bufferURI, bufferRelationShipType, bufferAttachmentInstance})); + Pointer valueAttachmentInstance = bufferAttachmentInstance.getPointer(0); + Attachment attachmentInstance = null; + if (valueAttachmentInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "AttachmentInstance was a null pointer"); + } + attachmentInstance = mWrapper.PolymorphicFactory(valueAttachmentInstance, Attachment.class); + return attachmentInstance; + } + + /** + * Removes attachment from the model. + * + * @param attachmentInstance Attachment instance to remove + * @throws Lib3MFException + */ + public void removeAttachment(Attachment attachmentInstance) throws Lib3MFException { + Pointer attachmentInstanceHandle = null; + if (attachmentInstance != null) { + attachmentInstanceHandle = attachmentInstance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "AttachmentInstance is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_model_removeattachment.invokeInt(new java.lang.Object[]{mHandle, attachmentInstanceHandle})); + } + + /** + * retrieves an attachment stream object from the model.. + * + * @param index Index of the attachment stream + * @return Instance of the attachment object + * @throws Lib3MFException + */ + public Attachment getAttachment(int index) throws Lib3MFException { + Pointer bufferAttachmentInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getattachment.invokeInt(new java.lang.Object[]{mHandle, index, bufferAttachmentInstance})); + Pointer valueAttachmentInstance = bufferAttachmentInstance.getPointer(0); + Attachment attachmentInstance = null; + if (valueAttachmentInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "AttachmentInstance was a null pointer"); + } + attachmentInstance = mWrapper.PolymorphicFactory(valueAttachmentInstance, Attachment.class); + return attachmentInstance; + } + + /** + * retrieves an attachment stream object from the model. + * + * @param uRI Path URI in the package + * @return Instance of the attachment object + * @throws Lib3MFException + */ + public Attachment findAttachment(String uRI) throws Lib3MFException { + byte[] bytesURI = uRI.getBytes(StandardCharsets.UTF_8); + Memory bufferURI = new Memory(bytesURI.length + 1); + bufferURI.write(0, bytesURI, 0, bytesURI.length); + bufferURI.setByte(bytesURI.length, (byte)0); + Pointer bufferAttachmentInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_findattachment.invokeInt(new java.lang.Object[]{mHandle, bufferURI, bufferAttachmentInstance})); + Pointer valueAttachmentInstance = bufferAttachmentInstance.getPointer(0); + Attachment attachmentInstance = null; + if (valueAttachmentInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "AttachmentInstance was a null pointer"); + } + attachmentInstance = mWrapper.PolymorphicFactory(valueAttachmentInstance, Attachment.class); + return attachmentInstance; + } + + /** + * retrieves the number of attachments of the model. + * + * @return Returns the number of attachments. + * @throws Lib3MFException + */ + public int getAttachmentCount() throws Lib3MFException { + Pointer bufferAttachmentCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_model_getattachmentcount.invokeInt(new java.lang.Object[]{mHandle, bufferAttachmentCount})); + return bufferAttachmentCount.getInt(0); + } + + /** + * Retrieve whether the OPC package contains a package thumbnail. + * + * @return returns whether the OPC package contains a package thumbnail + * @throws Lib3MFException + */ + public boolean hasPackageThumbnailAttachment() throws Lib3MFException { + Pointer bufferHasThumbnail = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_model_haspackagethumbnailattachment.invokeInt(new java.lang.Object[]{mHandle, bufferHasThumbnail})); + return bufferHasThumbnail.getByte(0) != 0; + } + + /** + * Create a new or the existing package thumbnail for the OPC package. + * + * @return Instance of a new or the existing thumbnailattachment object. + * @throws Lib3MFException + */ + public Attachment createPackageThumbnailAttachment() throws Lib3MFException { + Pointer bufferAttachment = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_createpackagethumbnailattachment.invokeInt(new java.lang.Object[]{mHandle, bufferAttachment})); + Pointer valueAttachment = bufferAttachment.getPointer(0); + Attachment attachment = null; + if (valueAttachment == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Attachment was a null pointer"); + } + attachment = mWrapper.PolymorphicFactory(valueAttachment, Attachment.class); + return attachment; + } + + /** + * Get the attachment to the OPC package containing the package thumbnail. + * + * @return Instance of the thumbnailattachment object or NULL. + * @throws Lib3MFException + */ + public Attachment getPackageThumbnailAttachment() throws Lib3MFException { + Pointer bufferAttachment = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getpackagethumbnailattachment.invokeInt(new java.lang.Object[]{mHandle, bufferAttachment})); + Pointer valueAttachment = bufferAttachment.getPointer(0); + Attachment attachment = null; + if (valueAttachment != Pointer.NULL) { + attachment = mWrapper.PolymorphicFactory(valueAttachment, Attachment.class); + } + return attachment; + } + + /** + * Remove the attachment to the OPC package containing the package thumbnail. + * + * @throws Lib3MFException + */ + public void removePackageThumbnailAttachment() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_model_removepackagethumbnailattachment.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Adds a new Content Type to the model. + * + * @param extension File Extension + * @param contentType Content Type Identifier + * @throws Lib3MFException + */ + public void addCustomContentType(String extension, String contentType) throws Lib3MFException { + byte[] bytesExtension = extension.getBytes(StandardCharsets.UTF_8); + Memory bufferExtension = new Memory(bytesExtension.length + 1); + bufferExtension.write(0, bytesExtension, 0, bytesExtension.length); + bufferExtension.setByte(bytesExtension.length, (byte)0); + byte[] bytesContentType = contentType.getBytes(StandardCharsets.UTF_8); + Memory bufferContentType = new Memory(bytesContentType.length + 1); + bufferContentType.write(0, bytesContentType, 0, bytesContentType.length); + bufferContentType.setByte(bytesContentType.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_model_addcustomcontenttype.invokeInt(new java.lang.Object[]{mHandle, bufferExtension, bufferContentType})); + } + + /** + * Removes a custom Content Type from the model (UTF8 version). + * + * @param extension File Extension + * @throws Lib3MFException + */ + public void removeCustomContentType(String extension) throws Lib3MFException { + byte[] bytesExtension = extension.getBytes(StandardCharsets.UTF_8); + Memory bufferExtension = new Memory(bytesExtension.length + 1); + bufferExtension.write(0, bytesExtension, 0, bytesExtension.length); + bufferExtension.setByte(bytesExtension.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_model_removecustomcontenttype.invokeInt(new java.lang.Object[]{mHandle, bufferExtension})); + } + + /** + * Sets the random number generator callback for use in the library + * + * @param theCallback The callback used to generate random numbers + * @param userData Userdata to be passed to the callback function + * @throws Lib3MFException + */ + public void setRandomNumberCallback(Lib3MFWrapper.RandomNumberCallback theCallback, Pointer userData) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_model_setrandomnumbercallback.invokeInt(new java.lang.Object[]{mHandle, theCallback, userData})); + } + + /** + * Gets the keystore associated with this model + * + * @return The package keystore + * @throws Lib3MFException + */ + public KeyStore getKeyStore() throws Lib3MFException { + Pointer bufferKeyStore = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getkeystore.invokeInt(new java.lang.Object[]{mHandle, bufferKeyStore})); + Pointer valueKeyStore = bufferKeyStore.getPointer(0); + KeyStore keyStore = null; + if (valueKeyStore == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "KeyStore was a null pointer"); + } + keyStore = mWrapper.PolymorphicFactory(valueKeyStore, KeyStore.class); + return keyStore; + } + + /** + * creates a resource iterator for all functions + * + * @return returns the resource iterator + * @throws Lib3MFException + */ + public FunctionIterator getFunctions() throws Lib3MFException { + Pointer bufferTheResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getfunctions.invokeInt(new java.lang.Object[]{mHandle, bufferTheResourceIterator})); + Pointer valueTheResourceIterator = bufferTheResourceIterator.getPointer(0); + FunctionIterator theResourceIterator = null; + if (valueTheResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheResourceIterator was a null pointer"); + } + theResourceIterator = mWrapper.PolymorphicFactory(valueTheResourceIterator, FunctionIterator.class); + return theResourceIterator; + } + + /** + * adds a function described by nodes to the model + * + * @return returns the function instance + * @throws Lib3MFException + */ + public ImplicitFunction addImplicitFunction() throws Lib3MFException { + Pointer bufferFunctionInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addimplicitfunction.invokeInt(new java.lang.Object[]{mHandle, bufferFunctionInstance})); + Pointer valueFunctionInstance = bufferFunctionInstance.getPointer(0); + ImplicitFunction functionInstance = null; + if (valueFunctionInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "FunctionInstance was a null pointer"); + } + functionInstance = mWrapper.PolymorphicFactory(valueFunctionInstance, ImplicitFunction.class); + return functionInstance; + } + + /** + * adds a function defined by an image3d to the model + * + * @param image3DInstance the Image3D-instance used for this function + * @return returns the function instance + * @throws Lib3MFException + */ + public FunctionFromImage3D addFunctionFromImage3D(Image3D image3DInstance) throws Lib3MFException { + Pointer image3DInstanceHandle = null; + if (image3DInstance != null) { + image3DInstanceHandle = image3DInstance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Image3DInstance is a null value."); + } + Pointer bufferFunctionInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addfunctionfromimage3d.invokeInt(new java.lang.Object[]{mHandle, image3DInstanceHandle, bufferFunctionInstance})); + Pointer valueFunctionInstance = bufferFunctionInstance.getPointer(0); + FunctionFromImage3D functionInstance = null; + if (valueFunctionInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "FunctionInstance was a null pointer"); + } + functionInstance = mWrapper.PolymorphicFactory(valueFunctionInstance, FunctionFromImage3D.class); + return functionInstance; + } + + /** + * adds a volume data resource to the model. + * + * @return returns the new volume data instance. + * @throws Lib3MFException + */ + public VolumeData addVolumeData() throws Lib3MFException { + Pointer bufferVolumeDataInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addvolumedata.invokeInt(new java.lang.Object[]{mHandle, bufferVolumeDataInstance})); + Pointer valueVolumeDataInstance = bufferVolumeDataInstance.getPointer(0); + VolumeData volumeDataInstance = null; + if (valueVolumeDataInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "VolumeDataInstance was a null pointer"); + } + volumeDataInstance = mWrapper.PolymorphicFactory(valueVolumeDataInstance, VolumeData.class); + return volumeDataInstance; + } + + /** + * adds an empty boundary shape object to the model. + * + * @return returns the mesh object instance + * @throws Lib3MFException + */ + public LevelSet addLevelSet() throws Lib3MFException { + Pointer bufferLevelSetInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_addlevelset.invokeInt(new java.lang.Object[]{mHandle, bufferLevelSetInstance})); + Pointer valueLevelSetInstance = bufferLevelSetInstance.getPointer(0); + LevelSet levelSetInstance = null; + if (valueLevelSetInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "LevelSetInstance was a null pointer"); + } + levelSetInstance = mWrapper.PolymorphicFactory(valueLevelSetInstance, LevelSet.class); + return levelSetInstance; + } + + /** + * creates a resource iterator instance with all boundary shape resources. + * + * @return returns the iterator instance. + * @throws Lib3MFException + */ + public LevelSetIterator getLevelSets() throws Lib3MFException { + Pointer bufferResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_model_getlevelsets.invokeInt(new java.lang.Object[]{mHandle, bufferResourceIterator})); + Pointer valueResourceIterator = bufferResourceIterator.getPointer(0); + LevelSetIterator resourceIterator = null; + if (valueResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "ResourceIterator was a null pointer"); + } + resourceIterator = mWrapper.PolymorphicFactory(valueResourceIterator, LevelSetIterator.class); + return resourceIterator; + } + + /** + * Removes a resource from the model + * + * @param resource The resource to remove + * @throws Lib3MFException + */ + public void removeResource(Resource resource) throws Lib3MFException { + Pointer resourceHandle = null; + if (resource != null) { + resourceHandle = resource.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_model_removeresource.invokeInt(new java.lang.Object[]{mHandle, resourceHandle})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/MultiPropertyGroup.java b/Autogenerated/Bindings/Java9/lib3mf/MultiPropertyGroup.java new file mode 100644 index 000000000..d6287f451 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/MultiPropertyGroup.java @@ -0,0 +1,194 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MultiPropertyGroup extends Resource { + + public MultiPropertyGroup(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the count of MultiProperty-s in the MultiPropertyGroup. + * + * @return returns the count of MultiProperty-s + * @throws Lib3MFException + */ + public int getCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_getcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup + * + * @return PropertyID of the MultiProperty-s in the MultiPropertyGroup. + * @throws Lib3MFException + */ + public int[] getAllPropertyIDs() throws Lib3MFException { + Pointer countNeededPropertyIDs = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededPropertyIDs, Pointer.NULL})); + long countPropertyIDs = countNeededPropertyIDs.getLong(0); + Pointer bufferPropertyIDs = new Memory(Math.max(1, 4 * countPropertyIDs)); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, countPropertyIDs, countNeededPropertyIDs, bufferPropertyIDs})); + return bufferPropertyIDs.getIntArray(0, (int)countPropertyIDs); + } + + /** + * Adds a new MultiProperty to the MultiPropertyGroup. + * + * @param propertyIDs The PropertyIDs of the new MultiProperty. + * @return returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. + * @throws Lib3MFException + */ + public int addMultiProperty(int[] propertyIDs) throws Lib3MFException { + Pointer bufferPropertyIDs = new Memory(Math.max(1, 4 * propertyIDs.length)); + for (int i = 0; i < propertyIDs.length; i++) { + bufferPropertyIDs.setInt(4 * i, propertyIDs[i]); + } + Pointer bufferPropertyID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_addmultiproperty.invokeInt(new java.lang.Object[]{mHandle, (long) propertyIDs.length, bufferPropertyIDs, bufferPropertyID})); + return bufferPropertyID.getInt(0); + } + + /** + * Sets the PropertyIDs of a MultiProperty. + * + * @param propertyID the PropertyID of the MultiProperty to be changed. + * @param propertyIDs The new PropertyIDs of the MultiProperty + * @throws Lib3MFException + */ + public void setMultiProperty(int propertyID, int[] propertyIDs) throws Lib3MFException { + Pointer bufferPropertyIDs = new Memory(Math.max(1, 4 * propertyIDs.length)); + for (int i = 0; i < propertyIDs.length; i++) { + bufferPropertyIDs.setInt(4 * i, propertyIDs[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_setmultiproperty.invokeInt(new java.lang.Object[]{mHandle, propertyID, (long) propertyIDs.length, bufferPropertyIDs})); + } + + /** + * Obtains the PropertyIDs of a MultiProperty. + * + * @param propertyID the PropertyID of the MultiProperty to be queried. + * @return The PropertyIDs of the MultiProperty + * @throws Lib3MFException + */ + public int[] getMultiProperty(int propertyID) throws Lib3MFException { + Pointer countNeededPropertyIDs = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_getmultiproperty.invokeInt(new java.lang.Object[]{mHandle, propertyID, 0L, countNeededPropertyIDs, Pointer.NULL})); + long countPropertyIDs = countNeededPropertyIDs.getLong(0); + Pointer bufferPropertyIDs = new Memory(Math.max(1, 4 * countPropertyIDs)); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_getmultiproperty.invokeInt(new java.lang.Object[]{mHandle, propertyID, countPropertyIDs, countNeededPropertyIDs, bufferPropertyIDs})); + return bufferPropertyIDs.getIntArray(0, (int)countPropertyIDs); + } + + /** + * Removes a MultiProperty from this MultiPropertyGroup. + * + * @param propertyID the PropertyID of the MultiProperty to be removed. + * @throws Lib3MFException + */ + public void removeMultiProperty(int propertyID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_removemultiproperty.invokeInt(new java.lang.Object[]{mHandle, propertyID})); + } + + /** + * Retrieves the number of layers of this MultiPropertyGroup. + * + * @return returns the number of layers + * @throws Lib3MFException + */ + public int getLayerCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_getlayercount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Adds a MultiPropertyLayer to this MultiPropertyGroup. + * + * @param theLayer The MultiPropertyLayer to add to this MultiPropertyGroup + * @return returns the index of this MultiPropertyLayer + * @throws Lib3MFException + */ + public int addLayer(MultiPropertyLayer theLayer) throws Lib3MFException { + Pointer bufferTheLayer = new Memory(MultiPropertyLayer.SIZE); + theLayer.writeToPointer(bufferTheLayer, 0); + Pointer bufferLayerIndex = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_addlayer.invokeInt(new java.lang.Object[]{mHandle, bufferTheLayer, bufferLayerIndex})); + return bufferLayerIndex.getInt(0); + } + + /** + * Obtains a MultiPropertyLayer of this MultiPropertyGroup. + * + * @param layerIndex The Index of the MultiPropertyLayer queried + * @return The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup + * @throws Lib3MFException + */ + public MultiPropertyLayer getLayer(int layerIndex) throws Lib3MFException { + Pointer bufferTheLayer = new Memory(MultiPropertyLayer.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_getlayer.invokeInt(new java.lang.Object[]{mHandle, layerIndex, bufferTheLayer})); + MultiPropertyLayer theLayer = new MultiPropertyLayer(); + theLayer.readFromPointer(bufferTheLayer, 0); + return theLayer; + } + + /** + * Removes a MultiPropertyLayer from this MultiPropertyGroup. + * + * @param layerIndex The Index of the MultiPropertyLayer to be removed + * @throws Lib3MFException + */ + public void removeLayer(int layerIndex) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroup_removelayer.invokeInt(new java.lang.Object[]{mHandle, layerIndex})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/MultiPropertyGroupIterator.java b/Autogenerated/Bindings/Java9/lib3mf/MultiPropertyGroupIterator.java new file mode 100644 index 000000000..ca596f4e7 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/MultiPropertyGroupIterator.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MultiPropertyGroupIterator extends ResourceIterator { + + public MultiPropertyGroupIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the MultiPropertyGroup the iterator points at. + * + * @return returns the MultiPropertyGroup instance. + * @throws Lib3MFException + */ + public MultiPropertyGroup getCurrentMultiPropertyGroup() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + MultiPropertyGroup resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, MultiPropertyGroup.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/MultiPropertyLayer.java b/Autogenerated/Bindings/Java9/lib3mf/MultiPropertyLayer.java new file mode 100644 index 000000000..fd6e38a45 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/MultiPropertyLayer.java @@ -0,0 +1,63 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class MultiPropertyLayer { + + public int ResourceID; + + public int TheBlendMethod; + + public static final int SIZE = 8; + + public void readFromPointer(Pointer p, long offset) { + ResourceID = p.getInt(offset + 0); + TheBlendMethod = p.getInt(offset + 4); + } + + public void writeToPointer(Pointer p, long offset) { + p.setInt(offset + 0, ResourceID); + p.setInt(offset + 4, TheBlendMethod); + } + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/MultiplicationNode.java b/Autogenerated/Bindings/Java9/lib3mf/MultiplicationNode.java new file mode 100644 index 000000000..9fbbf3843 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/MultiplicationNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class MultiplicationNode extends TwoInputNode { + + public MultiplicationNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/NodeIterator.java b/Autogenerated/Bindings/Java9/lib3mf/NodeIterator.java new file mode 100644 index 000000000..d1bf57277 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/NodeIterator.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class NodeIterator extends Iterator { + + public NodeIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the current element + * + * @return The current element + * @throws Lib3MFException + */ + public ImplicitNode getCurrent() throws Lib3MFException { + Pointer bufferNode = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_nodeiterator_getcurrent.invokeInt(new java.lang.Object[]{mHandle, bufferNode})); + Pointer valueNode = bufferNode.getPointer(0); + ImplicitNode node = null; + if (valueNode == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Node was a null pointer"); + } + node = mWrapper.PolymorphicFactory(valueNode, ImplicitNode.class); + return node; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/NormalizeDistanceNode.java b/Autogenerated/Bindings/Java9/lib3mf/NormalizeDistanceNode.java new file mode 100644 index 000000000..da41811e9 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/NormalizeDistanceNode.java @@ -0,0 +1,187 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class NormalizeDistanceNode extends ImplicitNode { + + public NormalizeDistanceNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the function id + * + * @return the input port for the function + * @throws Lib3MFException + */ + public ImplicitPort getInputFunctionID() throws Lib3MFException { + Pointer bufferFunction = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_getinputfunctionid.invokeInt(new java.lang.Object[]{mHandle, bufferFunction})); + Pointer valueFunction = bufferFunction.getPointer(0); + ImplicitPort function = null; + if (valueFunction == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Function was a null pointer"); + } + function = mWrapper.PolymorphicFactory(valueFunction, ImplicitPort.class); + return function; + } + + /** + * Retrieves the input for the position + * + * @return the input port for the position (vector) + * @throws Lib3MFException + */ + public ImplicitPort getInputPos() throws Lib3MFException { + Pointer bufferPos = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_getinputpos.invokeInt(new java.lang.Object[]{mHandle, bufferPos})); + Pointer valuePos = bufferPos.getPointer(0); + ImplicitPort pos = null; + if (valuePos == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Pos was a null pointer"); + } + pos = mWrapper.PolymorphicFactory(valuePos, ImplicitPort.class); + return pos; + } + + /** + * Retrieves the input for the finite difference step + * + * @return the input port for the finite difference step + * @throws Lib3MFException + */ + public ImplicitPort getInputStep() throws Lib3MFException { + Pointer bufferStep = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_getinputstep.invokeInt(new java.lang.Object[]{mHandle, bufferStep})); + Pointer valueStep = bufferStep.getPointer(0); + ImplicitPort step = null; + if (valueStep == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Step was a null pointer"); + } + step = mWrapper.PolymorphicFactory(valueStep, ImplicitPort.class); + return step; + } + + /** + * Sets the name of the referenced scalar output + * + * @param scalarOutputName the name of the scalar output of the referenced function + * @throws Lib3MFException + */ + public void setScalarOutputName(String scalarOutputName) throws Lib3MFException { + byte[] bytesScalarOutputName = scalarOutputName.getBytes(StandardCharsets.UTF_8); + Memory bufferScalarOutputName = new Memory(bytesScalarOutputName.length + 1); + bufferScalarOutputName.write(0, bytesScalarOutputName, 0, bytesScalarOutputName.length); + bufferScalarOutputName.setByte(bytesScalarOutputName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_setscalaroutputname.invokeInt(new java.lang.Object[]{mHandle, bufferScalarOutputName})); + } + + /** + * Retrieves the name of the referenced scalar output + * + * @return the name of the scalar output of the referenced function + * @throws Lib3MFException + */ + public String getScalarOutputName() throws Lib3MFException { + Pointer bytesNeededScalarOutputName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_getscalaroutputname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededScalarOutputName, null})); + int sizeScalarOutputName = bytesNeededScalarOutputName.getInt(0); + Pointer bufferScalarOutputName = new Memory(sizeScalarOutputName); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_getscalaroutputname.invokeInt(new java.lang.Object[]{mHandle, sizeScalarOutputName, bytesNeededScalarOutputName, bufferScalarOutputName})); + return new String(bufferScalarOutputName.getByteArray(0, sizeScalarOutputName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the name of the referenced vector input + * + * @param vectorInputName the name of the vector input (float3) of the referenced function + * @throws Lib3MFException + */ + public void setVectorInputName(String vectorInputName) throws Lib3MFException { + byte[] bytesVectorInputName = vectorInputName.getBytes(StandardCharsets.UTF_8); + Memory bufferVectorInputName = new Memory(bytesVectorInputName.length + 1); + bufferVectorInputName.write(0, bytesVectorInputName, 0, bytesVectorInputName.length); + bufferVectorInputName.setByte(bytesVectorInputName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_setvectorinputname.invokeInt(new java.lang.Object[]{mHandle, bufferVectorInputName})); + } + + /** + * Retrieves the name of the referenced vector input + * + * @return the name of the vector input (float3) of the referenced function + * @throws Lib3MFException + */ + public String getVectorInputName() throws Lib3MFException { + Pointer bytesNeededVectorInputName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_getvectorinputname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededVectorInputName, null})); + int sizeVectorInputName = bytesNeededVectorInputName.getInt(0); + Pointer bufferVectorInputName = new Memory(sizeVectorInputName); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_getvectorinputname.invokeInt(new java.lang.Object[]{mHandle, sizeVectorInputName, bytesNeededVectorInputName, bufferVectorInputName})); + return new String(bufferVectorInputName.getByteArray(0, sizeVectorInputName - 1), StandardCharsets.UTF_8); + } + + /** + * Retrieves the normalized result output + * + * @return the output port for the normalized distance + * @throws Lib3MFException + */ + public ImplicitPort getOutputResult() throws Lib3MFException { + Pointer bufferResult = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_normalizedistancenode_getoutputresult.invokeInt(new java.lang.Object[]{mHandle, bufferResult})); + Pointer valueResult = bufferResult.getPointer(0); + ImplicitPort result = null; + if (valueResult == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Result was a null pointer"); + } + result = mWrapper.PolymorphicFactory(valueResult, ImplicitPort.class); + return result; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Object.java b/Autogenerated/Bindings/Java9/lib3mf/Object.java new file mode 100644 index 000000000..2f80fac8b --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Object.java @@ -0,0 +1,394 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Object extends Resource { + + public Object(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves an object's type + * + * @return returns object type enum. + * @throws Lib3MFException + */ + public Lib3MFWrapper.ObjectType getType() throws Lib3MFException { + Pointer bufferObjectType = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_object_gettype.invokeInt(new java.lang.Object[]{mHandle, bufferObjectType})); + return Lib3MFWrapper.EnumConversion.convertConstToObjectType(bufferObjectType.getInt(0)); + } + + /** + * Sets an object's type + * + * @param objectType object type enum. + * @throws Lib3MFException + */ + public void setType(Lib3MFWrapper.ObjectType objectType) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_object_settype.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertObjectTypeToConst(objectType)})); + } + + /** + * Retrieves an object's name + * + * @return returns object name. + * @throws Lib3MFException + */ + public String getName() throws Lib3MFException { + Pointer bytesNeededName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_object_getname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededName, null})); + int sizeName = bytesNeededName.getInt(0); + Pointer bufferName = new Memory(sizeName); + mWrapper.checkError(this, mWrapper.lib3mf_object_getname.invokeInt(new java.lang.Object[]{mHandle, sizeName, bytesNeededName, bufferName})); + return new String(bufferName.getByteArray(0, sizeName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets an object's name string + * + * @param name new object name. + * @throws Lib3MFException + */ + public void setName(String name) throws Lib3MFException { + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_object_setname.invokeInt(new java.lang.Object[]{mHandle, bufferName})); + } + + /** + * Retrieves an object's part number + * + * @return returns object part number. + * @throws Lib3MFException + */ + public String getPartNumber() throws Lib3MFException { + Pointer bytesNeededPartNumber = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_object_getpartnumber.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededPartNumber, null})); + int sizePartNumber = bytesNeededPartNumber.getInt(0); + Pointer bufferPartNumber = new Memory(sizePartNumber); + mWrapper.checkError(this, mWrapper.lib3mf_object_getpartnumber.invokeInt(new java.lang.Object[]{mHandle, sizePartNumber, bytesNeededPartNumber, bufferPartNumber})); + return new String(bufferPartNumber.getByteArray(0, sizePartNumber - 1), StandardCharsets.UTF_8); + } + + /** + * Sets an objects partnumber string + * + * @param partNumber new object part number. + * @throws Lib3MFException + */ + public void setPartNumber(String partNumber) throws Lib3MFException { + byte[] bytesPartNumber = partNumber.getBytes(StandardCharsets.UTF_8); + Memory bufferPartNumber = new Memory(bytesPartNumber.length + 1); + bufferPartNumber.write(0, bytesPartNumber, 0, bytesPartNumber.length); + bufferPartNumber.setByte(bytesPartNumber.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_object_setpartnumber.invokeInt(new java.lang.Object[]{mHandle, bufferPartNumber})); + } + + /** + * Retrieves, if an object is a mesh object + * + * @return returns, whether the object is a mesh object + * @throws Lib3MFException + */ + public boolean isMeshObject() throws Lib3MFException { + Pointer bufferIsMeshObject = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_object_ismeshobject.invokeInt(new java.lang.Object[]{mHandle, bufferIsMeshObject})); + return bufferIsMeshObject.getByte(0) != 0; + } + + /** + * Retrieves, if an object is a components object + * + * @return returns, whether the object is a components object + * @throws Lib3MFException + */ + public boolean isComponentsObject() throws Lib3MFException { + Pointer bufferIsComponentsObject = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_object_iscomponentsobject.invokeInt(new java.lang.Object[]{mHandle, bufferIsComponentsObject})); + return bufferIsComponentsObject.getByte(0) != 0; + } + + /** + * Retrieves, if an object is a level set object + * + * @return returns, whether the object is a level set object + * @throws Lib3MFException + */ + public boolean isLevelSetObject() throws Lib3MFException { + Pointer bufferIsLevelSetObject = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_object_islevelsetobject.invokeInt(new java.lang.Object[]{mHandle, bufferIsLevelSetObject})); + return bufferIsLevelSetObject.getByte(0) != 0; + } + + /** + * Retrieves, if an object is a boolean object + * + * @return returns, whether the object is a boolean object + * @throws Lib3MFException + */ + public boolean isBooleanObject() throws Lib3MFException { + Pointer bufferIsBooleanObject = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_object_isbooleanobject.invokeInt(new java.lang.Object[]{mHandle, bufferIsBooleanObject})); + return bufferIsBooleanObject.getByte(0) != 0; + } + + /** + * Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. + * + * @return returns whether the object is a valid object description + * @throws Lib3MFException + */ + public boolean isValid() throws Lib3MFException { + Pointer bufferIsValid = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_object_isvalid.invokeInt(new java.lang.Object[]{mHandle, bufferIsValid})); + return bufferIsValid.getByte(0) != 0; + } + + /** + * Use an existing attachment as thumbnail for this object + * + * @param attachment Instance of a new or the existing thumbnailattachment object. + * @throws Lib3MFException + */ + public void setAttachmentAsThumbnail(Attachment attachment) throws Lib3MFException { + Pointer attachmentHandle = null; + if (attachment != null) { + attachmentHandle = attachment.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Attachment is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_object_setattachmentasthumbnail.invokeInt(new java.lang.Object[]{mHandle, attachmentHandle})); + } + + /** + * Get the attachment containing the object thumbnail. + * + * @return Instance of the thumbnailattachment object or NULL. + * @throws Lib3MFException + */ + public Attachment getThumbnailAttachment() throws Lib3MFException { + Pointer bufferAttachment = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_object_getthumbnailattachment.invokeInt(new java.lang.Object[]{mHandle, bufferAttachment})); + Pointer valueAttachment = bufferAttachment.getPointer(0); + Attachment attachment = null; + if (valueAttachment != Pointer.NULL) { + attachment = mWrapper.PolymorphicFactory(valueAttachment, Attachment.class); + } + return attachment; + } + + /** + * Clears the attachment. The attachment instance is not removed from the package. + * + * @throws Lib3MFException + */ + public void clearThumbnailAttachment() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_object_clearthumbnailattachment.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Returns the outbox of a build item + * + * @return Outbox of this build item + * @throws Lib3MFException + */ + public Box getOutbox() throws Lib3MFException { + Pointer bufferOutbox = new Memory(Box.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_object_getoutbox.invokeInt(new java.lang.Object[]{mHandle, bufferOutbox})); + Box outbox = new Box(); + outbox.readFromPointer(bufferOutbox, 0); + return outbox; + } + + /** + * Retrieves an object's uuid string (see production extension specification) + * + * @return GetUUID Result Tuple + * @throws Lib3MFException + */ + public GetUUIDResult getUUID() throws Lib3MFException { + Pointer bufferHasUUID = new Memory(1); + Pointer bytesNeededUUID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_object_getuuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, 0, bytesNeededUUID, null})); + int sizeUUID = bytesNeededUUID.getInt(0); + Pointer bufferUUID = new Memory(sizeUUID); + mWrapper.checkError(this, mWrapper.lib3mf_object_getuuid.invokeInt(new java.lang.Object[]{mHandle, bufferHasUUID, sizeUUID, bytesNeededUUID, bufferUUID})); + GetUUIDResult returnTuple = new GetUUIDResult(); + returnTuple.HasUUID = bufferHasUUID.getByte(0) != 0; + returnTuple.UUID = new String(bufferUUID.getByteArray(0, sizeUUID - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetUUIDResult { + /** + * flag whether the build item has a UUID + */ + public boolean HasUUID; + + /** + * returns object uuid. + */ + public String UUID; + + } + /** + * Sets a build object's uuid string (see production extension specification) + * + * @param uUID new object uuid string. + * @throws Lib3MFException + */ + public void setUUID(String uUID) throws Lib3MFException { + byte[] bytesUUID = uUID.getBytes(StandardCharsets.UTF_8); + Memory bufferUUID = new Memory(bytesUUID.length + 1); + bufferUUID.write(0, bytesUUID, 0, bytesUUID.length); + bufferUUID.setByte(bytesUUID.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_object_setuuid.invokeInt(new java.lang.Object[]{mHandle, bufferUUID})); + } + + /** + * Returns the metadatagroup of this object + * + * @return returns an Instance of the metadatagroup of this object + * @throws Lib3MFException + */ + public MetaDataGroup getMetaDataGroup() throws Lib3MFException { + Pointer bufferMetaDataGroup = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_object_getmetadatagroup.invokeInt(new java.lang.Object[]{mHandle, bufferMetaDataGroup})); + Pointer valueMetaDataGroup = bufferMetaDataGroup.getPointer(0); + MetaDataGroup metaDataGroup = null; + if (valueMetaDataGroup == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MetaDataGroup was a null pointer"); + } + metaDataGroup = mWrapper.PolymorphicFactory(valueMetaDataGroup, MetaDataGroup.class); + return metaDataGroup; + } + + /** + * set the meshresolution of the mesh object + * + * @param meshResolution meshresolution of this object + * @throws Lib3MFException + */ + public void setSlicesMeshResolution(Lib3MFWrapper.SlicesMeshResolution meshResolution) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_object_setslicesmeshresolution.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertSlicesMeshResolutionToConst(meshResolution)})); + } + + /** + * get the meshresolution of the mesh object + * + * @return meshresolution of this object + * @throws Lib3MFException + */ + public Lib3MFWrapper.SlicesMeshResolution getSlicesMeshResolution() throws Lib3MFException { + Pointer bufferMeshResolution = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_object_getslicesmeshresolution.invokeInt(new java.lang.Object[]{mHandle, bufferMeshResolution})); + return Lib3MFWrapper.EnumConversion.convertConstToSlicesMeshResolution(bufferMeshResolution.getInt(0)); + } + + /** + * returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack + * + * @param recursive check also all referenced objects? + * @return does the object have a slice stack? + * @throws Lib3MFException + */ + public boolean hasSlices(boolean recursive) throws Lib3MFException { + Pointer bufferHasSlices = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_object_hasslices.invokeInt(new java.lang.Object[]{mHandle, recursive, bufferHasSlices})); + return bufferHasSlices.getByte(0) != 0; + } + + /** + * unlinks the attached slicestack from this object. If no slice stack is attached, do noting. + * + * @throws Lib3MFException + */ + public void clearSliceStack() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_object_clearslicestack.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * get the Slicestack attached to the object + * + * @return returns the slicestack instance + * @throws Lib3MFException + */ + public SliceStack getSliceStack() throws Lib3MFException { + Pointer bufferSliceStackInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_object_getslicestack.invokeInt(new java.lang.Object[]{mHandle, bufferSliceStackInstance})); + Pointer valueSliceStackInstance = bufferSliceStackInstance.getPointer(0); + SliceStack sliceStackInstance = null; + if (valueSliceStackInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "SliceStackInstance was a null pointer"); + } + sliceStackInstance = mWrapper.PolymorphicFactory(valueSliceStackInstance, SliceStack.class); + return sliceStackInstance; + } + + /** + * assigns a slicestack to the object + * + * @param sliceStackInstance the new slice stack of this Object + * @throws Lib3MFException + */ + public void assignSliceStack(SliceStack sliceStackInstance) throws Lib3MFException { + Pointer sliceStackInstanceHandle = null; + if (sliceStackInstance != null) { + sliceStackInstanceHandle = sliceStackInstance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "SliceStackInstance is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_object_assignslicestack.invokeInt(new java.lang.Object[]{mHandle, sliceStackInstanceHandle})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ObjectIterator.java b/Autogenerated/Bindings/Java9/lib3mf/ObjectIterator.java new file mode 100644 index 000000000..3dd3faddf --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ObjectIterator.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ObjectIterator extends ResourceIterator { + + public ObjectIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the Object the iterator points at. + * + * @return returns the Object instance. + * @throws Lib3MFException + */ + public Object getCurrentObject() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_objectiterator_getcurrentobject.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + Object resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, Object.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/OneInputNode.java b/Autogenerated/Bindings/Java9/lib3mf/OneInputNode.java new file mode 100644 index 000000000..0949e7694 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/OneInputNode.java @@ -0,0 +1,93 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class OneInputNode extends ImplicitNode { + + public OneInputNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input + * + * @return the input + * @throws Lib3MFException + */ + public ImplicitPort getInputA() throws Lib3MFException { + Pointer bufferInput = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_oneinputnode_getinputa.invokeInt(new java.lang.Object[]{mHandle, bufferInput})); + Pointer valueInput = bufferInput.getPointer(0); + ImplicitPort input = null; + if (valueInput == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Input was a null pointer"); + } + input = mWrapper.PolymorphicFactory(valueInput, ImplicitPort.class); + return input; + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputResult() throws Lib3MFException { + Pointer bufferResult = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_oneinputnode_getoutputresult.invokeInt(new java.lang.Object[]{mHandle, bufferResult})); + Pointer valueResult = bufferResult.getPointer(0); + ImplicitPort result = null; + if (valueResult == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Result was a null pointer"); + } + result = mWrapper.PolymorphicFactory(valueResult, ImplicitPort.class); + return result; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/PackagePart.java b/Autogenerated/Bindings/Java9/lib3mf/PackagePart.java new file mode 100644 index 000000000..3b487b29a --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/PackagePart.java @@ -0,0 +1,86 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class PackagePart extends Base { + + public PackagePart(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the absolute path of this PackagePart. + * + * @return Returns the absolute path of this PackagePart + * @throws Lib3MFException + */ + public String getPath() throws Lib3MFException { + Pointer bytesNeededPath = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_packagepart_getpath.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededPath, null})); + int sizePath = bytesNeededPath.getInt(0); + Pointer bufferPath = new Memory(sizePath); + mWrapper.checkError(this, mWrapper.lib3mf_packagepart_getpath.invokeInt(new java.lang.Object[]{mHandle, sizePath, bytesNeededPath, bufferPath})); + return new String(bufferPath.getByteArray(0, sizePath - 1), StandardCharsets.UTF_8); + } + + /** + * Sets the absolute path of this PackagePart. + * + * @param path Sets the absolute path of this PackagePart. + * @throws Lib3MFException + */ + public void setPath(String path) throws Lib3MFException { + byte[] bytesPath = path.getBytes(StandardCharsets.UTF_8); + Memory bufferPath = new Memory(bytesPath.length + 1); + bufferPath.write(0, bytesPath, 0, bytesPath.length); + bufferPath.setByte(bytesPath.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_packagepart_setpath.invokeInt(new java.lang.Object[]{mHandle, bufferPath})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Position.java b/Autogenerated/Bindings/Java9/lib3mf/Position.java new file mode 100644 index 000000000..ebf1c4043 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Position.java @@ -0,0 +1,63 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Position { + + public float[] Coordinates = new float[3]; + + public static final int SIZE = 12; + + public void readFromPointer(Pointer p, long offset) { + Coordinates[0] = p.getFloat(offset + 0); + Coordinates[1] = p.getFloat(offset + 4); + Coordinates[2] = p.getFloat(offset + 8); + } + + public void writeToPointer(Pointer p, long offset) { + p.setFloat(offset + 0, Coordinates[0]); + p.setFloat(offset + 4, Coordinates[1]); + p.setFloat(offset + 8, Coordinates[2]); + } + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Position2D.java b/Autogenerated/Bindings/Java9/lib3mf/Position2D.java new file mode 100644 index 000000000..58d86aa67 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Position2D.java @@ -0,0 +1,61 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Position2D { + + public float[] Coordinates = new float[2]; + + public static final int SIZE = 8; + + public void readFromPointer(Pointer p, long offset) { + Coordinates[0] = p.getFloat(offset + 0); + Coordinates[1] = p.getFloat(offset + 4); + } + + public void writeToPointer(Pointer p, long offset) { + p.setFloat(offset + 0, Coordinates[0]); + p.setFloat(offset + 4, Coordinates[1]); + } + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/PowNode.java b/Autogenerated/Bindings/Java9/lib3mf/PowNode.java new file mode 100644 index 000000000..21a01f209 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/PowNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class PowNode extends TwoInputNode { + + public PowNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Reader.java b/Autogenerated/Bindings/Java9/lib3mf/Reader.java new file mode 100644 index 000000000..eb0a6c304 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Reader.java @@ -0,0 +1,230 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Reader extends Base { + + public Reader(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Reads a model from a file. The file type is specified by the Model Reader class + * + * @param filename Filename to read from + * @throws Lib3MFException + */ + public void readFromFile(String filename) throws Lib3MFException { + byte[] bytesFilename = filename.getBytes(StandardCharsets.UTF_8); + Memory bufferFilename = new Memory(bytesFilename.length + 1); + bufferFilename.write(0, bytesFilename, 0, bytesFilename.length); + bufferFilename.setByte(bytesFilename.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_reader_readfromfile.invokeInt(new java.lang.Object[]{mHandle, bufferFilename})); + } + + /** + * Reads a model from a memory buffer. + * + * @param buffer Buffer to read from + * @throws Lib3MFException + */ + public void readFromBuffer(byte[] buffer) throws Lib3MFException { + Pointer bufferBuffer = new Memory(Math.max(1, 1 * buffer.length)); + for (int i = 0; i < buffer.length; i++) { + bufferBuffer.setByte(1 * i, buffer[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_reader_readfrombuffer.invokeInt(new java.lang.Object[]{mHandle, (long) buffer.length, bufferBuffer})); + } + + /** + * Reads a model and from the data provided by a callback function + * + * @param theReadCallback Callback to call for reading a data chunk + * @param streamSize number of bytes the callback returns + * @param theSeekCallback Callback to call for seeking in the stream. + * @param userData Userdata that is passed to the callback function + * @throws Lib3MFException + */ + public void readFromCallback(Lib3MFWrapper.ReadCallback theReadCallback, long streamSize, Lib3MFWrapper.SeekCallback theSeekCallback, Pointer userData) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_reader_readfromcallback.invokeInt(new java.lang.Object[]{mHandle, theReadCallback, streamSize, theSeekCallback, userData})); + } + + /** + * Set the progress callback for calls to this writer + * + * @param progressCallback pointer to the callback function. + * @param userData pointer to arbitrary user data that is passed without modification to the callback. + * @throws Lib3MFException + */ + public void setProgressCallback(Lib3MFWrapper.ProgressCallback progressCallback, Pointer userData) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_reader_setprogresscallback.invokeInt(new java.lang.Object[]{mHandle, progressCallback, userData})); + } + + /** + * Adds a relationship type which shall be read as attachment in memory while loading + * + * @param relationShipType String of the relationship type + * @throws Lib3MFException + */ + public void addRelationToRead(String relationShipType) throws Lib3MFException { + byte[] bytesRelationShipType = relationShipType.getBytes(StandardCharsets.UTF_8); + Memory bufferRelationShipType = new Memory(bytesRelationShipType.length + 1); + bufferRelationShipType.write(0, bytesRelationShipType, 0, bytesRelationShipType.length); + bufferRelationShipType.setByte(bytesRelationShipType.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_reader_addrelationtoread.invokeInt(new java.lang.Object[]{mHandle, bufferRelationShipType})); + } + + /** + * Removes a relationship type which shall be read as attachment in memory while loading + * + * @param relationShipType String of the relationship type + * @throws Lib3MFException + */ + public void removeRelationToRead(String relationShipType) throws Lib3MFException { + byte[] bytesRelationShipType = relationShipType.getBytes(StandardCharsets.UTF_8); + Memory bufferRelationShipType = new Memory(bytesRelationShipType.length + 1); + bufferRelationShipType.write(0, bytesRelationShipType, 0, bytesRelationShipType.length); + bufferRelationShipType.setByte(bytesRelationShipType.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_reader_removerelationtoread.invokeInt(new java.lang.Object[]{mHandle, bufferRelationShipType})); + } + + /** + * Activates (deactivates) the strict mode of the reader. + * + * @param strictModeActive flag whether strict mode is active or not. + * @throws Lib3MFException + */ + public void setStrictModeActive(boolean strictModeActive) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_reader_setstrictmodeactive.invokeInt(new java.lang.Object[]{mHandle, strictModeActive})); + } + + /** + * Queries whether the strict mode of the reader is active or not + * + * @return returns flag whether strict mode is active or not. + * @throws Lib3MFException + */ + public boolean getStrictModeActive() throws Lib3MFException { + Pointer bufferStrictModeActive = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_reader_getstrictmodeactive.invokeInt(new java.lang.Object[]{mHandle, bufferStrictModeActive})); + return bufferStrictModeActive.getByte(0) != 0; + } + + /** + * Returns Warning and Error Information of the read process + * + * @param index Index of the Warning. Valid values are 0 to WarningCount - 1 + * @return GetWarning Result Tuple + * @throws Lib3MFException + */ + public GetWarningResult getWarning(int index) throws Lib3MFException { + Pointer bufferErrorCode = new Memory(4); + Pointer bytesNeededWarning = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_reader_getwarning.invokeInt(new java.lang.Object[]{mHandle, index, bufferErrorCode, 0, bytesNeededWarning, null})); + int sizeWarning = bytesNeededWarning.getInt(0); + Pointer bufferWarning = new Memory(sizeWarning); + mWrapper.checkError(this, mWrapper.lib3mf_reader_getwarning.invokeInt(new java.lang.Object[]{mHandle, index, bufferErrorCode, sizeWarning, bytesNeededWarning, bufferWarning})); + GetWarningResult returnTuple = new GetWarningResult(); + returnTuple.ErrorCode = bufferErrorCode.getInt(0); + returnTuple.Warning = new String(bufferWarning.getByteArray(0, sizeWarning - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetWarningResult { + /** + * filled with the error code of the warning + */ + public int ErrorCode; + + /** + * the message of the warning + */ + public String Warning; + + } + /** + * Returns Warning and Error Count of the read process + * + * @return filled with the count of the occurred warnings. + * @throws Lib3MFException + */ + public int getWarningCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_reader_getwarningcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Registers a callback to deal with key wrapping mechanism from keystore + * + * @param consumerID The ConsumerID to register for + * @param theCallback The callback used to decrypt data key + * @param userData Userdata that is passed to the callback function + * @throws Lib3MFException + */ + public void addKeyWrappingCallback(String consumerID, Lib3MFWrapper.KeyWrappingCallback theCallback, Pointer userData) throws Lib3MFException { + byte[] bytesConsumerID = consumerID.getBytes(StandardCharsets.UTF_8); + Memory bufferConsumerID = new Memory(bytesConsumerID.length + 1); + bufferConsumerID.write(0, bytesConsumerID, 0, bytesConsumerID.length); + bufferConsumerID.setByte(bytesConsumerID.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_reader_addkeywrappingcallback.invokeInt(new java.lang.Object[]{mHandle, bufferConsumerID, theCallback, userData})); + } + + /** + * Registers a callback to deal with encryption of content + * + * @param theCallback The callback used to encrypt content + * @param userData Userdata that is passed to the callback function + * @throws Lib3MFException + */ + public void setContentEncryptionCallback(Lib3MFWrapper.ContentEncryptionCallback theCallback, Pointer userData) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_reader_setcontentencryptioncallback.invokeInt(new java.lang.Object[]{mHandle, theCallback, userData})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Resource.java b/Autogenerated/Bindings/Java9/lib3mf/Resource.java new file mode 100644 index 000000000..383ceca2b --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Resource.java @@ -0,0 +1,127 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Resource extends Base { + + public Resource(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the unique id of this resource within a package. This function will be removed in a later release in favor of GetUniqueResourceID + * + * @return Retrieves the unique id of this resource within a package. + * @throws Lib3MFException + */ + public int getResourceID() throws Lib3MFException { + Pointer bufferUniqueResourceID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_resource_getresourceid.invokeInt(new java.lang.Object[]{mHandle, bufferUniqueResourceID})); + return bufferUniqueResourceID.getInt(0); + } + + /** + * Retrieves the unique id of this resource within a package. + * + * @return Retrieves the unique id of this resource within a package. + * @throws Lib3MFException + */ + public int getUniqueResourceID() throws Lib3MFException { + Pointer bufferUniqueResourceID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_resource_getuniqueresourceid.invokeInt(new java.lang.Object[]{mHandle, bufferUniqueResourceID})); + return bufferUniqueResourceID.getInt(0); + } + + /** + * Returns the PackagePart within which this resource resides + * + * @return the PackagePart within which this resource resides. + * @throws Lib3MFException + */ + public PackagePart packagePart() throws Lib3MFException { + Pointer bufferPackagePart = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resource_packagepart.invokeInt(new java.lang.Object[]{mHandle, bufferPackagePart})); + Pointer valuePackagePart = bufferPackagePart.getPointer(0); + PackagePart packagePart = null; + if (valuePackagePart == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "PackagePart was a null pointer"); + } + packagePart = mWrapper.PolymorphicFactory(valuePackagePart, PackagePart.class); + return packagePart; + } + + /** + * Sets the new PackagePart within which this resource resides + * + * @param packagePart the new PackagePart within which this resource resides. + * @throws Lib3MFException + */ + public void setPackagePart(PackagePart packagePart) throws Lib3MFException { + Pointer packagePartHandle = null; + if (packagePart != null) { + packagePartHandle = packagePart.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "PackagePart is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_resource_setpackagepart.invokeInt(new java.lang.Object[]{mHandle, packagePartHandle})); + } + + /** + * Retrieves the id of this resource within a model. + * + * @return Retrieves the id of this resource within a model. + * @throws Lib3MFException + */ + public int getModelResourceID() throws Lib3MFException { + Pointer bufferModelResourceId = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_resource_getmodelresourceid.invokeInt(new java.lang.Object[]{mHandle, bufferModelResourceId})); + return bufferModelResourceId.getInt(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ResourceData.java b/Autogenerated/Bindings/Java9/lib3mf/ResourceData.java new file mode 100644 index 000000000..1420342a8 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ResourceData.java @@ -0,0 +1,114 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ResourceData extends Base { + + public ResourceData(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Gets the encrypted part path + * + * @return The part path + * @throws Lib3MFException + */ + public PackagePart getPath() throws Lib3MFException { + Pointer bufferPath = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedata_getpath.invokeInt(new java.lang.Object[]{mHandle, bufferPath})); + Pointer valuePath = bufferPath.getPointer(0); + PackagePart path = null; + if (valuePath == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Path was a null pointer"); + } + path = mWrapper.PolymorphicFactory(valuePath, PackagePart.class); + return path; + } + + /** + * Gets the encryption algorithm used to encrypt this ResourceData + * + * @return The encryption algorithm + * @throws Lib3MFException + */ + public Lib3MFWrapper.EncryptionAlgorithm getEncryptionAlgorithm() throws Lib3MFException { + Pointer bufferEncryptionAlgorithm = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedata_getencryptionalgorithm.invokeInt(new java.lang.Object[]{mHandle, bufferEncryptionAlgorithm})); + return Lib3MFWrapper.EnumConversion.convertConstToEncryptionAlgorithm(bufferEncryptionAlgorithm.getInt(0)); + } + + /** + * Tells whether this ResourceData is compressed or not + * + * @return The compression method + * @throws Lib3MFException + */ + public Lib3MFWrapper.Compression getCompression() throws Lib3MFException { + Pointer bufferCompression = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedata_getcompression.invokeInt(new java.lang.Object[]{mHandle, bufferCompression})); + return Lib3MFWrapper.EnumConversion.convertConstToCompression(bufferCompression.getInt(0)); + } + + /** + * Tells whether this ResourceData is compressed or not + * + * @return The compression method + * @throws Lib3MFException + */ + public byte[] getAdditionalAuthenticationData() throws Lib3MFException { + Pointer countNeededByteData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedata_getadditionalauthenticationdata.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededByteData, Pointer.NULL})); + long countByteData = countNeededByteData.getLong(0); + Pointer bufferByteData = new Memory(Math.max(1, 1 * countByteData)); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedata_getadditionalauthenticationdata.invokeInt(new java.lang.Object[]{mHandle, countByteData, countNeededByteData, bufferByteData})); + return bufferByteData.getByteArray(0, (int)countByteData); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ResourceDataGroup.java b/Autogenerated/Bindings/Java9/lib3mf/ResourceDataGroup.java new file mode 100644 index 000000000..4422dad39 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ResourceDataGroup.java @@ -0,0 +1,140 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ResourceDataGroup extends Base { + + public ResourceDataGroup(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Sets the resourcedatagroup keyuuid + * + * @return The new resourcedatagroup keyuuid. + * @throws Lib3MFException + */ + public String getKeyUUID() throws Lib3MFException { + Pointer bytesNeededUUID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedatagroup_getkeyuuid.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededUUID, null})); + int sizeUUID = bytesNeededUUID.getInt(0); + Pointer bufferUUID = new Memory(sizeUUID); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedatagroup_getkeyuuid.invokeInt(new java.lang.Object[]{mHandle, sizeUUID, bytesNeededUUID, bufferUUID})); + return new String(bufferUUID.getByteArray(0, sizeUUID - 1), StandardCharsets.UTF_8); + } + + /** + * Add accessright to resourcedatagroup element + * + * @param consumer The Consumer reference + * @param wrappingAlgorithm The key wrapping algorithm to be used + * @param mgfAlgorithm The mask generation function to be used + * @param digestMethod The digest mechanism to be used + * @return The acess right instance + * @throws Lib3MFException + */ + public AccessRight addAccessRight(Consumer consumer, Lib3MFWrapper.WrappingAlgorithm wrappingAlgorithm, Lib3MFWrapper.MgfAlgorithm mgfAlgorithm, Lib3MFWrapper.DigestMethod digestMethod) throws Lib3MFException { + Pointer consumerHandle = null; + if (consumer != null) { + consumerHandle = consumer.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Consumer is a null value."); + } + Pointer bufferTheAccessRight = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedatagroup_addaccessright.invokeInt(new java.lang.Object[]{mHandle, consumerHandle, Lib3MFWrapper.EnumConversion.convertWrappingAlgorithmToConst(wrappingAlgorithm), Lib3MFWrapper.EnumConversion.convertMgfAlgorithmToConst(mgfAlgorithm), Lib3MFWrapper.EnumConversion.convertDigestMethodToConst(digestMethod), bufferTheAccessRight})); + Pointer valueTheAccessRight = bufferTheAccessRight.getPointer(0); + AccessRight theAccessRight = null; + if (valueTheAccessRight == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheAccessRight was a null pointer"); + } + theAccessRight = mWrapper.PolymorphicFactory(valueTheAccessRight, AccessRight.class); + return theAccessRight; + } + + /** + * Finds the AccessRight associated with a Consumer + * + * @param consumer The Consumer instance + * @return The AcessRight instance + * @throws Lib3MFException + */ + public AccessRight findAccessRightByConsumer(Consumer consumer) throws Lib3MFException { + Pointer consumerHandle = null; + if (consumer != null) { + consumerHandle = consumer.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Consumer is a null value."); + } + Pointer bufferTheAccessRight = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourcedatagroup_findaccessrightbyconsumer.invokeInt(new java.lang.Object[]{mHandle, consumerHandle, bufferTheAccessRight})); + Pointer valueTheAccessRight = bufferTheAccessRight.getPointer(0); + AccessRight theAccessRight = null; + if (valueTheAccessRight != Pointer.NULL) { + theAccessRight = mWrapper.PolymorphicFactory(valueTheAccessRight, AccessRight.class); + } + return theAccessRight; + } + + /** + * Removes access from a Consumer on this resource data group + * + * @param consumer The Consumer instance + * @throws Lib3MFException + */ + public void removeAccessRight(Consumer consumer) throws Lib3MFException { + Pointer consumerHandle = null; + if (consumer != null) { + consumerHandle = consumer.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Consumer is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_resourcedatagroup_removeaccessright.invokeInt(new java.lang.Object[]{mHandle, consumerHandle})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ResourceIdNode.java b/Autogenerated/Bindings/Java9/lib3mf/ResourceIdNode.java new file mode 100644 index 000000000..827d38020 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ResourceIdNode.java @@ -0,0 +1,109 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ResourceIdNode extends ImplicitNode { + + public ResourceIdNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Sets the Resource that the resourceid attribute of the node will point to + * + * @param resource the resource + * @throws Lib3MFException + */ + public void setResource(Resource resource) throws Lib3MFException { + Pointer resourceHandle = null; + if (resource != null) { + resourceHandle = resource.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_resourceidnode_setresource.invokeInt(new java.lang.Object[]{mHandle, resourceHandle})); + } + + /** + * Retrieves the resource of the node + * + * @return the resource + * @throws Lib3MFException + */ + public Resource getResource() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourceidnode_getresource.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + Resource resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, Resource.class); + return resource; + } + + /** + * Retrieves the output + * + * @return the output + * @throws Lib3MFException + */ + public ImplicitPort getOutputValue() throws Lib3MFException { + Pointer bufferValue = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourceidnode_getoutputvalue.invokeInt(new java.lang.Object[]{mHandle, bufferValue})); + Pointer valueValue = bufferValue.getPointer(0); + ImplicitPort value = null; + if (valueValue == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Value was a null pointer"); + } + value = mWrapper.PolymorphicFactory(valueValue, ImplicitPort.class); + return value; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/ResourceIterator.java b/Autogenerated/Bindings/Java9/lib3mf/ResourceIterator.java new file mode 100644 index 000000000..495019b11 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/ResourceIterator.java @@ -0,0 +1,129 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class ResourceIterator extends Base { + + public ResourceIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Iterates to the next resource in the list. + * + * @return Iterates to the next resource in the list. + * @throws Lib3MFException + */ + public boolean moveNext() throws Lib3MFException { + Pointer bufferHasNext = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_resourceiterator_movenext.invokeInt(new java.lang.Object[]{mHandle, bufferHasNext})); + return bufferHasNext.getByte(0) != 0; + } + + /** + * Iterates to the previous resource in the list. + * + * @return Iterates to the previous resource in the list. + * @throws Lib3MFException + */ + public boolean movePrevious() throws Lib3MFException { + Pointer bufferHasPrevious = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_resourceiterator_moveprevious.invokeInt(new java.lang.Object[]{mHandle, bufferHasPrevious})); + return bufferHasPrevious.getByte(0) != 0; + } + + /** + * Returns the resource the iterator points at. + * + * @return returns the resource instance. + * @throws Lib3MFException + */ + public Resource getCurrent() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourceiterator_getcurrent.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + Resource resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, Resource.class); + return resource; + } + + /** + * Creates a new resource iterator with the same resource list. + * + * @return returns the cloned Iterator instance + * @throws Lib3MFException + */ + public ResourceIterator clone_() throws Lib3MFException { + Pointer bufferOutResourceIterator = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourceiterator_clone.invokeInt(new java.lang.Object[]{mHandle, bufferOutResourceIterator})); + Pointer valueOutResourceIterator = bufferOutResourceIterator.getPointer(0); + ResourceIterator outResourceIterator = null; + if (valueOutResourceIterator == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "OutResourceIterator was a null pointer"); + } + outResourceIterator = mWrapper.PolymorphicFactory(valueOutResourceIterator, ResourceIterator.class); + return outResourceIterator; + } + + /** + * Returns the number of resoucres the iterator captures. + * + * @return returns the number of resoucres the iterator captures. + * @throws Lib3MFException + */ + public long count() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_resourceiterator_count.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/RoundNode.java b/Autogenerated/Bindings/Java9/lib3mf/RoundNode.java new file mode 100644 index 000000000..c5ff42f74 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/RoundNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class RoundNode extends OneInputNode { + + public RoundNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/SelectNode.java b/Autogenerated/Bindings/Java9/lib3mf/SelectNode.java new file mode 100644 index 000000000..16ba55b85 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/SelectNode.java @@ -0,0 +1,111 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class SelectNode extends OneInputNode { + + public SelectNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the second input + * + * @return the second input + * @throws Lib3MFException + */ + public ImplicitPort getInputB() throws Lib3MFException { + Pointer bufferB = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_selectnode_getinputb.invokeInt(new java.lang.Object[]{mHandle, bufferB})); + Pointer valueB = bufferB.getPointer(0); + ImplicitPort b = null; + if (valueB == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "B was a null pointer"); + } + b = mWrapper.PolymorphicFactory(valueB, ImplicitPort.class); + return b; + } + + /** + * Retrieves the third input + * + * @return the third input + * @throws Lib3MFException + */ + public ImplicitPort getInputC() throws Lib3MFException { + Pointer bufferC = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_selectnode_getinputc.invokeInt(new java.lang.Object[]{mHandle, bufferC})); + Pointer valueC = bufferC.getPointer(0); + ImplicitPort c = null; + if (valueC == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "C was a null pointer"); + } + c = mWrapper.PolymorphicFactory(valueC, ImplicitPort.class); + return c; + } + + /** + * Retrieves the fourth input + * + * @return the fourth input + * @throws Lib3MFException + */ + public ImplicitPort getInputD() throws Lib3MFException { + Pointer bufferD = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_selectnode_getinputd.invokeInt(new java.lang.Object[]{mHandle, bufferD})); + Pointer valueD = bufferD.getPointer(0); + ImplicitPort d = null; + if (valueD == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "D was a null pointer"); + } + d = mWrapper.PolymorphicFactory(valueD, ImplicitPort.class); + return d; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/SignNode.java b/Autogenerated/Bindings/Java9/lib3mf/SignNode.java new file mode 100644 index 000000000..1a203133f --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/SignNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class SignNode extends OneInputNode { + + public SignNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/SinNode.java b/Autogenerated/Bindings/Java9/lib3mf/SinNode.java new file mode 100644 index 000000000..23919d8ae --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/SinNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class SinNode extends OneInputNode { + + public SinNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/SinhNode.java b/Autogenerated/Bindings/Java9/lib3mf/SinhNode.java new file mode 100644 index 000000000..c58d244ed --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/SinhNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class SinhNode extends OneInputNode { + + public SinhNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Slice.java b/Autogenerated/Bindings/Java9/lib3mf/Slice.java new file mode 100644 index 000000000..a0c262cfb --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Slice.java @@ -0,0 +1,188 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Slice extends Base { + + public Slice(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Set all vertices of a slice. All polygons will be cleared. + * + * @param vertices contains the positions. + * @throws Lib3MFException + */ + public void setVertices(Position2D[] vertices) throws Lib3MFException { + Pointer bufferVertices = new Memory(Math.max(1, Position2D.SIZE * vertices.length)); + for (int i = 0; i < vertices.length; i++) { + vertices[i].writeToPointer(bufferVertices, i * Position2D.SIZE); + } + mWrapper.checkError(this, mWrapper.lib3mf_slice_setvertices.invokeInt(new java.lang.Object[]{mHandle, (long) vertices.length, bufferVertices})); + } + + /** + * Get all vertices of a slice + * + * @return contains the positions. + * @throws Lib3MFException + */ + public Position2D[] getVertices() throws Lib3MFException { + Pointer countNeededVertices = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slice_getvertices.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededVertices, null})); + long countVertices = countNeededVertices.getLong(0); + Pointer bufferVertices = new Memory(Math.max(1, countVertices * Position2D.SIZE)); + mWrapper.checkError(this, mWrapper.lib3mf_slice_getvertices.invokeInt(new java.lang.Object[]{mHandle, countVertices, countNeededVertices, bufferVertices})); + Position2D vertices[] = new Position2D[(int)countVertices]; + for (int i = 0; i < (int)countVertices; i++) { + vertices[i] = new Position2D(); + vertices[i].readFromPointer(bufferVertices, i * Position2D.SIZE); + } + return vertices; + } + + /** + * Get the number of vertices in a slice + * + * @return the number of vertices in the slice + * @throws Lib3MFException + */ + public long getVertexCount() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slice_getvertexcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + /** + * Add a new polygon to this slice + * + * @param indices the new indices of the new polygon + * @return the index of the new polygon + * @throws Lib3MFException + */ + public long addPolygon(int[] indices) throws Lib3MFException { + Pointer bufferIndices = new Memory(Math.max(1, 4 * indices.length)); + for (int i = 0; i < indices.length; i++) { + bufferIndices.setInt(4 * i, indices[i]); + } + Pointer bufferIndex = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slice_addpolygon.invokeInt(new java.lang.Object[]{mHandle, (long) indices.length, bufferIndices, bufferIndex})); + return bufferIndex.getLong(0); + } + + /** + * Get the number of polygons in the slice + * + * @return the number of polygons in the slice + * @throws Lib3MFException + */ + public long getPolygonCount() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slice_getpolygoncount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + /** + * Set all indices of a polygon + * + * @param index the index of the polygon to manipulate + * @param indices the new indices of the index-th polygon + * @throws Lib3MFException + */ + public void setPolygonIndices(long index, int[] indices) throws Lib3MFException { + Pointer bufferIndices = new Memory(Math.max(1, 4 * indices.length)); + for (int i = 0; i < indices.length; i++) { + bufferIndices.setInt(4 * i, indices[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_slice_setpolygonindices.invokeInt(new java.lang.Object[]{mHandle, index, (long) indices.length, bufferIndices})); + } + + /** + * Get all vertices of a slice + * + * @param index the index of the polygon to manipulate + * @return the indices of the index-th polygon + * @throws Lib3MFException + */ + public int[] getPolygonIndices(long index) throws Lib3MFException { + Pointer countNeededIndices = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slice_getpolygonindices.invokeInt(new java.lang.Object[]{mHandle, index, 0L, countNeededIndices, Pointer.NULL})); + long countIndices = countNeededIndices.getLong(0); + Pointer bufferIndices = new Memory(Math.max(1, 4 * countIndices)); + mWrapper.checkError(this, mWrapper.lib3mf_slice_getpolygonindices.invokeInt(new java.lang.Object[]{mHandle, index, countIndices, countNeededIndices, bufferIndices})); + return bufferIndices.getIntArray(0, (int)countIndices); + } + + /** + * Get the number of vertices in a slice + * + * @param index the index of the polygon to manipulate + * @return the number of indices of the index-th polygon + * @throws Lib3MFException + */ + public long getPolygonIndexCount(long index) throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slice_getpolygonindexcount.invokeInt(new java.lang.Object[]{mHandle, index, bufferCount})); + return bufferCount.getLong(0); + } + + /** + * Get the upper Z-Coordinate of this slice. + * + * @return the upper Z-Coordinate of this slice + * @throws Lib3MFException + */ + public double getZTop() throws Lib3MFException { + Pointer bufferZTop = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slice_getztop.invokeInt(new java.lang.Object[]{mHandle, bufferZTop})); + return bufferZTop.getDouble(0); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/SliceStack.java b/Autogenerated/Bindings/Java9/lib3mf/SliceStack.java new file mode 100644 index 000000000..02e241fb3 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/SliceStack.java @@ -0,0 +1,204 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class SliceStack extends Resource { + + public SliceStack(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Get the lower Z-Coordinate of the slice stack. + * + * @return the lower Z-Coordinate the slice stack + * @throws Lib3MFException + */ + public double getBottomZ() throws Lib3MFException { + Pointer bufferZBottom = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_getbottomz.invokeInt(new java.lang.Object[]{mHandle, bufferZBottom})); + return bufferZBottom.getDouble(0); + } + + /** + * Returns the number of slices + * + * @return the number of slices + * @throws Lib3MFException + */ + public long getSliceCount() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_getslicecount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + /** + * Query a slice from the slice stack + * + * @param sliceIndex the index of the slice + * @return the Slice instance + * @throws Lib3MFException + */ + public Slice getSlice(long sliceIndex) throws Lib3MFException { + Pointer bufferTheSlice = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_getslice.invokeInt(new java.lang.Object[]{mHandle, sliceIndex, bufferTheSlice})); + Pointer valueTheSlice = bufferTheSlice.getPointer(0); + Slice theSlice = null; + if (valueTheSlice == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheSlice was a null pointer"); + } + theSlice = mWrapper.PolymorphicFactory(valueTheSlice, Slice.class); + return theSlice; + } + + /** + * Returns the number of slices + * + * @param zTop upper Z coordinate of the slice + * @return a new Slice instance + * @throws Lib3MFException + */ + public Slice addSlice(double zTop) throws Lib3MFException { + Pointer bufferTheSlice = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_addslice.invokeInt(new java.lang.Object[]{mHandle, zTop, bufferTheSlice})); + Pointer valueTheSlice = bufferTheSlice.getPointer(0); + Slice theSlice = null; + if (valueTheSlice == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheSlice was a null pointer"); + } + theSlice = mWrapper.PolymorphicFactory(valueTheSlice, Slice.class); + return theSlice; + } + + /** + * Returns the number of slice refs + * + * @return the number of slicereferences + * @throws Lib3MFException + */ + public long getSliceRefCount() throws Lib3MFException { + Pointer bufferCount = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_getslicerefcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getLong(0); + } + + /** + * Adds another existing slicestack as sliceref in this slicestack + * + * @param theSliceStack the slicestack to use as sliceref + * @throws Lib3MFException + */ + public void addSliceStackReference(SliceStack theSliceStack) throws Lib3MFException { + Pointer theSliceStackHandle = null; + if (theSliceStack != null) { + theSliceStackHandle = theSliceStack.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheSliceStack is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_addslicestackreference.invokeInt(new java.lang.Object[]{mHandle, theSliceStackHandle})); + } + + /** + * Adds another existing slicestack as sliceref in this slicestack + * + * @param sliceRefIndex the index of the slice ref + * @return the slicestack that is used as sliceref + * @throws Lib3MFException + */ + public SliceStack getSliceStackReference(long sliceRefIndex) throws Lib3MFException { + Pointer bufferTheSliceStack = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_getslicestackreference.invokeInt(new java.lang.Object[]{mHandle, sliceRefIndex, bufferTheSliceStack})); + Pointer valueTheSliceStack = bufferTheSliceStack.getPointer(0); + SliceStack theSliceStack = null; + if (valueTheSliceStack == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheSliceStack was a null pointer"); + } + theSliceStack = mWrapper.PolymorphicFactory(valueTheSliceStack, SliceStack.class); + return theSliceStack; + } + + /** + * Removes the indirection of slices via slice-refs, i.e. creates the slices of all slice refs of this SliceStack as actual slices of this SliceStack. All previously existing slices or slicerefs will be removed. + * + * @throws Lib3MFException + */ + public void collapseSliceReferences() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_collapseslicereferences.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Sets the package path where this Slice should be stored. Input an empty string to reset the path + * + * @param path the package path where this Slice should be stored + * @throws Lib3MFException + */ + public void setOwnPath(String path) throws Lib3MFException { + byte[] bytesPath = path.getBytes(StandardCharsets.UTF_8); + Memory bufferPath = new Memory(bytesPath.length + 1); + bufferPath.write(0, bytesPath, 0, bytesPath.length); + bufferPath.setByte(bytesPath.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_setownpath.invokeInt(new java.lang.Object[]{mHandle, bufferPath})); + } + + /** + * Obtains the package path where this Slice should be stored. Returns an empty string if the slicestack is stored within the root model. + * + * @return the package path where this Slice will be stored + * @throws Lib3MFException + */ + public String getOwnPath() throws Lib3MFException { + Pointer bytesNeededPath = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_getownpath.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededPath, null})); + int sizePath = bytesNeededPath.getInt(0); + Pointer bufferPath = new Memory(sizePath); + mWrapper.checkError(this, mWrapper.lib3mf_slicestack_getownpath.invokeInt(new java.lang.Object[]{mHandle, sizePath, bytesNeededPath, bufferPath})); + return new String(bufferPath.getByteArray(0, sizePath - 1), StandardCharsets.UTF_8); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/SliceStackIterator.java b/Autogenerated/Bindings/Java9/lib3mf/SliceStackIterator.java new file mode 100644 index 000000000..f51751352 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/SliceStackIterator.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class SliceStackIterator extends ResourceIterator { + + public SliceStackIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the SliceStack the iterator points at. + * + * @return returns the SliceStack instance. + * @throws Lib3MFException + */ + public SliceStack getCurrentSliceStack() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_slicestackiterator_getcurrentslicestack.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + SliceStack resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, SliceStack.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/SqrtNode.java b/Autogenerated/Bindings/Java9/lib3mf/SqrtNode.java new file mode 100644 index 000000000..d0ce5e516 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/SqrtNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class SqrtNode extends OneInputNode { + + public SqrtNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/SubtractionNode.java b/Autogenerated/Bindings/Java9/lib3mf/SubtractionNode.java new file mode 100644 index 000000000..ddcb659bd --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/SubtractionNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class SubtractionNode extends TwoInputNode { + + public SubtractionNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/TanNode.java b/Autogenerated/Bindings/Java9/lib3mf/TanNode.java new file mode 100644 index 000000000..c10d32de2 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/TanNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class TanNode extends OneInputNode { + + public TanNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/TanhNode.java b/Autogenerated/Bindings/Java9/lib3mf/TanhNode.java new file mode 100644 index 000000000..970797efc --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/TanhNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class TanhNode extends OneInputNode { + + public TanhNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Tex2Coord.java b/Autogenerated/Bindings/Java9/lib3mf/Tex2Coord.java new file mode 100644 index 000000000..6fafa91a2 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Tex2Coord.java @@ -0,0 +1,63 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Tex2Coord { + + public double U; + + public double V; + + public static final int SIZE = 16; + + public void readFromPointer(Pointer p, long offset) { + U = p.getDouble(offset + 0); + V = p.getDouble(offset + 8); + } + + public void writeToPointer(Pointer p, long offset) { + p.setDouble(offset + 0, U); + p.setDouble(offset + 8, V); + } + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Texture2D.java b/Autogenerated/Bindings/Java9/lib3mf/Texture2D.java new file mode 100644 index 000000000..ad0ad7aa5 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Texture2D.java @@ -0,0 +1,174 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Texture2D extends Resource { + + public Texture2D(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the attachment located at the path of the texture. + * + * @return attachment that holds the texture's image information. + * @throws Lib3MFException + */ + public Attachment getAttachment() throws Lib3MFException { + Pointer bufferAttachment = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_texture2d_getattachment.invokeInt(new java.lang.Object[]{mHandle, bufferAttachment})); + Pointer valueAttachment = bufferAttachment.getPointer(0); + Attachment attachment = null; + if (valueAttachment == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Attachment was a null pointer"); + } + attachment = mWrapper.PolymorphicFactory(valueAttachment, Attachment.class); + return attachment; + } + + /** + * Sets the texture's package path to the path of the attachment. + * + * @param attachment attachment that holds the texture's image information. + * @throws Lib3MFException + */ + public void setAttachment(Attachment attachment) throws Lib3MFException { + Pointer attachmentHandle = null; + if (attachment != null) { + attachmentHandle = attachment.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Attachment is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_texture2d_setattachment.invokeInt(new java.lang.Object[]{mHandle, attachmentHandle})); + } + + /** + * Retrieves a texture's content type. + * + * @return returns content type enum. + * @throws Lib3MFException + */ + public Lib3MFWrapper.TextureType getContentType() throws Lib3MFException { + Pointer bufferContentType = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_texture2d_getcontenttype.invokeInt(new java.lang.Object[]{mHandle, bufferContentType})); + return Lib3MFWrapper.EnumConversion.convertConstToTextureType(bufferContentType.getInt(0)); + } + + /** + * Retrieves a texture's content type. + * + * @param contentType new Content Type + * @throws Lib3MFException + */ + public void setContentType(Lib3MFWrapper.TextureType contentType) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_texture2d_setcontenttype.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertTextureTypeToConst(contentType)})); + } + + /** + * Retrieves a texture's tilestyle type. + * + * @return GetTileStyleUV Result Tuple + * @throws Lib3MFException + */ + public GetTileStyleUVResult getTileStyleUV() throws Lib3MFException { + Pointer bufferTileStyleU = new Memory(4); + Pointer bufferTileStyleV = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_texture2d_gettilestyleuv.invokeInt(new java.lang.Object[]{mHandle, bufferTileStyleU, bufferTileStyleV})); + GetTileStyleUVResult returnTuple = new GetTileStyleUVResult(); + returnTuple.TileStyleU = Lib3MFWrapper.EnumConversion.convertConstToTextureTileStyle(bufferTileStyleU.getInt(0)); + returnTuple.TileStyleV = Lib3MFWrapper.EnumConversion.convertConstToTextureTileStyle(bufferTileStyleV.getInt(0)); + return returnTuple; + } + + public static class GetTileStyleUVResult { + /** + * returns tilestyle type enum. + */ + public Lib3MFWrapper.TextureTileStyle TileStyleU; + + /** + * returns tilestyle type enum. + */ + public Lib3MFWrapper.TextureTileStyle TileStyleV; + + } + /** + * Sets a texture's tilestyle type. + * + * @param tileStyleU new tilestyle type enum. + * @param tileStyleV new tilestyle type enum. + * @throws Lib3MFException + */ + public void setTileStyleUV(Lib3MFWrapper.TextureTileStyle tileStyleU, Lib3MFWrapper.TextureTileStyle tileStyleV) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_texture2d_settilestyleuv.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertTextureTileStyleToConst(tileStyleU), Lib3MFWrapper.EnumConversion.convertTextureTileStyleToConst(tileStyleV)})); + } + + /** + * Retrieves a texture's filter type. + * + * @return returns filter type enum. + * @throws Lib3MFException + */ + public Lib3MFWrapper.TextureFilter getFilter() throws Lib3MFException { + Pointer bufferFilter = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_texture2d_getfilter.invokeInt(new java.lang.Object[]{mHandle, bufferFilter})); + return Lib3MFWrapper.EnumConversion.convertConstToTextureFilter(bufferFilter.getInt(0)); + } + + /** + * Sets a texture's filter type. + * + * @param filter sets new filter type enum. + * @throws Lib3MFException + */ + public void setFilter(Lib3MFWrapper.TextureFilter filter) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_texture2d_setfilter.invokeInt(new java.lang.Object[]{mHandle, Lib3MFWrapper.EnumConversion.convertTextureFilterToConst(filter)})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Texture2DGroup.java b/Autogenerated/Bindings/Java9/lib3mf/Texture2DGroup.java new file mode 100644 index 000000000..39592625c --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Texture2DGroup.java @@ -0,0 +1,142 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Texture2DGroup extends Resource { + + public Texture2DGroup(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the count of tex2coords in the Texture2DGroup. + * + * @return returns the count of tex2coords. + * @throws Lib3MFException + */ + public int getCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_texture2dgroup_getcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * returns all the PropertyIDs of all tex2coords in this Texture2DGroup + * + * @return PropertyID of the tex2coords in the Texture2DGroup. + * @throws Lib3MFException + */ + public int[] getAllPropertyIDs() throws Lib3MFException { + Pointer countNeededPropertyIDs = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_texture2dgroup_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededPropertyIDs, Pointer.NULL})); + long countPropertyIDs = countNeededPropertyIDs.getLong(0); + Pointer bufferPropertyIDs = new Memory(Math.max(1, 4 * countPropertyIDs)); + mWrapper.checkError(this, mWrapper.lib3mf_texture2dgroup_getallpropertyids.invokeInt(new java.lang.Object[]{mHandle, countPropertyIDs, countNeededPropertyIDs, bufferPropertyIDs})); + return bufferPropertyIDs.getIntArray(0, (int)countPropertyIDs); + } + + /** + * Adds a new tex2coord to the Texture2DGroup + * + * @param uVCoordinate The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. + * @return returns new PropertyID of the new tex2coord in the Texture2DGroup. + * @throws Lib3MFException + */ + public int addTex2Coord(Tex2Coord uVCoordinate) throws Lib3MFException { + Pointer bufferUVCoordinate = new Memory(Tex2Coord.SIZE); + uVCoordinate.writeToPointer(bufferUVCoordinate, 0); + Pointer bufferPropertyID = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_texture2dgroup_addtex2coord.invokeInt(new java.lang.Object[]{mHandle, bufferUVCoordinate, bufferPropertyID})); + return bufferPropertyID.getInt(0); + } + + /** + * Obtains a tex2coord to the Texture2DGroup + * + * @param propertyID the PropertyID of the tex2coord in the Texture2DGroup. + * @return The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. + * @throws Lib3MFException + */ + public Tex2Coord getTex2Coord(int propertyID) throws Lib3MFException { + Pointer bufferUVCoordinate = new Memory(Tex2Coord.SIZE); + mWrapper.checkError(this, mWrapper.lib3mf_texture2dgroup_gettex2coord.invokeInt(new java.lang.Object[]{mHandle, propertyID, bufferUVCoordinate})); + Tex2Coord uVCoordinate = new Tex2Coord(); + uVCoordinate.readFromPointer(bufferUVCoordinate, 0); + return uVCoordinate; + } + + /** + * Removes a tex2coords from the Texture2DGroup. + * + * @param propertyID PropertyID of the tex2coords in the Texture2DGroup. + * @throws Lib3MFException + */ + public void removeTex2Coord(int propertyID) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_texture2dgroup_removetex2coord.invokeInt(new java.lang.Object[]{mHandle, propertyID})); + } + + /** + * Obtains the texture2D instance of this group. + * + * @return the texture2D instance of this group. + * @throws Lib3MFException + */ + public Texture2D getTexture2D() throws Lib3MFException { + Pointer bufferTexture2DInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_texture2dgroup_gettexture2d.invokeInt(new java.lang.Object[]{mHandle, bufferTexture2DInstance})); + Pointer valueTexture2DInstance = bufferTexture2DInstance.getPointer(0); + Texture2D texture2DInstance = null; + if (valueTexture2DInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Texture2DInstance was a null pointer"); + } + texture2DInstance = mWrapper.PolymorphicFactory(valueTexture2DInstance, Texture2D.class); + return texture2DInstance; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Texture2DGroupIterator.java b/Autogenerated/Bindings/Java9/lib3mf/Texture2DGroupIterator.java new file mode 100644 index 000000000..d25de0d9e --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Texture2DGroupIterator.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Texture2DGroupIterator extends ResourceIterator { + + public Texture2DGroupIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the Texture2DGroup the iterator points at. + * + * @return returns the Texture2DGroup instance. + * @throws Lib3MFException + */ + public Texture2DGroup getCurrentTexture2DGroup() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + Texture2DGroup resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, Texture2DGroup.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Texture2DIterator.java b/Autogenerated/Bindings/Java9/lib3mf/Texture2DIterator.java new file mode 100644 index 000000000..42d289e6c --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Texture2DIterator.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Texture2DIterator extends ResourceIterator { + + public Texture2DIterator(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the Texture2D the iterator points at. + * + * @return returns the Texture2D instance. + * @throws Lib3MFException + */ + public Texture2D getCurrentTexture2D() throws Lib3MFException { + Pointer bufferResource = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_texture2diterator_getcurrenttexture2d.invokeInt(new java.lang.Object[]{mHandle, bufferResource})); + Pointer valueResource = bufferResource.getPointer(0); + Texture2D resource = null; + if (valueResource == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Resource was a null pointer"); + } + resource = mWrapper.PolymorphicFactory(valueResource, Texture2D.class); + return resource; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Transform.java b/Autogenerated/Bindings/Java9/lib3mf/Transform.java new file mode 100644 index 000000000..795496b75 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Transform.java @@ -0,0 +1,81 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Transform { + + public float[][] Fields = new float[3][4]; + + public static final int SIZE = 48; + + public void readFromPointer(Pointer p, long offset) { + Fields[0][0] = p.getFloat(offset + 0); + Fields[0][1] = p.getFloat(offset + 4); + Fields[0][2] = p.getFloat(offset + 8); + Fields[0][3] = p.getFloat(offset + 12); + Fields[1][0] = p.getFloat(offset + 16); + Fields[1][1] = p.getFloat(offset + 20); + Fields[1][2] = p.getFloat(offset + 24); + Fields[1][3] = p.getFloat(offset + 28); + Fields[2][0] = p.getFloat(offset + 32); + Fields[2][1] = p.getFloat(offset + 36); + Fields[2][2] = p.getFloat(offset + 40); + Fields[2][3] = p.getFloat(offset + 44); + } + + public void writeToPointer(Pointer p, long offset) { + p.setFloat(offset + 0, Fields[0][0]); + p.setFloat(offset + 4, Fields[0][1]); + p.setFloat(offset + 8, Fields[0][2]); + p.setFloat(offset + 12, Fields[0][3]); + p.setFloat(offset + 16, Fields[1][0]); + p.setFloat(offset + 20, Fields[1][1]); + p.setFloat(offset + 24, Fields[1][2]); + p.setFloat(offset + 28, Fields[1][3]); + p.setFloat(offset + 32, Fields[2][0]); + p.setFloat(offset + 36, Fields[2][1]); + p.setFloat(offset + 40, Fields[2][2]); + p.setFloat(offset + 44, Fields[2][3]); + } + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/TransposeNode.java b/Autogenerated/Bindings/Java9/lib3mf/TransposeNode.java new file mode 100644 index 000000000..2513b7dd0 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/TransposeNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class TransposeNode extends OneInputNode { + + public TransposeNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Triangle.java b/Autogenerated/Bindings/Java9/lib3mf/Triangle.java new file mode 100644 index 000000000..007400619 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Triangle.java @@ -0,0 +1,63 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Triangle { + + public int[] Indices = new int[3]; + + public static final int SIZE = 12; + + public void readFromPointer(Pointer p, long offset) { + Indices[0] = p.getInt(offset + 0); + Indices[1] = p.getInt(offset + 4); + Indices[2] = p.getInt(offset + 8); + } + + public void writeToPointer(Pointer p, long offset) { + p.setInt(offset + 0, Indices[0]); + p.setInt(offset + 4, Indices[1]); + p.setInt(offset + 8, Indices[2]); + } + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/TriangleProperties.java b/Autogenerated/Bindings/Java9/lib3mf/TriangleProperties.java new file mode 100644 index 000000000..0e44da4e8 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/TriangleProperties.java @@ -0,0 +1,67 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class TriangleProperties { + + public int ResourceID; + + public int[] PropertyIDs = new int[3]; + + public static final int SIZE = 16; + + public void readFromPointer(Pointer p, long offset) { + ResourceID = p.getInt(offset + 0); + PropertyIDs[0] = p.getInt(offset + 4); + PropertyIDs[1] = p.getInt(offset + 8); + PropertyIDs[2] = p.getInt(offset + 12); + } + + public void writeToPointer(Pointer p, long offset) { + p.setInt(offset + 0, ResourceID); + p.setInt(offset + 4, PropertyIDs[0]); + p.setInt(offset + 8, PropertyIDs[1]); + p.setInt(offset + 12, PropertyIDs[2]); + } + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/TriangleSet.java b/Autogenerated/Bindings/Java9/lib3mf/TriangleSet.java new file mode 100644 index 000000000..7718b8563 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/TriangleSet.java @@ -0,0 +1,236 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class TriangleSet extends Base { + + public TriangleSet(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * sets the name of the triangle set + * + * @param name the new name + * @throws Lib3MFException + */ + public void setName(String name) throws Lib3MFException { + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_setname.invokeInt(new java.lang.Object[]{mHandle, bufferName})); + } + + /** + * returns the name of the triangle set + * + * @return returns the name + * @throws Lib3MFException + */ + public String getName() throws Lib3MFException { + Pointer bytesNeededName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_getname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededName, null})); + int sizeName = bytesNeededName.getInt(0); + Pointer bufferName = new Memory(sizeName); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_getname.invokeInt(new java.lang.Object[]{mHandle, sizeName, bytesNeededName, bufferName})); + return new String(bufferName.getByteArray(0, sizeName - 1), StandardCharsets.UTF_8); + } + + /** + * sets the identifier of the triangle set. + * + * @param identifier the new identifier. MUST be unique within the mesh. MUST NOT be an empty string + * @throws Lib3MFException + */ + public void setIdentifier(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_setidentifier.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier})); + } + + /** + * returns the identifier of the triangle set + * + * @return returns the identifier + * @throws Lib3MFException + */ + public String getIdentifier() throws Lib3MFException { + Pointer bytesNeededIdentifier = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_getidentifier.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededIdentifier, null})); + int sizeIdentifier = bytesNeededIdentifier.getInt(0); + Pointer bufferIdentifier = new Memory(sizeIdentifier); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_getidentifier.invokeInt(new java.lang.Object[]{mHandle, sizeIdentifier, bytesNeededIdentifier, bufferIdentifier})); + return new String(bufferIdentifier.getByteArray(0, sizeIdentifier - 1), StandardCharsets.UTF_8); + } + + /** + * adds a triangle to the set. Does nothing if triangle is already in the set. + * + * @param triangleIndex Triangle index to add. MUST be between 0 and TriangleCount - 1. + * @throws Lib3MFException + */ + public void addTriangle(int triangleIndex) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_addtriangle.invokeInt(new java.lang.Object[]{mHandle, triangleIndex})); + } + + /** + * removes a triangle from the set + * + * @param triangleIndex Triangle index to remove. MUST be between 0 and TriangleCount - 1. + * @throws Lib3MFException + */ + public void removeTriangle(int triangleIndex) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_removetriangle.invokeInt(new java.lang.Object[]{mHandle, triangleIndex})); + } + + /** + * clears all triangles from the list + * + * @throws Lib3MFException + */ + public void clear() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_clear.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Sets all triangles in the list, while clearing old values. Duplicates will be merged. + * + * @param triangleIndices Triangle indices to add. Every element MUST be between 0 and TriangleCount - 1. + * @throws Lib3MFException + */ + public void setTriangleList(int[] triangleIndices) throws Lib3MFException { + Pointer bufferTriangleIndices = new Memory(Math.max(1, 4 * triangleIndices.length)); + for (int i = 0; i < triangleIndices.length; i++) { + bufferTriangleIndices.setInt(4 * i, triangleIndices[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_settrianglelist.invokeInt(new java.lang.Object[]{mHandle, (long) triangleIndices.length, bufferTriangleIndices})); + } + + /** + * Retrieves all the triangles in the TriangleSet + * + * @return retrieves the indices of the triangles in this TriangleSet + * @throws Lib3MFException + */ + public int[] getTriangleList() throws Lib3MFException { + Pointer countNeededTriangleIndices = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_gettrianglelist.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededTriangleIndices, Pointer.NULL})); + long countTriangleIndices = countNeededTriangleIndices.getLong(0); + Pointer bufferTriangleIndices = new Memory(Math.max(1, 4 * countTriangleIndices)); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_gettrianglelist.invokeInt(new java.lang.Object[]{mHandle, countTriangleIndices, countNeededTriangleIndices, bufferTriangleIndices})); + return bufferTriangleIndices.getIntArray(0, (int)countTriangleIndices); + } + + /** + * Adds multiple triangles in the list. Duplicates will be merged. + * + * @param triangleIndices Triangle indices to add. Every element MUST be between 0 and TriangleCount - 1. + * @throws Lib3MFException + */ + public void addTriangleList(int[] triangleIndices) throws Lib3MFException { + Pointer bufferTriangleIndices = new Memory(Math.max(1, 4 * triangleIndices.length)); + for (int i = 0; i < triangleIndices.length; i++) { + bufferTriangleIndices.setInt(4 * i, triangleIndices[i]); + } + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_addtrianglelist.invokeInt(new java.lang.Object[]{mHandle, (long) triangleIndices.length, bufferTriangleIndices})); + } + + /** + * Merges another Triangle set. + * + * @param otherTriangleSet Other triangle set to merge. + * @param deleteOther Flag if other triangle set is getting removed. + * @throws Lib3MFException + */ + public void merge(TriangleSet otherTriangleSet, boolean deleteOther) throws Lib3MFException { + Pointer otherTriangleSetHandle = null; + if (otherTriangleSet != null) { + otherTriangleSetHandle = otherTriangleSet.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "OtherTriangleSet is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_merge.invokeInt(new java.lang.Object[]{mHandle, otherTriangleSetHandle, deleteOther})); + } + + /** + * Deletes the whole set from the mesh. + * + * @throws Lib3MFException + */ + public void deleteSet() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_deleteset.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Duplicates the set in the mesh. + * + * @param identifier the new identifier. MUST be unique within the mesh. MUST NOT be an empty string + * @return Copy of the triangle set. + * @throws Lib3MFException + */ + public TriangleSet duplicate(String identifier) throws Lib3MFException { + byte[] bytesIdentifier = identifier.getBytes(StandardCharsets.UTF_8); + Memory bufferIdentifier = new Memory(bytesIdentifier.length + 1); + bufferIdentifier.write(0, bytesIdentifier, 0, bytesIdentifier.length); + bufferIdentifier.setByte(bytesIdentifier.length, (byte)0); + Pointer bufferNewSet = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_triangleset_duplicate.invokeInt(new java.lang.Object[]{mHandle, bufferIdentifier, bufferNewSet})); + Pointer valueNewSet = bufferNewSet.getPointer(0); + TriangleSet newSet = null; + if (valueNewSet == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "NewSet was a null pointer"); + } + newSet = mWrapper.PolymorphicFactory(valueNewSet, TriangleSet.class); + return newSet; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/TwoInputNode.java b/Autogenerated/Bindings/Java9/lib3mf/TwoInputNode.java new file mode 100644 index 000000000..2f26f7c18 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/TwoInputNode.java @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class TwoInputNode extends OneInputNode { + + public TwoInputNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the second input + * + * @return the second input + * @throws Lib3MFException + */ + public ImplicitPort getInputB() throws Lib3MFException { + Pointer bufferB = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_twoinputnode_getinputb.invokeInt(new java.lang.Object[]{mHandle, bufferB})); + Pointer valueB = bufferB.getPointer(0); + ImplicitPort b = null; + if (valueB == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "B was a null pointer"); + } + b = mWrapper.PolymorphicFactory(valueB, ImplicitPort.class); + return b; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/UnsignedMeshNode.java b/Autogenerated/Bindings/Java9/lib3mf/UnsignedMeshNode.java new file mode 100644 index 000000000..3b1c9ff91 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/UnsignedMeshNode.java @@ -0,0 +1,111 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class UnsignedMeshNode extends ImplicitNode { + + public UnsignedMeshNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Retrieves the input for the model resource id of the mesh + * + * @return the input port for the model resource id of the mesh + * @throws Lib3MFException + */ + public ImplicitPort getInputMesh() throws Lib3MFException { + Pointer bufferMesh = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_unsignedmeshnode_getinputmesh.invokeInt(new java.lang.Object[]{mHandle, bufferMesh})); + Pointer valueMesh = bufferMesh.getPointer(0); + ImplicitPort mesh = null; + if (valueMesh == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Mesh was a null pointer"); + } + mesh = mWrapper.PolymorphicFactory(valueMesh, ImplicitPort.class); + return mesh; + } + + /** + * Retrieves the input for the position + * + * @return the input port for the position + * @throws Lib3MFException + */ + public ImplicitPort getInputPos() throws Lib3MFException { + Pointer bufferPos = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_unsignedmeshnode_getinputpos.invokeInt(new java.lang.Object[]{mHandle, bufferPos})); + Pointer valuePos = bufferPos.getPointer(0); + ImplicitPort pos = null; + if (valuePos == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Pos was a null pointer"); + } + pos = mWrapper.PolymorphicFactory(valuePos, ImplicitPort.class); + return pos; + } + + /** + * Retrieves the output + * + * @return the output port for the unsigned distance to the mesh + * @throws Lib3MFException + */ + public ImplicitPort getOutputDistance() throws Lib3MFException { + Pointer bufferDistance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_unsignedmeshnode_getoutputdistance.invokeInt(new java.lang.Object[]{mHandle, bufferDistance})); + Pointer valueDistance = bufferDistance.getPointer(0); + ImplicitPort distance = null; + if (valueDistance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "Distance was a null pointer"); + } + distance = mWrapper.PolymorphicFactory(valueDistance, ImplicitPort.class); + return distance; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Vector.java b/Autogenerated/Bindings/Java9/lib3mf/Vector.java new file mode 100644 index 000000000..4a47a9847 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Vector.java @@ -0,0 +1,63 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Memory; +import com.sun.jna.Pointer; + +import java.util.Arrays; +import java.util.List; + +public class Vector { + + public double[] Coordinates = new double[3]; + + public static final int SIZE = 24; + + public void readFromPointer(Pointer p, long offset) { + Coordinates[0] = p.getDouble(offset + 0); + Coordinates[1] = p.getDouble(offset + 8); + Coordinates[2] = p.getDouble(offset + 16); + } + + public void writeToPointer(Pointer p, long offset) { + p.setDouble(offset + 0, Coordinates[0]); + p.setDouble(offset + 8, Coordinates[1]); + p.setDouble(offset + 16, Coordinates[2]); + } + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/VectorFromScalarNode.java b/Autogenerated/Bindings/Java9/lib3mf/VectorFromScalarNode.java new file mode 100644 index 000000000..7527de675 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/VectorFromScalarNode.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class VectorFromScalarNode extends OneInputNode { + + public VectorFromScalarNode(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/VolumeData.java b/Autogenerated/Bindings/Java9/lib3mf/VolumeData.java new file mode 100644 index 000000000..26678e11d --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/VolumeData.java @@ -0,0 +1,223 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class VolumeData extends Resource { + + public VolumeData(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the VolumeDataComposite of this VolumeData instance + * + * @return filled with the VolumeDataComposite of this VolumeData instance. + * @throws Lib3MFException + */ + public VolumeDataComposite getComposite() throws Lib3MFException { + Pointer bufferTheCompositeData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_getcomposite.invokeInt(new java.lang.Object[]{mHandle, bufferTheCompositeData})); + Pointer valueTheCompositeData = bufferTheCompositeData.getPointer(0); + VolumeDataComposite theCompositeData = null; + if (valueTheCompositeData != Pointer.NULL) { + theCompositeData = mWrapper.PolymorphicFactory(valueTheCompositeData, VolumeDataComposite.class); + } + return theCompositeData; + } + + /** + * Creates a new VolumeDataComposite for this VolumeData instance + * + * @return The new VolumeDataComposite of this VolumeData instance. + * @throws Lib3MFException + */ + public VolumeDataComposite createNewComposite() throws Lib3MFException { + Pointer bufferTheCompositeData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_createnewcomposite.invokeInt(new java.lang.Object[]{mHandle, bufferTheCompositeData})); + Pointer valueTheCompositeData = bufferTheCompositeData.getPointer(0); + VolumeDataComposite theCompositeData = null; + if (valueTheCompositeData == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheCompositeData was a null pointer"); + } + theCompositeData = mWrapper.PolymorphicFactory(valueTheCompositeData, VolumeDataComposite.class); + return theCompositeData; + } + + /** + * Removes the VolumeDataComposite of this VolumeData instance + * + * @throws Lib3MFException + */ + public void removeComposite() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_removecomposite.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Returns the VolumeDataColor of this VolumeData instance + * + * @return filled with the VolumeDataColor of this VolumeData instance. + * @throws Lib3MFException + */ + public VolumeDataColor getColor() throws Lib3MFException { + Pointer bufferTheColorData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_getcolor.invokeInt(new java.lang.Object[]{mHandle, bufferTheColorData})); + Pointer valueTheColorData = bufferTheColorData.getPointer(0); + VolumeDataColor theColorData = null; + if (valueTheColorData != Pointer.NULL) { + theColorData = mWrapper.PolymorphicFactory(valueTheColorData, VolumeDataColor.class); + } + return theColorData; + } + + /** + * Creates a new VolumeDataColor for this VolumeData instance + * + * @param theFunction Function used in this element + * @return The new VolumeDataColor of this VolumeData instance. + * @throws Lib3MFException + */ + public VolumeDataColor createNewColor(Function theFunction) throws Lib3MFException { + Pointer theFunctionHandle = null; + if (theFunction != null) { + theFunctionHandle = theFunction.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheFunction is a null value."); + } + Pointer bufferTheColorData = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_createnewcolor.invokeInt(new java.lang.Object[]{mHandle, theFunctionHandle, bufferTheColorData})); + Pointer valueTheColorData = bufferTheColorData.getPointer(0); + VolumeDataColor theColorData = null; + if (valueTheColorData == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheColorData was a null pointer"); + } + theColorData = mWrapper.PolymorphicFactory(valueTheColorData, VolumeDataColor.class); + return theColorData; + } + + /** + * Removes the VolumeDataColor of this VolumeData instance + * + * @throws Lib3MFException + */ + public void removeColor() throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_removecolor.invokeInt(new java.lang.Object[]{mHandle})); + } + + /** + * Returns the number of VolumeDataProperty + * + * @return the number of VolumeDataProperty-elements within this VolumeData + * @throws Lib3MFException + */ + public int getPropertyCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_getpropertycount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Returns the VolumeDataProperty at a given Index + * + * @param index the index of the VolumeDataProperty to be returned. + * @return the VolumeDataProperty at the given index. + * @throws Lib3MFException + */ + public VolumeDataProperty getProperty(int index) throws Lib3MFException { + Pointer bufferTheVolumeDataProperty = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_getproperty.invokeInt(new java.lang.Object[]{mHandle, index, bufferTheVolumeDataProperty})); + Pointer valueTheVolumeDataProperty = bufferTheVolumeDataProperty.getPointer(0); + VolumeDataProperty theVolumeDataProperty = null; + if (valueTheVolumeDataProperty == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheVolumeDataProperty was a null pointer"); + } + theVolumeDataProperty = mWrapper.PolymorphicFactory(valueTheVolumeDataProperty, VolumeDataProperty.class); + return theVolumeDataProperty; + } + + /** + * Adds a new VolumeDataProperty from a Function + * + * @param name the qualified name (namespace+name) of the Property + * @param theFunction Function used in this element + * @return the newly created VolumeDataProperty. + * @throws Lib3MFException + */ + public VolumeDataProperty addPropertyFromFunction(String name, Function theFunction) throws Lib3MFException { + byte[] bytesName = name.getBytes(StandardCharsets.UTF_8); + Memory bufferName = new Memory(bytesName.length + 1); + bufferName.write(0, bytesName, 0, bytesName.length); + bufferName.setByte(bytesName.length, (byte)0); + Pointer theFunctionHandle = null; + if (theFunction != null) { + theFunctionHandle = theFunction.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheFunction is a null value."); + } + Pointer bufferTheVolumeDataProperty = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_addpropertyfromfunction.invokeInt(new java.lang.Object[]{mHandle, bufferName, theFunctionHandle, bufferTheVolumeDataProperty})); + Pointer valueTheVolumeDataProperty = bufferTheVolumeDataProperty.getPointer(0); + VolumeDataProperty theVolumeDataProperty = null; + if (valueTheVolumeDataProperty == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheVolumeDataProperty was a null pointer"); + } + theVolumeDataProperty = mWrapper.PolymorphicFactory(valueTheVolumeDataProperty, VolumeDataProperty.class); + return theVolumeDataProperty; + } + + /** + * Removes the VolumeDataProperty with a given index + * + * @param index the index of the VolumeDataProperty to be removed. + * @throws Lib3MFException + */ + public void removeProperty(int index) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_volumedata_removeproperty.invokeInt(new java.lang.Object[]{mHandle, index})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/VolumeDataColor.java b/Autogenerated/Bindings/Java9/lib3mf/VolumeDataColor.java new file mode 100644 index 000000000..41b3fb590 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/VolumeDataColor.java @@ -0,0 +1,57 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class VolumeDataColor extends FunctionReference { + + public VolumeDataColor(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/VolumeDataComposite.java b/Autogenerated/Bindings/Java9/lib3mf/VolumeDataComposite.java new file mode 100644 index 000000000..002e1acdc --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/VolumeDataComposite.java @@ -0,0 +1,153 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class VolumeDataComposite extends Base { + + public VolumeDataComposite(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Returns the BaseMaterialGroup used within this volume data item + * + * @return The BaseMaterialGroup instance of this VolumeDataComposite element + * @throws Lib3MFException + */ + public BaseMaterialGroup getBaseMaterialGroup() throws Lib3MFException { + Pointer bufferBaseMaterialGroupInstance = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedatacomposite_getbasematerialgroup.invokeInt(new java.lang.Object[]{mHandle, bufferBaseMaterialGroupInstance})); + Pointer valueBaseMaterialGroupInstance = bufferBaseMaterialGroupInstance.getPointer(0); + BaseMaterialGroup baseMaterialGroupInstance = null; + if (valueBaseMaterialGroupInstance == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BaseMaterialGroupInstance was a null pointer"); + } + baseMaterialGroupInstance = mWrapper.PolymorphicFactory(valueBaseMaterialGroupInstance, BaseMaterialGroup.class); + return baseMaterialGroupInstance; + } + + /** + * Sets the BaseMaterialGroup to use within this volume data item. + * + * @param baseMaterialGroupInstance The new BaseMaterialGroup instance of this VolumeDataComposite element + * @throws Lib3MFException + */ + public void setBaseMaterialGroup(BaseMaterialGroup baseMaterialGroupInstance) throws Lib3MFException { + Pointer baseMaterialGroupInstanceHandle = null; + if (baseMaterialGroupInstance != null) { + baseMaterialGroupInstanceHandle = baseMaterialGroupInstance.getHandle(); + } else { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "BaseMaterialGroupInstance is a null value."); + } + mWrapper.checkError(this, mWrapper.lib3mf_volumedatacomposite_setbasematerialgroup.invokeInt(new java.lang.Object[]{mHandle, baseMaterialGroupInstanceHandle})); + } + + /** + * Returns the number of material mappings of this VolumeDataComposite element + * + * @return the number of material mappings. + * @throws Lib3MFException + */ + public int getMaterialMappingCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_volumedatacomposite_getmaterialmappingcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Returns MaterialMapping with given index + * + * @param index Index of the MaterialMapping in question. + * @return MaterialMapping used in this element + * @throws Lib3MFException + */ + public MaterialMapping getMaterialMapping(int index) throws Lib3MFException { + Pointer bufferTheMaterialMapping = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedatacomposite_getmaterialmapping.invokeInt(new java.lang.Object[]{mHandle, index, bufferTheMaterialMapping})); + Pointer valueTheMaterialMapping = bufferTheMaterialMapping.getPointer(0); + MaterialMapping theMaterialMapping = null; + if (valueTheMaterialMapping == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheMaterialMapping was a null pointer"); + } + theMaterialMapping = mWrapper.PolymorphicFactory(valueTheMaterialMapping, MaterialMapping.class); + return theMaterialMapping; + } + + /** + * Adds a MaterialMapping + * + * @param transform new transformation matrix + * @return The new MaterialMapping + * @throws Lib3MFException + */ + public MaterialMapping addMaterialMapping(Transform transform) throws Lib3MFException { + Pointer bufferTransform = new Memory(Transform.SIZE); + transform.writeToPointer(bufferTransform, 0); + Pointer bufferTheMaterialMapping = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_volumedatacomposite_addmaterialmapping.invokeInt(new java.lang.Object[]{mHandle, bufferTransform, bufferTheMaterialMapping})); + Pointer valueTheMaterialMapping = bufferTheMaterialMapping.getPointer(0); + MaterialMapping theMaterialMapping = null; + if (valueTheMaterialMapping == Pointer.NULL) { + throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "TheMaterialMapping was a null pointer"); + } + theMaterialMapping = mWrapper.PolymorphicFactory(valueTheMaterialMapping, MaterialMapping.class); + return theMaterialMapping; + } + + /** + * Removes the MaterialMapping with given index + * + * @param index The index of the MaterialMapping to be removed. + * @throws Lib3MFException + */ + public void removeMaterialMapping(int index) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_volumedatacomposite_removematerialmapping.invokeInt(new java.lang.Object[]{mHandle, index})); + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/VolumeDataProperty.java b/Autogenerated/Bindings/Java9/lib3mf/VolumeDataProperty.java new file mode 100644 index 000000000..9a7014a97 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/VolumeDataProperty.java @@ -0,0 +1,94 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class VolumeDataProperty extends FunctionReference { + + public VolumeDataProperty(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Gets the qualified name of this property. + * + * @return The qualified name of this property. + * @throws Lib3MFException + */ + public String getName() throws Lib3MFException { + Pointer bytesNeededPropertyName = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_volumedataproperty_getname.invokeInt(new java.lang.Object[]{mHandle, 0, bytesNeededPropertyName, null})); + int sizePropertyName = bytesNeededPropertyName.getInt(0); + Pointer bufferPropertyName = new Memory(sizePropertyName); + mWrapper.checkError(this, mWrapper.lib3mf_volumedataproperty_getname.invokeInt(new java.lang.Object[]{mHandle, sizePropertyName, bytesNeededPropertyName, bufferPropertyName})); + return new String(bufferPropertyName.getByteArray(0, sizePropertyName - 1), StandardCharsets.UTF_8); + } + + /** + * Sets whether this property is required to process this 3MF document instance. + * + * @param isRequired New value for whether this property is required to process this 3MF document instance. + * @throws Lib3MFException + */ + public void setIsRequired(boolean isRequired) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_volumedataproperty_setisrequired.invokeInt(new java.lang.Object[]{mHandle, isRequired})); + } + + /** + * Returns whether this property is required to process this 3MF document instance. + * + * @return Is this property required to process this 3MF document instance? + * @throws Lib3MFException + */ + public boolean isRequired() throws Lib3MFException { + Pointer bufferIsRequired = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_volumedataproperty_isrequired.invokeInt(new java.lang.Object[]{mHandle, bufferIsRequired})); + return bufferIsRequired.getByte(0) != 0; + } + + +} + diff --git a/Autogenerated/Bindings/Java9/lib3mf/Writer.java b/Autogenerated/Bindings/Java9/lib3mf/Writer.java new file mode 100644 index 000000000..91e91ff70 --- /dev/null +++ b/Autogenerated/Bindings/Java9/lib3mf/Writer.java @@ -0,0 +1,236 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: This is an autogenerated Java file in order to allow an easy + use of the 3MF Library + +Interface version: 2.6.0 + +*/ + +package lib3mf; + +import com.sun.jna.Library; +import com.sun.jna.Memory; +import com.sun.jna.Native; +import com.sun.jna.Pointer; +import java.lang.ref.Cleaner; + + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +public class Writer extends Base { + + public Writer(Lib3MFWrapper wrapper, Pointer handle) { + super(wrapper, handle); + } + + /** + * Writes out the model as file. The file type is specified by the Model Writer class. + * + * @param filename Filename to write into + * @throws Lib3MFException + */ + public void writeToFile(String filename) throws Lib3MFException { + byte[] bytesFilename = filename.getBytes(StandardCharsets.UTF_8); + Memory bufferFilename = new Memory(bytesFilename.length + 1); + bufferFilename.write(0, bytesFilename, 0, bytesFilename.length); + bufferFilename.setByte(bytesFilename.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_writer_writetofile.invokeInt(new java.lang.Object[]{mHandle, bufferFilename})); + } + + /** + * Retrieves the size of the full 3MF file stream. + * + * @return the stream size + * @throws Lib3MFException + */ + public long getStreamSize() throws Lib3MFException { + Pointer bufferStreamSize = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_writer_getstreamsize.invokeInt(new java.lang.Object[]{mHandle, bufferStreamSize})); + return bufferStreamSize.getLong(0); + } + + /** + * Writes out the 3MF file into a memory buffer + * + * @return buffer to write into + * @throws Lib3MFException + */ + public byte[] writeToBuffer() throws Lib3MFException { + Pointer countNeededBuffer = new Memory(8); + mWrapper.checkError(this, mWrapper.lib3mf_writer_writetobuffer.invokeInt(new java.lang.Object[]{mHandle, 0L, countNeededBuffer, Pointer.NULL})); + long countBuffer = countNeededBuffer.getLong(0); + Pointer bufferBuffer = new Memory(Math.max(1, 1 * countBuffer)); + mWrapper.checkError(this, mWrapper.lib3mf_writer_writetobuffer.invokeInt(new java.lang.Object[]{mHandle, countBuffer, countNeededBuffer, bufferBuffer})); + return bufferBuffer.getByteArray(0, (int)countBuffer); + } + + /** + * Writes out the model and passes the data to a provided callback function. The file type is specified by the Model Writer class. + * + * @param theWriteCallback Callback to call for writing a data chunk + * @param theSeekCallback Callback to call for seeking in the stream + * @param userData Userdata that is passed to the callback function + * @throws Lib3MFException + */ + public void writeToCallback(Lib3MFWrapper.WriteCallback theWriteCallback, Lib3MFWrapper.SeekCallback theSeekCallback, Pointer userData) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_writer_writetocallback.invokeInt(new java.lang.Object[]{mHandle, theWriteCallback, theSeekCallback, userData})); + } + + /** + * Set the progress callback for calls to this writer + * + * @param progressCallback pointer to the callback function. + * @param userData pointer to arbitrary user data that is passed without modification to the callback. + * @throws Lib3MFException + */ + public void setProgressCallback(Lib3MFWrapper.ProgressCallback progressCallback, Pointer userData) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_writer_setprogresscallback.invokeInt(new java.lang.Object[]{mHandle, progressCallback, userData})); + } + + /** + * Returns the number of digits after the decimal point to be written in each vertex coordinate-value. + * + * @return The number of digits to be written in each vertex coordinate-value after the decimal point. + * @throws Lib3MFException + */ + public int getDecimalPrecision() throws Lib3MFException { + Pointer bufferDecimalPrecision = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_writer_getdecimalprecision.invokeInt(new java.lang.Object[]{mHandle, bufferDecimalPrecision})); + return bufferDecimalPrecision.getInt(0); + } + + /** + * Sets the number of digits after the decimal point to be written in each vertex coordinate-value. + * + * @param decimalPrecision The number of digits to be written in each vertex coordinate-value after the decimal point. + * @throws Lib3MFException + */ + public void setDecimalPrecision(int decimalPrecision) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_writer_setdecimalprecision.invokeInt(new java.lang.Object[]{mHandle, decimalPrecision})); + } + + /** + * Activates (deactivates) the strict mode of the reader. + * + * @param strictModeActive flag whether strict mode is active or not. + * @throws Lib3MFException + */ + public void setStrictModeActive(boolean strictModeActive) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_writer_setstrictmodeactive.invokeInt(new java.lang.Object[]{mHandle, strictModeActive})); + } + + /** + * Queries whether the strict mode of the reader is active or not + * + * @return returns flag whether strict mode is active or not. + * @throws Lib3MFException + */ + public boolean getStrictModeActive() throws Lib3MFException { + Pointer bufferStrictModeActive = new Memory(1); + mWrapper.checkError(this, mWrapper.lib3mf_writer_getstrictmodeactive.invokeInt(new java.lang.Object[]{mHandle, bufferStrictModeActive})); + return bufferStrictModeActive.getByte(0) != 0; + } + + /** + * Returns Warning and Error Information of the read process + * + * @param index Index of the Warning. Valid values are 0 to WarningCount - 1 + * @return GetWarning Result Tuple + * @throws Lib3MFException + */ + public GetWarningResult getWarning(int index) throws Lib3MFException { + Pointer bufferErrorCode = new Memory(4); + Pointer bytesNeededWarning = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_writer_getwarning.invokeInt(new java.lang.Object[]{mHandle, index, bufferErrorCode, 0, bytesNeededWarning, null})); + int sizeWarning = bytesNeededWarning.getInt(0); + Pointer bufferWarning = new Memory(sizeWarning); + mWrapper.checkError(this, mWrapper.lib3mf_writer_getwarning.invokeInt(new java.lang.Object[]{mHandle, index, bufferErrorCode, sizeWarning, bytesNeededWarning, bufferWarning})); + GetWarningResult returnTuple = new GetWarningResult(); + returnTuple.ErrorCode = bufferErrorCode.getInt(0); + returnTuple.Warning = new String(bufferWarning.getByteArray(0, sizeWarning - 1), StandardCharsets.UTF_8); + return returnTuple; + } + + public static class GetWarningResult { + /** + * filled with the error code of the warning + */ + public int ErrorCode; + + /** + * the message of the warning + */ + public String Warning; + + } + /** + * Returns Warning and Error Count of the read process + * + * @return filled with the count of the occurred warnings. + * @throws Lib3MFException + */ + public int getWarningCount() throws Lib3MFException { + Pointer bufferCount = new Memory(4); + mWrapper.checkError(this, mWrapper.lib3mf_writer_getwarningcount.invokeInt(new java.lang.Object[]{mHandle, bufferCount})); + return bufferCount.getInt(0); + } + + /** + * Registers a callback to deal with data key encryption/decryption from keystore + * + * @param consumerID The ConsumerID to register for + * @param theCallback The callback to be callede for wrapping and encryption key + * @param userData Userdata that is passed to the callback function + * @throws Lib3MFException + */ + public void addKeyWrappingCallback(String consumerID, Lib3MFWrapper.KeyWrappingCallback theCallback, Pointer userData) throws Lib3MFException { + byte[] bytesConsumerID = consumerID.getBytes(StandardCharsets.UTF_8); + Memory bufferConsumerID = new Memory(bytesConsumerID.length + 1); + bufferConsumerID.write(0, bytesConsumerID, 0, bytesConsumerID.length); + bufferConsumerID.setByte(bytesConsumerID.length, (byte)0); + mWrapper.checkError(this, mWrapper.lib3mf_writer_addkeywrappingcallback.invokeInt(new java.lang.Object[]{mHandle, bufferConsumerID, theCallback, userData})); + } + + /** + * Registers a callback to deal with encryption of content + * + * @param theCallback The callback used to encrypt content + * @param userData Userdata that is passed to the callback function + * @throws Lib3MFException + */ + public void setContentEncryptionCallback(Lib3MFWrapper.ContentEncryptionCallback theCallback, Pointer userData) throws Lib3MFException { + mWrapper.checkError(this, mWrapper.lib3mf_writer_setcontentencryptioncallback.invokeInt(new java.lang.Object[]{mHandle, theCallback, userData})); + } + + +} + diff --git a/Autogenerated/Bindings/NodeJS/lib3mf_dynamic.cc b/Autogenerated/Bindings/NodeJS/lib3mf_dynamic.cc index c687178fc..550350f35 100644 --- a/Autogenerated/Bindings/NodeJS/lib3mf_dynamic.cc +++ b/Autogenerated/Bindings/NodeJS/lib3mf_dynamic.cc @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated plain C Header file in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -90,6 +90,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_ObjectIterator_GetCurrentObject = NULL; pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = NULL; pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = NULL; + pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject = NULL; pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = NULL; pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = NULL; pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = NULL; @@ -138,6 +139,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Object_IsMeshObject = NULL; pWrapperTable->m_Object_IsComponentsObject = NULL; pWrapperTable->m_Object_IsLevelSetObject = NULL; + pWrapperTable->m_Object_IsBooleanObject = NULL; pWrapperTable->m_Object_IsValid = NULL; pWrapperTable->m_Object_SetAttachmentAsThumbnail = NULL; pWrapperTable->m_Object_GetThumbnailAttachment = NULL; @@ -195,6 +197,20 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_LevelSet_GetMesh = NULL; pWrapperTable->m_LevelSet_GetVolumeData = NULL; pWrapperTable->m_LevelSet_SetVolumeData = NULL; + pWrapperTable->m_BooleanObject_SetBaseObject = NULL; + pWrapperTable->m_BooleanObject_GetBaseObject = NULL; + pWrapperTable->m_BooleanObject_SetBaseTransform = NULL; + pWrapperTable->m_BooleanObject_GetBaseTransform = NULL; + pWrapperTable->m_BooleanObject_SetOperation = NULL; + pWrapperTable->m_BooleanObject_GetOperation = NULL; + pWrapperTable->m_BooleanObject_SetCSGModeEnabled = NULL; + pWrapperTable->m_BooleanObject_GetCSGModeEnabled = NULL; + pWrapperTable->m_BooleanObject_SetExtractionGridResolution = NULL; + pWrapperTable->m_BooleanObject_GetExtractionGridResolution = NULL; + pWrapperTable->m_BooleanObject_GetOperandCount = NULL; + pWrapperTable->m_BooleanObject_AddOperand = NULL; + pWrapperTable->m_BooleanObject_GetOperand = NULL; + pWrapperTable->m_BooleanObject_MergeToMeshObject = NULL; pWrapperTable->m_BeamLattice_GetMinLength = NULL; pWrapperTable->m_BeamLattice_SetMinLength = NULL; pWrapperTable->m_BeamLattice_GetClipping = NULL; @@ -422,6 +438,29 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_UnsignedMeshNode_GetInputMesh = NULL; pWrapperTable->m_UnsignedMeshNode_GetInputPos = NULL; pWrapperTable->m_UnsignedMeshNode_GetOutputDistance = NULL; + pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice = NULL; + pWrapperTable->m_BeamLatticeNode_GetInputPos = NULL; + pWrapperTable->m_BeamLatticeNode_GetOutputDistance = NULL; + pWrapperTable->m_BeamLatticeNode_SetAccurateRange = NULL; + pWrapperTable->m_BeamLatticeNode_GetAccurateRange = NULL; + pWrapperTable->m_FunctionGradientNode_GetInputFunctionID = NULL; + pWrapperTable->m_FunctionGradientNode_GetInputPos = NULL; + pWrapperTable->m_FunctionGradientNode_GetInputStep = NULL; + pWrapperTable->m_FunctionGradientNode_SetScalarOutputName = NULL; + pWrapperTable->m_FunctionGradientNode_GetScalarOutputName = NULL; + pWrapperTable->m_FunctionGradientNode_SetVectorInputName = NULL; + pWrapperTable->m_FunctionGradientNode_GetVectorInputName = NULL; + pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient = NULL; + pWrapperTable->m_FunctionGradientNode_GetOutputGradient = NULL; + pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetInputPos = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetInputStep = NULL; + pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName = NULL; + pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName = NULL; + pWrapperTable->m_NormalizeDistanceNode_GetOutputResult = NULL; pWrapperTable->m_FunctionCallNode_GetInputFunctionID = NULL; pWrapperTable->m_NodeIterator_GetCurrent = NULL; pWrapperTable->m_Function_GetDisplayName = NULL; @@ -485,6 +524,9 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_ImplicitFunction_AddConstMatNode = NULL; pWrapperTable->m_ImplicitFunction_AddMeshNode = NULL; pWrapperTable->m_ImplicitFunction_AddUnsignedMeshNode = NULL; + pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode = NULL; + pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode = NULL; + pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode = NULL; pWrapperTable->m_ImplicitFunction_AddFunctionCallNode = NULL; pWrapperTable->m_ImplicitFunction_GetNodes = NULL; pWrapperTable->m_ImplicitFunction_RemoveNode = NULL; @@ -594,6 +636,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_GetMultiPropertyGroupByID = NULL; pWrapperTable->m_Model_GetMeshObjectByID = NULL; pWrapperTable->m_Model_GetComponentsObjectByID = NULL; + pWrapperTable->m_Model_GetBooleanObjectByID = NULL; pWrapperTable->m_Model_GetColorGroupByID = NULL; pWrapperTable->m_Model_GetSliceStackByID = NULL; pWrapperTable->m_Model_GetLevelSetByID = NULL; @@ -605,6 +648,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_GetObjects = NULL; pWrapperTable->m_Model_GetMeshObjects = NULL; pWrapperTable->m_Model_GetComponentsObjects = NULL; + pWrapperTable->m_Model_GetBooleanObjects = NULL; pWrapperTable->m_Model_GetTexture2Ds = NULL; pWrapperTable->m_Model_GetBaseMaterialGroups = NULL; pWrapperTable->m_Model_GetColorGroups = NULL; @@ -617,6 +661,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_MergeFromModel = NULL; pWrapperTable->m_Model_AddMeshObject = NULL; pWrapperTable->m_Model_AddComponentsObject = NULL; + pWrapperTable->m_Model_AddBooleanObject = NULL; pWrapperTable->m_Model_AddSliceStack = NULL; pWrapperTable->m_Model_AddTexture2DFromAttachment = NULL; pWrapperTable->m_Model_AddBaseMaterialGroup = NULL; @@ -1100,6 +1145,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject = (PLib3MFBooleanObjectIterator_GetCurrentBooleanObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobjectiterator_getcurrentbooleanobject"); + #else // _WIN32 + pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject = (PLib3MFBooleanObjectIterator_GetCurrentBooleanObjectPtr) dlsym(hLibrary, "lib3mf_booleanobjectiterator_getcurrentbooleanobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); #else // _WIN32 @@ -1532,6 +1586,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Object_IsLevelSetObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Object_IsBooleanObject = (PLib3MFObject_IsBooleanObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_isbooleanobject"); + #else // _WIN32 + pWrapperTable->m_Object_IsBooleanObject = (PLib3MFObject_IsBooleanObjectPtr) dlsym(hLibrary, "lib3mf_object_isbooleanobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_IsBooleanObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) GetProcAddress(hLibrary, "lib3mf_object_isvalid"); #else // _WIN32 @@ -2045,6 +2108,132 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_LevelSet_SetVolumeData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetBaseObject = (PLib3MFBooleanObject_SetBaseObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setbaseobject"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetBaseObject = (PLib3MFBooleanObject_SetBaseObjectPtr) dlsym(hLibrary, "lib3mf_booleanobject_setbaseobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetBaseObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetBaseObject = (PLib3MFBooleanObject_GetBaseObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getbaseobject"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetBaseObject = (PLib3MFBooleanObject_GetBaseObjectPtr) dlsym(hLibrary, "lib3mf_booleanobject_getbaseobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetBaseObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetBaseTransform = (PLib3MFBooleanObject_SetBaseTransformPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setbasetransform"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetBaseTransform = (PLib3MFBooleanObject_SetBaseTransformPtr) dlsym(hLibrary, "lib3mf_booleanobject_setbasetransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetBaseTransform == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetBaseTransform = (PLib3MFBooleanObject_GetBaseTransformPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getbasetransform"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetBaseTransform = (PLib3MFBooleanObject_GetBaseTransformPtr) dlsym(hLibrary, "lib3mf_booleanobject_getbasetransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetBaseTransform == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetOperation = (PLib3MFBooleanObject_SetOperationPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setoperation"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetOperation = (PLib3MFBooleanObject_SetOperationPtr) dlsym(hLibrary, "lib3mf_booleanobject_setoperation"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetOperation == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetOperation = (PLib3MFBooleanObject_GetOperationPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getoperation"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetOperation = (PLib3MFBooleanObject_GetOperationPtr) dlsym(hLibrary, "lib3mf_booleanobject_getoperation"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetOperation == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetCSGModeEnabled = (PLib3MFBooleanObject_SetCSGModeEnabledPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setcsgmodeenabled"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetCSGModeEnabled = (PLib3MFBooleanObject_SetCSGModeEnabledPtr) dlsym(hLibrary, "lib3mf_booleanobject_setcsgmodeenabled"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetCSGModeEnabled == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetCSGModeEnabled = (PLib3MFBooleanObject_GetCSGModeEnabledPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getcsgmodeenabled"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetCSGModeEnabled = (PLib3MFBooleanObject_GetCSGModeEnabledPtr) dlsym(hLibrary, "lib3mf_booleanobject_getcsgmodeenabled"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetCSGModeEnabled == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_SetExtractionGridResolution = (PLib3MFBooleanObject_SetExtractionGridResolutionPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_setextractiongridresolution"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_SetExtractionGridResolution = (PLib3MFBooleanObject_SetExtractionGridResolutionPtr) dlsym(hLibrary, "lib3mf_booleanobject_setextractiongridresolution"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_SetExtractionGridResolution == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetExtractionGridResolution = (PLib3MFBooleanObject_GetExtractionGridResolutionPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getextractiongridresolution"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetExtractionGridResolution = (PLib3MFBooleanObject_GetExtractionGridResolutionPtr) dlsym(hLibrary, "lib3mf_booleanobject_getextractiongridresolution"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetExtractionGridResolution == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetOperandCount = (PLib3MFBooleanObject_GetOperandCountPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getoperandcount"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetOperandCount = (PLib3MFBooleanObject_GetOperandCountPtr) dlsym(hLibrary, "lib3mf_booleanobject_getoperandcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetOperandCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_AddOperand = (PLib3MFBooleanObject_AddOperandPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_addoperand"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_AddOperand = (PLib3MFBooleanObject_AddOperandPtr) dlsym(hLibrary, "lib3mf_booleanobject_addoperand"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_AddOperand == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_GetOperand = (PLib3MFBooleanObject_GetOperandPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_getoperand"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_GetOperand = (PLib3MFBooleanObject_GetOperandPtr) dlsym(hLibrary, "lib3mf_booleanobject_getoperand"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_GetOperand == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BooleanObject_MergeToMeshObject = (PLib3MFBooleanObject_MergeToMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_mergetomeshobject"); + #else // _WIN32 + pWrapperTable->m_BooleanObject_MergeToMeshObject = (PLib3MFBooleanObject_MergeToMeshObjectPtr) dlsym(hLibrary, "lib3mf_booleanobject_mergetomeshobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BooleanObject_MergeToMeshObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getminlength"); #else // _WIN32 @@ -4088,6 +4277,213 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_UnsignedMeshNode_GetOutputDistance == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice = (PLib3MFBeamLatticeNode_GetInputBeamLatticePtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_getinputbeamlattice"); + #else // _WIN32 + pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice = (PLib3MFBeamLatticeNode_GetInputBeamLatticePtr) dlsym(hLibrary, "lib3mf_beamlatticenode_getinputbeamlattice"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLatticeNode_GetInputBeamLattice == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLatticeNode_GetInputPos = (PLib3MFBeamLatticeNode_GetInputPosPtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_getinputpos"); + #else // _WIN32 + pWrapperTable->m_BeamLatticeNode_GetInputPos = (PLib3MFBeamLatticeNode_GetInputPosPtr) dlsym(hLibrary, "lib3mf_beamlatticenode_getinputpos"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLatticeNode_GetInputPos == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLatticeNode_GetOutputDistance = (PLib3MFBeamLatticeNode_GetOutputDistancePtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_getoutputdistance"); + #else // _WIN32 + pWrapperTable->m_BeamLatticeNode_GetOutputDistance = (PLib3MFBeamLatticeNode_GetOutputDistancePtr) dlsym(hLibrary, "lib3mf_beamlatticenode_getoutputdistance"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLatticeNode_GetOutputDistance == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLatticeNode_SetAccurateRange = (PLib3MFBeamLatticeNode_SetAccurateRangePtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_setaccuraterange"); + #else // _WIN32 + pWrapperTable->m_BeamLatticeNode_SetAccurateRange = (PLib3MFBeamLatticeNode_SetAccurateRangePtr) dlsym(hLibrary, "lib3mf_beamlatticenode_setaccuraterange"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLatticeNode_SetAccurateRange == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLatticeNode_GetAccurateRange = (PLib3MFBeamLatticeNode_GetAccurateRangePtr) GetProcAddress(hLibrary, "lib3mf_beamlatticenode_getaccuraterange"); + #else // _WIN32 + pWrapperTable->m_BeamLatticeNode_GetAccurateRange = (PLib3MFBeamLatticeNode_GetAccurateRangePtr) dlsym(hLibrary, "lib3mf_beamlatticenode_getaccuraterange"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLatticeNode_GetAccurateRange == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputFunctionID = (PLib3MFFunctionGradientNode_GetInputFunctionIDPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getinputfunctionid"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputFunctionID = (PLib3MFFunctionGradientNode_GetInputFunctionIDPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getinputfunctionid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetInputFunctionID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputPos = (PLib3MFFunctionGradientNode_GetInputPosPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getinputpos"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputPos = (PLib3MFFunctionGradientNode_GetInputPosPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getinputpos"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetInputPos == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputStep = (PLib3MFFunctionGradientNode_GetInputStepPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getinputstep"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetInputStep = (PLib3MFFunctionGradientNode_GetInputStepPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getinputstep"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetInputStep == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_SetScalarOutputName = (PLib3MFFunctionGradientNode_SetScalarOutputNamePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_setscalaroutputname"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_SetScalarOutputName = (PLib3MFFunctionGradientNode_SetScalarOutputNamePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_setscalaroutputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_SetScalarOutputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetScalarOutputName = (PLib3MFFunctionGradientNode_GetScalarOutputNamePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getscalaroutputname"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetScalarOutputName = (PLib3MFFunctionGradientNode_GetScalarOutputNamePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getscalaroutputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetScalarOutputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_SetVectorInputName = (PLib3MFFunctionGradientNode_SetVectorInputNamePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_setvectorinputname"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_SetVectorInputName = (PLib3MFFunctionGradientNode_SetVectorInputNamePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_setvectorinputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_SetVectorInputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetVectorInputName = (PLib3MFFunctionGradientNode_GetVectorInputNamePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getvectorinputname"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetVectorInputName = (PLib3MFFunctionGradientNode_GetVectorInputNamePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getvectorinputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetVectorInputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient = (PLib3MFFunctionGradientNode_GetOutputNormalizedGradientPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getoutputnormalizedgradient"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient = (PLib3MFFunctionGradientNode_GetOutputNormalizedGradientPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getoutputnormalizedgradient"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputGradient = (PLib3MFFunctionGradientNode_GetOutputGradientPtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getoutputgradient"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputGradient = (PLib3MFFunctionGradientNode_GetOutputGradientPtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getoutputgradient"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetOutputGradient == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude = (PLib3MFFunctionGradientNode_GetOutputMagnitudePtr) GetProcAddress(hLibrary, "lib3mf_functiongradientnode_getoutputmagnitude"); + #else // _WIN32 + pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude = (PLib3MFFunctionGradientNode_GetOutputMagnitudePtr) dlsym(hLibrary, "lib3mf_functiongradientnode_getoutputmagnitude"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FunctionGradientNode_GetOutputMagnitude == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID = (PLib3MFNormalizeDistanceNode_GetInputFunctionIDPtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getinputfunctionid"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID = (PLib3MFNormalizeDistanceNode_GetInputFunctionIDPtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getinputfunctionid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetInputFunctionID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputPos = (PLib3MFNormalizeDistanceNode_GetInputPosPtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getinputpos"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputPos = (PLib3MFNormalizeDistanceNode_GetInputPosPtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getinputpos"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetInputPos == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputStep = (PLib3MFNormalizeDistanceNode_GetInputStepPtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getinputstep"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetInputStep = (PLib3MFNormalizeDistanceNode_GetInputStepPtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getinputstep"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetInputStep == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName = (PLib3MFNormalizeDistanceNode_SetScalarOutputNamePtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_setscalaroutputname"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName = (PLib3MFNormalizeDistanceNode_SetScalarOutputNamePtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_setscalaroutputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_SetScalarOutputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName = (PLib3MFNormalizeDistanceNode_GetScalarOutputNamePtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getscalaroutputname"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName = (PLib3MFNormalizeDistanceNode_GetScalarOutputNamePtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getscalaroutputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetScalarOutputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName = (PLib3MFNormalizeDistanceNode_SetVectorInputNamePtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_setvectorinputname"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName = (PLib3MFNormalizeDistanceNode_SetVectorInputNamePtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_setvectorinputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_SetVectorInputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName = (PLib3MFNormalizeDistanceNode_GetVectorInputNamePtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getvectorinputname"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName = (PLib3MFNormalizeDistanceNode_GetVectorInputNamePtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getvectorinputname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetVectorInputName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetOutputResult = (PLib3MFNormalizeDistanceNode_GetOutputResultPtr) GetProcAddress(hLibrary, "lib3mf_normalizedistancenode_getoutputresult"); + #else // _WIN32 + pWrapperTable->m_NormalizeDistanceNode_GetOutputResult = (PLib3MFNormalizeDistanceNode_GetOutputResultPtr) dlsym(hLibrary, "lib3mf_normalizedistancenode_getoutputresult"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_NormalizeDistanceNode_GetOutputResult == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_FunctionCallNode_GetInputFunctionID = (PLib3MFFunctionCallNode_GetInputFunctionIDPtr) GetProcAddress(hLibrary, "lib3mf_functioncallnode_getinputfunctionid"); #else // _WIN32 @@ -4655,6 +5051,33 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_ImplicitFunction_AddUnsignedMeshNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode = (PLib3MFImplicitFunction_AddBeamLatticeNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addbeamlatticenode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode = (PLib3MFImplicitFunction_AddBeamLatticeNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addbeamlatticenode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddBeamLatticeNode == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode = (PLib3MFImplicitFunction_AddFunctionGradientNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addfunctiongradientnode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode = (PLib3MFImplicitFunction_AddFunctionGradientNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addfunctiongradientnode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddFunctionGradientNode == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode = (PLib3MFImplicitFunction_AddNormalizeDistanceNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addnormalizedistancenode"); + #else // _WIN32 + pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode = (PLib3MFImplicitFunction_AddNormalizeDistanceNodePtr) dlsym(hLibrary, "lib3mf_implicitfunction_addnormalizedistancenode"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_ImplicitFunction_AddFunctionCallNode = (PLib3MFImplicitFunction_AddFunctionCallNodePtr) GetProcAddress(hLibrary, "lib3mf_implicitfunction_addfunctioncallnode"); #else // _WIN32 @@ -5636,6 +6059,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Model_GetComponentsObjectByID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_GetBooleanObjectByID = (PLib3MFModel_GetBooleanObjectByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getbooleanobjectbyid"); + #else // _WIN32 + pWrapperTable->m_Model_GetBooleanObjectByID = (PLib3MFModel_GetBooleanObjectByIDPtr) dlsym(hLibrary, "lib3mf_model_getbooleanobjectbyid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetBooleanObjectByID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Model_GetColorGroupByID = (PLib3MFModel_GetColorGroupByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getcolorgroupbyid"); #else // _WIN32 @@ -5735,6 +6167,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Model_GetComponentsObjects == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_GetBooleanObjects = (PLib3MFModel_GetBooleanObjectsPtr) GetProcAddress(hLibrary, "lib3mf_model_getbooleanobjects"); + #else // _WIN32 + pWrapperTable->m_Model_GetBooleanObjects = (PLib3MFModel_GetBooleanObjectsPtr) dlsym(hLibrary, "lib3mf_model_getbooleanobjects"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetBooleanObjects == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Model_GetTexture2Ds = (PLib3MFModel_GetTexture2DsPtr) GetProcAddress(hLibrary, "lib3mf_model_gettexture2ds"); #else // _WIN32 @@ -5843,6 +6284,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Model_AddComponentsObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_AddBooleanObject = (PLib3MFModel_AddBooleanObjectPtr) GetProcAddress(hLibrary, "lib3mf_model_addbooleanobject"); + #else // _WIN32 + pWrapperTable->m_Model_AddBooleanObject = (PLib3MFModel_AddBooleanObjectPtr) dlsym(hLibrary, "lib3mf_model_addbooleanobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddBooleanObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Model_AddSliceStack = (PLib3MFModel_AddSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_model_addslicestack"); #else // _WIN32 diff --git a/Autogenerated/Bindings/NodeJS/lib3mf_dynamic.h b/Autogenerated/Bindings/NodeJS/lib3mf_dynamic.h index 76b6778df..d18f473b1 100644 --- a/Autogenerated/Bindings/NodeJS/lib3mf_dynamic.h +++ b/Autogenerated/Bindings/NodeJS/lib3mf_dynamic.h @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated plain C Header file in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -484,6 +484,19 @@ typedef Lib3MFResult (*PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) (Lib3M */ typedef Lib3MFResult (*PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) (Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); +/************************************************************************************************************************* + Class definition for BooleanObjectIterator +**************************************************************************************************************************/ + +/** +* Returns the BooleanObject the iterator points at. +* +* @param[in] pBooleanObjectIterator - BooleanObjectIterator instance. +* @param[out] pResource - returns the BooleanObject instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObjectIterator_GetCurrentBooleanObjectPtr) (Lib3MF_BooleanObjectIterator pBooleanObjectIterator, Lib3MF_BooleanObject * pResource); + /************************************************************************************************************************* Class definition for Texture2DIterator **************************************************************************************************************************/ @@ -998,6 +1011,15 @@ typedef Lib3MFResult (*PLib3MFObject_IsComponentsObjectPtr) (Lib3MF_Object pObje */ typedef Lib3MFResult (*PLib3MFObject_IsLevelSetObjectPtr) (Lib3MF_Object pObject, bool * pIsLevelSetObject); +/** +* Retrieves, if an object is a boolean object +* +* @param[in] pObject - Object instance. +* @param[out] pIsBooleanObject - returns, whether the object is a boolean object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_IsBooleanObjectPtr) (Lib3MF_Object pObject, bool * pIsBooleanObject); + /** * Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * @@ -1548,6 +1570,140 @@ typedef Lib3MFResult (*PLib3MFLevelSet_GetVolumeDataPtr) (Lib3MF_LevelSet pLevel */ typedef Lib3MFResult (*PLib3MFLevelSet_SetVolumeDataPtr) (Lib3MF_LevelSet pLevelSet, Lib3MF_VolumeData pTheVolumeData); +/************************************************************************************************************************* + Class definition for BooleanObject +**************************************************************************************************************************/ + +/** +* Sets the base object and transform for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pBaseObject - base object of the boolean shape +* @param[in] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetBaseObjectPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object pBaseObject, const sLib3MFTransform * pTransform); + +/** +* Returns the base object of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pBaseObject - base object of the boolean shape +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetBaseObjectPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object * pBaseObject); + +/** +* Sets the base transform of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetBaseTransformPtr) (Lib3MF_BooleanObject pBooleanObject, const sLib3MFTransform * pTransform); + +/** +* Returns the base transform of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetBaseTransformPtr) (Lib3MF_BooleanObject pBooleanObject, sLib3MFTransform * pTransform); + +/** +* Sets the boolean operation used for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] eOperation - boolean operation used for the shape +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetOperationPtr) (Lib3MF_BooleanObject pBooleanObject, eLib3MFBooleanOperation eOperation); + +/** +* Returns the boolean operation used for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pOperation - boolean operation used for the shape +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetOperationPtr) (Lib3MF_BooleanObject pBooleanObject, eLib3MFBooleanOperation * pOperation); + +/** +* Enables or disables CSG field evaluation for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] bCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetCSGModeEnabledPtr) (Lib3MF_BooleanObject pBooleanObject, bool bCSGModeEnabled); + +/** +* Returns whether CSG field evaluation is enabled for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetCSGModeEnabledPtr) (Lib3MF_BooleanObject pBooleanObject, bool * pCSGModeEnabled); + +/** +* Sets the extraction grid resolution used for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] nGridResolution - extraction grid resolution for boolean surface extraction +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_SetExtractionGridResolutionPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nGridResolution); + +/** +* Returns the extraction grid resolution used for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pGridResolution - extraction grid resolution for boolean surface extraction +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetExtractionGridResolutionPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pGridResolution); + +/** +* Returns the number of operands in the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pCount - number of operands in the boolean sequence +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetOperandCountPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pCount); + +/** +* Adds an operand object to the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pOperandObject - mesh object used as operand +* @param[in] pTransform - transform applied to the operand object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_AddOperandPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject pOperandObject, const sLib3MFTransform * pTransform); + +/** +* Returns one operand object and transform from the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] nIndex - index of the operand in the boolean sequence +* @param[out] pOperandObject - mesh object used as operand +* @param[out] pTransform - transform applied to the operand object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_GetOperandPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nIndex, Lib3MF_MeshObject * pOperandObject, sLib3MFTransform * pTransform); + +/** +* Materializes the boolean shape into a newly created mesh object. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pMeshObject - new mesh object containing the tessellated boolean shape +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBooleanObject_MergeToMeshObjectPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject * pMeshObject); + /************************************************************************************************************************* Class definition for BeamLattice **************************************************************************************************************************/ @@ -1913,7 +2069,7 @@ typedef Lib3MFResult (*PLib3MFVolumeDataComposite_SetBaseMaterialGroupPtr) (Lib3 typedef Lib3MFResult (*PLib3MFVolumeDataComposite_GetMaterialMappingCountPtr) (Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 * pCount); /** -* Returns MaterialMappting with given index +* Returns MaterialMapping with given index * * @param[in] pVolumeDataComposite - VolumeDataComposite instance. * @param[in] nIndex - Index of the MaterialMapping in question. @@ -1923,7 +2079,7 @@ typedef Lib3MFResult (*PLib3MFVolumeDataComposite_GetMaterialMappingCountPtr) (L typedef Lib3MFResult (*PLib3MFVolumeDataComposite_GetMaterialMappingPtr) (Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 nIndex, Lib3MF_MaterialMapping * pTheMaterialMapping); /** -* Adds a the MaterialMapping +* Adds a MaterialMapping * * @param[in] pVolumeDataComposite - VolumeDataComposite instance. * @param[in] pTransform - new transformation matrix @@ -2035,7 +2191,7 @@ typedef Lib3MFResult (*PLib3MFVolumeData_RemoveColorPtr) (Lib3MF_VolumeData pVol * Returns the number of VolumeDataProperty * * @param[in] pVolumeData - VolumeData instance. -* @param[out] pCount - the number of VolumeDataProperty-elements within this VolumdeData +* @param[out] pCount - the number of VolumeDataProperty-elements within this VolumeData * @return error code or 0 (success) */ typedef Lib3MFResult (*PLib3MFVolumeData_GetPropertyCountPtr) (Lib3MF_VolumeData pVolumeData, Lib3MF_uint32 * pCount); @@ -2860,7 +3016,7 @@ typedef Lib3MFResult (*PLib3MFAttachment_SetRelationShipTypePtr) (Lib3MF_Attachm typedef Lib3MFResult (*PLib3MFAttachment_WriteToFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); /** -* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * * @param[in] pAttachment - Attachment instance. * @param[in] pFileName - file to read from. @@ -2869,7 +3025,7 @@ typedef Lib3MFResult (*PLib3MFAttachment_WriteToFilePtr) (Lib3MF_Attachment pAtt typedef Lib3MFResult (*PLib3MFAttachment_ReadFromFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); /** -* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * * @param[in] pAttachment - Attachment instance. * @param[in] pTheReadCallback - Callback to call for reading a data chunk @@ -2901,7 +3057,7 @@ typedef Lib3MFResult (*PLib3MFAttachment_GetStreamSizePtr) (Lib3MF_Attachment pA typedef Lib3MFResult (*PLib3MFAttachment_WriteToBufferPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); /** -* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* Reads an attachment from a memory buffer. This buffer is immediately read (in contrast to the ReadFromCallback and ReadFromFile-methods). * * @param[in] pAttachment - Attachment instance. * @param[in] nBufferBufferSize - Number of elements in buffer @@ -4013,6 +4169,233 @@ typedef Lib3MFResult (*PLib3MFUnsignedMeshNode_GetInputPosPtr) (Lib3MF_UnsignedM */ typedef Lib3MFResult (*PLib3MFUnsignedMeshNode_GetOutputDistancePtr) (Lib3MF_UnsignedMeshNode pUnsignedMeshNode, Lib3MF_ImplicitPort * pDistance); +/************************************************************************************************************************* + Class definition for BeamLatticeNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the model resource id of the beam lattice +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pBeamLattice - the input port for the model resource id of the beam lattice (mesh with beamlattice extension) +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_GetInputBeamLatticePtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pBeamLattice); + +/** +* Retrieves the input for the position +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_GetInputPosPtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the output +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pDistance - the output port for the signed distance to the beam lattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_GetOutputDistancePtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pDistance); + +/** +* Sets the accurate range for distance computation +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[in] dAccurateRange - the accurate range in model units +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_SetAccurateRangePtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double dAccurateRange); + +/** +* Retrieves the accurate range for distance computation +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pAccurateRange - the accurate range in model units +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLatticeNode_GetAccurateRangePtr) (Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double * pAccurateRange); + +/************************************************************************************************************************* + Class definition for FunctionGradientNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the function id +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pFunction - the input port for the function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetInputFunctionIDPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pFunction); + +/** +* Retrieves the input for the position +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetInputPosPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the input for the finite difference step +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pStep - the input port for the finite difference step +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetInputStepPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pStep); + +/** +* Sets the name of the referenced scalar output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] pScalarOutputName - the name of the scalar output of the referenced function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_SetScalarOutputNamePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pScalarOutputName); + +/** +* Retrieves the name of the referenced scalar output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetScalarOutputNamePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + +/** +* Sets the name of the referenced vector input +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_SetVectorInputNamePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pVectorInputName); + +/** +* Retrieves the name of the referenced vector input +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetVectorInputNamePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + +/** +* Retrieves the normalized gradient output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pNormalizedGradient - the output port for the normalized gradient +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetOutputNormalizedGradientPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pNormalizedGradient); + +/** +* Retrieves the raw gradient output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pGradient - the output port for the raw gradient +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetOutputGradientPtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pGradient); + +/** +* Retrieves the gradient magnitude output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pMagnitude - the output port for the gradient magnitude +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFFunctionGradientNode_GetOutputMagnitudePtr) (Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pMagnitude); + +/************************************************************************************************************************* + Class definition for NormalizeDistanceNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the function id +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pFunction - the input port for the function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetInputFunctionIDPtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pFunction); + +/** +* Retrieves the input for the position +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pPos - the input port for the position (vector) +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetInputPosPtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the input for the finite difference step +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pStep - the input port for the finite difference step +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetInputStepPtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pStep); + +/** +* Sets the name of the referenced scalar output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] pScalarOutputName - the name of the scalar output of the referenced function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_SetScalarOutputNamePtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pScalarOutputName); + +/** +* Retrieves the name of the referenced scalar output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetScalarOutputNamePtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + +/** +* Sets the name of the referenced vector input +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_SetVectorInputNamePtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pVectorInputName); + +/** +* Retrieves the name of the referenced vector input +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetVectorInputNamePtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + +/** +* Retrieves the normalized result output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pResult - the output port for the normalized distance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFNormalizeDistanceNode_GetOutputResultPtr) (Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pResult); + /************************************************************************************************************************* Class definition for FunctionCallNode **************************************************************************************************************************/ @@ -4788,6 +5171,42 @@ typedef Lib3MFResult (*PLib3MFImplicitFunction_AddMeshNodePtr) (Lib3MF_ImplicitF */ typedef Lib3MFResult (*PLib3MFImplicitFunction_AddUnsignedMeshNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_UnsignedMeshNode * pNode); +/** +* Add a BeamLatticeNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFImplicitFunction_AddBeamLatticeNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_BeamLatticeNode * pNode); + +/** +* Add a FunctionGradientNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFImplicitFunction_AddFunctionGradientNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_FunctionGradientNode * pNode); + +/** +* Add a NormalizeDistanceNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFImplicitFunction_AddNormalizeDistanceNodePtr) (Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_NormalizeDistanceNode * pNode); + /** * Add a FunctionCallNode * @@ -5902,6 +6321,16 @@ typedef Lib3MFResult (*PLib3MFModel_GetMeshObjectByIDPtr) (Lib3MF_Model pModel, */ typedef Lib3MFResult (*PLib3MFModel_GetComponentsObjectByIDPtr) (Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_ComponentsObject * pComponentsObjectInstance); +/** +* finds a boolean object by its UniqueResourceID +* +* @param[in] pModel - Model instance. +* @param[in] nUniqueResourceID - UniqueResourceID +* @param[out] pBooleanObjectInstance - returns the boolean object instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_GetBooleanObjectByIDPtr) (Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_BooleanObject * pBooleanObjectInstance); + /** * finds a model color group by its UniqueResourceID * @@ -6007,6 +6436,15 @@ typedef Lib3MFResult (*PLib3MFModel_GetMeshObjectsPtr) (Lib3MF_Model pModel, Lib */ typedef Lib3MFResult (*PLib3MFModel_GetComponentsObjectsPtr) (Lib3MF_Model pModel, Lib3MF_ComponentsObjectIterator * pResourceIterator); +/** +* creates a resource iterator instance with all boolean object resources. +* +* @param[in] pModel - Model instance. +* @param[out] pResourceIterator - returns the iterator instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_GetBooleanObjectsPtr) (Lib3MF_Model pModel, Lib3MF_BooleanObjectIterator * pResourceIterator); + /** * creates a Texture2DIterator instance with all texture2d resources. * @@ -6115,6 +6553,15 @@ typedef Lib3MFResult (*PLib3MFModel_AddMeshObjectPtr) (Lib3MF_Model pModel, Lib3 */ typedef Lib3MFResult (*PLib3MFModel_AddComponentsObjectPtr) (Lib3MF_Model pModel, Lib3MF_ComponentsObject * pComponentsObjectInstance); +/** +* adds an empty boolean object to the model. +* +* @param[in] pModel - Model instance. +* @param[out] pBooleanObjectInstance - returns the boolean object instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_AddBooleanObjectPtr) (Lib3MF_Model pModel, Lib3MF_BooleanObject * pBooleanObjectInstance); + /** * creates a new model slicestack by its id * @@ -6665,6 +7112,7 @@ typedef struct { PLib3MFObjectIterator_GetCurrentObjectPtr m_ObjectIterator_GetCurrentObject; PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr m_MeshObjectIterator_GetCurrentMeshObject; PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr m_ComponentsObjectIterator_GetCurrentComponentsObject; + PLib3MFBooleanObjectIterator_GetCurrentBooleanObjectPtr m_BooleanObjectIterator_GetCurrentBooleanObject; PLib3MFTexture2DIterator_GetCurrentTexture2DPtr m_Texture2DIterator_GetCurrentTexture2D; PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup; PLib3MFColorGroupIterator_GetCurrentColorGroupPtr m_ColorGroupIterator_GetCurrentColorGroup; @@ -6713,6 +7161,7 @@ typedef struct { PLib3MFObject_IsMeshObjectPtr m_Object_IsMeshObject; PLib3MFObject_IsComponentsObjectPtr m_Object_IsComponentsObject; PLib3MFObject_IsLevelSetObjectPtr m_Object_IsLevelSetObject; + PLib3MFObject_IsBooleanObjectPtr m_Object_IsBooleanObject; PLib3MFObject_IsValidPtr m_Object_IsValid; PLib3MFObject_SetAttachmentAsThumbnailPtr m_Object_SetAttachmentAsThumbnail; PLib3MFObject_GetThumbnailAttachmentPtr m_Object_GetThumbnailAttachment; @@ -6770,6 +7219,20 @@ typedef struct { PLib3MFLevelSet_GetMeshPtr m_LevelSet_GetMesh; PLib3MFLevelSet_GetVolumeDataPtr m_LevelSet_GetVolumeData; PLib3MFLevelSet_SetVolumeDataPtr m_LevelSet_SetVolumeData; + PLib3MFBooleanObject_SetBaseObjectPtr m_BooleanObject_SetBaseObject; + PLib3MFBooleanObject_GetBaseObjectPtr m_BooleanObject_GetBaseObject; + PLib3MFBooleanObject_SetBaseTransformPtr m_BooleanObject_SetBaseTransform; + PLib3MFBooleanObject_GetBaseTransformPtr m_BooleanObject_GetBaseTransform; + PLib3MFBooleanObject_SetOperationPtr m_BooleanObject_SetOperation; + PLib3MFBooleanObject_GetOperationPtr m_BooleanObject_GetOperation; + PLib3MFBooleanObject_SetCSGModeEnabledPtr m_BooleanObject_SetCSGModeEnabled; + PLib3MFBooleanObject_GetCSGModeEnabledPtr m_BooleanObject_GetCSGModeEnabled; + PLib3MFBooleanObject_SetExtractionGridResolutionPtr m_BooleanObject_SetExtractionGridResolution; + PLib3MFBooleanObject_GetExtractionGridResolutionPtr m_BooleanObject_GetExtractionGridResolution; + PLib3MFBooleanObject_GetOperandCountPtr m_BooleanObject_GetOperandCount; + PLib3MFBooleanObject_AddOperandPtr m_BooleanObject_AddOperand; + PLib3MFBooleanObject_GetOperandPtr m_BooleanObject_GetOperand; + PLib3MFBooleanObject_MergeToMeshObjectPtr m_BooleanObject_MergeToMeshObject; PLib3MFBeamLattice_GetMinLengthPtr m_BeamLattice_GetMinLength; PLib3MFBeamLattice_SetMinLengthPtr m_BeamLattice_SetMinLength; PLib3MFBeamLattice_GetClippingPtr m_BeamLattice_GetClipping; @@ -6997,6 +7460,29 @@ typedef struct { PLib3MFUnsignedMeshNode_GetInputMeshPtr m_UnsignedMeshNode_GetInputMesh; PLib3MFUnsignedMeshNode_GetInputPosPtr m_UnsignedMeshNode_GetInputPos; PLib3MFUnsignedMeshNode_GetOutputDistancePtr m_UnsignedMeshNode_GetOutputDistance; + PLib3MFBeamLatticeNode_GetInputBeamLatticePtr m_BeamLatticeNode_GetInputBeamLattice; + PLib3MFBeamLatticeNode_GetInputPosPtr m_BeamLatticeNode_GetInputPos; + PLib3MFBeamLatticeNode_GetOutputDistancePtr m_BeamLatticeNode_GetOutputDistance; + PLib3MFBeamLatticeNode_SetAccurateRangePtr m_BeamLatticeNode_SetAccurateRange; + PLib3MFBeamLatticeNode_GetAccurateRangePtr m_BeamLatticeNode_GetAccurateRange; + PLib3MFFunctionGradientNode_GetInputFunctionIDPtr m_FunctionGradientNode_GetInputFunctionID; + PLib3MFFunctionGradientNode_GetInputPosPtr m_FunctionGradientNode_GetInputPos; + PLib3MFFunctionGradientNode_GetInputStepPtr m_FunctionGradientNode_GetInputStep; + PLib3MFFunctionGradientNode_SetScalarOutputNamePtr m_FunctionGradientNode_SetScalarOutputName; + PLib3MFFunctionGradientNode_GetScalarOutputNamePtr m_FunctionGradientNode_GetScalarOutputName; + PLib3MFFunctionGradientNode_SetVectorInputNamePtr m_FunctionGradientNode_SetVectorInputName; + PLib3MFFunctionGradientNode_GetVectorInputNamePtr m_FunctionGradientNode_GetVectorInputName; + PLib3MFFunctionGradientNode_GetOutputNormalizedGradientPtr m_FunctionGradientNode_GetOutputNormalizedGradient; + PLib3MFFunctionGradientNode_GetOutputGradientPtr m_FunctionGradientNode_GetOutputGradient; + PLib3MFFunctionGradientNode_GetOutputMagnitudePtr m_FunctionGradientNode_GetOutputMagnitude; + PLib3MFNormalizeDistanceNode_GetInputFunctionIDPtr m_NormalizeDistanceNode_GetInputFunctionID; + PLib3MFNormalizeDistanceNode_GetInputPosPtr m_NormalizeDistanceNode_GetInputPos; + PLib3MFNormalizeDistanceNode_GetInputStepPtr m_NormalizeDistanceNode_GetInputStep; + PLib3MFNormalizeDistanceNode_SetScalarOutputNamePtr m_NormalizeDistanceNode_SetScalarOutputName; + PLib3MFNormalizeDistanceNode_GetScalarOutputNamePtr m_NormalizeDistanceNode_GetScalarOutputName; + PLib3MFNormalizeDistanceNode_SetVectorInputNamePtr m_NormalizeDistanceNode_SetVectorInputName; + PLib3MFNormalizeDistanceNode_GetVectorInputNamePtr m_NormalizeDistanceNode_GetVectorInputName; + PLib3MFNormalizeDistanceNode_GetOutputResultPtr m_NormalizeDistanceNode_GetOutputResult; PLib3MFFunctionCallNode_GetInputFunctionIDPtr m_FunctionCallNode_GetInputFunctionID; PLib3MFNodeIterator_GetCurrentPtr m_NodeIterator_GetCurrent; PLib3MFFunction_GetDisplayNamePtr m_Function_GetDisplayName; @@ -7060,6 +7546,9 @@ typedef struct { PLib3MFImplicitFunction_AddConstMatNodePtr m_ImplicitFunction_AddConstMatNode; PLib3MFImplicitFunction_AddMeshNodePtr m_ImplicitFunction_AddMeshNode; PLib3MFImplicitFunction_AddUnsignedMeshNodePtr m_ImplicitFunction_AddUnsignedMeshNode; + PLib3MFImplicitFunction_AddBeamLatticeNodePtr m_ImplicitFunction_AddBeamLatticeNode; + PLib3MFImplicitFunction_AddFunctionGradientNodePtr m_ImplicitFunction_AddFunctionGradientNode; + PLib3MFImplicitFunction_AddNormalizeDistanceNodePtr m_ImplicitFunction_AddNormalizeDistanceNode; PLib3MFImplicitFunction_AddFunctionCallNodePtr m_ImplicitFunction_AddFunctionCallNode; PLib3MFImplicitFunction_GetNodesPtr m_ImplicitFunction_GetNodes; PLib3MFImplicitFunction_RemoveNodePtr m_ImplicitFunction_RemoveNode; @@ -7169,6 +7658,7 @@ typedef struct { PLib3MFModel_GetMultiPropertyGroupByIDPtr m_Model_GetMultiPropertyGroupByID; PLib3MFModel_GetMeshObjectByIDPtr m_Model_GetMeshObjectByID; PLib3MFModel_GetComponentsObjectByIDPtr m_Model_GetComponentsObjectByID; + PLib3MFModel_GetBooleanObjectByIDPtr m_Model_GetBooleanObjectByID; PLib3MFModel_GetColorGroupByIDPtr m_Model_GetColorGroupByID; PLib3MFModel_GetSliceStackByIDPtr m_Model_GetSliceStackByID; PLib3MFModel_GetLevelSetByIDPtr m_Model_GetLevelSetByID; @@ -7180,6 +7670,7 @@ typedef struct { PLib3MFModel_GetObjectsPtr m_Model_GetObjects; PLib3MFModel_GetMeshObjectsPtr m_Model_GetMeshObjects; PLib3MFModel_GetComponentsObjectsPtr m_Model_GetComponentsObjects; + PLib3MFModel_GetBooleanObjectsPtr m_Model_GetBooleanObjects; PLib3MFModel_GetTexture2DsPtr m_Model_GetTexture2Ds; PLib3MFModel_GetBaseMaterialGroupsPtr m_Model_GetBaseMaterialGroups; PLib3MFModel_GetColorGroupsPtr m_Model_GetColorGroups; @@ -7192,6 +7683,7 @@ typedef struct { PLib3MFModel_MergeFromModelPtr m_Model_MergeFromModel; PLib3MFModel_AddMeshObjectPtr m_Model_AddMeshObject; PLib3MFModel_AddComponentsObjectPtr m_Model_AddComponentsObject; + PLib3MFModel_AddBooleanObjectPtr m_Model_AddBooleanObject; PLib3MFModel_AddSliceStackPtr m_Model_AddSliceStack; PLib3MFModel_AddTexture2DFromAttachmentPtr m_Model_AddTexture2DFromAttachment; PLib3MFModel_AddBaseMaterialGroupPtr m_Model_AddBaseMaterialGroup; diff --git a/Autogenerated/Bindings/NodeJS/lib3mf_nodeaddon.cc b/Autogenerated/Bindings/NodeJS/lib3mf_nodeaddon.cc index 2422bc092..9bf593ea5 100644 --- a/Autogenerated/Bindings/NodeJS/lib3mf_nodeaddon.cc +++ b/Autogenerated/Bindings/NodeJS/lib3mf_nodeaddon.cc @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++ Implementation file for the Node addon class of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -58,6 +58,7 @@ void InitAll(v8::Local exports, v8::Local module) CLib3MFObjectIterator::Init(); CLib3MFMeshObjectIterator::Init(); CLib3MFComponentsObjectIterator::Init(); + CLib3MFBooleanObjectIterator::Init(); CLib3MFTexture2DIterator::Init(); CLib3MFBaseMaterialGroupIterator::Init(); CLib3MFColorGroupIterator::Init(); @@ -73,6 +74,7 @@ void InitAll(v8::Local exports, v8::Local module) CLib3MFObject::Init(); CLib3MFMeshObject::Init(); CLib3MFLevelSet::Init(); + CLib3MFBooleanObject::Init(); CLib3MFBeamLattice::Init(); CLib3MFFunctionReference::Init(); CLib3MFVolumeDataColor::Init(); @@ -148,6 +150,9 @@ void InitAll(v8::Local exports, v8::Local module) CLib3MFConstMatNode::Init(); CLib3MFMeshNode::Init(); CLib3MFUnsignedMeshNode::Init(); + CLib3MFBeamLatticeNode::Init(); + CLib3MFFunctionGradientNode::Init(); + CLib3MFNormalizeDistanceNode::Init(); CLib3MFFunctionCallNode::Init(); CLib3MFNodeIterator::Init(); CLib3MFFunction::Init(); diff --git a/Autogenerated/Bindings/NodeJS/lib3mf_nodewrapper.cc b/Autogenerated/Bindings/NodeJS/lib3mf_nodewrapper.cc index 07b5130b7..e7978aa73 100644 --- a/Autogenerated/Bindings/NodeJS/lib3mf_nodewrapper.cc +++ b/Autogenerated/Bindings/NodeJS/lib3mf_nodewrapper.cc @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++ Implementation file for the Node wrapper class of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -51,6 +51,7 @@ Persistent CLib3MFSliceStackIterator::constructor; Persistent CLib3MFObjectIterator::constructor; Persistent CLib3MFMeshObjectIterator::constructor; Persistent CLib3MFComponentsObjectIterator::constructor; +Persistent CLib3MFBooleanObjectIterator::constructor; Persistent CLib3MFTexture2DIterator::constructor; Persistent CLib3MFBaseMaterialGroupIterator::constructor; Persistent CLib3MFColorGroupIterator::constructor; @@ -66,6 +67,7 @@ Persistent CLib3MFTriangleSet::constructor; Persistent CLib3MFObject::constructor; Persistent CLib3MFMeshObject::constructor; Persistent CLib3MFLevelSet::constructor; +Persistent CLib3MFBooleanObject::constructor; Persistent CLib3MFBeamLattice::constructor; Persistent CLib3MFFunctionReference::constructor; Persistent CLib3MFVolumeDataColor::constructor; @@ -141,6 +143,9 @@ Persistent CLib3MFConstVecNode::constructor; Persistent CLib3MFConstMatNode::constructor; Persistent CLib3MFMeshNode::constructor; Persistent CLib3MFUnsignedMeshNode::constructor; +Persistent CLib3MFBeamLatticeNode::constructor; +Persistent CLib3MFFunctionGradientNode::constructor; +Persistent CLib3MFNormalizeDistanceNode::constructor; Persistent CLib3MFFunctionCallNode::constructor; Persistent CLib3MFNodeIterator::constructor; Persistent CLib3MFFunction::constructor; @@ -3008,6 +3013,85 @@ void CLib3MFComponentsObjectIterator::GetCurrentComponentsObject(const FunctionC } } +/************************************************************************************************************************* + Class CLib3MFBooleanObjectIterator Implementation +**************************************************************************************************************************/ + +CLib3MFBooleanObjectIterator::CLib3MFBooleanObjectIterator() + : CLib3MFBaseClass() +{ +} + +CLib3MFBooleanObjectIterator::~CLib3MFBooleanObjectIterator() +{ +} + +void CLib3MFBooleanObjectIterator::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBooleanObjectIterator")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentBooleanObject", GetCurrentBooleanObject); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFBooleanObjectIterator::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFBooleanObjectIterator * booleanobjectiteratorInstance = new CLib3MFBooleanObjectIterator(); + booleanobjectiteratorInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFBooleanObjectIterator: Invalid call to Constructor"); + } +} + +Local CLib3MFBooleanObjectIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFBooleanObjectIterator::GetCurrentBooleanObject(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnResource = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentBooleanObject."); + if (wrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject == nullptr) + throw std::runtime_error("Could not call Lib3MF method BooleanObjectIterator::GetCurrentBooleanObject."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BooleanObjectIterator_GetCurrentBooleanObject(instanceHandle, &hReturnResource); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjResource = CLib3MFBooleanObject::NewInstance(args.Holder(), hReturnResource); + args.GetReturnValue().Set(instanceObjResource); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + /************************************************************************************************************************* Class CLib3MFTexture2DIterator Implementation **************************************************************************************************************************/ @@ -4720,6 +4804,7 @@ void CLib3MFObject::Init() NODE_SET_PROTOTYPE_METHOD(tpl, "IsMeshObject", IsMeshObject); NODE_SET_PROTOTYPE_METHOD(tpl, "IsComponentsObject", IsComponentsObject); NODE_SET_PROTOTYPE_METHOD(tpl, "IsLevelSetObject", IsLevelSetObject); + NODE_SET_PROTOTYPE_METHOD(tpl, "IsBooleanObject", IsBooleanObject); NODE_SET_PROTOTYPE_METHOD(tpl, "IsValid", IsValid); NODE_SET_PROTOTYPE_METHOD(tpl, "SetAttachmentAsThumbnail", SetAttachmentAsThumbnail); NODE_SET_PROTOTYPE_METHOD(tpl, "GetThumbnailAttachment", GetThumbnailAttachment); @@ -4983,6 +5068,28 @@ void CLib3MFObject::IsLevelSetObject(const FunctionCallbackInfo& args) } +void CLib3MFObject::IsBooleanObject(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + bool bReturnIsBooleanObject = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method IsBooleanObject."); + if (wrapperTable->m_Object_IsBooleanObject == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::IsBooleanObject."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_IsBooleanObject(instanceHandle, &bReturnIsBooleanObject); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnIsBooleanObject)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + void CLib3MFObject::IsValid(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); @@ -6529,71 +6636,62 @@ void CLib3MFLevelSet::SetVolumeData(const FunctionCallbackInfo& args) } /************************************************************************************************************************* - Class CLib3MFBeamLattice Implementation + Class CLib3MFBooleanObject Implementation **************************************************************************************************************************/ -CLib3MFBeamLattice::CLib3MFBeamLattice() +CLib3MFBooleanObject::CLib3MFBooleanObject() : CLib3MFBaseClass() { } -CLib3MFBeamLattice::~CLib3MFBeamLattice() +CLib3MFBooleanObject::~CLib3MFBooleanObject() { } -void CLib3MFBeamLattice::Init() +void CLib3MFBooleanObject::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBeamLattice")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBooleanObject")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetMinLength", GetMinLength); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetMinLength", SetMinLength); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetClipping", GetClipping); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetClipping", SetClipping); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetRepresentation", GetRepresentation); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetRepresentation", SetRepresentation); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBallOptions", GetBallOptions); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetBallOptions", SetBallOptions); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeamCount", GetBeamCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeam", GetBeam); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddBeam", AddBeam); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetBeam", SetBeam); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetBeams", SetBeams); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeams", GetBeams); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBallCount", GetBallCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBall", GetBall); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddBall", AddBall); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetBall", SetBall); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetBalls", SetBalls); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBalls", GetBalls); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeamSetCount", GetBeamSetCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddBeamSet", AddBeamSet); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeamSet", GetBeamSet); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetBaseObject", SetBaseObject); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBaseObject", GetBaseObject); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetBaseTransform", SetBaseTransform); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBaseTransform", GetBaseTransform); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetOperation", SetOperation); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOperation", GetOperation); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetCSGModeEnabled", SetCSGModeEnabled); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCSGModeEnabled", GetCSGModeEnabled); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetExtractionGridResolution", SetExtractionGridResolution); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetExtractionGridResolution", GetExtractionGridResolution); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOperandCount", GetOperandCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddOperand", AddOperand); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOperand", GetOperand); + NODE_SET_PROTOTYPE_METHOD(tpl, "MergeToMeshObject", MergeToMeshObject); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFBeamLattice::New(const FunctionCallbackInfo& args) +void CLib3MFBooleanObject::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFBeamLattice * beamlatticeInstance = new CLib3MFBeamLattice(); - beamlatticeInstance->Wrap(args.This()); + CLib3MFBooleanObject * booleanobjectInstance = new CLib3MFBooleanObject(); + booleanobjectInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFBeamLattice: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFBooleanObject: Invalid call to Constructor"); } } -Local CLib3MFBeamLattice::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFBooleanObject::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -6607,21 +6705,31 @@ Local CLib3MFBeamLattice::NewInstance(Local pParent, Lib3MFHandl } -void CLib3MFBeamLattice::GetMinLength(const FunctionCallbackInfo& args) +void CLib3MFBooleanObject::SetBaseObject(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - double dReturnMinLength = 0.0; + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected class parameter 0 (BaseObject)"); + } + if (!args[1]->IsObject()) { + throw std::runtime_error("Expected struct parameter 1 (Transform)"); + } + Local objBaseObject = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFObject * instanceBaseObject = ObjectWrap::Unwrap(objBaseObject); + if (instanceBaseObject == nullptr) + throw std::runtime_error("Invalid Object parameter 0 (BaseObject)"); + Lib3MFHandle hBaseObject = instanceBaseObject->getHandle( objBaseObject ); + sLib3MFTransform sTransform = convertObjectToLib3MFTransform(isolate, args[1]); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMinLength."); - if (wrapperTable->m_BeamLattice_GetMinLength == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetMinLength."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBaseObject."); + if (wrapperTable->m_BooleanObject_SetBaseObject == nullptr) + throw std::runtime_error("Could not call Lib3MF method BooleanObject::SetBaseObject."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetMinLength(instanceHandle, &dReturnMinLength); + Lib3MFResult errorCode = wrapperTable->m_BooleanObject_SetBaseObject(instanceHandle, hBaseObject, &sTransform); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Number::New(isolate, dReturnMinLength)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6629,23 +6737,22 @@ void CLib3MFBeamLattice::GetMinLength(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::SetMinLength(const FunctionCallbackInfo& args) +void CLib3MFBooleanObject::GetBaseObject(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsNumber()) { - throw std::runtime_error("Expected double parameter 0 (MinLength)"); - } - double dMinLength = (double) args[0]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnBaseObject = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetMinLength."); - if (wrapperTable->m_BeamLattice_SetMinLength == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetMinLength."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBaseObject."); + if (wrapperTable->m_BooleanObject_GetBaseObject == nullptr) + throw std::runtime_error("Could not call Lib3MF method BooleanObject::GetBaseObject."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetMinLength(instanceHandle, dMinLength); + Lib3MFResult errorCode = wrapperTable->m_BooleanObject_GetBaseObject(instanceHandle, &hReturnBaseObject); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjBaseObject = CLib3MFObject::NewInstance(args.Holder(), hReturnBaseObject); + args.GetReturnValue().Set(instanceObjBaseObject); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6653,25 +6760,23 @@ void CLib3MFBeamLattice::SetMinLength(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetClipping(const FunctionCallbackInfo& args) +void CLib3MFBooleanObject::SetBaseTransform(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Local outObject = Object::New(isolate); - eLib3MFBeamLatticeClipMode eReturnClipMode; - unsigned int nReturnUniqueResourceID = 0; + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected struct parameter 0 (Transform)"); + } + sLib3MFTransform sTransform = convertObjectToLib3MFTransform(isolate, args[0]); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetClipping."); - if (wrapperTable->m_BeamLattice_GetClipping == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetClipping."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBaseTransform."); + if (wrapperTable->m_BooleanObject_SetBaseTransform == nullptr) + throw std::runtime_error("Could not call Lib3MF method BooleanObject::SetBaseTransform."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetClipping(instanceHandle, &eReturnClipMode, &nReturnUniqueResourceID); + Lib3MFResult errorCode = wrapperTable->m_BooleanObject_SetBaseTransform(instanceHandle, &sTransform); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "ClipMode"), Integer::New(isolate, (int)eReturnClipMode)); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UniqueResourceID"), Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); - args.GetReturnValue().Set(outObject); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6679,27 +6784,21 @@ void CLib3MFBeamLattice::GetClipping(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::SetClipping(const FunctionCallbackInfo& args) +void CLib3MFBooleanObject::GetBaseTransform(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected enum parameter 0 (ClipMode)"); - } - if (!args[1]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 1 (UniqueResourceID)"); - } - unsigned int eClipMode = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - unsigned int nUniqueResourceID = (unsigned int) args[1]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFTransform sReturnTransform; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetClipping."); - if (wrapperTable->m_BeamLattice_SetClipping == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetClipping."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBaseTransform."); + if (wrapperTable->m_BooleanObject_GetBaseTransform == nullptr) + throw std::runtime_error("Could not call Lib3MF method BooleanObject::GetBaseTransform."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetClipping(instanceHandle, (eLib3MFBeamLatticeClipMode) eClipMode, nUniqueResourceID); + Lib3MFResult errorCode = wrapperTable->m_BooleanObject_GetBaseTransform(instanceHandle, &sReturnTransform); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(convertLib3MFTransformToObject(isolate, sReturnTransform)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6707,25 +6806,23 @@ void CLib3MFBeamLattice::SetClipping(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetRepresentation(const FunctionCallbackInfo& args) +void CLib3MFBooleanObject::SetOperation(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Local outObject = Object::New(isolate); - bool bReturnHasRepresentation = false; - unsigned int nReturnUniqueResourceID = 0; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected enum parameter 0 (Operation)"); + } + unsigned int eOperation = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetRepresentation."); - if (wrapperTable->m_BeamLattice_GetRepresentation == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetRepresentation."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetOperation."); + if (wrapperTable->m_BooleanObject_SetOperation == nullptr) + throw std::runtime_error("Could not call Lib3MF method BooleanObject::SetOperation."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetRepresentation(instanceHandle, &bReturnHasRepresentation, &nReturnUniqueResourceID); + Lib3MFResult errorCode = wrapperTable->m_BooleanObject_SetOperation(instanceHandle, (eLib3MFBooleanOperation) eOperation); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "HasRepresentation"), Boolean::New(isolate, bReturnHasRepresentation)); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UniqueResourceID"), Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); - args.GetReturnValue().Set(outObject); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6733,23 +6830,21 @@ void CLib3MFBeamLattice::GetRepresentation(const FunctionCallbackInfo& ar } -void CLib3MFBeamLattice::SetRepresentation(const FunctionCallbackInfo& args) +void CLib3MFBooleanObject::GetOperation(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (UniqueResourceID)"); - } - unsigned int nUniqueResourceID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + eLib3MFBooleanOperation eReturnOperation; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetRepresentation."); - if (wrapperTable->m_BeamLattice_SetRepresentation == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetRepresentation."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOperation."); + if (wrapperTable->m_BooleanObject_GetOperation == nullptr) + throw std::runtime_error("Could not call Lib3MF method BooleanObject::GetOperation."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetRepresentation(instanceHandle, nUniqueResourceID); + Lib3MFResult errorCode = wrapperTable->m_BooleanObject_GetOperation(instanceHandle, &eReturnOperation); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::New(isolate, (int)eReturnOperation)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6757,25 +6852,23 @@ void CLib3MFBeamLattice::SetRepresentation(const FunctionCallbackInfo& ar } -void CLib3MFBeamLattice::GetBallOptions(const FunctionCallbackInfo& args) +void CLib3MFBooleanObject::SetCSGModeEnabled(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Local outObject = Object::New(isolate); - eLib3MFBeamLatticeBallMode eReturnBallMode; - double dReturnBallRadius = 0.0; + if (!args[0]->IsBoolean()) { + throw std::runtime_error("Expected bool parameter 0 (CSGModeEnabled)"); + } + bool bCSGModeEnabled = args[0]->BooleanValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBallOptions."); - if (wrapperTable->m_BeamLattice_GetBallOptions == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBallOptions."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetCSGModeEnabled."); + if (wrapperTable->m_BooleanObject_SetCSGModeEnabled == nullptr) + throw std::runtime_error("Could not call Lib3MF method BooleanObject::SetCSGModeEnabled."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBallOptions(instanceHandle, &eReturnBallMode, &dReturnBallRadius); + Lib3MFResult errorCode = wrapperTable->m_BooleanObject_SetCSGModeEnabled(instanceHandle, bCSGModeEnabled); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "BallMode"), Integer::New(isolate, (int)eReturnBallMode)); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "BallRadius"), Number::New(isolate, dReturnBallRadius)); - args.GetReturnValue().Set(outObject); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6783,27 +6876,21 @@ void CLib3MFBeamLattice::GetBallOptions(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::SetBallOptions(const FunctionCallbackInfo& args) +void CLib3MFBooleanObject::GetCSGModeEnabled(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected enum parameter 0 (BallMode)"); - } - if (!args[1]->IsNumber()) { - throw std::runtime_error("Expected double parameter 1 (BallRadius)"); - } - unsigned int eBallMode = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - double dBallRadius = (double) args[1]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + bool bReturnCSGModeEnabled = false; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBallOptions."); - if (wrapperTable->m_BeamLattice_SetBallOptions == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBallOptions."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCSGModeEnabled."); + if (wrapperTable->m_BooleanObject_GetCSGModeEnabled == nullptr) + throw std::runtime_error("Could not call Lib3MF method BooleanObject::GetCSGModeEnabled."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBallOptions(instanceHandle, (eLib3MFBeamLatticeBallMode) eBallMode, dBallRadius); + Lib3MFResult errorCode = wrapperTable->m_BooleanObject_GetCSGModeEnabled(instanceHandle, &bReturnCSGModeEnabled); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnCSGModeEnabled)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6811,21 +6898,23 @@ void CLib3MFBeamLattice::SetBallOptions(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetBeamCount(const FunctionCallbackInfo& args) +void CLib3MFBooleanObject::SetExtractionGridResolution(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnCount = 0; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (GridResolution)"); + } + unsigned int nGridResolution = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeamCount."); - if (wrapperTable->m_BeamLattice_GetBeamCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeamCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetExtractionGridResolution."); + if (wrapperTable->m_BooleanObject_SetExtractionGridResolution == nullptr) + throw std::runtime_error("Could not call Lib3MF method BooleanObject::SetExtractionGridResolution."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeamCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_BooleanObject_SetExtractionGridResolution(instanceHandle, nGridResolution); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6833,25 +6922,21 @@ void CLib3MFBeamLattice::GetBeamCount(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetBeam(const FunctionCallbackInfo& args) +void CLib3MFBooleanObject::GetExtractionGridResolution(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); - } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFBeam sReturnBeamInfo; + unsigned int nReturnGridResolution = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeam."); - if (wrapperTable->m_BeamLattice_GetBeam == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeam."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetExtractionGridResolution."); + if (wrapperTable->m_BooleanObject_GetExtractionGridResolution == nullptr) + throw std::runtime_error("Could not call Lib3MF method BooleanObject::GetExtractionGridResolution."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeam(instanceHandle, nIndex, &sReturnBeamInfo); + Lib3MFResult errorCode = wrapperTable->m_BooleanObject_GetExtractionGridResolution(instanceHandle, &nReturnGridResolution); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFBeamToObject(isolate, sReturnBeamInfo)); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnGridResolution)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6859,25 +6944,21 @@ void CLib3MFBeamLattice::GetBeam(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::AddBeam(const FunctionCallbackInfo& args) +void CLib3MFBooleanObject::GetOperandCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected struct parameter 0 (BeamInfo)"); - } - sLib3MFBeam sBeamInfo = convertObjectToLib3MFBeam(isolate, args[0]); - unsigned int nReturnIndex = 0; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddBeam."); - if (wrapperTable->m_BeamLattice_AddBeam == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::AddBeam."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOperandCount."); + if (wrapperTable->m_BooleanObject_GetOperandCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method BooleanObject::GetOperandCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_AddBeam(instanceHandle, &sBeamInfo, &nReturnIndex); + Lib3MFResult errorCode = wrapperTable->m_BooleanObject_GetOperandCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnIndex)); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6885,26 +6966,30 @@ void CLib3MFBeamLattice::AddBeam(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::SetBeam(const FunctionCallbackInfo& args) +void CLib3MFBooleanObject::AddOperand(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected class parameter 0 (OperandObject)"); } if (!args[1]->IsObject()) { - throw std::runtime_error("Expected struct parameter 1 (BeamInfo)"); + throw std::runtime_error("Expected struct parameter 1 (Transform)"); } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFBeam sBeamInfo = convertObjectToLib3MFBeam(isolate, args[1]); + Local objOperandObject = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFMeshObject * instanceOperandObject = ObjectWrap::Unwrap(objOperandObject); + if (instanceOperandObject == nullptr) + throw std::runtime_error("Invalid Object parameter 0 (OperandObject)"); + Lib3MFHandle hOperandObject = instanceOperandObject->getHandle( objOperandObject ); + sLib3MFTransform sTransform = convertObjectToLib3MFTransform(isolate, args[1]); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBeam."); - if (wrapperTable->m_BeamLattice_SetBeam == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBeam."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddOperand."); + if (wrapperTable->m_BooleanObject_AddOperand == nullptr) + throw std::runtime_error("Could not call Lib3MF method BooleanObject::AddOperand."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBeam(instanceHandle, nIndex, &sBeamInfo); + Lib3MFResult errorCode = wrapperTable->m_BooleanObject_AddOperand(instanceHandle, hOperandObject, &sTransform); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -6913,19 +6998,30 @@ void CLib3MFBeamLattice::SetBeam(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::SetBeams(const FunctionCallbackInfo& args) +void CLib3MFBooleanObject::GetOperand(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + Local outObject = Object::New(isolate); + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnOperandObject = nullptr; + sLib3MFTransform sReturnTransform; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBeams."); - if (wrapperTable->m_BeamLattice_SetBeams == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBeams."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOperand."); + if (wrapperTable->m_BooleanObject_GetOperand == nullptr) + throw std::runtime_error("Could not call Lib3MF method BooleanObject::GetOperand."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBeams(instanceHandle, 0, nullptr); + Lib3MFResult errorCode = wrapperTable->m_BooleanObject_GetOperand(instanceHandle, nIndex, &hReturnOperandObject, &sReturnTransform); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjOperandObject = CLib3MFMeshObject::NewInstance(args.Holder(), hReturnOperandObject); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "OperandObject"), instanceObjOperandObject); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "Transform"), convertLib3MFTransformToObject(isolate, sReturnTransform)); + args.GetReturnValue().Set(outObject); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6933,41 +7029,122 @@ void CLib3MFBeamLattice::SetBeams(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetBeams(const FunctionCallbackInfo& args) +void CLib3MFBooleanObject::MergeToMeshObject(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + Lib3MFHandle hReturnMeshObject = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeams."); - if (wrapperTable->m_BeamLattice_GetBeams == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeams."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method MergeToMeshObject."); + if (wrapperTable->m_BooleanObject_MergeToMeshObject == nullptr) + throw std::runtime_error("Could not call Lib3MF method BooleanObject::MergeToMeshObject."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeams(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_BooleanObject_MergeToMeshObject(instanceHandle, &hReturnMeshObject); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjMeshObject = CLib3MFMeshObject::NewInstance(args.Holder(), hReturnMeshObject); + args.GetReturnValue().Set(instanceObjMeshObject); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } +/************************************************************************************************************************* + Class CLib3MFBeamLattice Implementation +**************************************************************************************************************************/ -void CLib3MFBeamLattice::GetBallCount(const FunctionCallbackInfo& args) +CLib3MFBeamLattice::CLib3MFBeamLattice() + : CLib3MFBaseClass() +{ +} + +CLib3MFBeamLattice::~CLib3MFBeamLattice() +{ +} + +void CLib3MFBeamLattice::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBeamLattice")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetMinLength", GetMinLength); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetMinLength", SetMinLength); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetClipping", GetClipping); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetClipping", SetClipping); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetRepresentation", GetRepresentation); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetRepresentation", SetRepresentation); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBallOptions", GetBallOptions); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetBallOptions", SetBallOptions); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeamCount", GetBeamCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeam", GetBeam); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddBeam", AddBeam); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetBeam", SetBeam); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetBeams", SetBeams); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeams", GetBeams); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBallCount", GetBallCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBall", GetBall); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddBall", AddBall); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetBall", SetBall); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetBalls", SetBalls); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBalls", GetBalls); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeamSetCount", GetBeamSetCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddBeamSet", AddBeamSet); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeamSet", GetBeamSet); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFBeamLattice::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFBeamLattice * beamlatticeInstance = new CLib3MFBeamLattice(); + beamlatticeInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFBeamLattice: Invalid call to Constructor"); + } +} + +Local CLib3MFBeamLattice::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFBeamLattice::GetMinLength(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnCount = 0; + double dReturnMinLength = 0.0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBallCount."); - if (wrapperTable->m_BeamLattice_GetBallCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBallCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMinLength."); + if (wrapperTable->m_BeamLattice_GetMinLength == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetMinLength."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBallCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetMinLength(instanceHandle, &dReturnMinLength); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); + args.GetReturnValue().Set(Number::New(isolate, dReturnMinLength)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6975,25 +7152,23 @@ void CLib3MFBeamLattice::GetBallCount(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetBall(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::SetMinLength(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + if (!args[0]->IsNumber()) { + throw std::runtime_error("Expected double parameter 0 (MinLength)"); } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFBall sReturnBallInfo; + double dMinLength = (double) args[0]->NumberValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBall."); - if (wrapperTable->m_BeamLattice_GetBall == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBall."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetMinLength."); + if (wrapperTable->m_BeamLattice_SetMinLength == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetMinLength."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBall(instanceHandle, nIndex, &sReturnBallInfo); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetMinLength(instanceHandle, dMinLength); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFBallToObject(isolate, sReturnBallInfo)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7001,25 +7176,25 @@ void CLib3MFBeamLattice::GetBall(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::AddBall(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetClipping(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected struct parameter 0 (BallInfo)"); - } - sLib3MFBall sBallInfo = convertObjectToLib3MFBall(isolate, args[0]); - unsigned int nReturnIndex = 0; + Local outObject = Object::New(isolate); + eLib3MFBeamLatticeClipMode eReturnClipMode; + unsigned int nReturnUniqueResourceID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddBall."); - if (wrapperTable->m_BeamLattice_AddBall == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::AddBall."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetClipping."); + if (wrapperTable->m_BeamLattice_GetClipping == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetClipping."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_AddBall(instanceHandle, &sBallInfo, &nReturnIndex); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetClipping(instanceHandle, &eReturnClipMode, &nReturnUniqueResourceID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnIndex)); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "ClipMode"), Integer::New(isolate, (int)eReturnClipMode)); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UniqueResourceID"), Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); + args.GetReturnValue().Set(outObject); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7027,26 +7202,26 @@ void CLib3MFBeamLattice::AddBall(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::SetBall(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::SetClipping(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + throw std::runtime_error("Expected enum parameter 0 (ClipMode)"); } - if (!args[1]->IsObject()) { - throw std::runtime_error("Expected struct parameter 1 (BallInfo)"); + if (!args[1]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 1 (UniqueResourceID)"); } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFBall sBallInfo = convertObjectToLib3MFBall(isolate, args[1]); + unsigned int eClipMode = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nUniqueResourceID = (unsigned int) args[1]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBall."); - if (wrapperTable->m_BeamLattice_SetBall == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBall."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetClipping."); + if (wrapperTable->m_BeamLattice_SetClipping == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetClipping."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBall(instanceHandle, nIndex, &sBallInfo); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetClipping(instanceHandle, (eLib3MFBeamLatticeClipMode) eClipMode, nUniqueResourceID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -7055,19 +7230,25 @@ void CLib3MFBeamLattice::SetBall(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::SetBalls(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetRepresentation(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + Local outObject = Object::New(isolate); + bool bReturnHasRepresentation = false; + unsigned int nReturnUniqueResourceID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBalls."); - if (wrapperTable->m_BeamLattice_SetBalls == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBalls."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetRepresentation."); + if (wrapperTable->m_BeamLattice_GetRepresentation == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetRepresentation."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBalls(instanceHandle, 0, nullptr); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetRepresentation(instanceHandle, &bReturnHasRepresentation, &nReturnUniqueResourceID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "HasRepresentation"), Boolean::New(isolate, bReturnHasRepresentation)); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UniqueResourceID"), Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); + args.GetReturnValue().Set(outObject); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7075,18 +7256,22 @@ void CLib3MFBeamLattice::SetBalls(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetBalls(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::SetRepresentation(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (UniqueResourceID)"); + } + unsigned int nUniqueResourceID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBalls."); - if (wrapperTable->m_BeamLattice_GetBalls == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBalls."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetRepresentation."); + if (wrapperTable->m_BeamLattice_SetRepresentation == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetRepresentation."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBalls(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetRepresentation(instanceHandle, nUniqueResourceID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -7095,21 +7280,25 @@ void CLib3MFBeamLattice::GetBalls(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetBeamSetCount(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetBallOptions(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnCount = 0; + Local outObject = Object::New(isolate); + eLib3MFBeamLatticeBallMode eReturnBallMode; + double dReturnBallRadius = 0.0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeamSetCount."); - if (wrapperTable->m_BeamLattice_GetBeamSetCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeamSetCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBallOptions."); + if (wrapperTable->m_BeamLattice_GetBallOptions == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBallOptions."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeamSetCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBallOptions(instanceHandle, &eReturnBallMode, &dReturnBallRadius); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "BallMode"), Integer::New(isolate, (int)eReturnBallMode)); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "BallRadius"), Number::New(isolate, dReturnBallRadius)); + args.GetReturnValue().Set(outObject); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7117,22 +7306,27 @@ void CLib3MFBeamLattice::GetBeamSetCount(const FunctionCallbackInfo& args } -void CLib3MFBeamLattice::AddBeamSet(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::SetBallOptions(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnBeamSet = nullptr; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected enum parameter 0 (BallMode)"); + } + if (!args[1]->IsNumber()) { + throw std::runtime_error("Expected double parameter 1 (BallRadius)"); + } + unsigned int eBallMode = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + double dBallRadius = (double) args[1]->NumberValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddBeamSet."); - if (wrapperTable->m_BeamLattice_AddBeamSet == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::AddBeamSet."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBallOptions."); + if (wrapperTable->m_BeamLattice_SetBallOptions == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBallOptions."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_AddBeamSet(instanceHandle, &hReturnBeamSet); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBallOptions(instanceHandle, (eLib3MFBeamLatticeBallMode) eBallMode, dBallRadius); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjBeamSet = CLib3MFBeamSet::NewInstance(args.Holder(), hReturnBeamSet); - args.GetReturnValue().Set(instanceObjBeamSet); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7140,113 +7334,101 @@ void CLib3MFBeamLattice::AddBeamSet(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetBeamSet(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetBeamCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); - } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - Lib3MFHandle hReturnBeamSet = nullptr; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeamSet."); - if (wrapperTable->m_BeamLattice_GetBeamSet == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeamSet."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeamCount."); + if (wrapperTable->m_BeamLattice_GetBeamCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeamCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeamSet(instanceHandle, nIndex, &hReturnBeamSet); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeamCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjBeamSet = CLib3MFBeamSet::NewInstance(args.Holder(), hReturnBeamSet); - args.GetReturnValue().Set(instanceObjBeamSet); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } -/************************************************************************************************************************* - Class CLib3MFFunctionReference Implementation -**************************************************************************************************************************/ - -CLib3MFFunctionReference::CLib3MFFunctionReference() - : CLib3MFBaseClass() -{ -} - -CLib3MFFunctionReference::~CLib3MFFunctionReference() -{ -} - -void CLib3MFFunctionReference::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFFunctionReference")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetFunctionResourceID", GetFunctionResourceID); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetFunctionResourceID", SetFunctionResourceID); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetTransform", GetTransform); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetTransform", SetTransform); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetChannelName", GetChannelName); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetChannelName", SetChannelName); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetMinFeatureSize", SetMinFeatureSize); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetMinFeatureSize", GetMinFeatureSize); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetFallBackValue", SetFallBackValue); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetFallBackValue", GetFallBackValue); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - -} -void CLib3MFFunctionReference::New(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetBeam(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFBeam sReturnBeamInfo; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeam."); + if (wrapperTable->m_BeamLattice_GetBeam == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeam."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeam(instanceHandle, nIndex, &sReturnBeamInfo); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(convertLib3MFBeamToObject(isolate, sReturnBeamInfo)); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFFunctionReference * functionreferenceInstance = new CLib3MFFunctionReference(); - functionreferenceInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFFunctionReference: Invalid call to Constructor"); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } } -Local CLib3MFFunctionReference::NewInstance(Local pParent, Lib3MFHandle pHandle) + +void CLib3MFBeamLattice::AddBeam(const FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + try { + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected struct parameter 0 (BeamInfo)"); + } + sLib3MFBeam sBeamInfo = convertObjectToLib3MFBeam(isolate, args[0]); + unsigned int nReturnIndex = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddBeam."); + if (wrapperTable->m_BeamLattice_AddBeam == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::AddBeam."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_AddBeam(instanceHandle, &sBeamInfo, &nReturnIndex); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnIndex)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFFunctionReference::GetFunctionResourceID(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::SetBeam(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnUniqueResourceID = 0; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + if (!args[1]->IsObject()) { + throw std::runtime_error("Expected struct parameter 1 (BeamInfo)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFBeam sBeamInfo = convertObjectToLib3MFBeam(isolate, args[1]); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetFunctionResourceID."); - if (wrapperTable->m_FunctionReference_GetFunctionResourceID == nullptr) - throw std::runtime_error("Could not call Lib3MF method FunctionReference::GetFunctionResourceID."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBeam."); + if (wrapperTable->m_BeamLattice_SetBeam == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBeam."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_FunctionReference_GetFunctionResourceID(instanceHandle, &nReturnUniqueResourceID); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBeam(instanceHandle, nIndex, &sBeamInfo); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7254,22 +7436,18 @@ void CLib3MFFunctionReference::GetFunctionResourceID(const FunctionCallbackInfo< } -void CLib3MFFunctionReference::SetFunctionResourceID(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::SetBeams(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (UniqueResourceID)"); - } - unsigned int nUniqueResourceID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetFunctionResourceID."); - if (wrapperTable->m_FunctionReference_SetFunctionResourceID == nullptr) - throw std::runtime_error("Could not call Lib3MF method FunctionReference::SetFunctionResourceID."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBeams."); + if (wrapperTable->m_BeamLattice_SetBeams == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBeams."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_FunctionReference_SetFunctionResourceID(instanceHandle, nUniqueResourceID); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBeams(instanceHandle, 0, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -7278,21 +7456,19 @@ void CLib3MFFunctionReference::SetFunctionResourceID(const FunctionCallbackInfo< } -void CLib3MFFunctionReference::GetTransform(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetBeams(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - sLib3MFTransform sReturnTransform; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTransform."); - if (wrapperTable->m_FunctionReference_GetTransform == nullptr) - throw std::runtime_error("Could not call Lib3MF method FunctionReference::GetTransform."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeams."); + if (wrapperTable->m_BeamLattice_GetBeams == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeams."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_FunctionReference_GetTransform(instanceHandle, &sReturnTransform); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeams(instanceHandle, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFTransformToObject(isolate, sReturnTransform)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7300,23 +7476,21 @@ void CLib3MFFunctionReference::GetTransform(const FunctionCallbackInfo& a } -void CLib3MFFunctionReference::SetTransform(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetBallCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected struct parameter 0 (Transform)"); - } - sLib3MFTransform sTransform = convertObjectToLib3MFTransform(isolate, args[0]); + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetTransform."); - if (wrapperTable->m_FunctionReference_SetTransform == nullptr) - throw std::runtime_error("Could not call Lib3MF method FunctionReference::SetTransform."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBallCount."); + if (wrapperTable->m_BeamLattice_GetBallCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBallCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_FunctionReference_SetTransform(instanceHandle, &sTransform); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBallCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7324,26 +7498,25 @@ void CLib3MFFunctionReference::SetTransform(const FunctionCallbackInfo& a } -void CLib3MFFunctionReference::GetChannelName(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetBall(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int bytesNeededChannelName = 0; - unsigned int bytesWrittenChannelName = 0; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFBall sReturnBallInfo; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetChannelName."); - if (wrapperTable->m_FunctionReference_GetChannelName == nullptr) - throw std::runtime_error("Could not call Lib3MF method FunctionReference::GetChannelName."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBall."); + if (wrapperTable->m_BeamLattice_GetBall == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBall."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_FunctionReference_GetChannelName(instanceHandle, 0, &bytesNeededChannelName, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferChannelName; - bufferChannelName.resize(bytesNeededChannelName); - Lib3MFResult errorCode = wrapperTable->m_FunctionReference_GetChannelName(instanceHandle, bytesNeededChannelName, &bytesWrittenChannelName, &bufferChannelName[0]); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBall(instanceHandle, nIndex, &sReturnBallInfo); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferChannelName[0])); + args.GetReturnValue().Set(convertLib3MFBallToObject(isolate, sReturnBallInfo)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7351,24 +7524,25 @@ void CLib3MFFunctionReference::GetChannelName(const FunctionCallbackInfo& } -void CLib3MFFunctionReference::SetChannelName(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::AddBall(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (ChannelName)"); + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected struct parameter 0 (BallInfo)"); } - v8::String::Utf8Value sutf8ChannelName(isolate, args[0]); - std::string sChannelName = *sutf8ChannelName; + sLib3MFBall sBallInfo = convertObjectToLib3MFBall(isolate, args[0]); + unsigned int nReturnIndex = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetChannelName."); - if (wrapperTable->m_FunctionReference_SetChannelName == nullptr) - throw std::runtime_error("Could not call Lib3MF method FunctionReference::SetChannelName."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddBall."); + if (wrapperTable->m_BeamLattice_AddBall == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::AddBall."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_FunctionReference_SetChannelName(instanceHandle, sChannelName.c_str()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_AddBall(instanceHandle, &sBallInfo, &nReturnIndex); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnIndex)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7376,22 +7550,26 @@ void CLib3MFFunctionReference::SetChannelName(const FunctionCallbackInfo& } -void CLib3MFFunctionReference::SetMinFeatureSize(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::SetBall(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsNumber()) { - throw std::runtime_error("Expected double parameter 0 (MinFeatureSize)"); + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); } - double dMinFeatureSize = (double) args[0]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + if (!args[1]->IsObject()) { + throw std::runtime_error("Expected struct parameter 1 (BallInfo)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFBall sBallInfo = convertObjectToLib3MFBall(isolate, args[1]); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetMinFeatureSize."); - if (wrapperTable->m_FunctionReference_SetMinFeatureSize == nullptr) - throw std::runtime_error("Could not call Lib3MF method FunctionReference::SetMinFeatureSize."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBall."); + if (wrapperTable->m_BeamLattice_SetBall == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBall."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_FunctionReference_SetMinFeatureSize(instanceHandle, dMinFeatureSize); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBall(instanceHandle, nIndex, &sBallInfo); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -7400,21 +7578,19 @@ void CLib3MFFunctionReference::SetMinFeatureSize(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::SetBalls(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - double dReturnMinFeatureSize = 0.0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMinFeatureSize."); - if (wrapperTable->m_FunctionReference_GetMinFeatureSize == nullptr) - throw std::runtime_error("Could not call Lib3MF method FunctionReference::GetMinFeatureSize."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBalls."); + if (wrapperTable->m_BeamLattice_SetBalls == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBalls."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_FunctionReference_GetMinFeatureSize(instanceHandle, &dReturnMinFeatureSize); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBalls(instanceHandle, 0, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Number::New(isolate, dReturnMinFeatureSize)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7422,22 +7598,18 @@ void CLib3MFFunctionReference::GetMinFeatureSize(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetBalls(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsNumber()) { - throw std::runtime_error("Expected double parameter 0 (FallBackValue)"); - } - double dFallBackValue = (double) args[0]->NumberValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetFallBackValue."); - if (wrapperTable->m_FunctionReference_SetFallBackValue == nullptr) - throw std::runtime_error("Could not call Lib3MF method FunctionReference::SetFallBackValue."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBalls."); + if (wrapperTable->m_BeamLattice_GetBalls == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBalls."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_FunctionReference_SetFallBackValue(instanceHandle, dFallBackValue); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBalls(instanceHandle, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -7446,186 +7618,130 @@ void CLib3MFFunctionReference::SetFallBackValue(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetBeamSetCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - double dReturnFallBackValue = 0.0; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetFallBackValue."); - if (wrapperTable->m_FunctionReference_GetFallBackValue == nullptr) - throw std::runtime_error("Could not call Lib3MF method FunctionReference::GetFallBackValue."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeamSetCount."); + if (wrapperTable->m_BeamLattice_GetBeamSetCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeamSetCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_FunctionReference_GetFallBackValue(instanceHandle, &dReturnFallBackValue); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeamSetCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Number::New(isolate, dReturnFallBackValue)); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } -/************************************************************************************************************************* - Class CLib3MFVolumeDataColor Implementation -**************************************************************************************************************************/ - -CLib3MFVolumeDataColor::CLib3MFVolumeDataColor() - : CLib3MFBaseClass() -{ -} - -CLib3MFVolumeDataColor::~CLib3MFVolumeDataColor() -{ -} - -void CLib3MFVolumeDataColor::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFVolumeDataColor")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - - // Prototype - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - -} - -void CLib3MFVolumeDataColor::New(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::AddBeamSet(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + Lib3MFHandle hReturnBeamSet = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddBeamSet."); + if (wrapperTable->m_BeamLattice_AddBeamSet == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::AddBeamSet."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_AddBeamSet(instanceHandle, &hReturnBeamSet); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjBeamSet = CLib3MFBeamSet::NewInstance(args.Holder(), hReturnBeamSet); + args.GetReturnValue().Set(instanceObjBeamSet); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFVolumeDataColor * volumedatacolorInstance = new CLib3MFVolumeDataColor(); - volumedatacolorInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFVolumeDataColor: Invalid call to Constructor"); - } -} - -Local CLib3MFVolumeDataColor::NewInstance(Local pParent, Lib3MFHandle pHandle) -{ - Isolate* isolate = Isolate::GetCurrent(); - HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; -} - -/************************************************************************************************************************* - Class CLib3MFMaterialMapping Implementation -**************************************************************************************************************************/ - -CLib3MFMaterialMapping::CLib3MFMaterialMapping() - : CLib3MFBaseClass() -{ -} - -CLib3MFMaterialMapping::~CLib3MFMaterialMapping() -{ } -void CLib3MFMaterialMapping::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMaterialMapping")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - - // Prototype - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - -} -void CLib3MFMaterialMapping::New(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetBeamSet(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnBeamSet = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeamSet."); + if (wrapperTable->m_BeamLattice_GetBeamSet == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeamSet."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeamSet(instanceHandle, nIndex, &hReturnBeamSet); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjBeamSet = CLib3MFBeamSet::NewInstance(args.Holder(), hReturnBeamSet); + args.GetReturnValue().Set(instanceObjBeamSet); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFMaterialMapping * materialmappingInstance = new CLib3MFMaterialMapping(); - materialmappingInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFMaterialMapping: Invalid call to Constructor"); - } -} - -Local CLib3MFMaterialMapping::NewInstance(Local pParent, Lib3MFHandle pHandle) -{ - Isolate* isolate = Isolate::GetCurrent(); - HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } /************************************************************************************************************************* - Class CLib3MFVolumeDataComposite Implementation + Class CLib3MFFunctionReference Implementation **************************************************************************************************************************/ -CLib3MFVolumeDataComposite::CLib3MFVolumeDataComposite() +CLib3MFFunctionReference::CLib3MFFunctionReference() : CLib3MFBaseClass() { } -CLib3MFVolumeDataComposite::~CLib3MFVolumeDataComposite() +CLib3MFFunctionReference::~CLib3MFFunctionReference() { } -void CLib3MFVolumeDataComposite::Init() +void CLib3MFFunctionReference::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFVolumeDataComposite")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFFunctionReference")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBaseMaterialGroup", GetBaseMaterialGroup); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetBaseMaterialGroup", SetBaseMaterialGroup); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetMaterialMappingCount", GetMaterialMappingCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetMaterialMapping", GetMaterialMapping); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddMaterialMapping", AddMaterialMapping); - NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveMaterialMapping", RemoveMaterialMapping); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetFunctionResourceID", GetFunctionResourceID); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetFunctionResourceID", SetFunctionResourceID); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetTransform", GetTransform); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetTransform", SetTransform); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetChannelName", GetChannelName); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetChannelName", SetChannelName); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetMinFeatureSize", SetMinFeatureSize); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetMinFeatureSize", GetMinFeatureSize); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetFallBackValue", SetFallBackValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetFallBackValue", GetFallBackValue); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFVolumeDataComposite::New(const FunctionCallbackInfo& args) +void CLib3MFFunctionReference::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFVolumeDataComposite * volumedatacompositeInstance = new CLib3MFVolumeDataComposite(); - volumedatacompositeInstance->Wrap(args.This()); + CLib3MFFunctionReference * functionreferenceInstance = new CLib3MFFunctionReference(); + functionreferenceInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFVolumeDataComposite: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFFunctionReference: Invalid call to Constructor"); } } -Local CLib3MFVolumeDataComposite::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFFunctionReference::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -7639,22 +7755,21 @@ Local CLib3MFVolumeDataComposite::NewInstance(Local pParent, Lib } -void CLib3MFVolumeDataComposite::GetBaseMaterialGroup(const FunctionCallbackInfo& args) +void CLib3MFFunctionReference::GetFunctionResourceID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnBaseMaterialGroupInstance = nullptr; + unsigned int nReturnUniqueResourceID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBaseMaterialGroup."); - if (wrapperTable->m_VolumeDataComposite_GetBaseMaterialGroup == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeDataComposite::GetBaseMaterialGroup."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetFunctionResourceID."); + if (wrapperTable->m_FunctionReference_GetFunctionResourceID == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionReference::GetFunctionResourceID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeDataComposite_GetBaseMaterialGroup(instanceHandle, &hReturnBaseMaterialGroupInstance); + Lib3MFResult errorCode = wrapperTable->m_FunctionReference_GetFunctionResourceID(instanceHandle, &nReturnUniqueResourceID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjBaseMaterialGroupInstance = CLib3MFBaseMaterialGroup::NewInstance(args.Holder(), hReturnBaseMaterialGroupInstance); - args.GetReturnValue().Set(instanceObjBaseMaterialGroupInstance); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7662,26 +7777,22 @@ void CLib3MFVolumeDataComposite::GetBaseMaterialGroup(const FunctionCallbackInfo } -void CLib3MFVolumeDataComposite::SetBaseMaterialGroup(const FunctionCallbackInfo& args) +void CLib3MFFunctionReference::SetFunctionResourceID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected class parameter 0 (BaseMaterialGroupInstance)"); + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (UniqueResourceID)"); } - Local objBaseMaterialGroupInstance = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); - CLib3MFBaseMaterialGroup * instanceBaseMaterialGroupInstance = ObjectWrap::Unwrap(objBaseMaterialGroupInstance); - if (instanceBaseMaterialGroupInstance == nullptr) - throw std::runtime_error("Invalid Object parameter 0 (BaseMaterialGroupInstance)"); - Lib3MFHandle hBaseMaterialGroupInstance = instanceBaseMaterialGroupInstance->getHandle( objBaseMaterialGroupInstance ); + unsigned int nUniqueResourceID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBaseMaterialGroup."); - if (wrapperTable->m_VolumeDataComposite_SetBaseMaterialGroup == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeDataComposite::SetBaseMaterialGroup."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetFunctionResourceID."); + if (wrapperTable->m_FunctionReference_SetFunctionResourceID == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionReference::SetFunctionResourceID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeDataComposite_SetBaseMaterialGroup(instanceHandle, hBaseMaterialGroupInstance); + Lib3MFResult errorCode = wrapperTable->m_FunctionReference_SetFunctionResourceID(instanceHandle, nUniqueResourceID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -7690,21 +7801,21 @@ void CLib3MFVolumeDataComposite::SetBaseMaterialGroup(const FunctionCallbackInfo } -void CLib3MFVolumeDataComposite::GetMaterialMappingCount(const FunctionCallbackInfo& args) +void CLib3MFFunctionReference::GetTransform(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnCount = 0; + sLib3MFTransform sReturnTransform; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMaterialMappingCount."); - if (wrapperTable->m_VolumeDataComposite_GetMaterialMappingCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeDataComposite::GetMaterialMappingCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTransform."); + if (wrapperTable->m_FunctionReference_GetTransform == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionReference::GetTransform."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeDataComposite_GetMaterialMappingCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_FunctionReference_GetTransform(instanceHandle, &sReturnTransform); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); + args.GetReturnValue().Set(convertLib3MFTransformToObject(isolate, sReturnTransform)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7712,26 +7823,23 @@ void CLib3MFVolumeDataComposite::GetMaterialMappingCount(const FunctionCallbackI } -void CLib3MFVolumeDataComposite::GetMaterialMapping(const FunctionCallbackInfo& args) +void CLib3MFFunctionReference::SetTransform(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected struct parameter 0 (Transform)"); } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - Lib3MFHandle hReturnTheMaterialMapping = nullptr; + sLib3MFTransform sTransform = convertObjectToLib3MFTransform(isolate, args[0]); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMaterialMapping."); - if (wrapperTable->m_VolumeDataComposite_GetMaterialMapping == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeDataComposite::GetMaterialMapping."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetTransform."); + if (wrapperTable->m_FunctionReference_SetTransform == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionReference::SetTransform."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeDataComposite_GetMaterialMapping(instanceHandle, nIndex, &hReturnTheMaterialMapping); + Lib3MFResult errorCode = wrapperTable->m_FunctionReference_SetTransform(instanceHandle, &sTransform); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjTheMaterialMapping = CLib3MFMaterialMapping::NewInstance(args.Holder(), hReturnTheMaterialMapping); - args.GetReturnValue().Set(instanceObjTheMaterialMapping); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7739,26 +7847,26 @@ void CLib3MFVolumeDataComposite::GetMaterialMapping(const FunctionCallbackInfo& args) +void CLib3MFFunctionReference::GetChannelName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected struct parameter 0 (Transform)"); - } - sLib3MFTransform sTransform = convertObjectToLib3MFTransform(isolate, args[0]); - Lib3MFHandle hReturnTheMaterialMapping = nullptr; + unsigned int bytesNeededChannelName = 0; + unsigned int bytesWrittenChannelName = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddMaterialMapping."); - if (wrapperTable->m_VolumeDataComposite_AddMaterialMapping == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeDataComposite::AddMaterialMapping."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetChannelName."); + if (wrapperTable->m_FunctionReference_GetChannelName == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionReference::GetChannelName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeDataComposite_AddMaterialMapping(instanceHandle, &sTransform, &hReturnTheMaterialMapping); + Lib3MFResult initErrorCode = wrapperTable->m_FunctionReference_GetChannelName(instanceHandle, 0, &bytesNeededChannelName, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferChannelName; + bufferChannelName.resize(bytesNeededChannelName); + Lib3MFResult errorCode = wrapperTable->m_FunctionReference_GetChannelName(instanceHandle, bytesNeededChannelName, &bytesWrittenChannelName, &bufferChannelName[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjTheMaterialMapping = CLib3MFMaterialMapping::NewInstance(args.Holder(), hReturnTheMaterialMapping); - args.GetReturnValue().Set(instanceObjTheMaterialMapping); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferChannelName[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7766,22 +7874,23 @@ void CLib3MFVolumeDataComposite::AddMaterialMapping(const FunctionCallbackInfo& args) +void CLib3MFFunctionReference::SetChannelName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (ChannelName)"); } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + v8::String::Utf8Value sutf8ChannelName(isolate, args[0]); + std::string sChannelName = *sutf8ChannelName; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveMaterialMapping."); - if (wrapperTable->m_VolumeDataComposite_RemoveMaterialMapping == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeDataComposite::RemoveMaterialMapping."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetChannelName."); + if (wrapperTable->m_FunctionReference_SetChannelName == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionReference::SetChannelName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeDataComposite_RemoveMaterialMapping(instanceHandle, nIndex); + Lib3MFResult errorCode = wrapperTable->m_FunctionReference_SetChannelName(instanceHandle, sChannelName.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -7789,85 +7898,46 @@ void CLib3MFVolumeDataComposite::RemoveMaterialMapping(const FunctionCallbackInf } } -/************************************************************************************************************************* - Class CLib3MFVolumeDataProperty Implementation -**************************************************************************************************************************/ - -CLib3MFVolumeDataProperty::CLib3MFVolumeDataProperty() - : CLib3MFBaseClass() -{ -} - -CLib3MFVolumeDataProperty::~CLib3MFVolumeDataProperty() -{ -} - -void CLib3MFVolumeDataProperty::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFVolumeDataProperty")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetName", GetName); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetIsRequired", SetIsRequired); - NODE_SET_PROTOTYPE_METHOD(tpl, "IsRequired", IsRequired); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - -} -void CLib3MFVolumeDataProperty::New(const FunctionCallbackInfo& args) +void CLib3MFFunctionReference::SetMinFeatureSize(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + if (!args[0]->IsNumber()) { + throw std::runtime_error("Expected double parameter 0 (MinFeatureSize)"); + } + double dMinFeatureSize = (double) args[0]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetMinFeatureSize."); + if (wrapperTable->m_FunctionReference_SetMinFeatureSize == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionReference::SetMinFeatureSize."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_FunctionReference_SetMinFeatureSize(instanceHandle, dMinFeatureSize); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFVolumeDataProperty * volumedatapropertyInstance = new CLib3MFVolumeDataProperty(); - volumedatapropertyInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFVolumeDataProperty: Invalid call to Constructor"); - } -} - -Local CLib3MFVolumeDataProperty::NewInstance(Local pParent, Lib3MFHandle pHandle) -{ - Isolate* isolate = Isolate::GetCurrent(); - HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFVolumeDataProperty::GetName(const FunctionCallbackInfo& args) +void CLib3MFFunctionReference::GetMinFeatureSize(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int bytesNeededPropertyName = 0; - unsigned int bytesWrittenPropertyName = 0; + double dReturnMinFeatureSize = 0.0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetName."); - if (wrapperTable->m_VolumeDataProperty_GetName == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeDataProperty::GetName."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMinFeatureSize."); + if (wrapperTable->m_FunctionReference_GetMinFeatureSize == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionReference::GetMinFeatureSize."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_VolumeDataProperty_GetName(instanceHandle, 0, &bytesNeededPropertyName, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferPropertyName; - bufferPropertyName.resize(bytesNeededPropertyName); - Lib3MFResult errorCode = wrapperTable->m_VolumeDataProperty_GetName(instanceHandle, bytesNeededPropertyName, &bytesWrittenPropertyName, &bufferPropertyName[0]); + Lib3MFResult errorCode = wrapperTable->m_FunctionReference_GetMinFeatureSize(instanceHandle, &dReturnMinFeatureSize); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferPropertyName[0])); + args.GetReturnValue().Set(Number::New(isolate, dReturnMinFeatureSize)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7875,22 +7945,22 @@ void CLib3MFVolumeDataProperty::GetName(const FunctionCallbackInfo& args) } -void CLib3MFVolumeDataProperty::SetIsRequired(const FunctionCallbackInfo& args) +void CLib3MFFunctionReference::SetFallBackValue(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsBoolean()) { - throw std::runtime_error("Expected bool parameter 0 (IsRequired)"); + if (!args[0]->IsNumber()) { + throw std::runtime_error("Expected double parameter 0 (FallBackValue)"); } - bool bIsRequired = args[0]->BooleanValue(isolate->GetCurrentContext()).ToChecked(); + double dFallBackValue = (double) args[0]->NumberValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetIsRequired."); - if (wrapperTable->m_VolumeDataProperty_SetIsRequired == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeDataProperty::SetIsRequired."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetFallBackValue."); + if (wrapperTable->m_FunctionReference_SetFallBackValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionReference::SetFallBackValue."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeDataProperty_SetIsRequired(instanceHandle, bIsRequired); + Lib3MFResult errorCode = wrapperTable->m_FunctionReference_SetFallBackValue(instanceHandle, dFallBackValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -7899,21 +7969,21 @@ void CLib3MFVolumeDataProperty::SetIsRequired(const FunctionCallbackInfo& } -void CLib3MFVolumeDataProperty::IsRequired(const FunctionCallbackInfo& args) +void CLib3MFFunctionReference::GetFallBackValue(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - bool bReturnIsRequired = false; + double dReturnFallBackValue = 0.0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method IsRequired."); - if (wrapperTable->m_VolumeDataProperty_IsRequired == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeDataProperty::IsRequired."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetFallBackValue."); + if (wrapperTable->m_FunctionReference_GetFallBackValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionReference::GetFallBackValue."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeDataProperty_IsRequired(instanceHandle, &bReturnIsRequired); + Lib3MFResult errorCode = wrapperTable->m_FunctionReference_GetFallBackValue(instanceHandle, &dReturnFallBackValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Boolean::New(isolate, bReturnIsRequired)); + args.GetReturnValue().Set(Number::New(isolate, dReturnFallBackValue)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7921,58 +7991,48 @@ void CLib3MFVolumeDataProperty::IsRequired(const FunctionCallbackInfo& ar } /************************************************************************************************************************* - Class CLib3MFVolumeData Implementation + Class CLib3MFVolumeDataColor Implementation **************************************************************************************************************************/ -CLib3MFVolumeData::CLib3MFVolumeData() +CLib3MFVolumeDataColor::CLib3MFVolumeDataColor() : CLib3MFBaseClass() { } -CLib3MFVolumeData::~CLib3MFVolumeData() +CLib3MFVolumeDataColor::~CLib3MFVolumeDataColor() { } -void CLib3MFVolumeData::Init() +void CLib3MFVolumeDataColor::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFVolumeData")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFVolumeDataColor")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetComposite", GetComposite); - NODE_SET_PROTOTYPE_METHOD(tpl, "CreateNewComposite", CreateNewComposite); - NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveComposite", RemoveComposite); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetColor", GetColor); - NODE_SET_PROTOTYPE_METHOD(tpl, "CreateNewColor", CreateNewColor); - NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveColor", RemoveColor); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetPropertyCount", GetPropertyCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetProperty", GetProperty); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddPropertyFromFunction", AddPropertyFromFunction); - NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveProperty", RemoveProperty); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFVolumeData::New(const FunctionCallbackInfo& args) +void CLib3MFVolumeDataColor::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFVolumeData * volumedataInstance = new CLib3MFVolumeData(); - volumedataInstance->Wrap(args.This()); + CLib3MFVolumeDataColor * volumedatacolorInstance = new CLib3MFVolumeDataColor(); + volumedatacolorInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFVolumeData: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFVolumeDataColor: Invalid call to Constructor"); } } -Local CLib3MFVolumeData::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFVolumeDataColor::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -7985,120 +8045,139 @@ Local CLib3MFVolumeData::NewInstance(Local pParent, Lib3MFHandle return instance; } +/************************************************************************************************************************* + Class CLib3MFMaterialMapping Implementation +**************************************************************************************************************************/ -void CLib3MFVolumeData::GetComposite(const FunctionCallbackInfo& args) +CLib3MFMaterialMapping::CLib3MFMaterialMapping() + : CLib3MFBaseClass() { - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - Lib3MFHandle hReturnTheCompositeData = nullptr; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetComposite."); - if (wrapperTable->m_VolumeData_GetComposite == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeData::GetComposite."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeData_GetComposite(instanceHandle, &hReturnTheCompositeData); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjTheCompositeData = CLib3MFVolumeDataComposite::NewInstance(args.Holder(), hReturnTheCompositeData); - args.GetReturnValue().Set(instanceObjTheCompositeData); +} - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } +CLib3MFMaterialMapping::~CLib3MFMaterialMapping() +{ } +void CLib3MFMaterialMapping::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); -void CLib3MFVolumeData::CreateNewComposite(const FunctionCallbackInfo& args) + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMaterialMapping")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFMaterialMapping::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - try { - Lib3MFHandle hReturnTheCompositeData = nullptr; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method CreateNewComposite."); - if (wrapperTable->m_VolumeData_CreateNewComposite == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeData::CreateNewComposite."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeData_CreateNewComposite(instanceHandle, &hReturnTheCompositeData); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjTheCompositeData = CLib3MFVolumeDataComposite::NewInstance(args.Holder(), hReturnTheCompositeData); - args.GetReturnValue().Set(instanceObjTheCompositeData); - } catch (std::exception & E) { - RaiseError(isolate, E.what()); + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFMaterialMapping * materialmappingInstance = new CLib3MFMaterialMapping(); + materialmappingInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFMaterialMapping: Invalid call to Constructor"); } } - -void CLib3MFVolumeData::RemoveComposite(const FunctionCallbackInfo& args) +Local CLib3MFMaterialMapping::NewInstance(Local pParent, Lib3MFHandle pHandle) { - Isolate* isolate = args.GetIsolate(); + Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); - try { - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveComposite."); - if (wrapperTable->m_VolumeData_RemoveComposite == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeData::RemoveComposite."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeData_RemoveComposite(instanceHandle); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); } + return instance; } +/************************************************************************************************************************* + Class CLib3MFVolumeDataComposite Implementation +**************************************************************************************************************************/ -void CLib3MFVolumeData::GetColor(const FunctionCallbackInfo& args) +CLib3MFVolumeDataComposite::CLib3MFVolumeDataComposite() + : CLib3MFBaseClass() { - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - Lib3MFHandle hReturnTheColorData = nullptr; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetColor."); - if (wrapperTable->m_VolumeData_GetColor == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeData::GetColor."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeData_GetColor(instanceHandle, &hReturnTheColorData); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjTheColorData = CLib3MFVolumeDataColor::NewInstance(args.Holder(), hReturnTheColorData); - args.GetReturnValue().Set(instanceObjTheColorData); +} - } catch (std::exception & E) { - RaiseError(isolate, E.what()); +CLib3MFVolumeDataComposite::~CLib3MFVolumeDataComposite() +{ +} + +void CLib3MFVolumeDataComposite::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFVolumeDataComposite")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBaseMaterialGroup", GetBaseMaterialGroup); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetBaseMaterialGroup", SetBaseMaterialGroup); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetMaterialMappingCount", GetMaterialMappingCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetMaterialMapping", GetMaterialMapping); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddMaterialMapping", AddMaterialMapping); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveMaterialMapping", RemoveMaterialMapping); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFVolumeDataComposite::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFVolumeDataComposite * volumedatacompositeInstance = new CLib3MFVolumeDataComposite(); + volumedatacompositeInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFVolumeDataComposite: Invalid call to Constructor"); + } +} + +Local CLib3MFVolumeDataComposite::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); } + return instance; } -void CLib3MFVolumeData::CreateNewColor(const FunctionCallbackInfo& args) +void CLib3MFVolumeDataComposite::GetBaseMaterialGroup(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected class parameter 0 (TheFunction)"); - } - Local objTheFunction = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); - CLib3MFFunction * instanceTheFunction = ObjectWrap::Unwrap(objTheFunction); - if (instanceTheFunction == nullptr) - throw std::runtime_error("Invalid Object parameter 0 (TheFunction)"); - Lib3MFHandle hTheFunction = instanceTheFunction->getHandle( objTheFunction ); - Lib3MFHandle hReturnTheColorData = nullptr; + Lib3MFHandle hReturnBaseMaterialGroupInstance = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method CreateNewColor."); - if (wrapperTable->m_VolumeData_CreateNewColor == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeData::CreateNewColor."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBaseMaterialGroup."); + if (wrapperTable->m_VolumeDataComposite_GetBaseMaterialGroup == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeDataComposite::GetBaseMaterialGroup."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeData_CreateNewColor(instanceHandle, hTheFunction, &hReturnTheColorData); + Lib3MFResult errorCode = wrapperTable->m_VolumeDataComposite_GetBaseMaterialGroup(instanceHandle, &hReturnBaseMaterialGroupInstance); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjTheColorData = CLib3MFVolumeDataColor::NewInstance(args.Holder(), hReturnTheColorData); - args.GetReturnValue().Set(instanceObjTheColorData); + Local instanceObjBaseMaterialGroupInstance = CLib3MFBaseMaterialGroup::NewInstance(args.Holder(), hReturnBaseMaterialGroupInstance); + args.GetReturnValue().Set(instanceObjBaseMaterialGroupInstance); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8106,18 +8185,26 @@ void CLib3MFVolumeData::CreateNewColor(const FunctionCallbackInfo& args) } -void CLib3MFVolumeData::RemoveColor(const FunctionCallbackInfo& args) +void CLib3MFVolumeDataComposite::SetBaseMaterialGroup(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected class parameter 0 (BaseMaterialGroupInstance)"); + } + Local objBaseMaterialGroupInstance = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFBaseMaterialGroup * instanceBaseMaterialGroupInstance = ObjectWrap::Unwrap(objBaseMaterialGroupInstance); + if (instanceBaseMaterialGroupInstance == nullptr) + throw std::runtime_error("Invalid Object parameter 0 (BaseMaterialGroupInstance)"); + Lib3MFHandle hBaseMaterialGroupInstance = instanceBaseMaterialGroupInstance->getHandle( objBaseMaterialGroupInstance ); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveColor."); - if (wrapperTable->m_VolumeData_RemoveColor == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeData::RemoveColor."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBaseMaterialGroup."); + if (wrapperTable->m_VolumeDataComposite_SetBaseMaterialGroup == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeDataComposite::SetBaseMaterialGroup."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeData_RemoveColor(instanceHandle); + Lib3MFResult errorCode = wrapperTable->m_VolumeDataComposite_SetBaseMaterialGroup(instanceHandle, hBaseMaterialGroupInstance); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -8126,7 +8213,7 @@ void CLib3MFVolumeData::RemoveColor(const FunctionCallbackInfo& args) } -void CLib3MFVolumeData::GetPropertyCount(const FunctionCallbackInfo& args) +void CLib3MFVolumeDataComposite::GetMaterialMappingCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); @@ -8134,11 +8221,11 @@ void CLib3MFVolumeData::GetPropertyCount(const FunctionCallbackInfo& args unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetPropertyCount."); - if (wrapperTable->m_VolumeData_GetPropertyCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeData::GetPropertyCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMaterialMappingCount."); + if (wrapperTable->m_VolumeDataComposite_GetMaterialMappingCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeDataComposite::GetMaterialMappingCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeData_GetPropertyCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_VolumeDataComposite_GetMaterialMappingCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); @@ -8148,7 +8235,7 @@ void CLib3MFVolumeData::GetPropertyCount(const FunctionCallbackInfo& args } -void CLib3MFVolumeData::GetProperty(const FunctionCallbackInfo& args) +void CLib3MFVolumeDataComposite::GetMaterialMapping(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); @@ -8157,17 +8244,17 @@ void CLib3MFVolumeData::GetProperty(const FunctionCallbackInfo& args) throw std::runtime_error("Expected uint32 parameter 0 (Index)"); } unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - Lib3MFHandle hReturnTheVolumeDataProperty = nullptr; + Lib3MFHandle hReturnTheMaterialMapping = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetProperty."); - if (wrapperTable->m_VolumeData_GetProperty == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeData::GetProperty."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMaterialMapping."); + if (wrapperTable->m_VolumeDataComposite_GetMaterialMapping == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeDataComposite::GetMaterialMapping."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeData_GetProperty(instanceHandle, nIndex, &hReturnTheVolumeDataProperty); + Lib3MFResult errorCode = wrapperTable->m_VolumeDataComposite_GetMaterialMapping(instanceHandle, nIndex, &hReturnTheMaterialMapping); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjTheVolumeDataProperty = CLib3MFVolumeDataProperty::NewInstance(args.Holder(), hReturnTheVolumeDataProperty); - args.GetReturnValue().Set(instanceObjTheVolumeDataProperty); + Local instanceObjTheMaterialMapping = CLib3MFMaterialMapping::NewInstance(args.Holder(), hReturnTheMaterialMapping); + args.GetReturnValue().Set(instanceObjTheMaterialMapping); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8175,35 +8262,26 @@ void CLib3MFVolumeData::GetProperty(const FunctionCallbackInfo& args) } -void CLib3MFVolumeData::AddPropertyFromFunction(const FunctionCallbackInfo& args) +void CLib3MFVolumeDataComposite::AddMaterialMapping(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (Name)"); - } - if (!args[1]->IsObject()) { - throw std::runtime_error("Expected class parameter 1 (TheFunction)"); + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected struct parameter 0 (Transform)"); } - v8::String::Utf8Value sutf8Name(isolate, args[0]); - std::string sName = *sutf8Name; - Local objTheFunction = args[1]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); - CLib3MFFunction * instanceTheFunction = ObjectWrap::Unwrap(objTheFunction); - if (instanceTheFunction == nullptr) - throw std::runtime_error("Invalid Object parameter 1 (TheFunction)"); - Lib3MFHandle hTheFunction = instanceTheFunction->getHandle( objTheFunction ); - Lib3MFHandle hReturnTheVolumeDataProperty = nullptr; + sLib3MFTransform sTransform = convertObjectToLib3MFTransform(isolate, args[0]); + Lib3MFHandle hReturnTheMaterialMapping = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddPropertyFromFunction."); - if (wrapperTable->m_VolumeData_AddPropertyFromFunction == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeData::AddPropertyFromFunction."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddMaterialMapping."); + if (wrapperTable->m_VolumeDataComposite_AddMaterialMapping == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeDataComposite::AddMaterialMapping."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeData_AddPropertyFromFunction(instanceHandle, sName.c_str(), hTheFunction, &hReturnTheVolumeDataProperty); + Lib3MFResult errorCode = wrapperTable->m_VolumeDataComposite_AddMaterialMapping(instanceHandle, &sTransform, &hReturnTheMaterialMapping); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjTheVolumeDataProperty = CLib3MFVolumeDataProperty::NewInstance(args.Holder(), hReturnTheVolumeDataProperty); - args.GetReturnValue().Set(instanceObjTheVolumeDataProperty); + Local instanceObjTheMaterialMapping = CLib3MFMaterialMapping::NewInstance(args.Holder(), hReturnTheMaterialMapping); + args.GetReturnValue().Set(instanceObjTheMaterialMapping); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8211,7 +8289,7 @@ void CLib3MFVolumeData::AddPropertyFromFunction(const FunctionCallbackInfo& args) +void CLib3MFVolumeDataComposite::RemoveMaterialMapping(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); @@ -8222,11 +8300,11 @@ void CLib3MFVolumeData::RemoveProperty(const FunctionCallbackInfo& args) unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveProperty."); - if (wrapperTable->m_VolumeData_RemoveProperty == nullptr) - throw std::runtime_error("Could not call Lib3MF method VolumeData::RemoveProperty."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveMaterialMapping."); + if (wrapperTable->m_VolumeDataComposite_RemoveMaterialMapping == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeDataComposite::RemoveMaterialMapping."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_VolumeData_RemoveProperty(instanceHandle, nIndex); + Lib3MFResult errorCode = wrapperTable->m_VolumeDataComposite_RemoveMaterialMapping(instanceHandle, nIndex); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -8235,55 +8313,51 @@ void CLib3MFVolumeData::RemoveProperty(const FunctionCallbackInfo& args) } /************************************************************************************************************************* - Class CLib3MFComponent Implementation + Class CLib3MFVolumeDataProperty Implementation **************************************************************************************************************************/ -CLib3MFComponent::CLib3MFComponent() +CLib3MFVolumeDataProperty::CLib3MFVolumeDataProperty() : CLib3MFBaseClass() { } -CLib3MFComponent::~CLib3MFComponent() +CLib3MFVolumeDataProperty::~CLib3MFVolumeDataProperty() { } -void CLib3MFComponent::Init() +void CLib3MFVolumeDataProperty::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFComponent")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFVolumeDataProperty")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetObjectResource", GetObjectResource); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetObjectResourceID", GetObjectResourceID); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetUUID", GetUUID); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetUUID", SetUUID); - NODE_SET_PROTOTYPE_METHOD(tpl, "HasTransform", HasTransform); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetTransform", GetTransform); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetTransform", SetTransform); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetName", GetName); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetIsRequired", SetIsRequired); + NODE_SET_PROTOTYPE_METHOD(tpl, "IsRequired", IsRequired); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFComponent::New(const FunctionCallbackInfo& args) +void CLib3MFVolumeDataProperty::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFComponent * componentInstance = new CLib3MFComponent(); - componentInstance->Wrap(args.This()); + CLib3MFVolumeDataProperty * volumedatapropertyInstance = new CLib3MFVolumeDataProperty(); + volumedatapropertyInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFComponent: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFVolumeDataProperty: Invalid call to Constructor"); } } -Local CLib3MFComponent::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFVolumeDataProperty::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -8297,22 +8371,26 @@ Local CLib3MFComponent::NewInstance(Local pParent, Lib3MFHandle } -void CLib3MFComponent::GetObjectResource(const FunctionCallbackInfo& args) +void CLib3MFVolumeDataProperty::GetName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnObjectResource = nullptr; + unsigned int bytesNeededPropertyName = 0; + unsigned int bytesWrittenPropertyName = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetObjectResource."); - if (wrapperTable->m_Component_GetObjectResource == nullptr) - throw std::runtime_error("Could not call Lib3MF method Component::GetObjectResource."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetName."); + if (wrapperTable->m_VolumeDataProperty_GetName == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeDataProperty::GetName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Component_GetObjectResource(instanceHandle, &hReturnObjectResource); + Lib3MFResult initErrorCode = wrapperTable->m_VolumeDataProperty_GetName(instanceHandle, 0, &bytesNeededPropertyName, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferPropertyName; + bufferPropertyName.resize(bytesNeededPropertyName); + Lib3MFResult errorCode = wrapperTable->m_VolumeDataProperty_GetName(instanceHandle, bytesNeededPropertyName, &bytesWrittenPropertyName, &bufferPropertyName[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjObjectResource = CLib3MFObject::NewInstance(args.Holder(), hReturnObjectResource); - args.GetReturnValue().Set(instanceObjObjectResource); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferPropertyName[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8320,21 +8398,23 @@ void CLib3MFComponent::GetObjectResource(const FunctionCallbackInfo& args } -void CLib3MFComponent::GetObjectResourceID(const FunctionCallbackInfo& args) +void CLib3MFVolumeDataProperty::SetIsRequired(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnUniqueResourceID = 0; + if (!args[0]->IsBoolean()) { + throw std::runtime_error("Expected bool parameter 0 (IsRequired)"); + } + bool bIsRequired = args[0]->BooleanValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetObjectResourceID."); - if (wrapperTable->m_Component_GetObjectResourceID == nullptr) - throw std::runtime_error("Could not call Lib3MF method Component::GetObjectResourceID."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetIsRequired."); + if (wrapperTable->m_VolumeDataProperty_SetIsRequired == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeDataProperty::SetIsRequired."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Component_GetObjectResourceID(instanceHandle, &nReturnUniqueResourceID); + Lib3MFResult errorCode = wrapperTable->m_VolumeDataProperty_SetIsRequired(instanceHandle, bIsRequired); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8342,77 +8422,109 @@ void CLib3MFComponent::GetObjectResourceID(const FunctionCallbackInfo& ar } -void CLib3MFComponent::GetUUID(const FunctionCallbackInfo& args) +void CLib3MFVolumeDataProperty::IsRequired(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Local outObject = Object::New(isolate); - bool bReturnHasUUID = false; - unsigned int bytesNeededUUID = 0; - unsigned int bytesWrittenUUID = 0; + bool bReturnIsRequired = false; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetUUID."); - if (wrapperTable->m_Component_GetUUID == nullptr) - throw std::runtime_error("Could not call Lib3MF method Component::GetUUID."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method IsRequired."); + if (wrapperTable->m_VolumeDataProperty_IsRequired == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeDataProperty::IsRequired."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_Component_GetUUID(instanceHandle, &bReturnHasUUID, 0, &bytesNeededUUID, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferUUID; - bufferUUID.resize(bytesNeededUUID); - Lib3MFResult errorCode = wrapperTable->m_Component_GetUUID(instanceHandle, &bReturnHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0]); + Lib3MFResult errorCode = wrapperTable->m_VolumeDataProperty_IsRequired(instanceHandle, &bReturnIsRequired); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "HasUUID"), Boolean::New(isolate, bReturnHasUUID)); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UUID"), String::NewFromUtf8(isolate, &bufferUUID[0])); - args.GetReturnValue().Set(outObject); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnIsRequired)); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } +/************************************************************************************************************************* + Class CLib3MFVolumeData Implementation +**************************************************************************************************************************/ + +CLib3MFVolumeData::CLib3MFVolumeData() + : CLib3MFBaseClass() +{ +} -void CLib3MFComponent::SetUUID(const FunctionCallbackInfo& args) +CLib3MFVolumeData::~CLib3MFVolumeData() +{ +} + +void CLib3MFVolumeData::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFVolumeData")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetComposite", GetComposite); + NODE_SET_PROTOTYPE_METHOD(tpl, "CreateNewComposite", CreateNewComposite); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveComposite", RemoveComposite); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetColor", GetColor); + NODE_SET_PROTOTYPE_METHOD(tpl, "CreateNewColor", CreateNewColor); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveColor", RemoveColor); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetPropertyCount", GetPropertyCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetProperty", GetProperty); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddPropertyFromFunction", AddPropertyFromFunction); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveProperty", RemoveProperty); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFVolumeData::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (UUID)"); - } - v8::String::Utf8Value sutf8UUID(isolate, args[0]); - std::string sUUID = *sutf8UUID; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetUUID."); - if (wrapperTable->m_Component_SetUUID == nullptr) - throw std::runtime_error("Could not call Lib3MF method Component::SetUUID."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Component_SetUUID(instanceHandle, sUUID.c_str()); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - } catch (std::exception & E) { - RaiseError(isolate, E.what()); + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFVolumeData * volumedataInstance = new CLib3MFVolumeData(); + volumedataInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFVolumeData: Invalid call to Constructor"); + } +} + +Local CLib3MFVolumeData::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); } + return instance; } -void CLib3MFComponent::HasTransform(const FunctionCallbackInfo& args) +void CLib3MFVolumeData::GetComposite(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - bool bReturnHasTransform = false; + Lib3MFHandle hReturnTheCompositeData = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method HasTransform."); - if (wrapperTable->m_Component_HasTransform == nullptr) - throw std::runtime_error("Could not call Lib3MF method Component::HasTransform."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetComposite."); + if (wrapperTable->m_VolumeData_GetComposite == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeData::GetComposite."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Component_HasTransform(instanceHandle, &bReturnHasTransform); + Lib3MFResult errorCode = wrapperTable->m_VolumeData_GetComposite(instanceHandle, &hReturnTheCompositeData); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Boolean::New(isolate, bReturnHasTransform)); + Local instanceObjTheCompositeData = CLib3MFVolumeDataComposite::NewInstance(args.Holder(), hReturnTheCompositeData); + args.GetReturnValue().Set(instanceObjTheCompositeData); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8420,21 +8532,22 @@ void CLib3MFComponent::HasTransform(const FunctionCallbackInfo& args) } -void CLib3MFComponent::GetTransform(const FunctionCallbackInfo& args) +void CLib3MFVolumeData::CreateNewComposite(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - sLib3MFTransform sReturnTransform; + Lib3MFHandle hReturnTheCompositeData = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTransform."); - if (wrapperTable->m_Component_GetTransform == nullptr) - throw std::runtime_error("Could not call Lib3MF method Component::GetTransform."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method CreateNewComposite."); + if (wrapperTable->m_VolumeData_CreateNewComposite == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeData::CreateNewComposite."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Component_GetTransform(instanceHandle, &sReturnTransform); + Lib3MFResult errorCode = wrapperTable->m_VolumeData_CreateNewComposite(instanceHandle, &hReturnTheCompositeData); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFTransformToObject(isolate, sReturnTransform)); + Local instanceObjTheCompositeData = CLib3MFVolumeDataComposite::NewInstance(args.Holder(), hReturnTheCompositeData); + args.GetReturnValue().Set(instanceObjTheCompositeData); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8442,22 +8555,18 @@ void CLib3MFComponent::GetTransform(const FunctionCallbackInfo& args) } -void CLib3MFComponent::SetTransform(const FunctionCallbackInfo& args) +void CLib3MFVolumeData::RemoveComposite(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected struct parameter 0 (Transform)"); - } - sLib3MFTransform sTransform = convertObjectToLib3MFTransform(isolate, args[0]); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetTransform."); - if (wrapperTable->m_Component_SetTransform == nullptr) - throw std::runtime_error("Could not call Lib3MF method Component::SetTransform."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveComposite."); + if (wrapperTable->m_VolumeData_RemoveComposite == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeData::RemoveComposite."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Component_SetTransform(instanceHandle, &sTransform); + Lib3MFResult errorCode = wrapperTable->m_VolumeData_RemoveComposite(instanceHandle); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -8465,93 +8574,54 @@ void CLib3MFComponent::SetTransform(const FunctionCallbackInfo& args) } } -/************************************************************************************************************************* - Class CLib3MFComponentsObject Implementation -**************************************************************************************************************************/ - -CLib3MFComponentsObject::CLib3MFComponentsObject() - : CLib3MFBaseClass() -{ -} - -CLib3MFComponentsObject::~CLib3MFComponentsObject() -{ -} - -void CLib3MFComponentsObject::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFComponentsObject")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "AddComponent", AddComponent); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetComponent", GetComponent); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetComponentCount", GetComponentCount); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - -} -void CLib3MFComponentsObject::New(const FunctionCallbackInfo& args) +void CLib3MFVolumeData::GetColor(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + Lib3MFHandle hReturnTheColorData = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetColor."); + if (wrapperTable->m_VolumeData_GetColor == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeData::GetColor."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_VolumeData_GetColor(instanceHandle, &hReturnTheColorData); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjTheColorData = CLib3MFVolumeDataColor::NewInstance(args.Holder(), hReturnTheColorData); + args.GetReturnValue().Set(instanceObjTheColorData); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFComponentsObject * componentsobjectInstance = new CLib3MFComponentsObject(); - componentsobjectInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFComponentsObject: Invalid call to Constructor"); - } -} - -Local CLib3MFComponentsObject::NewInstance(Local pParent, Lib3MFHandle pHandle) -{ - Isolate* isolate = Isolate::GetCurrent(); - HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFComponentsObject::AddComponent(const FunctionCallbackInfo& args) +void CLib3MFVolumeData::CreateNewColor(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsObject()) { - throw std::runtime_error("Expected class parameter 0 (ObjectResource)"); - } - if (!args[1]->IsObject()) { - throw std::runtime_error("Expected struct parameter 1 (Transform)"); + throw std::runtime_error("Expected class parameter 0 (TheFunction)"); } - Local objObjectResource = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); - CLib3MFObject * instanceObjectResource = ObjectWrap::Unwrap(objObjectResource); - if (instanceObjectResource == nullptr) - throw std::runtime_error("Invalid Object parameter 0 (ObjectResource)"); - Lib3MFHandle hObjectResource = instanceObjectResource->getHandle( objObjectResource ); - sLib3MFTransform sTransform = convertObjectToLib3MFTransform(isolate, args[1]); - Lib3MFHandle hReturnComponentInstance = nullptr; + Local objTheFunction = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFFunction * instanceTheFunction = ObjectWrap::Unwrap(objTheFunction); + if (instanceTheFunction == nullptr) + throw std::runtime_error("Invalid Object parameter 0 (TheFunction)"); + Lib3MFHandle hTheFunction = instanceTheFunction->getHandle( objTheFunction ); + Lib3MFHandle hReturnTheColorData = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddComponent."); - if (wrapperTable->m_ComponentsObject_AddComponent == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComponentsObject::AddComponent."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method CreateNewColor."); + if (wrapperTable->m_VolumeData_CreateNewColor == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeData::CreateNewColor."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComponentsObject_AddComponent(instanceHandle, hObjectResource, &sTransform, &hReturnComponentInstance); + Lib3MFResult errorCode = wrapperTable->m_VolumeData_CreateNewColor(instanceHandle, hTheFunction, &hReturnTheColorData); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjComponentInstance = CLib3MFComponent::NewInstance(args.Holder(), hReturnComponentInstance); - args.GetReturnValue().Set(instanceObjComponentInstance); + Local instanceObjTheColorData = CLib3MFVolumeDataColor::NewInstance(args.Holder(), hReturnTheColorData); + args.GetReturnValue().Set(instanceObjTheColorData); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8559,26 +8629,19 @@ void CLib3MFComponentsObject::AddComponent(const FunctionCallbackInfo& ar } -void CLib3MFComponentsObject::GetComponent(const FunctionCallbackInfo& args) +void CLib3MFVolumeData::RemoveColor(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); - } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - Lib3MFHandle hReturnComponentInstance = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetComponent."); - if (wrapperTable->m_ComponentsObject_GetComponent == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComponentsObject::GetComponent."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveColor."); + if (wrapperTable->m_VolumeData_RemoveColor == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeData::RemoveColor."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComponentsObject_GetComponent(instanceHandle, nIndex, &hReturnComponentInstance); + Lib3MFResult errorCode = wrapperTable->m_VolumeData_RemoveColor(instanceHandle); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjComponentInstance = CLib3MFComponent::NewInstance(args.Holder(), hReturnComponentInstance); - args.GetReturnValue().Set(instanceObjComponentInstance); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8586,7 +8649,7 @@ void CLib3MFComponentsObject::GetComponent(const FunctionCallbackInfo& ar } -void CLib3MFComponentsObject::GetComponentCount(const FunctionCallbackInfo& args) +void CLib3MFVolumeData::GetPropertyCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); @@ -8594,11 +8657,11 @@ void CLib3MFComponentsObject::GetComponentCount(const FunctionCallbackInfom_ComponentsObject_GetComponentCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComponentsObject::GetComponentCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetPropertyCount."); + if (wrapperTable->m_VolumeData_GetPropertyCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeData::GetPropertyCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComponentsObject_GetComponentCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_VolumeData_GetPropertyCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); @@ -8607,59 +8670,143 @@ void CLib3MFComponentsObject::GetComponentCount(const FunctionCallbackInfo& args) { -} - -CLib3MFBeamSet::~CLib3MFBeamSet() + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnTheVolumeDataProperty = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetProperty."); + if (wrapperTable->m_VolumeData_GetProperty == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeData::GetProperty."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_VolumeData_GetProperty(instanceHandle, nIndex, &hReturnTheVolumeDataProperty); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjTheVolumeDataProperty = CLib3MFVolumeDataProperty::NewInstance(args.Holder(), hReturnTheVolumeDataProperty); + args.GetReturnValue().Set(instanceObjTheVolumeDataProperty); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFVolumeData::AddPropertyFromFunction(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + if (!args[1]->IsObject()) { + throw std::runtime_error("Expected class parameter 1 (TheFunction)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + Local objTheFunction = args[1]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFFunction * instanceTheFunction = ObjectWrap::Unwrap(objTheFunction); + if (instanceTheFunction == nullptr) + throw std::runtime_error("Invalid Object parameter 1 (TheFunction)"); + Lib3MFHandle hTheFunction = instanceTheFunction->getHandle( objTheFunction ); + Lib3MFHandle hReturnTheVolumeDataProperty = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddPropertyFromFunction."); + if (wrapperTable->m_VolumeData_AddPropertyFromFunction == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeData::AddPropertyFromFunction."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_VolumeData_AddPropertyFromFunction(instanceHandle, sName.c_str(), hTheFunction, &hReturnTheVolumeDataProperty); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjTheVolumeDataProperty = CLib3MFVolumeDataProperty::NewInstance(args.Holder(), hReturnTheVolumeDataProperty); + args.GetReturnValue().Set(instanceObjTheVolumeDataProperty); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -void CLib3MFBeamSet::Init() + +void CLib3MFVolumeData::RemoveProperty(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveProperty."); + if (wrapperTable->m_VolumeData_RemoveProperty == nullptr) + throw std::runtime_error("Could not call Lib3MF method VolumeData::RemoveProperty."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_VolumeData_RemoveProperty(instanceHandle, nIndex); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFComponent Implementation +**************************************************************************************************************************/ + +CLib3MFComponent::CLib3MFComponent() + : CLib3MFBaseClass() +{ +} + +CLib3MFComponent::~CLib3MFComponent() +{ +} + +void CLib3MFComponent::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBeamSet")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFComponent")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "SetName", SetName); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetName", GetName); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetIdentifier", SetIdentifier); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetIdentifier", GetIdentifier); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetReferenceCount", GetReferenceCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetReferences", SetReferences); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetReferences", GetReferences); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBallReferenceCount", GetBallReferenceCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetBallReferences", SetBallReferences); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBallReferences", GetBallReferences); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetObjectResource", GetObjectResource); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetObjectResourceID", GetObjectResourceID); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetUUID", GetUUID); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetUUID", SetUUID); + NODE_SET_PROTOTYPE_METHOD(tpl, "HasTransform", HasTransform); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetTransform", GetTransform); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetTransform", SetTransform); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFBeamSet::New(const FunctionCallbackInfo& args) +void CLib3MFComponent::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFBeamSet * beamsetInstance = new CLib3MFBeamSet(); - beamsetInstance->Wrap(args.This()); + CLib3MFComponent * componentInstance = new CLib3MFComponent(); + componentInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFBeamSet: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFComponent: Invalid call to Constructor"); } } -Local CLib3MFBeamSet::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFComponent::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -8673,24 +8820,22 @@ Local CLib3MFBeamSet::NewInstance(Local pParent, Lib3MFHandle pH } -void CLib3MFBeamSet::SetName(const FunctionCallbackInfo& args) +void CLib3MFComponent::GetObjectResource(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (Name)"); - } - v8::String::Utf8Value sutf8Name(isolate, args[0]); - std::string sName = *sutf8Name; + Lib3MFHandle hReturnObjectResource = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetName."); - if (wrapperTable->m_BeamSet_SetName == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::SetName."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetObjectResource."); + if (wrapperTable->m_Component_GetObjectResource == nullptr) + throw std::runtime_error("Could not call Lib3MF method Component::GetObjectResource."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_SetName(instanceHandle, sName.c_str()); + Lib3MFResult errorCode = wrapperTable->m_Component_GetObjectResource(instanceHandle, &hReturnObjectResource); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjObjectResource = CLib3MFObject::NewInstance(args.Holder(), hReturnObjectResource); + args.GetReturnValue().Set(instanceObjObjectResource); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8698,26 +8843,21 @@ void CLib3MFBeamSet::SetName(const FunctionCallbackInfo& args) } -void CLib3MFBeamSet::GetName(const FunctionCallbackInfo& args) +void CLib3MFComponent::GetObjectResourceID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int bytesNeededName = 0; - unsigned int bytesWrittenName = 0; + unsigned int nReturnUniqueResourceID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetName."); - if (wrapperTable->m_BeamSet_GetName == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::GetName."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetObjectResourceID."); + if (wrapperTable->m_Component_GetObjectResourceID == nullptr) + throw std::runtime_error("Could not call Lib3MF method Component::GetObjectResourceID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_BeamSet_GetName(instanceHandle, 0, &bytesNeededName, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferName; - bufferName.resize(bytesNeededName); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetName(instanceHandle, bytesNeededName, &bytesWrittenName, &bufferName[0]); + Lib3MFResult errorCode = wrapperTable->m_Component_GetObjectResourceID(instanceHandle, &nReturnUniqueResourceID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferName[0])); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8725,24 +8865,30 @@ void CLib3MFBeamSet::GetName(const FunctionCallbackInfo& args) } -void CLib3MFBeamSet::SetIdentifier(const FunctionCallbackInfo& args) +void CLib3MFComponent::GetUUID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (Identifier)"); - } - v8::String::Utf8Value sutf8Identifier(isolate, args[0]); - std::string sIdentifier = *sutf8Identifier; + Local outObject = Object::New(isolate); + bool bReturnHasUUID = false; + unsigned int bytesNeededUUID = 0; + unsigned int bytesWrittenUUID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetIdentifier."); - if (wrapperTable->m_BeamSet_SetIdentifier == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::SetIdentifier."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetUUID."); + if (wrapperTable->m_Component_GetUUID == nullptr) + throw std::runtime_error("Could not call Lib3MF method Component::GetUUID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_SetIdentifier(instanceHandle, sIdentifier.c_str()); + Lib3MFResult initErrorCode = wrapperTable->m_Component_GetUUID(instanceHandle, &bReturnHasUUID, 0, &bytesNeededUUID, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferUUID; + bufferUUID.resize(bytesNeededUUID); + Lib3MFResult errorCode = wrapperTable->m_Component_GetUUID(instanceHandle, &bReturnHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "HasUUID"), Boolean::New(isolate, bReturnHasUUID)); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UUID"), String::NewFromUtf8(isolate, &bufferUUID[0])); + args.GetReturnValue().Set(outObject); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8750,26 +8896,24 @@ void CLib3MFBeamSet::SetIdentifier(const FunctionCallbackInfo& args) } -void CLib3MFBeamSet::GetIdentifier(const FunctionCallbackInfo& args) +void CLib3MFComponent::SetUUID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int bytesNeededIdentifier = 0; - unsigned int bytesWrittenIdentifier = 0; + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (UUID)"); + } + v8::String::Utf8Value sutf8UUID(isolate, args[0]); + std::string sUUID = *sutf8UUID; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetIdentifier."); - if (wrapperTable->m_BeamSet_GetIdentifier == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::GetIdentifier."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetUUID."); + if (wrapperTable->m_Component_SetUUID == nullptr) + throw std::runtime_error("Could not call Lib3MF method Component::SetUUID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_BeamSet_GetIdentifier(instanceHandle, 0, &bytesNeededIdentifier, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferIdentifier; - bufferIdentifier.resize(bytesNeededIdentifier); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetIdentifier(instanceHandle, bytesNeededIdentifier, &bytesWrittenIdentifier, &bufferIdentifier[0]); + Lib3MFResult errorCode = wrapperTable->m_Component_SetUUID(instanceHandle, sUUID.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferIdentifier[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8777,21 +8921,21 @@ void CLib3MFBeamSet::GetIdentifier(const FunctionCallbackInfo& args) } -void CLib3MFBeamSet::GetReferenceCount(const FunctionCallbackInfo& args) +void CLib3MFComponent::HasTransform(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnCount = 0; + bool bReturnHasTransform = false; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetReferenceCount."); - if (wrapperTable->m_BeamSet_GetReferenceCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::GetReferenceCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method HasTransform."); + if (wrapperTable->m_Component_HasTransform == nullptr) + throw std::runtime_error("Could not call Lib3MF method Component::HasTransform."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetReferenceCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_Component_HasTransform(instanceHandle, &bReturnHasTransform); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnHasTransform)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8799,19 +8943,21 @@ void CLib3MFBeamSet::GetReferenceCount(const FunctionCallbackInfo& args) } -void CLib3MFBeamSet::SetReferences(const FunctionCallbackInfo& args) +void CLib3MFComponent::GetTransform(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + sLib3MFTransform sReturnTransform; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetReferences."); - if (wrapperTable->m_BeamSet_SetReferences == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::SetReferences."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTransform."); + if (wrapperTable->m_Component_GetTransform == nullptr) + throw std::runtime_error("Could not call Lib3MF method Component::GetTransform."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_SetReferences(instanceHandle, 0, nullptr); + Lib3MFResult errorCode = wrapperTable->m_Component_GetTransform(instanceHandle, &sReturnTransform); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(convertLib3MFTransformToObject(isolate, sReturnTransform)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8819,18 +8965,22 @@ void CLib3MFBeamSet::SetReferences(const FunctionCallbackInfo& args) } -void CLib3MFBeamSet::GetReferences(const FunctionCallbackInfo& args) +void CLib3MFComponent::SetTransform(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected struct parameter 0 (Transform)"); + } + sLib3MFTransform sTransform = convertObjectToLib3MFTransform(isolate, args[0]); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetReferences."); - if (wrapperTable->m_BeamSet_GetReferences == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::GetReferences."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetTransform."); + if (wrapperTable->m_Component_SetTransform == nullptr) + throw std::runtime_error("Could not call Lib3MF method Component::SetTransform."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetReferences(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_Component_SetTransform(instanceHandle, &sTransform); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -8838,22 +8988,93 @@ void CLib3MFBeamSet::GetReferences(const FunctionCallbackInfo& args) } } +/************************************************************************************************************************* + Class CLib3MFComponentsObject Implementation +**************************************************************************************************************************/ -void CLib3MFBeamSet::GetBallReferenceCount(const FunctionCallbackInfo& args) +CLib3MFComponentsObject::CLib3MFComponentsObject() + : CLib3MFBaseClass() +{ +} + +CLib3MFComponentsObject::~CLib3MFComponentsObject() +{ +} + +void CLib3MFComponentsObject::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFComponentsObject")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "AddComponent", AddComponent); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetComponent", GetComponent); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetComponentCount", GetComponentCount); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFComponentsObject::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFComponentsObject * componentsobjectInstance = new CLib3MFComponentsObject(); + componentsobjectInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFComponentsObject: Invalid call to Constructor"); + } +} + +Local CLib3MFComponentsObject::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFComponentsObject::AddComponent(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnCount = 0; + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected class parameter 0 (ObjectResource)"); + } + if (!args[1]->IsObject()) { + throw std::runtime_error("Expected struct parameter 1 (Transform)"); + } + Local objObjectResource = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFObject * instanceObjectResource = ObjectWrap::Unwrap(objObjectResource); + if (instanceObjectResource == nullptr) + throw std::runtime_error("Invalid Object parameter 0 (ObjectResource)"); + Lib3MFHandle hObjectResource = instanceObjectResource->getHandle( objObjectResource ); + sLib3MFTransform sTransform = convertObjectToLib3MFTransform(isolate, args[1]); + Lib3MFHandle hReturnComponentInstance = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBallReferenceCount."); - if (wrapperTable->m_BeamSet_GetBallReferenceCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::GetBallReferenceCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddComponent."); + if (wrapperTable->m_ComponentsObject_AddComponent == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComponentsObject::AddComponent."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetBallReferenceCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_ComponentsObject_AddComponent(instanceHandle, hObjectResource, &sTransform, &hReturnComponentInstance); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); + Local instanceObjComponentInstance = CLib3MFComponent::NewInstance(args.Holder(), hReturnComponentInstance); + args.GetReturnValue().Set(instanceObjComponentInstance); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8861,19 +9082,26 @@ void CLib3MFBeamSet::GetBallReferenceCount(const FunctionCallbackInfo& ar } -void CLib3MFBeamSet::SetBallReferences(const FunctionCallbackInfo& args) +void CLib3MFComponentsObject::GetComponent(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnComponentInstance = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBallReferences."); - if (wrapperTable->m_BeamSet_SetBallReferences == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::SetBallReferences."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetComponent."); + if (wrapperTable->m_ComponentsObject_GetComponent == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComponentsObject::GetComponent."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_SetBallReferences(instanceHandle, 0, nullptr); + Lib3MFResult errorCode = wrapperTable->m_ComponentsObject_GetComponent(instanceHandle, nIndex, &hReturnComponentInstance); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjComponentInstance = CLib3MFComponent::NewInstance(args.Holder(), hReturnComponentInstance); + args.GetReturnValue().Set(instanceObjComponentInstance); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8881,19 +9109,21 @@ void CLib3MFBeamSet::SetBallReferences(const FunctionCallbackInfo& args) } -void CLib3MFBeamSet::GetBallReferences(const FunctionCallbackInfo& args) +void CLib3MFComponentsObject::GetComponentCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBallReferences."); - if (wrapperTable->m_BeamSet_GetBallReferences == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::GetBallReferences."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetComponentCount."); + if (wrapperTable->m_ComponentsObject_GetComponentCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComponentsObject::GetComponentCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetBallReferences(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_ComponentsObject_GetComponentCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8901,56 +9131,58 @@ void CLib3MFBeamSet::GetBallReferences(const FunctionCallbackInfo& args) } /************************************************************************************************************************* - Class CLib3MFBaseMaterialGroup Implementation + Class CLib3MFBeamSet Implementation **************************************************************************************************************************/ -CLib3MFBaseMaterialGroup::CLib3MFBaseMaterialGroup() +CLib3MFBeamSet::CLib3MFBeamSet() : CLib3MFBaseClass() { } -CLib3MFBaseMaterialGroup::~CLib3MFBaseMaterialGroup() +CLib3MFBeamSet::~CLib3MFBeamSet() { } -void CLib3MFBaseMaterialGroup::Init() +void CLib3MFBeamSet::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBaseMaterialGroup")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBeamSet")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetCount", GetCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetAllPropertyIDs", GetAllPropertyIDs); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddMaterial", AddMaterial); - NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveMaterial", RemoveMaterial); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetName", GetName); NODE_SET_PROTOTYPE_METHOD(tpl, "SetName", SetName); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetDisplayColor", SetDisplayColor); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetDisplayColor", GetDisplayColor); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetName", GetName); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetIdentifier", SetIdentifier); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetIdentifier", GetIdentifier); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetReferenceCount", GetReferenceCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetReferences", SetReferences); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetReferences", GetReferences); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBallReferenceCount", GetBallReferenceCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetBallReferences", SetBallReferences); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBallReferences", GetBallReferences); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFBaseMaterialGroup::New(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFBaseMaterialGroup * basematerialgroupInstance = new CLib3MFBaseMaterialGroup(); - basematerialgroupInstance->Wrap(args.This()); + CLib3MFBeamSet * beamsetInstance = new CLib3MFBeamSet(); + beamsetInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFBaseMaterialGroup: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFBeamSet: Invalid call to Constructor"); } } -Local CLib3MFBaseMaterialGroup::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFBeamSet::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -8964,21 +9196,24 @@ Local CLib3MFBaseMaterialGroup::NewInstance(Local pParent, Lib3M } -void CLib3MFBaseMaterialGroup::GetCount(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::SetName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnCount = 0; + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCount."); - if (wrapperTable->m_BaseMaterialGroup_GetCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::GetCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetName."); + if (wrapperTable->m_BeamSet_SetName == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::SetName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_GetCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_SetName(instanceHandle, sName.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8986,19 +9221,26 @@ void CLib3MFBaseMaterialGroup::GetCount(const FunctionCallbackInfo& args) } -void CLib3MFBaseMaterialGroup::GetAllPropertyIDs(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::GetName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + unsigned int bytesNeededName = 0; + unsigned int bytesWrittenName = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAllPropertyIDs."); - if (wrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs == nullptr) - throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::GetAllPropertyIDs."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetName."); + if (wrapperTable->m_BeamSet_GetName == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::GetName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult initErrorCode = wrapperTable->m_BeamSet_GetName(instanceHandle, 0, &bytesNeededName, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferName; + bufferName.resize(bytesNeededName); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetName(instanceHandle, bytesNeededName, &bytesWrittenName, &bufferName[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferName[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -9006,30 +9248,24 @@ void CLib3MFBaseMaterialGroup::GetAllPropertyIDs(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::SetIdentifier(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (Name)"); - } - if (!args[1]->IsObject()) { - throw std::runtime_error("Expected struct parameter 1 (DisplayColor)"); + throw std::runtime_error("Expected string parameter 0 (Identifier)"); } - v8::String::Utf8Value sutf8Name(isolate, args[0]); - std::string sName = *sutf8Name; - sLib3MFColor sDisplayColor = convertObjectToLib3MFColor(isolate, args[1]); - unsigned int nReturnPropertyID = 0; + v8::String::Utf8Value sutf8Identifier(isolate, args[0]); + std::string sIdentifier = *sutf8Identifier; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddMaterial."); - if (wrapperTable->m_BaseMaterialGroup_AddMaterial == nullptr) - throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::AddMaterial."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetIdentifier."); + if (wrapperTable->m_BeamSet_SetIdentifier == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::SetIdentifier."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_AddMaterial(instanceHandle, sName.c_str(), &sDisplayColor, &nReturnPropertyID); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_SetIdentifier(instanceHandle, sIdentifier.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnPropertyID)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -9037,23 +9273,26 @@ void CLib3MFBaseMaterialGroup::AddMaterial(const FunctionCallbackInfo& ar } -void CLib3MFBaseMaterialGroup::RemoveMaterial(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::GetIdentifier(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); - } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int bytesNeededIdentifier = 0; + unsigned int bytesWrittenIdentifier = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveMaterial."); - if (wrapperTable->m_BaseMaterialGroup_RemoveMaterial == nullptr) - throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::RemoveMaterial."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetIdentifier."); + if (wrapperTable->m_BeamSet_GetIdentifier == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::GetIdentifier."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_RemoveMaterial(instanceHandle, nPropertyID); + Lib3MFResult initErrorCode = wrapperTable->m_BeamSet_GetIdentifier(instanceHandle, 0, &bytesNeededIdentifier, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferIdentifier; + bufferIdentifier.resize(bytesNeededIdentifier); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetIdentifier(instanceHandle, bytesNeededIdentifier, &bytesWrittenIdentifier, &bufferIdentifier[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferIdentifier[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -9061,30 +9300,21 @@ void CLib3MFBaseMaterialGroup::RemoveMaterial(const FunctionCallbackInfo& } -void CLib3MFBaseMaterialGroup::GetName(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::GetReferenceCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); - } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - unsigned int bytesNeededName = 0; - unsigned int bytesWrittenName = 0; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetName."); - if (wrapperTable->m_BaseMaterialGroup_GetName == nullptr) - throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::GetName."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetReferenceCount."); + if (wrapperTable->m_BeamSet_GetReferenceCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::GetReferenceCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_BaseMaterialGroup_GetName(instanceHandle, nPropertyID, 0, &bytesNeededName, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferName; - bufferName.resize(bytesNeededName); - Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_GetName(instanceHandle, nPropertyID, bytesNeededName, &bytesWrittenName, &bufferName[0]); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetReferenceCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferName[0])); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -9092,27 +9322,18 @@ void CLib3MFBaseMaterialGroup::GetName(const FunctionCallbackInfo& args) } -void CLib3MFBaseMaterialGroup::SetName(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::SetReferences(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); - } - if (!args[1]->IsString()) { - throw std::runtime_error("Expected string parameter 1 (Name)"); - } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - v8::String::Utf8Value sutf8Name(isolate, args[1]); - std::string sName = *sutf8Name; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetName."); - if (wrapperTable->m_BaseMaterialGroup_SetName == nullptr) - throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::SetName."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetReferences."); + if (wrapperTable->m_BeamSet_SetReferences == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::SetReferences."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_SetName(instanceHandle, nPropertyID, sName.c_str()); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_SetReferences(instanceHandle, 0, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -9121,26 +9342,18 @@ void CLib3MFBaseMaterialGroup::SetName(const FunctionCallbackInfo& args) } -void CLib3MFBaseMaterialGroup::SetDisplayColor(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::GetReferences(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); - } - if (!args[1]->IsObject()) { - throw std::runtime_error("Expected struct parameter 1 (TheColor)"); - } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFColor sTheColor = convertObjectToLib3MFColor(isolate, args[1]); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetDisplayColor."); - if (wrapperTable->m_BaseMaterialGroup_SetDisplayColor == nullptr) - throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::SetDisplayColor."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetReferences."); + if (wrapperTable->m_BeamSet_GetReferences == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::GetReferences."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_SetDisplayColor(instanceHandle, nPropertyID, &sTheColor); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetReferences(instanceHandle, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -9149,25 +9362,61 @@ void CLib3MFBaseMaterialGroup::SetDisplayColor(const FunctionCallbackInfo } -void CLib3MFBaseMaterialGroup::GetDisplayColor(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::GetBallReferenceCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); - } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFColor sReturnTheColor; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetDisplayColor."); - if (wrapperTable->m_BaseMaterialGroup_GetDisplayColor == nullptr) - throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::GetDisplayColor."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBallReferenceCount."); + if (wrapperTable->m_BeamSet_GetBallReferenceCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::GetBallReferenceCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_GetDisplayColor(instanceHandle, nPropertyID, &sReturnTheColor); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetBallReferenceCount(instanceHandle, &nReturnCount); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFBeamSet::SetBallReferences(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBallReferences."); + if (wrapperTable->m_BeamSet_SetBallReferences == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::SetBallReferences."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_SetBallReferences(instanceHandle, 0, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFBeamSet::GetBallReferences(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBallReferences."); + if (wrapperTable->m_BeamSet_GetBallReferences == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::GetBallReferences."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetBallReferences(instanceHandle, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFColorToObject(isolate, sReturnTheColor)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -9175,54 +9424,56 @@ void CLib3MFBaseMaterialGroup::GetDisplayColor(const FunctionCallbackInfo } /************************************************************************************************************************* - Class CLib3MFColorGroup Implementation + Class CLib3MFBaseMaterialGroup Implementation **************************************************************************************************************************/ -CLib3MFColorGroup::CLib3MFColorGroup() +CLib3MFBaseMaterialGroup::CLib3MFBaseMaterialGroup() : CLib3MFBaseClass() { } -CLib3MFColorGroup::~CLib3MFColorGroup() +CLib3MFBaseMaterialGroup::~CLib3MFBaseMaterialGroup() { } -void CLib3MFColorGroup::Init() +void CLib3MFBaseMaterialGroup::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFColorGroup")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBaseMaterialGroup")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype NODE_SET_PROTOTYPE_METHOD(tpl, "GetCount", GetCount); NODE_SET_PROTOTYPE_METHOD(tpl, "GetAllPropertyIDs", GetAllPropertyIDs); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddColor", AddColor); - NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveColor", RemoveColor); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetColor", SetColor); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetColor", GetColor); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddMaterial", AddMaterial); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveMaterial", RemoveMaterial); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetName", GetName); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetName", SetName); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetDisplayColor", SetDisplayColor); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetDisplayColor", GetDisplayColor); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFColorGroup::New(const FunctionCallbackInfo& args) +void CLib3MFBaseMaterialGroup::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFColorGroup * colorgroupInstance = new CLib3MFColorGroup(); - colorgroupInstance->Wrap(args.This()); + CLib3MFBaseMaterialGroup * basematerialgroupInstance = new CLib3MFBaseMaterialGroup(); + basematerialgroupInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFColorGroup: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFBaseMaterialGroup: Invalid call to Constructor"); } } -Local CLib3MFColorGroup::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFBaseMaterialGroup::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -9236,7 +9487,7 @@ Local CLib3MFColorGroup::NewInstance(Local pParent, Lib3MFHandle } -void CLib3MFColorGroup::GetCount(const FunctionCallbackInfo& args) +void CLib3MFBaseMaterialGroup::GetCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); @@ -9245,10 +9496,10 @@ void CLib3MFColorGroup::GetCount(const FunctionCallbackInfo& args) sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCount."); - if (wrapperTable->m_ColorGroup_GetCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method ColorGroup::GetCount."); + if (wrapperTable->m_BaseMaterialGroup_GetCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::GetCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ColorGroup_GetCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_GetCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); @@ -9258,7 +9509,7 @@ void CLib3MFColorGroup::GetCount(const FunctionCallbackInfo& args) } -void CLib3MFColorGroup::GetAllPropertyIDs(const FunctionCallbackInfo& args) +void CLib3MFBaseMaterialGroup::GetAllPropertyIDs(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); @@ -9266,10 +9517,10 @@ void CLib3MFColorGroup::GetAllPropertyIDs(const FunctionCallbackInfo& arg sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAllPropertyIDs."); - if (wrapperTable->m_ColorGroup_GetAllPropertyIDs == nullptr) - throw std::runtime_error("Could not call Lib3MF method ColorGroup::GetAllPropertyIDs."); + if (wrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs == nullptr) + throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::GetAllPropertyIDs."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ColorGroup_GetAllPropertyIDs(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs(instanceHandle, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -9278,23 +9529,28 @@ void CLib3MFColorGroup::GetAllPropertyIDs(const FunctionCallbackInfo& arg } -void CLib3MFColorGroup::AddColor(const FunctionCallbackInfo& args) +void CLib3MFBaseMaterialGroup::AddMaterial(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected struct parameter 0 (TheColor)"); + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); } - sLib3MFColor sTheColor = convertObjectToLib3MFColor(isolate, args[0]); + if (!args[1]->IsObject()) { + throw std::runtime_error("Expected struct parameter 1 (DisplayColor)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + sLib3MFColor sDisplayColor = convertObjectToLib3MFColor(isolate, args[1]); unsigned int nReturnPropertyID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddColor."); - if (wrapperTable->m_ColorGroup_AddColor == nullptr) - throw std::runtime_error("Could not call Lib3MF method ColorGroup::AddColor."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddMaterial."); + if (wrapperTable->m_BaseMaterialGroup_AddMaterial == nullptr) + throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::AddMaterial."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ColorGroup_AddColor(instanceHandle, &sTheColor, &nReturnPropertyID); + Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_AddMaterial(instanceHandle, sName.c_str(), &sDisplayColor, &nReturnPropertyID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnPropertyID)); @@ -9304,7 +9560,7 @@ void CLib3MFColorGroup::AddColor(const FunctionCallbackInfo& args) } -void CLib3MFColorGroup::RemoveColor(const FunctionCallbackInfo& args) +void CLib3MFBaseMaterialGroup::RemoveMaterial(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); @@ -9315,11 +9571,11 @@ void CLib3MFColorGroup::RemoveColor(const FunctionCallbackInfo& args) unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveColor."); - if (wrapperTable->m_ColorGroup_RemoveColor == nullptr) - throw std::runtime_error("Could not call Lib3MF method ColorGroup::RemoveColor."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveMaterial."); + if (wrapperTable->m_BaseMaterialGroup_RemoveMaterial == nullptr) + throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::RemoveMaterial."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ColorGroup_RemoveColor(instanceHandle, nPropertyID); + Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_RemoveMaterial(instanceHandle, nPropertyID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -9328,7 +9584,67 @@ void CLib3MFColorGroup::RemoveColor(const FunctionCallbackInfo& args) } -void CLib3MFColorGroup::SetColor(const FunctionCallbackInfo& args) +void CLib3MFBaseMaterialGroup::GetName(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + } + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int bytesNeededName = 0; + unsigned int bytesWrittenName = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetName."); + if (wrapperTable->m_BaseMaterialGroup_GetName == nullptr) + throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::GetName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_BaseMaterialGroup_GetName(instanceHandle, nPropertyID, 0, &bytesNeededName, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferName; + bufferName.resize(bytesNeededName); + Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_GetName(instanceHandle, nPropertyID, bytesNeededName, &bytesWrittenName, &bufferName[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferName[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFBaseMaterialGroup::SetName(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (Name)"); + } + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + v8::String::Utf8Value sutf8Name(isolate, args[1]); + std::string sName = *sutf8Name; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetName."); + if (wrapperTable->m_BaseMaterialGroup_SetName == nullptr) + throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::SetName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_SetName(instanceHandle, nPropertyID, sName.c_str()); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFBaseMaterialGroup::SetDisplayColor(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); @@ -9343,11 +9659,11 @@ void CLib3MFColorGroup::SetColor(const FunctionCallbackInfo& args) sLib3MFColor sTheColor = convertObjectToLib3MFColor(isolate, args[1]); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetColor."); - if (wrapperTable->m_ColorGroup_SetColor == nullptr) - throw std::runtime_error("Could not call Lib3MF method ColorGroup::SetColor."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetDisplayColor."); + if (wrapperTable->m_BaseMaterialGroup_SetDisplayColor == nullptr) + throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::SetDisplayColor."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ColorGroup_SetColor(instanceHandle, nPropertyID, &sTheColor); + Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_SetDisplayColor(instanceHandle, nPropertyID, &sTheColor); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -9356,7 +9672,7 @@ void CLib3MFColorGroup::SetColor(const FunctionCallbackInfo& args) } -void CLib3MFColorGroup::GetColor(const FunctionCallbackInfo& args) +void CLib3MFBaseMaterialGroup::GetDisplayColor(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); @@ -9368,11 +9684,11 @@ void CLib3MFColorGroup::GetColor(const FunctionCallbackInfo& args) sLib3MFColor sReturnTheColor; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetColor."); - if (wrapperTable->m_ColorGroup_GetColor == nullptr) - throw std::runtime_error("Could not call Lib3MF method ColorGroup::GetColor."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetDisplayColor."); + if (wrapperTable->m_BaseMaterialGroup_GetDisplayColor == nullptr) + throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::GetDisplayColor."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ColorGroup_GetColor(instanceHandle, nPropertyID, &sReturnTheColor); + Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_GetDisplayColor(instanceHandle, nPropertyID, &sReturnTheColor); CheckError(isolate, wrapperTable, instanceHandle, errorCode); args.GetReturnValue().Set(convertLib3MFColorToObject(isolate, sReturnTheColor)); @@ -9382,36 +9698,243 @@ void CLib3MFColorGroup::GetColor(const FunctionCallbackInfo& args) } /************************************************************************************************************************* - Class CLib3MFTexture2DGroup Implementation + Class CLib3MFColorGroup Implementation **************************************************************************************************************************/ -CLib3MFTexture2DGroup::CLib3MFTexture2DGroup() +CLib3MFColorGroup::CLib3MFColorGroup() : CLib3MFBaseClass() { } -CLib3MFTexture2DGroup::~CLib3MFTexture2DGroup() +CLib3MFColorGroup::~CLib3MFColorGroup() { } -void CLib3MFTexture2DGroup::Init() +void CLib3MFColorGroup::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFTexture2DGroup")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFColorGroup")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype NODE_SET_PROTOTYPE_METHOD(tpl, "GetCount", GetCount); NODE_SET_PROTOTYPE_METHOD(tpl, "GetAllPropertyIDs", GetAllPropertyIDs); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddTex2Coord", AddTex2Coord); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetTex2Coord", GetTex2Coord); - NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveTex2Coord", RemoveTex2Coord); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetTexture2D", GetTexture2D); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - + NODE_SET_PROTOTYPE_METHOD(tpl, "AddColor", AddColor); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveColor", RemoveColor); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetColor", SetColor); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetColor", GetColor); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFColorGroup::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFColorGroup * colorgroupInstance = new CLib3MFColorGroup(); + colorgroupInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFColorGroup: Invalid call to Constructor"); + } +} + +Local CLib3MFColorGroup::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFColorGroup::GetCount(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int nReturnCount = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCount."); + if (wrapperTable->m_ColorGroup_GetCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method ColorGroup::GetCount."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ColorGroup_GetCount(instanceHandle, &nReturnCount); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFColorGroup::GetAllPropertyIDs(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAllPropertyIDs."); + if (wrapperTable->m_ColorGroup_GetAllPropertyIDs == nullptr) + throw std::runtime_error("Could not call Lib3MF method ColorGroup::GetAllPropertyIDs."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ColorGroup_GetAllPropertyIDs(instanceHandle, 0, nullptr, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFColorGroup::AddColor(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected struct parameter 0 (TheColor)"); + } + sLib3MFColor sTheColor = convertObjectToLib3MFColor(isolate, args[0]); + unsigned int nReturnPropertyID = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddColor."); + if (wrapperTable->m_ColorGroup_AddColor == nullptr) + throw std::runtime_error("Could not call Lib3MF method ColorGroup::AddColor."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ColorGroup_AddColor(instanceHandle, &sTheColor, &nReturnPropertyID); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnPropertyID)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFColorGroup::RemoveColor(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + } + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveColor."); + if (wrapperTable->m_ColorGroup_RemoveColor == nullptr) + throw std::runtime_error("Could not call Lib3MF method ColorGroup::RemoveColor."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ColorGroup_RemoveColor(instanceHandle, nPropertyID); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFColorGroup::SetColor(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + } + if (!args[1]->IsObject()) { + throw std::runtime_error("Expected struct parameter 1 (TheColor)"); + } + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFColor sTheColor = convertObjectToLib3MFColor(isolate, args[1]); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetColor."); + if (wrapperTable->m_ColorGroup_SetColor == nullptr) + throw std::runtime_error("Could not call Lib3MF method ColorGroup::SetColor."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ColorGroup_SetColor(instanceHandle, nPropertyID, &sTheColor); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFColorGroup::GetColor(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + } + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFColor sReturnTheColor; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetColor."); + if (wrapperTable->m_ColorGroup_GetColor == nullptr) + throw std::runtime_error("Could not call Lib3MF method ColorGroup::GetColor."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ColorGroup_GetColor(instanceHandle, nPropertyID, &sReturnTheColor); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(convertLib3MFColorToObject(isolate, sReturnTheColor)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFTexture2DGroup Implementation +**************************************************************************************************************************/ + +CLib3MFTexture2DGroup::CLib3MFTexture2DGroup() + : CLib3MFBaseClass() +{ +} + +CLib3MFTexture2DGroup::~CLib3MFTexture2DGroup() +{ +} + +void CLib3MFTexture2DGroup::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFTexture2DGroup")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCount", GetCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetAllPropertyIDs", GetAllPropertyIDs); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddTex2Coord", AddTex2Coord); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetTex2Coord", GetTex2Coord); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveTex2Coord", RemoveTex2Coord); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetTexture2D", GetTexture2D); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + } void CLib3MFTexture2DGroup::New(const FunctionCallbackInfo& args) @@ -14526,26 +15049,731 @@ Local CLib3MFClampNode::NewInstance(Local pParent, Lib3MFHandle instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); } - return instance; + return instance; +} + + +void CLib3MFClampNode::GetInputMin(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnMin = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputMin."); + if (wrapperTable->m_ClampNode_GetInputMin == nullptr) + throw std::runtime_error("Could not call Lib3MF method ClampNode::GetInputMin."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ClampNode_GetInputMin(instanceHandle, &hReturnMin); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjMin = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnMin); + args.GetReturnValue().Set(instanceObjMin); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFClampNode::GetInputMax(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnMax = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputMax."); + if (wrapperTable->m_ClampNode_GetInputMax == nullptr) + throw std::runtime_error("Could not call Lib3MF method ClampNode::GetInputMax."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ClampNode_GetInputMax(instanceHandle, &hReturnMax); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjMax = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnMax); + args.GetReturnValue().Set(instanceObjMax); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFComposeVectorNode Implementation +**************************************************************************************************************************/ + +CLib3MFComposeVectorNode::CLib3MFComposeVectorNode() + : CLib3MFBaseClass() +{ +} + +CLib3MFComposeVectorNode::~CLib3MFComposeVectorNode() +{ +} + +void CLib3MFComposeVectorNode::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFComposeVectorNode")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputX", GetInputX); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputY", GetInputY); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputZ", GetInputZ); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputResult", GetOutputResult); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFComposeVectorNode::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFComposeVectorNode * composevectornodeInstance = new CLib3MFComposeVectorNode(); + composevectornodeInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFComposeVectorNode: Invalid call to Constructor"); + } +} + +Local CLib3MFComposeVectorNode::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFComposeVectorNode::GetInputX(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnX = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputX."); + if (wrapperTable->m_ComposeVectorNode_GetInputX == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeVectorNode::GetInputX."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ComposeVectorNode_GetInputX(instanceHandle, &hReturnX); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjX = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnX); + args.GetReturnValue().Set(instanceObjX); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFComposeVectorNode::GetInputY(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnY = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputY."); + if (wrapperTable->m_ComposeVectorNode_GetInputY == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeVectorNode::GetInputY."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ComposeVectorNode_GetInputY(instanceHandle, &hReturnY); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjY = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnY); + args.GetReturnValue().Set(instanceObjY); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFComposeVectorNode::GetInputZ(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnZ = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputZ."); + if (wrapperTable->m_ComposeVectorNode_GetInputZ == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeVectorNode::GetInputZ."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ComposeVectorNode_GetInputZ(instanceHandle, &hReturnZ); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjZ = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnZ); + args.GetReturnValue().Set(instanceObjZ); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFComposeVectorNode::GetOutputResult(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnResult = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputResult."); + if (wrapperTable->m_ComposeVectorNode_GetOutputResult == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeVectorNode::GetOutputResult."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ComposeVectorNode_GetOutputResult(instanceHandle, &hReturnResult); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjResult = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnResult); + args.GetReturnValue().Set(instanceObjResult); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFVectorFromScalarNode Implementation +**************************************************************************************************************************/ + +CLib3MFVectorFromScalarNode::CLib3MFVectorFromScalarNode() + : CLib3MFBaseClass() +{ +} + +CLib3MFVectorFromScalarNode::~CLib3MFVectorFromScalarNode() +{ +} + +void CLib3MFVectorFromScalarNode::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFVectorFromScalarNode")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFVectorFromScalarNode::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFVectorFromScalarNode * vectorfromscalarnodeInstance = new CLib3MFVectorFromScalarNode(); + vectorfromscalarnodeInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFVectorFromScalarNode: Invalid call to Constructor"); + } +} + +Local CLib3MFVectorFromScalarNode::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + +/************************************************************************************************************************* + Class CLib3MFDecomposeVectorNode Implementation +**************************************************************************************************************************/ + +CLib3MFDecomposeVectorNode::CLib3MFDecomposeVectorNode() + : CLib3MFBaseClass() +{ +} + +CLib3MFDecomposeVectorNode::~CLib3MFDecomposeVectorNode() +{ +} + +void CLib3MFDecomposeVectorNode::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFDecomposeVectorNode")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputA", GetInputA); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputX", GetOutputX); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputY", GetOutputY); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputZ", GetOutputZ); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFDecomposeVectorNode::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFDecomposeVectorNode * decomposevectornodeInstance = new CLib3MFDecomposeVectorNode(); + decomposevectornodeInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFDecomposeVectorNode: Invalid call to Constructor"); + } +} + +Local CLib3MFDecomposeVectorNode::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFDecomposeVectorNode::GetInputA(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnA = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputA."); + if (wrapperTable->m_DecomposeVectorNode_GetInputA == nullptr) + throw std::runtime_error("Could not call Lib3MF method DecomposeVectorNode::GetInputA."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_DecomposeVectorNode_GetInputA(instanceHandle, &hReturnA); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjA = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnA); + args.GetReturnValue().Set(instanceObjA); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFDecomposeVectorNode::GetOutputX(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnX = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputX."); + if (wrapperTable->m_DecomposeVectorNode_GetOutputX == nullptr) + throw std::runtime_error("Could not call Lib3MF method DecomposeVectorNode::GetOutputX."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_DecomposeVectorNode_GetOutputX(instanceHandle, &hReturnX); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjX = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnX); + args.GetReturnValue().Set(instanceObjX); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFDecomposeVectorNode::GetOutputY(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnY = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputY."); + if (wrapperTable->m_DecomposeVectorNode_GetOutputY == nullptr) + throw std::runtime_error("Could not call Lib3MF method DecomposeVectorNode::GetOutputY."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_DecomposeVectorNode_GetOutputY(instanceHandle, &hReturnY); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjY = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnY); + args.GetReturnValue().Set(instanceObjY); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFDecomposeVectorNode::GetOutputZ(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnZ = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputZ."); + if (wrapperTable->m_DecomposeVectorNode_GetOutputZ == nullptr) + throw std::runtime_error("Could not call Lib3MF method DecomposeVectorNode::GetOutputZ."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_DecomposeVectorNode_GetOutputZ(instanceHandle, &hReturnZ); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjZ = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnZ); + args.GetReturnValue().Set(instanceObjZ); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFComposeMatrixNode Implementation +**************************************************************************************************************************/ + +CLib3MFComposeMatrixNode::CLib3MFComposeMatrixNode() + : CLib3MFBaseClass() +{ +} + +CLib3MFComposeMatrixNode::~CLib3MFComposeMatrixNode() +{ +} + +void CLib3MFComposeMatrixNode::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFComposeMatrixNode")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM00", GetInputM00); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM01", GetInputM01); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM02", GetInputM02); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM03", GetInputM03); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM10", GetInputM10); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM11", GetInputM11); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM12", GetInputM12); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM13", GetInputM13); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM20", GetInputM20); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM21", GetInputM21); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM22", GetInputM22); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM23", GetInputM23); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM30", GetInputM30); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM31", GetInputM31); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM32", GetInputM32); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM33", GetInputM33); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputResult", GetOutputResult); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFComposeMatrixNode::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFComposeMatrixNode * composematrixnodeInstance = new CLib3MFComposeMatrixNode(); + composematrixnodeInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFComposeMatrixNode: Invalid call to Constructor"); + } +} + +Local CLib3MFComposeMatrixNode::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFComposeMatrixNode::GetInputM00(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnM00 = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM00."); + if (wrapperTable->m_ComposeMatrixNode_GetInputM00 == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM00."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM00(instanceHandle, &hReturnM00); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjM00 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM00); + args.GetReturnValue().Set(instanceObjM00); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFComposeMatrixNode::GetInputM01(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnM01 = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM01."); + if (wrapperTable->m_ComposeMatrixNode_GetInputM01 == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM01."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM01(instanceHandle, &hReturnM01); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjM01 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM01); + args.GetReturnValue().Set(instanceObjM01); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFComposeMatrixNode::GetInputM02(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnM02 = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM02."); + if (wrapperTable->m_ComposeMatrixNode_GetInputM02 == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM02."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM02(instanceHandle, &hReturnM02); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjM02 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM02); + args.GetReturnValue().Set(instanceObjM02); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFComposeMatrixNode::GetInputM03(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnM03 = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM03."); + if (wrapperTable->m_ComposeMatrixNode_GetInputM03 == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM03."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM03(instanceHandle, &hReturnM03); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjM03 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM03); + args.GetReturnValue().Set(instanceObjM03); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFComposeMatrixNode::GetInputM10(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnM10 = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM10."); + if (wrapperTable->m_ComposeMatrixNode_GetInputM10 == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM10."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM10(instanceHandle, &hReturnM10); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjM10 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM10); + args.GetReturnValue().Set(instanceObjM10); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFComposeMatrixNode::GetInputM11(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnM11 = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM11."); + if (wrapperTable->m_ComposeMatrixNode_GetInputM11 == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM11."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM11(instanceHandle, &hReturnM11); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjM11 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM11); + args.GetReturnValue().Set(instanceObjM11); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFComposeMatrixNode::GetInputM12(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnM12 = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM12."); + if (wrapperTable->m_ComposeMatrixNode_GetInputM12 == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM12."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM12(instanceHandle, &hReturnM12); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjM12 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM12); + args.GetReturnValue().Set(instanceObjM12); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFComposeMatrixNode::GetInputM13(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnM13 = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM13."); + if (wrapperTable->m_ComposeMatrixNode_GetInputM13 == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM13."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM13(instanceHandle, &hReturnM13); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjM13 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM13); + args.GetReturnValue().Set(instanceObjM13); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFComposeMatrixNode::GetInputM20(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnM20 = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM20."); + if (wrapperTable->m_ComposeMatrixNode_GetInputM20 == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM20."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM20(instanceHandle, &hReturnM20); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjM20 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM20); + args.GetReturnValue().Set(instanceObjM20); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFComposeMatrixNode::GetInputM21(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnM21 = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM21."); + if (wrapperTable->m_ComposeMatrixNode_GetInputM21 == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM21."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM21(instanceHandle, &hReturnM21); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjM21 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM21); + args.GetReturnValue().Set(instanceObjM21); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -void CLib3MFClampNode::GetInputMin(const FunctionCallbackInfo& args) +void CLib3MFComposeMatrixNode::GetInputM22(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnMin = nullptr; + Lib3MFHandle hReturnM22 = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputMin."); - if (wrapperTable->m_ClampNode_GetInputMin == nullptr) - throw std::runtime_error("Could not call Lib3MF method ClampNode::GetInputMin."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM22."); + if (wrapperTable->m_ComposeMatrixNode_GetInputM22 == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM22."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ClampNode_GetInputMin(instanceHandle, &hReturnMin); + Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM22(instanceHandle, &hReturnM22); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjMin = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnMin); - args.GetReturnValue().Set(instanceObjMin); + Local instanceObjM22 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM22); + args.GetReturnValue().Set(instanceObjM22); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -14553,104 +15781,68 @@ void CLib3MFClampNode::GetInputMin(const FunctionCallbackInfo& args) } -void CLib3MFClampNode::GetInputMax(const FunctionCallbackInfo& args) +void CLib3MFComposeMatrixNode::GetInputM23(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnMax = nullptr; + Lib3MFHandle hReturnM23 = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputMax."); - if (wrapperTable->m_ClampNode_GetInputMax == nullptr) - throw std::runtime_error("Could not call Lib3MF method ClampNode::GetInputMax."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM23."); + if (wrapperTable->m_ComposeMatrixNode_GetInputM23 == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM23."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ClampNode_GetInputMax(instanceHandle, &hReturnMax); + Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM23(instanceHandle, &hReturnM23); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjMax = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnMax); - args.GetReturnValue().Set(instanceObjMax); + Local instanceObjM23 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM23); + args.GetReturnValue().Set(instanceObjM23); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } -/************************************************************************************************************************* - Class CLib3MFComposeVectorNode Implementation -**************************************************************************************************************************/ - -CLib3MFComposeVectorNode::CLib3MFComposeVectorNode() - : CLib3MFBaseClass() -{ -} - -CLib3MFComposeVectorNode::~CLib3MFComposeVectorNode() -{ -} - -void CLib3MFComposeVectorNode::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFComposeVectorNode")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputX", GetInputX); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputY", GetInputY); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputZ", GetInputZ); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputResult", GetOutputResult); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - -} -void CLib3MFComposeVectorNode::New(const FunctionCallbackInfo& args) +void CLib3MFComposeMatrixNode::GetInputM30(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + Lib3MFHandle hReturnM30 = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM30."); + if (wrapperTable->m_ComposeMatrixNode_GetInputM30 == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM30."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM30(instanceHandle, &hReturnM30); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjM30 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM30); + args.GetReturnValue().Set(instanceObjM30); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFComposeVectorNode * composevectornodeInstance = new CLib3MFComposeVectorNode(); - composevectornodeInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFComposeVectorNode: Invalid call to Constructor"); - } -} - -Local CLib3MFComposeVectorNode::NewInstance(Local pParent, Lib3MFHandle pHandle) -{ - Isolate* isolate = Isolate::GetCurrent(); - HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFComposeVectorNode::GetInputX(const FunctionCallbackInfo& args) +void CLib3MFComposeMatrixNode::GetInputM31(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnX = nullptr; + Lib3MFHandle hReturnM31 = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputX."); - if (wrapperTable->m_ComposeVectorNode_GetInputX == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeVectorNode::GetInputX."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM31."); + if (wrapperTable->m_ComposeMatrixNode_GetInputM31 == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM31."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeVectorNode_GetInputX(instanceHandle, &hReturnX); + Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM31(instanceHandle, &hReturnM31); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjX = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnX); - args.GetReturnValue().Set(instanceObjX); + Local instanceObjM31 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM31); + args.GetReturnValue().Set(instanceObjM31); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -14658,22 +15850,22 @@ void CLib3MFComposeVectorNode::GetInputX(const FunctionCallbackInfo& args } -void CLib3MFComposeVectorNode::GetInputY(const FunctionCallbackInfo& args) +void CLib3MFComposeMatrixNode::GetInputM32(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnY = nullptr; + Lib3MFHandle hReturnM32 = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputY."); - if (wrapperTable->m_ComposeVectorNode_GetInputY == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeVectorNode::GetInputY."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM32."); + if (wrapperTable->m_ComposeMatrixNode_GetInputM32 == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM32."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeVectorNode_GetInputY(instanceHandle, &hReturnY); + Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM32(instanceHandle, &hReturnM32); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjY = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnY); - args.GetReturnValue().Set(instanceObjY); + Local instanceObjM32 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM32); + args.GetReturnValue().Set(instanceObjM32); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -14681,22 +15873,22 @@ void CLib3MFComposeVectorNode::GetInputY(const FunctionCallbackInfo& args } -void CLib3MFComposeVectorNode::GetInputZ(const FunctionCallbackInfo& args) +void CLib3MFComposeMatrixNode::GetInputM33(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnZ = nullptr; + Lib3MFHandle hReturnM33 = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputZ."); - if (wrapperTable->m_ComposeVectorNode_GetInputZ == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeVectorNode::GetInputZ."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM33."); + if (wrapperTable->m_ComposeMatrixNode_GetInputM33 == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM33."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeVectorNode_GetInputZ(instanceHandle, &hReturnZ); + Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM33(instanceHandle, &hReturnM33); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjZ = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnZ); - args.GetReturnValue().Set(instanceObjZ); + Local instanceObjM33 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM33); + args.GetReturnValue().Set(instanceObjM33); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -14704,7 +15896,7 @@ void CLib3MFComposeVectorNode::GetInputZ(const FunctionCallbackInfo& args } -void CLib3MFComposeVectorNode::GetOutputResult(const FunctionCallbackInfo& args) +void CLib3MFComposeMatrixNode::GetOutputResult(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); @@ -14713,10 +15905,10 @@ void CLib3MFComposeVectorNode::GetOutputResult(const FunctionCallbackInfo sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputResult."); - if (wrapperTable->m_ComposeVectorNode_GetOutputResult == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeVectorNode::GetOutputResult."); + if (wrapperTable->m_ComposeMatrixNode_GetOutputResult == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetOutputResult."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeVectorNode_GetOutputResult(instanceHandle, &hReturnResult); + Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetOutputResult(instanceHandle, &hReturnResult); CheckError(isolate, wrapperTable, instanceHandle, errorCode); Local instanceObjResult = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnResult); args.GetReturnValue().Set(instanceObjResult); @@ -14727,48 +15919,53 @@ void CLib3MFComposeVectorNode::GetOutputResult(const FunctionCallbackInfo } /************************************************************************************************************************* - Class CLib3MFVectorFromScalarNode Implementation + Class CLib3MFMatrixFromRowsNode Implementation **************************************************************************************************************************/ -CLib3MFVectorFromScalarNode::CLib3MFVectorFromScalarNode() +CLib3MFMatrixFromRowsNode::CLib3MFMatrixFromRowsNode() : CLib3MFBaseClass() { } -CLib3MFVectorFromScalarNode::~CLib3MFVectorFromScalarNode() +CLib3MFMatrixFromRowsNode::~CLib3MFMatrixFromRowsNode() { } -void CLib3MFVectorFromScalarNode::Init() +void CLib3MFMatrixFromRowsNode::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFVectorFromScalarNode")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMatrixFromRowsNode")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputA", GetInputA); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputB", GetInputB); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputC", GetInputC); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputD", GetInputD); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputResult", GetOutputResult); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFVectorFromScalarNode::New(const FunctionCallbackInfo& args) +void CLib3MFMatrixFromRowsNode::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFVectorFromScalarNode * vectorfromscalarnodeInstance = new CLib3MFVectorFromScalarNode(); - vectorfromscalarnodeInstance->Wrap(args.This()); + CLib3MFMatrixFromRowsNode * matrixfromrowsnodeInstance = new CLib3MFMatrixFromRowsNode(); + matrixfromrowsnodeInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFVectorFromScalarNode: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFMatrixFromRowsNode: Invalid call to Constructor"); } } -Local CLib3MFVectorFromScalarNode::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFMatrixFromRowsNode::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -14781,82 +15978,46 @@ Local CLib3MFVectorFromScalarNode::NewInstance(Local pParent, Li return instance; } -/************************************************************************************************************************* - Class CLib3MFDecomposeVectorNode Implementation -**************************************************************************************************************************/ - -CLib3MFDecomposeVectorNode::CLib3MFDecomposeVectorNode() - : CLib3MFBaseClass() -{ -} - -CLib3MFDecomposeVectorNode::~CLib3MFDecomposeVectorNode() -{ -} - -void CLib3MFDecomposeVectorNode::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFDecomposeVectorNode")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputA", GetInputA); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputX", GetOutputX); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputY", GetOutputY); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputZ", GetOutputZ); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - -} -void CLib3MFDecomposeVectorNode::New(const FunctionCallbackInfo& args) +void CLib3MFMatrixFromRowsNode::GetInputA(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + Lib3MFHandle hReturnRow0 = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputA."); + if (wrapperTable->m_MatrixFromRowsNode_GetInputA == nullptr) + throw std::runtime_error("Could not call Lib3MF method MatrixFromRowsNode::GetInputA."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MatrixFromRowsNode_GetInputA(instanceHandle, &hReturnRow0); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjRow0 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnRow0); + args.GetReturnValue().Set(instanceObjRow0); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFDecomposeVectorNode * decomposevectornodeInstance = new CLib3MFDecomposeVectorNode(); - decomposevectornodeInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFDecomposeVectorNode: Invalid call to Constructor"); - } -} - -Local CLib3MFDecomposeVectorNode::NewInstance(Local pParent, Lib3MFHandle pHandle) -{ - Isolate* isolate = Isolate::GetCurrent(); - HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFDecomposeVectorNode::GetInputA(const FunctionCallbackInfo& args) +void CLib3MFMatrixFromRowsNode::GetInputB(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnA = nullptr; + Lib3MFHandle hReturnRow1 = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputA."); - if (wrapperTable->m_DecomposeVectorNode_GetInputA == nullptr) - throw std::runtime_error("Could not call Lib3MF method DecomposeVectorNode::GetInputA."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputB."); + if (wrapperTable->m_MatrixFromRowsNode_GetInputB == nullptr) + throw std::runtime_error("Could not call Lib3MF method MatrixFromRowsNode::GetInputB."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_DecomposeVectorNode_GetInputA(instanceHandle, &hReturnA); + Lib3MFResult errorCode = wrapperTable->m_MatrixFromRowsNode_GetInputB(instanceHandle, &hReturnRow1); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjA = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnA); - args.GetReturnValue().Set(instanceObjA); + Local instanceObjRow1 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnRow1); + args.GetReturnValue().Set(instanceObjRow1); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -14864,22 +16025,22 @@ void CLib3MFDecomposeVectorNode::GetInputA(const FunctionCallbackInfo& ar } -void CLib3MFDecomposeVectorNode::GetOutputX(const FunctionCallbackInfo& args) +void CLib3MFMatrixFromRowsNode::GetInputC(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnX = nullptr; + Lib3MFHandle hReturnRow2 = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputX."); - if (wrapperTable->m_DecomposeVectorNode_GetOutputX == nullptr) - throw std::runtime_error("Could not call Lib3MF method DecomposeVectorNode::GetOutputX."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputC."); + if (wrapperTable->m_MatrixFromRowsNode_GetInputC == nullptr) + throw std::runtime_error("Could not call Lib3MF method MatrixFromRowsNode::GetInputC."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_DecomposeVectorNode_GetOutputX(instanceHandle, &hReturnX); + Lib3MFResult errorCode = wrapperTable->m_MatrixFromRowsNode_GetInputC(instanceHandle, &hReturnRow2); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjX = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnX); - args.GetReturnValue().Set(instanceObjX); + Local instanceObjRow2 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnRow2); + args.GetReturnValue().Set(instanceObjRow2); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -14887,22 +16048,22 @@ void CLib3MFDecomposeVectorNode::GetOutputX(const FunctionCallbackInfo& a } -void CLib3MFDecomposeVectorNode::GetOutputY(const FunctionCallbackInfo& args) +void CLib3MFMatrixFromRowsNode::GetInputD(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnY = nullptr; + Lib3MFHandle hReturnRow3 = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputY."); - if (wrapperTable->m_DecomposeVectorNode_GetOutputY == nullptr) - throw std::runtime_error("Could not call Lib3MF method DecomposeVectorNode::GetOutputY."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputD."); + if (wrapperTable->m_MatrixFromRowsNode_GetInputD == nullptr) + throw std::runtime_error("Could not call Lib3MF method MatrixFromRowsNode::GetInputD."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_DecomposeVectorNode_GetOutputY(instanceHandle, &hReturnY); + Lib3MFResult errorCode = wrapperTable->m_MatrixFromRowsNode_GetInputD(instanceHandle, &hReturnRow3); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjY = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnY); - args.GetReturnValue().Set(instanceObjY); + Local instanceObjRow3 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnRow3); + args.GetReturnValue().Set(instanceObjRow3); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -14910,22 +16071,22 @@ void CLib3MFDecomposeVectorNode::GetOutputY(const FunctionCallbackInfo& a } -void CLib3MFDecomposeVectorNode::GetOutputZ(const FunctionCallbackInfo& args) +void CLib3MFMatrixFromRowsNode::GetOutputResult(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnZ = nullptr; + Lib3MFHandle hReturnResult = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputZ."); - if (wrapperTable->m_DecomposeVectorNode_GetOutputZ == nullptr) - throw std::runtime_error("Could not call Lib3MF method DecomposeVectorNode::GetOutputZ."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputResult."); + if (wrapperTable->m_MatrixFromRowsNode_GetOutputResult == nullptr) + throw std::runtime_error("Could not call Lib3MF method MatrixFromRowsNode::GetOutputResult."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_DecomposeVectorNode_GetOutputZ(instanceHandle, &hReturnZ); + Lib3MFResult errorCode = wrapperTable->m_MatrixFromRowsNode_GetOutputResult(instanceHandle, &hReturnResult); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjZ = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnZ); - args.GetReturnValue().Set(instanceObjZ); + Local instanceObjResult = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnResult); + args.GetReturnValue().Set(instanceObjResult); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -14933,65 +16094,53 @@ void CLib3MFDecomposeVectorNode::GetOutputZ(const FunctionCallbackInfo& a } /************************************************************************************************************************* - Class CLib3MFComposeMatrixNode Implementation + Class CLib3MFMatrixFromColumnsNode Implementation **************************************************************************************************************************/ -CLib3MFComposeMatrixNode::CLib3MFComposeMatrixNode() +CLib3MFMatrixFromColumnsNode::CLib3MFMatrixFromColumnsNode() : CLib3MFBaseClass() { } -CLib3MFComposeMatrixNode::~CLib3MFComposeMatrixNode() +CLib3MFMatrixFromColumnsNode::~CLib3MFMatrixFromColumnsNode() { } -void CLib3MFComposeMatrixNode::Init() +void CLib3MFMatrixFromColumnsNode::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFComposeMatrixNode")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMatrixFromColumnsNode")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM00", GetInputM00); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM01", GetInputM01); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM02", GetInputM02); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM03", GetInputM03); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM10", GetInputM10); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM11", GetInputM11); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM12", GetInputM12); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM13", GetInputM13); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM20", GetInputM20); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM21", GetInputM21); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM22", GetInputM22); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM23", GetInputM23); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM30", GetInputM30); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM31", GetInputM31); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM32", GetInputM32); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputM33", GetInputM33); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputA", GetInputA); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputB", GetInputB); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputC", GetInputC); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputD", GetInputD); NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputResult", GetOutputResult); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFComposeMatrixNode::New(const FunctionCallbackInfo& args) +void CLib3MFMatrixFromColumnsNode::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFComposeMatrixNode * composematrixnodeInstance = new CLib3MFComposeMatrixNode(); - composematrixnodeInstance->Wrap(args.This()); + CLib3MFMatrixFromColumnsNode * matrixfromcolumnsnodeInstance = new CLib3MFMatrixFromColumnsNode(); + matrixfromcolumnsnodeInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFComposeMatrixNode: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFMatrixFromColumnsNode: Invalid call to Constructor"); } } -Local CLib3MFComposeMatrixNode::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFMatrixFromColumnsNode::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -15005,22 +16154,22 @@ Local CLib3MFComposeMatrixNode::NewInstance(Local pParent, Lib3M } -void CLib3MFComposeMatrixNode::GetInputM00(const FunctionCallbackInfo& args) +void CLib3MFMatrixFromColumnsNode::GetInputA(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnM00 = nullptr; + Lib3MFHandle hReturnColumn0 = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM00."); - if (wrapperTable->m_ComposeMatrixNode_GetInputM00 == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM00."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputA."); + if (wrapperTable->m_MatrixFromColumnsNode_GetInputA == nullptr) + throw std::runtime_error("Could not call Lib3MF method MatrixFromColumnsNode::GetInputA."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM00(instanceHandle, &hReturnM00); + Lib3MFResult errorCode = wrapperTable->m_MatrixFromColumnsNode_GetInputA(instanceHandle, &hReturnColumn0); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjM00 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM00); - args.GetReturnValue().Set(instanceObjM00); + Local instanceObjColumn0 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnColumn0); + args.GetReturnValue().Set(instanceObjColumn0); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15028,22 +16177,22 @@ void CLib3MFComposeMatrixNode::GetInputM00(const FunctionCallbackInfo& ar } -void CLib3MFComposeMatrixNode::GetInputM01(const FunctionCallbackInfo& args) +void CLib3MFMatrixFromColumnsNode::GetInputB(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnM01 = nullptr; + Lib3MFHandle hReturnColumn1 = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM01."); - if (wrapperTable->m_ComposeMatrixNode_GetInputM01 == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM01."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputB."); + if (wrapperTable->m_MatrixFromColumnsNode_GetInputB == nullptr) + throw std::runtime_error("Could not call Lib3MF method MatrixFromColumnsNode::GetInputB."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM01(instanceHandle, &hReturnM01); + Lib3MFResult errorCode = wrapperTable->m_MatrixFromColumnsNode_GetInputB(instanceHandle, &hReturnColumn1); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjM01 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM01); - args.GetReturnValue().Set(instanceObjM01); + Local instanceObjColumn1 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnColumn1); + args.GetReturnValue().Set(instanceObjColumn1); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15051,22 +16200,22 @@ void CLib3MFComposeMatrixNode::GetInputM01(const FunctionCallbackInfo& ar } -void CLib3MFComposeMatrixNode::GetInputM02(const FunctionCallbackInfo& args) +void CLib3MFMatrixFromColumnsNode::GetInputC(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnM02 = nullptr; + Lib3MFHandle hReturnColumn2 = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM02."); - if (wrapperTable->m_ComposeMatrixNode_GetInputM02 == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM02."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputC."); + if (wrapperTable->m_MatrixFromColumnsNode_GetInputC == nullptr) + throw std::runtime_error("Could not call Lib3MF method MatrixFromColumnsNode::GetInputC."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM02(instanceHandle, &hReturnM02); + Lib3MFResult errorCode = wrapperTable->m_MatrixFromColumnsNode_GetInputC(instanceHandle, &hReturnColumn2); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjM02 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM02); - args.GetReturnValue().Set(instanceObjM02); + Local instanceObjColumn2 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnColumn2); + args.GetReturnValue().Set(instanceObjColumn2); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15074,22 +16223,22 @@ void CLib3MFComposeMatrixNode::GetInputM02(const FunctionCallbackInfo& ar } -void CLib3MFComposeMatrixNode::GetInputM03(const FunctionCallbackInfo& args) +void CLib3MFMatrixFromColumnsNode::GetInputD(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnM03 = nullptr; + Lib3MFHandle hReturnColumn3 = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM03."); - if (wrapperTable->m_ComposeMatrixNode_GetInputM03 == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM03."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputD."); + if (wrapperTable->m_MatrixFromColumnsNode_GetInputD == nullptr) + throw std::runtime_error("Could not call Lib3MF method MatrixFromColumnsNode::GetInputD."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM03(instanceHandle, &hReturnM03); + Lib3MFResult errorCode = wrapperTable->m_MatrixFromColumnsNode_GetInputD(instanceHandle, &hReturnColumn3); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjM03 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM03); - args.GetReturnValue().Set(instanceObjM03); + Local instanceObjColumn3 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnColumn3); + args.GetReturnValue().Set(instanceObjColumn3); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15097,68 +16246,104 @@ void CLib3MFComposeMatrixNode::GetInputM03(const FunctionCallbackInfo& ar } -void CLib3MFComposeMatrixNode::GetInputM10(const FunctionCallbackInfo& args) +void CLib3MFMatrixFromColumnsNode::GetOutputResult(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnM10 = nullptr; + Lib3MFHandle hReturnResult = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM10."); - if (wrapperTable->m_ComposeMatrixNode_GetInputM10 == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM10."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputResult."); + if (wrapperTable->m_MatrixFromColumnsNode_GetOutputResult == nullptr) + throw std::runtime_error("Could not call Lib3MF method MatrixFromColumnsNode::GetOutputResult."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM10(instanceHandle, &hReturnM10); + Lib3MFResult errorCode = wrapperTable->m_MatrixFromColumnsNode_GetOutputResult(instanceHandle, &hReturnResult); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjM10 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM10); - args.GetReturnValue().Set(instanceObjM10); + Local instanceObjResult = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnResult); + args.GetReturnValue().Set(instanceObjResult); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } +/************************************************************************************************************************* + Class CLib3MFConstantNode Implementation +**************************************************************************************************************************/ -void CLib3MFComposeMatrixNode::GetInputM11(const FunctionCallbackInfo& args) +CLib3MFConstantNode::CLib3MFConstantNode() + : CLib3MFBaseClass() +{ +} + +CLib3MFConstantNode::~CLib3MFConstantNode() +{ +} + +void CLib3MFConstantNode::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFConstantNode")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "SetConstant", SetConstant); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetConstant", GetConstant); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputValue", GetOutputValue); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFConstantNode::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - try { - Lib3MFHandle hReturnM11 = nullptr; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM11."); - if (wrapperTable->m_ComposeMatrixNode_GetInputM11 == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM11."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM11(instanceHandle, &hReturnM11); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjM11 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM11); - args.GetReturnValue().Set(instanceObjM11); - } catch (std::exception & E) { - RaiseError(isolate, E.what()); + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFConstantNode * constantnodeInstance = new CLib3MFConstantNode(); + constantnodeInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFConstantNode: Invalid call to Constructor"); + } +} + +Local CLib3MFConstantNode::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); } + return instance; } -void CLib3MFComposeMatrixNode::GetInputM12(const FunctionCallbackInfo& args) +void CLib3MFConstantNode::SetConstant(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnM12 = nullptr; + if (!args[0]->IsNumber()) { + throw std::runtime_error("Expected double parameter 0 (Value)"); + } + double dValue = (double) args[0]->NumberValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM12."); - if (wrapperTable->m_ComposeMatrixNode_GetInputM12 == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM12."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetConstant."); + if (wrapperTable->m_ConstantNode_SetConstant == nullptr) + throw std::runtime_error("Could not call Lib3MF method ConstantNode::SetConstant."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM12(instanceHandle, &hReturnM12); + Lib3MFResult errorCode = wrapperTable->m_ConstantNode_SetConstant(instanceHandle, dValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjM12 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM12); - args.GetReturnValue().Set(instanceObjM12); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15166,22 +16351,21 @@ void CLib3MFComposeMatrixNode::GetInputM12(const FunctionCallbackInfo& ar } -void CLib3MFComposeMatrixNode::GetInputM13(const FunctionCallbackInfo& args) +void CLib3MFConstantNode::GetConstant(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnM13 = nullptr; + double dReturnValue = 0.0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM13."); - if (wrapperTable->m_ComposeMatrixNode_GetInputM13 == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM13."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetConstant."); + if (wrapperTable->m_ConstantNode_GetConstant == nullptr) + throw std::runtime_error("Could not call Lib3MF method ConstantNode::GetConstant."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM13(instanceHandle, &hReturnM13); + Lib3MFResult errorCode = wrapperTable->m_ConstantNode_GetConstant(instanceHandle, &dReturnValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjM13 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM13); - args.GetReturnValue().Set(instanceObjM13); + args.GetReturnValue().Set(Number::New(isolate, dReturnValue)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15189,68 +16373,104 @@ void CLib3MFComposeMatrixNode::GetInputM13(const FunctionCallbackInfo& ar } -void CLib3MFComposeMatrixNode::GetInputM20(const FunctionCallbackInfo& args) +void CLib3MFConstantNode::GetOutputValue(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnM20 = nullptr; + Lib3MFHandle hReturnValue = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM20."); - if (wrapperTable->m_ComposeMatrixNode_GetInputM20 == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM20."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputValue."); + if (wrapperTable->m_ConstantNode_GetOutputValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method ConstantNode::GetOutputValue."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM20(instanceHandle, &hReturnM20); + Lib3MFResult errorCode = wrapperTable->m_ConstantNode_GetOutputValue(instanceHandle, &hReturnValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjM20 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM20); - args.GetReturnValue().Set(instanceObjM20); + Local instanceObjValue = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnValue); + args.GetReturnValue().Set(instanceObjValue); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } +/************************************************************************************************************************* + Class CLib3MFConstVecNode Implementation +**************************************************************************************************************************/ + +CLib3MFConstVecNode::CLib3MFConstVecNode() + : CLib3MFBaseClass() +{ +} -void CLib3MFComposeMatrixNode::GetInputM21(const FunctionCallbackInfo& args) +CLib3MFConstVecNode::~CLib3MFConstVecNode() +{ +} + +void CLib3MFConstVecNode::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFConstVecNode")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "SetVector", SetVector); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetVector", GetVector); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputVector", GetOutputVector); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFConstVecNode::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - try { - Lib3MFHandle hReturnM21 = nullptr; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM21."); - if (wrapperTable->m_ComposeMatrixNode_GetInputM21 == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM21."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM21(instanceHandle, &hReturnM21); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjM21 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM21); - args.GetReturnValue().Set(instanceObjM21); - } catch (std::exception & E) { - RaiseError(isolate, E.what()); + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFConstVecNode * constvecnodeInstance = new CLib3MFConstVecNode(); + constvecnodeInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFConstVecNode: Invalid call to Constructor"); + } +} + +Local CLib3MFConstVecNode::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); } + return instance; } -void CLib3MFComposeMatrixNode::GetInputM22(const FunctionCallbackInfo& args) +void CLib3MFConstVecNode::SetVector(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnM22 = nullptr; + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected struct parameter 0 (Value)"); + } + sLib3MFVector sValue = convertObjectToLib3MFVector(isolate, args[0]); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM22."); - if (wrapperTable->m_ComposeMatrixNode_GetInputM22 == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM22."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetVector."); + if (wrapperTable->m_ConstVecNode_SetVector == nullptr) + throw std::runtime_error("Could not call Lib3MF method ConstVecNode::SetVector."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM22(instanceHandle, &hReturnM22); + Lib3MFResult errorCode = wrapperTable->m_ConstVecNode_SetVector(instanceHandle, &sValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjM22 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM22); - args.GetReturnValue().Set(instanceObjM22); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15258,22 +16478,21 @@ void CLib3MFComposeMatrixNode::GetInputM22(const FunctionCallbackInfo& ar } -void CLib3MFComposeMatrixNode::GetInputM23(const FunctionCallbackInfo& args) +void CLib3MFConstVecNode::GetVector(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnM23 = nullptr; + sLib3MFVector sReturnValue; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM23."); - if (wrapperTable->m_ComposeMatrixNode_GetInputM23 == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM23."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetVector."); + if (wrapperTable->m_ConstVecNode_GetVector == nullptr) + throw std::runtime_error("Could not call Lib3MF method ConstVecNode::GetVector."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM23(instanceHandle, &hReturnM23); + Lib3MFResult errorCode = wrapperTable->m_ConstVecNode_GetVector(instanceHandle, &sReturnValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjM23 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM23); - args.GetReturnValue().Set(instanceObjM23); + args.GetReturnValue().Set(convertLib3MFVectorToObject(isolate, sReturnValue)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15281,68 +16500,104 @@ void CLib3MFComposeMatrixNode::GetInputM23(const FunctionCallbackInfo& ar } -void CLib3MFComposeMatrixNode::GetInputM30(const FunctionCallbackInfo& args) +void CLib3MFConstVecNode::GetOutputVector(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnM30 = nullptr; + Lib3MFHandle hReturnVector = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM30."); - if (wrapperTable->m_ComposeMatrixNode_GetInputM30 == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM30."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputVector."); + if (wrapperTable->m_ConstVecNode_GetOutputVector == nullptr) + throw std::runtime_error("Could not call Lib3MF method ConstVecNode::GetOutputVector."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM30(instanceHandle, &hReturnM30); + Lib3MFResult errorCode = wrapperTable->m_ConstVecNode_GetOutputVector(instanceHandle, &hReturnVector); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjM30 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM30); - args.GetReturnValue().Set(instanceObjM30); + Local instanceObjVector = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnVector); + args.GetReturnValue().Set(instanceObjVector); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } +/************************************************************************************************************************* + Class CLib3MFConstMatNode Implementation +**************************************************************************************************************************/ + +CLib3MFConstMatNode::CLib3MFConstMatNode() + : CLib3MFBaseClass() +{ +} -void CLib3MFComposeMatrixNode::GetInputM31(const FunctionCallbackInfo& args) +CLib3MFConstMatNode::~CLib3MFConstMatNode() +{ +} + +void CLib3MFConstMatNode::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFConstMatNode")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "SetMatrix", SetMatrix); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetMatrix", GetMatrix); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputMatrix", GetOutputMatrix); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFConstMatNode::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - try { - Lib3MFHandle hReturnM31 = nullptr; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM31."); - if (wrapperTable->m_ComposeMatrixNode_GetInputM31 == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM31."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM31(instanceHandle, &hReturnM31); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjM31 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM31); - args.GetReturnValue().Set(instanceObjM31); - } catch (std::exception & E) { - RaiseError(isolate, E.what()); + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFConstMatNode * constmatnodeInstance = new CLib3MFConstMatNode(); + constmatnodeInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFConstMatNode: Invalid call to Constructor"); + } +} + +Local CLib3MFConstMatNode::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); } + return instance; } -void CLib3MFComposeMatrixNode::GetInputM32(const FunctionCallbackInfo& args) +void CLib3MFConstMatNode::SetMatrix(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnM32 = nullptr; + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected struct parameter 0 (Value)"); + } + sLib3MFMatrix4x4 sValue = convertObjectToLib3MFMatrix4x4(isolate, args[0]); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM32."); - if (wrapperTable->m_ComposeMatrixNode_GetInputM32 == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM32."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetMatrix."); + if (wrapperTable->m_ConstMatNode_SetMatrix == nullptr) + throw std::runtime_error("Could not call Lib3MF method ConstMatNode::SetMatrix."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM32(instanceHandle, &hReturnM32); + Lib3MFResult errorCode = wrapperTable->m_ConstMatNode_SetMatrix(instanceHandle, &sValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjM32 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM32); - args.GetReturnValue().Set(instanceObjM32); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15350,22 +16605,21 @@ void CLib3MFComposeMatrixNode::GetInputM32(const FunctionCallbackInfo& ar } -void CLib3MFComposeMatrixNode::GetInputM33(const FunctionCallbackInfo& args) +void CLib3MFConstMatNode::GetMatrix(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnM33 = nullptr; + sLib3MFMatrix4x4 sReturnValue; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputM33."); - if (wrapperTable->m_ComposeMatrixNode_GetInputM33 == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetInputM33."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMatrix."); + if (wrapperTable->m_ConstMatNode_GetMatrix == nullptr) + throw std::runtime_error("Could not call Lib3MF method ConstMatNode::GetMatrix."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetInputM33(instanceHandle, &hReturnM33); + Lib3MFResult errorCode = wrapperTable->m_ConstMatNode_GetMatrix(instanceHandle, &sReturnValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjM33 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnM33); - args.GetReturnValue().Set(instanceObjM33); + args.GetReturnValue().Set(convertLib3MFMatrix4x4ToObject(isolate, sReturnValue)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15373,22 +16627,22 @@ void CLib3MFComposeMatrixNode::GetInputM33(const FunctionCallbackInfo& ar } -void CLib3MFComposeMatrixNode::GetOutputResult(const FunctionCallbackInfo& args) +void CLib3MFConstMatNode::GetOutputMatrix(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnResult = nullptr; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputResult."); - if (wrapperTable->m_ComposeMatrixNode_GetOutputResult == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComposeMatrixNode::GetOutputResult."); + Lib3MFHandle hReturnMatrix = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputMatrix."); + if (wrapperTable->m_ConstMatNode_GetOutputMatrix == nullptr) + throw std::runtime_error("Could not call Lib3MF method ConstMatNode::GetOutputMatrix."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComposeMatrixNode_GetOutputResult(instanceHandle, &hReturnResult); + Lib3MFResult errorCode = wrapperTable->m_ConstMatNode_GetOutputMatrix(instanceHandle, &hReturnMatrix); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjResult = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnResult); - args.GetReturnValue().Set(instanceObjResult); + Local instanceObjMatrix = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnMatrix); + args.GetReturnValue().Set(instanceObjMatrix); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15396,53 +16650,51 @@ void CLib3MFComposeMatrixNode::GetOutputResult(const FunctionCallbackInfo } /************************************************************************************************************************* - Class CLib3MFMatrixFromRowsNode Implementation + Class CLib3MFMeshNode Implementation **************************************************************************************************************************/ -CLib3MFMatrixFromRowsNode::CLib3MFMatrixFromRowsNode() +CLib3MFMeshNode::CLib3MFMeshNode() : CLib3MFBaseClass() { } -CLib3MFMatrixFromRowsNode::~CLib3MFMatrixFromRowsNode() +CLib3MFMeshNode::~CLib3MFMeshNode() { } -void CLib3MFMatrixFromRowsNode::Init() +void CLib3MFMeshNode::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMatrixFromRowsNode")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMeshNode")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputA", GetInputA); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputB", GetInputB); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputC", GetInputC); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputD", GetInputD); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputResult", GetOutputResult); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputMesh", GetInputMesh); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputPos", GetInputPos); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputDistance", GetOutputDistance); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFMatrixFromRowsNode::New(const FunctionCallbackInfo& args) +void CLib3MFMeshNode::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFMatrixFromRowsNode * matrixfromrowsnodeInstance = new CLib3MFMatrixFromRowsNode(); - matrixfromrowsnodeInstance->Wrap(args.This()); + CLib3MFMeshNode * meshnodeInstance = new CLib3MFMeshNode(); + meshnodeInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFMatrixFromRowsNode: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFMeshNode: Invalid call to Constructor"); } } -Local CLib3MFMatrixFromRowsNode::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFMeshNode::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -15456,68 +16708,22 @@ Local CLib3MFMatrixFromRowsNode::NewInstance(Local pParent, Lib3 } -void CLib3MFMatrixFromRowsNode::GetInputA(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - Lib3MFHandle hReturnRow0 = nullptr; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputA."); - if (wrapperTable->m_MatrixFromRowsNode_GetInputA == nullptr) - throw std::runtime_error("Could not call Lib3MF method MatrixFromRowsNode::GetInputA."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MatrixFromRowsNode_GetInputA(instanceHandle, &hReturnRow0); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjRow0 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnRow0); - args.GetReturnValue().Set(instanceObjRow0); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - - -void CLib3MFMatrixFromRowsNode::GetInputB(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - Lib3MFHandle hReturnRow1 = nullptr; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputB."); - if (wrapperTable->m_MatrixFromRowsNode_GetInputB == nullptr) - throw std::runtime_error("Could not call Lib3MF method MatrixFromRowsNode::GetInputB."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MatrixFromRowsNode_GetInputB(instanceHandle, &hReturnRow1); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjRow1 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnRow1); - args.GetReturnValue().Set(instanceObjRow1); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - - -void CLib3MFMatrixFromRowsNode::GetInputC(const FunctionCallbackInfo& args) +void CLib3MFMeshNode::GetInputMesh(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnRow2 = nullptr; + Lib3MFHandle hReturnMesh = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputC."); - if (wrapperTable->m_MatrixFromRowsNode_GetInputC == nullptr) - throw std::runtime_error("Could not call Lib3MF method MatrixFromRowsNode::GetInputC."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputMesh."); + if (wrapperTable->m_MeshNode_GetInputMesh == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshNode::GetInputMesh."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MatrixFromRowsNode_GetInputC(instanceHandle, &hReturnRow2); + Lib3MFResult errorCode = wrapperTable->m_MeshNode_GetInputMesh(instanceHandle, &hReturnMesh); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjRow2 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnRow2); - args.GetReturnValue().Set(instanceObjRow2); + Local instanceObjMesh = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnMesh); + args.GetReturnValue().Set(instanceObjMesh); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15525,22 +16731,22 @@ void CLib3MFMatrixFromRowsNode::GetInputC(const FunctionCallbackInfo& arg } -void CLib3MFMatrixFromRowsNode::GetInputD(const FunctionCallbackInfo& args) +void CLib3MFMeshNode::GetInputPos(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnRow3 = nullptr; + Lib3MFHandle hReturnPos = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputD."); - if (wrapperTable->m_MatrixFromRowsNode_GetInputD == nullptr) - throw std::runtime_error("Could not call Lib3MF method MatrixFromRowsNode::GetInputD."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputPos."); + if (wrapperTable->m_MeshNode_GetInputPos == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshNode::GetInputPos."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MatrixFromRowsNode_GetInputD(instanceHandle, &hReturnRow3); + Lib3MFResult errorCode = wrapperTable->m_MeshNode_GetInputPos(instanceHandle, &hReturnPos); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjRow3 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnRow3); - args.GetReturnValue().Set(instanceObjRow3); + Local instanceObjPos = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnPos); + args.GetReturnValue().Set(instanceObjPos); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15548,22 +16754,22 @@ void CLib3MFMatrixFromRowsNode::GetInputD(const FunctionCallbackInfo& arg } -void CLib3MFMatrixFromRowsNode::GetOutputResult(const FunctionCallbackInfo& args) +void CLib3MFMeshNode::GetOutputDistance(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnResult = nullptr; + Lib3MFHandle hReturnDistance = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputResult."); - if (wrapperTable->m_MatrixFromRowsNode_GetOutputResult == nullptr) - throw std::runtime_error("Could not call Lib3MF method MatrixFromRowsNode::GetOutputResult."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputDistance."); + if (wrapperTable->m_MeshNode_GetOutputDistance == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshNode::GetOutputDistance."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MatrixFromRowsNode_GetOutputResult(instanceHandle, &hReturnResult); + Lib3MFResult errorCode = wrapperTable->m_MeshNode_GetOutputDistance(instanceHandle, &hReturnDistance); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjResult = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnResult); - args.GetReturnValue().Set(instanceObjResult); + Local instanceObjDistance = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnDistance); + args.GetReturnValue().Set(instanceObjDistance); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15571,53 +16777,51 @@ void CLib3MFMatrixFromRowsNode::GetOutputResult(const FunctionCallbackInfo tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMatrixFromColumnsNode")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFUnsignedMeshNode")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputA", GetInputA); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputB", GetInputB); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputC", GetInputC); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputD", GetInputD); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputResult", GetOutputResult); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputMesh", GetInputMesh); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputPos", GetInputPos); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputDistance", GetOutputDistance); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFMatrixFromColumnsNode::New(const FunctionCallbackInfo& args) +void CLib3MFUnsignedMeshNode::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFMatrixFromColumnsNode * matrixfromcolumnsnodeInstance = new CLib3MFMatrixFromColumnsNode(); - matrixfromcolumnsnodeInstance->Wrap(args.This()); + CLib3MFUnsignedMeshNode * unsignedmeshnodeInstance = new CLib3MFUnsignedMeshNode(); + unsignedmeshnodeInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFMatrixFromColumnsNode: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFUnsignedMeshNode: Invalid call to Constructor"); } } -Local CLib3MFMatrixFromColumnsNode::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFUnsignedMeshNode::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -15631,68 +16835,22 @@ Local CLib3MFMatrixFromColumnsNode::NewInstance(Local pParent, L } -void CLib3MFMatrixFromColumnsNode::GetInputA(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - Lib3MFHandle hReturnColumn0 = nullptr; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputA."); - if (wrapperTable->m_MatrixFromColumnsNode_GetInputA == nullptr) - throw std::runtime_error("Could not call Lib3MF method MatrixFromColumnsNode::GetInputA."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MatrixFromColumnsNode_GetInputA(instanceHandle, &hReturnColumn0); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjColumn0 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnColumn0); - args.GetReturnValue().Set(instanceObjColumn0); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - - -void CLib3MFMatrixFromColumnsNode::GetInputB(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - Lib3MFHandle hReturnColumn1 = nullptr; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputB."); - if (wrapperTable->m_MatrixFromColumnsNode_GetInputB == nullptr) - throw std::runtime_error("Could not call Lib3MF method MatrixFromColumnsNode::GetInputB."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MatrixFromColumnsNode_GetInputB(instanceHandle, &hReturnColumn1); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjColumn1 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnColumn1); - args.GetReturnValue().Set(instanceObjColumn1); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - - -void CLib3MFMatrixFromColumnsNode::GetInputC(const FunctionCallbackInfo& args) +void CLib3MFUnsignedMeshNode::GetInputMesh(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnColumn2 = nullptr; + Lib3MFHandle hReturnMesh = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputC."); - if (wrapperTable->m_MatrixFromColumnsNode_GetInputC == nullptr) - throw std::runtime_error("Could not call Lib3MF method MatrixFromColumnsNode::GetInputC."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputMesh."); + if (wrapperTable->m_UnsignedMeshNode_GetInputMesh == nullptr) + throw std::runtime_error("Could not call Lib3MF method UnsignedMeshNode::GetInputMesh."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MatrixFromColumnsNode_GetInputC(instanceHandle, &hReturnColumn2); + Lib3MFResult errorCode = wrapperTable->m_UnsignedMeshNode_GetInputMesh(instanceHandle, &hReturnMesh); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjColumn2 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnColumn2); - args.GetReturnValue().Set(instanceObjColumn2); + Local instanceObjMesh = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnMesh); + args.GetReturnValue().Set(instanceObjMesh); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15700,22 +16858,22 @@ void CLib3MFMatrixFromColumnsNode::GetInputC(const FunctionCallbackInfo& } -void CLib3MFMatrixFromColumnsNode::GetInputD(const FunctionCallbackInfo& args) +void CLib3MFUnsignedMeshNode::GetInputPos(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnColumn3 = nullptr; + Lib3MFHandle hReturnPos = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputD."); - if (wrapperTable->m_MatrixFromColumnsNode_GetInputD == nullptr) - throw std::runtime_error("Could not call Lib3MF method MatrixFromColumnsNode::GetInputD."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputPos."); + if (wrapperTable->m_UnsignedMeshNode_GetInputPos == nullptr) + throw std::runtime_error("Could not call Lib3MF method UnsignedMeshNode::GetInputPos."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MatrixFromColumnsNode_GetInputD(instanceHandle, &hReturnColumn3); + Lib3MFResult errorCode = wrapperTable->m_UnsignedMeshNode_GetInputPos(instanceHandle, &hReturnPos); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjColumn3 = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnColumn3); - args.GetReturnValue().Set(instanceObjColumn3); + Local instanceObjPos = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnPos); + args.GetReturnValue().Set(instanceObjPos); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15723,22 +16881,22 @@ void CLib3MFMatrixFromColumnsNode::GetInputD(const FunctionCallbackInfo& } -void CLib3MFMatrixFromColumnsNode::GetOutputResult(const FunctionCallbackInfo& args) +void CLib3MFUnsignedMeshNode::GetOutputDistance(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnResult = nullptr; + Lib3MFHandle hReturnDistance = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputResult."); - if (wrapperTable->m_MatrixFromColumnsNode_GetOutputResult == nullptr) - throw std::runtime_error("Could not call Lib3MF method MatrixFromColumnsNode::GetOutputResult."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputDistance."); + if (wrapperTable->m_UnsignedMeshNode_GetOutputDistance == nullptr) + throw std::runtime_error("Could not call Lib3MF method UnsignedMeshNode::GetOutputDistance."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MatrixFromColumnsNode_GetOutputResult(instanceHandle, &hReturnResult); + Lib3MFResult errorCode = wrapperTable->m_UnsignedMeshNode_GetOutputDistance(instanceHandle, &hReturnDistance); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjResult = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnResult); - args.GetReturnValue().Set(instanceObjResult); + Local instanceObjDistance = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnDistance); + args.GetReturnValue().Set(instanceObjDistance); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15746,51 +16904,53 @@ void CLib3MFMatrixFromColumnsNode::GetOutputResult(const FunctionCallbackInfo tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFConstantNode")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBeamLatticeNode")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "SetConstant", SetConstant); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetConstant", GetConstant); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputValue", GetOutputValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputBeamLattice", GetInputBeamLattice); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputPos", GetInputPos); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputDistance", GetOutputDistance); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetAccurateRange", SetAccurateRange); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetAccurateRange", GetAccurateRange); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFConstantNode::New(const FunctionCallbackInfo& args) +void CLib3MFBeamLatticeNode::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFConstantNode * constantnodeInstance = new CLib3MFConstantNode(); - constantnodeInstance->Wrap(args.This()); + CLib3MFBeamLatticeNode * beamlatticenodeInstance = new CLib3MFBeamLatticeNode(); + beamlatticenodeInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFConstantNode: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFBeamLatticeNode: Invalid call to Constructor"); } } -Local CLib3MFConstantNode::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFBeamLatticeNode::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -15804,23 +16964,22 @@ Local CLib3MFConstantNode::NewInstance(Local pParent, Lib3MFHand } -void CLib3MFConstantNode::SetConstant(const FunctionCallbackInfo& args) +void CLib3MFBeamLatticeNode::GetInputBeamLattice(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsNumber()) { - throw std::runtime_error("Expected double parameter 0 (Value)"); - } - double dValue = (double) args[0]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnBeamLattice = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetConstant."); - if (wrapperTable->m_ConstantNode_SetConstant == nullptr) - throw std::runtime_error("Could not call Lib3MF method ConstantNode::SetConstant."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputBeamLattice."); + if (wrapperTable->m_BeamLatticeNode_GetInputBeamLattice == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLatticeNode::GetInputBeamLattice."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ConstantNode_SetConstant(instanceHandle, dValue); + Lib3MFResult errorCode = wrapperTable->m_BeamLatticeNode_GetInputBeamLattice(instanceHandle, &hReturnBeamLattice); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjBeamLattice = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnBeamLattice); + args.GetReturnValue().Set(instanceObjBeamLattice); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15828,21 +16987,22 @@ void CLib3MFConstantNode::SetConstant(const FunctionCallbackInfo& args) } -void CLib3MFConstantNode::GetConstant(const FunctionCallbackInfo& args) +void CLib3MFBeamLatticeNode::GetInputPos(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - double dReturnValue = 0.0; + Lib3MFHandle hReturnPos = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetConstant."); - if (wrapperTable->m_ConstantNode_GetConstant == nullptr) - throw std::runtime_error("Could not call Lib3MF method ConstantNode::GetConstant."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputPos."); + if (wrapperTable->m_BeamLatticeNode_GetInputPos == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLatticeNode::GetInputPos."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ConstantNode_GetConstant(instanceHandle, &dReturnValue); + Lib3MFResult errorCode = wrapperTable->m_BeamLatticeNode_GetInputPos(instanceHandle, &hReturnPos); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Number::New(isolate, dReturnValue)); + Local instanceObjPos = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnPos); + args.GetReturnValue().Set(instanceObjPos); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15850,22 +17010,68 @@ void CLib3MFConstantNode::GetConstant(const FunctionCallbackInfo& args) } -void CLib3MFConstantNode::GetOutputValue(const FunctionCallbackInfo& args) +void CLib3MFBeamLatticeNode::GetOutputDistance(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnValue = nullptr; + Lib3MFHandle hReturnDistance = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputValue."); - if (wrapperTable->m_ConstantNode_GetOutputValue == nullptr) - throw std::runtime_error("Could not call Lib3MF method ConstantNode::GetOutputValue."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputDistance."); + if (wrapperTable->m_BeamLatticeNode_GetOutputDistance == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLatticeNode::GetOutputDistance."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ConstantNode_GetOutputValue(instanceHandle, &hReturnValue); + Lib3MFResult errorCode = wrapperTable->m_BeamLatticeNode_GetOutputDistance(instanceHandle, &hReturnDistance); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjValue = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnValue); - args.GetReturnValue().Set(instanceObjValue); + Local instanceObjDistance = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnDistance); + args.GetReturnValue().Set(instanceObjDistance); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFBeamLatticeNode::SetAccurateRange(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsNumber()) { + throw std::runtime_error("Expected double parameter 0 (AccurateRange)"); + } + double dAccurateRange = (double) args[0]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetAccurateRange."); + if (wrapperTable->m_BeamLatticeNode_SetAccurateRange == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLatticeNode::SetAccurateRange."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamLatticeNode_SetAccurateRange(instanceHandle, dAccurateRange); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFBeamLatticeNode::GetAccurateRange(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + double dReturnAccurateRange = 0.0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAccurateRange."); + if (wrapperTable->m_BeamLatticeNode_GetAccurateRange == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLatticeNode::GetAccurateRange."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamLatticeNode_GetAccurateRange(instanceHandle, &dReturnAccurateRange); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Number::New(isolate, dReturnAccurateRange)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15873,51 +17079,58 @@ void CLib3MFConstantNode::GetOutputValue(const FunctionCallbackInfo& args } /************************************************************************************************************************* - Class CLib3MFConstVecNode Implementation + Class CLib3MFFunctionGradientNode Implementation **************************************************************************************************************************/ -CLib3MFConstVecNode::CLib3MFConstVecNode() +CLib3MFFunctionGradientNode::CLib3MFFunctionGradientNode() : CLib3MFBaseClass() { } -CLib3MFConstVecNode::~CLib3MFConstVecNode() +CLib3MFFunctionGradientNode::~CLib3MFFunctionGradientNode() { } -void CLib3MFConstVecNode::Init() +void CLib3MFFunctionGradientNode::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFConstVecNode")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFFunctionGradientNode")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "SetVector", SetVector); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetVector", GetVector); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputVector", GetOutputVector); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputFunctionID", GetInputFunctionID); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputPos", GetInputPos); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputStep", GetInputStep); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetScalarOutputName", SetScalarOutputName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetScalarOutputName", GetScalarOutputName); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetVectorInputName", SetVectorInputName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetVectorInputName", GetVectorInputName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputNormalizedGradient", GetOutputNormalizedGradient); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputGradient", GetOutputGradient); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputMagnitude", GetOutputMagnitude); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFConstVecNode::New(const FunctionCallbackInfo& args) +void CLib3MFFunctionGradientNode::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFConstVecNode * constvecnodeInstance = new CLib3MFConstVecNode(); - constvecnodeInstance->Wrap(args.This()); + CLib3MFFunctionGradientNode * functiongradientnodeInstance = new CLib3MFFunctionGradientNode(); + functiongradientnodeInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFConstVecNode: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFFunctionGradientNode: Invalid call to Constructor"); } } -Local CLib3MFConstVecNode::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFFunctionGradientNode::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -15931,23 +17144,22 @@ Local CLib3MFConstVecNode::NewInstance(Local pParent, Lib3MFHand } -void CLib3MFConstVecNode::SetVector(const FunctionCallbackInfo& args) +void CLib3MFFunctionGradientNode::GetInputFunctionID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected struct parameter 0 (Value)"); - } - sLib3MFVector sValue = convertObjectToLib3MFVector(isolate, args[0]); + Lib3MFHandle hReturnFunction = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetVector."); - if (wrapperTable->m_ConstVecNode_SetVector == nullptr) - throw std::runtime_error("Could not call Lib3MF method ConstVecNode::SetVector."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputFunctionID."); + if (wrapperTable->m_FunctionGradientNode_GetInputFunctionID == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionGradientNode::GetInputFunctionID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ConstVecNode_SetVector(instanceHandle, &sValue); + Lib3MFResult errorCode = wrapperTable->m_FunctionGradientNode_GetInputFunctionID(instanceHandle, &hReturnFunction); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjFunction = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnFunction); + args.GetReturnValue().Set(instanceObjFunction); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15955,21 +17167,22 @@ void CLib3MFConstVecNode::SetVector(const FunctionCallbackInfo& args) } -void CLib3MFConstVecNode::GetVector(const FunctionCallbackInfo& args) +void CLib3MFFunctionGradientNode::GetInputPos(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - sLib3MFVector sReturnValue; + Lib3MFHandle hReturnPos = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetVector."); - if (wrapperTable->m_ConstVecNode_GetVector == nullptr) - throw std::runtime_error("Could not call Lib3MF method ConstVecNode::GetVector."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputPos."); + if (wrapperTable->m_FunctionGradientNode_GetInputPos == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionGradientNode::GetInputPos."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ConstVecNode_GetVector(instanceHandle, &sReturnValue); + Lib3MFResult errorCode = wrapperTable->m_FunctionGradientNode_GetInputPos(instanceHandle, &hReturnPos); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFVectorToObject(isolate, sReturnValue)); + Local instanceObjPos = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnPos); + args.GetReturnValue().Set(instanceObjPos); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -15977,104 +17190,149 @@ void CLib3MFConstVecNode::GetVector(const FunctionCallbackInfo& args) } -void CLib3MFConstVecNode::GetOutputVector(const FunctionCallbackInfo& args) +void CLib3MFFunctionGradientNode::GetInputStep(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnVector = nullptr; + Lib3MFHandle hReturnStep = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputVector."); - if (wrapperTable->m_ConstVecNode_GetOutputVector == nullptr) - throw std::runtime_error("Could not call Lib3MF method ConstVecNode::GetOutputVector."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputStep."); + if (wrapperTable->m_FunctionGradientNode_GetInputStep == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionGradientNode::GetInputStep."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ConstVecNode_GetOutputVector(instanceHandle, &hReturnVector); + Lib3MFResult errorCode = wrapperTable->m_FunctionGradientNode_GetInputStep(instanceHandle, &hReturnStep); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjVector = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnVector); - args.GetReturnValue().Set(instanceObjVector); + Local instanceObjStep = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnStep); + args.GetReturnValue().Set(instanceObjStep); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } -/************************************************************************************************************************* - Class CLib3MFConstMatNode Implementation -**************************************************************************************************************************/ -CLib3MFConstMatNode::CLib3MFConstMatNode() - : CLib3MFBaseClass() +void CLib3MFFunctionGradientNode::SetScalarOutputName(const FunctionCallbackInfo& args) { -} + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (ScalarOutputName)"); + } + v8::String::Utf8Value sutf8ScalarOutputName(isolate, args[0]); + std::string sScalarOutputName = *sutf8ScalarOutputName; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetScalarOutputName."); + if (wrapperTable->m_FunctionGradientNode_SetScalarOutputName == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionGradientNode::SetScalarOutputName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_FunctionGradientNode_SetScalarOutputName(instanceHandle, sScalarOutputName.c_str()); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); -CLib3MFConstMatNode::~CLib3MFConstMatNode() -{ + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -void CLib3MFConstMatNode::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFConstMatNode")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "SetMatrix", SetMatrix); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetMatrix", GetMatrix); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputMatrix", GetOutputMatrix); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); +void CLib3MFFunctionGradientNode::GetScalarOutputName(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int bytesNeededScalarOutputName = 0; + unsigned int bytesWrittenScalarOutputName = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetScalarOutputName."); + if (wrapperTable->m_FunctionGradientNode_GetScalarOutputName == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionGradientNode::GetScalarOutputName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_FunctionGradientNode_GetScalarOutputName(instanceHandle, 0, &bytesNeededScalarOutputName, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferScalarOutputName; + bufferScalarOutputName.resize(bytesNeededScalarOutputName); + Lib3MFResult errorCode = wrapperTable->m_FunctionGradientNode_GetScalarOutputName(instanceHandle, bytesNeededScalarOutputName, &bytesWrittenScalarOutputName, &bufferScalarOutputName[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferScalarOutputName[0])); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -void CLib3MFConstMatNode::New(const FunctionCallbackInfo& args) + +void CLib3MFFunctionGradientNode::SetVectorInputName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (VectorInputName)"); + } + v8::String::Utf8Value sutf8VectorInputName(isolate, args[0]); + std::string sVectorInputName = *sutf8VectorInputName; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetVectorInputName."); + if (wrapperTable->m_FunctionGradientNode_SetVectorInputName == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionGradientNode::SetVectorInputName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_FunctionGradientNode_SetVectorInputName(instanceHandle, sVectorInputName.c_str()); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFConstMatNode * constmatnodeInstance = new CLib3MFConstMatNode(); - constmatnodeInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFConstMatNode: Invalid call to Constructor"); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } } -Local CLib3MFConstMatNode::NewInstance(Local pParent, Lib3MFHandle pHandle) + +void CLib3MFFunctionGradientNode::GetVectorInputName(const FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + try { + unsigned int bytesNeededVectorInputName = 0; + unsigned int bytesWrittenVectorInputName = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetVectorInputName."); + if (wrapperTable->m_FunctionGradientNode_GetVectorInputName == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionGradientNode::GetVectorInputName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_FunctionGradientNode_GetVectorInputName(instanceHandle, 0, &bytesNeededVectorInputName, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferVectorInputName; + bufferVectorInputName.resize(bytesNeededVectorInputName); + Lib3MFResult errorCode = wrapperTable->m_FunctionGradientNode_GetVectorInputName(instanceHandle, bytesNeededVectorInputName, &bytesWrittenVectorInputName, &bufferVectorInputName[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferVectorInputName[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFConstMatNode::SetMatrix(const FunctionCallbackInfo& args) +void CLib3MFFunctionGradientNode::GetOutputNormalizedGradient(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected struct parameter 0 (Value)"); - } - sLib3MFMatrix4x4 sValue = convertObjectToLib3MFMatrix4x4(isolate, args[0]); + Lib3MFHandle hReturnNormalizedGradient = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetMatrix."); - if (wrapperTable->m_ConstMatNode_SetMatrix == nullptr) - throw std::runtime_error("Could not call Lib3MF method ConstMatNode::SetMatrix."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputNormalizedGradient."); + if (wrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionGradientNode::GetOutputNormalizedGradient."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ConstMatNode_SetMatrix(instanceHandle, &sValue); + Lib3MFResult errorCode = wrapperTable->m_FunctionGradientNode_GetOutputNormalizedGradient(instanceHandle, &hReturnNormalizedGradient); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjNormalizedGradient = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnNormalizedGradient); + args.GetReturnValue().Set(instanceObjNormalizedGradient); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -16082,21 +17340,22 @@ void CLib3MFConstMatNode::SetMatrix(const FunctionCallbackInfo& args) } -void CLib3MFConstMatNode::GetMatrix(const FunctionCallbackInfo& args) +void CLib3MFFunctionGradientNode::GetOutputGradient(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - sLib3MFMatrix4x4 sReturnValue; + Lib3MFHandle hReturnGradient = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMatrix."); - if (wrapperTable->m_ConstMatNode_GetMatrix == nullptr) - throw std::runtime_error("Could not call Lib3MF method ConstMatNode::GetMatrix."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputGradient."); + if (wrapperTable->m_FunctionGradientNode_GetOutputGradient == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionGradientNode::GetOutputGradient."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ConstMatNode_GetMatrix(instanceHandle, &sReturnValue); + Lib3MFResult errorCode = wrapperTable->m_FunctionGradientNode_GetOutputGradient(instanceHandle, &hReturnGradient); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFMatrix4x4ToObject(isolate, sReturnValue)); + Local instanceObjGradient = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnGradient); + args.GetReturnValue().Set(instanceObjGradient); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -16104,22 +17363,22 @@ void CLib3MFConstMatNode::GetMatrix(const FunctionCallbackInfo& args) } -void CLib3MFConstMatNode::GetOutputMatrix(const FunctionCallbackInfo& args) +void CLib3MFFunctionGradientNode::GetOutputMagnitude(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnMatrix = nullptr; + Lib3MFHandle hReturnMagnitude = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputMatrix."); - if (wrapperTable->m_ConstMatNode_GetOutputMatrix == nullptr) - throw std::runtime_error("Could not call Lib3MF method ConstMatNode::GetOutputMatrix."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputMagnitude."); + if (wrapperTable->m_FunctionGradientNode_GetOutputMagnitude == nullptr) + throw std::runtime_error("Could not call Lib3MF method FunctionGradientNode::GetOutputMagnitude."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ConstMatNode_GetOutputMatrix(instanceHandle, &hReturnMatrix); + Lib3MFResult errorCode = wrapperTable->m_FunctionGradientNode_GetOutputMagnitude(instanceHandle, &hReturnMagnitude); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjMatrix = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnMatrix); - args.GetReturnValue().Set(instanceObjMatrix); + Local instanceObjMagnitude = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnMagnitude); + args.GetReturnValue().Set(instanceObjMagnitude); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -16127,51 +17386,56 @@ void CLib3MFConstMatNode::GetOutputMatrix(const FunctionCallbackInfo& arg } /************************************************************************************************************************* - Class CLib3MFMeshNode Implementation + Class CLib3MFNormalizeDistanceNode Implementation **************************************************************************************************************************/ -CLib3MFMeshNode::CLib3MFMeshNode() +CLib3MFNormalizeDistanceNode::CLib3MFNormalizeDistanceNode() : CLib3MFBaseClass() { } -CLib3MFMeshNode::~CLib3MFMeshNode() +CLib3MFNormalizeDistanceNode::~CLib3MFNormalizeDistanceNode() { } -void CLib3MFMeshNode::Init() +void CLib3MFNormalizeDistanceNode::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMeshNode")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFNormalizeDistanceNode")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputMesh", GetInputMesh); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputFunctionID", GetInputFunctionID); NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputPos", GetInputPos); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputDistance", GetOutputDistance); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputStep", GetInputStep); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetScalarOutputName", SetScalarOutputName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetScalarOutputName", GetScalarOutputName); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetVectorInputName", SetVectorInputName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetVectorInputName", GetVectorInputName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputResult", GetOutputResult); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFMeshNode::New(const FunctionCallbackInfo& args) +void CLib3MFNormalizeDistanceNode::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFMeshNode * meshnodeInstance = new CLib3MFMeshNode(); - meshnodeInstance->Wrap(args.This()); + CLib3MFNormalizeDistanceNode * normalizedistancenodeInstance = new CLib3MFNormalizeDistanceNode(); + normalizedistancenodeInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFMeshNode: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFNormalizeDistanceNode: Invalid call to Constructor"); } } -Local CLib3MFMeshNode::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFNormalizeDistanceNode::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -16185,22 +17449,22 @@ Local CLib3MFMeshNode::NewInstance(Local pParent, Lib3MFHandle p } -void CLib3MFMeshNode::GetInputMesh(const FunctionCallbackInfo& args) +void CLib3MFNormalizeDistanceNode::GetInputFunctionID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnMesh = nullptr; + Lib3MFHandle hReturnFunction = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputMesh."); - if (wrapperTable->m_MeshNode_GetInputMesh == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshNode::GetInputMesh."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputFunctionID."); + if (wrapperTable->m_NormalizeDistanceNode_GetInputFunctionID == nullptr) + throw std::runtime_error("Could not call Lib3MF method NormalizeDistanceNode::GetInputFunctionID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshNode_GetInputMesh(instanceHandle, &hReturnMesh); + Lib3MFResult errorCode = wrapperTable->m_NormalizeDistanceNode_GetInputFunctionID(instanceHandle, &hReturnFunction); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjMesh = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnMesh); - args.GetReturnValue().Set(instanceObjMesh); + Local instanceObjFunction = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnFunction); + args.GetReturnValue().Set(instanceObjFunction); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -16208,7 +17472,7 @@ void CLib3MFMeshNode::GetInputMesh(const FunctionCallbackInfo& args) } -void CLib3MFMeshNode::GetInputPos(const FunctionCallbackInfo& args) +void CLib3MFNormalizeDistanceNode::GetInputPos(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); @@ -16217,10 +17481,10 @@ void CLib3MFMeshNode::GetInputPos(const FunctionCallbackInfo& args) sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputPos."); - if (wrapperTable->m_MeshNode_GetInputPos == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshNode::GetInputPos."); + if (wrapperTable->m_NormalizeDistanceNode_GetInputPos == nullptr) + throw std::runtime_error("Could not call Lib3MF method NormalizeDistanceNode::GetInputPos."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshNode_GetInputPos(instanceHandle, &hReturnPos); + Lib3MFResult errorCode = wrapperTable->m_NormalizeDistanceNode_GetInputPos(instanceHandle, &hReturnPos); CheckError(isolate, wrapperTable, instanceHandle, errorCode); Local instanceObjPos = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnPos); args.GetReturnValue().Set(instanceObjPos); @@ -16231,103 +17495,99 @@ void CLib3MFMeshNode::GetInputPos(const FunctionCallbackInfo& args) } -void CLib3MFMeshNode::GetOutputDistance(const FunctionCallbackInfo& args) +void CLib3MFNormalizeDistanceNode::GetInputStep(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnDistance = nullptr; + Lib3MFHandle hReturnStep = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputDistance."); - if (wrapperTable->m_MeshNode_GetOutputDistance == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshNode::GetOutputDistance."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputStep."); + if (wrapperTable->m_NormalizeDistanceNode_GetInputStep == nullptr) + throw std::runtime_error("Could not call Lib3MF method NormalizeDistanceNode::GetInputStep."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshNode_GetOutputDistance(instanceHandle, &hReturnDistance); + Lib3MFResult errorCode = wrapperTable->m_NormalizeDistanceNode_GetInputStep(instanceHandle, &hReturnStep); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjDistance = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnDistance); - args.GetReturnValue().Set(instanceObjDistance); + Local instanceObjStep = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnStep); + args.GetReturnValue().Set(instanceObjStep); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } -/************************************************************************************************************************* - Class CLib3MFUnsignedMeshNode Implementation -**************************************************************************************************************************/ - -CLib3MFUnsignedMeshNode::CLib3MFUnsignedMeshNode() - : CLib3MFBaseClass() -{ -} - -CLib3MFUnsignedMeshNode::~CLib3MFUnsignedMeshNode() -{ -} - -void CLib3MFUnsignedMeshNode::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFUnsignedMeshNode")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputMesh", GetInputMesh); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetInputPos", GetInputPos); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutputDistance", GetOutputDistance); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - -} -void CLib3MFUnsignedMeshNode::New(const FunctionCallbackInfo& args) +void CLib3MFNormalizeDistanceNode::SetScalarOutputName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (ScalarOutputName)"); + } + v8::String::Utf8Value sutf8ScalarOutputName(isolate, args[0]); + std::string sScalarOutputName = *sutf8ScalarOutputName; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetScalarOutputName."); + if (wrapperTable->m_NormalizeDistanceNode_SetScalarOutputName == nullptr) + throw std::runtime_error("Could not call Lib3MF method NormalizeDistanceNode::SetScalarOutputName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_NormalizeDistanceNode_SetScalarOutputName(instanceHandle, sScalarOutputName.c_str()); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFUnsignedMeshNode * unsignedmeshnodeInstance = new CLib3MFUnsignedMeshNode(); - unsignedmeshnodeInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFUnsignedMeshNode: Invalid call to Constructor"); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } } -Local CLib3MFUnsignedMeshNode::NewInstance(Local pParent, Lib3MFHandle pHandle) + +void CLib3MFNormalizeDistanceNode::GetScalarOutputName(const FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + try { + unsigned int bytesNeededScalarOutputName = 0; + unsigned int bytesWrittenScalarOutputName = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetScalarOutputName."); + if (wrapperTable->m_NormalizeDistanceNode_GetScalarOutputName == nullptr) + throw std::runtime_error("Could not call Lib3MF method NormalizeDistanceNode::GetScalarOutputName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_NormalizeDistanceNode_GetScalarOutputName(instanceHandle, 0, &bytesNeededScalarOutputName, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferScalarOutputName; + bufferScalarOutputName.resize(bytesNeededScalarOutputName); + Lib3MFResult errorCode = wrapperTable->m_NormalizeDistanceNode_GetScalarOutputName(instanceHandle, bytesNeededScalarOutputName, &bytesWrittenScalarOutputName, &bufferScalarOutputName[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferScalarOutputName[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFUnsignedMeshNode::GetInputMesh(const FunctionCallbackInfo& args) +void CLib3MFNormalizeDistanceNode::SetVectorInputName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnMesh = nullptr; + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (VectorInputName)"); + } + v8::String::Utf8Value sutf8VectorInputName(isolate, args[0]); + std::string sVectorInputName = *sutf8VectorInputName; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputMesh."); - if (wrapperTable->m_UnsignedMeshNode_GetInputMesh == nullptr) - throw std::runtime_error("Could not call Lib3MF method UnsignedMeshNode::GetInputMesh."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetVectorInputName."); + if (wrapperTable->m_NormalizeDistanceNode_SetVectorInputName == nullptr) + throw std::runtime_error("Could not call Lib3MF method NormalizeDistanceNode::SetVectorInputName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_UnsignedMeshNode_GetInputMesh(instanceHandle, &hReturnMesh); + Lib3MFResult errorCode = wrapperTable->m_NormalizeDistanceNode_SetVectorInputName(instanceHandle, sVectorInputName.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjMesh = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnMesh); - args.GetReturnValue().Set(instanceObjMesh); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -16335,22 +17595,26 @@ void CLib3MFUnsignedMeshNode::GetInputMesh(const FunctionCallbackInfo& ar } -void CLib3MFUnsignedMeshNode::GetInputPos(const FunctionCallbackInfo& args) +void CLib3MFNormalizeDistanceNode::GetVectorInputName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnPos = nullptr; + unsigned int bytesNeededVectorInputName = 0; + unsigned int bytesWrittenVectorInputName = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetInputPos."); - if (wrapperTable->m_UnsignedMeshNode_GetInputPos == nullptr) - throw std::runtime_error("Could not call Lib3MF method UnsignedMeshNode::GetInputPos."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetVectorInputName."); + if (wrapperTable->m_NormalizeDistanceNode_GetVectorInputName == nullptr) + throw std::runtime_error("Could not call Lib3MF method NormalizeDistanceNode::GetVectorInputName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_UnsignedMeshNode_GetInputPos(instanceHandle, &hReturnPos); + Lib3MFResult initErrorCode = wrapperTable->m_NormalizeDistanceNode_GetVectorInputName(instanceHandle, 0, &bytesNeededVectorInputName, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferVectorInputName; + bufferVectorInputName.resize(bytesNeededVectorInputName); + Lib3MFResult errorCode = wrapperTable->m_NormalizeDistanceNode_GetVectorInputName(instanceHandle, bytesNeededVectorInputName, &bytesWrittenVectorInputName, &bufferVectorInputName[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjPos = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnPos); - args.GetReturnValue().Set(instanceObjPos); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferVectorInputName[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -16358,22 +17622,22 @@ void CLib3MFUnsignedMeshNode::GetInputPos(const FunctionCallbackInfo& arg } -void CLib3MFUnsignedMeshNode::GetOutputDistance(const FunctionCallbackInfo& args) +void CLib3MFNormalizeDistanceNode::GetOutputResult(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnDistance = nullptr; + Lib3MFHandle hReturnResult = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputDistance."); - if (wrapperTable->m_UnsignedMeshNode_GetOutputDistance == nullptr) - throw std::runtime_error("Could not call Lib3MF method UnsignedMeshNode::GetOutputDistance."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutputResult."); + if (wrapperTable->m_NormalizeDistanceNode_GetOutputResult == nullptr) + throw std::runtime_error("Could not call Lib3MF method NormalizeDistanceNode::GetOutputResult."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_UnsignedMeshNode_GetOutputDistance(instanceHandle, &hReturnDistance); + Lib3MFResult errorCode = wrapperTable->m_NormalizeDistanceNode_GetOutputResult(instanceHandle, &hReturnResult); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjDistance = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnDistance); - args.GetReturnValue().Set(instanceObjDistance); + Local instanceObjResult = CLib3MFImplicitPort::NewInstance(args.Holder(), hReturnResult); + args.GetReturnValue().Set(instanceObjResult); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -16961,6 +18225,9 @@ void CLib3MFImplicitFunction::Init() NODE_SET_PROTOTYPE_METHOD(tpl, "AddConstMatNode", AddConstMatNode); NODE_SET_PROTOTYPE_METHOD(tpl, "AddMeshNode", AddMeshNode); NODE_SET_PROTOTYPE_METHOD(tpl, "AddUnsignedMeshNode", AddUnsignedMeshNode); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddBeamLatticeNode", AddBeamLatticeNode); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddFunctionGradientNode", AddFunctionGradientNode); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddNormalizeDistanceNode", AddNormalizeDistanceNode); NODE_SET_PROTOTYPE_METHOD(tpl, "AddFunctionCallNode", AddFunctionCallNode); NODE_SET_PROTOTYPE_METHOD(tpl, "GetNodes", GetNodes); NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveNode", RemoveNode); @@ -19047,6 +20314,120 @@ void CLib3MFImplicitFunction::AddUnsignedMeshNode(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Identifier)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (DisplayName)"); + } + if (!args[2]->IsString()) { + throw std::runtime_error("Expected string parameter 2 (Tag)"); + } + v8::String::Utf8Value sutf8Identifier(isolate, args[0]); + std::string sIdentifier = *sutf8Identifier; + v8::String::Utf8Value sutf8DisplayName(isolate, args[1]); + std::string sDisplayName = *sutf8DisplayName; + v8::String::Utf8Value sutf8Tag(isolate, args[2]); + std::string sTag = *sutf8Tag; + Lib3MFHandle hReturnNode = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddBeamLatticeNode."); + if (wrapperTable->m_ImplicitFunction_AddBeamLatticeNode == nullptr) + throw std::runtime_error("Could not call Lib3MF method ImplicitFunction::AddBeamLatticeNode."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ImplicitFunction_AddBeamLatticeNode(instanceHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hReturnNode); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjNode = CLib3MFBeamLatticeNode::NewInstance(args.Holder(), hReturnNode); + args.GetReturnValue().Set(instanceObjNode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFImplicitFunction::AddFunctionGradientNode(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Identifier)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (DisplayName)"); + } + if (!args[2]->IsString()) { + throw std::runtime_error("Expected string parameter 2 (Tag)"); + } + v8::String::Utf8Value sutf8Identifier(isolate, args[0]); + std::string sIdentifier = *sutf8Identifier; + v8::String::Utf8Value sutf8DisplayName(isolate, args[1]); + std::string sDisplayName = *sutf8DisplayName; + v8::String::Utf8Value sutf8Tag(isolate, args[2]); + std::string sTag = *sutf8Tag; + Lib3MFHandle hReturnNode = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddFunctionGradientNode."); + if (wrapperTable->m_ImplicitFunction_AddFunctionGradientNode == nullptr) + throw std::runtime_error("Could not call Lib3MF method ImplicitFunction::AddFunctionGradientNode."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ImplicitFunction_AddFunctionGradientNode(instanceHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hReturnNode); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjNode = CLib3MFFunctionGradientNode::NewInstance(args.Holder(), hReturnNode); + args.GetReturnValue().Set(instanceObjNode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFImplicitFunction::AddNormalizeDistanceNode(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Identifier)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (DisplayName)"); + } + if (!args[2]->IsString()) { + throw std::runtime_error("Expected string parameter 2 (Tag)"); + } + v8::String::Utf8Value sutf8Identifier(isolate, args[0]); + std::string sIdentifier = *sutf8Identifier; + v8::String::Utf8Value sutf8DisplayName(isolate, args[1]); + std::string sDisplayName = *sutf8DisplayName; + v8::String::Utf8Value sutf8Tag(isolate, args[2]); + std::string sTag = *sutf8Tag; + Lib3MFHandle hReturnNode = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddNormalizeDistanceNode."); + if (wrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode == nullptr) + throw std::runtime_error("Could not call Lib3MF method ImplicitFunction::AddNormalizeDistanceNode."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ImplicitFunction_AddNormalizeDistanceNode(instanceHandle, sIdentifier.c_str(), sDisplayName.c_str(), sTag.c_str(), &hReturnNode); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjNode = CLib3MFNormalizeDistanceNode::NewInstance(args.Holder(), hReturnNode); + args.GetReturnValue().Set(instanceObjNode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + void CLib3MFImplicitFunction::AddFunctionCallNode(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); @@ -22105,6 +23486,7 @@ void CLib3MFModel::Init() NODE_SET_PROTOTYPE_METHOD(tpl, "GetMultiPropertyGroupByID", GetMultiPropertyGroupByID); NODE_SET_PROTOTYPE_METHOD(tpl, "GetMeshObjectByID", GetMeshObjectByID); NODE_SET_PROTOTYPE_METHOD(tpl, "GetComponentsObjectByID", GetComponentsObjectByID); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBooleanObjectByID", GetBooleanObjectByID); NODE_SET_PROTOTYPE_METHOD(tpl, "GetColorGroupByID", GetColorGroupByID); NODE_SET_PROTOTYPE_METHOD(tpl, "GetSliceStackByID", GetSliceStackByID); NODE_SET_PROTOTYPE_METHOD(tpl, "GetLevelSetByID", GetLevelSetByID); @@ -22116,6 +23498,7 @@ void CLib3MFModel::Init() NODE_SET_PROTOTYPE_METHOD(tpl, "GetObjects", GetObjects); NODE_SET_PROTOTYPE_METHOD(tpl, "GetMeshObjects", GetMeshObjects); NODE_SET_PROTOTYPE_METHOD(tpl, "GetComponentsObjects", GetComponentsObjects); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBooleanObjects", GetBooleanObjects); NODE_SET_PROTOTYPE_METHOD(tpl, "GetTexture2Ds", GetTexture2Ds); NODE_SET_PROTOTYPE_METHOD(tpl, "GetBaseMaterialGroups", GetBaseMaterialGroups); NODE_SET_PROTOTYPE_METHOD(tpl, "GetColorGroups", GetColorGroups); @@ -22128,6 +23511,7 @@ void CLib3MFModel::Init() NODE_SET_PROTOTYPE_METHOD(tpl, "MergeFromModel", MergeFromModel); NODE_SET_PROTOTYPE_METHOD(tpl, "AddMeshObject", AddMeshObject); NODE_SET_PROTOTYPE_METHOD(tpl, "AddComponentsObject", AddComponentsObject); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddBooleanObject", AddBooleanObject); NODE_SET_PROTOTYPE_METHOD(tpl, "AddSliceStack", AddSliceStack); NODE_SET_PROTOTYPE_METHOD(tpl, "AddTexture2DFromAttachment", AddTexture2DFromAttachment); NODE_SET_PROTOTYPE_METHOD(tpl, "AddBaseMaterialGroup", AddBaseMaterialGroup); @@ -22640,6 +24024,33 @@ void CLib3MFModel::GetComponentsObjectByID(const FunctionCallbackInfo& ar } +void CLib3MFModel::GetBooleanObjectByID(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (UniqueResourceID)"); + } + unsigned int nUniqueResourceID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnBooleanObjectInstance = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBooleanObjectByID."); + if (wrapperTable->m_Model_GetBooleanObjectByID == nullptr) + throw std::runtime_error("Could not call Lib3MF method Model::GetBooleanObjectByID."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Model_GetBooleanObjectByID(instanceHandle, nUniqueResourceID, &hReturnBooleanObjectInstance); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjBooleanObjectInstance = CLib3MFBooleanObject::NewInstance(args.Holder(), hReturnBooleanObjectInstance); + args.GetReturnValue().Set(instanceObjBooleanObjectInstance); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + void CLib3MFModel::GetColorGroupByID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); @@ -22914,6 +24325,29 @@ void CLib3MFModel::GetComponentsObjects(const FunctionCallbackInfo& args) } +void CLib3MFModel::GetBooleanObjects(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnResourceIterator = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBooleanObjects."); + if (wrapperTable->m_Model_GetBooleanObjects == nullptr) + throw std::runtime_error("Could not call Lib3MF method Model::GetBooleanObjects."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Model_GetBooleanObjects(instanceHandle, &hReturnResourceIterator); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjResourceIterator = CLib3MFBooleanObjectIterator::NewInstance(args.Holder(), hReturnResourceIterator); + args.GetReturnValue().Set(instanceObjResourceIterator); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + void CLib3MFModel::GetTexture2Ds(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); @@ -23195,6 +24629,29 @@ void CLib3MFModel::AddComponentsObject(const FunctionCallbackInfo& args) } +void CLib3MFModel::AddBooleanObject(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnBooleanObjectInstance = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddBooleanObject."); + if (wrapperTable->m_Model_AddBooleanObject == nullptr) + throw std::runtime_error("Could not call Lib3MF method Model::AddBooleanObject."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Model_AddBooleanObject(instanceHandle, &hReturnBooleanObjectInstance); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjBooleanObjectInstance = CLib3MFBooleanObject::NewInstance(args.Holder(), hReturnBooleanObjectInstance); + args.GetReturnValue().Set(instanceObjBooleanObjectInstance); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + void CLib3MFModel::AddSliceStack(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); @@ -24124,6 +25581,10 @@ void CLib3MFWrapper::New(const FunctionCallbackInfo& args) newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eObjectType_Model"), Integer::New(isolate, 1)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eObjectType_Support"), Integer::New(isolate, 2)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eObjectType_SolidSupport"), Integer::New(isolate, 3)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eObjectType_Surface"), Integer::New(isolate, 4)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eBooleanOperation_Union"), Integer::New(isolate, 0)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eBooleanOperation_Difference"), Integer::New(isolate, 1)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eBooleanOperation_Intersection"), Integer::New(isolate, 2)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eTextureType_Unknown"), Integer::New(isolate, 0)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eTextureType_PNG"), Integer::New(isolate, 1)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eTextureType_JPEG"), Integer::New(isolate, 2)); @@ -24232,6 +25693,9 @@ void CLib3MFWrapper::New(const FunctionCallbackInfo& args) newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eImplicitNodeType_VectorFromScalar"), Integer::New(isolate, 48)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eImplicitNodeType_UnsignedMesh"), Integer::New(isolate, 49)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eImplicitNodeType_Mod"), Integer::New(isolate, 50)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eImplicitNodeType_BeamLattice"), Integer::New(isolate, 51)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eImplicitNodeType_FunctionGradient"), Integer::New(isolate, 52)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eImplicitNodeType_NormalizeDistance"), Integer::New(isolate, 53)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eImplicitPortType_Scalar"), Integer::New(isolate, 0)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eImplicitPortType_Vector"), Integer::New(isolate, 1)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eImplicitPortType_Matrix"), Integer::New(isolate, 2)); diff --git a/Autogenerated/Bindings/NodeJS/lib3mf_nodewrapper.h b/Autogenerated/Bindings/NodeJS/lib3mf_nodewrapper.h index bcd313abf..93f627435 100644 --- a/Autogenerated/Bindings/NodeJS/lib3mf_nodewrapper.h +++ b/Autogenerated/Bindings/NodeJS/lib3mf_nodewrapper.h @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++ Header file for the Node wrapper class of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -281,6 +281,24 @@ class CLib3MFComponentsObjectIterator : public CLib3MFBaseClass { }; +/************************************************************************************************************************* + Class CLib3MFBooleanObjectIterator +**************************************************************************************************************************/ +class CLib3MFBooleanObjectIterator : public CLib3MFBaseClass { +private: + static void New(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + static void GetCurrentBooleanObject(const v8::FunctionCallbackInfo& args); + +public: + CLib3MFBooleanObjectIterator(); + ~CLib3MFBooleanObjectIterator(); + + static void Init(); + static v8::Local NewInstance(v8::Local, Lib3MFHandle pHandle); + +}; + /************************************************************************************************************************* Class CLib3MFTexture2DIterator **************************************************************************************************************************/ @@ -540,6 +558,7 @@ class CLib3MFObject : public CLib3MFBaseClass { static void IsMeshObject(const v8::FunctionCallbackInfo& args); static void IsComponentsObject(const v8::FunctionCallbackInfo& args); static void IsLevelSetObject(const v8::FunctionCallbackInfo& args); + static void IsBooleanObject(const v8::FunctionCallbackInfo& args); static void IsValid(const v8::FunctionCallbackInfo& args); static void SetAttachmentAsThumbnail(const v8::FunctionCallbackInfo& args); static void GetThumbnailAttachment(const v8::FunctionCallbackInfo& args); @@ -641,6 +660,37 @@ class CLib3MFLevelSet : public CLib3MFBaseClass { }; +/************************************************************************************************************************* + Class CLib3MFBooleanObject +**************************************************************************************************************************/ +class CLib3MFBooleanObject : public CLib3MFBaseClass { +private: + static void New(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + static void SetBaseObject(const v8::FunctionCallbackInfo& args); + static void GetBaseObject(const v8::FunctionCallbackInfo& args); + static void SetBaseTransform(const v8::FunctionCallbackInfo& args); + static void GetBaseTransform(const v8::FunctionCallbackInfo& args); + static void SetOperation(const v8::FunctionCallbackInfo& args); + static void GetOperation(const v8::FunctionCallbackInfo& args); + static void SetCSGModeEnabled(const v8::FunctionCallbackInfo& args); + static void GetCSGModeEnabled(const v8::FunctionCallbackInfo& args); + static void SetExtractionGridResolution(const v8::FunctionCallbackInfo& args); + static void GetExtractionGridResolution(const v8::FunctionCallbackInfo& args); + static void GetOperandCount(const v8::FunctionCallbackInfo& args); + static void AddOperand(const v8::FunctionCallbackInfo& args); + static void GetOperand(const v8::FunctionCallbackInfo& args); + static void MergeToMeshObject(const v8::FunctionCallbackInfo& args); + +public: + CLib3MFBooleanObject(); + ~CLib3MFBooleanObject(); + + static void Init(); + static v8::Local NewInstance(v8::Local, Lib3MFHandle pHandle); + +}; + /************************************************************************************************************************* Class CLib3MFBeamLattice **************************************************************************************************************************/ @@ -2143,6 +2193,80 @@ class CLib3MFUnsignedMeshNode : public CLib3MFBaseClass { }; +/************************************************************************************************************************* + Class CLib3MFBeamLatticeNode +**************************************************************************************************************************/ +class CLib3MFBeamLatticeNode : public CLib3MFBaseClass { +private: + static void New(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + static void GetInputBeamLattice(const v8::FunctionCallbackInfo& args); + static void GetInputPos(const v8::FunctionCallbackInfo& args); + static void GetOutputDistance(const v8::FunctionCallbackInfo& args); + static void SetAccurateRange(const v8::FunctionCallbackInfo& args); + static void GetAccurateRange(const v8::FunctionCallbackInfo& args); + +public: + CLib3MFBeamLatticeNode(); + ~CLib3MFBeamLatticeNode(); + + static void Init(); + static v8::Local NewInstance(v8::Local, Lib3MFHandle pHandle); + +}; + +/************************************************************************************************************************* + Class CLib3MFFunctionGradientNode +**************************************************************************************************************************/ +class CLib3MFFunctionGradientNode : public CLib3MFBaseClass { +private: + static void New(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + static void GetInputFunctionID(const v8::FunctionCallbackInfo& args); + static void GetInputPos(const v8::FunctionCallbackInfo& args); + static void GetInputStep(const v8::FunctionCallbackInfo& args); + static void SetScalarOutputName(const v8::FunctionCallbackInfo& args); + static void GetScalarOutputName(const v8::FunctionCallbackInfo& args); + static void SetVectorInputName(const v8::FunctionCallbackInfo& args); + static void GetVectorInputName(const v8::FunctionCallbackInfo& args); + static void GetOutputNormalizedGradient(const v8::FunctionCallbackInfo& args); + static void GetOutputGradient(const v8::FunctionCallbackInfo& args); + static void GetOutputMagnitude(const v8::FunctionCallbackInfo& args); + +public: + CLib3MFFunctionGradientNode(); + ~CLib3MFFunctionGradientNode(); + + static void Init(); + static v8::Local NewInstance(v8::Local, Lib3MFHandle pHandle); + +}; + +/************************************************************************************************************************* + Class CLib3MFNormalizeDistanceNode +**************************************************************************************************************************/ +class CLib3MFNormalizeDistanceNode : public CLib3MFBaseClass { +private: + static void New(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + static void GetInputFunctionID(const v8::FunctionCallbackInfo& args); + static void GetInputPos(const v8::FunctionCallbackInfo& args); + static void GetInputStep(const v8::FunctionCallbackInfo& args); + static void SetScalarOutputName(const v8::FunctionCallbackInfo& args); + static void GetScalarOutputName(const v8::FunctionCallbackInfo& args); + static void SetVectorInputName(const v8::FunctionCallbackInfo& args); + static void GetVectorInputName(const v8::FunctionCallbackInfo& args); + static void GetOutputResult(const v8::FunctionCallbackInfo& args); + +public: + CLib3MFNormalizeDistanceNode(); + ~CLib3MFNormalizeDistanceNode(); + + static void Init(); + static v8::Local NewInstance(v8::Local, Lib3MFHandle pHandle); + +}; + /************************************************************************************************************************* Class CLib3MFFunctionCallNode **************************************************************************************************************************/ @@ -2264,6 +2388,9 @@ class CLib3MFImplicitFunction : public CLib3MFBaseClass { static void AddConstMatNode(const v8::FunctionCallbackInfo& args); static void AddMeshNode(const v8::FunctionCallbackInfo& args); static void AddUnsignedMeshNode(const v8::FunctionCallbackInfo& args); + static void AddBeamLatticeNode(const v8::FunctionCallbackInfo& args); + static void AddFunctionGradientNode(const v8::FunctionCallbackInfo& args); + static void AddNormalizeDistanceNode(const v8::FunctionCallbackInfo& args); static void AddFunctionCallNode(const v8::FunctionCallbackInfo& args); static void GetNodes(const v8::FunctionCallbackInfo& args); static void RemoveNode(const v8::FunctionCallbackInfo& args); @@ -2577,6 +2704,7 @@ class CLib3MFModel : public CLib3MFBaseClass { static void GetMultiPropertyGroupByID(const v8::FunctionCallbackInfo& args); static void GetMeshObjectByID(const v8::FunctionCallbackInfo& args); static void GetComponentsObjectByID(const v8::FunctionCallbackInfo& args); + static void GetBooleanObjectByID(const v8::FunctionCallbackInfo& args); static void GetColorGroupByID(const v8::FunctionCallbackInfo& args); static void GetSliceStackByID(const v8::FunctionCallbackInfo& args); static void GetLevelSetByID(const v8::FunctionCallbackInfo& args); @@ -2588,6 +2716,7 @@ class CLib3MFModel : public CLib3MFBaseClass { static void GetObjects(const v8::FunctionCallbackInfo& args); static void GetMeshObjects(const v8::FunctionCallbackInfo& args); static void GetComponentsObjects(const v8::FunctionCallbackInfo& args); + static void GetBooleanObjects(const v8::FunctionCallbackInfo& args); static void GetTexture2Ds(const v8::FunctionCallbackInfo& args); static void GetBaseMaterialGroups(const v8::FunctionCallbackInfo& args); static void GetColorGroups(const v8::FunctionCallbackInfo& args); @@ -2600,6 +2729,7 @@ class CLib3MFModel : public CLib3MFBaseClass { static void MergeFromModel(const v8::FunctionCallbackInfo& args); static void AddMeshObject(const v8::FunctionCallbackInfo& args); static void AddComponentsObject(const v8::FunctionCallbackInfo& args); + static void AddBooleanObject(const v8::FunctionCallbackInfo& args); static void AddSliceStack(const v8::FunctionCallbackInfo& args); static void AddTexture2DFromAttachment(const v8::FunctionCallbackInfo& args); static void AddBaseMaterialGroup(const v8::FunctionCallbackInfo& args); diff --git a/Autogenerated/Bindings/NodeJS/lib3mf_types.h b/Autogenerated/Bindings/NodeJS/lib3mf_types.h index 5df0da2fd..b9e4aec27 100644 --- a/Autogenerated/Bindings/NodeJS/lib3mf_types.h +++ b/Autogenerated/Bindings/NodeJS/lib3mf_types.h @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated plain C Header file with basic types in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -84,7 +84,7 @@ typedef void * Lib3MF_pvoid; **************************************************************************************************************************/ #define LIB3MF_VERSION_MAJOR 2 -#define LIB3MF_VERSION_MINOR 4 +#define LIB3MF_VERSION_MINOR 6 #define LIB3MF_VERSION_MICRO 0 #define LIB3MF_VERSION_PRERELEASEINFO "" #define LIB3MF_VERSION_BUILDINFO "" @@ -220,6 +220,7 @@ typedef Lib3MFHandle Lib3MF_SliceStackIterator; typedef Lib3MFHandle Lib3MF_ObjectIterator; typedef Lib3MFHandle Lib3MF_MeshObjectIterator; typedef Lib3MFHandle Lib3MF_ComponentsObjectIterator; +typedef Lib3MFHandle Lib3MF_BooleanObjectIterator; typedef Lib3MFHandle Lib3MF_Texture2DIterator; typedef Lib3MFHandle Lib3MF_BaseMaterialGroupIterator; typedef Lib3MFHandle Lib3MF_ColorGroupIterator; @@ -235,6 +236,7 @@ typedef Lib3MFHandle Lib3MF_TriangleSet; typedef Lib3MFHandle Lib3MF_Object; typedef Lib3MFHandle Lib3MF_MeshObject; typedef Lib3MFHandle Lib3MF_LevelSet; +typedef Lib3MFHandle Lib3MF_BooleanObject; typedef Lib3MFHandle Lib3MF_BeamLattice; typedef Lib3MFHandle Lib3MF_FunctionReference; typedef Lib3MFHandle Lib3MF_VolumeDataColor; @@ -310,6 +312,9 @@ typedef Lib3MFHandle Lib3MF_ConstVecNode; typedef Lib3MFHandle Lib3MF_ConstMatNode; typedef Lib3MFHandle Lib3MF_MeshNode; typedef Lib3MFHandle Lib3MF_UnsignedMeshNode; +typedef Lib3MFHandle Lib3MF_BeamLatticeNode; +typedef Lib3MFHandle Lib3MF_FunctionGradientNode; +typedef Lib3MFHandle Lib3MF_NormalizeDistanceNode; typedef Lib3MFHandle Lib3MF_FunctionCallNode; typedef Lib3MFHandle Lib3MF_NodeIterator; typedef Lib3MFHandle Lib3MF_Function; @@ -358,9 +363,16 @@ typedef enum eLib3MFObjectType { eObjectTypeOther = 0, eObjectTypeModel = 1, eObjectTypeSupport = 2, - eObjectTypeSolidSupport = 3 + eObjectTypeSolidSupport = 3, + eObjectTypeSurface = 4 } eLib3MFObjectType; +typedef enum eLib3MFBooleanOperation { + eBooleanOperationUnion = 0, + eBooleanOperationDifference = 1, + eBooleanOperationIntersection = 2 +} eLib3MFBooleanOperation; + typedef enum eLib3MFTextureType { eTextureTypeUnknown = 0, eTextureTypePNG = 1, @@ -472,11 +484,11 @@ typedef enum eLib3MFImplicitNodeType { eImplicitNodeTypeMatVecMultiplication = 14, /** Multiplies a matrix with a vector */ eImplicitNodeTypeTranspose = 15, /** Transposes a matrix */ eImplicitNodeTypeInverse = 16, /** Computes the inverse of a matrix */ - eImplicitNodeTypeSinus = 17, /** Calculates the sinus */ - eImplicitNodeTypeCosinus = 18, /** Calculates the cosinus */ + eImplicitNodeTypeSinus = 17, /** Calculates the sine */ + eImplicitNodeTypeCosinus = 18, /** Calculates the cosine */ eImplicitNodeTypeTan = 19, /** Calculates the tangent */ - eImplicitNodeTypeArcSin = 20, /** Calculates the arcsinus */ - eImplicitNodeTypeArcCos = 21, /** Calculates the arccosinus */ + eImplicitNodeTypeArcSin = 20, /** Calculates the arcsine */ + eImplicitNodeTypeArcCos = 21, /** Calculates the arccosine */ eImplicitNodeTypeArcTan = 22, /** Calculates the arctangent */ eImplicitNodeTypeArcTan2 = 23, /** Calculates the arctangent */ eImplicitNodeTypeMin = 24, /** Calculates the minimum of two values */ @@ -486,9 +498,9 @@ typedef enum eLib3MFImplicitNodeType { eImplicitNodeTypePow = 28, /** Calculates the power A^B */ eImplicitNodeTypeSqrt = 29, /** Calculates the square root */ eImplicitNodeTypeExp = 30, /** Exponential function */ - eImplicitNodeTypeLog = 31, /** Natural logarithmus */ - eImplicitNodeTypeLog2 = 32, /** Logarithmus to the base 2 */ - eImplicitNodeTypeLog10 = 33, /** Logarithmus to the base 10 */ + eImplicitNodeTypeLog = 31, /** Natural logarithm */ + eImplicitNodeTypeLog2 = 32, /** Logarithm to the base 2 */ + eImplicitNodeTypeLog10 = 33, /** Logarithm to the base 10 */ eImplicitNodeTypeSelect = 34, /** If A is less than B returns C, else D */ eImplicitNodeTypeClamp = 35, /** Clamps the input value to min and max */ eImplicitNodeTypeSinh = 36, /** Calculates the hyperbolic sine */ @@ -503,9 +515,12 @@ typedef enum eLib3MFImplicitNodeType { eImplicitNodeTypeMesh = 45, /** Calculates the signed distance to a mesh */ eImplicitNodeTypeLength = 46, /** Calculates the length of a vector */ eImplicitNodeTypeConstResourceID = 47, /** Selects a resource (function, mesh etc.) */ - eImplicitNodeTypeVectorFromScalar = 48, /** Creates a vector from one scalar values */ + eImplicitNodeTypeVectorFromScalar = 48, /** Creates a vector from one scalar value */ eImplicitNodeTypeUnsignedMesh = 49, /** Calculates the unsigned distance to a mesh */ - eImplicitNodeTypeMod = 50 /** Calculates the modulo of two values (same behaviour as glsl mod) */ + eImplicitNodeTypeMod = 50, /** Calculates the modulo of two values (same behaviour as glsl mod) */ + eImplicitNodeTypeBeamLattice = 51, /** Calculates the signed distance to a beam lattice */ + eImplicitNodeTypeFunctionGradient = 52, /** Calculates the gradient of a function */ + eImplicitNodeTypeNormalizeDistance = 53 /** Normalizes a distance field */ } eLib3MFImplicitNodeType; /** @@ -578,6 +593,11 @@ typedef union { int m_code; } structEnumLib3MFObjectType; +typedef union { + eLib3MFBooleanOperation m_enum; + int m_code; +} structEnumLib3MFBooleanOperation; + typedef union { eLib3MFTextureType m_enum; int m_code; diff --git a/Autogenerated/Bindings/Pascal/Unit_Lib3MF.pas b/Autogenerated/Bindings/Pascal/Unit_Lib3MF.pas index 98da6f836..68cada15c 100644 --- a/Autogenerated/Bindings/Pascal/Unit_Lib3MF.pas +++ b/Autogenerated/Bindings/Pascal/Unit_Lib3MF.pas @@ -25,12 +25,12 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated Pascal Header file in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 *) @@ -54,7 +54,7 @@ interface const LIB3MF_VERSION_MAJOR = 2; - LIB3MF_VERSION_MINOR = 4; + LIB3MF_VERSION_MINOR = 6; LIB3MF_VERSION_MICRO = 0; LIB3MF_VERSION_PRERELEASEINFO = ''; LIB3MF_VERSION_BUILDINFO = ''; @@ -161,7 +161,14 @@ interface eObjectTypeOther, eObjectTypeModel, eObjectTypeSupport, - eObjectTypeSolidSupport + eObjectTypeSolidSupport, + eObjectTypeSurface + ); + + TLib3MFBooleanOperation = ( + eBooleanOperationUnion, + eBooleanOperationDifference, + eBooleanOperationIntersection ); TLib3MFTextureType = ( @@ -305,7 +312,10 @@ interface eImplicitNodeTypeConstResourceID, eImplicitNodeTypeVectorFromScalar, eImplicitNodeTypeUnsignedMesh, - eImplicitNodeTypeMod + eImplicitNodeTypeMod, + eImplicitNodeTypeBeamLattice, + eImplicitNodeTypeFunctionGradient, + eImplicitNodeTypeNormalizeDistance ); TLib3MFImplicitPortType = ( @@ -485,6 +495,7 @@ TLib3MFSliceStackIterator = class; TLib3MFObjectIterator = class; TLib3MFMeshObjectIterator = class; TLib3MFComponentsObjectIterator = class; + TLib3MFBooleanObjectIterator = class; TLib3MFTexture2DIterator = class; TLib3MFBaseMaterialGroupIterator = class; TLib3MFColorGroupIterator = class; @@ -500,6 +511,7 @@ TLib3MFTriangleSet = class; TLib3MFObject = class; TLib3MFMeshObject = class; TLib3MFLevelSet = class; + TLib3MFBooleanObject = class; TLib3MFBeamLattice = class; TLib3MFFunctionReference = class; TLib3MFVolumeDataColor = class; @@ -575,6 +587,9 @@ TLib3MFConstVecNode = class; TLib3MFConstMatNode = class; TLib3MFMeshNode = class; TLib3MFUnsignedMeshNode = class; + TLib3MFBeamLatticeNode = class; + TLib3MFFunctionGradientNode = class; + TLib3MFNormalizeDistanceNode = class; TLib3MFFunctionCallNode = class; TLib3MFNodeIterator = class; TLib3MFFunction = class; @@ -1047,6 +1062,20 @@ TLib3MFModel = class; TLib3MFComponentsObjectIterator_GetCurrentComponentsObjectFunc = function(pComponentsObjectIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; +(************************************************************************************************************************* + Function type definitions for BooleanObjectIterator +**************************************************************************************************************************) + + (** + * Returns the BooleanObject the iterator points at. + * + * @param[in] pBooleanObjectIterator - BooleanObjectIterator instance. + * @param[out] pResource - returns the BooleanObject instance. + * @return error code or 0 (success) + *) + TLib3MFBooleanObjectIterator_GetCurrentBooleanObjectFunc = function(pBooleanObjectIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + + (************************************************************************************************************************* Function type definitions for Texture2DIterator **************************************************************************************************************************) @@ -1573,6 +1602,15 @@ TLib3MFModel = class; *) TLib3MFObject_IsLevelSetObjectFunc = function(pObject: TLib3MFHandle; out pIsLevelSetObject: Byte): TLib3MFResult; cdecl; + (** + * Retrieves, if an object is a boolean object + * + * @param[in] pObject - Object instance. + * @param[out] pIsBooleanObject - returns, whether the object is a boolean object + * @return error code or 0 (success) + *) + TLib3MFObject_IsBooleanObjectFunc = function(pObject: TLib3MFHandle; out pIsBooleanObject: Byte): TLib3MFResult; cdecl; + (** * Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * @@ -2126,6 +2164,141 @@ TLib3MFModel = class; TLib3MFLevelSet_SetVolumeDataFunc = function(pLevelSet: TLib3MFHandle; const pTheVolumeData: TLib3MFHandle): TLib3MFResult; cdecl; +(************************************************************************************************************************* + Function type definitions for BooleanObject +**************************************************************************************************************************) + + (** + * Sets the base object and transform for the boolean shape. + * + * @param[in] pBooleanObject - BooleanObject instance. + * @param[in] pBaseObject - base object of the boolean shape + * @param[in] pTransform - transform applied to the base object + * @return error code or 0 (success) + *) + TLib3MFBooleanObject_SetBaseObjectFunc = function(pBooleanObject: TLib3MFHandle; const pBaseObject: TLib3MFHandle; const pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + + (** + * Returns the base object of the boolean shape. + * + * @param[in] pBooleanObject - BooleanObject instance. + * @param[out] pBaseObject - base object of the boolean shape + * @return error code or 0 (success) + *) + TLib3MFBooleanObject_GetBaseObjectFunc = function(pBooleanObject: TLib3MFHandle; out pBaseObject: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Sets the base transform of the boolean shape. + * + * @param[in] pBooleanObject - BooleanObject instance. + * @param[in] pTransform - transform applied to the base object + * @return error code or 0 (success) + *) + TLib3MFBooleanObject_SetBaseTransformFunc = function(pBooleanObject: TLib3MFHandle; const pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + + (** + * Returns the base transform of the boolean shape. + * + * @param[in] pBooleanObject - BooleanObject instance. + * @param[out] pTransform - transform applied to the base object + * @return error code or 0 (success) + *) + TLib3MFBooleanObject_GetBaseTransformFunc = function(pBooleanObject: TLib3MFHandle; pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + + (** + * Sets the boolean operation used for the boolean shape. + * + * @param[in] pBooleanObject - BooleanObject instance. + * @param[in] eOperation - boolean operation used for the shape + * @return error code or 0 (success) + *) + TLib3MFBooleanObject_SetOperationFunc = function(pBooleanObject: TLib3MFHandle; const eOperation: Integer): TLib3MFResult; cdecl; + + (** + * Returns the boolean operation used for the boolean shape. + * + * @param[in] pBooleanObject - BooleanObject instance. + * @param[out] pOperation - boolean operation used for the shape + * @return error code or 0 (success) + *) + TLib3MFBooleanObject_GetOperationFunc = function(pBooleanObject: TLib3MFHandle; out pOperation: Integer): TLib3MFResult; cdecl; + + (** + * Enables or disables CSG field evaluation for boolean-to-mesh materialization. + * + * @param[in] pBooleanObject - BooleanObject instance. + * @param[in] bCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback + * @return error code or 0 (success) + *) + TLib3MFBooleanObject_SetCSGModeEnabledFunc = function(pBooleanObject: TLib3MFHandle; const bCSGModeEnabled: Byte): TLib3MFResult; cdecl; + + (** + * Returns whether CSG field evaluation is enabled for boolean-to-mesh materialization. + * + * @param[in] pBooleanObject - BooleanObject instance. + * @param[out] pCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback + * @return error code or 0 (success) + *) + TLib3MFBooleanObject_GetCSGModeEnabledFunc = function(pBooleanObject: TLib3MFHandle; out pCSGModeEnabled: Byte): TLib3MFResult; cdecl; + + (** + * Sets the extraction grid resolution used for boolean-to-mesh materialization. + * + * @param[in] pBooleanObject - BooleanObject instance. + * @param[in] nGridResolution - extraction grid resolution for boolean surface extraction + * @return error code or 0 (success) + *) + TLib3MFBooleanObject_SetExtractionGridResolutionFunc = function(pBooleanObject: TLib3MFHandle; const nGridResolution: Cardinal): TLib3MFResult; cdecl; + + (** + * Returns the extraction grid resolution used for boolean-to-mesh materialization. + * + * @param[in] pBooleanObject - BooleanObject instance. + * @param[out] pGridResolution - extraction grid resolution for boolean surface extraction + * @return error code or 0 (success) + *) + TLib3MFBooleanObject_GetExtractionGridResolutionFunc = function(pBooleanObject: TLib3MFHandle; out pGridResolution: Cardinal): TLib3MFResult; cdecl; + + (** + * Returns the number of operands in the boolean sequence. + * + * @param[in] pBooleanObject - BooleanObject instance. + * @param[out] pCount - number of operands in the boolean sequence + * @return error code or 0 (success) + *) + TLib3MFBooleanObject_GetOperandCountFunc = function(pBooleanObject: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; + + (** + * Adds an operand object to the boolean sequence. + * + * @param[in] pBooleanObject - BooleanObject instance. + * @param[in] pOperandObject - mesh object used as operand + * @param[in] pTransform - transform applied to the operand object + * @return error code or 0 (success) + *) + TLib3MFBooleanObject_AddOperandFunc = function(pBooleanObject: TLib3MFHandle; const pOperandObject: TLib3MFHandle; const pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + + (** + * Returns one operand object and transform from the boolean sequence. + * + * @param[in] pBooleanObject - BooleanObject instance. + * @param[in] nIndex - index of the operand in the boolean sequence + * @param[out] pOperandObject - mesh object used as operand + * @param[out] pTransform - transform applied to the operand object + * @return error code or 0 (success) + *) + TLib3MFBooleanObject_GetOperandFunc = function(pBooleanObject: TLib3MFHandle; const nIndex: Cardinal; out pOperandObject: TLib3MFHandle; pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + + (** + * Materializes the boolean shape into a newly created mesh object. + * + * @param[in] pBooleanObject - BooleanObject instance. + * @param[out] pMeshObject - new mesh object containing the tessellated boolean shape + * @return error code or 0 (success) + *) + TLib3MFBooleanObject_MergeToMeshObjectFunc = function(pBooleanObject: TLib3MFHandle; out pMeshObject: TLib3MFHandle): TLib3MFResult; cdecl; + + (************************************************************************************************************************* Function type definitions for BeamLattice **************************************************************************************************************************) @@ -2495,7 +2668,7 @@ TLib3MFModel = class; TLib3MFVolumeDataComposite_GetMaterialMappingCountFunc = function(pVolumeDataComposite: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * Returns MaterialMappting with given index + * Returns MaterialMapping with given index * * @param[in] pVolumeDataComposite - VolumeDataComposite instance. * @param[in] nIndex - Index of the MaterialMapping in question. @@ -2505,7 +2678,7 @@ TLib3MFModel = class; TLib3MFVolumeDataComposite_GetMaterialMappingFunc = function(pVolumeDataComposite: TLib3MFHandle; const nIndex: Cardinal; out pTheMaterialMapping: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Adds a the MaterialMapping + * Adds a MaterialMapping * * @param[in] pVolumeDataComposite - VolumeDataComposite instance. * @param[in] pTransform - new transformation matrix @@ -2619,7 +2792,7 @@ TLib3MFModel = class; * Returns the number of VolumeDataProperty * * @param[in] pVolumeData - VolumeData instance. - * @param[out] pCount - the number of VolumeDataProperty-elements within this VolumdeData + * @param[out] pCount - the number of VolumeDataProperty-elements within this VolumeData * @return error code or 0 (success) *) TLib3MFVolumeData_GetPropertyCountFunc = function(pVolumeData: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; @@ -3455,7 +3628,7 @@ TLib3MFModel = class; TLib3MFAttachment_WriteToFileFunc = function(pAttachment: TLib3MFHandle; const pFileName: PAnsiChar): TLib3MFResult; cdecl; (** - * Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. + * Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * * @param[in] pAttachment - Attachment instance. * @param[in] pFileName - file to read from. @@ -3464,7 +3637,7 @@ TLib3MFModel = class; TLib3MFAttachment_ReadFromFileFunc = function(pAttachment: TLib3MFHandle; const pFileName: PAnsiChar): TLib3MFResult; cdecl; (** - * Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. + * Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * * @param[in] pAttachment - Attachment instance. * @param[in] pTheReadCallback - Callback to call for reading a data chunk @@ -3496,7 +3669,7 @@ TLib3MFModel = class; TLib3MFAttachment_WriteToBufferFunc = function(pAttachment: TLib3MFHandle; const nBufferCount: QWord; out pBufferNeededCount: QWord; pBufferBuffer: PByte): TLib3MFResult; cdecl; (** - * Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). + * Reads an attachment from a memory buffer. This buffer is immediately read (in contrast to the ReadFromCallback and ReadFromFile-methods). * * @param[in] pAttachment - Attachment instance. * @param[in] nBufferCount - Number of elements in buffer @@ -4666,6 +4839,236 @@ TLib3MFModel = class; TLib3MFUnsignedMeshNode_GetOutputDistanceFunc = function(pUnsignedMeshNode: TLib3MFHandle; out pDistance: TLib3MFHandle): TLib3MFResult; cdecl; +(************************************************************************************************************************* + Function type definitions for BeamLatticeNode +**************************************************************************************************************************) + + (** + * Retrieves the input for the model resource id of the beam lattice + * + * @param[in] pBeamLatticeNode - BeamLatticeNode instance. + * @param[out] pBeamLattice - the input port for the model resource id of the beam lattice (mesh with beamlattice extension) + * @return error code or 0 (success) + *) + TLib3MFBeamLatticeNode_GetInputBeamLatticeFunc = function(pBeamLatticeNode: TLib3MFHandle; out pBeamLattice: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Retrieves the input for the position + * + * @param[in] pBeamLatticeNode - BeamLatticeNode instance. + * @param[out] pPos - the input port for the position + * @return error code or 0 (success) + *) + TLib3MFBeamLatticeNode_GetInputPosFunc = function(pBeamLatticeNode: TLib3MFHandle; out pPos: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Retrieves the output + * + * @param[in] pBeamLatticeNode - BeamLatticeNode instance. + * @param[out] pDistance - the output port for the signed distance to the beam lattice + * @return error code or 0 (success) + *) + TLib3MFBeamLatticeNode_GetOutputDistanceFunc = function(pBeamLatticeNode: TLib3MFHandle; out pDistance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Sets the accurate range for distance computation + * + * @param[in] pBeamLatticeNode - BeamLatticeNode instance. + * @param[in] dAccurateRange - the accurate range in model units + * @return error code or 0 (success) + *) + TLib3MFBeamLatticeNode_SetAccurateRangeFunc = function(pBeamLatticeNode: TLib3MFHandle; const dAccurateRange: Double): TLib3MFResult; cdecl; + + (** + * Retrieves the accurate range for distance computation + * + * @param[in] pBeamLatticeNode - BeamLatticeNode instance. + * @param[out] pAccurateRange - the accurate range in model units + * @return error code or 0 (success) + *) + TLib3MFBeamLatticeNode_GetAccurateRangeFunc = function(pBeamLatticeNode: TLib3MFHandle; out pAccurateRange: Double): TLib3MFResult; cdecl; + + +(************************************************************************************************************************* + Function type definitions for FunctionGradientNode +**************************************************************************************************************************) + + (** + * Retrieves the input for the function id + * + * @param[in] pFunctionGradientNode - FunctionGradientNode instance. + * @param[out] pFunction - the input port for the function + * @return error code or 0 (success) + *) + TLib3MFFunctionGradientNode_GetInputFunctionIDFunc = function(pFunctionGradientNode: TLib3MFHandle; out pFunction: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Retrieves the input for the position + * + * @param[in] pFunctionGradientNode - FunctionGradientNode instance. + * @param[out] pPos - the input port for the position + * @return error code or 0 (success) + *) + TLib3MFFunctionGradientNode_GetInputPosFunc = function(pFunctionGradientNode: TLib3MFHandle; out pPos: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Retrieves the input for the finite difference step + * + * @param[in] pFunctionGradientNode - FunctionGradientNode instance. + * @param[out] pStep - the input port for the finite difference step + * @return error code or 0 (success) + *) + TLib3MFFunctionGradientNode_GetInputStepFunc = function(pFunctionGradientNode: TLib3MFHandle; out pStep: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Sets the name of the referenced scalar output + * + * @param[in] pFunctionGradientNode - FunctionGradientNode instance. + * @param[in] pScalarOutputName - the name of the scalar output of the referenced function + * @return error code or 0 (success) + *) + TLib3MFFunctionGradientNode_SetScalarOutputNameFunc = function(pFunctionGradientNode: TLib3MFHandle; const pScalarOutputName: PAnsiChar): TLib3MFResult; cdecl; + + (** + * Retrieves the name of the referenced scalar output + * + * @param[in] pFunctionGradientNode - FunctionGradientNode instance. + * @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) + * @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL + * @return error code or 0 (success) + *) + TLib3MFFunctionGradientNode_GetScalarOutputNameFunc = function(pFunctionGradientNode: TLib3MFHandle; const nScalarOutputNameBufferSize: Cardinal; out pScalarOutputNameNeededChars: Cardinal; pScalarOutputNameBuffer: PAnsiChar): TLib3MFResult; cdecl; + + (** + * Sets the name of the referenced vector input + * + * @param[in] pFunctionGradientNode - FunctionGradientNode instance. + * @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function + * @return error code or 0 (success) + *) + TLib3MFFunctionGradientNode_SetVectorInputNameFunc = function(pFunctionGradientNode: TLib3MFHandle; const pVectorInputName: PAnsiChar): TLib3MFResult; cdecl; + + (** + * Retrieves the name of the referenced vector input + * + * @param[in] pFunctionGradientNode - FunctionGradientNode instance. + * @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) + * @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL + * @return error code or 0 (success) + *) + TLib3MFFunctionGradientNode_GetVectorInputNameFunc = function(pFunctionGradientNode: TLib3MFHandle; const nVectorInputNameBufferSize: Cardinal; out pVectorInputNameNeededChars: Cardinal; pVectorInputNameBuffer: PAnsiChar): TLib3MFResult; cdecl; + + (** + * Retrieves the normalized gradient output + * + * @param[in] pFunctionGradientNode - FunctionGradientNode instance. + * @param[out] pNormalizedGradient - the output port for the normalized gradient + * @return error code or 0 (success) + *) + TLib3MFFunctionGradientNode_GetOutputNormalizedGradientFunc = function(pFunctionGradientNode: TLib3MFHandle; out pNormalizedGradient: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Retrieves the raw gradient output + * + * @param[in] pFunctionGradientNode - FunctionGradientNode instance. + * @param[out] pGradient - the output port for the raw gradient + * @return error code or 0 (success) + *) + TLib3MFFunctionGradientNode_GetOutputGradientFunc = function(pFunctionGradientNode: TLib3MFHandle; out pGradient: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Retrieves the gradient magnitude output + * + * @param[in] pFunctionGradientNode - FunctionGradientNode instance. + * @param[out] pMagnitude - the output port for the gradient magnitude + * @return error code or 0 (success) + *) + TLib3MFFunctionGradientNode_GetOutputMagnitudeFunc = function(pFunctionGradientNode: TLib3MFHandle; out pMagnitude: TLib3MFHandle): TLib3MFResult; cdecl; + + +(************************************************************************************************************************* + Function type definitions for NormalizeDistanceNode +**************************************************************************************************************************) + + (** + * Retrieves the input for the function id + * + * @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. + * @param[out] pFunction - the input port for the function + * @return error code or 0 (success) + *) + TLib3MFNormalizeDistanceNode_GetInputFunctionIDFunc = function(pNormalizeDistanceNode: TLib3MFHandle; out pFunction: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Retrieves the input for the position + * + * @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. + * @param[out] pPos - the input port for the position (vector) + * @return error code or 0 (success) + *) + TLib3MFNormalizeDistanceNode_GetInputPosFunc = function(pNormalizeDistanceNode: TLib3MFHandle; out pPos: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Retrieves the input for the finite difference step + * + * @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. + * @param[out] pStep - the input port for the finite difference step + * @return error code or 0 (success) + *) + TLib3MFNormalizeDistanceNode_GetInputStepFunc = function(pNormalizeDistanceNode: TLib3MFHandle; out pStep: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Sets the name of the referenced scalar output + * + * @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. + * @param[in] pScalarOutputName - the name of the scalar output of the referenced function + * @return error code or 0 (success) + *) + TLib3MFNormalizeDistanceNode_SetScalarOutputNameFunc = function(pNormalizeDistanceNode: TLib3MFHandle; const pScalarOutputName: PAnsiChar): TLib3MFResult; cdecl; + + (** + * Retrieves the name of the referenced scalar output + * + * @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. + * @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) + * @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL + * @return error code or 0 (success) + *) + TLib3MFNormalizeDistanceNode_GetScalarOutputNameFunc = function(pNormalizeDistanceNode: TLib3MFHandle; const nScalarOutputNameBufferSize: Cardinal; out pScalarOutputNameNeededChars: Cardinal; pScalarOutputNameBuffer: PAnsiChar): TLib3MFResult; cdecl; + + (** + * Sets the name of the referenced vector input + * + * @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. + * @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function + * @return error code or 0 (success) + *) + TLib3MFNormalizeDistanceNode_SetVectorInputNameFunc = function(pNormalizeDistanceNode: TLib3MFHandle; const pVectorInputName: PAnsiChar): TLib3MFResult; cdecl; + + (** + * Retrieves the name of the referenced vector input + * + * @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. + * @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) + * @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL + * @return error code or 0 (success) + *) + TLib3MFNormalizeDistanceNode_GetVectorInputNameFunc = function(pNormalizeDistanceNode: TLib3MFHandle; const nVectorInputNameBufferSize: Cardinal; out pVectorInputNameNeededChars: Cardinal; pVectorInputNameBuffer: PAnsiChar): TLib3MFResult; cdecl; + + (** + * Retrieves the normalized result output + * + * @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. + * @param[out] pResult - the output port for the normalized distance + * @return error code or 0 (success) + *) + TLib3MFNormalizeDistanceNode_GetOutputResultFunc = function(pNormalizeDistanceNode: TLib3MFHandle; out pResult: TLib3MFHandle): TLib3MFResult; cdecl; + + (************************************************************************************************************************* Function type definitions for FunctionCallNode **************************************************************************************************************************) @@ -5445,7 +5848,7 @@ TLib3MFModel = class; TLib3MFImplicitFunction_AddUnsignedMeshNodeFunc = function(pImplicitFunction: TLib3MFHandle; const pIdentifier: PAnsiChar; const pDisplayName: PAnsiChar; const pTag: PAnsiChar; out pNode: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Add a FunctionCallNode + * Add a BeamLatticeNode * * @param[in] pImplicitFunction - ImplicitFunction instance. * @param[in] pIdentifier - the identifier of the node @@ -5454,38 +5857,74 @@ TLib3MFModel = class; * @param[out] pNode - the added node * @return error code or 0 (success) *) - TLib3MFImplicitFunction_AddFunctionCallNodeFunc = function(pImplicitFunction: TLib3MFHandle; const pIdentifier: PAnsiChar; const pDisplayName: PAnsiChar; const pTag: PAnsiChar; out pNode: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFImplicitFunction_AddBeamLatticeNodeFunc = function(pImplicitFunction: TLib3MFHandle; const pIdentifier: PAnsiChar; const pDisplayName: PAnsiChar; const pTag: PAnsiChar; out pNode: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Retrieves the nodes + * Add a FunctionGradientNode * * @param[in] pImplicitFunction - ImplicitFunction instance. - * @param[out] pIterator - iterator for the list of nodes + * @param[in] pIdentifier - the identifier of the node + * @param[in] pDisplayName - the display name of the node + * @param[in] pTag - the tag of the node + * @param[out] pNode - the added node * @return error code or 0 (success) *) - TLib3MFImplicitFunction_GetNodesFunc = function(pImplicitFunction: TLib3MFHandle; out pIterator: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFImplicitFunction_AddFunctionGradientNodeFunc = function(pImplicitFunction: TLib3MFHandle; const pIdentifier: PAnsiChar; const pDisplayName: PAnsiChar; const pTag: PAnsiChar; out pNode: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Removes a node + * Add a NormalizeDistanceNode * * @param[in] pImplicitFunction - ImplicitFunction instance. - * @param[in] pNode - The node to be removed + * @param[in] pIdentifier - the identifier of the node + * @param[in] pDisplayName - the display name of the node + * @param[in] pTag - the tag of the node + * @param[out] pNode - the added node * @return error code or 0 (success) *) - TLib3MFImplicitFunction_RemoveNodeFunc = function(pImplicitFunction: TLib3MFHandle; const pNode: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFImplicitFunction_AddNormalizeDistanceNodeFunc = function(pImplicitFunction: TLib3MFHandle; const pIdentifier: PAnsiChar; const pDisplayName: PAnsiChar; const pTag: PAnsiChar; out pNode: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Add a link + * Add a FunctionCallNode * * @param[in] pImplicitFunction - ImplicitFunction instance. - * @param[in] pSource - the source port - * @param[in] pTarget - the target port + * @param[in] pIdentifier - the identifier of the node + * @param[in] pDisplayName - the display name of the node + * @param[in] pTag - the tag of the node + * @param[out] pNode - the added node * @return error code or 0 (success) *) - TLib3MFImplicitFunction_AddLinkFunc = function(pImplicitFunction: TLib3MFHandle; const pSource: TLib3MFHandle; const pTarget: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFImplicitFunction_AddFunctionCallNodeFunc = function(pImplicitFunction: TLib3MFHandle; const pIdentifier: PAnsiChar; const pDisplayName: PAnsiChar; const pTag: PAnsiChar; out pNode: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Add a link + * Retrieves the nodes + * + * @param[in] pImplicitFunction - ImplicitFunction instance. + * @param[out] pIterator - iterator for the list of nodes + * @return error code or 0 (success) + *) + TLib3MFImplicitFunction_GetNodesFunc = function(pImplicitFunction: TLib3MFHandle; out pIterator: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Removes a node + * + * @param[in] pImplicitFunction - ImplicitFunction instance. + * @param[in] pNode - The node to be removed + * @return error code or 0 (success) + *) + TLib3MFImplicitFunction_RemoveNodeFunc = function(pImplicitFunction: TLib3MFHandle; const pNode: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Add a link + * + * @param[in] pImplicitFunction - ImplicitFunction instance. + * @param[in] pSource - the source port + * @param[in] pTarget - the target port + * @return error code or 0 (success) + *) + TLib3MFImplicitFunction_AddLinkFunc = function(pImplicitFunction: TLib3MFHandle; const pSource: TLib3MFHandle; const pTarget: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Add a link * * @param[in] pImplicitFunction - ImplicitFunction instance. * @param[in] pSource - name of the source port in the format nodename.portname @@ -6570,6 +7009,16 @@ TLib3MFModel = class; *) TLib3MFModel_GetComponentsObjectByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pComponentsObjectInstance: TLib3MFHandle): TLib3MFResult; cdecl; + (** + * finds a boolean object by its UniqueResourceID + * + * @param[in] pModel - Model instance. + * @param[in] nUniqueResourceID - UniqueResourceID + * @param[out] pBooleanObjectInstance - returns the boolean object instance + * @return error code or 0 (success) + *) + TLib3MFModel_GetBooleanObjectByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pBooleanObjectInstance: TLib3MFHandle): TLib3MFResult; cdecl; + (** * finds a model color group by its UniqueResourceID * @@ -6675,6 +7124,15 @@ TLib3MFModel = class; *) TLib3MFModel_GetComponentsObjectsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + (** + * creates a resource iterator instance with all boolean object resources. + * + * @param[in] pModel - Model instance. + * @param[out] pResourceIterator - returns the iterator instance. + * @return error code or 0 (success) + *) + TLib3MFModel_GetBooleanObjectsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + (** * creates a Texture2DIterator instance with all texture2d resources. * @@ -6783,6 +7241,15 @@ TLib3MFModel = class; *) TLib3MFModel_AddComponentsObjectFunc = function(pModel: TLib3MFHandle; out pComponentsObjectInstance: TLib3MFHandle): TLib3MFResult; cdecl; + (** + * adds an empty boolean object to the model. + * + * @param[in] pModel - Model instance. + * @param[out] pBooleanObjectInstance - returns the boolean object instance + * @return error code or 0 (success) + *) + TLib3MFModel_AddBooleanObjectFunc = function(pModel: TLib3MFHandle; out pBooleanObjectInstance: TLib3MFHandle): TLib3MFResult; cdecl; + (** * creates a new model slicestack by its id * @@ -7463,6 +7930,18 @@ TLib3MFComponentsObjectIterator = class(TLib3MFResourceIterator) end; +(************************************************************************************************************************* + Class definition for BooleanObjectIterator +**************************************************************************************************************************) + + TLib3MFBooleanObjectIterator = class(TLib3MFResourceIterator) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetCurrentBooleanObject(): TLib3MFBooleanObject; + end; + + (************************************************************************************************************************* Class definition for Texture2DIterator **************************************************************************************************************************) @@ -7651,6 +8130,7 @@ TLib3MFObject = class(TLib3MFResource) function IsMeshObject(): Boolean; function IsComponentsObject(): Boolean; function IsLevelSetObject(): Boolean; + function IsBooleanObject(): Boolean; function IsValid(): Boolean; procedure SetAttachmentAsThumbnail(const AAttachment: TLib3MFAttachment); function GetThumbnailAttachment(): TLib3MFAttachment; @@ -7733,6 +8213,31 @@ TLib3MFLevelSet = class(TLib3MFObject) end; +(************************************************************************************************************************* + Class definition for BooleanObject +**************************************************************************************************************************) + + TLib3MFBooleanObject = class(TLib3MFObject) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + procedure SetBaseObject(const ABaseObject: TLib3MFObject; const ATransform: TLib3MFTransform); + function GetBaseObject(): TLib3MFObject; + procedure SetBaseTransform(const ATransform: TLib3MFTransform); + function GetBaseTransform(): TLib3MFTransform; + procedure SetOperation(const AOperation: TLib3MFBooleanOperation); + function GetOperation(): TLib3MFBooleanOperation; + procedure SetCSGModeEnabled(const ACSGModeEnabled: Boolean); + function GetCSGModeEnabled(): Boolean; + procedure SetExtractionGridResolution(const AGridResolution: Cardinal); + function GetExtractionGridResolution(): Cardinal; + function GetOperandCount(): Cardinal; + procedure AddOperand(const AOperandObject: TLib3MFMeshObject; const ATransform: TLib3MFTransform); + function GetOperand(const AIndex: Cardinal; out AOperandObject: TLib3MFMeshObject): TLib3MFTransform; + function MergeToMeshObject(): TLib3MFMeshObject; + end; + + (************************************************************************************************************************* Class definition for BeamLattice **************************************************************************************************************************) @@ -8785,6 +9290,62 @@ TLib3MFUnsignedMeshNode = class(TLib3MFImplicitNode) end; +(************************************************************************************************************************* + Class definition for BeamLatticeNode +**************************************************************************************************************************) + + TLib3MFBeamLatticeNode = class(TLib3MFImplicitNode) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetInputBeamLattice(): TLib3MFImplicitPort; + function GetInputPos(): TLib3MFImplicitPort; + function GetOutputDistance(): TLib3MFImplicitPort; + procedure SetAccurateRange(const AAccurateRange: Double); + function GetAccurateRange(): Double; + end; + + +(************************************************************************************************************************* + Class definition for FunctionGradientNode +**************************************************************************************************************************) + + TLib3MFFunctionGradientNode = class(TLib3MFImplicitNode) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetInputFunctionID(): TLib3MFImplicitPort; + function GetInputPos(): TLib3MFImplicitPort; + function GetInputStep(): TLib3MFImplicitPort; + procedure SetScalarOutputName(const AScalarOutputName: String); + function GetScalarOutputName(): String; + procedure SetVectorInputName(const AVectorInputName: String); + function GetVectorInputName(): String; + function GetOutputNormalizedGradient(): TLib3MFImplicitPort; + function GetOutputGradient(): TLib3MFImplicitPort; + function GetOutputMagnitude(): TLib3MFImplicitPort; + end; + + +(************************************************************************************************************************* + Class definition for NormalizeDistanceNode +**************************************************************************************************************************) + + TLib3MFNormalizeDistanceNode = class(TLib3MFImplicitNode) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetInputFunctionID(): TLib3MFImplicitPort; + function GetInputPos(): TLib3MFImplicitPort; + function GetInputStep(): TLib3MFImplicitPort; + procedure SetScalarOutputName(const AScalarOutputName: String); + function GetScalarOutputName(): String; + procedure SetVectorInputName(const AVectorInputName: String); + function GetVectorInputName(): String; + function GetOutputResult(): TLib3MFImplicitPort; + end; + + (************************************************************************************************************************* Class definition for FunctionCallNode **************************************************************************************************************************) @@ -8889,6 +9450,9 @@ TLib3MFImplicitFunction = class(TLib3MFFunction) function AddConstMatNode(const AIdentifier: String; const ADisplayName: String; const ATag: String): TLib3MFConstMatNode; function AddMeshNode(const AIdentifier: String; const ADisplayName: String; const ATag: String): TLib3MFMeshNode; function AddUnsignedMeshNode(const AIdentifier: String; const ADisplayName: String; const ATag: String): TLib3MFUnsignedMeshNode; + function AddBeamLatticeNode(const AIdentifier: String; const ADisplayName: String; const ATag: String): TLib3MFBeamLatticeNode; + function AddFunctionGradientNode(const AIdentifier: String; const ADisplayName: String; const ATag: String): TLib3MFFunctionGradientNode; + function AddNormalizeDistanceNode(const AIdentifier: String; const ADisplayName: String; const ATag: String): TLib3MFNormalizeDistanceNode; function AddFunctionCallNode(const AIdentifier: String; const ADisplayName: String; const ATag: String): TLib3MFFunctionCallNode; function GetNodes(): TLib3MFNodeIterator; procedure RemoveNode(const ANode: TLib3MFImplicitNode); @@ -9130,6 +9694,7 @@ TLib3MFModel = class(TLib3MFBase) function GetMultiPropertyGroupByID(const AUniqueResourceID: Cardinal): TLib3MFMultiPropertyGroup; function GetMeshObjectByID(const AUniqueResourceID: Cardinal): TLib3MFMeshObject; function GetComponentsObjectByID(const AUniqueResourceID: Cardinal): TLib3MFComponentsObject; + function GetBooleanObjectByID(const AUniqueResourceID: Cardinal): TLib3MFBooleanObject; function GetColorGroupByID(const AUniqueResourceID: Cardinal): TLib3MFColorGroup; function GetSliceStackByID(const AUniqueResourceID: Cardinal): TLib3MFSliceStack; function GetLevelSetByID(const AUniqueResourceID: Cardinal): TLib3MFLevelSet; @@ -9141,6 +9706,7 @@ TLib3MFModel = class(TLib3MFBase) function GetObjects(): TLib3MFObjectIterator; function GetMeshObjects(): TLib3MFMeshObjectIterator; function GetComponentsObjects(): TLib3MFComponentsObjectIterator; + function GetBooleanObjects(): TLib3MFBooleanObjectIterator; function GetTexture2Ds(): TLib3MFTexture2DIterator; function GetBaseMaterialGroups(): TLib3MFBaseMaterialGroupIterator; function GetColorGroups(): TLib3MFColorGroupIterator; @@ -9153,6 +9719,7 @@ TLib3MFModel = class(TLib3MFBase) procedure MergeFromModel(const AModelInstance: TLib3MFModel); function AddMeshObject(): TLib3MFMeshObject; function AddComponentsObject(): TLib3MFComponentsObject; + function AddBooleanObject(): TLib3MFBooleanObject; function AddSliceStack(const AZBottom: Double): TLib3MFSliceStack; function AddTexture2DFromAttachment(const ATextureAttachment: TLib3MFAttachment): TLib3MFTexture2D; function AddBaseMaterialGroup(): TLib3MFBaseMaterialGroup; @@ -9236,6 +9803,7 @@ TLib3MFWrapper = class(TObject) FLib3MFObjectIterator_GetCurrentObjectFunc: TLib3MFObjectIterator_GetCurrentObjectFunc; FLib3MFMeshObjectIterator_GetCurrentMeshObjectFunc: TLib3MFMeshObjectIterator_GetCurrentMeshObjectFunc; FLib3MFComponentsObjectIterator_GetCurrentComponentsObjectFunc: TLib3MFComponentsObjectIterator_GetCurrentComponentsObjectFunc; + FLib3MFBooleanObjectIterator_GetCurrentBooleanObjectFunc: TLib3MFBooleanObjectIterator_GetCurrentBooleanObjectFunc; FLib3MFTexture2DIterator_GetCurrentTexture2DFunc: TLib3MFTexture2DIterator_GetCurrentTexture2DFunc; FLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupFunc: TLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupFunc; FLib3MFColorGroupIterator_GetCurrentColorGroupFunc: TLib3MFColorGroupIterator_GetCurrentColorGroupFunc; @@ -9284,6 +9852,7 @@ TLib3MFWrapper = class(TObject) FLib3MFObject_IsMeshObjectFunc: TLib3MFObject_IsMeshObjectFunc; FLib3MFObject_IsComponentsObjectFunc: TLib3MFObject_IsComponentsObjectFunc; FLib3MFObject_IsLevelSetObjectFunc: TLib3MFObject_IsLevelSetObjectFunc; + FLib3MFObject_IsBooleanObjectFunc: TLib3MFObject_IsBooleanObjectFunc; FLib3MFObject_IsValidFunc: TLib3MFObject_IsValidFunc; FLib3MFObject_SetAttachmentAsThumbnailFunc: TLib3MFObject_SetAttachmentAsThumbnailFunc; FLib3MFObject_GetThumbnailAttachmentFunc: TLib3MFObject_GetThumbnailAttachmentFunc; @@ -9341,6 +9910,20 @@ TLib3MFWrapper = class(TObject) FLib3MFLevelSet_GetMeshFunc: TLib3MFLevelSet_GetMeshFunc; FLib3MFLevelSet_GetVolumeDataFunc: TLib3MFLevelSet_GetVolumeDataFunc; FLib3MFLevelSet_SetVolumeDataFunc: TLib3MFLevelSet_SetVolumeDataFunc; + FLib3MFBooleanObject_SetBaseObjectFunc: TLib3MFBooleanObject_SetBaseObjectFunc; + FLib3MFBooleanObject_GetBaseObjectFunc: TLib3MFBooleanObject_GetBaseObjectFunc; + FLib3MFBooleanObject_SetBaseTransformFunc: TLib3MFBooleanObject_SetBaseTransformFunc; + FLib3MFBooleanObject_GetBaseTransformFunc: TLib3MFBooleanObject_GetBaseTransformFunc; + FLib3MFBooleanObject_SetOperationFunc: TLib3MFBooleanObject_SetOperationFunc; + FLib3MFBooleanObject_GetOperationFunc: TLib3MFBooleanObject_GetOperationFunc; + FLib3MFBooleanObject_SetCSGModeEnabledFunc: TLib3MFBooleanObject_SetCSGModeEnabledFunc; + FLib3MFBooleanObject_GetCSGModeEnabledFunc: TLib3MFBooleanObject_GetCSGModeEnabledFunc; + FLib3MFBooleanObject_SetExtractionGridResolutionFunc: TLib3MFBooleanObject_SetExtractionGridResolutionFunc; + FLib3MFBooleanObject_GetExtractionGridResolutionFunc: TLib3MFBooleanObject_GetExtractionGridResolutionFunc; + FLib3MFBooleanObject_GetOperandCountFunc: TLib3MFBooleanObject_GetOperandCountFunc; + FLib3MFBooleanObject_AddOperandFunc: TLib3MFBooleanObject_AddOperandFunc; + FLib3MFBooleanObject_GetOperandFunc: TLib3MFBooleanObject_GetOperandFunc; + FLib3MFBooleanObject_MergeToMeshObjectFunc: TLib3MFBooleanObject_MergeToMeshObjectFunc; FLib3MFBeamLattice_GetMinLengthFunc: TLib3MFBeamLattice_GetMinLengthFunc; FLib3MFBeamLattice_SetMinLengthFunc: TLib3MFBeamLattice_SetMinLengthFunc; FLib3MFBeamLattice_GetClippingFunc: TLib3MFBeamLattice_GetClippingFunc; @@ -9568,6 +10151,29 @@ TLib3MFWrapper = class(TObject) FLib3MFUnsignedMeshNode_GetInputMeshFunc: TLib3MFUnsignedMeshNode_GetInputMeshFunc; FLib3MFUnsignedMeshNode_GetInputPosFunc: TLib3MFUnsignedMeshNode_GetInputPosFunc; FLib3MFUnsignedMeshNode_GetOutputDistanceFunc: TLib3MFUnsignedMeshNode_GetOutputDistanceFunc; + FLib3MFBeamLatticeNode_GetInputBeamLatticeFunc: TLib3MFBeamLatticeNode_GetInputBeamLatticeFunc; + FLib3MFBeamLatticeNode_GetInputPosFunc: TLib3MFBeamLatticeNode_GetInputPosFunc; + FLib3MFBeamLatticeNode_GetOutputDistanceFunc: TLib3MFBeamLatticeNode_GetOutputDistanceFunc; + FLib3MFBeamLatticeNode_SetAccurateRangeFunc: TLib3MFBeamLatticeNode_SetAccurateRangeFunc; + FLib3MFBeamLatticeNode_GetAccurateRangeFunc: TLib3MFBeamLatticeNode_GetAccurateRangeFunc; + FLib3MFFunctionGradientNode_GetInputFunctionIDFunc: TLib3MFFunctionGradientNode_GetInputFunctionIDFunc; + FLib3MFFunctionGradientNode_GetInputPosFunc: TLib3MFFunctionGradientNode_GetInputPosFunc; + FLib3MFFunctionGradientNode_GetInputStepFunc: TLib3MFFunctionGradientNode_GetInputStepFunc; + FLib3MFFunctionGradientNode_SetScalarOutputNameFunc: TLib3MFFunctionGradientNode_SetScalarOutputNameFunc; + FLib3MFFunctionGradientNode_GetScalarOutputNameFunc: TLib3MFFunctionGradientNode_GetScalarOutputNameFunc; + FLib3MFFunctionGradientNode_SetVectorInputNameFunc: TLib3MFFunctionGradientNode_SetVectorInputNameFunc; + FLib3MFFunctionGradientNode_GetVectorInputNameFunc: TLib3MFFunctionGradientNode_GetVectorInputNameFunc; + FLib3MFFunctionGradientNode_GetOutputNormalizedGradientFunc: TLib3MFFunctionGradientNode_GetOutputNormalizedGradientFunc; + FLib3MFFunctionGradientNode_GetOutputGradientFunc: TLib3MFFunctionGradientNode_GetOutputGradientFunc; + FLib3MFFunctionGradientNode_GetOutputMagnitudeFunc: TLib3MFFunctionGradientNode_GetOutputMagnitudeFunc; + FLib3MFNormalizeDistanceNode_GetInputFunctionIDFunc: TLib3MFNormalizeDistanceNode_GetInputFunctionIDFunc; + FLib3MFNormalizeDistanceNode_GetInputPosFunc: TLib3MFNormalizeDistanceNode_GetInputPosFunc; + FLib3MFNormalizeDistanceNode_GetInputStepFunc: TLib3MFNormalizeDistanceNode_GetInputStepFunc; + FLib3MFNormalizeDistanceNode_SetScalarOutputNameFunc: TLib3MFNormalizeDistanceNode_SetScalarOutputNameFunc; + FLib3MFNormalizeDistanceNode_GetScalarOutputNameFunc: TLib3MFNormalizeDistanceNode_GetScalarOutputNameFunc; + FLib3MFNormalizeDistanceNode_SetVectorInputNameFunc: TLib3MFNormalizeDistanceNode_SetVectorInputNameFunc; + FLib3MFNormalizeDistanceNode_GetVectorInputNameFunc: TLib3MFNormalizeDistanceNode_GetVectorInputNameFunc; + FLib3MFNormalizeDistanceNode_GetOutputResultFunc: TLib3MFNormalizeDistanceNode_GetOutputResultFunc; FLib3MFFunctionCallNode_GetInputFunctionIDFunc: TLib3MFFunctionCallNode_GetInputFunctionIDFunc; FLib3MFNodeIterator_GetCurrentFunc: TLib3MFNodeIterator_GetCurrentFunc; FLib3MFFunction_GetDisplayNameFunc: TLib3MFFunction_GetDisplayNameFunc; @@ -9631,6 +10237,9 @@ TLib3MFWrapper = class(TObject) FLib3MFImplicitFunction_AddConstMatNodeFunc: TLib3MFImplicitFunction_AddConstMatNodeFunc; FLib3MFImplicitFunction_AddMeshNodeFunc: TLib3MFImplicitFunction_AddMeshNodeFunc; FLib3MFImplicitFunction_AddUnsignedMeshNodeFunc: TLib3MFImplicitFunction_AddUnsignedMeshNodeFunc; + FLib3MFImplicitFunction_AddBeamLatticeNodeFunc: TLib3MFImplicitFunction_AddBeamLatticeNodeFunc; + FLib3MFImplicitFunction_AddFunctionGradientNodeFunc: TLib3MFImplicitFunction_AddFunctionGradientNodeFunc; + FLib3MFImplicitFunction_AddNormalizeDistanceNodeFunc: TLib3MFImplicitFunction_AddNormalizeDistanceNodeFunc; FLib3MFImplicitFunction_AddFunctionCallNodeFunc: TLib3MFImplicitFunction_AddFunctionCallNodeFunc; FLib3MFImplicitFunction_GetNodesFunc: TLib3MFImplicitFunction_GetNodesFunc; FLib3MFImplicitFunction_RemoveNodeFunc: TLib3MFImplicitFunction_RemoveNodeFunc; @@ -9740,6 +10349,7 @@ TLib3MFWrapper = class(TObject) FLib3MFModel_GetMultiPropertyGroupByIDFunc: TLib3MFModel_GetMultiPropertyGroupByIDFunc; FLib3MFModel_GetMeshObjectByIDFunc: TLib3MFModel_GetMeshObjectByIDFunc; FLib3MFModel_GetComponentsObjectByIDFunc: TLib3MFModel_GetComponentsObjectByIDFunc; + FLib3MFModel_GetBooleanObjectByIDFunc: TLib3MFModel_GetBooleanObjectByIDFunc; FLib3MFModel_GetColorGroupByIDFunc: TLib3MFModel_GetColorGroupByIDFunc; FLib3MFModel_GetSliceStackByIDFunc: TLib3MFModel_GetSliceStackByIDFunc; FLib3MFModel_GetLevelSetByIDFunc: TLib3MFModel_GetLevelSetByIDFunc; @@ -9751,6 +10361,7 @@ TLib3MFWrapper = class(TObject) FLib3MFModel_GetObjectsFunc: TLib3MFModel_GetObjectsFunc; FLib3MFModel_GetMeshObjectsFunc: TLib3MFModel_GetMeshObjectsFunc; FLib3MFModel_GetComponentsObjectsFunc: TLib3MFModel_GetComponentsObjectsFunc; + FLib3MFModel_GetBooleanObjectsFunc: TLib3MFModel_GetBooleanObjectsFunc; FLib3MFModel_GetTexture2DsFunc: TLib3MFModel_GetTexture2DsFunc; FLib3MFModel_GetBaseMaterialGroupsFunc: TLib3MFModel_GetBaseMaterialGroupsFunc; FLib3MFModel_GetColorGroupsFunc: TLib3MFModel_GetColorGroupsFunc; @@ -9763,6 +10374,7 @@ TLib3MFWrapper = class(TObject) FLib3MFModel_MergeFromModelFunc: TLib3MFModel_MergeFromModelFunc; FLib3MFModel_AddMeshObjectFunc: TLib3MFModel_AddMeshObjectFunc; FLib3MFModel_AddComponentsObjectFunc: TLib3MFModel_AddComponentsObjectFunc; + FLib3MFModel_AddBooleanObjectFunc: TLib3MFModel_AddBooleanObjectFunc; FLib3MFModel_AddSliceStackFunc: TLib3MFModel_AddSliceStackFunc; FLib3MFModel_AddTexture2DFromAttachmentFunc: TLib3MFModel_AddTexture2DFromAttachmentFunc; FLib3MFModel_AddBaseMaterialGroupFunc: TLib3MFModel_AddBaseMaterialGroupFunc; @@ -9866,6 +10478,7 @@ TLib3MFWrapper = class(TObject) property Lib3MFObjectIterator_GetCurrentObjectFunc: TLib3MFObjectIterator_GetCurrentObjectFunc read FLib3MFObjectIterator_GetCurrentObjectFunc; property Lib3MFMeshObjectIterator_GetCurrentMeshObjectFunc: TLib3MFMeshObjectIterator_GetCurrentMeshObjectFunc read FLib3MFMeshObjectIterator_GetCurrentMeshObjectFunc; property Lib3MFComponentsObjectIterator_GetCurrentComponentsObjectFunc: TLib3MFComponentsObjectIterator_GetCurrentComponentsObjectFunc read FLib3MFComponentsObjectIterator_GetCurrentComponentsObjectFunc; + property Lib3MFBooleanObjectIterator_GetCurrentBooleanObjectFunc: TLib3MFBooleanObjectIterator_GetCurrentBooleanObjectFunc read FLib3MFBooleanObjectIterator_GetCurrentBooleanObjectFunc; property Lib3MFTexture2DIterator_GetCurrentTexture2DFunc: TLib3MFTexture2DIterator_GetCurrentTexture2DFunc read FLib3MFTexture2DIterator_GetCurrentTexture2DFunc; property Lib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupFunc: TLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupFunc read FLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupFunc; property Lib3MFColorGroupIterator_GetCurrentColorGroupFunc: TLib3MFColorGroupIterator_GetCurrentColorGroupFunc read FLib3MFColorGroupIterator_GetCurrentColorGroupFunc; @@ -9914,6 +10527,7 @@ TLib3MFWrapper = class(TObject) property Lib3MFObject_IsMeshObjectFunc: TLib3MFObject_IsMeshObjectFunc read FLib3MFObject_IsMeshObjectFunc; property Lib3MFObject_IsComponentsObjectFunc: TLib3MFObject_IsComponentsObjectFunc read FLib3MFObject_IsComponentsObjectFunc; property Lib3MFObject_IsLevelSetObjectFunc: TLib3MFObject_IsLevelSetObjectFunc read FLib3MFObject_IsLevelSetObjectFunc; + property Lib3MFObject_IsBooleanObjectFunc: TLib3MFObject_IsBooleanObjectFunc read FLib3MFObject_IsBooleanObjectFunc; property Lib3MFObject_IsValidFunc: TLib3MFObject_IsValidFunc read FLib3MFObject_IsValidFunc; property Lib3MFObject_SetAttachmentAsThumbnailFunc: TLib3MFObject_SetAttachmentAsThumbnailFunc read FLib3MFObject_SetAttachmentAsThumbnailFunc; property Lib3MFObject_GetThumbnailAttachmentFunc: TLib3MFObject_GetThumbnailAttachmentFunc read FLib3MFObject_GetThumbnailAttachmentFunc; @@ -9971,6 +10585,20 @@ TLib3MFWrapper = class(TObject) property Lib3MFLevelSet_GetMeshFunc: TLib3MFLevelSet_GetMeshFunc read FLib3MFLevelSet_GetMeshFunc; property Lib3MFLevelSet_GetVolumeDataFunc: TLib3MFLevelSet_GetVolumeDataFunc read FLib3MFLevelSet_GetVolumeDataFunc; property Lib3MFLevelSet_SetVolumeDataFunc: TLib3MFLevelSet_SetVolumeDataFunc read FLib3MFLevelSet_SetVolumeDataFunc; + property Lib3MFBooleanObject_SetBaseObjectFunc: TLib3MFBooleanObject_SetBaseObjectFunc read FLib3MFBooleanObject_SetBaseObjectFunc; + property Lib3MFBooleanObject_GetBaseObjectFunc: TLib3MFBooleanObject_GetBaseObjectFunc read FLib3MFBooleanObject_GetBaseObjectFunc; + property Lib3MFBooleanObject_SetBaseTransformFunc: TLib3MFBooleanObject_SetBaseTransformFunc read FLib3MFBooleanObject_SetBaseTransformFunc; + property Lib3MFBooleanObject_GetBaseTransformFunc: TLib3MFBooleanObject_GetBaseTransformFunc read FLib3MFBooleanObject_GetBaseTransformFunc; + property Lib3MFBooleanObject_SetOperationFunc: TLib3MFBooleanObject_SetOperationFunc read FLib3MFBooleanObject_SetOperationFunc; + property Lib3MFBooleanObject_GetOperationFunc: TLib3MFBooleanObject_GetOperationFunc read FLib3MFBooleanObject_GetOperationFunc; + property Lib3MFBooleanObject_SetCSGModeEnabledFunc: TLib3MFBooleanObject_SetCSGModeEnabledFunc read FLib3MFBooleanObject_SetCSGModeEnabledFunc; + property Lib3MFBooleanObject_GetCSGModeEnabledFunc: TLib3MFBooleanObject_GetCSGModeEnabledFunc read FLib3MFBooleanObject_GetCSGModeEnabledFunc; + property Lib3MFBooleanObject_SetExtractionGridResolutionFunc: TLib3MFBooleanObject_SetExtractionGridResolutionFunc read FLib3MFBooleanObject_SetExtractionGridResolutionFunc; + property Lib3MFBooleanObject_GetExtractionGridResolutionFunc: TLib3MFBooleanObject_GetExtractionGridResolutionFunc read FLib3MFBooleanObject_GetExtractionGridResolutionFunc; + property Lib3MFBooleanObject_GetOperandCountFunc: TLib3MFBooleanObject_GetOperandCountFunc read FLib3MFBooleanObject_GetOperandCountFunc; + property Lib3MFBooleanObject_AddOperandFunc: TLib3MFBooleanObject_AddOperandFunc read FLib3MFBooleanObject_AddOperandFunc; + property Lib3MFBooleanObject_GetOperandFunc: TLib3MFBooleanObject_GetOperandFunc read FLib3MFBooleanObject_GetOperandFunc; + property Lib3MFBooleanObject_MergeToMeshObjectFunc: TLib3MFBooleanObject_MergeToMeshObjectFunc read FLib3MFBooleanObject_MergeToMeshObjectFunc; property Lib3MFBeamLattice_GetMinLengthFunc: TLib3MFBeamLattice_GetMinLengthFunc read FLib3MFBeamLattice_GetMinLengthFunc; property Lib3MFBeamLattice_SetMinLengthFunc: TLib3MFBeamLattice_SetMinLengthFunc read FLib3MFBeamLattice_SetMinLengthFunc; property Lib3MFBeamLattice_GetClippingFunc: TLib3MFBeamLattice_GetClippingFunc read FLib3MFBeamLattice_GetClippingFunc; @@ -10198,6 +10826,29 @@ TLib3MFWrapper = class(TObject) property Lib3MFUnsignedMeshNode_GetInputMeshFunc: TLib3MFUnsignedMeshNode_GetInputMeshFunc read FLib3MFUnsignedMeshNode_GetInputMeshFunc; property Lib3MFUnsignedMeshNode_GetInputPosFunc: TLib3MFUnsignedMeshNode_GetInputPosFunc read FLib3MFUnsignedMeshNode_GetInputPosFunc; property Lib3MFUnsignedMeshNode_GetOutputDistanceFunc: TLib3MFUnsignedMeshNode_GetOutputDistanceFunc read FLib3MFUnsignedMeshNode_GetOutputDistanceFunc; + property Lib3MFBeamLatticeNode_GetInputBeamLatticeFunc: TLib3MFBeamLatticeNode_GetInputBeamLatticeFunc read FLib3MFBeamLatticeNode_GetInputBeamLatticeFunc; + property Lib3MFBeamLatticeNode_GetInputPosFunc: TLib3MFBeamLatticeNode_GetInputPosFunc read FLib3MFBeamLatticeNode_GetInputPosFunc; + property Lib3MFBeamLatticeNode_GetOutputDistanceFunc: TLib3MFBeamLatticeNode_GetOutputDistanceFunc read FLib3MFBeamLatticeNode_GetOutputDistanceFunc; + property Lib3MFBeamLatticeNode_SetAccurateRangeFunc: TLib3MFBeamLatticeNode_SetAccurateRangeFunc read FLib3MFBeamLatticeNode_SetAccurateRangeFunc; + property Lib3MFBeamLatticeNode_GetAccurateRangeFunc: TLib3MFBeamLatticeNode_GetAccurateRangeFunc read FLib3MFBeamLatticeNode_GetAccurateRangeFunc; + property Lib3MFFunctionGradientNode_GetInputFunctionIDFunc: TLib3MFFunctionGradientNode_GetInputFunctionIDFunc read FLib3MFFunctionGradientNode_GetInputFunctionIDFunc; + property Lib3MFFunctionGradientNode_GetInputPosFunc: TLib3MFFunctionGradientNode_GetInputPosFunc read FLib3MFFunctionGradientNode_GetInputPosFunc; + property Lib3MFFunctionGradientNode_GetInputStepFunc: TLib3MFFunctionGradientNode_GetInputStepFunc read FLib3MFFunctionGradientNode_GetInputStepFunc; + property Lib3MFFunctionGradientNode_SetScalarOutputNameFunc: TLib3MFFunctionGradientNode_SetScalarOutputNameFunc read FLib3MFFunctionGradientNode_SetScalarOutputNameFunc; + property Lib3MFFunctionGradientNode_GetScalarOutputNameFunc: TLib3MFFunctionGradientNode_GetScalarOutputNameFunc read FLib3MFFunctionGradientNode_GetScalarOutputNameFunc; + property Lib3MFFunctionGradientNode_SetVectorInputNameFunc: TLib3MFFunctionGradientNode_SetVectorInputNameFunc read FLib3MFFunctionGradientNode_SetVectorInputNameFunc; + property Lib3MFFunctionGradientNode_GetVectorInputNameFunc: TLib3MFFunctionGradientNode_GetVectorInputNameFunc read FLib3MFFunctionGradientNode_GetVectorInputNameFunc; + property Lib3MFFunctionGradientNode_GetOutputNormalizedGradientFunc: TLib3MFFunctionGradientNode_GetOutputNormalizedGradientFunc read FLib3MFFunctionGradientNode_GetOutputNormalizedGradientFunc; + property Lib3MFFunctionGradientNode_GetOutputGradientFunc: TLib3MFFunctionGradientNode_GetOutputGradientFunc read FLib3MFFunctionGradientNode_GetOutputGradientFunc; + property Lib3MFFunctionGradientNode_GetOutputMagnitudeFunc: TLib3MFFunctionGradientNode_GetOutputMagnitudeFunc read FLib3MFFunctionGradientNode_GetOutputMagnitudeFunc; + property Lib3MFNormalizeDistanceNode_GetInputFunctionIDFunc: TLib3MFNormalizeDistanceNode_GetInputFunctionIDFunc read FLib3MFNormalizeDistanceNode_GetInputFunctionIDFunc; + property Lib3MFNormalizeDistanceNode_GetInputPosFunc: TLib3MFNormalizeDistanceNode_GetInputPosFunc read FLib3MFNormalizeDistanceNode_GetInputPosFunc; + property Lib3MFNormalizeDistanceNode_GetInputStepFunc: TLib3MFNormalizeDistanceNode_GetInputStepFunc read FLib3MFNormalizeDistanceNode_GetInputStepFunc; + property Lib3MFNormalizeDistanceNode_SetScalarOutputNameFunc: TLib3MFNormalizeDistanceNode_SetScalarOutputNameFunc read FLib3MFNormalizeDistanceNode_SetScalarOutputNameFunc; + property Lib3MFNormalizeDistanceNode_GetScalarOutputNameFunc: TLib3MFNormalizeDistanceNode_GetScalarOutputNameFunc read FLib3MFNormalizeDistanceNode_GetScalarOutputNameFunc; + property Lib3MFNormalizeDistanceNode_SetVectorInputNameFunc: TLib3MFNormalizeDistanceNode_SetVectorInputNameFunc read FLib3MFNormalizeDistanceNode_SetVectorInputNameFunc; + property Lib3MFNormalizeDistanceNode_GetVectorInputNameFunc: TLib3MFNormalizeDistanceNode_GetVectorInputNameFunc read FLib3MFNormalizeDistanceNode_GetVectorInputNameFunc; + property Lib3MFNormalizeDistanceNode_GetOutputResultFunc: TLib3MFNormalizeDistanceNode_GetOutputResultFunc read FLib3MFNormalizeDistanceNode_GetOutputResultFunc; property Lib3MFFunctionCallNode_GetInputFunctionIDFunc: TLib3MFFunctionCallNode_GetInputFunctionIDFunc read FLib3MFFunctionCallNode_GetInputFunctionIDFunc; property Lib3MFNodeIterator_GetCurrentFunc: TLib3MFNodeIterator_GetCurrentFunc read FLib3MFNodeIterator_GetCurrentFunc; property Lib3MFFunction_GetDisplayNameFunc: TLib3MFFunction_GetDisplayNameFunc read FLib3MFFunction_GetDisplayNameFunc; @@ -10261,6 +10912,9 @@ TLib3MFWrapper = class(TObject) property Lib3MFImplicitFunction_AddConstMatNodeFunc: TLib3MFImplicitFunction_AddConstMatNodeFunc read FLib3MFImplicitFunction_AddConstMatNodeFunc; property Lib3MFImplicitFunction_AddMeshNodeFunc: TLib3MFImplicitFunction_AddMeshNodeFunc read FLib3MFImplicitFunction_AddMeshNodeFunc; property Lib3MFImplicitFunction_AddUnsignedMeshNodeFunc: TLib3MFImplicitFunction_AddUnsignedMeshNodeFunc read FLib3MFImplicitFunction_AddUnsignedMeshNodeFunc; + property Lib3MFImplicitFunction_AddBeamLatticeNodeFunc: TLib3MFImplicitFunction_AddBeamLatticeNodeFunc read FLib3MFImplicitFunction_AddBeamLatticeNodeFunc; + property Lib3MFImplicitFunction_AddFunctionGradientNodeFunc: TLib3MFImplicitFunction_AddFunctionGradientNodeFunc read FLib3MFImplicitFunction_AddFunctionGradientNodeFunc; + property Lib3MFImplicitFunction_AddNormalizeDistanceNodeFunc: TLib3MFImplicitFunction_AddNormalizeDistanceNodeFunc read FLib3MFImplicitFunction_AddNormalizeDistanceNodeFunc; property Lib3MFImplicitFunction_AddFunctionCallNodeFunc: TLib3MFImplicitFunction_AddFunctionCallNodeFunc read FLib3MFImplicitFunction_AddFunctionCallNodeFunc; property Lib3MFImplicitFunction_GetNodesFunc: TLib3MFImplicitFunction_GetNodesFunc read FLib3MFImplicitFunction_GetNodesFunc; property Lib3MFImplicitFunction_RemoveNodeFunc: TLib3MFImplicitFunction_RemoveNodeFunc read FLib3MFImplicitFunction_RemoveNodeFunc; @@ -10370,6 +11024,7 @@ TLib3MFWrapper = class(TObject) property Lib3MFModel_GetMultiPropertyGroupByIDFunc: TLib3MFModel_GetMultiPropertyGroupByIDFunc read FLib3MFModel_GetMultiPropertyGroupByIDFunc; property Lib3MFModel_GetMeshObjectByIDFunc: TLib3MFModel_GetMeshObjectByIDFunc read FLib3MFModel_GetMeshObjectByIDFunc; property Lib3MFModel_GetComponentsObjectByIDFunc: TLib3MFModel_GetComponentsObjectByIDFunc read FLib3MFModel_GetComponentsObjectByIDFunc; + property Lib3MFModel_GetBooleanObjectByIDFunc: TLib3MFModel_GetBooleanObjectByIDFunc read FLib3MFModel_GetBooleanObjectByIDFunc; property Lib3MFModel_GetColorGroupByIDFunc: TLib3MFModel_GetColorGroupByIDFunc read FLib3MFModel_GetColorGroupByIDFunc; property Lib3MFModel_GetSliceStackByIDFunc: TLib3MFModel_GetSliceStackByIDFunc read FLib3MFModel_GetSliceStackByIDFunc; property Lib3MFModel_GetLevelSetByIDFunc: TLib3MFModel_GetLevelSetByIDFunc read FLib3MFModel_GetLevelSetByIDFunc; @@ -10381,6 +11036,7 @@ TLib3MFWrapper = class(TObject) property Lib3MFModel_GetObjectsFunc: TLib3MFModel_GetObjectsFunc read FLib3MFModel_GetObjectsFunc; property Lib3MFModel_GetMeshObjectsFunc: TLib3MFModel_GetMeshObjectsFunc read FLib3MFModel_GetMeshObjectsFunc; property Lib3MFModel_GetComponentsObjectsFunc: TLib3MFModel_GetComponentsObjectsFunc read FLib3MFModel_GetComponentsObjectsFunc; + property Lib3MFModel_GetBooleanObjectsFunc: TLib3MFModel_GetBooleanObjectsFunc read FLib3MFModel_GetBooleanObjectsFunc; property Lib3MFModel_GetTexture2DsFunc: TLib3MFModel_GetTexture2DsFunc read FLib3MFModel_GetTexture2DsFunc; property Lib3MFModel_GetBaseMaterialGroupsFunc: TLib3MFModel_GetBaseMaterialGroupsFunc read FLib3MFModel_GetBaseMaterialGroupsFunc; property Lib3MFModel_GetColorGroupsFunc: TLib3MFModel_GetColorGroupsFunc read FLib3MFModel_GetColorGroupsFunc; @@ -10393,6 +11049,7 @@ TLib3MFWrapper = class(TObject) property Lib3MFModel_MergeFromModelFunc: TLib3MFModel_MergeFromModelFunc read FLib3MFModel_MergeFromModelFunc; property Lib3MFModel_AddMeshObjectFunc: TLib3MFModel_AddMeshObjectFunc read FLib3MFModel_AddMeshObjectFunc; property Lib3MFModel_AddComponentsObjectFunc: TLib3MFModel_AddComponentsObjectFunc read FLib3MFModel_AddComponentsObjectFunc; + property Lib3MFModel_AddBooleanObjectFunc: TLib3MFModel_AddBooleanObjectFunc read FLib3MFModel_AddBooleanObjectFunc; property Lib3MFModel_AddSliceStackFunc: TLib3MFModel_AddSliceStackFunc read FLib3MFModel_AddSliceStackFunc; property Lib3MFModel_AddTexture2DFromAttachmentFunc: TLib3MFModel_AddTexture2DFromAttachmentFunc read FLib3MFModel_AddTexture2DFromAttachmentFunc; property Lib3MFModel_AddBaseMaterialGroupFunc: TLib3MFModel_AddBaseMaterialGroupFunc read FLib3MFModel_AddBaseMaterialGroupFunc; @@ -10470,57 +11127,6 @@ TLib3MFWrapper = class(TObject) function GetTranslationTransform(const AVectorX: Single; const AVectorY: Single; const AVectorZ: Single): TLib3MFTransform; end; -(************************************************************************************************************************* - Enum conversion -**************************************************************************************************************************) - - function convertPropertyTypeToConst(const AValue: TLib3MFPropertyType): Integer; - function convertConstToPropertyType(const AValue: Integer): TLib3MFPropertyType; - function convertSlicesMeshResolutionToConst(const AValue: TLib3MFSlicesMeshResolution): Integer; - function convertConstToSlicesMeshResolution(const AValue: Integer): TLib3MFSlicesMeshResolution; - function convertModelUnitToConst(const AValue: TLib3MFModelUnit): Integer; - function convertConstToModelUnit(const AValue: Integer): TLib3MFModelUnit; - function convertObjectTypeToConst(const AValue: TLib3MFObjectType): Integer; - function convertConstToObjectType(const AValue: Integer): TLib3MFObjectType; - function convertTextureTypeToConst(const AValue: TLib3MFTextureType): Integer; - function convertConstToTextureType(const AValue: Integer): TLib3MFTextureType; - function convertTextureTileStyleToConst(const AValue: TLib3MFTextureTileStyle): Integer; - function convertConstToTextureTileStyle(const AValue: Integer): TLib3MFTextureTileStyle; - function convertTextureFilterToConst(const AValue: TLib3MFTextureFilter): Integer; - function convertConstToTextureFilter(const AValue: Integer): TLib3MFTextureFilter; - function convertBeamLatticeCapModeToConst(const AValue: TLib3MFBeamLatticeCapMode): Integer; - function convertConstToBeamLatticeCapMode(const AValue: Integer): TLib3MFBeamLatticeCapMode; - function convertBeamLatticeClipModeToConst(const AValue: TLib3MFBeamLatticeClipMode): Integer; - function convertConstToBeamLatticeClipMode(const AValue: Integer): TLib3MFBeamLatticeClipMode; - function convertBeamLatticeBallModeToConst(const AValue: TLib3MFBeamLatticeBallMode): Integer; - function convertConstToBeamLatticeBallMode(const AValue: Integer): TLib3MFBeamLatticeBallMode; - function convertProgressIdentifierToConst(const AValue: TLib3MFProgressIdentifier): Integer; - function convertConstToProgressIdentifier(const AValue: Integer): TLib3MFProgressIdentifier; - function convertBlendMethodToConst(const AValue: TLib3MFBlendMethod): Integer; - function convertConstToBlendMethod(const AValue: Integer): TLib3MFBlendMethod; - function convertChannelNameToConst(const AValue: TLib3MFChannelName): Integer; - function convertConstToChannelName(const AValue: Integer): TLib3MFChannelName; - function convertCompositionMethodToConst(const AValue: TLib3MFCompositionMethod): Integer; - function convertConstToCompositionMethod(const AValue: Integer): TLib3MFCompositionMethod; - function convertCompositionSpaceToConst(const AValue: TLib3MFCompositionSpace): Integer; - function convertConstToCompositionSpace(const AValue: Integer): TLib3MFCompositionSpace; - function convertImplicitNodeTypeToConst(const AValue: TLib3MFImplicitNodeType): Integer; - function convertConstToImplicitNodeType(const AValue: Integer): TLib3MFImplicitNodeType; - function convertImplicitPortTypeToConst(const AValue: TLib3MFImplicitPortType): Integer; - function convertConstToImplicitPortType(const AValue: Integer): TLib3MFImplicitPortType; - function convertImplicitNodeConfigurationToConst(const AValue: TLib3MFImplicitNodeConfiguration): Integer; - function convertConstToImplicitNodeConfiguration(const AValue: Integer): TLib3MFImplicitNodeConfiguration; - function convertEncryptionAlgorithmToConst(const AValue: TLib3MFEncryptionAlgorithm): Integer; - function convertConstToEncryptionAlgorithm(const AValue: Integer): TLib3MFEncryptionAlgorithm; - function convertWrappingAlgorithmToConst(const AValue: TLib3MFWrappingAlgorithm): Integer; - function convertConstToWrappingAlgorithm(const AValue: Integer): TLib3MFWrappingAlgorithm; - function convertMgfAlgorithmToConst(const AValue: TLib3MFMgfAlgorithm): Integer; - function convertConstToMgfAlgorithm(const AValue: Integer): TLib3MFMgfAlgorithm; - function convertDigestMethodToConst(const AValue: TLib3MFDigestMethod): Integer; - function convertConstToDigestMethod(const AValue: Integer): TLib3MFDigestMethod; - function convertCompressionToConst(const AValue: TLib3MFCompression): Integer; - function convertConstToCompression(const AValue: Integer): TLib3MFCompression; - TLib3MFPolymorphicFactory<_T:class; _B> = record class function Make(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): _T; static; end; @@ -10534,6 +11140,7 @@ TLib3MFPolymorphicFactory<_T:class; _B> = record function TLib3MFPolymorphicFactoryMakeObjectIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFObjectIterator; function TLib3MFPolymorphicFactoryMakeMeshObjectIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMeshObjectIterator; function TLib3MFPolymorphicFactoryMakeComponentsObjectIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFComponentsObjectIterator; + function TLib3MFPolymorphicFactoryMakeBooleanObjectIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBooleanObjectIterator; function TLib3MFPolymorphicFactoryMakeTexture2DIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2DIterator; function TLib3MFPolymorphicFactoryMakeBaseMaterialGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBaseMaterialGroupIterator; function TLib3MFPolymorphicFactoryMakeColorGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFColorGroupIterator; @@ -10549,6 +11156,7 @@ TLib3MFPolymorphicFactory<_T:class; _B> = record function TLib3MFPolymorphicFactoryMakeObject(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFObject; function TLib3MFPolymorphicFactoryMakeMeshObject(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMeshObject; function TLib3MFPolymorphicFactoryMakeLevelSet(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFLevelSet; + function TLib3MFPolymorphicFactoryMakeBooleanObject(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBooleanObject; function TLib3MFPolymorphicFactoryMakeBeamLattice(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBeamLattice; function TLib3MFPolymorphicFactoryMakeFunctionReference(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFFunctionReference; function TLib3MFPolymorphicFactoryMakeVolumeDataColor(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFVolumeDataColor; @@ -10624,6 +11232,9 @@ TLib3MFPolymorphicFactory<_T:class; _B> = record function TLib3MFPolymorphicFactoryMakeConstMatNode(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFConstMatNode; function TLib3MFPolymorphicFactoryMakeMeshNode(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMeshNode; function TLib3MFPolymorphicFactoryMakeUnsignedMeshNode(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFUnsignedMeshNode; + function TLib3MFPolymorphicFactoryMakeBeamLatticeNode(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBeamLatticeNode; + function TLib3MFPolymorphicFactoryMakeFunctionGradientNode(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFFunctionGradientNode; + function TLib3MFPolymorphicFactoryMakeNormalizeDistanceNode(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFNormalizeDistanceNode; function TLib3MFPolymorphicFactoryMakeFunctionCallNode(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFFunctionCallNode; function TLib3MFPolymorphicFactoryMakeNodeIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFNodeIterator; function TLib3MFPolymorphicFactoryMakeFunction(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFFunction; @@ -10640,6 +11251,59 @@ TLib3MFPolymorphicFactory<_T:class; _B> = record function TLib3MFPolymorphicFactoryMakeResourceDataGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFResourceDataGroup; function TLib3MFPolymorphicFactoryMakeKeyStore(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFKeyStore; function TLib3MFPolymorphicFactoryMakeModel(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFModel; +(************************************************************************************************************************* + Enum conversion +**************************************************************************************************************************) + + function convertPropertyTypeToConst(const AValue: TLib3MFPropertyType): Integer; + function convertConstToPropertyType(const AValue: Integer): TLib3MFPropertyType; + function convertSlicesMeshResolutionToConst(const AValue: TLib3MFSlicesMeshResolution): Integer; + function convertConstToSlicesMeshResolution(const AValue: Integer): TLib3MFSlicesMeshResolution; + function convertModelUnitToConst(const AValue: TLib3MFModelUnit): Integer; + function convertConstToModelUnit(const AValue: Integer): TLib3MFModelUnit; + function convertObjectTypeToConst(const AValue: TLib3MFObjectType): Integer; + function convertConstToObjectType(const AValue: Integer): TLib3MFObjectType; + function convertBooleanOperationToConst(const AValue: TLib3MFBooleanOperation): Integer; + function convertConstToBooleanOperation(const AValue: Integer): TLib3MFBooleanOperation; + function convertTextureTypeToConst(const AValue: TLib3MFTextureType): Integer; + function convertConstToTextureType(const AValue: Integer): TLib3MFTextureType; + function convertTextureTileStyleToConst(const AValue: TLib3MFTextureTileStyle): Integer; + function convertConstToTextureTileStyle(const AValue: Integer): TLib3MFTextureTileStyle; + function convertTextureFilterToConst(const AValue: TLib3MFTextureFilter): Integer; + function convertConstToTextureFilter(const AValue: Integer): TLib3MFTextureFilter; + function convertBeamLatticeCapModeToConst(const AValue: TLib3MFBeamLatticeCapMode): Integer; + function convertConstToBeamLatticeCapMode(const AValue: Integer): TLib3MFBeamLatticeCapMode; + function convertBeamLatticeClipModeToConst(const AValue: TLib3MFBeamLatticeClipMode): Integer; + function convertConstToBeamLatticeClipMode(const AValue: Integer): TLib3MFBeamLatticeClipMode; + function convertBeamLatticeBallModeToConst(const AValue: TLib3MFBeamLatticeBallMode): Integer; + function convertConstToBeamLatticeBallMode(const AValue: Integer): TLib3MFBeamLatticeBallMode; + function convertProgressIdentifierToConst(const AValue: TLib3MFProgressIdentifier): Integer; + function convertConstToProgressIdentifier(const AValue: Integer): TLib3MFProgressIdentifier; + function convertBlendMethodToConst(const AValue: TLib3MFBlendMethod): Integer; + function convertConstToBlendMethod(const AValue: Integer): TLib3MFBlendMethod; + function convertChannelNameToConst(const AValue: TLib3MFChannelName): Integer; + function convertConstToChannelName(const AValue: Integer): TLib3MFChannelName; + function convertCompositionMethodToConst(const AValue: TLib3MFCompositionMethod): Integer; + function convertConstToCompositionMethod(const AValue: Integer): TLib3MFCompositionMethod; + function convertCompositionSpaceToConst(const AValue: TLib3MFCompositionSpace): Integer; + function convertConstToCompositionSpace(const AValue: Integer): TLib3MFCompositionSpace; + function convertImplicitNodeTypeToConst(const AValue: TLib3MFImplicitNodeType): Integer; + function convertConstToImplicitNodeType(const AValue: Integer): TLib3MFImplicitNodeType; + function convertImplicitPortTypeToConst(const AValue: TLib3MFImplicitPortType): Integer; + function convertConstToImplicitPortType(const AValue: Integer): TLib3MFImplicitPortType; + function convertImplicitNodeConfigurationToConst(const AValue: TLib3MFImplicitNodeConfiguration): Integer; + function convertConstToImplicitNodeConfiguration(const AValue: Integer): TLib3MFImplicitNodeConfiguration; + function convertEncryptionAlgorithmToConst(const AValue: TLib3MFEncryptionAlgorithm): Integer; + function convertConstToEncryptionAlgorithm(const AValue: Integer): TLib3MFEncryptionAlgorithm; + function convertWrappingAlgorithmToConst(const AValue: TLib3MFWrappingAlgorithm): Integer; + function convertConstToWrappingAlgorithm(const AValue: Integer): TLib3MFWrappingAlgorithm; + function convertMgfAlgorithmToConst(const AValue: TLib3MFMgfAlgorithm): Integer; + function convertConstToMgfAlgorithm(const AValue: Integer): TLib3MFMgfAlgorithm; + function convertDigestMethodToConst(const AValue: TLib3MFDigestMethod): Integer; + function convertConstToDigestMethod(const AValue: Integer): TLib3MFDigestMethod; + function convertCompressionToConst(const AValue: TLib3MFCompression): Integer; + function convertConstToCompression(const AValue: Integer): TLib3MFCompression; + implementation @@ -10733,6 +11397,7 @@ implementation eObjectTypeModel: Result := 1; eObjectTypeSupport: Result := 2; eObjectTypeSolidSupport: Result := 3; + eObjectTypeSurface: Result := 4; else raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); end; @@ -10745,6 +11410,30 @@ implementation 1: Result := eObjectTypeModel; 2: Result := eObjectTypeSupport; 3: Result := eObjectTypeSolidSupport; + 4: Result := eObjectTypeSurface; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertBooleanOperationToConst(const AValue: TLib3MFBooleanOperation): Integer; + begin + case AValue of + eBooleanOperationUnion: Result := 0; + eBooleanOperationDifference: Result := 1; + eBooleanOperationIntersection: Result := 2; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToBooleanOperation(const AValue: Integer): TLib3MFBooleanOperation; + begin + case AValue of + 0: Result := eBooleanOperationUnion; + 1: Result := eBooleanOperationDifference; + 2: Result := eBooleanOperationIntersection; else raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); end; @@ -11106,6 +11795,9 @@ implementation eImplicitNodeTypeVectorFromScalar: Result := 48; eImplicitNodeTypeUnsignedMesh: Result := 49; eImplicitNodeTypeMod: Result := 50; + eImplicitNodeTypeBeamLattice: Result := 51; + eImplicitNodeTypeFunctionGradient: Result := 52; + eImplicitNodeTypeNormalizeDistance: Result := 53; else raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); end; @@ -11165,6 +11857,9 @@ implementation 48: Result := eImplicitNodeTypeVectorFromScalar; 49: Result := eImplicitNodeTypeUnsignedMesh; 50: Result := eImplicitNodeTypeMod; + 51: Result := eImplicitNodeTypeBeamLattice; + 52: Result := eImplicitNodeTypeFunctionGradient; + 53: Result := eImplicitNodeTypeNormalizeDistance; else raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); end; @@ -11359,6 +12054,7 @@ implementation QWord($DE92510BD2112288): begin Obj := TLIB3MFObjectIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ObjectIterator" QWord($F4196034E2B9FDE6): begin Obj := TLIB3MFMeshObjectIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObjectIterator" QWord($564DE4217ED7614A): begin Obj := TLIB3MFComponentsObjectIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObjectIterator" + QWord($AFF01F512E1FF6AE): begin Obj := TLIB3MFBooleanObjectIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BooleanObjectIterator" QWord($4BD32B4870FFC03B): begin Obj := TLIB3MFTexture2DIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DIterator" QWord($65E6EDD9362C79CB): begin Obj := TLIB3MFBaseMaterialGroupIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroupIterator" QWord($10274A1757C729C0): begin Obj := TLIB3MFColorGroupIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroupIterator" @@ -11374,6 +12070,7 @@ implementation QWord($2DA2136F577A779C): begin Obj := TLIB3MFObject.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Object" QWord($3B3A6DC6EC610497): begin Obj := TLIB3MFMeshObject.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObject" QWord($E8A7D9C192EFD0E2): begin Obj := TLIB3MFLevelSet.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::LevelSet" + QWord($85FA0E8806B6C357): begin Obj := TLIB3MFBooleanObject.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BooleanObject" QWord($63B3B461B30B4BA5): begin Obj := TLIB3MFBeamLattice.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLattice" QWord($4DF17E76926221C2): begin Obj := TLIB3MFFunctionReference.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionReference" QWord($D85B5B6143E787E3): begin Obj := TLIB3MFVolumeDataColor.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::VolumeDataColor" @@ -11449,6 +12146,9 @@ implementation QWord($F85C90EDCE6F90A4): begin Obj := TLIB3MFConstMatNode.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ConstMatNode" QWord($53601FD432E3DEF4): begin Obj := TLIB3MFMeshNode.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::MeshNode" QWord($29985A628251A9CD): begin Obj := TLIB3MFUnsignedMeshNode.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::UnsignedMeshNode" + QWord($0F3A4EE98F7FEC0C): begin Obj := TLIB3MFBeamLatticeNode.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLatticeNode" + QWord($0437E27AEF740121): begin Obj := TLIB3MFFunctionGradientNode.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionGradientNode" + QWord($817D2E566E73AA8F): begin Obj := TLIB3MFNormalizeDistanceNode.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::NormalizeDistanceNode" QWord($0765C17C952F24E3): begin Obj := TLIB3MFFunctionCallNode.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionCallNode" QWord($FC006BC888CAB4D0): begin Obj := TLIB3MFNodeIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::NodeIterator" QWord($9EFB2757CA1A5231): begin Obj := TLIB3MFFunction.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Function" @@ -11508,6 +12208,10 @@ implementation begin Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); end; + function TLib3MFPolymorphicFactoryMakeBooleanObjectIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBooleanObjectIterator; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; function TLib3MFPolymorphicFactoryMakeTexture2DIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2DIterator; begin Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); @@ -11568,6 +12272,10 @@ implementation begin Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); end; + function TLib3MFPolymorphicFactoryMakeBooleanObject(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBooleanObject; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; function TLib3MFPolymorphicFactoryMakeBeamLattice(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBeamLattice; begin Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); @@ -11868,6 +12576,18 @@ implementation begin Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); end; + function TLib3MFPolymorphicFactoryMakeBeamLatticeNode(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBeamLatticeNode; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeFunctionGradientNode(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFFunctionGradientNode; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeNormalizeDistanceNode(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFNormalizeDistanceNode; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; function TLib3MFPolymorphicFactoryMakeFunctionCallNode(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFFunctionCallNode; begin Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); @@ -12494,6 +13214,31 @@ implementation Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); end; +(************************************************************************************************************************* + Class implementation for BooleanObjectIterator +**************************************************************************************************************************) + + constructor TLib3MFBooleanObjectIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + begin + inherited Create(AWrapper, AHandle); + end; + + destructor TLib3MFBooleanObjectIterator.Destroy; + begin + inherited; + end; + + function TLib3MFBooleanObjectIterator.GetCurrentBooleanObject(): TLib3MFBooleanObject; + var + HResource: TLib3MFHandle; + begin + Result := nil; + HResource := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFBooleanObjectIterator_GetCurrentBooleanObjectFunc(FHandle, HResource)); + if Assigned(HResource) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); + end; + (************************************************************************************************************************* Class implementation for Texture2DIterator **************************************************************************************************************************) @@ -13136,6 +13881,15 @@ implementation Result := (ResultIsLevelSetObject <> 0); end; + function TLib3MFObject.IsBooleanObject(): Boolean; + var + ResultIsBooleanObject: Byte; + begin + ResultIsBooleanObject := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_IsBooleanObjectFunc(FHandle, ResultIsBooleanObject)); + Result := (ResultIsBooleanObject <> 0); + end; + function TLib3MFObject.IsValid(): Boolean; var ResultIsValid: Byte; @@ -13654,22 +14408,144 @@ implementation end; (************************************************************************************************************************* - Class implementation for BeamLattice + Class implementation for BooleanObject **************************************************************************************************************************) - constructor TLib3MFBeamLattice.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + constructor TLib3MFBooleanObject.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin inherited Create(AWrapper, AHandle); end; - destructor TLib3MFBeamLattice.Destroy; + destructor TLib3MFBooleanObject.Destroy; begin inherited; end; - function TLib3MFBeamLattice.GetMinLength(): Double; + procedure TLib3MFBooleanObject.SetBaseObject(const ABaseObject: TLib3MFObject; const ATransform: TLib3MFTransform); + var + ABaseObjectHandle: TLib3MFHandle; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetMinLengthFunc(FHandle, Result)); + if Assigned(ABaseObject) then + ABaseObjectHandle := ABaseObject.TheHandle + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ABaseObject is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFBooleanObject_SetBaseObjectFunc(FHandle, ABaseObjectHandle, @ATransform)); + end; + + function TLib3MFBooleanObject.GetBaseObject(): TLib3MFObject; + var + HBaseObject: TLib3MFHandle; + begin + Result := nil; + HBaseObject := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFBooleanObject_GetBaseObjectFunc(FHandle, HBaseObject)); + if Assigned(HBaseObject) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HBaseObject); + end; + + procedure TLib3MFBooleanObject.SetBaseTransform(const ATransform: TLib3MFTransform); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBooleanObject_SetBaseTransformFunc(FHandle, @ATransform)); + end; + + function TLib3MFBooleanObject.GetBaseTransform(): TLib3MFTransform; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBooleanObject_GetBaseTransformFunc(FHandle, @Result)); + end; + + procedure TLib3MFBooleanObject.SetOperation(const AOperation: TLib3MFBooleanOperation); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBooleanObject_SetOperationFunc(FHandle, convertBooleanOperationToConst(AOperation))); + end; + + function TLib3MFBooleanObject.GetOperation(): TLib3MFBooleanOperation; + var + ResultOperation: Integer; + begin + ResultOperation := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBooleanObject_GetOperationFunc(FHandle, ResultOperation)); + Result := convertConstToBooleanOperation(ResultOperation); + end; + + procedure TLib3MFBooleanObject.SetCSGModeEnabled(const ACSGModeEnabled: Boolean); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBooleanObject_SetCSGModeEnabledFunc(FHandle, Ord(ACSGModeEnabled))); + end; + + function TLib3MFBooleanObject.GetCSGModeEnabled(): Boolean; + var + ResultCSGModeEnabled: Byte; + begin + ResultCSGModeEnabled := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBooleanObject_GetCSGModeEnabledFunc(FHandle, ResultCSGModeEnabled)); + Result := (ResultCSGModeEnabled <> 0); + end; + + procedure TLib3MFBooleanObject.SetExtractionGridResolution(const AGridResolution: Cardinal); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBooleanObject_SetExtractionGridResolutionFunc(FHandle, AGridResolution)); + end; + + function TLib3MFBooleanObject.GetExtractionGridResolution(): Cardinal; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBooleanObject_GetExtractionGridResolutionFunc(FHandle, Result)); + end; + + function TLib3MFBooleanObject.GetOperandCount(): Cardinal; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBooleanObject_GetOperandCountFunc(FHandle, Result)); + end; + + procedure TLib3MFBooleanObject.AddOperand(const AOperandObject: TLib3MFMeshObject; const ATransform: TLib3MFTransform); + var + AOperandObjectHandle: TLib3MFHandle; + begin + if Assigned(AOperandObject) then + AOperandObjectHandle := AOperandObject.TheHandle + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'AOperandObject is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFBooleanObject_AddOperandFunc(FHandle, AOperandObjectHandle, @ATransform)); + end; + + function TLib3MFBooleanObject.GetOperand(const AIndex: Cardinal; out AOperandObject: TLib3MFMeshObject): TLib3MFTransform; + var + HOperandObject: TLib3MFHandle; + begin + AOperandObject := nil; + HOperandObject := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFBooleanObject_GetOperandFunc(FHandle, AIndex, HOperandObject, @Result)); + if Assigned(HOperandObject) then + AOperandObject := TLib3MFMeshObject.Create(FWrapper, HOperandObject); + end; + + function TLib3MFBooleanObject.MergeToMeshObject(): TLib3MFMeshObject; + var + HMeshObject: TLib3MFHandle; + begin + Result := nil; + HMeshObject := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFBooleanObject_MergeToMeshObjectFunc(FHandle, HMeshObject)); + if Assigned(HMeshObject) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HMeshObject); + end; + +(************************************************************************************************************************* + Class implementation for BeamLattice +**************************************************************************************************************************) + + constructor TLib3MFBeamLattice.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + begin + inherited Create(AWrapper, AHandle); + end; + + destructor TLib3MFBeamLattice.Destroy; + begin + inherited; + end; + + function TLib3MFBeamLattice.GetMinLength(): Double; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetMinLengthFunc(FHandle, Result)); end; procedure TLib3MFBeamLattice.SetMinLength(const AMinLength: Double); @@ -16758,6 +17634,277 @@ implementation Result := TLib3MFPolymorphicFactory.Make(FWrapper, HDistance); end; +(************************************************************************************************************************* + Class implementation for BeamLatticeNode +**************************************************************************************************************************) + + constructor TLib3MFBeamLatticeNode.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + begin + inherited Create(AWrapper, AHandle); + end; + + destructor TLib3MFBeamLatticeNode.Destroy; + begin + inherited; + end; + + function TLib3MFBeamLatticeNode.GetInputBeamLattice(): TLib3MFImplicitPort; + var + HBeamLattice: TLib3MFHandle; + begin + Result := nil; + HBeamLattice := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLatticeNode_GetInputBeamLatticeFunc(FHandle, HBeamLattice)); + if Assigned(HBeamLattice) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HBeamLattice); + end; + + function TLib3MFBeamLatticeNode.GetInputPos(): TLib3MFImplicitPort; + var + HPos: TLib3MFHandle; + begin + Result := nil; + HPos := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLatticeNode_GetInputPosFunc(FHandle, HPos)); + if Assigned(HPos) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HPos); + end; + + function TLib3MFBeamLatticeNode.GetOutputDistance(): TLib3MFImplicitPort; + var + HDistance: TLib3MFHandle; + begin + Result := nil; + HDistance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLatticeNode_GetOutputDistanceFunc(FHandle, HDistance)); + if Assigned(HDistance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HDistance); + end; + + procedure TLib3MFBeamLatticeNode.SetAccurateRange(const AAccurateRange: Double); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLatticeNode_SetAccurateRangeFunc(FHandle, AAccurateRange)); + end; + + function TLib3MFBeamLatticeNode.GetAccurateRange(): Double; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLatticeNode_GetAccurateRangeFunc(FHandle, Result)); + end; + +(************************************************************************************************************************* + Class implementation for FunctionGradientNode +**************************************************************************************************************************) + + constructor TLib3MFFunctionGradientNode.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + begin + inherited Create(AWrapper, AHandle); + end; + + destructor TLib3MFFunctionGradientNode.Destroy; + begin + inherited; + end; + + function TLib3MFFunctionGradientNode.GetInputFunctionID(): TLib3MFImplicitPort; + var + HFunction: TLib3MFHandle; + begin + Result := nil; + HFunction := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFFunctionGradientNode_GetInputFunctionIDFunc(FHandle, HFunction)); + if Assigned(HFunction) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HFunction); + end; + + function TLib3MFFunctionGradientNode.GetInputPos(): TLib3MFImplicitPort; + var + HPos: TLib3MFHandle; + begin + Result := nil; + HPos := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFFunctionGradientNode_GetInputPosFunc(FHandle, HPos)); + if Assigned(HPos) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HPos); + end; + + function TLib3MFFunctionGradientNode.GetInputStep(): TLib3MFImplicitPort; + var + HStep: TLib3MFHandle; + begin + Result := nil; + HStep := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFFunctionGradientNode_GetInputStepFunc(FHandle, HStep)); + if Assigned(HStep) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HStep); + end; + + procedure TLib3MFFunctionGradientNode.SetScalarOutputName(const AScalarOutputName: String); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFFunctionGradientNode_SetScalarOutputNameFunc(FHandle, PAnsiChar(AScalarOutputName))); + end; + + function TLib3MFFunctionGradientNode.GetScalarOutputName(): String; + var + bytesNeededScalarOutputName: Cardinal; + bytesWrittenScalarOutputName: Cardinal; + bufferScalarOutputName: array of Char; + begin + bytesNeededScalarOutputName:= 0; + bytesWrittenScalarOutputName:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFFunctionGradientNode_GetScalarOutputNameFunc(FHandle, 0, bytesNeededScalarOutputName, nil)); + SetLength(bufferScalarOutputName, bytesNeededScalarOutputName); + FWrapper.CheckError(Self, FWrapper.Lib3MFFunctionGradientNode_GetScalarOutputNameFunc(FHandle, bytesNeededScalarOutputName, bytesWrittenScalarOutputName, @bufferScalarOutputName[0])); + Result := StrPas(@bufferScalarOutputName[0]); + end; + + procedure TLib3MFFunctionGradientNode.SetVectorInputName(const AVectorInputName: String); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFFunctionGradientNode_SetVectorInputNameFunc(FHandle, PAnsiChar(AVectorInputName))); + end; + + function TLib3MFFunctionGradientNode.GetVectorInputName(): String; + var + bytesNeededVectorInputName: Cardinal; + bytesWrittenVectorInputName: Cardinal; + bufferVectorInputName: array of Char; + begin + bytesNeededVectorInputName:= 0; + bytesWrittenVectorInputName:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFFunctionGradientNode_GetVectorInputNameFunc(FHandle, 0, bytesNeededVectorInputName, nil)); + SetLength(bufferVectorInputName, bytesNeededVectorInputName); + FWrapper.CheckError(Self, FWrapper.Lib3MFFunctionGradientNode_GetVectorInputNameFunc(FHandle, bytesNeededVectorInputName, bytesWrittenVectorInputName, @bufferVectorInputName[0])); + Result := StrPas(@bufferVectorInputName[0]); + end; + + function TLib3MFFunctionGradientNode.GetOutputNormalizedGradient(): TLib3MFImplicitPort; + var + HNormalizedGradient: TLib3MFHandle; + begin + Result := nil; + HNormalizedGradient := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFFunctionGradientNode_GetOutputNormalizedGradientFunc(FHandle, HNormalizedGradient)); + if Assigned(HNormalizedGradient) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HNormalizedGradient); + end; + + function TLib3MFFunctionGradientNode.GetOutputGradient(): TLib3MFImplicitPort; + var + HGradient: TLib3MFHandle; + begin + Result := nil; + HGradient := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFFunctionGradientNode_GetOutputGradientFunc(FHandle, HGradient)); + if Assigned(HGradient) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HGradient); + end; + + function TLib3MFFunctionGradientNode.GetOutputMagnitude(): TLib3MFImplicitPort; + var + HMagnitude: TLib3MFHandle; + begin + Result := nil; + HMagnitude := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFFunctionGradientNode_GetOutputMagnitudeFunc(FHandle, HMagnitude)); + if Assigned(HMagnitude) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HMagnitude); + end; + +(************************************************************************************************************************* + Class implementation for NormalizeDistanceNode +**************************************************************************************************************************) + + constructor TLib3MFNormalizeDistanceNode.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + begin + inherited Create(AWrapper, AHandle); + end; + + destructor TLib3MFNormalizeDistanceNode.Destroy; + begin + inherited; + end; + + function TLib3MFNormalizeDistanceNode.GetInputFunctionID(): TLib3MFImplicitPort; + var + HFunction: TLib3MFHandle; + begin + Result := nil; + HFunction := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFNormalizeDistanceNode_GetInputFunctionIDFunc(FHandle, HFunction)); + if Assigned(HFunction) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HFunction); + end; + + function TLib3MFNormalizeDistanceNode.GetInputPos(): TLib3MFImplicitPort; + var + HPos: TLib3MFHandle; + begin + Result := nil; + HPos := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFNormalizeDistanceNode_GetInputPosFunc(FHandle, HPos)); + if Assigned(HPos) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HPos); + end; + + function TLib3MFNormalizeDistanceNode.GetInputStep(): TLib3MFImplicitPort; + var + HStep: TLib3MFHandle; + begin + Result := nil; + HStep := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFNormalizeDistanceNode_GetInputStepFunc(FHandle, HStep)); + if Assigned(HStep) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HStep); + end; + + procedure TLib3MFNormalizeDistanceNode.SetScalarOutputName(const AScalarOutputName: String); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFNormalizeDistanceNode_SetScalarOutputNameFunc(FHandle, PAnsiChar(AScalarOutputName))); + end; + + function TLib3MFNormalizeDistanceNode.GetScalarOutputName(): String; + var + bytesNeededScalarOutputName: Cardinal; + bytesWrittenScalarOutputName: Cardinal; + bufferScalarOutputName: array of Char; + begin + bytesNeededScalarOutputName:= 0; + bytesWrittenScalarOutputName:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFNormalizeDistanceNode_GetScalarOutputNameFunc(FHandle, 0, bytesNeededScalarOutputName, nil)); + SetLength(bufferScalarOutputName, bytesNeededScalarOutputName); + FWrapper.CheckError(Self, FWrapper.Lib3MFNormalizeDistanceNode_GetScalarOutputNameFunc(FHandle, bytesNeededScalarOutputName, bytesWrittenScalarOutputName, @bufferScalarOutputName[0])); + Result := StrPas(@bufferScalarOutputName[0]); + end; + + procedure TLib3MFNormalizeDistanceNode.SetVectorInputName(const AVectorInputName: String); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFNormalizeDistanceNode_SetVectorInputNameFunc(FHandle, PAnsiChar(AVectorInputName))); + end; + + function TLib3MFNormalizeDistanceNode.GetVectorInputName(): String; + var + bytesNeededVectorInputName: Cardinal; + bytesWrittenVectorInputName: Cardinal; + bufferVectorInputName: array of Char; + begin + bytesNeededVectorInputName:= 0; + bytesWrittenVectorInputName:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFNormalizeDistanceNode_GetVectorInputNameFunc(FHandle, 0, bytesNeededVectorInputName, nil)); + SetLength(bufferVectorInputName, bytesNeededVectorInputName); + FWrapper.CheckError(Self, FWrapper.Lib3MFNormalizeDistanceNode_GetVectorInputNameFunc(FHandle, bytesNeededVectorInputName, bytesWrittenVectorInputName, @bufferVectorInputName[0])); + Result := StrPas(@bufferVectorInputName[0]); + end; + + function TLib3MFNormalizeDistanceNode.GetOutputResult(): TLib3MFImplicitPort; + var + HResult: TLib3MFHandle; + begin + Result := nil; + HResult := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFNormalizeDistanceNode_GetOutputResultFunc(FHandle, HResult)); + if Assigned(HResult) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResult); + end; + (************************************************************************************************************************* Class implementation for FunctionCallNode **************************************************************************************************************************) @@ -17501,6 +18648,39 @@ implementation Result := TLib3MFPolymorphicFactory.Make(FWrapper, HNode); end; + function TLib3MFImplicitFunction.AddBeamLatticeNode(const AIdentifier: String; const ADisplayName: String; const ATag: String): TLib3MFBeamLatticeNode; + var + HNode: TLib3MFHandle; + begin + Result := nil; + HNode := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFImplicitFunction_AddBeamLatticeNodeFunc(FHandle, PAnsiChar(AIdentifier), PAnsiChar(ADisplayName), PAnsiChar(ATag), HNode)); + if Assigned(HNode) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HNode); + end; + + function TLib3MFImplicitFunction.AddFunctionGradientNode(const AIdentifier: String; const ADisplayName: String; const ATag: String): TLib3MFFunctionGradientNode; + var + HNode: TLib3MFHandle; + begin + Result := nil; + HNode := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFImplicitFunction_AddFunctionGradientNodeFunc(FHandle, PAnsiChar(AIdentifier), PAnsiChar(ADisplayName), PAnsiChar(ATag), HNode)); + if Assigned(HNode) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HNode); + end; + + function TLib3MFImplicitFunction.AddNormalizeDistanceNode(const AIdentifier: String; const ADisplayName: String; const ATag: String): TLib3MFNormalizeDistanceNode; + var + HNode: TLib3MFHandle; + begin + Result := nil; + HNode := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFImplicitFunction_AddNormalizeDistanceNodeFunc(FHandle, PAnsiChar(AIdentifier), PAnsiChar(ADisplayName), PAnsiChar(ATag), HNode)); + if Assigned(HNode) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HNode); + end; + function TLib3MFImplicitFunction.AddFunctionCallNode(const AIdentifier: String; const ADisplayName: String; const ATag: String): TLib3MFFunctionCallNode; var HNode: TLib3MFHandle; @@ -18764,6 +19944,17 @@ implementation Result := TLib3MFPolymorphicFactory.Make(FWrapper, HComponentsObjectInstance); end; + function TLib3MFModel.GetBooleanObjectByID(const AUniqueResourceID: Cardinal): TLib3MFBooleanObject; + var + HBooleanObjectInstance: TLib3MFHandle; + begin + Result := nil; + HBooleanObjectInstance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFModel_GetBooleanObjectByIDFunc(FHandle, AUniqueResourceID, HBooleanObjectInstance)); + if Assigned(HBooleanObjectInstance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HBooleanObjectInstance); + end; + function TLib3MFModel.GetColorGroupByID(const AUniqueResourceID: Cardinal): TLib3MFColorGroup; var HColorGroupInstance: TLib3MFHandle; @@ -18879,6 +20070,17 @@ implementation Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResourceIterator); end; + function TLib3MFModel.GetBooleanObjects(): TLib3MFBooleanObjectIterator; + var + HResourceIterator: TLib3MFHandle; + begin + Result := nil; + HResourceIterator := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFModel_GetBooleanObjectsFunc(FHandle, HResourceIterator)); + if Assigned(HResourceIterator) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResourceIterator); + end; + function TLib3MFModel.GetTexture2Ds(): TLib3MFTexture2DIterator; var HResourceIterator: TLib3MFHandle; @@ -19011,6 +20213,17 @@ implementation Result := TLib3MFPolymorphicFactory.Make(FWrapper, HComponentsObjectInstance); end; + function TLib3MFModel.AddBooleanObject(): TLib3MFBooleanObject; + var + HBooleanObjectInstance: TLib3MFHandle; + begin + Result := nil; + HBooleanObjectInstance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFModel_AddBooleanObjectFunc(FHandle, HBooleanObjectInstance)); + if Assigned(HBooleanObjectInstance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HBooleanObjectInstance); + end; + function TLib3MFModel.AddSliceStack(const AZBottom: Double): TLib3MFSliceStack; var HSliceStackInstance: TLib3MFHandle; @@ -19422,6 +20635,7 @@ implementation FLib3MFObjectIterator_GetCurrentObjectFunc := LoadFunction('lib3mf_objectiterator_getcurrentobject'); FLib3MFMeshObjectIterator_GetCurrentMeshObjectFunc := LoadFunction('lib3mf_meshobjectiterator_getcurrentmeshobject'); FLib3MFComponentsObjectIterator_GetCurrentComponentsObjectFunc := LoadFunction('lib3mf_componentsobjectiterator_getcurrentcomponentsobject'); + FLib3MFBooleanObjectIterator_GetCurrentBooleanObjectFunc := LoadFunction('lib3mf_booleanobjectiterator_getcurrentbooleanobject'); FLib3MFTexture2DIterator_GetCurrentTexture2DFunc := LoadFunction('lib3mf_texture2diterator_getcurrenttexture2d'); FLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupFunc := LoadFunction('lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup'); FLib3MFColorGroupIterator_GetCurrentColorGroupFunc := LoadFunction('lib3mf_colorgroupiterator_getcurrentcolorgroup'); @@ -19470,6 +20684,7 @@ implementation FLib3MFObject_IsMeshObjectFunc := LoadFunction('lib3mf_object_ismeshobject'); FLib3MFObject_IsComponentsObjectFunc := LoadFunction('lib3mf_object_iscomponentsobject'); FLib3MFObject_IsLevelSetObjectFunc := LoadFunction('lib3mf_object_islevelsetobject'); + FLib3MFObject_IsBooleanObjectFunc := LoadFunction('lib3mf_object_isbooleanobject'); FLib3MFObject_IsValidFunc := LoadFunction('lib3mf_object_isvalid'); FLib3MFObject_SetAttachmentAsThumbnailFunc := LoadFunction('lib3mf_object_setattachmentasthumbnail'); FLib3MFObject_GetThumbnailAttachmentFunc := LoadFunction('lib3mf_object_getthumbnailattachment'); @@ -19527,6 +20742,20 @@ implementation FLib3MFLevelSet_GetMeshFunc := LoadFunction('lib3mf_levelset_getmesh'); FLib3MFLevelSet_GetVolumeDataFunc := LoadFunction('lib3mf_levelset_getvolumedata'); FLib3MFLevelSet_SetVolumeDataFunc := LoadFunction('lib3mf_levelset_setvolumedata'); + FLib3MFBooleanObject_SetBaseObjectFunc := LoadFunction('lib3mf_booleanobject_setbaseobject'); + FLib3MFBooleanObject_GetBaseObjectFunc := LoadFunction('lib3mf_booleanobject_getbaseobject'); + FLib3MFBooleanObject_SetBaseTransformFunc := LoadFunction('lib3mf_booleanobject_setbasetransform'); + FLib3MFBooleanObject_GetBaseTransformFunc := LoadFunction('lib3mf_booleanobject_getbasetransform'); + FLib3MFBooleanObject_SetOperationFunc := LoadFunction('lib3mf_booleanobject_setoperation'); + FLib3MFBooleanObject_GetOperationFunc := LoadFunction('lib3mf_booleanobject_getoperation'); + FLib3MFBooleanObject_SetCSGModeEnabledFunc := LoadFunction('lib3mf_booleanobject_setcsgmodeenabled'); + FLib3MFBooleanObject_GetCSGModeEnabledFunc := LoadFunction('lib3mf_booleanobject_getcsgmodeenabled'); + FLib3MFBooleanObject_SetExtractionGridResolutionFunc := LoadFunction('lib3mf_booleanobject_setextractiongridresolution'); + FLib3MFBooleanObject_GetExtractionGridResolutionFunc := LoadFunction('lib3mf_booleanobject_getextractiongridresolution'); + FLib3MFBooleanObject_GetOperandCountFunc := LoadFunction('lib3mf_booleanobject_getoperandcount'); + FLib3MFBooleanObject_AddOperandFunc := LoadFunction('lib3mf_booleanobject_addoperand'); + FLib3MFBooleanObject_GetOperandFunc := LoadFunction('lib3mf_booleanobject_getoperand'); + FLib3MFBooleanObject_MergeToMeshObjectFunc := LoadFunction('lib3mf_booleanobject_mergetomeshobject'); FLib3MFBeamLattice_GetMinLengthFunc := LoadFunction('lib3mf_beamlattice_getminlength'); FLib3MFBeamLattice_SetMinLengthFunc := LoadFunction('lib3mf_beamlattice_setminlength'); FLib3MFBeamLattice_GetClippingFunc := LoadFunction('lib3mf_beamlattice_getclipping'); @@ -19754,6 +20983,29 @@ implementation FLib3MFUnsignedMeshNode_GetInputMeshFunc := LoadFunction('lib3mf_unsignedmeshnode_getinputmesh'); FLib3MFUnsignedMeshNode_GetInputPosFunc := LoadFunction('lib3mf_unsignedmeshnode_getinputpos'); FLib3MFUnsignedMeshNode_GetOutputDistanceFunc := LoadFunction('lib3mf_unsignedmeshnode_getoutputdistance'); + FLib3MFBeamLatticeNode_GetInputBeamLatticeFunc := LoadFunction('lib3mf_beamlatticenode_getinputbeamlattice'); + FLib3MFBeamLatticeNode_GetInputPosFunc := LoadFunction('lib3mf_beamlatticenode_getinputpos'); + FLib3MFBeamLatticeNode_GetOutputDistanceFunc := LoadFunction('lib3mf_beamlatticenode_getoutputdistance'); + FLib3MFBeamLatticeNode_SetAccurateRangeFunc := LoadFunction('lib3mf_beamlatticenode_setaccuraterange'); + FLib3MFBeamLatticeNode_GetAccurateRangeFunc := LoadFunction('lib3mf_beamlatticenode_getaccuraterange'); + FLib3MFFunctionGradientNode_GetInputFunctionIDFunc := LoadFunction('lib3mf_functiongradientnode_getinputfunctionid'); + FLib3MFFunctionGradientNode_GetInputPosFunc := LoadFunction('lib3mf_functiongradientnode_getinputpos'); + FLib3MFFunctionGradientNode_GetInputStepFunc := LoadFunction('lib3mf_functiongradientnode_getinputstep'); + FLib3MFFunctionGradientNode_SetScalarOutputNameFunc := LoadFunction('lib3mf_functiongradientnode_setscalaroutputname'); + FLib3MFFunctionGradientNode_GetScalarOutputNameFunc := LoadFunction('lib3mf_functiongradientnode_getscalaroutputname'); + FLib3MFFunctionGradientNode_SetVectorInputNameFunc := LoadFunction('lib3mf_functiongradientnode_setvectorinputname'); + FLib3MFFunctionGradientNode_GetVectorInputNameFunc := LoadFunction('lib3mf_functiongradientnode_getvectorinputname'); + FLib3MFFunctionGradientNode_GetOutputNormalizedGradientFunc := LoadFunction('lib3mf_functiongradientnode_getoutputnormalizedgradient'); + FLib3MFFunctionGradientNode_GetOutputGradientFunc := LoadFunction('lib3mf_functiongradientnode_getoutputgradient'); + FLib3MFFunctionGradientNode_GetOutputMagnitudeFunc := LoadFunction('lib3mf_functiongradientnode_getoutputmagnitude'); + FLib3MFNormalizeDistanceNode_GetInputFunctionIDFunc := LoadFunction('lib3mf_normalizedistancenode_getinputfunctionid'); + FLib3MFNormalizeDistanceNode_GetInputPosFunc := LoadFunction('lib3mf_normalizedistancenode_getinputpos'); + FLib3MFNormalizeDistanceNode_GetInputStepFunc := LoadFunction('lib3mf_normalizedistancenode_getinputstep'); + FLib3MFNormalizeDistanceNode_SetScalarOutputNameFunc := LoadFunction('lib3mf_normalizedistancenode_setscalaroutputname'); + FLib3MFNormalizeDistanceNode_GetScalarOutputNameFunc := LoadFunction('lib3mf_normalizedistancenode_getscalaroutputname'); + FLib3MFNormalizeDistanceNode_SetVectorInputNameFunc := LoadFunction('lib3mf_normalizedistancenode_setvectorinputname'); + FLib3MFNormalizeDistanceNode_GetVectorInputNameFunc := LoadFunction('lib3mf_normalizedistancenode_getvectorinputname'); + FLib3MFNormalizeDistanceNode_GetOutputResultFunc := LoadFunction('lib3mf_normalizedistancenode_getoutputresult'); FLib3MFFunctionCallNode_GetInputFunctionIDFunc := LoadFunction('lib3mf_functioncallnode_getinputfunctionid'); FLib3MFNodeIterator_GetCurrentFunc := LoadFunction('lib3mf_nodeiterator_getcurrent'); FLib3MFFunction_GetDisplayNameFunc := LoadFunction('lib3mf_function_getdisplayname'); @@ -19817,6 +21069,9 @@ implementation FLib3MFImplicitFunction_AddConstMatNodeFunc := LoadFunction('lib3mf_implicitfunction_addconstmatnode'); FLib3MFImplicitFunction_AddMeshNodeFunc := LoadFunction('lib3mf_implicitfunction_addmeshnode'); FLib3MFImplicitFunction_AddUnsignedMeshNodeFunc := LoadFunction('lib3mf_implicitfunction_addunsignedmeshnode'); + FLib3MFImplicitFunction_AddBeamLatticeNodeFunc := LoadFunction('lib3mf_implicitfunction_addbeamlatticenode'); + FLib3MFImplicitFunction_AddFunctionGradientNodeFunc := LoadFunction('lib3mf_implicitfunction_addfunctiongradientnode'); + FLib3MFImplicitFunction_AddNormalizeDistanceNodeFunc := LoadFunction('lib3mf_implicitfunction_addnormalizedistancenode'); FLib3MFImplicitFunction_AddFunctionCallNodeFunc := LoadFunction('lib3mf_implicitfunction_addfunctioncallnode'); FLib3MFImplicitFunction_GetNodesFunc := LoadFunction('lib3mf_implicitfunction_getnodes'); FLib3MFImplicitFunction_RemoveNodeFunc := LoadFunction('lib3mf_implicitfunction_removenode'); @@ -19926,6 +21181,7 @@ implementation FLib3MFModel_GetMultiPropertyGroupByIDFunc := LoadFunction('lib3mf_model_getmultipropertygroupbyid'); FLib3MFModel_GetMeshObjectByIDFunc := LoadFunction('lib3mf_model_getmeshobjectbyid'); FLib3MFModel_GetComponentsObjectByIDFunc := LoadFunction('lib3mf_model_getcomponentsobjectbyid'); + FLib3MFModel_GetBooleanObjectByIDFunc := LoadFunction('lib3mf_model_getbooleanobjectbyid'); FLib3MFModel_GetColorGroupByIDFunc := LoadFunction('lib3mf_model_getcolorgroupbyid'); FLib3MFModel_GetSliceStackByIDFunc := LoadFunction('lib3mf_model_getslicestackbyid'); FLib3MFModel_GetLevelSetByIDFunc := LoadFunction('lib3mf_model_getlevelsetbyid'); @@ -19937,6 +21193,7 @@ implementation FLib3MFModel_GetObjectsFunc := LoadFunction('lib3mf_model_getobjects'); FLib3MFModel_GetMeshObjectsFunc := LoadFunction('lib3mf_model_getmeshobjects'); FLib3MFModel_GetComponentsObjectsFunc := LoadFunction('lib3mf_model_getcomponentsobjects'); + FLib3MFModel_GetBooleanObjectsFunc := LoadFunction('lib3mf_model_getbooleanobjects'); FLib3MFModel_GetTexture2DsFunc := LoadFunction('lib3mf_model_gettexture2ds'); FLib3MFModel_GetBaseMaterialGroupsFunc := LoadFunction('lib3mf_model_getbasematerialgroups'); FLib3MFModel_GetColorGroupsFunc := LoadFunction('lib3mf_model_getcolorgroups'); @@ -19949,6 +21206,7 @@ implementation FLib3MFModel_MergeFromModelFunc := LoadFunction('lib3mf_model_mergefrommodel'); FLib3MFModel_AddMeshObjectFunc := LoadFunction('lib3mf_model_addmeshobject'); FLib3MFModel_AddComponentsObjectFunc := LoadFunction('lib3mf_model_addcomponentsobject'); + FLib3MFModel_AddBooleanObjectFunc := LoadFunction('lib3mf_model_addbooleanobject'); FLib3MFModel_AddSliceStackFunc := LoadFunction('lib3mf_model_addslicestack'); FLib3MFModel_AddTexture2DFromAttachmentFunc := LoadFunction('lib3mf_model_addtexture2dfromattachment'); FLib3MFModel_AddBaseMaterialGroupFunc := LoadFunction('lib3mf_model_addbasematerialgroup'); @@ -20135,6 +21393,9 @@ implementation if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_componentsobjectiterator_getcurrentcomponentsobject'), @FLib3MFComponentsObjectIterator_GetCurrentComponentsObjectFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_booleanobjectiterator_getcurrentbooleanobject'), @FLib3MFBooleanObjectIterator_GetCurrentBooleanObjectFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_texture2diterator_getcurrenttexture2d'), @FLib3MFTexture2DIterator_GetCurrentTexture2DFunc); @@ -20279,6 +21540,9 @@ implementation if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_object_islevelsetobject'), @FLib3MFObject_IsLevelSetObjectFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_object_isbooleanobject'), @FLib3MFObject_IsBooleanObjectFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_object_isvalid'), @FLib3MFObject_IsValidFunc); @@ -20450,6 +21714,48 @@ implementation if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_levelset_setvolumedata'), @FLib3MFLevelSet_SetVolumeDataFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_booleanobject_setbaseobject'), @FLib3MFBooleanObject_SetBaseObjectFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_booleanobject_getbaseobject'), @FLib3MFBooleanObject_GetBaseObjectFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_booleanobject_setbasetransform'), @FLib3MFBooleanObject_SetBaseTransformFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_booleanobject_getbasetransform'), @FLib3MFBooleanObject_GetBaseTransformFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_booleanobject_setoperation'), @FLib3MFBooleanObject_SetOperationFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_booleanobject_getoperation'), @FLib3MFBooleanObject_GetOperationFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_booleanobject_setcsgmodeenabled'), @FLib3MFBooleanObject_SetCSGModeEnabledFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_booleanobject_getcsgmodeenabled'), @FLib3MFBooleanObject_GetCSGModeEnabledFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_booleanobject_setextractiongridresolution'), @FLib3MFBooleanObject_SetExtractionGridResolutionFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_booleanobject_getextractiongridresolution'), @FLib3MFBooleanObject_GetExtractionGridResolutionFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_booleanobject_getoperandcount'), @FLib3MFBooleanObject_GetOperandCountFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_booleanobject_addoperand'), @FLib3MFBooleanObject_AddOperandFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_booleanobject_getoperand'), @FLib3MFBooleanObject_GetOperandFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_booleanobject_mergetomeshobject'), @FLib3MFBooleanObject_MergeToMeshObjectFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_beamlattice_getminlength'), @FLib3MFBeamLattice_GetMinLengthFunc); @@ -21131,6 +22437,75 @@ implementation if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_unsignedmeshnode_getoutputdistance'), @FLib3MFUnsignedMeshNode_GetOutputDistanceFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_beamlatticenode_getinputbeamlattice'), @FLib3MFBeamLatticeNode_GetInputBeamLatticeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_beamlatticenode_getinputpos'), @FLib3MFBeamLatticeNode_GetInputPosFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_beamlatticenode_getoutputdistance'), @FLib3MFBeamLatticeNode_GetOutputDistanceFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_beamlatticenode_setaccuraterange'), @FLib3MFBeamLatticeNode_SetAccurateRangeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_beamlatticenode_getaccuraterange'), @FLib3MFBeamLatticeNode_GetAccurateRangeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_functiongradientnode_getinputfunctionid'), @FLib3MFFunctionGradientNode_GetInputFunctionIDFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_functiongradientnode_getinputpos'), @FLib3MFFunctionGradientNode_GetInputPosFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_functiongradientnode_getinputstep'), @FLib3MFFunctionGradientNode_GetInputStepFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_functiongradientnode_setscalaroutputname'), @FLib3MFFunctionGradientNode_SetScalarOutputNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_functiongradientnode_getscalaroutputname'), @FLib3MFFunctionGradientNode_GetScalarOutputNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_functiongradientnode_setvectorinputname'), @FLib3MFFunctionGradientNode_SetVectorInputNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_functiongradientnode_getvectorinputname'), @FLib3MFFunctionGradientNode_GetVectorInputNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_functiongradientnode_getoutputnormalizedgradient'), @FLib3MFFunctionGradientNode_GetOutputNormalizedGradientFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_functiongradientnode_getoutputgradient'), @FLib3MFFunctionGradientNode_GetOutputGradientFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_functiongradientnode_getoutputmagnitude'), @FLib3MFFunctionGradientNode_GetOutputMagnitudeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_normalizedistancenode_getinputfunctionid'), @FLib3MFNormalizeDistanceNode_GetInputFunctionIDFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_normalizedistancenode_getinputpos'), @FLib3MFNormalizeDistanceNode_GetInputPosFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_normalizedistancenode_getinputstep'), @FLib3MFNormalizeDistanceNode_GetInputStepFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_normalizedistancenode_setscalaroutputname'), @FLib3MFNormalizeDistanceNode_SetScalarOutputNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_normalizedistancenode_getscalaroutputname'), @FLib3MFNormalizeDistanceNode_GetScalarOutputNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_normalizedistancenode_setvectorinputname'), @FLib3MFNormalizeDistanceNode_SetVectorInputNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_normalizedistancenode_getvectorinputname'), @FLib3MFNormalizeDistanceNode_GetVectorInputNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_normalizedistancenode_getoutputresult'), @FLib3MFNormalizeDistanceNode_GetOutputResultFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_functioncallnode_getinputfunctionid'), @FLib3MFFunctionCallNode_GetInputFunctionIDFunc); @@ -21320,6 +22695,15 @@ implementation if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_implicitfunction_addunsignedmeshnode'), @FLib3MFImplicitFunction_AddUnsignedMeshNodeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_implicitfunction_addbeamlatticenode'), @FLib3MFImplicitFunction_AddBeamLatticeNodeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_implicitfunction_addfunctiongradientnode'), @FLib3MFImplicitFunction_AddFunctionGradientNodeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_implicitfunction_addnormalizedistancenode'), @FLib3MFImplicitFunction_AddNormalizeDistanceNodeFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_implicitfunction_addfunctioncallnode'), @FLib3MFImplicitFunction_AddFunctionCallNodeFunc); @@ -21647,6 +23031,9 @@ implementation if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_model_getcomponentsobjectbyid'), @FLib3MFModel_GetComponentsObjectByIDFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_model_getbooleanobjectbyid'), @FLib3MFModel_GetBooleanObjectByIDFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_model_getcolorgroupbyid'), @FLib3MFModel_GetColorGroupByIDFunc); @@ -21680,6 +23067,9 @@ implementation if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_model_getcomponentsobjects'), @FLib3MFModel_GetComponentsObjectsFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_model_getbooleanobjects'), @FLib3MFModel_GetBooleanObjectsFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_model_gettexture2ds'), @FLib3MFModel_GetTexture2DsFunc); @@ -21716,6 +23106,9 @@ implementation if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_model_addcomponentsobject'), @FLib3MFModel_AddComponentsObjectFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_model_addbooleanobject'), @FLib3MFModel_AddBooleanObjectFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_model_addslicestack'), @FLib3MFModel_AddSliceStackFunc); diff --git a/Autogenerated/Bindings/Python/Lib3MF.py b/Autogenerated/Bindings/Python/Lib3MF.py index c686f9a15..9eccb935f 100644 --- a/Autogenerated/Bindings/Python/Lib3MF.py +++ b/Autogenerated/Bindings/Python/Lib3MF.py @@ -24,12 +24,12 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated Python file in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 ''' @@ -52,12 +52,254 @@ def __str__(self): if self._message: return 'Lib3MFException ' + str(self._code) + ': '+ str(self._message) return 'Lib3MFException ' + str(self._code) + + def get_error_code(self): + """Returns the error code""" + return self._code + + def get_error_message(self): + """Returns the custom error message""" + return self._message + + def get_error_name(self): + """Returns the error name (constant name)""" + if self._code == ErrorCodes.SUCCESS: + return 'SUCCESS' + elif self._code == ErrorCodes.NOTIMPLEMENTED: + return 'NOTIMPLEMENTED' + elif self._code == ErrorCodes.INVALIDPARAM: + return 'INVALIDPARAM' + elif self._code == ErrorCodes.INVALIDCAST: + return 'INVALIDCAST' + elif self._code == ErrorCodes.BUFFERTOOSMALL: + return 'BUFFERTOOSMALL' + elif self._code == ErrorCodes.GENERICEXCEPTION: + return 'GENERICEXCEPTION' + elif self._code == ErrorCodes.COULDNOTLOADLIBRARY: + return 'COULDNOTLOADLIBRARY' + elif self._code == ErrorCodes.COULDNOTFINDLIBRARYEXPORT: + return 'COULDNOTFINDLIBRARYEXPORT' + elif self._code == ErrorCodes.INCOMPATIBLEBINARYVERSION: + return 'INCOMPATIBLEBINARYVERSION' + elif self._code == ErrorCodes.CALCULATIONABORTED: + return 'CALCULATIONABORTED' + elif self._code == ErrorCodes.SHOULDNOTBECALLED: + return 'SHOULDNOTBECALLED' + elif self._code == ErrorCodes.READERCLASSUNKNOWN: + return 'READERCLASSUNKNOWN' + elif self._code == ErrorCodes.WRITERCLASSUNKNOWN: + return 'WRITERCLASSUNKNOWN' + elif self._code == ErrorCodes.ITERATORINVALIDINDEX: + return 'ITERATORINVALIDINDEX' + elif self._code == ErrorCodes.INVALIDMODELRESOURCE: + return 'INVALIDMODELRESOURCE' + elif self._code == ErrorCodes.RESOURCENOTFOUND: + return 'RESOURCENOTFOUND' + elif self._code == ErrorCodes.INVALIDMODEL: + return 'INVALIDMODEL' + elif self._code == ErrorCodes.INVALIDOBJECT: + return 'INVALIDOBJECT' + elif self._code == ErrorCodes.INVALIDMESHOBJECT: + return 'INVALIDMESHOBJECT' + elif self._code == ErrorCodes.INVALIDCOMPONENTSOBJECT: + return 'INVALIDCOMPONENTSOBJECT' + elif self._code == ErrorCodes.INVALIDCOMPONENT: + return 'INVALIDCOMPONENT' + elif self._code == ErrorCodes.INVALIDBUILDITEM: + return 'INVALIDBUILDITEM' + elif self._code == ErrorCodes.INVALIDBASEMATERIALGROUP: + return 'INVALIDBASEMATERIALGROUP' + elif self._code == ErrorCodes.INVALIDSLICESTACKRESOURCE: + return 'INVALIDSLICESTACKRESOURCE' + elif self._code == ErrorCodes.INVALIDTEXTURERESOURCE: + return 'INVALIDTEXTURERESOURCE' + elif self._code == ErrorCodes.INVALIDCOLORGROUP: + return 'INVALIDCOLORGROUP' + elif self._code == ErrorCodes.INVALIDTEXTURE2DGROUP: + return 'INVALIDTEXTURE2DGROUP' + elif self._code == ErrorCodes.INVALIDCOMPOSITEMATERIALS: + return 'INVALIDCOMPOSITEMATERIALS' + elif self._code == ErrorCodes.INVALIDMULTIPROPERTYGROUP: + return 'INVALIDMULTIPROPERTYGROUP' + elif self._code == ErrorCodes.INVALIDRESOURCEINDEX: + return 'INVALIDRESOURCEINDEX' + elif self._code == ErrorCodes.ATTACHMENTNOTFOUND: + return 'ATTACHMENTNOTFOUND' + elif self._code == ErrorCodes.FORBIDDENCYCLICREFERENCE: + return 'FORBIDDENCYCLICREFERENCE' + elif self._code == ErrorCodes.INVALIDATTACHMENTSTREAM: + return 'INVALIDATTACHMENTSTREAM' + elif self._code == ErrorCodes.INVALIDPROPERTYCOUNT: + return 'INVALIDPROPERTYCOUNT' + elif self._code == ErrorCodes.UNKOWNPROGRESSIDENTIFIER: + return 'UNKOWNPROGRESSIDENTIFIER' + elif self._code == ErrorCodes.ELEMENTCOUNTEXCEEDSLIMIT: + return 'ELEMENTCOUNTEXCEEDSLIMIT' + elif self._code == ErrorCodes.INVALIDRESOURCE: + return 'INVALIDRESOURCE' + elif self._code == ErrorCodes.INVALIDLEVELSET: + return 'INVALIDLEVELSET' + elif self._code == ErrorCodes.COULDNOTFINDTRIANGLESET: + return 'COULDNOTFINDTRIANGLESET' + elif self._code == ErrorCodes.INVALIDTRIANGLESETINDEX: + return 'INVALIDTRIANGLESETINDEX' + elif self._code == ErrorCodes.BEAMLATTICE_INVALID_OBJECTTYPE: + return 'BEAMLATTICE_INVALID_OBJECTTYPE' + elif self._code == ErrorCodes.INVALIDKEYSTORE: + return 'INVALIDKEYSTORE' + elif self._code == ErrorCodes.INVALIDKEYSTORECONSUMER: + return 'INVALIDKEYSTORECONSUMER' + elif self._code == ErrorCodes.KEYSTORECONSUMERNOTFOUND: + return 'KEYSTORECONSUMERNOTFOUND' + elif self._code == ErrorCodes.KEYSTORERESOURCEDATANOTFOUND: + return 'KEYSTORERESOURCEDATANOTFOUND' + elif self._code == ErrorCodes.SECURECONTEXTNOTREGISTERED: + return 'SECURECONTEXTNOTREGISTERED' + elif self._code == ErrorCodes.INVALIDKEYSIZE: + return 'INVALIDKEYSIZE' + elif self._code == ErrorCodes.INCOMPATIBLEPORTTYPES: + return 'INCOMPATIBLEPORTTYPES' + elif self._code == ErrorCodes.GRAPHISCYCLIC: + return 'GRAPHISCYCLIC' + elif self._code == ErrorCodes.INPUTNOTSET: + return 'INPUTNOTSET' + elif self._code == ErrorCodes.INVALIDNODECONFIGURATION: + return 'INVALIDNODECONFIGURATION' + else: + return 'UNKNOWN' + + def get_error_description(self): + """Returns the error description (human-readable)""" + if self._code == ErrorCodes.SUCCESS: + return 'success' + elif self._code == ErrorCodes.NOTIMPLEMENTED: + return 'functionality not implemented' + elif self._code == ErrorCodes.INVALIDPARAM: + return 'an invalid parameter was passed' + elif self._code == ErrorCodes.INVALIDCAST: + return 'a type cast failed' + elif self._code == ErrorCodes.BUFFERTOOSMALL: + return 'a provided buffer is too small' + elif self._code == ErrorCodes.GENERICEXCEPTION: + return 'a generic exception occurred' + elif self._code == ErrorCodes.COULDNOTLOADLIBRARY: + return 'the library could not be loaded' + elif self._code == ErrorCodes.COULDNOTFINDLIBRARYEXPORT: + return 'a required exported symbol could not be found in the library' + elif self._code == ErrorCodes.INCOMPATIBLEBINARYVERSION: + return 'the version of the binary interface does not match the bindings interface' + elif self._code == ErrorCodes.CALCULATIONABORTED: + return 'a calculation has been aborted' + elif self._code == ErrorCodes.SHOULDNOTBECALLED: + return 'functionality should not be called' + elif self._code == ErrorCodes.READERCLASSUNKNOWN: + return 'the queried reader class is unknown' + elif self._code == ErrorCodes.WRITERCLASSUNKNOWN: + return 'the queried writer class is unknown' + elif self._code == ErrorCodes.ITERATORINVALIDINDEX: + return 'the current index of an iterator is invalid' + elif self._code == ErrorCodes.INVALIDMODELRESOURCE: + return 'no Model Resource has been given' + elif self._code == ErrorCodes.RESOURCENOTFOUND: + return 'Resource not found' + elif self._code == ErrorCodes.INVALIDMODEL: + return 'A model is invalid' + elif self._code == ErrorCodes.INVALIDOBJECT: + return 'An object is invalid' + elif self._code == ErrorCodes.INVALIDMESHOBJECT: + return 'A mesh object is invalid' + elif self._code == ErrorCodes.INVALIDCOMPONENTSOBJECT: + return 'A components object is invalid' + elif self._code == ErrorCodes.INVALIDCOMPONENT: + return 'A component is invalid' + elif self._code == ErrorCodes.INVALIDBUILDITEM: + return 'A build item is invalid' + elif self._code == ErrorCodes.INVALIDBASEMATERIALGROUP: + return 'A basematerialgroup is invalid' + elif self._code == ErrorCodes.INVALIDSLICESTACKRESOURCE: + return 'A slicestack resource is invalid' + elif self._code == ErrorCodes.INVALIDTEXTURERESOURCE: + return 'A texture resource is invalid' + elif self._code == ErrorCodes.INVALIDCOLORGROUP: + return 'A color group resource is invalid' + elif self._code == ErrorCodes.INVALIDTEXTURE2DGROUP: + return 'A texture2d group resource is invalid' + elif self._code == ErrorCodes.INVALIDCOMPOSITEMATERIALS: + return 'A composite materials resource is invalid' + elif self._code == ErrorCodes.INVALIDMULTIPROPERTYGROUP: + return 'A MultiPropertyGroup resource is invalid' + elif self._code == ErrorCodes.INVALIDRESOURCEINDEX: + return 'A resource index is invalid' + elif self._code == ErrorCodes.ATTACHMENTNOTFOUND: + return 'Attachment not found' + elif self._code == ErrorCodes.FORBIDDENCYCLICREFERENCE: + return 'A component references one of its ancestors' + elif self._code == ErrorCodes.INVALIDATTACHMENTSTREAM: + return 'An attachment stream is invalid' + elif self._code == ErrorCodes.INVALIDPROPERTYCOUNT: + return 'Invalid property count.' + elif self._code == ErrorCodes.UNKOWNPROGRESSIDENTIFIER: + return 'A progress identifier is unknown' + elif self._code == ErrorCodes.ELEMENTCOUNTEXCEEDSLIMIT: + return 'An element buffer exceeds its spec limit' + elif self._code == ErrorCodes.INVALIDRESOURCE: + return 'A resource is invalid' + elif self._code == ErrorCodes.INVALIDLEVELSET: + return 'A level set is invalid' + elif self._code == ErrorCodes.COULDNOTFINDTRIANGLESET: + return 'Could not find triangle set' + elif self._code == ErrorCodes.INVALIDTRIANGLESETINDEX: + return 'Invalid triangle set index' + elif self._code == ErrorCodes.BEAMLATTICE_INVALID_OBJECTTYPE: + return 'This object type is not valid for beamlattices' + elif self._code == ErrorCodes.INVALIDKEYSTORE: + return 'The keystore object is invalid' + elif self._code == ErrorCodes.INVALIDKEYSTORECONSUMER: + return 'The consumer keystore object is invalid' + elif self._code == ErrorCodes.KEYSTORECONSUMERNOTFOUND: + return 'A consumer has not been found' + elif self._code == ErrorCodes.KEYSTORERESOURCEDATANOTFOUND: + return 'A resource data has not been found' + elif self._code == ErrorCodes.SECURECONTEXTNOTREGISTERED: + return 'A Key or Conentent encryption callback has not been registered' + elif self._code == ErrorCodes.INVALIDKEYSIZE: + return 'The key size is invalid' + elif self._code == ErrorCodes.INCOMPATIBLEPORTTYPES: + return 'Link could not be added, the port types are incompatible' + elif self._code == ErrorCodes.GRAPHISCYCLIC: + return 'The functin graph is cyclic. Only dircected graphs are valid and can be topological sorted.' + elif self._code == ErrorCodes.INPUTNOTSET: + return 'The input of a node is not set.' + elif self._code == ErrorCodes.INVALIDNODECONFIGURATION: + return 'The selected node configuration is not supported' + else: + return 'unknown error' + + @property + def error_code(self): + """Property to access error code""" + return self._code + + @property + def error_message(self): + """Property to access custom error message""" + return self._message + + @property + def error_name(self): + """Property to access error name""" + return self.get_error_name() + + @property + def error_description(self): + """Property to access error description""" + return self.get_error_description() '''Definition of binding API version ''' class BindingVersion(enum.IntEnum): MAJOR = 2 - MINOR = 4 + MINOR = 6 MICRO = 0 '''Definition Error Codes @@ -179,6 +421,7 @@ class FunctionTable: lib3mf_objectiterator_getcurrentobject = None lib3mf_meshobjectiterator_getcurrentmeshobject = None lib3mf_componentsobjectiterator_getcurrentcomponentsobject = None + lib3mf_booleanobjectiterator_getcurrentbooleanobject = None lib3mf_texture2diterator_getcurrenttexture2d = None lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup = None lib3mf_colorgroupiterator_getcurrentcolorgroup = None @@ -227,6 +470,7 @@ class FunctionTable: lib3mf_object_ismeshobject = None lib3mf_object_iscomponentsobject = None lib3mf_object_islevelsetobject = None + lib3mf_object_isbooleanobject = None lib3mf_object_isvalid = None lib3mf_object_setattachmentasthumbnail = None lib3mf_object_getthumbnailattachment = None @@ -284,6 +528,20 @@ class FunctionTable: lib3mf_levelset_getmesh = None lib3mf_levelset_getvolumedata = None lib3mf_levelset_setvolumedata = None + lib3mf_booleanobject_setbaseobject = None + lib3mf_booleanobject_getbaseobject = None + lib3mf_booleanobject_setbasetransform = None + lib3mf_booleanobject_getbasetransform = None + lib3mf_booleanobject_setoperation = None + lib3mf_booleanobject_getoperation = None + lib3mf_booleanobject_setcsgmodeenabled = None + lib3mf_booleanobject_getcsgmodeenabled = None + lib3mf_booleanobject_setextractiongridresolution = None + lib3mf_booleanobject_getextractiongridresolution = None + lib3mf_booleanobject_getoperandcount = None + lib3mf_booleanobject_addoperand = None + lib3mf_booleanobject_getoperand = None + lib3mf_booleanobject_mergetomeshobject = None lib3mf_beamlattice_getminlength = None lib3mf_beamlattice_setminlength = None lib3mf_beamlattice_getclipping = None @@ -511,6 +769,29 @@ class FunctionTable: lib3mf_unsignedmeshnode_getinputmesh = None lib3mf_unsignedmeshnode_getinputpos = None lib3mf_unsignedmeshnode_getoutputdistance = None + lib3mf_beamlatticenode_getinputbeamlattice = None + lib3mf_beamlatticenode_getinputpos = None + lib3mf_beamlatticenode_getoutputdistance = None + lib3mf_beamlatticenode_setaccuraterange = None + lib3mf_beamlatticenode_getaccuraterange = None + lib3mf_functiongradientnode_getinputfunctionid = None + lib3mf_functiongradientnode_getinputpos = None + lib3mf_functiongradientnode_getinputstep = None + lib3mf_functiongradientnode_setscalaroutputname = None + lib3mf_functiongradientnode_getscalaroutputname = None + lib3mf_functiongradientnode_setvectorinputname = None + lib3mf_functiongradientnode_getvectorinputname = None + lib3mf_functiongradientnode_getoutputnormalizedgradient = None + lib3mf_functiongradientnode_getoutputgradient = None + lib3mf_functiongradientnode_getoutputmagnitude = None + lib3mf_normalizedistancenode_getinputfunctionid = None + lib3mf_normalizedistancenode_getinputpos = None + lib3mf_normalizedistancenode_getinputstep = None + lib3mf_normalizedistancenode_setscalaroutputname = None + lib3mf_normalizedistancenode_getscalaroutputname = None + lib3mf_normalizedistancenode_setvectorinputname = None + lib3mf_normalizedistancenode_getvectorinputname = None + lib3mf_normalizedistancenode_getoutputresult = None lib3mf_functioncallnode_getinputfunctionid = None lib3mf_nodeiterator_getcurrent = None lib3mf_function_getdisplayname = None @@ -574,6 +855,9 @@ class FunctionTable: lib3mf_implicitfunction_addconstmatnode = None lib3mf_implicitfunction_addmeshnode = None lib3mf_implicitfunction_addunsignedmeshnode = None + lib3mf_implicitfunction_addbeamlatticenode = None + lib3mf_implicitfunction_addfunctiongradientnode = None + lib3mf_implicitfunction_addnormalizedistancenode = None lib3mf_implicitfunction_addfunctioncallnode = None lib3mf_implicitfunction_getnodes = None lib3mf_implicitfunction_removenode = None @@ -683,6 +967,7 @@ class FunctionTable: lib3mf_model_getmultipropertygroupbyid = None lib3mf_model_getmeshobjectbyid = None lib3mf_model_getcomponentsobjectbyid = None + lib3mf_model_getbooleanobjectbyid = None lib3mf_model_getcolorgroupbyid = None lib3mf_model_getslicestackbyid = None lib3mf_model_getlevelsetbyid = None @@ -694,6 +979,7 @@ class FunctionTable: lib3mf_model_getobjects = None lib3mf_model_getmeshobjects = None lib3mf_model_getcomponentsobjects = None + lib3mf_model_getbooleanobjects = None lib3mf_model_gettexture2ds = None lib3mf_model_getbasematerialgroups = None lib3mf_model_getcolorgroups = None @@ -706,6 +992,7 @@ class FunctionTable: lib3mf_model_mergefrommodel = None lib3mf_model_addmeshobject = None lib3mf_model_addcomponentsobject = None + lib3mf_model_addbooleanobject = None lib3mf_model_addslicestack = None lib3mf_model_addtexture2dfromattachment = None lib3mf_model_addbasematerialgroup = None @@ -778,6 +1065,13 @@ class ObjectType(CTypesEnum): Model = 1 Support = 2 SolidSupport = 3 + Surface = 4 +'''Definition of BooleanOperation +''' +class BooleanOperation(CTypesEnum): + Union = 0 + Difference = 1 + Intersection = 2 '''Definition of TextureType ''' class TextureType(CTypesEnum): @@ -922,6 +1216,9 @@ class ImplicitNodeType(CTypesEnum): VectorFromScalar = 48 UnsignedMesh = 49 Mod = 50 + BeamLattice = 51 + FunctionGradient = 52 + NormalizeDistance = 53 '''Definition of ImplicitPortType ''' class ImplicitPortType(CTypesEnum): @@ -1514,6 +1811,12 @@ def _loadFunctionTableFromMethod(self, symbolLookupMethodAddress): methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) self.lib.lib3mf_componentsobjectiterator_getcurrentcomponentsobject = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_booleanobjectiterator_getcurrentbooleanobject")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_booleanobjectiterator_getcurrentbooleanobject = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_texture2diterator_getcurrenttexture2d")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) @@ -1802,6 +2105,12 @@ def _loadFunctionTableFromMethod(self, symbolLookupMethodAddress): methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)) self.lib.lib3mf_object_islevelsetobject = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_object_isbooleanobject")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_object_isbooleanobject = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_object_isvalid")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) @@ -2144,6 +2453,90 @@ def _loadFunctionTableFromMethod(self, symbolLookupMethodAddress): methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p) self.lib.lib3mf_levelset_setvolumedata = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_booleanobject_setbaseobject")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(Transform)) + self.lib.lib3mf_booleanobject_setbaseobject = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_booleanobject_getbaseobject")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_booleanobject_getbaseobject = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_booleanobject_setbasetransform")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(Transform)) + self.lib.lib3mf_booleanobject_setbasetransform = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_booleanobject_getbasetransform")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(Transform)) + self.lib.lib3mf_booleanobject_getbasetransform = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_booleanobject_setoperation")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, BooleanOperation) + self.lib.lib3mf_booleanobject_setoperation = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_booleanobject_getoperation")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)) + self.lib.lib3mf_booleanobject_getoperation = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_booleanobject_setcsgmodeenabled")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_bool) + self.lib.lib3mf_booleanobject_setcsgmodeenabled = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_booleanobject_getcsgmodeenabled")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_booleanobject_getcsgmodeenabled = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_booleanobject_setextractiongridresolution")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32) + self.lib.lib3mf_booleanobject_setextractiongridresolution = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_booleanobject_getextractiongridresolution")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)) + self.lib.lib3mf_booleanobject_getextractiongridresolution = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_booleanobject_getoperandcount")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)) + self.lib.lib3mf_booleanobject_getoperandcount = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_booleanobject_addoperand")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(Transform)) + self.lib.lib3mf_booleanobject_addoperand = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_booleanobject_getoperand")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p), ctypes.POINTER(Transform)) + self.lib.lib3mf_booleanobject_getoperand = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_booleanobject_mergetomeshobject")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_booleanobject_mergetomeshobject = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_beamlattice_getminlength")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) @@ -3506,6 +3899,144 @@ def _loadFunctionTableFromMethod(self, symbolLookupMethodAddress): methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) self.lib.lib3mf_unsignedmeshnode_getoutputdistance = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_beamlatticenode_getinputbeamlattice")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_beamlatticenode_getinputbeamlattice = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_beamlatticenode_getinputpos")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_beamlatticenode_getinputpos = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_beamlatticenode_getoutputdistance")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_beamlatticenode_getoutputdistance = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_beamlatticenode_setaccuraterange")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_double) + self.lib.lib3mf_beamlatticenode_setaccuraterange = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_beamlatticenode_getaccuraterange")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_double)) + self.lib.lib3mf_beamlatticenode_getaccuraterange = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_functiongradientnode_getinputfunctionid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_functiongradientnode_getinputfunctionid = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_functiongradientnode_getinputpos")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_functiongradientnode_getinputpos = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_functiongradientnode_getinputstep")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_functiongradientnode_getinputstep = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_functiongradientnode_setscalaroutputname")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p) + self.lib.lib3mf_functiongradientnode_setscalaroutputname = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_functiongradientnode_getscalaroutputname")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_functiongradientnode_getscalaroutputname = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_functiongradientnode_setvectorinputname")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p) + self.lib.lib3mf_functiongradientnode_setvectorinputname = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_functiongradientnode_getvectorinputname")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_functiongradientnode_getvectorinputname = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_functiongradientnode_getoutputnormalizedgradient")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_functiongradientnode_getoutputnormalizedgradient = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_functiongradientnode_getoutputgradient")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_functiongradientnode_getoutputgradient = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_functiongradientnode_getoutputmagnitude")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_functiongradientnode_getoutputmagnitude = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_normalizedistancenode_getinputfunctionid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_normalizedistancenode_getinputfunctionid = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_normalizedistancenode_getinputpos")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_normalizedistancenode_getinputpos = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_normalizedistancenode_getinputstep")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_normalizedistancenode_getinputstep = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_normalizedistancenode_setscalaroutputname")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p) + self.lib.lib3mf_normalizedistancenode_setscalaroutputname = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_normalizedistancenode_getscalaroutputname")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_normalizedistancenode_getscalaroutputname = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_normalizedistancenode_setvectorinputname")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p) + self.lib.lib3mf_normalizedistancenode_setvectorinputname = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_normalizedistancenode_getvectorinputname")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_normalizedistancenode_getvectorinputname = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_normalizedistancenode_getoutputresult")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_normalizedistancenode_getoutputresult = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_functioncallnode_getinputfunctionid")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) @@ -3884,6 +4415,24 @@ def _loadFunctionTableFromMethod(self, symbolLookupMethodAddress): methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) self.lib.lib3mf_implicitfunction_addunsignedmeshnode = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_implicitfunction_addbeamlatticenode")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_implicitfunction_addbeamlatticenode = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_implicitfunction_addfunctiongradientnode")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_implicitfunction_addfunctiongradientnode = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_implicitfunction_addnormalizedistancenode")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_implicitfunction_addnormalizedistancenode = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_implicitfunction_addfunctioncallnode")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) @@ -4538,6 +5087,12 @@ def _loadFunctionTableFromMethod(self, symbolLookupMethodAddress): methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) self.lib.lib3mf_model_getcomponentsobjectbyid = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getbooleanobjectbyid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getbooleanobjectbyid = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getcolorgroupbyid")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) @@ -4604,6 +5159,12 @@ def _loadFunctionTableFromMethod(self, symbolLookupMethodAddress): methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) self.lib.lib3mf_model_getcomponentsobjects = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getbooleanobjects")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getbooleanobjects = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_gettexture2ds")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) @@ -4676,6 +5237,12 @@ def _loadFunctionTableFromMethod(self, symbolLookupMethodAddress): methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) self.lib.lib3mf_model_addcomponentsobject = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addbooleanobject")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_addbooleanobject = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addslicestack")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) @@ -5056,6 +5623,9 @@ def _loadFunctionTable(self): self.lib.lib3mf_componentsobjectiterator_getcurrentcomponentsobject.restype = ctypes.c_int32 self.lib.lib3mf_componentsobjectiterator_getcurrentcomponentsobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_booleanobjectiterator_getcurrentbooleanobject.restype = ctypes.c_int32 + self.lib.lib3mf_booleanobjectiterator_getcurrentbooleanobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_texture2diterator_getcurrenttexture2d.restype = ctypes.c_int32 self.lib.lib3mf_texture2diterator_getcurrenttexture2d.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] @@ -5200,6 +5770,9 @@ def _loadFunctionTable(self): self.lib.lib3mf_object_islevelsetobject.restype = ctypes.c_int32 self.lib.lib3mf_object_islevelsetobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + self.lib.lib3mf_object_isbooleanobject.restype = ctypes.c_int32 + self.lib.lib3mf_object_isbooleanobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + self.lib.lib3mf_object_isvalid.restype = ctypes.c_int32 self.lib.lib3mf_object_isvalid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] @@ -5371,6 +5944,48 @@ def _loadFunctionTable(self): self.lib.lib3mf_levelset_setvolumedata.restype = ctypes.c_int32 self.lib.lib3mf_levelset_setvolumedata.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + self.lib.lib3mf_booleanobject_setbaseobject.restype = ctypes.c_int32 + self.lib.lib3mf_booleanobject_setbaseobject.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(Transform)] + + self.lib.lib3mf_booleanobject_getbaseobject.restype = ctypes.c_int32 + self.lib.lib3mf_booleanobject_getbaseobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_booleanobject_setbasetransform.restype = ctypes.c_int32 + self.lib.lib3mf_booleanobject_setbasetransform.argtypes = [ctypes.c_void_p, ctypes.POINTER(Transform)] + + self.lib.lib3mf_booleanobject_getbasetransform.restype = ctypes.c_int32 + self.lib.lib3mf_booleanobject_getbasetransform.argtypes = [ctypes.c_void_p, ctypes.POINTER(Transform)] + + self.lib.lib3mf_booleanobject_setoperation.restype = ctypes.c_int32 + self.lib.lib3mf_booleanobject_setoperation.argtypes = [ctypes.c_void_p, BooleanOperation] + + self.lib.lib3mf_booleanobject_getoperation.restype = ctypes.c_int32 + self.lib.lib3mf_booleanobject_getoperation.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + + self.lib.lib3mf_booleanobject_setcsgmodeenabled.restype = ctypes.c_int32 + self.lib.lib3mf_booleanobject_setcsgmodeenabled.argtypes = [ctypes.c_void_p, ctypes.c_bool] + + self.lib.lib3mf_booleanobject_getcsgmodeenabled.restype = ctypes.c_int32 + self.lib.lib3mf_booleanobject_getcsgmodeenabled.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + + self.lib.lib3mf_booleanobject_setextractiongridresolution.restype = ctypes.c_int32 + self.lib.lib3mf_booleanobject_setextractiongridresolution.argtypes = [ctypes.c_void_p, ctypes.c_uint32] + + self.lib.lib3mf_booleanobject_getextractiongridresolution.restype = ctypes.c_int32 + self.lib.lib3mf_booleanobject_getextractiongridresolution.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_booleanobject_getoperandcount.restype = ctypes.c_int32 + self.lib.lib3mf_booleanobject_getoperandcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_booleanobject_addoperand.restype = ctypes.c_int32 + self.lib.lib3mf_booleanobject_addoperand.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(Transform)] + + self.lib.lib3mf_booleanobject_getoperand.restype = ctypes.c_int32 + self.lib.lib3mf_booleanobject_getoperand.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p), ctypes.POINTER(Transform)] + + self.lib.lib3mf_booleanobject_mergetomeshobject.restype = ctypes.c_int32 + self.lib.lib3mf_booleanobject_mergetomeshobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_beamlattice_getminlength.restype = ctypes.c_int32 self.lib.lib3mf_beamlattice_getminlength.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_double)] @@ -6052,6 +6667,75 @@ def _loadFunctionTable(self): self.lib.lib3mf_unsignedmeshnode_getoutputdistance.restype = ctypes.c_int32 self.lib.lib3mf_unsignedmeshnode_getoutputdistance.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_beamlatticenode_getinputbeamlattice.restype = ctypes.c_int32 + self.lib.lib3mf_beamlatticenode_getinputbeamlattice.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_beamlatticenode_getinputpos.restype = ctypes.c_int32 + self.lib.lib3mf_beamlatticenode_getinputpos.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_beamlatticenode_getoutputdistance.restype = ctypes.c_int32 + self.lib.lib3mf_beamlatticenode_getoutputdistance.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_beamlatticenode_setaccuraterange.restype = ctypes.c_int32 + self.lib.lib3mf_beamlatticenode_setaccuraterange.argtypes = [ctypes.c_void_p, ctypes.c_double] + + self.lib.lib3mf_beamlatticenode_getaccuraterange.restype = ctypes.c_int32 + self.lib.lib3mf_beamlatticenode_getaccuraterange.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_double)] + + self.lib.lib3mf_functiongradientnode_getinputfunctionid.restype = ctypes.c_int32 + self.lib.lib3mf_functiongradientnode_getinputfunctionid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_functiongradientnode_getinputpos.restype = ctypes.c_int32 + self.lib.lib3mf_functiongradientnode_getinputpos.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_functiongradientnode_getinputstep.restype = ctypes.c_int32 + self.lib.lib3mf_functiongradientnode_getinputstep.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_functiongradientnode_setscalaroutputname.restype = ctypes.c_int32 + self.lib.lib3mf_functiongradientnode_setscalaroutputname.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + + self.lib.lib3mf_functiongradientnode_getscalaroutputname.restype = ctypes.c_int32 + self.lib.lib3mf_functiongradientnode_getscalaroutputname.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_functiongradientnode_setvectorinputname.restype = ctypes.c_int32 + self.lib.lib3mf_functiongradientnode_setvectorinputname.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + + self.lib.lib3mf_functiongradientnode_getvectorinputname.restype = ctypes.c_int32 + self.lib.lib3mf_functiongradientnode_getvectorinputname.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_functiongradientnode_getoutputnormalizedgradient.restype = ctypes.c_int32 + self.lib.lib3mf_functiongradientnode_getoutputnormalizedgradient.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_functiongradientnode_getoutputgradient.restype = ctypes.c_int32 + self.lib.lib3mf_functiongradientnode_getoutputgradient.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_functiongradientnode_getoutputmagnitude.restype = ctypes.c_int32 + self.lib.lib3mf_functiongradientnode_getoutputmagnitude.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_normalizedistancenode_getinputfunctionid.restype = ctypes.c_int32 + self.lib.lib3mf_normalizedistancenode_getinputfunctionid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_normalizedistancenode_getinputpos.restype = ctypes.c_int32 + self.lib.lib3mf_normalizedistancenode_getinputpos.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_normalizedistancenode_getinputstep.restype = ctypes.c_int32 + self.lib.lib3mf_normalizedistancenode_getinputstep.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_normalizedistancenode_setscalaroutputname.restype = ctypes.c_int32 + self.lib.lib3mf_normalizedistancenode_setscalaroutputname.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + + self.lib.lib3mf_normalizedistancenode_getscalaroutputname.restype = ctypes.c_int32 + self.lib.lib3mf_normalizedistancenode_getscalaroutputname.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_normalizedistancenode_setvectorinputname.restype = ctypes.c_int32 + self.lib.lib3mf_normalizedistancenode_setvectorinputname.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + + self.lib.lib3mf_normalizedistancenode_getvectorinputname.restype = ctypes.c_int32 + self.lib.lib3mf_normalizedistancenode_getvectorinputname.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_normalizedistancenode_getoutputresult.restype = ctypes.c_int32 + self.lib.lib3mf_normalizedistancenode_getoutputresult.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_functioncallnode_getinputfunctionid.restype = ctypes.c_int32 self.lib.lib3mf_functioncallnode_getinputfunctionid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] @@ -6241,6 +6925,15 @@ def _loadFunctionTable(self): self.lib.lib3mf_implicitfunction_addunsignedmeshnode.restype = ctypes.c_int32 self.lib.lib3mf_implicitfunction_addunsignedmeshnode.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_implicitfunction_addbeamlatticenode.restype = ctypes.c_int32 + self.lib.lib3mf_implicitfunction_addbeamlatticenode.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_implicitfunction_addfunctiongradientnode.restype = ctypes.c_int32 + self.lib.lib3mf_implicitfunction_addfunctiongradientnode.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_implicitfunction_addnormalizedistancenode.restype = ctypes.c_int32 + self.lib.lib3mf_implicitfunction_addnormalizedistancenode.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_implicitfunction_addfunctioncallnode.restype = ctypes.c_int32 self.lib.lib3mf_implicitfunction_addfunctioncallnode.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] @@ -6568,6 +7261,9 @@ def _loadFunctionTable(self): self.lib.lib3mf_model_getcomponentsobjectbyid.restype = ctypes.c_int32 self.lib.lib3mf_model_getcomponentsobjectbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_model_getbooleanobjectbyid.restype = ctypes.c_int32 + self.lib.lib3mf_model_getbooleanobjectbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_model_getcolorgroupbyid.restype = ctypes.c_int32 self.lib.lib3mf_model_getcolorgroupbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] @@ -6601,6 +7297,9 @@ def _loadFunctionTable(self): self.lib.lib3mf_model_getcomponentsobjects.restype = ctypes.c_int32 self.lib.lib3mf_model_getcomponentsobjects.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_model_getbooleanobjects.restype = ctypes.c_int32 + self.lib.lib3mf_model_getbooleanobjects.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_model_gettexture2ds.restype = ctypes.c_int32 self.lib.lib3mf_model_gettexture2ds.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] @@ -6637,6 +7336,9 @@ def _loadFunctionTable(self): self.lib.lib3mf_model_addcomponentsobject.restype = ctypes.c_int32 self.lib.lib3mf_model_addcomponentsobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_model_addbooleanobject.restype = ctypes.c_int32 + self.lib.lib3mf_model_addbooleanobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_model_addslicestack.restype = ctypes.c_int32 self.lib.lib3mf_model_addslicestack.argtypes = [ctypes.c_void_p, ctypes.c_double, ctypes.POINTER(ctypes.c_void_p)] @@ -6742,26 +7444,30 @@ def _checkBinaryVersion(self): raise ELib3MFException(ErrorCodes.INCOMPATIBLEBINARYVERSION) def checkError(self, instance, errorCode): - if errorCode != ErrorCodes.SUCCESS.value: + ec = globals().get('ErrorCodes') + if ec is None: + # Interpreter shutdown: ErrorCodes may already be cleared; avoid noisy teardown + return + if errorCode != ec.SUCCESS.value: if instance: if instance._wrapper != self: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'invalid wrapper call') + raise ELib3MFException(ec.INVALIDCAST, 'invalid wrapper call') message,_ = self.GetLastError(instance) raise ELib3MFException(errorCode, message) - def GetLibraryVersion(self): - pMajor = ctypes.c_uint32() - pMinor = ctypes.c_uint32() - pMicro = ctypes.c_uint32() + def GetLibraryVersion(self, Major = None, Minor = None, Micro = None): + pMajor = ctypes.c_uint32(Major if Major is not None else 0) + pMinor = ctypes.c_uint32(Minor if Minor is not None else 0) + pMicro = ctypes.c_uint32(Micro if Micro is not None else 0) self.checkError(None, self.lib.lib3mf_getlibraryversion(pMajor, pMinor, pMicro)) return pMajor.value, pMinor.value, pMicro.value - def GetPrereleaseInformation(self): + def GetPrereleaseInformation(self, PrereleaseInfo = None): pHasPrereleaseInfo = ctypes.c_bool() - nPrereleaseInfoBufferSize = ctypes.c_uint64(0) + nPrereleaseInfoBufferSize = ctypes.c_uint64(len(PrereleaseInfo) if PrereleaseInfo else 0) nPrereleaseInfoNeededChars = ctypes.c_uint64(0) - pPrereleaseInfoBuffer = ctypes.c_char_p(None) + pPrereleaseInfoBuffer = ctypes.c_char_p(str.encode(PrereleaseInfo) if PrereleaseInfo else None) self.checkError(None, self.lib.lib3mf_getprereleaseinformation(pHasPrereleaseInfo, nPrereleaseInfoBufferSize, nPrereleaseInfoNeededChars, pPrereleaseInfoBuffer)) nPrereleaseInfoBufferSize = ctypes.c_uint64(nPrereleaseInfoNeededChars.value) pPrereleaseInfoBuffer = (ctypes.c_char * (nPrereleaseInfoNeededChars.value))() @@ -6769,11 +7475,11 @@ def GetPrereleaseInformation(self): return pHasPrereleaseInfo.value, pPrereleaseInfoBuffer.value.decode() - def GetBuildInformation(self): + def GetBuildInformation(self, BuildInformation = None): pHasBuildInfo = ctypes.c_bool() - nBuildInformationBufferSize = ctypes.c_uint64(0) + nBuildInformationBufferSize = ctypes.c_uint64(len(BuildInformation) if BuildInformation else 0) nBuildInformationNeededChars = ctypes.c_uint64(0) - pBuildInformationBuffer = ctypes.c_char_p(None) + pBuildInformationBuffer = ctypes.c_char_p(str.encode(BuildInformation) if BuildInformation else None) self.checkError(None, self.lib.lib3mf_getbuildinformation(pHasBuildInfo, nBuildInformationBufferSize, nBuildInformationNeededChars, pBuildInformationBuffer)) nBuildInformationBufferSize = ctypes.c_uint64(nBuildInformationNeededChars.value) pBuildInformationBuffer = (ctypes.c_char * (nBuildInformationNeededChars.value))() @@ -6781,12 +7487,12 @@ def GetBuildInformation(self): return pHasBuildInfo.value, pBuildInformationBuffer.value.decode() - def GetSpecificationVersion(self, SpecificationURL): + def GetSpecificationVersion(self, SpecificationURL, IsSupported = None, Major = None, Minor = None, Micro = None): pSpecificationURL = ctypes.c_char_p(str.encode(SpecificationURL)) - pIsSupported = ctypes.c_bool() - pMajor = ctypes.c_uint32() - pMinor = ctypes.c_uint32() - pMicro = ctypes.c_uint32() + pIsSupported = ctypes.c_bool(IsSupported if IsSupported is not None else 0) + pMajor = ctypes.c_uint32(Major if Major is not None else 0) + pMinor = ctypes.c_uint32(Minor if Minor is not None else 0) + pMicro = ctypes.c_uint32(Micro if Micro is not None else 0) self.checkError(None, self.lib.lib3mf_getspecificationversion(pSpecificationURL, pIsSupported, pMajor, pMinor, pMicro)) return pIsSupported.value, pMajor.value, pMinor.value, pMicro.value @@ -6824,15 +7530,15 @@ def SetJournal(self, JournalPath): self.checkError(None, self.lib.lib3mf_setjournal(pJournalPath)) - def GetLastError(self, InstanceObject): + def GetLastError(self, InstanceObject, LastErrorString = None): InstanceHandle = None if InstanceObject: InstanceHandle = InstanceObject._handle else: raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') - nLastErrorStringBufferSize = ctypes.c_uint64(0) + nLastErrorStringBufferSize = ctypes.c_uint64(len(LastErrorString) if LastErrorString else 0) nLastErrorStringNeededChars = ctypes.c_uint64(0) - pLastErrorStringBuffer = ctypes.c_char_p(None) + pLastErrorStringBuffer = ctypes.c_char_p(str.encode(LastErrorString) if LastErrorString else None) pHasLastError = ctypes.c_bool() self.checkError(None, self.lib.lib3mf_getlasterror(InstanceHandle, nLastErrorStringBufferSize, nLastErrorStringNeededChars, pLastErrorStringBuffer, pHasLastError)) nLastErrorStringBufferSize = ctypes.c_uint64(nLastErrorStringNeededChars.value) @@ -6847,10 +7553,10 @@ def GetSymbolLookupMethod(self): return pSymbolLookupMethod.value - def RetrieveProgressMessage(self, TheProgressIdentifier): - nProgressMessageBufferSize = ctypes.c_uint64(0) + def RetrieveProgressMessage(self, TheProgressIdentifier, ProgressMessage = None): + nProgressMessageBufferSize = ctypes.c_uint64(len(ProgressMessage) if ProgressMessage else 0) nProgressMessageNeededChars = ctypes.c_uint64(0) - pProgressMessageBuffer = ctypes.c_char_p(None) + pProgressMessageBuffer = ctypes.c_char_p(str.encode(ProgressMessage) if ProgressMessage else None) self.checkError(None, self.lib.lib3mf_retrieveprogressmessage(TheProgressIdentifier, nProgressMessageBufferSize, nProgressMessageNeededChars, pProgressMessageBuffer)) nProgressMessageBufferSize = ctypes.c_uint64(nProgressMessageNeededChars.value) pProgressMessageBuffer = (ctypes.c_char * (nProgressMessageNeededChars.value))() @@ -6878,20 +7584,20 @@ def FloatRGBAToColor(self, Red, Green, Blue, Alpha): return pTheColor - def ColorToRGBA(self, TheColor): - pRed = ctypes.c_uint8() - pGreen = ctypes.c_uint8() - pBlue = ctypes.c_uint8() - pAlpha = ctypes.c_uint8() + def ColorToRGBA(self, TheColor, Red = None, Green = None, Blue = None, Alpha = None): + pRed = ctypes.c_uint8(Red if Red is not None else 0) + pGreen = ctypes.c_uint8(Green if Green is not None else 0) + pBlue = ctypes.c_uint8(Blue if Blue is not None else 0) + pAlpha = ctypes.c_uint8(Alpha if Alpha is not None else 0) self.checkError(None, self.lib.lib3mf_colortorgba(TheColor, pRed, pGreen, pBlue, pAlpha)) return pRed.value, pGreen.value, pBlue.value, pAlpha.value - def ColorToFloatRGBA(self, TheColor): - pRed = ctypes.c_float() - pGreen = ctypes.c_float() - pBlue = ctypes.c_float() - pAlpha = ctypes.c_float() + def ColorToFloatRGBA(self, TheColor, Red = None, Green = None, Blue = None, Alpha = None): + pRed = ctypes.c_float(Red if Red is not None else 0) + pGreen = ctypes.c_float(Green if Green is not None else 0) + pBlue = ctypes.c_float(Blue if Blue is not None else 0) + pAlpha = ctypes.c_float(Alpha if Alpha is not None else 0) self.checkError(None, self.lib.lib3mf_colortofloatrgba(TheColor, pRed, pGreen, pBlue, pAlpha)) return pRed.value, pGreen.value, pBlue.value, pAlpha.value @@ -6959,6 +7665,8 @@ def getObjectById_F4196034E2B9FDE6(self, handle, wrapper): # First 64 bits of SH return MeshObjectIterator(handle, wrapper) def getObjectById_564DE4217ED7614A(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObjectIterator" return ComponentsObjectIterator(handle, wrapper) + def getObjectById_AFF01F512E1FF6AE(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BooleanObjectIterator" + return BooleanObjectIterator(handle, wrapper) def getObjectById_4BD32B4870FFC03B(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Texture2DIterator" return Texture2DIterator(handle, wrapper) def getObjectById_65E6EDD9362C79CB(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroupIterator" @@ -6989,6 +7697,8 @@ def getObjectById_3B3A6DC6EC610497(self, handle, wrapper): # First 64 bits of SH return MeshObject(handle, wrapper) def getObjectById_E8A7D9C192EFD0E2(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::LevelSet" return LevelSet(handle, wrapper) + def getObjectById_85FA0E8806B6C357(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BooleanObject" + return BooleanObject(handle, wrapper) def getObjectById_63B3B461B30B4BA5(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BeamLattice" return BeamLattice(handle, wrapper) def getObjectById_4DF17E76926221C2(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::FunctionReference" @@ -7139,6 +7849,12 @@ def getObjectById_53601FD432E3DEF4(self, handle, wrapper): # First 64 bits of SH return MeshNode(handle, wrapper) def getObjectById_29985A628251A9CD(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::UnsignedMeshNode" return UnsignedMeshNode(handle, wrapper) + def getObjectById_0F3A4EE98F7FEC0C(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BeamLatticeNode" + return BeamLatticeNode(handle, wrapper) + def getObjectById_0437E27AEF740121(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::FunctionGradientNode" + return FunctionGradientNode(handle, wrapper) + def getObjectById_817D2E566E73AA8F(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::NormalizeDistanceNode" + return NormalizeDistanceNode(handle, wrapper) def getObjectById_0765C17C952F24E3(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::FunctionCallNode" return FunctionCallNode(handle, wrapper) def getObjectById_FC006BC888CAB4D0(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::NodeIterator" @@ -7216,16 +7932,16 @@ def GetStreamSize(self): return pStreamSize.value - def WriteToBuffer(self): - nBufferCount = ctypes.c_uint64(0) + def WriteToBuffer(self, Buffer = None): + nBufferCount = ctypes.c_uint64(len(Buffer) if Buffer else 0) nBufferNeededCount = ctypes.c_uint64(0) - pBufferBuffer = (ctypes.c_uint8*0)() + pBufferBuffer = (ctypes.c_uint8*(len(Buffer) if Buffer else 0))(*Buffer if Buffer else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_writetobuffer(self._handle, nBufferCount, nBufferNeededCount, pBufferBuffer)) nBufferCount = ctypes.c_uint64(nBufferNeededCount.value) pBufferBuffer = (ctypes.c_uint8 * nBufferNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_writetobuffer(self._handle, nBufferCount, nBufferNeededCount, pBufferBuffer)) - return [pBufferBuffer[i] for i in range(nBufferNeededCount.value)] + return list(pBufferBuffer) def WriteToCallback(self, TheWriteCallbackFunc, TheSeekCallbackFunc, UserData): pUserData = ctypes.c_void_p(UserData) @@ -7259,9 +7975,9 @@ def GetStrictModeActive(self): return pStrictModeActive.value - def GetWarning(self, Index): + def GetWarning(self, Index, ErrorCode = None): nIndex = ctypes.c_uint32(Index) - pErrorCode = ctypes.c_uint32() + pErrorCode = ctypes.c_uint32(ErrorCode if ErrorCode is not None else 0) nWarningBufferSize = ctypes.c_uint64(0) nWarningNeededChars = ctypes.c_uint64(0) pWarningBuffer = ctypes.c_char_p(None) @@ -7339,9 +8055,9 @@ def GetStrictModeActive(self): return pStrictModeActive.value - def GetWarning(self, Index): + def GetWarning(self, Index, ErrorCode = None): nIndex = ctypes.c_uint32(Index) - pErrorCode = ctypes.c_uint32() + pErrorCode = ctypes.c_uint32(ErrorCode if ErrorCode is not None else 0) nWarningBufferSize = ctypes.c_uint64(0) nWarningNeededChars = ctypes.c_uint64(0) pWarningBuffer = ctypes.c_char_p(None) @@ -7551,6 +8267,23 @@ def GetCurrentComponentsObject(self): +''' Class Implementation for BooleanObjectIterator +''' +class BooleanObjectIterator(ResourceIterator): + def __init__(self, handle, wrapper): + ResourceIterator.__init__(self, handle, wrapper) + def GetCurrentBooleanObject(self): + ResourceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_booleanobjectiterator_getcurrentbooleanobject(self._handle, ResourceHandle)) + if ResourceHandle: + ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ResourceObject + + + ''' Class Implementation for Texture2DIterator ''' class Texture2DIterator(ResourceIterator): @@ -7919,16 +8652,16 @@ def SetTriangleList(self, TriangleIndices): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_triangleset_settrianglelist(self._handle, nTriangleIndicesCount, pTriangleIndicesBuffer)) - def GetTriangleList(self): - nTriangleIndicesCount = ctypes.c_uint64(0) + def GetTriangleList(self, TriangleIndices = None): + nTriangleIndicesCount = ctypes.c_uint64(len(TriangleIndices) if TriangleIndices else 0) nTriangleIndicesNeededCount = ctypes.c_uint64(0) - pTriangleIndicesBuffer = (ctypes.c_uint32*0)() + pTriangleIndicesBuffer = (ctypes.c_uint32*(len(TriangleIndices) if TriangleIndices else 0))(*TriangleIndices if TriangleIndices else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_triangleset_gettrianglelist(self._handle, nTriangleIndicesCount, nTriangleIndicesNeededCount, pTriangleIndicesBuffer)) nTriangleIndicesCount = ctypes.c_uint64(nTriangleIndicesNeededCount.value) pTriangleIndicesBuffer = (ctypes.c_uint32 * nTriangleIndicesNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_triangleset_gettrianglelist(self._handle, nTriangleIndicesCount, nTriangleIndicesNeededCount, pTriangleIndicesBuffer)) - return [pTriangleIndicesBuffer[i] for i in range(nTriangleIndicesNeededCount.value)] + return list(pTriangleIndicesBuffer) def AddTriangleList(self, TriangleIndices): nTriangleIndicesCount = ctypes.c_uint64(len(TriangleIndices)) @@ -8028,6 +8761,12 @@ def IsLevelSetObject(self): return pIsLevelSetObject.value + def IsBooleanObject(self): + pIsBooleanObject = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_isbooleanobject(self._handle, pIsBooleanObject)) + + return pIsBooleanObject.value + def IsValid(self): pIsValid = ctypes.c_bool() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_isvalid(self._handle, pIsValid)) @@ -8063,8 +8802,8 @@ def GetOutbox(self): return pOutbox - def GetUUID(self): - pHasUUID = ctypes.c_bool() + def GetUUID(self, HasUUID = None): + pHasUUID = ctypes.c_bool(HasUUID if HasUUID is not None else 0) nUUIDBufferSize = ctypes.c_uint64(0) nUUIDNeededChars = ctypes.c_uint64(0) pUUIDBuffer = ctypes.c_char_p(None) @@ -8167,16 +8906,16 @@ def AddVertex(self, Coordinates): return pNewIndex.value - def GetVertices(self): - nVerticesCount = ctypes.c_uint64(0) + def GetVertices(self, Vertices = None): + nVerticesCount = ctypes.c_uint64(len(Vertices) if Vertices else 0) nVerticesNeededCount = ctypes.c_uint64(0) - pVerticesBuffer = (Position*0)() + pVerticesBuffer = (Position*(len(Vertices) if Vertices else 0))(*Vertices if Vertices else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getvertices(self._handle, nVerticesCount, nVerticesNeededCount, pVerticesBuffer)) nVerticesCount = ctypes.c_uint64(nVerticesNeededCount.value) pVerticesBuffer = (Position * nVerticesNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getvertices(self._handle, nVerticesCount, nVerticesNeededCount, pVerticesBuffer)) - return [pVerticesBuffer[i] for i in range(nVerticesNeededCount.value)] + return list(pVerticesBuffer) def GetTriangle(self, Index): nIndex = ctypes.c_uint32(Index) @@ -8196,16 +8935,16 @@ def AddTriangle(self, Indices): return pNewIndex.value - def GetTriangleIndices(self): - nIndicesCount = ctypes.c_uint64(0) + def GetTriangleIndices(self, Indices = None): + nIndicesCount = ctypes.c_uint64(len(Indices) if Indices else 0) nIndicesNeededCount = ctypes.c_uint64(0) - pIndicesBuffer = (Triangle*0)() + pIndicesBuffer = (Triangle*(len(Indices) if Indices else 0))(*Indices if Indices else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_gettriangleindices(self._handle, nIndicesCount, nIndicesNeededCount, pIndicesBuffer)) nIndicesCount = ctypes.c_uint64(nIndicesNeededCount.value) pIndicesBuffer = (Triangle * nIndicesNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_gettriangleindices(self._handle, nIndicesCount, nIndicesNeededCount, pIndicesBuffer)) - return [pIndicesBuffer[i] for i in range(nIndicesNeededCount.value)] + return list(pIndicesBuffer) def SetObjectLevelProperty(self, UniqueResourceID, PropertyID): nUniqueResourceID = ctypes.c_uint32(UniqueResourceID) @@ -8213,9 +8952,9 @@ def SetObjectLevelProperty(self, UniqueResourceID, PropertyID): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_setobjectlevelproperty(self._handle, nUniqueResourceID, nPropertyID)) - def GetObjectLevelProperty(self): - pUniqueResourceID = ctypes.c_uint32() - pPropertyID = ctypes.c_uint32() + def GetObjectLevelProperty(self, UniqueResourceID = None, PropertyID = None): + pUniqueResourceID = ctypes.c_uint32(UniqueResourceID if UniqueResourceID is not None else 0) + pPropertyID = ctypes.c_uint32(PropertyID if PropertyID is not None else 0) pHasObjectLevelProperty = ctypes.c_bool() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getobjectlevelproperty(self._handle, pUniqueResourceID, pPropertyID, pHasObjectLevelProperty)) @@ -8226,9 +8965,9 @@ def SetTriangleProperties(self, Index, Properties): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_settriangleproperties(self._handle, nIndex, Properties)) - def GetTriangleProperties(self, Index): + def GetTriangleProperties(self, Index, Property = None): nIndex = ctypes.c_uint32(Index) - pProperty = TriangleProperties() + pProperty = Property if Property is not None else TriangleProperties() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_gettriangleproperties(self._handle, nIndex, pProperty)) return pProperty @@ -8239,16 +8978,16 @@ def SetAllTriangleProperties(self, PropertiesArray): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_setalltriangleproperties(self._handle, nPropertiesArrayCount, pPropertiesArrayBuffer)) - def GetAllTriangleProperties(self): - nPropertiesArrayCount = ctypes.c_uint64(0) + def GetAllTriangleProperties(self, PropertiesArray = None): + nPropertiesArrayCount = ctypes.c_uint64(len(PropertiesArray) if PropertiesArray else 0) nPropertiesArrayNeededCount = ctypes.c_uint64(0) - pPropertiesArrayBuffer = (TriangleProperties*0)() + pPropertiesArrayBuffer = (TriangleProperties*(len(PropertiesArray) if PropertiesArray else 0))(*PropertiesArray if PropertiesArray else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getalltriangleproperties(self._handle, nPropertiesArrayCount, nPropertiesArrayNeededCount, pPropertiesArrayBuffer)) nPropertiesArrayCount = ctypes.c_uint64(nPropertiesArrayNeededCount.value) pPropertiesArrayBuffer = (TriangleProperties * nPropertiesArrayNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getalltriangleproperties(self._handle, nPropertiesArrayCount, nPropertiesArrayNeededCount, pPropertiesArrayBuffer)) - return [pPropertiesArrayBuffer[i] for i in range(nPropertiesArrayNeededCount.value)] + return list(pPropertiesArrayBuffer) def ClearAllProperties(self): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_clearallproperties(self._handle)) @@ -8469,6 +9208,115 @@ def SetVolumeData(self, TheVolumeDataObject): +''' Class Implementation for BooleanObject +''' +class BooleanObject(Object): + def __init__(self, handle, wrapper): + Object.__init__(self, handle, wrapper) + def SetBaseObject(self, BaseObjectObject, Transform): + BaseObjectHandle = None + if BaseObjectObject: + BaseObjectHandle = BaseObjectObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_booleanobject_setbaseobject(self._handle, BaseObjectHandle, Transform)) + + + def GetBaseObject(self): + BaseObjectHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_booleanobject_getbaseobject(self._handle, BaseObjectHandle)) + if BaseObjectHandle: + BaseObjectObject = self._wrapper._polymorphicFactory(BaseObjectHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return BaseObjectObject + + def SetBaseTransform(self, Transform): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_booleanobject_setbasetransform(self._handle, Transform)) + + + def GetBaseTransform(self): + pTransform = Transform() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_booleanobject_getbasetransform(self._handle, pTransform)) + + return pTransform + + def SetOperation(self, Operation): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_booleanobject_setoperation(self._handle, Operation)) + + + def GetOperation(self): + pOperation = ctypes.c_int32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_booleanobject_getoperation(self._handle, pOperation)) + + return BooleanOperation(pOperation.value) + + def SetCSGModeEnabled(self, CSGModeEnabled): + bCSGModeEnabled = ctypes.c_bool(CSGModeEnabled) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_booleanobject_setcsgmodeenabled(self._handle, bCSGModeEnabled)) + + + def GetCSGModeEnabled(self): + pCSGModeEnabled = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_booleanobject_getcsgmodeenabled(self._handle, pCSGModeEnabled)) + + return pCSGModeEnabled.value + + def SetExtractionGridResolution(self, GridResolution): + nGridResolution = ctypes.c_uint32(GridResolution) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_booleanobject_setextractiongridresolution(self._handle, nGridResolution)) + + + def GetExtractionGridResolution(self): + pGridResolution = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_booleanobject_getextractiongridresolution(self._handle, pGridResolution)) + + return pGridResolution.value + + def GetOperandCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_booleanobject_getoperandcount(self._handle, pCount)) + + return pCount.value + + def AddOperand(self, OperandObjectObject, Transform): + OperandObjectHandle = None + if OperandObjectObject: + OperandObjectHandle = OperandObjectObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_booleanobject_addoperand(self._handle, OperandObjectHandle, Transform)) + + + def GetOperand(self, Index, OperandObjectObject = None): + nIndex = ctypes.c_uint32(Index) + OperandObjectHandle = ctypes.c_void_p() + if OperandObjectObject is not None: + OperandObjectHandle = ctypes.c_void_p(OperandObjectObject._handle) + else: + OperandObjectHandle = ctypes.c_void_p() + pTransform = Transform() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_booleanobject_getoperand(self._handle, nIndex, OperandObjectHandle, pTransform)) + if OperandObjectHandle.value: + OperandObjectObject = self._wrapper._polymorphicFactory(OperandObjectHandle.value) + else: + OperandObjectObject = None + + return OperandObjectObject, pTransform + + def MergeToMeshObject(self): + MeshObjectHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_booleanobject_mergetomeshobject(self._handle, MeshObjectHandle)) + if MeshObjectHandle: + MeshObjectObject = self._wrapper._polymorphicFactory(MeshObjectHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return MeshObjectObject + + + ''' Class Implementation for BeamLattice ''' class BeamLattice(Base): @@ -8485,21 +9333,21 @@ def SetMinLength(self, MinLength): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setminlength(self._handle, dMinLength)) - def GetClipping(self): - pClipMode = ctypes.c_int32() - pUniqueResourceID = ctypes.c_uint32() + def GetClipping(self, ClipMode = None, UniqueResourceID = None): + pClipMode = ctypes.c_int32(ClipMode if ClipMode else 0) + pUniqueResourceID = ctypes.c_uint32(UniqueResourceID if UniqueResourceID is not None else 0) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getclipping(self._handle, pClipMode, pUniqueResourceID)) - return BeamLatticeClipMode(pClipMode.value), pUniqueResourceID.value + return pClipMode.value, pUniqueResourceID.value def SetClipping(self, ClipMode, UniqueResourceID): nUniqueResourceID = ctypes.c_uint32(UniqueResourceID) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setclipping(self._handle, ClipMode, nUniqueResourceID)) - def GetRepresentation(self): + def GetRepresentation(self, UniqueResourceID = None): pHasRepresentation = ctypes.c_bool() - pUniqueResourceID = ctypes.c_uint32() + pUniqueResourceID = ctypes.c_uint32(UniqueResourceID if UniqueResourceID is not None else 0) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getrepresentation(self._handle, pHasRepresentation, pUniqueResourceID)) return pHasRepresentation.value, pUniqueResourceID.value @@ -8509,12 +9357,12 @@ def SetRepresentation(self, UniqueResourceID): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setrepresentation(self._handle, nUniqueResourceID)) - def GetBallOptions(self): - pBallMode = ctypes.c_int32() - pBallRadius = ctypes.c_double() + def GetBallOptions(self, BallMode = None, BallRadius = None): + pBallMode = ctypes.c_int32(BallMode if BallMode else 0) + pBallRadius = ctypes.c_double(BallRadius if BallRadius is not None else 0) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getballoptions(self._handle, pBallMode, pBallRadius)) - return BeamLatticeBallMode(pBallMode.value), pBallRadius.value + return pBallMode.value, pBallRadius.value def SetBallOptions(self, BallMode, BallRadius): dBallRadius = ctypes.c_double(BallRadius) @@ -8551,16 +9399,16 @@ def SetBeams(self, BeamInfo): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setbeams(self._handle, nBeamInfoCount, pBeamInfoBuffer)) - def GetBeams(self): - nBeamInfoCount = ctypes.c_uint64(0) + def GetBeams(self, BeamInfo = None): + nBeamInfoCount = ctypes.c_uint64(len(BeamInfo) if BeamInfo else 0) nBeamInfoNeededCount = ctypes.c_uint64(0) - pBeamInfoBuffer = (Beam*0)() + pBeamInfoBuffer = (Beam*(len(BeamInfo) if BeamInfo else 0))(*BeamInfo if BeamInfo else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getbeams(self._handle, nBeamInfoCount, nBeamInfoNeededCount, pBeamInfoBuffer)) nBeamInfoCount = ctypes.c_uint64(nBeamInfoNeededCount.value) pBeamInfoBuffer = (Beam * nBeamInfoNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getbeams(self._handle, nBeamInfoCount, nBeamInfoNeededCount, pBeamInfoBuffer)) - return [pBeamInfoBuffer[i] for i in range(nBeamInfoNeededCount.value)] + return list(pBeamInfoBuffer) def GetBallCount(self): pCount = ctypes.c_uint32() @@ -8592,16 +9440,16 @@ def SetBalls(self, BallInfo): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setballs(self._handle, nBallInfoCount, pBallInfoBuffer)) - def GetBalls(self): - nBallInfoCount = ctypes.c_uint64(0) + def GetBalls(self, BallInfo = None): + nBallInfoCount = ctypes.c_uint64(len(BallInfo) if BallInfo else 0) nBallInfoNeededCount = ctypes.c_uint64(0) - pBallInfoBuffer = (Ball*0)() + pBallInfoBuffer = (Ball*(len(BallInfo) if BallInfo else 0))(*BallInfo if BallInfo else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getballs(self._handle, nBallInfoCount, nBallInfoNeededCount, pBallInfoBuffer)) nBallInfoCount = ctypes.c_uint64(nBallInfoNeededCount.value) pBallInfoBuffer = (Ball * nBallInfoNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getballs(self._handle, nBallInfoCount, nBallInfoNeededCount, pBallInfoBuffer)) - return [pBallInfoBuffer[i] for i in range(nBallInfoNeededCount.value)] + return list(pBallInfoBuffer) def GetBeamSetCount(self): pCount = ctypes.c_uint32() @@ -8918,8 +9766,8 @@ def GetObjectResourceID(self): return pUniqueResourceID.value - def GetUUID(self): - pHasUUID = ctypes.c_bool() + def GetUUID(self, HasUUID = None): + pHasUUID = ctypes.c_bool(HasUUID if HasUUID is not None else 0) nUUIDBufferSize = ctypes.c_uint64(0) nUUIDNeededChars = ctypes.c_uint64(0) pUUIDBuffer = ctypes.c_char_p(None) @@ -9041,16 +9889,16 @@ def SetReferences(self, References): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_setreferences(self._handle, nReferencesCount, pReferencesBuffer)) - def GetReferences(self): - nReferencesCount = ctypes.c_uint64(0) + def GetReferences(self, References = None): + nReferencesCount = ctypes.c_uint64(len(References) if References else 0) nReferencesNeededCount = ctypes.c_uint64(0) - pReferencesBuffer = (ctypes.c_uint32*0)() + pReferencesBuffer = (ctypes.c_uint32*(len(References) if References else 0))(*References if References else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getreferences(self._handle, nReferencesCount, nReferencesNeededCount, pReferencesBuffer)) nReferencesCount = ctypes.c_uint64(nReferencesNeededCount.value) pReferencesBuffer = (ctypes.c_uint32 * nReferencesNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getreferences(self._handle, nReferencesCount, nReferencesNeededCount, pReferencesBuffer)) - return [pReferencesBuffer[i] for i in range(nReferencesNeededCount.value)] + return list(pReferencesBuffer) def GetBallReferenceCount(self): pCount = ctypes.c_uint32() @@ -9064,16 +9912,16 @@ def SetBallReferences(self, BallReferences): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_setballreferences(self._handle, nBallReferencesCount, pBallReferencesBuffer)) - def GetBallReferences(self): - nBallReferencesCount = ctypes.c_uint64(0) + def GetBallReferences(self, BallReferences = None): + nBallReferencesCount = ctypes.c_uint64(len(BallReferences) if BallReferences else 0) nBallReferencesNeededCount = ctypes.c_uint64(0) - pBallReferencesBuffer = (ctypes.c_uint32*0)() + pBallReferencesBuffer = (ctypes.c_uint32*(len(BallReferences) if BallReferences else 0))(*BallReferences if BallReferences else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getballreferences(self._handle, nBallReferencesCount, nBallReferencesNeededCount, pBallReferencesBuffer)) nBallReferencesCount = ctypes.c_uint64(nBallReferencesNeededCount.value) pBallReferencesBuffer = (ctypes.c_uint32 * nBallReferencesNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getballreferences(self._handle, nBallReferencesCount, nBallReferencesNeededCount, pBallReferencesBuffer)) - return [pBallReferencesBuffer[i] for i in range(nBallReferencesNeededCount.value)] + return list(pBallReferencesBuffer) @@ -9088,16 +9936,16 @@ def GetCount(self): return pCount.value - def GetAllPropertyIDs(self): - nPropertyIDsCount = ctypes.c_uint64(0) + def GetAllPropertyIDs(self, PropertyIDs = None): + nPropertyIDsCount = ctypes.c_uint64(len(PropertyIDs) if PropertyIDs else 0) nPropertyIDsNeededCount = ctypes.c_uint64(0) - pPropertyIDsBuffer = (ctypes.c_uint32*0)() + pPropertyIDsBuffer = (ctypes.c_uint32*(len(PropertyIDs) if PropertyIDs else 0))(*PropertyIDs if PropertyIDs else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) - return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] + return list(pPropertyIDsBuffer) def AddMaterial(self, Name, DisplayColor): pName = ctypes.c_char_p(str.encode(Name)) @@ -9154,16 +10002,16 @@ def GetCount(self): return pCount.value - def GetAllPropertyIDs(self): - nPropertyIDsCount = ctypes.c_uint64(0) + def GetAllPropertyIDs(self, PropertyIDs = None): + nPropertyIDsCount = ctypes.c_uint64(len(PropertyIDs) if PropertyIDs else 0) nPropertyIDsNeededCount = ctypes.c_uint64(0) - pPropertyIDsBuffer = (ctypes.c_uint32*0)() + pPropertyIDsBuffer = (ctypes.c_uint32*(len(PropertyIDs) if PropertyIDs else 0))(*PropertyIDs if PropertyIDs else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) - return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] + return list(pPropertyIDsBuffer) def AddColor(self, TheColor): pPropertyID = ctypes.c_uint32() @@ -9201,16 +10049,16 @@ def GetCount(self): return pCount.value - def GetAllPropertyIDs(self): - nPropertyIDsCount = ctypes.c_uint64(0) + def GetAllPropertyIDs(self, PropertyIDs = None): + nPropertyIDsCount = ctypes.c_uint64(len(PropertyIDs) if PropertyIDs else 0) nPropertyIDsNeededCount = ctypes.c_uint64(0) - pPropertyIDsBuffer = (ctypes.c_uint32*0)() + pPropertyIDsBuffer = (ctypes.c_uint32*(len(PropertyIDs) if PropertyIDs else 0))(*PropertyIDs if PropertyIDs else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) - return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] + return list(pPropertyIDsBuffer) def AddTex2Coord(self, UVCoordinate): pPropertyID = ctypes.c_uint32() @@ -9253,16 +10101,16 @@ def GetCount(self): return pCount.value - def GetAllPropertyIDs(self): - nPropertyIDsCount = ctypes.c_uint64(0) + def GetAllPropertyIDs(self, PropertyIDs = None): + nPropertyIDsCount = ctypes.c_uint64(len(PropertyIDs) if PropertyIDs else 0) nPropertyIDsNeededCount = ctypes.c_uint64(0) - pPropertyIDsBuffer = (ctypes.c_uint32*0)() + pPropertyIDsBuffer = (ctypes.c_uint32*(len(PropertyIDs) if PropertyIDs else 0))(*PropertyIDs if PropertyIDs else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) - return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] + return list(pPropertyIDsBuffer) def GetBaseMaterialGroup(self): BaseMaterialGroupInstanceHandle = ctypes.c_void_p() @@ -9287,17 +10135,17 @@ def RemoveComposite(self, PropertyID): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_removecomposite(self._handle, nPropertyID)) - def GetComposite(self, PropertyID): + def GetComposite(self, PropertyID, Composite = None): nPropertyID = ctypes.c_uint32(PropertyID) - nCompositeCount = ctypes.c_uint64(0) + nCompositeCount = ctypes.c_uint64(len(Composite) if Composite else 0) nCompositeNeededCount = ctypes.c_uint64(0) - pCompositeBuffer = (CompositeConstituent*0)() + pCompositeBuffer = (CompositeConstituent*(len(Composite) if Composite else 0))(*Composite if Composite else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_getcomposite(self._handle, nPropertyID, nCompositeCount, nCompositeNeededCount, pCompositeBuffer)) nCompositeCount = ctypes.c_uint64(nCompositeNeededCount.value) pCompositeBuffer = (CompositeConstituent * nCompositeNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_getcomposite(self._handle, nPropertyID, nCompositeCount, nCompositeNeededCount, pCompositeBuffer)) - return [pCompositeBuffer[i] for i in range(nCompositeNeededCount.value)] + return list(pCompositeBuffer) @@ -9312,16 +10160,16 @@ def GetCount(self): return pCount.value - def GetAllPropertyIDs(self): - nPropertyIDsCount = ctypes.c_uint64(0) + def GetAllPropertyIDs(self, PropertyIDs = None): + nPropertyIDsCount = ctypes.c_uint64(len(PropertyIDs) if PropertyIDs else 0) nPropertyIDsNeededCount = ctypes.c_uint64(0) - pPropertyIDsBuffer = (ctypes.c_uint32*0)() + pPropertyIDsBuffer = (ctypes.c_uint32*(len(PropertyIDs) if PropertyIDs else 0))(*PropertyIDs if PropertyIDs else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) - return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] + return list(pPropertyIDsBuffer) def AddMultiProperty(self, PropertyIDs): nPropertyIDsCount = ctypes.c_uint64(len(PropertyIDs)) @@ -9338,17 +10186,17 @@ def SetMultiProperty(self, PropertyID, PropertyIDs): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_setmultiproperty(self._handle, nPropertyID, nPropertyIDsCount, pPropertyIDsBuffer)) - def GetMultiProperty(self, PropertyID): + def GetMultiProperty(self, PropertyID, PropertyIDs = None): nPropertyID = ctypes.c_uint32(PropertyID) - nPropertyIDsCount = ctypes.c_uint64(0) + nPropertyIDsCount = ctypes.c_uint64(len(PropertyIDs) if PropertyIDs else 0) nPropertyIDsNeededCount = ctypes.c_uint64(0) - pPropertyIDsBuffer = (ctypes.c_uint32*0)() + pPropertyIDsBuffer = (ctypes.c_uint32*(len(PropertyIDs) if PropertyIDs else 0))(*PropertyIDs if PropertyIDs else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getmultiproperty(self._handle, nPropertyID, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getmultiproperty(self._handle, nPropertyID, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) - return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] + return list(pPropertyIDsBuffer) def RemoveMultiProperty(self, PropertyID): nPropertyID = ctypes.c_uint32(PropertyID) @@ -9574,16 +10422,16 @@ def GetStreamSize(self): return pStreamSize.value - def WriteToBuffer(self): - nBufferCount = ctypes.c_uint64(0) + def WriteToBuffer(self, Buffer = None): + nBufferCount = ctypes.c_uint64(len(Buffer) if Buffer else 0) nBufferNeededCount = ctypes.c_uint64(0) - pBufferBuffer = (ctypes.c_uint8*0)() + pBufferBuffer = (ctypes.c_uint8*(len(Buffer) if Buffer else 0))(*Buffer if Buffer else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_writetobuffer(self._handle, nBufferCount, nBufferNeededCount, pBufferBuffer)) nBufferCount = ctypes.c_uint64(nBufferNeededCount.value) pBufferBuffer = (ctypes.c_uint8 * nBufferNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_writetobuffer(self._handle, nBufferCount, nBufferNeededCount, pBufferBuffer)) - return [pBufferBuffer[i] for i in range(nBufferNeededCount.value)] + return list(pBufferBuffer) def ReadFromBuffer(self, Buffer): nBufferCount = ctypes.c_uint64(len(Buffer)) @@ -9627,12 +10475,12 @@ def SetContentType(self, ContentType): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_setcontenttype(self._handle, ContentType)) - def GetTileStyleUV(self): - pTileStyleU = ctypes.c_int32() - pTileStyleV = ctypes.c_int32() + def GetTileStyleUV(self, TileStyleU = None, TileStyleV = None): + pTileStyleU = ctypes.c_int32(TileStyleU if TileStyleU else 0) + pTileStyleV = ctypes.c_int32(TileStyleV if TileStyleV else 0) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_gettilestyleuv(self._handle, pTileStyleU, pTileStyleV)) - return TextureTileStyle(pTileStyleU.value), TextureTileStyle(pTileStyleV.value) + return pTileStyleU.value, pTileStyleV.value def SetTileStyleUV(self, TileStyleU, TileStyleV): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_settilestyleuv(self._handle, TileStyleU, TileStyleV)) @@ -10834,6 +11682,232 @@ def GetOutputDistance(self): +''' Class Implementation for BeamLatticeNode +''' +class BeamLatticeNode(ImplicitNode): + def __init__(self, handle, wrapper): + ImplicitNode.__init__(self, handle, wrapper) + def GetInputBeamLattice(self): + BeamLatticeHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlatticenode_getinputbeamlattice(self._handle, BeamLatticeHandle)) + if BeamLatticeHandle: + BeamLatticeObject = self._wrapper._polymorphicFactory(BeamLatticeHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return BeamLatticeObject + + def GetInputPos(self): + PosHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlatticenode_getinputpos(self._handle, PosHandle)) + if PosHandle: + PosObject = self._wrapper._polymorphicFactory(PosHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return PosObject + + def GetOutputDistance(self): + DistanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlatticenode_getoutputdistance(self._handle, DistanceHandle)) + if DistanceHandle: + DistanceObject = self._wrapper._polymorphicFactory(DistanceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return DistanceObject + + def SetAccurateRange(self, AccurateRange): + dAccurateRange = ctypes.c_double(AccurateRange) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlatticenode_setaccuraterange(self._handle, dAccurateRange)) + + + def GetAccurateRange(self): + pAccurateRange = ctypes.c_double() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlatticenode_getaccuraterange(self._handle, pAccurateRange)) + + return pAccurateRange.value + + + +''' Class Implementation for FunctionGradientNode +''' +class FunctionGradientNode(ImplicitNode): + def __init__(self, handle, wrapper): + ImplicitNode.__init__(self, handle, wrapper) + def GetInputFunctionID(self): + FunctionHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_functiongradientnode_getinputfunctionid(self._handle, FunctionHandle)) + if FunctionHandle: + FunctionObject = self._wrapper._polymorphicFactory(FunctionHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return FunctionObject + + def GetInputPos(self): + PosHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_functiongradientnode_getinputpos(self._handle, PosHandle)) + if PosHandle: + PosObject = self._wrapper._polymorphicFactory(PosHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return PosObject + + def GetInputStep(self): + StepHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_functiongradientnode_getinputstep(self._handle, StepHandle)) + if StepHandle: + StepObject = self._wrapper._polymorphicFactory(StepHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return StepObject + + def SetScalarOutputName(self, ScalarOutputName): + pScalarOutputName = ctypes.c_char_p(str.encode(ScalarOutputName)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_functiongradientnode_setscalaroutputname(self._handle, pScalarOutputName)) + + + def GetScalarOutputName(self): + nScalarOutputNameBufferSize = ctypes.c_uint64(0) + nScalarOutputNameNeededChars = ctypes.c_uint64(0) + pScalarOutputNameBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_functiongradientnode_getscalaroutputname(self._handle, nScalarOutputNameBufferSize, nScalarOutputNameNeededChars, pScalarOutputNameBuffer)) + nScalarOutputNameBufferSize = ctypes.c_uint64(nScalarOutputNameNeededChars.value) + pScalarOutputNameBuffer = (ctypes.c_char * (nScalarOutputNameNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_functiongradientnode_getscalaroutputname(self._handle, nScalarOutputNameBufferSize, nScalarOutputNameNeededChars, pScalarOutputNameBuffer)) + + return pScalarOutputNameBuffer.value.decode() + + def SetVectorInputName(self, VectorInputName): + pVectorInputName = ctypes.c_char_p(str.encode(VectorInputName)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_functiongradientnode_setvectorinputname(self._handle, pVectorInputName)) + + + def GetVectorInputName(self): + nVectorInputNameBufferSize = ctypes.c_uint64(0) + nVectorInputNameNeededChars = ctypes.c_uint64(0) + pVectorInputNameBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_functiongradientnode_getvectorinputname(self._handle, nVectorInputNameBufferSize, nVectorInputNameNeededChars, pVectorInputNameBuffer)) + nVectorInputNameBufferSize = ctypes.c_uint64(nVectorInputNameNeededChars.value) + pVectorInputNameBuffer = (ctypes.c_char * (nVectorInputNameNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_functiongradientnode_getvectorinputname(self._handle, nVectorInputNameBufferSize, nVectorInputNameNeededChars, pVectorInputNameBuffer)) + + return pVectorInputNameBuffer.value.decode() + + def GetOutputNormalizedGradient(self): + NormalizedGradientHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_functiongradientnode_getoutputnormalizedgradient(self._handle, NormalizedGradientHandle)) + if NormalizedGradientHandle: + NormalizedGradientObject = self._wrapper._polymorphicFactory(NormalizedGradientHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return NormalizedGradientObject + + def GetOutputGradient(self): + GradientHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_functiongradientnode_getoutputgradient(self._handle, GradientHandle)) + if GradientHandle: + GradientObject = self._wrapper._polymorphicFactory(GradientHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return GradientObject + + def GetOutputMagnitude(self): + MagnitudeHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_functiongradientnode_getoutputmagnitude(self._handle, MagnitudeHandle)) + if MagnitudeHandle: + MagnitudeObject = self._wrapper._polymorphicFactory(MagnitudeHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return MagnitudeObject + + + +''' Class Implementation for NormalizeDistanceNode +''' +class NormalizeDistanceNode(ImplicitNode): + def __init__(self, handle, wrapper): + ImplicitNode.__init__(self, handle, wrapper) + def GetInputFunctionID(self): + FunctionHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_normalizedistancenode_getinputfunctionid(self._handle, FunctionHandle)) + if FunctionHandle: + FunctionObject = self._wrapper._polymorphicFactory(FunctionHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return FunctionObject + + def GetInputPos(self): + PosHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_normalizedistancenode_getinputpos(self._handle, PosHandle)) + if PosHandle: + PosObject = self._wrapper._polymorphicFactory(PosHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return PosObject + + def GetInputStep(self): + StepHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_normalizedistancenode_getinputstep(self._handle, StepHandle)) + if StepHandle: + StepObject = self._wrapper._polymorphicFactory(StepHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return StepObject + + def SetScalarOutputName(self, ScalarOutputName): + pScalarOutputName = ctypes.c_char_p(str.encode(ScalarOutputName)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_normalizedistancenode_setscalaroutputname(self._handle, pScalarOutputName)) + + + def GetScalarOutputName(self): + nScalarOutputNameBufferSize = ctypes.c_uint64(0) + nScalarOutputNameNeededChars = ctypes.c_uint64(0) + pScalarOutputNameBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_normalizedistancenode_getscalaroutputname(self._handle, nScalarOutputNameBufferSize, nScalarOutputNameNeededChars, pScalarOutputNameBuffer)) + nScalarOutputNameBufferSize = ctypes.c_uint64(nScalarOutputNameNeededChars.value) + pScalarOutputNameBuffer = (ctypes.c_char * (nScalarOutputNameNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_normalizedistancenode_getscalaroutputname(self._handle, nScalarOutputNameBufferSize, nScalarOutputNameNeededChars, pScalarOutputNameBuffer)) + + return pScalarOutputNameBuffer.value.decode() + + def SetVectorInputName(self, VectorInputName): + pVectorInputName = ctypes.c_char_p(str.encode(VectorInputName)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_normalizedistancenode_setvectorinputname(self._handle, pVectorInputName)) + + + def GetVectorInputName(self): + nVectorInputNameBufferSize = ctypes.c_uint64(0) + nVectorInputNameNeededChars = ctypes.c_uint64(0) + pVectorInputNameBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_normalizedistancenode_getvectorinputname(self._handle, nVectorInputNameBufferSize, nVectorInputNameNeededChars, pVectorInputNameBuffer)) + nVectorInputNameBufferSize = ctypes.c_uint64(nVectorInputNameNeededChars.value) + pVectorInputNameBuffer = (ctypes.c_char * (nVectorInputNameNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_normalizedistancenode_getvectorinputname(self._handle, nVectorInputNameBufferSize, nVectorInputNameNeededChars, pVectorInputNameBuffer)) + + return pVectorInputNameBuffer.value.decode() + + def GetOutputResult(self): + ResultHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_normalizedistancenode_getoutputresult(self._handle, ResultHandle)) + if ResultHandle: + ResultObject = self._wrapper._polymorphicFactory(ResultHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ResultObject + + + ''' Class Implementation for FunctionCallNode ''' class FunctionCallNode(ImplicitNode): @@ -11633,6 +12707,45 @@ def AddUnsignedMeshNode(self, Identifier, DisplayName, Tag): return NodeObject + def AddBeamLatticeNode(self, Identifier, DisplayName, Tag): + pIdentifier = ctypes.c_char_p(str.encode(Identifier)) + pDisplayName = ctypes.c_char_p(str.encode(DisplayName)) + pTag = ctypes.c_char_p(str.encode(Tag)) + NodeHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_implicitfunction_addbeamlatticenode(self._handle, pIdentifier, pDisplayName, pTag, NodeHandle)) + if NodeHandle: + NodeObject = self._wrapper._polymorphicFactory(NodeHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return NodeObject + + def AddFunctionGradientNode(self, Identifier, DisplayName, Tag): + pIdentifier = ctypes.c_char_p(str.encode(Identifier)) + pDisplayName = ctypes.c_char_p(str.encode(DisplayName)) + pTag = ctypes.c_char_p(str.encode(Tag)) + NodeHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_implicitfunction_addfunctiongradientnode(self._handle, pIdentifier, pDisplayName, pTag, NodeHandle)) + if NodeHandle: + NodeObject = self._wrapper._polymorphicFactory(NodeHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return NodeObject + + def AddNormalizeDistanceNode(self, Identifier, DisplayName, Tag): + pIdentifier = ctypes.c_char_p(str.encode(Identifier)) + pDisplayName = ctypes.c_char_p(str.encode(DisplayName)) + pTag = ctypes.c_char_p(str.encode(Tag)) + NodeHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_implicitfunction_addnormalizedistancenode(self._handle, pIdentifier, pDisplayName, pTag, NodeHandle)) + if NodeHandle: + NodeObject = self._wrapper._polymorphicFactory(NodeHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return NodeObject + def AddFunctionCallNode(self, Identifier, DisplayName, Tag): pIdentifier = ctypes.c_char_p(str.encode(Identifier)) pDisplayName = ctypes.c_char_p(str.encode(DisplayName)) @@ -11733,13 +12846,13 @@ def SetTileStyles(self, TileStyleU, TileStyleV, TileStyleW): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_functionfromimage3d_settilestyles(self._handle, TileStyleU, TileStyleV, TileStyleW)) - def GetTileStyles(self): - pTileStyleU = ctypes.c_int32() - pTileStyleV = ctypes.c_int32() - pTileStyleW = ctypes.c_int32() + def GetTileStyles(self, TileStyleU = None, TileStyleV = None, TileStyleW = None): + pTileStyleU = ctypes.c_int32(TileStyleU if TileStyleU else 0) + pTileStyleV = ctypes.c_int32(TileStyleV if TileStyleV else 0) + pTileStyleW = ctypes.c_int32(TileStyleW if TileStyleW else 0) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_functionfromimage3d_gettilestyles(self._handle, pTileStyleU, pTileStyleV, pTileStyleW)) - return TextureTileStyle(pTileStyleU.value), TextureTileStyle(pTileStyleV.value), TextureTileStyle(pTileStyleW.value) + return pTileStyleU.value, pTileStyleV.value, pTileStyleW.value def GetOffset(self): pOffset = ctypes.c_double() @@ -11780,8 +12893,8 @@ def GetObjectResource(self): return ObjectResourceObject - def GetUUID(self): - pHasUUID = ctypes.c_bool() + def GetUUID(self, HasUUID = None): + pHasUUID = ctypes.c_bool(HasUUID if HasUUID is not None else 0) nUUIDBufferSize = ctypes.c_uint64(0) nUUIDNeededChars = ctypes.c_uint64(0) pUUIDBuffer = ctypes.c_char_p(None) @@ -11909,16 +13022,16 @@ def SetVertices(self, Vertices): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_setvertices(self._handle, nVerticesCount, pVerticesBuffer)) - def GetVertices(self): - nVerticesCount = ctypes.c_uint64(0) + def GetVertices(self, Vertices = None): + nVerticesCount = ctypes.c_uint64(len(Vertices) if Vertices else 0) nVerticesNeededCount = ctypes.c_uint64(0) - pVerticesBuffer = (Position2D*0)() + pVerticesBuffer = (Position2D*(len(Vertices) if Vertices else 0))(*Vertices if Vertices else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getvertices(self._handle, nVerticesCount, nVerticesNeededCount, pVerticesBuffer)) nVerticesCount = ctypes.c_uint64(nVerticesNeededCount.value) pVerticesBuffer = (Position2D * nVerticesNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getvertices(self._handle, nVerticesCount, nVerticesNeededCount, pVerticesBuffer)) - return [pVerticesBuffer[i] for i in range(nVerticesNeededCount.value)] + return list(pVerticesBuffer) def GetVertexCount(self): pCount = ctypes.c_uint64() @@ -11947,17 +13060,17 @@ def SetPolygonIndices(self, Index, Indices): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_setpolygonindices(self._handle, nIndex, nIndicesCount, pIndicesBuffer)) - def GetPolygonIndices(self, Index): + def GetPolygonIndices(self, Index, Indices = None): nIndex = ctypes.c_uint64(Index) - nIndicesCount = ctypes.c_uint64(0) + nIndicesCount = ctypes.c_uint64(len(Indices) if Indices else 0) nIndicesNeededCount = ctypes.c_uint64(0) - pIndicesBuffer = (ctypes.c_uint32*0)() + pIndicesBuffer = (ctypes.c_uint32*(len(Indices) if Indices else 0))(*Indices if Indices else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getpolygonindices(self._handle, nIndex, nIndicesCount, nIndicesNeededCount, pIndicesBuffer)) nIndicesCount = ctypes.c_uint64(nIndicesNeededCount.value) pIndicesBuffer = (ctypes.c_uint32 * nIndicesNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getpolygonindices(self._handle, nIndex, nIndicesCount, nIndicesNeededCount, pIndicesBuffer)) - return [pIndicesBuffer[i] for i in range(nIndicesNeededCount.value)] + return list(pIndicesBuffer) def GetPolygonIndexCount(self, Index): nIndex = ctypes.c_uint64(Index) @@ -12147,38 +13260,38 @@ def GetEncryptionAlgorithm(self): return EncryptionAlgorithm(pAlgorithm.value) - def GetKey(self): - nByteDataCount = ctypes.c_uint64(0) + def GetKey(self, ByteData = None): + nByteDataCount = ctypes.c_uint64(len(ByteData) if ByteData else 0) nByteDataNeededCount = ctypes.c_uint64(0) - pByteDataBuffer = (ctypes.c_uint8*0)() + pByteDataBuffer = (ctypes.c_uint8*(len(ByteData) if ByteData else 0))(*ByteData if ByteData else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_contentencryptionparams_getkey(self._handle, nByteDataCount, nByteDataNeededCount, pByteDataBuffer)) nByteDataCount = ctypes.c_uint64(nByteDataNeededCount.value) pByteDataBuffer = (ctypes.c_uint8 * nByteDataNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_contentencryptionparams_getkey(self._handle, nByteDataCount, nByteDataNeededCount, pByteDataBuffer)) - return [pByteDataBuffer[i] for i in range(nByteDataNeededCount.value)] + return list(pByteDataBuffer) - def GetInitializationVector(self): - nByteDataCount = ctypes.c_uint64(0) + def GetInitializationVector(self, ByteData = None): + nByteDataCount = ctypes.c_uint64(len(ByteData) if ByteData else 0) nByteDataNeededCount = ctypes.c_uint64(0) - pByteDataBuffer = (ctypes.c_uint8*0)() + pByteDataBuffer = (ctypes.c_uint8*(len(ByteData) if ByteData else 0))(*ByteData if ByteData else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_contentencryptionparams_getinitializationvector(self._handle, nByteDataCount, nByteDataNeededCount, pByteDataBuffer)) nByteDataCount = ctypes.c_uint64(nByteDataNeededCount.value) pByteDataBuffer = (ctypes.c_uint8 * nByteDataNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_contentencryptionparams_getinitializationvector(self._handle, nByteDataCount, nByteDataNeededCount, pByteDataBuffer)) - return [pByteDataBuffer[i] for i in range(nByteDataNeededCount.value)] + return list(pByteDataBuffer) - def GetAuthenticationTag(self): - nByteDataCount = ctypes.c_uint64(0) + def GetAuthenticationTag(self, ByteData = None): + nByteDataCount = ctypes.c_uint64(len(ByteData) if ByteData else 0) nByteDataNeededCount = ctypes.c_uint64(0) - pByteDataBuffer = (ctypes.c_uint8*0)() + pByteDataBuffer = (ctypes.c_uint8*(len(ByteData) if ByteData else 0))(*ByteData if ByteData else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_contentencryptionparams_getauthenticationtag(self._handle, nByteDataCount, nByteDataNeededCount, pByteDataBuffer)) nByteDataCount = ctypes.c_uint64(nByteDataNeededCount.value) pByteDataBuffer = (ctypes.c_uint8 * nByteDataNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_contentencryptionparams_getauthenticationtag(self._handle, nByteDataCount, nByteDataNeededCount, pByteDataBuffer)) - return [pByteDataBuffer[i] for i in range(nByteDataNeededCount.value)] + return list(pByteDataBuffer) def SetAuthenticationTag(self, ByteData): nByteDataCount = ctypes.c_uint64(len(ByteData)) @@ -12186,16 +13299,16 @@ def SetAuthenticationTag(self, ByteData): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_contentencryptionparams_setauthenticationtag(self._handle, nByteDataCount, pByteDataBuffer)) - def GetAdditionalAuthenticationData(self): - nByteDataCount = ctypes.c_uint64(0) + def GetAdditionalAuthenticationData(self, ByteData = None): + nByteDataCount = ctypes.c_uint64(len(ByteData) if ByteData else 0) nByteDataNeededCount = ctypes.c_uint64(0) - pByteDataBuffer = (ctypes.c_uint8*0)() + pByteDataBuffer = (ctypes.c_uint8*(len(ByteData) if ByteData else 0))(*ByteData if ByteData else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_contentencryptionparams_getadditionalauthenticationdata(self._handle, nByteDataCount, nByteDataNeededCount, pByteDataBuffer)) nByteDataCount = ctypes.c_uint64(nByteDataNeededCount.value) pByteDataBuffer = (ctypes.c_uint8 * nByteDataNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_contentencryptionparams_getadditionalauthenticationdata(self._handle, nByteDataCount, nByteDataNeededCount, pByteDataBuffer)) - return [pByteDataBuffer[i] for i in range(nByteDataNeededCount.value)] + return list(pByteDataBuffer) def GetDescriptor(self): pDescriptor = ctypes.c_uint64() @@ -12243,16 +13356,16 @@ def GetCompression(self): return Compression(pCompression.value) - def GetAdditionalAuthenticationData(self): - nByteDataCount = ctypes.c_uint64(0) + def GetAdditionalAuthenticationData(self, ByteData = None): + nByteDataCount = ctypes.c_uint64(len(ByteData) if ByteData else 0) nByteDataNeededCount = ctypes.c_uint64(0) - pByteDataBuffer = (ctypes.c_uint8*0)() + pByteDataBuffer = (ctypes.c_uint8*(len(ByteData) if ByteData else 0))(*ByteData if ByteData else []) self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resourcedata_getadditionalauthenticationdata(self._handle, nByteDataCount, nByteDataNeededCount, pByteDataBuffer)) nByteDataCount = ctypes.c_uint64(nByteDataNeededCount.value) pByteDataBuffer = (ctypes.c_uint8 * nByteDataNeededCount.value)() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resourcedata_getadditionalauthenticationdata(self._handle, nByteDataCount, nByteDataNeededCount, pByteDataBuffer)) - return [pByteDataBuffer[i] for i in range(nByteDataNeededCount.value)] + return list(pByteDataBuffer) @@ -12482,8 +13595,8 @@ def GetResourceData(self, ResourceDataIndex): return ResourceDataObject - def GetUUID(self): - pHasUUID = ctypes.c_bool() + def GetUUID(self, HasUUID = None): + pHasUUID = ctypes.c_bool(HasUUID if HasUUID is not None else 0) nUUIDBufferSize = ctypes.c_uint64(0) nUUIDNeededChars = ctypes.c_uint64(0) pUUIDBuffer = ctypes.c_char_p(None) @@ -12670,6 +13783,17 @@ def GetComponentsObjectByID(self, UniqueResourceID): return ComponentsObjectInstanceObject + def GetBooleanObjectByID(self, UniqueResourceID): + nUniqueResourceID = ctypes.c_uint32(UniqueResourceID) + BooleanObjectInstanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_model_getbooleanobjectbyid(self._handle, nUniqueResourceID, BooleanObjectInstanceHandle)) + if BooleanObjectInstanceHandle: + BooleanObjectInstanceObject = self._wrapper._polymorphicFactory(BooleanObjectInstanceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return BooleanObjectInstanceObject + def GetColorGroupByID(self, UniqueResourceID): nUniqueResourceID = ctypes.c_uint32(UniqueResourceID) ColorGroupInstanceHandle = ctypes.c_void_p() @@ -12703,8 +13827,8 @@ def GetLevelSetByID(self, UniqueResourceID): return LevelSetObjectInstanceObject - def GetBuildUUID(self): - pHasUUID = ctypes.c_bool() + def GetBuildUUID(self, HasUUID = None): + pHasUUID = ctypes.c_bool(HasUUID if HasUUID is not None else 0) nUUIDBufferSize = ctypes.c_uint64(0) nUUIDNeededChars = ctypes.c_uint64(0) pUUIDBuffer = ctypes.c_char_p(None) @@ -12776,6 +13900,16 @@ def GetComponentsObjects(self): return ResourceIteratorObject + def GetBooleanObjects(self): + ResourceIteratorHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_model_getbooleanobjects(self._handle, ResourceIteratorHandle)) + if ResourceIteratorHandle: + ResourceIteratorObject = self._wrapper._polymorphicFactory(ResourceIteratorHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ResourceIteratorObject + def GetTexture2Ds(self): ResourceIteratorHandle = ctypes.c_void_p() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_model_gettexture2ds(self._handle, ResourceIteratorHandle)) @@ -12895,6 +14029,16 @@ def AddComponentsObject(self): return ComponentsObjectInstanceObject + def AddBooleanObject(self): + BooleanObjectInstanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_model_addbooleanobject(self._handle, BooleanObjectInstanceHandle)) + if BooleanObjectInstanceHandle: + BooleanObjectInstanceObject = self._wrapper._polymorphicFactory(BooleanObjectInstanceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return BooleanObjectInstanceObject + def AddSliceStack(self, ZBottom): dZBottom = ctypes.c_double(ZBottom) SliceStackInstanceHandle = ctypes.c_void_p() diff --git a/Autogenerated/Bindings/WASM/lib3mf_bindings.cpp b/Autogenerated/Bindings/WASM/lib3mf_bindings.cpp new file mode 100644 index 000000000..2b938474d --- /dev/null +++ b/Autogenerated/Bindings/WASM/lib3mf_bindings.cpp @@ -0,0 +1,2801 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. + +Abstract: C++ Emscripten wrapper for WebAssembly + +Interface version: 2.6.0 + +*/ + +#include +#include +#include +#include +#include +#include "Cpp/lib3mf_implicit.hpp" + +using namespace emscripten; +using namespace Lib3MF; + +struct sTriangleWrapper { + sTriangle value; + Lib3MF_uint32 get_Indices0() const { return value.m_Indices[0]; } + void set_Indices0(Lib3MF_uint32 v) { value.m_Indices[0] = v; } + Lib3MF_uint32 get_Indices1() const { return value.m_Indices[1]; } + void set_Indices1(Lib3MF_uint32 v) { value.m_Indices[1] = v; } + Lib3MF_uint32 get_Indices2() const { return value.m_Indices[2]; } + void set_Indices2(Lib3MF_uint32 v) { value.m_Indices[2] = v; } + + sTriangle toStruct() const { return value; } + + static sTriangleWrapper fromStruct(const emscripten::val &js) { + sTriangleWrapper wrapper; + wrapper.value.m_Indices[0] = js["Indices0"].as(); + wrapper.value.m_Indices[1] = js["Indices1"].as(); + wrapper.value.m_Indices[2] = js["Indices2"].as(); + return wrapper; + } +}; + +struct sTrianglePropertiesWrapper { + sTriangleProperties value; + Lib3MF_uint32 get_ResourceID() const { return value.m_ResourceID; } + void set_ResourceID(Lib3MF_uint32 v) { value.m_ResourceID = v; } + Lib3MF_uint32 get_PropertyIDs0() const { return value.m_PropertyIDs[0]; } + void set_PropertyIDs0(Lib3MF_uint32 v) { value.m_PropertyIDs[0] = v; } + Lib3MF_uint32 get_PropertyIDs1() const { return value.m_PropertyIDs[1]; } + void set_PropertyIDs1(Lib3MF_uint32 v) { value.m_PropertyIDs[1] = v; } + Lib3MF_uint32 get_PropertyIDs2() const { return value.m_PropertyIDs[2]; } + void set_PropertyIDs2(Lib3MF_uint32 v) { value.m_PropertyIDs[2] = v; } + + sTriangleProperties toStruct() const { return value; } + + static sTrianglePropertiesWrapper fromStruct(const emscripten::val &js) { + sTrianglePropertiesWrapper wrapper; + wrapper.value.m_ResourceID = js["ResourceID"].as(); + wrapper.value.m_PropertyIDs[0] = js["PropertyIDs0"].as(); + wrapper.value.m_PropertyIDs[1] = js["PropertyIDs1"].as(); + wrapper.value.m_PropertyIDs[2] = js["PropertyIDs2"].as(); + return wrapper; + } +}; + +struct sPositionWrapper { + sPosition value; + Lib3MF_single get_Coordinates0() const { return value.m_Coordinates[0]; } + void set_Coordinates0(Lib3MF_single v) { value.m_Coordinates[0] = v; } + Lib3MF_single get_Coordinates1() const { return value.m_Coordinates[1]; } + void set_Coordinates1(Lib3MF_single v) { value.m_Coordinates[1] = v; } + Lib3MF_single get_Coordinates2() const { return value.m_Coordinates[2]; } + void set_Coordinates2(Lib3MF_single v) { value.m_Coordinates[2] = v; } + + sPosition toStruct() const { return value; } + + static sPositionWrapper fromStruct(const emscripten::val &js) { + sPositionWrapper wrapper; + wrapper.value.m_Coordinates[0] = js["Coordinates0"].as(); + wrapper.value.m_Coordinates[1] = js["Coordinates1"].as(); + wrapper.value.m_Coordinates[2] = js["Coordinates2"].as(); + return wrapper; + } +}; + +struct sPosition2DWrapper { + sPosition2D value; + Lib3MF_single get_Coordinates0() const { return value.m_Coordinates[0]; } + void set_Coordinates0(Lib3MF_single v) { value.m_Coordinates[0] = v; } + Lib3MF_single get_Coordinates1() const { return value.m_Coordinates[1]; } + void set_Coordinates1(Lib3MF_single v) { value.m_Coordinates[1] = v; } + + sPosition2D toStruct() const { return value; } + + static sPosition2DWrapper fromStruct(const emscripten::val &js) { + sPosition2DWrapper wrapper; + wrapper.value.m_Coordinates[0] = js["Coordinates0"].as(); + wrapper.value.m_Coordinates[1] = js["Coordinates1"].as(); + return wrapper; + } +}; + +struct sCompositeConstituentWrapper { + sCompositeConstituent value; + Lib3MF_uint32 get_PropertyID() const { return value.m_PropertyID; } + void set_PropertyID(Lib3MF_uint32 v) { value.m_PropertyID = v; } + Lib3MF_double get_MixingRatio() const { return value.m_MixingRatio; } + void set_MixingRatio(Lib3MF_double v) { value.m_MixingRatio = v; } + + sCompositeConstituent toStruct() const { return value; } + + static sCompositeConstituentWrapper fromStruct(const emscripten::val &js) { + sCompositeConstituentWrapper wrapper; + wrapper.value.m_PropertyID = js["PropertyID"].as(); + wrapper.value.m_MixingRatio = js["MixingRatio"].as(); + return wrapper; + } +}; + +struct sMultiPropertyLayerWrapper { + sMultiPropertyLayer value; + Lib3MF_uint32 get_ResourceID() const { return value.m_ResourceID; } + void set_ResourceID(Lib3MF_uint32 v) { value.m_ResourceID = v; } + eBlendMethod get_TheBlendMethod() const { return value.m_TheBlendMethod; } + void set_TheBlendMethod(eBlendMethod v) { value.m_TheBlendMethod = v; } + + sMultiPropertyLayer toStruct() const { return value; } + + static sMultiPropertyLayerWrapper fromStruct(const emscripten::val &js) { + sMultiPropertyLayerWrapper wrapper; + wrapper.value.m_ResourceID = js["ResourceID"].as(); + wrapper.value.m_TheBlendMethod = js["TheBlendMethod"].as(); + return wrapper; + } +}; + +struct sTex2CoordWrapper { + sTex2Coord value; + Lib3MF_double get_U() const { return value.m_U; } + void set_U(Lib3MF_double v) { value.m_U = v; } + Lib3MF_double get_V() const { return value.m_V; } + void set_V(Lib3MF_double v) { value.m_V = v; } + + sTex2Coord toStruct() const { return value; } + + static sTex2CoordWrapper fromStruct(const emscripten::val &js) { + sTex2CoordWrapper wrapper; + wrapper.value.m_U = js["U"].as(); + wrapper.value.m_V = js["V"].as(); + return wrapper; + } +}; + +struct sTransformWrapper { + sTransform value; + Lib3MF_single get_Fields_0_0() const { return value.m_Fields[0][0]; } + void set_Fields_0_0(Lib3MF_single v) { value.m_Fields[0][0] = v; } + Lib3MF_single get_Fields_0_1() const { return value.m_Fields[0][1]; } + void set_Fields_0_1(Lib3MF_single v) { value.m_Fields[0][1] = v; } + Lib3MF_single get_Fields_0_2() const { return value.m_Fields[0][2]; } + void set_Fields_0_2(Lib3MF_single v) { value.m_Fields[0][2] = v; } + Lib3MF_single get_Fields_1_0() const { return value.m_Fields[1][0]; } + void set_Fields_1_0(Lib3MF_single v) { value.m_Fields[1][0] = v; } + Lib3MF_single get_Fields_1_1() const { return value.m_Fields[1][1]; } + void set_Fields_1_1(Lib3MF_single v) { value.m_Fields[1][1] = v; } + Lib3MF_single get_Fields_1_2() const { return value.m_Fields[1][2]; } + void set_Fields_1_2(Lib3MF_single v) { value.m_Fields[1][2] = v; } + Lib3MF_single get_Fields_2_0() const { return value.m_Fields[2][0]; } + void set_Fields_2_0(Lib3MF_single v) { value.m_Fields[2][0] = v; } + Lib3MF_single get_Fields_2_1() const { return value.m_Fields[2][1]; } + void set_Fields_2_1(Lib3MF_single v) { value.m_Fields[2][1] = v; } + Lib3MF_single get_Fields_2_2() const { return value.m_Fields[2][2]; } + void set_Fields_2_2(Lib3MF_single v) { value.m_Fields[2][2] = v; } + Lib3MF_single get_Fields_3_0() const { return value.m_Fields[3][0]; } + void set_Fields_3_0(Lib3MF_single v) { value.m_Fields[3][0] = v; } + Lib3MF_single get_Fields_3_1() const { return value.m_Fields[3][1]; } + void set_Fields_3_1(Lib3MF_single v) { value.m_Fields[3][1] = v; } + Lib3MF_single get_Fields_3_2() const { return value.m_Fields[3][2]; } + void set_Fields_3_2(Lib3MF_single v) { value.m_Fields[3][2] = v; } + + sTransform toStruct() const { return value; } + + static sTransformWrapper fromStruct(const emscripten::val &js) { + sTransformWrapper wrapper; + wrapper.value.m_Fields[0][0] = js["Fields_0_0"].as(); + wrapper.value.m_Fields[1][0] = js["Fields_1_0"].as(); + wrapper.value.m_Fields[2][0] = js["Fields_2_0"].as(); + wrapper.value.m_Fields[3][0] = js["Fields_3_0"].as(); + wrapper.value.m_Fields[0][1] = js["Fields_0_1"].as(); + wrapper.value.m_Fields[1][1] = js["Fields_1_1"].as(); + wrapper.value.m_Fields[2][1] = js["Fields_2_1"].as(); + wrapper.value.m_Fields[3][1] = js["Fields_3_1"].as(); + wrapper.value.m_Fields[0][2] = js["Fields_0_2"].as(); + wrapper.value.m_Fields[1][2] = js["Fields_1_2"].as(); + wrapper.value.m_Fields[2][2] = js["Fields_2_2"].as(); + wrapper.value.m_Fields[3][2] = js["Fields_3_2"].as(); + return wrapper; + } +}; + +struct sBoxWrapper { + sBox value; + Lib3MF_single get_MinCoordinate0() const { return value.m_MinCoordinate[0]; } + void set_MinCoordinate0(Lib3MF_single v) { value.m_MinCoordinate[0] = v; } + Lib3MF_single get_MinCoordinate1() const { return value.m_MinCoordinate[1]; } + void set_MinCoordinate1(Lib3MF_single v) { value.m_MinCoordinate[1] = v; } + Lib3MF_single get_MinCoordinate2() const { return value.m_MinCoordinate[2]; } + void set_MinCoordinate2(Lib3MF_single v) { value.m_MinCoordinate[2] = v; } + Lib3MF_single get_MaxCoordinate0() const { return value.m_MaxCoordinate[0]; } + void set_MaxCoordinate0(Lib3MF_single v) { value.m_MaxCoordinate[0] = v; } + Lib3MF_single get_MaxCoordinate1() const { return value.m_MaxCoordinate[1]; } + void set_MaxCoordinate1(Lib3MF_single v) { value.m_MaxCoordinate[1] = v; } + Lib3MF_single get_MaxCoordinate2() const { return value.m_MaxCoordinate[2]; } + void set_MaxCoordinate2(Lib3MF_single v) { value.m_MaxCoordinate[2] = v; } + + sBox toStruct() const { return value; } + + static sBoxWrapper fromStruct(const emscripten::val &js) { + sBoxWrapper wrapper; + wrapper.value.m_MinCoordinate[0] = js["MinCoordinate0"].as(); + wrapper.value.m_MinCoordinate[1] = js["MinCoordinate1"].as(); + wrapper.value.m_MinCoordinate[2] = js["MinCoordinate2"].as(); + wrapper.value.m_MaxCoordinate[0] = js["MaxCoordinate0"].as(); + wrapper.value.m_MaxCoordinate[1] = js["MaxCoordinate1"].as(); + wrapper.value.m_MaxCoordinate[2] = js["MaxCoordinate2"].as(); + return wrapper; + } +}; + +struct sColorWrapper { + sColor value; + Lib3MF_uint8 get_Red() const { return value.m_Red; } + void set_Red(Lib3MF_uint8 v) { value.m_Red = v; } + Lib3MF_uint8 get_Green() const { return value.m_Green; } + void set_Green(Lib3MF_uint8 v) { value.m_Green = v; } + Lib3MF_uint8 get_Blue() const { return value.m_Blue; } + void set_Blue(Lib3MF_uint8 v) { value.m_Blue = v; } + Lib3MF_uint8 get_Alpha() const { return value.m_Alpha; } + void set_Alpha(Lib3MF_uint8 v) { value.m_Alpha = v; } + + sColor toStruct() const { return value; } + + static sColorWrapper fromStruct(const emscripten::val &js) { + sColorWrapper wrapper; + wrapper.value.m_Red = js["Red"].as(); + wrapper.value.m_Green = js["Green"].as(); + wrapper.value.m_Blue = js["Blue"].as(); + wrapper.value.m_Alpha = js["Alpha"].as(); + return wrapper; + } +}; + +struct sBeamWrapper { + sBeam value; + Lib3MF_uint32 get_Indices0() const { return value.m_Indices[0]; } + void set_Indices0(Lib3MF_uint32 v) { value.m_Indices[0] = v; } + Lib3MF_uint32 get_Indices1() const { return value.m_Indices[1]; } + void set_Indices1(Lib3MF_uint32 v) { value.m_Indices[1] = v; } + Lib3MF_double get_Radii0() const { return value.m_Radii[0]; } + void set_Radii0(Lib3MF_double v) { value.m_Radii[0] = v; } + Lib3MF_double get_Radii1() const { return value.m_Radii[1]; } + void set_Radii1(Lib3MF_double v) { value.m_Radii[1] = v; } + eBeamLatticeCapMode get_CapModes0() const { return value.m_CapModes[0]; } + void set_CapModes0(eBeamLatticeCapMode v) { value.m_CapModes[0] = v; } + eBeamLatticeCapMode get_CapModes1() const { return value.m_CapModes[1]; } + void set_CapModes1(eBeamLatticeCapMode v) { value.m_CapModes[1] = v; } + + sBeam toStruct() const { return value; } + + static sBeamWrapper fromStruct(const emscripten::val &js) { + sBeamWrapper wrapper; + wrapper.value.m_Indices[0] = js["Indices0"].as(); + wrapper.value.m_Indices[1] = js["Indices1"].as(); + wrapper.value.m_Radii[0] = js["Radii0"].as(); + wrapper.value.m_Radii[1] = js["Radii1"].as(); + wrapper.value.m_CapModes[0] = js["CapModes0"].as(); + wrapper.value.m_CapModes[1] = js["CapModes1"].as(); + return wrapper; + } +}; + +struct sBallWrapper { + sBall value; + Lib3MF_uint32 get_Index() const { return value.m_Index; } + void set_Index(Lib3MF_uint32 v) { value.m_Index = v; } + Lib3MF_double get_Radius() const { return value.m_Radius; } + void set_Radius(Lib3MF_double v) { value.m_Radius = v; } + + sBall toStruct() const { return value; } + + static sBallWrapper fromStruct(const emscripten::val &js) { + sBallWrapper wrapper; + wrapper.value.m_Index = js["Index"].as(); + wrapper.value.m_Radius = js["Radius"].as(); + return wrapper; + } +}; + +struct sVectorWrapper { + sVector value; + Lib3MF_double get_Coordinates0() const { return value.m_Coordinates[0]; } + void set_Coordinates0(Lib3MF_double v) { value.m_Coordinates[0] = v; } + Lib3MF_double get_Coordinates1() const { return value.m_Coordinates[1]; } + void set_Coordinates1(Lib3MF_double v) { value.m_Coordinates[1] = v; } + Lib3MF_double get_Coordinates2() const { return value.m_Coordinates[2]; } + void set_Coordinates2(Lib3MF_double v) { value.m_Coordinates[2] = v; } + + sVector toStruct() const { return value; } + + static sVectorWrapper fromStruct(const emscripten::val &js) { + sVectorWrapper wrapper; + wrapper.value.m_Coordinates[0] = js["Coordinates0"].as(); + wrapper.value.m_Coordinates[1] = js["Coordinates1"].as(); + wrapper.value.m_Coordinates[2] = js["Coordinates2"].as(); + return wrapper; + } +}; + +struct sMatrix4x4Wrapper { + sMatrix4x4 value; + Lib3MF_double get_Field_0_0() const { return value.m_Field[0][0]; } + void set_Field_0_0(Lib3MF_double v) { value.m_Field[0][0] = v; } + Lib3MF_double get_Field_0_1() const { return value.m_Field[0][1]; } + void set_Field_0_1(Lib3MF_double v) { value.m_Field[0][1] = v; } + Lib3MF_double get_Field_0_2() const { return value.m_Field[0][2]; } + void set_Field_0_2(Lib3MF_double v) { value.m_Field[0][2] = v; } + Lib3MF_double get_Field_0_3() const { return value.m_Field[0][3]; } + void set_Field_0_3(Lib3MF_double v) { value.m_Field[0][3] = v; } + Lib3MF_double get_Field_1_0() const { return value.m_Field[1][0]; } + void set_Field_1_0(Lib3MF_double v) { value.m_Field[1][0] = v; } + Lib3MF_double get_Field_1_1() const { return value.m_Field[1][1]; } + void set_Field_1_1(Lib3MF_double v) { value.m_Field[1][1] = v; } + Lib3MF_double get_Field_1_2() const { return value.m_Field[1][2]; } + void set_Field_1_2(Lib3MF_double v) { value.m_Field[1][2] = v; } + Lib3MF_double get_Field_1_3() const { return value.m_Field[1][3]; } + void set_Field_1_3(Lib3MF_double v) { value.m_Field[1][3] = v; } + Lib3MF_double get_Field_2_0() const { return value.m_Field[2][0]; } + void set_Field_2_0(Lib3MF_double v) { value.m_Field[2][0] = v; } + Lib3MF_double get_Field_2_1() const { return value.m_Field[2][1]; } + void set_Field_2_1(Lib3MF_double v) { value.m_Field[2][1] = v; } + Lib3MF_double get_Field_2_2() const { return value.m_Field[2][2]; } + void set_Field_2_2(Lib3MF_double v) { value.m_Field[2][2] = v; } + Lib3MF_double get_Field_2_3() const { return value.m_Field[2][3]; } + void set_Field_2_3(Lib3MF_double v) { value.m_Field[2][3] = v; } + Lib3MF_double get_Field_3_0() const { return value.m_Field[3][0]; } + void set_Field_3_0(Lib3MF_double v) { value.m_Field[3][0] = v; } + Lib3MF_double get_Field_3_1() const { return value.m_Field[3][1]; } + void set_Field_3_1(Lib3MF_double v) { value.m_Field[3][1] = v; } + Lib3MF_double get_Field_3_2() const { return value.m_Field[3][2]; } + void set_Field_3_2(Lib3MF_double v) { value.m_Field[3][2] = v; } + Lib3MF_double get_Field_3_3() const { return value.m_Field[3][3]; } + void set_Field_3_3(Lib3MF_double v) { value.m_Field[3][3] = v; } + + sMatrix4x4 toStruct() const { return value; } + + static sMatrix4x4Wrapper fromStruct(const emscripten::val &js) { + sMatrix4x4Wrapper wrapper; + wrapper.value.m_Field[0][0] = js["Field_0_0"].as(); + wrapper.value.m_Field[1][0] = js["Field_1_0"].as(); + wrapper.value.m_Field[2][0] = js["Field_2_0"].as(); + wrapper.value.m_Field[3][0] = js["Field_3_0"].as(); + wrapper.value.m_Field[0][1] = js["Field_0_1"].as(); + wrapper.value.m_Field[1][1] = js["Field_1_1"].as(); + wrapper.value.m_Field[2][1] = js["Field_2_1"].as(); + wrapper.value.m_Field[3][1] = js["Field_3_1"].as(); + wrapper.value.m_Field[0][2] = js["Field_0_2"].as(); + wrapper.value.m_Field[1][2] = js["Field_1_2"].as(); + wrapper.value.m_Field[2][2] = js["Field_2_2"].as(); + wrapper.value.m_Field[3][2] = js["Field_3_2"].as(); + wrapper.value.m_Field[0][3] = js["Field_0_3"].as(); + wrapper.value.m_Field[1][3] = js["Field_1_3"].as(); + wrapper.value.m_Field[2][3] = js["Field_2_3"].as(); + wrapper.value.m_Field[3][3] = js["Field_3_3"].as(); + return wrapper; + } +}; + +static void wrap_Resource_SetPackagePart(CResource &self, PPackagePart& PackagePart) { + self.SetPackagePart(classParam(PackagePart)); +} + +static void wrap_MetaDataGroup_RemoveMetaData(CMetaDataGroup &self, PMetaData& TheMetaData) { + self.RemoveMetaData(classParam(TheMetaData)); +} + +static void wrap_TriangleSet_Merge(CTriangleSet &self, PTriangleSet& OtherTriangleSet, const bool& DeleteOther) { + self.Merge(classParam(OtherTriangleSet), DeleteOther); +} + +static void wrap_Object_SetAttachmentAsThumbnail(CObject &self, PAttachment& Attachment) { + self.SetAttachmentAsThumbnail(classParam(Attachment)); +} + +static sBoxWrapper wrap_Object_GetOutbox(CObject &self) { + auto result = self.GetOutbox(); + sBoxWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static void wrap_Object_AssignSliceStack(CObject &self, PSliceStack& SliceStackInstance) { + self.AssignSliceStack(classParam(SliceStackInstance)); +} + +static sPositionWrapper wrap_MeshObject_GetVertex(CMeshObject &self, const Lib3MF_uint32& Index) { + auto result = self.GetVertex(Index); + sPositionWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static void wrap_MeshObject_SetVertex(CMeshObject &self, const Lib3MF_uint32& Index, const sPositionWrapper& Coordinates) { + self.SetVertex(Index, Coordinates.toStruct()); +} + +static Lib3MF_uint32 wrap_MeshObject_AddVertex(CMeshObject &self, const sPositionWrapper& Coordinates) { + auto result = self.AddVertex(Coordinates.toStruct()); + return result; +} + +static sTriangleWrapper wrap_MeshObject_GetTriangle(CMeshObject &self, const Lib3MF_uint32& Index) { + auto result = self.GetTriangle(Index); + sTriangleWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static void wrap_MeshObject_SetTriangle(CMeshObject &self, const Lib3MF_uint32& Index, const sTriangleWrapper& Indices) { + self.SetTriangle(Index, Indices.toStruct()); +} + +static Lib3MF_uint32 wrap_MeshObject_AddTriangle(CMeshObject &self, const sTriangleWrapper& Indices) { + auto result = self.AddTriangle(Indices.toStruct()); + return result; +} + +static void wrap_MeshObject_SetTriangleProperties(CMeshObject &self, const Lib3MF_uint32& Index, const sTrianglePropertiesWrapper& Properties) { + self.SetTriangleProperties(Index, Properties.toStruct()); +} + +static void wrap_MeshObject_SetAllTriangleProperties(CMeshObject &self, const std::vector& PropertiesArray) { + std::vector converted_PropertiesArray; + converted_PropertiesArray.reserve(PropertiesArray.size()); + for (const auto& w : PropertiesArray) converted_PropertiesArray.push_back(w.toStruct()); + self.SetAllTriangleProperties(converted_PropertiesArray); +} + +static void wrap_MeshObject_SetGeometry(CMeshObject &self, const std::vector& Vertices, const std::vector& Indices) { + std::vector converted_Vertices; + converted_Vertices.reserve(Vertices.size()); + for (const auto& w : Vertices) converted_Vertices.push_back(w.toStruct()); + std::vector converted_Indices; + converted_Indices.reserve(Indices.size()); + for (const auto& w : Indices) converted_Indices.push_back(w.toStruct()); + self.SetGeometry(converted_Vertices, converted_Indices); +} + +static void wrap_MeshObject_SetVolumeData(CMeshObject &self, PVolumeData& TheVolumeData) { + self.SetVolumeData(classParam(TheVolumeData)); +} + +static void wrap_LevelSet_SetFunction(CLevelSet &self, PFunction& TheFunction) { + self.SetFunction(classParam(TheFunction)); +} + +static sTransformWrapper wrap_LevelSet_GetTransform(CLevelSet &self) { + auto result = self.GetTransform(); + sTransformWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static void wrap_LevelSet_SetTransform(CLevelSet &self, const sTransformWrapper& Transform) { + self.SetTransform(Transform.toStruct()); +} + +static void wrap_LevelSet_SetMesh(CLevelSet &self, PMeshObject& TheMesh) { + self.SetMesh(classParam(TheMesh)); +} + +static void wrap_LevelSet_SetVolumeData(CLevelSet &self, PVolumeData& TheVolumeData) { + self.SetVolumeData(classParam(TheVolumeData)); +} + +static void wrap_BooleanObject_SetBaseObject(CBooleanObject &self, PObject& BaseObject, const sTransformWrapper& Transform) { + self.SetBaseObject(classParam(BaseObject), Transform.toStruct()); +} + +static void wrap_BooleanObject_SetBaseTransform(CBooleanObject &self, const sTransformWrapper& Transform) { + self.SetBaseTransform(Transform.toStruct()); +} + +static sTransformWrapper wrap_BooleanObject_GetBaseTransform(CBooleanObject &self) { + auto result = self.GetBaseTransform(); + sTransformWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static void wrap_BooleanObject_AddOperand(CBooleanObject &self, PMeshObject& OperandObject, const sTransformWrapper& Transform) { + self.AddOperand(classParam(OperandObject), Transform.toStruct()); +} + +static sBeamWrapper wrap_BeamLattice_GetBeam(CBeamLattice &self, const Lib3MF_uint32& Index) { + auto result = self.GetBeam(Index); + sBeamWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static Lib3MF_uint32 wrap_BeamLattice_AddBeam(CBeamLattice &self, const sBeamWrapper& BeamInfo) { + auto result = self.AddBeam(BeamInfo.toStruct()); + return result; +} + +static void wrap_BeamLattice_SetBeam(CBeamLattice &self, const Lib3MF_uint32& Index, const sBeamWrapper& BeamInfo) { + self.SetBeam(Index, BeamInfo.toStruct()); +} + +static void wrap_BeamLattice_SetBeams(CBeamLattice &self, const std::vector& BeamInfo) { + std::vector converted_BeamInfo; + converted_BeamInfo.reserve(BeamInfo.size()); + for (const auto& w : BeamInfo) converted_BeamInfo.push_back(w.toStruct()); + self.SetBeams(converted_BeamInfo); +} + +static sBallWrapper wrap_BeamLattice_GetBall(CBeamLattice &self, const Lib3MF_uint32& Index) { + auto result = self.GetBall(Index); + sBallWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static Lib3MF_uint32 wrap_BeamLattice_AddBall(CBeamLattice &self, const sBallWrapper& BallInfo) { + auto result = self.AddBall(BallInfo.toStruct()); + return result; +} + +static void wrap_BeamLattice_SetBall(CBeamLattice &self, const Lib3MF_uint32& Index, const sBallWrapper& BallInfo) { + self.SetBall(Index, BallInfo.toStruct()); +} + +static void wrap_BeamLattice_SetBalls(CBeamLattice &self, const std::vector& BallInfo) { + std::vector converted_BallInfo; + converted_BallInfo.reserve(BallInfo.size()); + for (const auto& w : BallInfo) converted_BallInfo.push_back(w.toStruct()); + self.SetBalls(converted_BallInfo); +} + +static sTransformWrapper wrap_FunctionReference_GetTransform(CFunctionReference &self) { + auto result = self.GetTransform(); + sTransformWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static void wrap_FunctionReference_SetTransform(CFunctionReference &self, const sTransformWrapper& Transform) { + self.SetTransform(Transform.toStruct()); +} + +static void wrap_VolumeDataComposite_SetBaseMaterialGroup(CVolumeDataComposite &self, PBaseMaterialGroup& BaseMaterialGroupInstance) { + self.SetBaseMaterialGroup(classParam(BaseMaterialGroupInstance)); +} + +static PMaterialMapping wrap_VolumeDataComposite_AddMaterialMapping(CVolumeDataComposite &self, const sTransformWrapper& Transform) { + auto result = self.AddMaterialMapping(Transform.toStruct()); + return result; +} + +static PVolumeDataColor wrap_VolumeData_CreateNewColor(CVolumeData &self, PFunction& TheFunction) { + auto result = self.CreateNewColor(classParam(TheFunction)); + return result; +} + +static PVolumeDataProperty wrap_VolumeData_AddPropertyFromFunction(CVolumeData &self, const std::string& Name, PFunction& TheFunction) { + auto result = self.AddPropertyFromFunction(Name, classParam(TheFunction)); + return result; +} + +static sTransformWrapper wrap_Component_GetTransform(CComponent &self) { + auto result = self.GetTransform(); + sTransformWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static void wrap_Component_SetTransform(CComponent &self, const sTransformWrapper& Transform) { + self.SetTransform(Transform.toStruct()); +} + +static PComponent wrap_ComponentsObject_AddComponent(CComponentsObject &self, PObject& ObjectResource, const sTransformWrapper& Transform) { + auto result = self.AddComponent(classParam(ObjectResource), Transform.toStruct()); + return result; +} + +static Lib3MF_uint32 wrap_BaseMaterialGroup_AddMaterial(CBaseMaterialGroup &self, const std::string& Name, const sColorWrapper& DisplayColor) { + auto result = self.AddMaterial(Name, DisplayColor.toStruct()); + return result; +} + +static void wrap_BaseMaterialGroup_SetDisplayColor(CBaseMaterialGroup &self, const Lib3MF_uint32& PropertyID, const sColorWrapper& TheColor) { + self.SetDisplayColor(PropertyID, TheColor.toStruct()); +} + +static sColorWrapper wrap_BaseMaterialGroup_GetDisplayColor(CBaseMaterialGroup &self, const Lib3MF_uint32& PropertyID) { + auto result = self.GetDisplayColor(PropertyID); + sColorWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static Lib3MF_uint32 wrap_ColorGroup_AddColor(CColorGroup &self, const sColorWrapper& TheColor) { + auto result = self.AddColor(TheColor.toStruct()); + return result; +} + +static void wrap_ColorGroup_SetColor(CColorGroup &self, const Lib3MF_uint32& PropertyID, const sColorWrapper& TheColor) { + self.SetColor(PropertyID, TheColor.toStruct()); +} + +static sColorWrapper wrap_ColorGroup_GetColor(CColorGroup &self, const Lib3MF_uint32& PropertyID) { + auto result = self.GetColor(PropertyID); + sColorWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static Lib3MF_uint32 wrap_Texture2DGroup_AddTex2Coord(CTexture2DGroup &self, const sTex2CoordWrapper& UVCoordinate) { + auto result = self.AddTex2Coord(UVCoordinate.toStruct()); + return result; +} + +static sTex2CoordWrapper wrap_Texture2DGroup_GetTex2Coord(CTexture2DGroup &self, const Lib3MF_uint32& PropertyID) { + auto result = self.GetTex2Coord(PropertyID); + sTex2CoordWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static Lib3MF_uint32 wrap_CompositeMaterials_AddComposite(CCompositeMaterials &self, const std::vector& Composite) { + std::vector converted_Composite; + converted_Composite.reserve(Composite.size()); + for (const auto& w : Composite) converted_Composite.push_back(w.toStruct()); + auto result = self.AddComposite(converted_Composite); + return result; +} + +static Lib3MF_uint32 wrap_MultiPropertyGroup_AddLayer(CMultiPropertyGroup &self, const sMultiPropertyLayerWrapper& TheLayer) { + auto result = self.AddLayer(TheLayer.toStruct()); + return result; +} + +static sMultiPropertyLayerWrapper wrap_MultiPropertyGroup_GetLayer(CMultiPropertyGroup &self, const Lib3MF_uint32& LayerIndex) { + auto result = self.GetLayer(LayerIndex); + sMultiPropertyLayerWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static void wrap_ImageStack_SetSheet(CImageStack &self, const Lib3MF_uint32& Index, PAttachment& Sheet) { + self.SetSheet(Index, classParam(Sheet)); +} + +static void wrap_Texture2D_SetAttachment(CTexture2D &self, PAttachment& Attachment) { + self.SetAttachment(classParam(Attachment)); +} + +static void wrap_ResourceIdNode_SetResource(CResourceIdNode &self, PResource& Resource) { + self.SetResource(classParam(Resource)); +} + +static void wrap_ConstVecNode_SetVector(CConstVecNode &self, const sVectorWrapper& Value) { + self.SetVector(Value.toStruct()); +} + +static sVectorWrapper wrap_ConstVecNode_GetVector(CConstVecNode &self) { + auto result = self.GetVector(); + sVectorWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static void wrap_ConstMatNode_SetMatrix(CConstMatNode &self, const sMatrix4x4Wrapper& Value) { + self.SetMatrix(Value.toStruct()); +} + +static sMatrix4x4Wrapper wrap_ConstMatNode_GetMatrix(CConstMatNode &self) { + auto result = self.GetMatrix(); + sMatrix4x4Wrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static void wrap_Function_RemoveInput(CFunction &self, PImplicitPort& Input) { + self.RemoveInput(classParam(Input)); +} + +static void wrap_Function_RemoveOutput(CFunction &self, PImplicitPort& Output) { + self.RemoveOutput(classParam(Output)); +} + +static void wrap_ImplicitFunction_RemoveNode(CImplicitFunction &self, PImplicitNode& Node) { + self.RemoveNode(classParam(Node)); +} + +static void wrap_ImplicitFunction_AddLink(CImplicitFunction &self, PImplicitPort& Source, PImplicitPort& Target) { + self.AddLink(classParam(Source), classParam(Target)); +} + +static void wrap_FunctionFromImage3D_SetImage3D(CFunctionFromImage3D &self, PImage3D& Image3D) { + self.SetImage3D(classParam(Image3D)); +} + +static sTransformWrapper wrap_BuildItem_GetObjectTransform(CBuildItem &self) { + auto result = self.GetObjectTransform(); + sTransformWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static void wrap_BuildItem_SetObjectTransform(CBuildItem &self, const sTransformWrapper& Transform) { + self.SetObjectTransform(Transform.toStruct()); +} + +static sBoxWrapper wrap_BuildItem_GetOutbox(CBuildItem &self) { + auto result = self.GetOutbox(); + sBoxWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static void wrap_Slice_SetVertices(CSlice &self, const std::vector& Vertices) { + std::vector converted_Vertices; + converted_Vertices.reserve(Vertices.size()); + for (const auto& w : Vertices) converted_Vertices.push_back(w.toStruct()); + self.SetVertices(converted_Vertices); +} + +static void wrap_SliceStack_AddSliceStackReference(CSliceStack &self, PSliceStack& TheSliceStack) { + self.AddSliceStackReference(classParam(TheSliceStack)); +} + +static PAccessRight wrap_ResourceDataGroup_AddAccessRight(CResourceDataGroup &self, PConsumer& Consumer, const eWrappingAlgorithm& WrappingAlgorithm, const eMgfAlgorithm& MgfAlgorithm, const eDigestMethod& DigestMethod) { + auto result = self.AddAccessRight(classParam(Consumer), WrappingAlgorithm, MgfAlgorithm, DigestMethod); + return result; +} + +static PAccessRight wrap_ResourceDataGroup_FindAccessRightByConsumer(CResourceDataGroup &self, PConsumer& Consumer) { + auto result = self.FindAccessRightByConsumer(classParam(Consumer)); + return result; +} + +static void wrap_ResourceDataGroup_RemoveAccessRight(CResourceDataGroup &self, PConsumer& Consumer) { + self.RemoveAccessRight(classParam(Consumer)); +} + +static void wrap_KeyStore_RemoveConsumer(CKeyStore &self, PConsumer& Consumer) { + self.RemoveConsumer(classParam(Consumer)); +} + +static void wrap_KeyStore_RemoveResourceDataGroup(CKeyStore &self, PResourceDataGroup& ResourceDataGroup) { + self.RemoveResourceDataGroup(classParam(ResourceDataGroup)); +} + +static PResourceDataGroup wrap_KeyStore_FindResourceDataGroup(CKeyStore &self, PPackagePart& PartPath) { + auto result = self.FindResourceDataGroup(classParam(PartPath)); + return result; +} + +static PResourceData wrap_KeyStore_AddResourceData(CKeyStore &self, PResourceDataGroup& ResourceDataGroup, PPackagePart& PartPath, const eEncryptionAlgorithm& Algorithm, const eCompression& Compression, std::vector& AdditionalAuthenticationData) { + auto result = self.AddResourceData(classParam(ResourceDataGroup), classParam(PartPath), Algorithm, Compression, AdditionalAuthenticationData); + return result; +} + +static void wrap_KeyStore_RemoveResourceData(CKeyStore &self, PResourceData& ResourceData) { + self.RemoveResourceData(classParam(ResourceData)); +} + +static PResourceData wrap_KeyStore_FindResourceData(CKeyStore &self, PPackagePart& ResourcePath) { + auto result = self.FindResourceData(classParam(ResourcePath)); + return result; +} + +static sBoxWrapper wrap_Model_GetOutbox(CModel &self) { + auto result = self.GetOutbox(); + sBoxWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static void wrap_Model_MergeFromModel(CModel &self, PModel& ModelInstance) { + self.MergeFromModel(classParam(ModelInstance)); +} + +static PTexture2D wrap_Model_AddTexture2DFromAttachment(CModel &self, PAttachment& TextureAttachment) { + auto result = self.AddTexture2DFromAttachment(classParam(TextureAttachment)); + return result; +} + +static PTexture2DGroup wrap_Model_AddTexture2DGroup(CModel &self, PTexture2D& Texture2DInstance) { + auto result = self.AddTexture2DGroup(classParam(Texture2DInstance)); + return result; +} + +static PCompositeMaterials wrap_Model_AddCompositeMaterials(CModel &self, PBaseMaterialGroup& BaseMaterialGroupInstance) { + auto result = self.AddCompositeMaterials(classParam(BaseMaterialGroupInstance)); + return result; +} + +static PBuildItem wrap_Model_AddBuildItem(CModel &self, PObject& Object, const sTransformWrapper& Transform) { + auto result = self.AddBuildItem(classParam(Object), Transform.toStruct()); + return result; +} + +static void wrap_Model_RemoveBuildItem(CModel &self, PBuildItem& BuildItemInstance) { + self.RemoveBuildItem(classParam(BuildItemInstance)); +} + +static void wrap_Model_RemoveAttachment(CModel &self, PAttachment& AttachmentInstance) { + self.RemoveAttachment(classParam(AttachmentInstance)); +} + +static PFunctionFromImage3D wrap_Model_AddFunctionFromImage3D(CModel &self, PImage3D& Image3DInstance) { + auto result = self.AddFunctionFromImage3D(classParam(Image3DInstance)); + return result; +} + +static void wrap_Model_RemoveResource(CModel &self, PResource& Resource) { + self.RemoveResource(classParam(Resource)); +} + +static void wrap_Wrapper_Release(CWrapper &self, PBase& Instance) { + self.Release(classParam(Instance)); +} + +static void wrap_Wrapper_Acquire(CWrapper &self, PBase& Instance) { + self.Acquire(classParam(Instance)); +} + +static sColorWrapper wrap_Wrapper_RGBAToColor(CWrapper &self, const Lib3MF_uint8& Red, const Lib3MF_uint8& Green, const Lib3MF_uint8& Blue, const Lib3MF_uint8& Alpha) { + auto result = self.RGBAToColor(Red, Green, Blue, Alpha); + sColorWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static sColorWrapper wrap_Wrapper_FloatRGBAToColor(CWrapper &self, const Lib3MF_single& Red, const Lib3MF_single& Green, const Lib3MF_single& Blue, const Lib3MF_single& Alpha) { + auto result = self.FloatRGBAToColor(Red, Green, Blue, Alpha); + sColorWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static sTransformWrapper wrap_Wrapper_GetIdentityTransform(CWrapper &self) { + auto result = self.GetIdentityTransform(); + sTransformWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static sTransformWrapper wrap_Wrapper_GetUniformScaleTransform(CWrapper &self, const Lib3MF_single& Factor) { + auto result = self.GetUniformScaleTransform(Factor); + sTransformWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static sTransformWrapper wrap_Wrapper_GetScaleTransform(CWrapper &self, const Lib3MF_single& FactorX, const Lib3MF_single& FactorY, const Lib3MF_single& FactorZ) { + auto result = self.GetScaleTransform(FactorX, FactorY, FactorZ); + sTransformWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static sTransformWrapper wrap_Wrapper_GetTranslationTransform(CWrapper &self, const Lib3MF_single& VectorX, const Lib3MF_single& VectorY, const Lib3MF_single& VectorZ) { + auto result = self.GetTranslationTransform(VectorX, VectorY, VectorZ); + sTransformWrapper wrapper; + wrapper.value = result; + return wrapper; +} + +static emscripten::val wrap_Writer_WriteToBuffer(CWriter &self) { + emscripten::val output = emscripten::val::object(); + std::vector Buffer; + self.WriteToBuffer(Buffer); + output.set("Buffer", Buffer); + return output; +} + +static emscripten::val wrap_Writer_GetWarning(CWriter &self, const Lib3MF_uint32& Index) { + emscripten::val output = emscripten::val::object(); + Lib3MF_uint32 ErrorCode; + std::string return_value = self.GetWarning(Index, ErrorCode); + output.set("return", return_value); + output.set("ErrorCode", ErrorCode); + return output; +} + +static emscripten::val wrap_Reader_GetWarning(CReader &self, const Lib3MF_uint32& Index) { + emscripten::val output = emscripten::val::object(); + Lib3MF_uint32 ErrorCode; + std::string return_value = self.GetWarning(Index, ErrorCode); + output.set("return", return_value); + output.set("ErrorCode", ErrorCode); + return output; +} + +static emscripten::val wrap_TriangleSet_GetTriangleList(CTriangleSet &self) { + emscripten::val output = emscripten::val::object(); + std::vector TriangleIndices; + self.GetTriangleList(TriangleIndices); + output.set("TriangleIndices", TriangleIndices); + return output; +} + +static emscripten::val wrap_Object_GetUUID(CObject &self) { + emscripten::val output = emscripten::val::object(); + bool HasUUID; + std::string return_value = self.GetUUID(HasUUID); + output.set("return", return_value); + output.set("HasUUID", HasUUID); + return output; +} + +static emscripten::val wrap_MeshObject_GetVertices(CMeshObject &self) { + emscripten::val output = emscripten::val::object(); + std::vector Vertices; + self.GetVertices(Vertices); + std::vector wrapped_Vertices; + wrapped_Vertices.reserve(Vertices.size()); + for (const auto& v : Vertices) wrapped_Vertices.push_back(sPositionWrapper{v}); + output.set("Vertices", wrapped_Vertices); + return output; +} + +static emscripten::val wrap_MeshObject_GetTriangleIndices(CMeshObject &self) { + emscripten::val output = emscripten::val::object(); + std::vector Indices; + self.GetTriangleIndices(Indices); + std::vector wrapped_Indices; + wrapped_Indices.reserve(Indices.size()); + for (const auto& v : Indices) wrapped_Indices.push_back(sTriangleWrapper{v}); + output.set("Indices", wrapped_Indices); + return output; +} + +static emscripten::val wrap_MeshObject_GetObjectLevelProperty(CMeshObject &self) { + emscripten::val output = emscripten::val::object(); + Lib3MF_uint32 UniqueResourceID; + Lib3MF_uint32 PropertyID; + bool return_value = self.GetObjectLevelProperty(UniqueResourceID, PropertyID); + output.set("return", return_value); + output.set("UniqueResourceID", UniqueResourceID); + output.set("PropertyID", PropertyID); + return output; +} + +static emscripten::val wrap_MeshObject_GetTriangleProperties(CMeshObject &self, const Lib3MF_uint32& Index) { + emscripten::val output = emscripten::val::object(); + sTrianglePropertiesWrapper Property; + self.GetTriangleProperties(Index, Property.value); + output.set("Property", Property); + return output; +} + +static emscripten::val wrap_MeshObject_GetAllTriangleProperties(CMeshObject &self) { + emscripten::val output = emscripten::val::object(); + std::vector PropertiesArray; + self.GetAllTriangleProperties(PropertiesArray); + std::vector wrapped_PropertiesArray; + wrapped_PropertiesArray.reserve(PropertiesArray.size()); + for (const auto& v : PropertiesArray) wrapped_PropertiesArray.push_back(sTrianglePropertiesWrapper{v}); + output.set("PropertiesArray", wrapped_PropertiesArray); + return output; +} + +static emscripten::val wrap_BooleanObject_GetOperand(CBooleanObject &self, const Lib3MF_uint32& Index) { + emscripten::val output = emscripten::val::object(); + PMeshObject OperandObject; + sTransformWrapper return_value; + return_value.value = self.GetOperand(Index, OperandObject); + output.set("return", return_value); + output.set("OperandObject", OperandObject); + return output; +} + +static emscripten::val wrap_BeamLattice_GetClipping(CBeamLattice &self) { + emscripten::val output = emscripten::val::object(); + eBeamLatticeClipMode ClipMode; + Lib3MF_uint32 UniqueResourceID; + self.GetClipping(ClipMode, UniqueResourceID); + output.set("ClipMode", ClipMode); + output.set("UniqueResourceID", UniqueResourceID); + return output; +} + +static emscripten::val wrap_BeamLattice_GetRepresentation(CBeamLattice &self) { + emscripten::val output = emscripten::val::object(); + Lib3MF_uint32 UniqueResourceID; + bool return_value = self.GetRepresentation(UniqueResourceID); + output.set("return", return_value); + output.set("UniqueResourceID", UniqueResourceID); + return output; +} + +static emscripten::val wrap_BeamLattice_GetBallOptions(CBeamLattice &self) { + emscripten::val output = emscripten::val::object(); + eBeamLatticeBallMode BallMode; + Lib3MF_double BallRadius; + self.GetBallOptions(BallMode, BallRadius); + output.set("BallMode", BallMode); + output.set("BallRadius", BallRadius); + return output; +} + +static emscripten::val wrap_BeamLattice_GetBeams(CBeamLattice &self) { + emscripten::val output = emscripten::val::object(); + std::vector BeamInfo; + self.GetBeams(BeamInfo); + std::vector wrapped_BeamInfo; + wrapped_BeamInfo.reserve(BeamInfo.size()); + for (const auto& v : BeamInfo) wrapped_BeamInfo.push_back(sBeamWrapper{v}); + output.set("BeamInfo", wrapped_BeamInfo); + return output; +} + +static emscripten::val wrap_BeamLattice_GetBalls(CBeamLattice &self) { + emscripten::val output = emscripten::val::object(); + std::vector BallInfo; + self.GetBalls(BallInfo); + std::vector wrapped_BallInfo; + wrapped_BallInfo.reserve(BallInfo.size()); + for (const auto& v : BallInfo) wrapped_BallInfo.push_back(sBallWrapper{v}); + output.set("BallInfo", wrapped_BallInfo); + return output; +} + +static emscripten::val wrap_Component_GetUUID(CComponent &self) { + emscripten::val output = emscripten::val::object(); + bool HasUUID; + std::string return_value = self.GetUUID(HasUUID); + output.set("return", return_value); + output.set("HasUUID", HasUUID); + return output; +} + +static emscripten::val wrap_BeamSet_GetReferences(CBeamSet &self) { + emscripten::val output = emscripten::val::object(); + std::vector References; + self.GetReferences(References); + output.set("References", References); + return output; +} + +static emscripten::val wrap_BeamSet_GetBallReferences(CBeamSet &self) { + emscripten::val output = emscripten::val::object(); + std::vector BallReferences; + self.GetBallReferences(BallReferences); + output.set("BallReferences", BallReferences); + return output; +} + +static emscripten::val wrap_BaseMaterialGroup_GetAllPropertyIDs(CBaseMaterialGroup &self) { + emscripten::val output = emscripten::val::object(); + std::vector PropertyIDs; + self.GetAllPropertyIDs(PropertyIDs); + output.set("PropertyIDs", PropertyIDs); + return output; +} + +static emscripten::val wrap_ColorGroup_GetAllPropertyIDs(CColorGroup &self) { + emscripten::val output = emscripten::val::object(); + std::vector PropertyIDs; + self.GetAllPropertyIDs(PropertyIDs); + output.set("PropertyIDs", PropertyIDs); + return output; +} + +static emscripten::val wrap_Texture2DGroup_GetAllPropertyIDs(CTexture2DGroup &self) { + emscripten::val output = emscripten::val::object(); + std::vector PropertyIDs; + self.GetAllPropertyIDs(PropertyIDs); + output.set("PropertyIDs", PropertyIDs); + return output; +} + +static emscripten::val wrap_CompositeMaterials_GetAllPropertyIDs(CCompositeMaterials &self) { + emscripten::val output = emscripten::val::object(); + std::vector PropertyIDs; + self.GetAllPropertyIDs(PropertyIDs); + output.set("PropertyIDs", PropertyIDs); + return output; +} + +static emscripten::val wrap_CompositeMaterials_GetComposite(CCompositeMaterials &self, const Lib3MF_uint32& PropertyID) { + emscripten::val output = emscripten::val::object(); + std::vector Composite; + self.GetComposite(PropertyID, Composite); + std::vector wrapped_Composite; + wrapped_Composite.reserve(Composite.size()); + for (const auto& v : Composite) wrapped_Composite.push_back(sCompositeConstituentWrapper{v}); + output.set("Composite", wrapped_Composite); + return output; +} + +static emscripten::val wrap_MultiPropertyGroup_GetAllPropertyIDs(CMultiPropertyGroup &self) { + emscripten::val output = emscripten::val::object(); + std::vector PropertyIDs; + self.GetAllPropertyIDs(PropertyIDs); + output.set("PropertyIDs", PropertyIDs); + return output; +} + +static emscripten::val wrap_MultiPropertyGroup_GetMultiProperty(CMultiPropertyGroup &self, const Lib3MF_uint32& PropertyID) { + emscripten::val output = emscripten::val::object(); + std::vector PropertyIDs; + self.GetMultiProperty(PropertyID, PropertyIDs); + output.set("PropertyIDs", PropertyIDs); + return output; +} + +static emscripten::val wrap_Attachment_WriteToBuffer(CAttachment &self) { + emscripten::val output = emscripten::val::object(); + std::vector Buffer; + self.WriteToBuffer(Buffer); + output.set("Buffer", Buffer); + return output; +} + +static emscripten::val wrap_Texture2D_GetTileStyleUV(CTexture2D &self) { + emscripten::val output = emscripten::val::object(); + eTextureTileStyle TileStyleU; + eTextureTileStyle TileStyleV; + self.GetTileStyleUV(TileStyleU, TileStyleV); + output.set("TileStyleU", TileStyleU); + output.set("TileStyleV", TileStyleV); + return output; +} + +static emscripten::val wrap_FunctionFromImage3D_GetTileStyles(CFunctionFromImage3D &self) { + emscripten::val output = emscripten::val::object(); + eTextureTileStyle TileStyleU; + eTextureTileStyle TileStyleV; + eTextureTileStyle TileStyleW; + self.GetTileStyles(TileStyleU, TileStyleV, TileStyleW); + output.set("TileStyleU", TileStyleU); + output.set("TileStyleV", TileStyleV); + output.set("TileStyleW", TileStyleW); + return output; +} + +static emscripten::val wrap_BuildItem_GetUUID(CBuildItem &self) { + emscripten::val output = emscripten::val::object(); + bool HasUUID; + std::string return_value = self.GetUUID(HasUUID); + output.set("return", return_value); + output.set("HasUUID", HasUUID); + return output; +} + +static emscripten::val wrap_Slice_GetVertices(CSlice &self) { + emscripten::val output = emscripten::val::object(); + std::vector Vertices; + self.GetVertices(Vertices); + std::vector wrapped_Vertices; + wrapped_Vertices.reserve(Vertices.size()); + for (const auto& v : Vertices) wrapped_Vertices.push_back(sPosition2DWrapper{v}); + output.set("Vertices", wrapped_Vertices); + return output; +} + +static sPosition2DWrapper wrap_Slice_GetVertex(CSlice &self, const Lib3MF_uint64& Index) { + std::vector vertices; + self.GetVertices(vertices); + return sPosition2DWrapper{vertices.at(static_cast(Index))}; +} + +static emscripten::val wrap_Slice_GetPolygonIndices(CSlice &self, const Lib3MF_uint64& Index) { + emscripten::val output = emscripten::val::object(); + std::vector Indices; + self.GetPolygonIndices(Index, Indices); + output.set("Indices", Indices); + return output; +} + +static emscripten::val wrap_ContentEncryptionParams_GetKey(CContentEncryptionParams &self) { + emscripten::val output = emscripten::val::object(); + std::vector ByteData; + self.GetKey(ByteData); + output.set("ByteData", ByteData); + return output; +} + +static emscripten::val wrap_ContentEncryptionParams_GetInitializationVector(CContentEncryptionParams &self) { + emscripten::val output = emscripten::val::object(); + std::vector ByteData; + self.GetInitializationVector(ByteData); + output.set("ByteData", ByteData); + return output; +} + +static emscripten::val wrap_ContentEncryptionParams_GetAuthenticationTag(CContentEncryptionParams &self) { + emscripten::val output = emscripten::val::object(); + std::vector ByteData; + self.GetAuthenticationTag(ByteData); + output.set("ByteData", ByteData); + return output; +} + +static emscripten::val wrap_ContentEncryptionParams_GetAdditionalAuthenticationData(CContentEncryptionParams &self) { + emscripten::val output = emscripten::val::object(); + std::vector ByteData; + self.GetAdditionalAuthenticationData(ByteData); + output.set("ByteData", ByteData); + return output; +} + +static emscripten::val wrap_ResourceData_GetAdditionalAuthenticationData(CResourceData &self) { + emscripten::val output = emscripten::val::object(); + std::vector ByteData; + self.GetAdditionalAuthenticationData(ByteData); + output.set("ByteData", ByteData); + return output; +} + +static emscripten::val wrap_KeyStore_GetUUID(CKeyStore &self) { + emscripten::val output = emscripten::val::object(); + bool HasUUID; + std::string return_value = self.GetUUID(HasUUID); + output.set("return", return_value); + output.set("HasUUID", HasUUID); + return output; +} + +static emscripten::val wrap_Model_GetBuildUUID(CModel &self) { + emscripten::val output = emscripten::val::object(); + bool HasUUID; + std::string return_value = self.GetBuildUUID(HasUUID); + output.set("return", return_value); + output.set("HasUUID", HasUUID); + return output; +} + +static emscripten::val wrap_Wrapper_GetLibraryVersion(CWrapper &self) { + emscripten::val output = emscripten::val::object(); + Lib3MF_uint32 Major; + Lib3MF_uint32 Minor; + Lib3MF_uint32 Micro; + self.GetLibraryVersion(Major, Minor, Micro); + output.set("Major", Major); + output.set("Minor", Minor); + output.set("Micro", Micro); + return output; +} + +static emscripten::val wrap_Wrapper_GetPrereleaseInformation(CWrapper &self) { + emscripten::val output = emscripten::val::object(); + std::string PrereleaseInfo; + bool return_value = self.GetPrereleaseInformation(PrereleaseInfo); + output.set("return", return_value); + output.set("PrereleaseInfo", PrereleaseInfo); + return output; +} + +static emscripten::val wrap_Wrapper_GetBuildInformation(CWrapper &self) { + emscripten::val output = emscripten::val::object(); + std::string BuildInformation; + bool return_value = self.GetBuildInformation(BuildInformation); + output.set("return", return_value); + output.set("BuildInformation", BuildInformation); + return output; +} + +static emscripten::val wrap_Wrapper_GetSpecificationVersion(CWrapper &self, const std::string& SpecificationURL) { + emscripten::val output = emscripten::val::object(); + bool IsSupported; + Lib3MF_uint32 Major; + Lib3MF_uint32 Minor; + Lib3MF_uint32 Micro; + self.GetSpecificationVersion(SpecificationURL, IsSupported, Major, Minor, Micro); + output.set("IsSupported", IsSupported); + output.set("Major", Major); + output.set("Minor", Minor); + output.set("Micro", Micro); + return output; +} + +static emscripten::val wrap_Wrapper_GetLastError(CWrapper &self, PBase& Instance) { + emscripten::val output = emscripten::val::object(); + std::string LastErrorString; + bool return_value = self.GetLastError(classParam(Instance), LastErrorString); + output.set("return", return_value); + output.set("LastErrorString", LastErrorString); + return output; +} + +static emscripten::val wrap_Wrapper_RetrieveProgressMessage(CWrapper &self, const eProgressIdentifier& TheProgressIdentifier) { + emscripten::val output = emscripten::val::object(); + std::string ProgressMessage; + self.RetrieveProgressMessage(TheProgressIdentifier, ProgressMessage); + output.set("ProgressMessage", ProgressMessage); + return output; +} + +static emscripten::val wrap_Wrapper_ColorToRGBA(CWrapper &self, const sColorWrapper& TheColor) { + emscripten::val output = emscripten::val::object(); + Lib3MF_uint8 Red; + Lib3MF_uint8 Green; + Lib3MF_uint8 Blue; + Lib3MF_uint8 Alpha; + self.ColorToRGBA(TheColor.toStruct(), Red, Green, Blue, Alpha); + output.set("Red", Red); + output.set("Green", Green); + output.set("Blue", Blue); + output.set("Alpha", Alpha); + return output; +} + +static emscripten::val wrap_Wrapper_ColorToFloatRGBA(CWrapper &self, const sColorWrapper& TheColor) { + emscripten::val output = emscripten::val::object(); + Lib3MF_single Red; + Lib3MF_single Green; + Lib3MF_single Blue; + Lib3MF_single Alpha; + self.ColorToFloatRGBA(TheColor.toStruct(), Red, Green, Blue, Alpha); + output.set("Red", Red); + output.set("Green", Green); + output.set("Blue", Blue); + output.set("Alpha", Alpha); + return output; +} + +// ================== Emscripten Bindings ================== +EMSCRIPTEN_BINDINGS(Lib3MF) { + // Enums + enum_("ePropertyType") + .value("NoPropertyType", ePropertyType::NoPropertyType) + .value("BaseMaterial", ePropertyType::BaseMaterial) + .value("TexCoord", ePropertyType::TexCoord) + .value("Colors", ePropertyType::Colors) + .value("Composite", ePropertyType::Composite) + .value("Multi", ePropertyType::Multi) + ; + enum_("eSlicesMeshResolution") + .value("Fullres", eSlicesMeshResolution::Fullres) + .value("Lowres", eSlicesMeshResolution::Lowres) + ; + enum_("eModelUnit") + .value("MicroMeter", eModelUnit::MicroMeter) + .value("MilliMeter", eModelUnit::MilliMeter) + .value("CentiMeter", eModelUnit::CentiMeter) + .value("Inch", eModelUnit::Inch) + .value("Foot", eModelUnit::Foot) + .value("Meter", eModelUnit::Meter) + ; + enum_("eObjectType") + .value("Other", eObjectType::Other) + .value("Model", eObjectType::Model) + .value("Support", eObjectType::Support) + .value("SolidSupport", eObjectType::SolidSupport) + .value("Surface", eObjectType::Surface) + ; + enum_("eBooleanOperation") + .value("Union", eBooleanOperation::Union) + .value("Difference", eBooleanOperation::Difference) + .value("Intersection", eBooleanOperation::Intersection) + ; + enum_("eTextureType") + .value("Unknown", eTextureType::Unknown) + .value("PNG", eTextureType::PNG) + .value("JPEG", eTextureType::JPEG) + ; + enum_("eTextureTileStyle") + .value("Wrap", eTextureTileStyle::Wrap) + .value("Mirror", eTextureTileStyle::Mirror) + .value("Clamp", eTextureTileStyle::Clamp) + .value("NoTileStyle", eTextureTileStyle::NoTileStyle) + ; + enum_("eTextureFilter") + .value("Auto", eTextureFilter::Auto) + .value("Linear", eTextureFilter::Linear) + .value("Nearest", eTextureFilter::Nearest) + ; + enum_("eBeamLatticeCapMode") + .value("Sphere", eBeamLatticeCapMode::Sphere) + .value("HemiSphere", eBeamLatticeCapMode::HemiSphere) + .value("Butt", eBeamLatticeCapMode::Butt) + ; + enum_("eBeamLatticeClipMode") + .value("NoClipMode", eBeamLatticeClipMode::NoClipMode) + .value("Inside", eBeamLatticeClipMode::Inside) + .value("Outside", eBeamLatticeClipMode::Outside) + ; + enum_("eBeamLatticeBallMode") + .value("BeamLatticeBallModeNone", eBeamLatticeBallMode::BeamLatticeBallModeNone) + .value("Mixed", eBeamLatticeBallMode::Mixed) + .value("All", eBeamLatticeBallMode::All) + ; + enum_("eProgressIdentifier") + .value("QUERYCANCELED", eProgressIdentifier::QUERYCANCELED) + .value("DONE", eProgressIdentifier::DONE) + .value("CLEANUP", eProgressIdentifier::CLEANUP) + .value("READSTREAM", eProgressIdentifier::READSTREAM) + .value("EXTRACTOPCPACKAGE", eProgressIdentifier::EXTRACTOPCPACKAGE) + .value("READNONROOTMODELS", eProgressIdentifier::READNONROOTMODELS) + .value("READROOTMODEL", eProgressIdentifier::READROOTMODEL) + .value("READRESOURCES", eProgressIdentifier::READRESOURCES) + .value("READMESH", eProgressIdentifier::READMESH) + .value("READSLICES", eProgressIdentifier::READSLICES) + .value("READBUILD", eProgressIdentifier::READBUILD) + .value("READCUSTOMATTACHMENT", eProgressIdentifier::READCUSTOMATTACHMENT) + .value("READTEXTURETACHMENTS", eProgressIdentifier::READTEXTURETACHMENTS) + .value("CREATEOPCPACKAGE", eProgressIdentifier::CREATEOPCPACKAGE) + .value("WRITEMODELSTOSTREAM", eProgressIdentifier::WRITEMODELSTOSTREAM) + .value("WRITEROOTMODEL", eProgressIdentifier::WRITEROOTMODEL) + .value("WRITENONROOTMODELS", eProgressIdentifier::WRITENONROOTMODELS) + .value("WRITEATTACHMENTS", eProgressIdentifier::WRITEATTACHMENTS) + .value("WRITECONTENTTYPES", eProgressIdentifier::WRITECONTENTTYPES) + .value("WRITENOBJECTS", eProgressIdentifier::WRITENOBJECTS) + .value("WRITENODES", eProgressIdentifier::WRITENODES) + .value("WRITETRIANGLES", eProgressIdentifier::WRITETRIANGLES) + .value("WRITESLICES", eProgressIdentifier::WRITESLICES) + .value("WRITEKEYSTORE", eProgressIdentifier::WRITEKEYSTORE) + ; + enum_("eBlendMethod") + .value("NoBlendMethod", eBlendMethod::NoBlendMethod) + .value("Mix", eBlendMethod::Mix) + .value("Multiply", eBlendMethod::Multiply) + ; + enum_("eChannelName") + .value("Red", eChannelName::Red) + .value("Green", eChannelName::Green) + .value("Blue", eChannelName::Blue) + .value("Alpha", eChannelName::Alpha) + ; + enum_("eCompositionMethod") + .value("WeightedSum", eCompositionMethod::WeightedSum) + .value("Multiply", eCompositionMethod::Multiply) + .value("Min", eCompositionMethod::Min) + .value("Max", eCompositionMethod::Max) + .value("Mask", eCompositionMethod::Mask) + ; + enum_("eCompositionSpace") + .value("Raw", eCompositionSpace::Raw) + .value("LinearColor", eCompositionSpace::LinearColor) + ; + enum_("eImplicitNodeType") + .value("Addition", eImplicitNodeType::Addition) + .value("Subtraction", eImplicitNodeType::Subtraction) + .value("Multiplication", eImplicitNodeType::Multiplication) + .value("Division", eImplicitNodeType::Division) + .value("Constant", eImplicitNodeType::Constant) + .value("ConstVec", eImplicitNodeType::ConstVec) + .value("ConstMat", eImplicitNodeType::ConstMat) + .value("ComposeVector", eImplicitNodeType::ComposeVector) + .value("DecomposeVector", eImplicitNodeType::DecomposeVector) + .value("ComposeMatrix", eImplicitNodeType::ComposeMatrix) + .value("MatrixFromColumns", eImplicitNodeType::MatrixFromColumns) + .value("MatrixFromRows", eImplicitNodeType::MatrixFromRows) + .value("Dot", eImplicitNodeType::Dot) + .value("Cross", eImplicitNodeType::Cross) + .value("MatVecMultiplication", eImplicitNodeType::MatVecMultiplication) + .value("Transpose", eImplicitNodeType::Transpose) + .value("Inverse", eImplicitNodeType::Inverse) + .value("Sinus", eImplicitNodeType::Sinus) + .value("Cosinus", eImplicitNodeType::Cosinus) + .value("Tan", eImplicitNodeType::Tan) + .value("ArcSin", eImplicitNodeType::ArcSin) + .value("ArcCos", eImplicitNodeType::ArcCos) + .value("ArcTan", eImplicitNodeType::ArcTan) + .value("ArcTan2", eImplicitNodeType::ArcTan2) + .value("Min", eImplicitNodeType::Min) + .value("Max", eImplicitNodeType::Max) + .value("Abs", eImplicitNodeType::Abs) + .value("Fmod", eImplicitNodeType::Fmod) + .value("Pow", eImplicitNodeType::Pow) + .value("Sqrt", eImplicitNodeType::Sqrt) + .value("Exp", eImplicitNodeType::Exp) + .value("Log", eImplicitNodeType::Log) + .value("Log2", eImplicitNodeType::Log2) + .value("Log10", eImplicitNodeType::Log10) + .value("Select", eImplicitNodeType::Select) + .value("Clamp", eImplicitNodeType::Clamp) + .value("Sinh", eImplicitNodeType::Sinh) + .value("Cosh", eImplicitNodeType::Cosh) + .value("Tanh", eImplicitNodeType::Tanh) + .value("Round", eImplicitNodeType::Round) + .value("Ceil", eImplicitNodeType::Ceil) + .value("Floor", eImplicitNodeType::Floor) + .value("Sign", eImplicitNodeType::Sign) + .value("Fract", eImplicitNodeType::Fract) + .value("FunctionCall", eImplicitNodeType::FunctionCall) + .value("Mesh", eImplicitNodeType::Mesh) + .value("Length", eImplicitNodeType::Length) + .value("ConstResourceID", eImplicitNodeType::ConstResourceID) + .value("VectorFromScalar", eImplicitNodeType::VectorFromScalar) + .value("UnsignedMesh", eImplicitNodeType::UnsignedMesh) + .value("Mod", eImplicitNodeType::Mod) + .value("BeamLattice", eImplicitNodeType::BeamLattice) + .value("FunctionGradient", eImplicitNodeType::FunctionGradient) + .value("NormalizeDistance", eImplicitNodeType::NormalizeDistance) + ; + enum_("eImplicitPortType") + .value("Scalar", eImplicitPortType::Scalar) + .value("Vector", eImplicitPortType::Vector) + .value("Matrix", eImplicitPortType::Matrix) + .value("ResourceID", eImplicitPortType::ResourceID) + ; + enum_("eImplicitNodeConfiguration") + .value("Default", eImplicitNodeConfiguration::Default) + .value("ScalarToScalar", eImplicitNodeConfiguration::ScalarToScalar) + .value("VectorToVector", eImplicitNodeConfiguration::VectorToVector) + .value("MatrixToMatrix", eImplicitNodeConfiguration::MatrixToMatrix) + ; + enum_("eEncryptionAlgorithm") + .value("AES256_GCM", eEncryptionAlgorithm::AES256_GCM) + ; + enum_("eWrappingAlgorithm") + .value("RSA_OAEP", eWrappingAlgorithm::RSA_OAEP) + ; + enum_("eMgfAlgorithm") + .value("MGF1_SHA1", eMgfAlgorithm::MGF1_SHA1) + .value("MGF1_SHA224", eMgfAlgorithm::MGF1_SHA224) + .value("MGF1_SHA256", eMgfAlgorithm::MGF1_SHA256) + .value("MGF1_SHA384", eMgfAlgorithm::MGF1_SHA384) + .value("MGF1_SHA512", eMgfAlgorithm::MGF1_SHA512) + ; + enum_("eDigestMethod") + .value("SHA1", eDigestMethod::SHA1) + .value("SHA256", eDigestMethod::SHA256) + ; + enum_("eCompression") + .value("NoCompression", eCompression::NoCompression) + .value("Deflate", eCompression::Deflate) + ; + + // Register JS bindings for struct-array wrappers + register_vector("std::vector"); + register_vector("std::vector"); + register_vector("std::vector"); + register_vector("std::vector"); + register_vector("std::vector"); + register_vector("std::vector"); + register_vector("std::vector"); + register_vector("std::vector"); + register_vector("std::vector"); + register_vector("std::vector"); + register_vector("std::vector"); + register_vector("std::vector"); + register_vector("std::vector"); + register_vector("std::vector"); + + // Structs as exposed JS classes + class_("sTriangle") + .constructor<>() + .class_function("fromStruct", &sTriangleWrapper::fromStruct) + .function("get_Indices0", &sTriangleWrapper::get_Indices0) + .function("set_Indices0", &sTriangleWrapper::set_Indices0) + .function("get_Indices1", &sTriangleWrapper::get_Indices1) + .function("set_Indices1", &sTriangleWrapper::set_Indices1) + .function("get_Indices2", &sTriangleWrapper::get_Indices2) + .function("set_Indices2", &sTriangleWrapper::set_Indices2) + ; + class_("sTriangleProperties") + .constructor<>() + .class_function("fromStruct", &sTrianglePropertiesWrapper::fromStruct) + .function("get_ResourceID", &sTrianglePropertiesWrapper::get_ResourceID) + .function("set_ResourceID", &sTrianglePropertiesWrapper::set_ResourceID) + .function("get_PropertyIDs0", &sTrianglePropertiesWrapper::get_PropertyIDs0) + .function("set_PropertyIDs0", &sTrianglePropertiesWrapper::set_PropertyIDs0) + .function("get_PropertyIDs1", &sTrianglePropertiesWrapper::get_PropertyIDs1) + .function("set_PropertyIDs1", &sTrianglePropertiesWrapper::set_PropertyIDs1) + .function("get_PropertyIDs2", &sTrianglePropertiesWrapper::get_PropertyIDs2) + .function("set_PropertyIDs2", &sTrianglePropertiesWrapper::set_PropertyIDs2) + ; + class_("sPosition") + .constructor<>() + .class_function("fromStruct", &sPositionWrapper::fromStruct) + .function("get_Coordinates0", &sPositionWrapper::get_Coordinates0) + .function("set_Coordinates0", &sPositionWrapper::set_Coordinates0) + .function("get_Coordinates1", &sPositionWrapper::get_Coordinates1) + .function("set_Coordinates1", &sPositionWrapper::set_Coordinates1) + .function("get_Coordinates2", &sPositionWrapper::get_Coordinates2) + .function("set_Coordinates2", &sPositionWrapper::set_Coordinates2) + ; + class_("sPosition2D") + .constructor<>() + .class_function("fromStruct", &sPosition2DWrapper::fromStruct) + .function("get_Coordinates0", &sPosition2DWrapper::get_Coordinates0) + .function("set_Coordinates0", &sPosition2DWrapper::set_Coordinates0) + .function("get_Coordinates1", &sPosition2DWrapper::get_Coordinates1) + .function("set_Coordinates1", &sPosition2DWrapper::set_Coordinates1) + ; + class_("sCompositeConstituent") + .constructor<>() + .class_function("fromStruct", &sCompositeConstituentWrapper::fromStruct) + .function("get_PropertyID", &sCompositeConstituentWrapper::get_PropertyID) + .function("set_PropertyID", &sCompositeConstituentWrapper::set_PropertyID) + .function("get_MixingRatio", &sCompositeConstituentWrapper::get_MixingRatio) + .function("set_MixingRatio", &sCompositeConstituentWrapper::set_MixingRatio) + ; + class_("sMultiPropertyLayer") + .constructor<>() + .class_function("fromStruct", &sMultiPropertyLayerWrapper::fromStruct) + .function("get_ResourceID", &sMultiPropertyLayerWrapper::get_ResourceID) + .function("set_ResourceID", &sMultiPropertyLayerWrapper::set_ResourceID) + .function("get_TheBlendMethod", &sMultiPropertyLayerWrapper::get_TheBlendMethod) + .function("set_TheBlendMethod", &sMultiPropertyLayerWrapper::set_TheBlendMethod) + ; + class_("sTex2Coord") + .constructor<>() + .class_function("fromStruct", &sTex2CoordWrapper::fromStruct) + .function("get_U", &sTex2CoordWrapper::get_U) + .function("set_U", &sTex2CoordWrapper::set_U) + .function("get_V", &sTex2CoordWrapper::get_V) + .function("set_V", &sTex2CoordWrapper::set_V) + ; + class_("sTransform") + .constructor<>() + .class_function("fromStruct", &sTransformWrapper::fromStruct) + .function("get_Fields_0_0", &sTransformWrapper::get_Fields_0_0) + .function("set_Fields_0_0", &sTransformWrapper::set_Fields_0_0) + .function("get_Fields_0_1", &sTransformWrapper::get_Fields_0_1) + .function("set_Fields_0_1", &sTransformWrapper::set_Fields_0_1) + .function("get_Fields_0_2", &sTransformWrapper::get_Fields_0_2) + .function("set_Fields_0_2", &sTransformWrapper::set_Fields_0_2) + .function("get_Fields_1_0", &sTransformWrapper::get_Fields_1_0) + .function("set_Fields_1_0", &sTransformWrapper::set_Fields_1_0) + .function("get_Fields_1_1", &sTransformWrapper::get_Fields_1_1) + .function("set_Fields_1_1", &sTransformWrapper::set_Fields_1_1) + .function("get_Fields_1_2", &sTransformWrapper::get_Fields_1_2) + .function("set_Fields_1_2", &sTransformWrapper::set_Fields_1_2) + .function("get_Fields_2_0", &sTransformWrapper::get_Fields_2_0) + .function("set_Fields_2_0", &sTransformWrapper::set_Fields_2_0) + .function("get_Fields_2_1", &sTransformWrapper::get_Fields_2_1) + .function("set_Fields_2_1", &sTransformWrapper::set_Fields_2_1) + .function("get_Fields_2_2", &sTransformWrapper::get_Fields_2_2) + .function("set_Fields_2_2", &sTransformWrapper::set_Fields_2_2) + .function("get_Fields_3_0", &sTransformWrapper::get_Fields_3_0) + .function("set_Fields_3_0", &sTransformWrapper::set_Fields_3_0) + .function("get_Fields_3_1", &sTransformWrapper::get_Fields_3_1) + .function("set_Fields_3_1", &sTransformWrapper::set_Fields_3_1) + .function("get_Fields_3_2", &sTransformWrapper::get_Fields_3_2) + .function("set_Fields_3_2", &sTransformWrapper::set_Fields_3_2) + ; + class_("sBox") + .constructor<>() + .class_function("fromStruct", &sBoxWrapper::fromStruct) + .function("get_MinCoordinate0", &sBoxWrapper::get_MinCoordinate0) + .function("set_MinCoordinate0", &sBoxWrapper::set_MinCoordinate0) + .function("get_MinCoordinate1", &sBoxWrapper::get_MinCoordinate1) + .function("set_MinCoordinate1", &sBoxWrapper::set_MinCoordinate1) + .function("get_MinCoordinate2", &sBoxWrapper::get_MinCoordinate2) + .function("set_MinCoordinate2", &sBoxWrapper::set_MinCoordinate2) + .function("get_MaxCoordinate0", &sBoxWrapper::get_MaxCoordinate0) + .function("set_MaxCoordinate0", &sBoxWrapper::set_MaxCoordinate0) + .function("get_MaxCoordinate1", &sBoxWrapper::get_MaxCoordinate1) + .function("set_MaxCoordinate1", &sBoxWrapper::set_MaxCoordinate1) + .function("get_MaxCoordinate2", &sBoxWrapper::get_MaxCoordinate2) + .function("set_MaxCoordinate2", &sBoxWrapper::set_MaxCoordinate2) + ; + class_("sColor") + .constructor<>() + .class_function("fromStruct", &sColorWrapper::fromStruct) + .function("get_Red", &sColorWrapper::get_Red) + .function("set_Red", &sColorWrapper::set_Red) + .function("get_Green", &sColorWrapper::get_Green) + .function("set_Green", &sColorWrapper::set_Green) + .function("get_Blue", &sColorWrapper::get_Blue) + .function("set_Blue", &sColorWrapper::set_Blue) + .function("get_Alpha", &sColorWrapper::get_Alpha) + .function("set_Alpha", &sColorWrapper::set_Alpha) + ; + class_("sBeam") + .constructor<>() + .class_function("fromStruct", &sBeamWrapper::fromStruct) + .function("get_Indices0", &sBeamWrapper::get_Indices0) + .function("set_Indices0", &sBeamWrapper::set_Indices0) + .function("get_Indices1", &sBeamWrapper::get_Indices1) + .function("set_Indices1", &sBeamWrapper::set_Indices1) + .function("get_Radii0", &sBeamWrapper::get_Radii0) + .function("set_Radii0", &sBeamWrapper::set_Radii0) + .function("get_Radii1", &sBeamWrapper::get_Radii1) + .function("set_Radii1", &sBeamWrapper::set_Radii1) + .function("get_CapModes0", &sBeamWrapper::get_CapModes0) + .function("set_CapModes0", &sBeamWrapper::set_CapModes0) + .function("get_CapModes1", &sBeamWrapper::get_CapModes1) + .function("set_CapModes1", &sBeamWrapper::set_CapModes1) + ; + class_("sBall") + .constructor<>() + .class_function("fromStruct", &sBallWrapper::fromStruct) + .function("get_Index", &sBallWrapper::get_Index) + .function("set_Index", &sBallWrapper::set_Index) + .function("get_Radius", &sBallWrapper::get_Radius) + .function("set_Radius", &sBallWrapper::set_Radius) + ; + class_("sVector") + .constructor<>() + .class_function("fromStruct", &sVectorWrapper::fromStruct) + .function("get_Coordinates0", &sVectorWrapper::get_Coordinates0) + .function("set_Coordinates0", &sVectorWrapper::set_Coordinates0) + .function("get_Coordinates1", &sVectorWrapper::get_Coordinates1) + .function("set_Coordinates1", &sVectorWrapper::set_Coordinates1) + .function("get_Coordinates2", &sVectorWrapper::get_Coordinates2) + .function("set_Coordinates2", &sVectorWrapper::set_Coordinates2) + ; + class_("sMatrix4x4") + .constructor<>() + .class_function("fromStruct", &sMatrix4x4Wrapper::fromStruct) + .function("get_Field_0_0", &sMatrix4x4Wrapper::get_Field_0_0) + .function("set_Field_0_0", &sMatrix4x4Wrapper::set_Field_0_0) + .function("get_Field_0_1", &sMatrix4x4Wrapper::get_Field_0_1) + .function("set_Field_0_1", &sMatrix4x4Wrapper::set_Field_0_1) + .function("get_Field_0_2", &sMatrix4x4Wrapper::get_Field_0_2) + .function("set_Field_0_2", &sMatrix4x4Wrapper::set_Field_0_2) + .function("get_Field_0_3", &sMatrix4x4Wrapper::get_Field_0_3) + .function("set_Field_0_3", &sMatrix4x4Wrapper::set_Field_0_3) + .function("get_Field_1_0", &sMatrix4x4Wrapper::get_Field_1_0) + .function("set_Field_1_0", &sMatrix4x4Wrapper::set_Field_1_0) + .function("get_Field_1_1", &sMatrix4x4Wrapper::get_Field_1_1) + .function("set_Field_1_1", &sMatrix4x4Wrapper::set_Field_1_1) + .function("get_Field_1_2", &sMatrix4x4Wrapper::get_Field_1_2) + .function("set_Field_1_2", &sMatrix4x4Wrapper::set_Field_1_2) + .function("get_Field_1_3", &sMatrix4x4Wrapper::get_Field_1_3) + .function("set_Field_1_3", &sMatrix4x4Wrapper::set_Field_1_3) + .function("get_Field_2_0", &sMatrix4x4Wrapper::get_Field_2_0) + .function("set_Field_2_0", &sMatrix4x4Wrapper::set_Field_2_0) + .function("get_Field_2_1", &sMatrix4x4Wrapper::get_Field_2_1) + .function("set_Field_2_1", &sMatrix4x4Wrapper::set_Field_2_1) + .function("get_Field_2_2", &sMatrix4x4Wrapper::get_Field_2_2) + .function("set_Field_2_2", &sMatrix4x4Wrapper::set_Field_2_2) + .function("get_Field_2_3", &sMatrix4x4Wrapper::get_Field_2_3) + .function("set_Field_2_3", &sMatrix4x4Wrapper::set_Field_2_3) + .function("get_Field_3_0", &sMatrix4x4Wrapper::get_Field_3_0) + .function("set_Field_3_0", &sMatrix4x4Wrapper::set_Field_3_0) + .function("get_Field_3_1", &sMatrix4x4Wrapper::get_Field_3_1) + .function("set_Field_3_1", &sMatrix4x4Wrapper::set_Field_3_1) + .function("get_Field_3_2", &sMatrix4x4Wrapper::get_Field_3_2) + .function("set_Field_3_2", &sMatrix4x4Wrapper::set_Field_3_2) + .function("get_Field_3_3", &sMatrix4x4Wrapper::get_Field_3_3) + .function("set_Field_3_3", &sMatrix4x4Wrapper::set_Field_3_3) + ; + + // Binding Methods + class_("CBase") + .smart_ptr>("shared_ptr") + .function("ClassTypeId", &CBase::ClassTypeId) + ; + class_>("CWriter") + .smart_ptr>("shared_ptr") + .function("WriteToFile", &CWriter::WriteToFile) + .function("GetStreamSize", &CWriter::GetStreamSize) + .function("WriteToBuffer", &wrap_Writer_WriteToBuffer) + // .function("WriteToCallback", &wrap_Writer_WriteToCallback) // Skipped due to callback + // .function("SetProgressCallback", &wrap_Writer_SetProgressCallback) // Skipped due to callback + .function("GetDecimalPrecision", &CWriter::GetDecimalPrecision) + .function("SetDecimalPrecision", &CWriter::SetDecimalPrecision) + .function("SetStrictModeActive", &CWriter::SetStrictModeActive) + .function("GetStrictModeActive", &CWriter::GetStrictModeActive) + .function("GetWarning", &wrap_Writer_GetWarning) + .function("GetWarningCount", &CWriter::GetWarningCount) + // .function("AddKeyWrappingCallback", &wrap_Writer_AddKeyWrappingCallback) // Skipped due to callback + // .function("SetContentEncryptionCallback", &wrap_Writer_SetContentEncryptionCallback) // Skipped due to callback + ; + class_>("CReader") + .smart_ptr>("shared_ptr") + .function("ReadFromFile", &CReader::ReadFromFile) + .function("ReadFromBuffer", &CReader::ReadFromBuffer) + // .function("ReadFromCallback", &wrap_Reader_ReadFromCallback) // Skipped due to callback + // .function("SetProgressCallback", &wrap_Reader_SetProgressCallback) // Skipped due to callback + .function("AddRelationToRead", &CReader::AddRelationToRead) + .function("RemoveRelationToRead", &CReader::RemoveRelationToRead) + .function("SetStrictModeActive", &CReader::SetStrictModeActive) + .function("GetStrictModeActive", &CReader::GetStrictModeActive) + .function("GetWarning", &wrap_Reader_GetWarning) + .function("GetWarningCount", &CReader::GetWarningCount) + // .function("AddKeyWrappingCallback", &wrap_Reader_AddKeyWrappingCallback) // Skipped due to callback + // .function("SetContentEncryptionCallback", &wrap_Reader_SetContentEncryptionCallback) // Skipped due to callback + ; + class_>("CPackagePart") + .smart_ptr>("shared_ptr") + .function("GetPath", &CPackagePart::GetPath) + .function("SetPath", &CPackagePart::SetPath) + ; + class_>("CResource") + .smart_ptr>("shared_ptr") + .function("GetResourceID", &CResource::GetResourceID) + .function("GetUniqueResourceID", &CResource::GetUniqueResourceID) + .function("PackagePart", &CResource::PackagePart) + .function("SetPackagePart", &wrap_Resource_SetPackagePart) + .function("GetModelResourceID", &CResource::GetModelResourceID) + ; + class_>("CResourceIterator") + .smart_ptr>("shared_ptr") + .function("MoveNext", &CResourceIterator::MoveNext) + .function("MovePrevious", &CResourceIterator::MovePrevious) + .function("GetCurrent", &CResourceIterator::GetCurrent) + .function("Clone", &CResourceIterator::Clone) + .function("Count", &CResourceIterator::Count) + ; + class_>("CSliceStackIterator") + .smart_ptr>("shared_ptr") + .function("GetCurrentSliceStack", &CSliceStackIterator::GetCurrentSliceStack) + ; + class_>("CObjectIterator") + .smart_ptr>("shared_ptr") + .function("GetCurrentObject", &CObjectIterator::GetCurrentObject) + ; + class_>("CMeshObjectIterator") + .smart_ptr>("shared_ptr") + .function("GetCurrentMeshObject", &CMeshObjectIterator::GetCurrentMeshObject) + ; + class_>("CComponentsObjectIterator") + .smart_ptr>("shared_ptr") + .function("GetCurrentComponentsObject", &CComponentsObjectIterator::GetCurrentComponentsObject) + ; + class_>("CBooleanObjectIterator") + .smart_ptr>("shared_ptr") + .function("GetCurrentBooleanObject", &CBooleanObjectIterator::GetCurrentBooleanObject) + ; + class_>("CTexture2DIterator") + .smart_ptr>("shared_ptr") + .function("GetCurrentTexture2D", &CTexture2DIterator::GetCurrentTexture2D) + ; + class_>("CBaseMaterialGroupIterator") + .smart_ptr>("shared_ptr") + .function("GetCurrentBaseMaterialGroup", &CBaseMaterialGroupIterator::GetCurrentBaseMaterialGroup) + ; + class_>("CColorGroupIterator") + .smart_ptr>("shared_ptr") + .function("GetCurrentColorGroup", &CColorGroupIterator::GetCurrentColorGroup) + ; + class_>("CTexture2DGroupIterator") + .smart_ptr>("shared_ptr") + .function("GetCurrentTexture2DGroup", &CTexture2DGroupIterator::GetCurrentTexture2DGroup) + ; + class_>("CCompositeMaterialsIterator") + .smart_ptr>("shared_ptr") + .function("GetCurrentCompositeMaterials", &CCompositeMaterialsIterator::GetCurrentCompositeMaterials) + ; + class_>("CMultiPropertyGroupIterator") + .smart_ptr>("shared_ptr") + .function("GetCurrentMultiPropertyGroup", &CMultiPropertyGroupIterator::GetCurrentMultiPropertyGroup) + ; + class_>("CImage3DIterator") + .smart_ptr>("shared_ptr") + .function("GetCurrentImage3D", &CImage3DIterator::GetCurrentImage3D) + ; + class_>("CFunctionIterator") + .smart_ptr>("shared_ptr") + .function("GetCurrentFunction", &CFunctionIterator::GetCurrentFunction) + ; + class_>("CLevelSetIterator") + .smart_ptr>("shared_ptr") + .function("GetCurrentLevelSet", &CLevelSetIterator::GetCurrentLevelSet) + ; + class_>("CMetaData") + .smart_ptr>("shared_ptr") + .function("GetNameSpace", &CMetaData::GetNameSpace) + .function("SetNameSpace", &CMetaData::SetNameSpace) + .function("GetName", &CMetaData::GetName) + .function("SetName", &CMetaData::SetName) + .function("GetKey", &CMetaData::GetKey) + .function("GetMustPreserve", &CMetaData::GetMustPreserve) + .function("SetMustPreserve", &CMetaData::SetMustPreserve) + .function("GetType", &CMetaData::GetType) + .function("SetType", &CMetaData::SetType) + .function("GetValue", &CMetaData::GetValue) + .function("SetValue", &CMetaData::SetValue) + ; + class_>("CMetaDataGroup") + .smart_ptr>("shared_ptr") + .function("GetMetaDataCount", &CMetaDataGroup::GetMetaDataCount) + .function("GetMetaData", &CMetaDataGroup::GetMetaData) + .function("GetMetaDataByKey", &CMetaDataGroup::GetMetaDataByKey) + .function("RemoveMetaDataByIndex", &CMetaDataGroup::RemoveMetaDataByIndex) + .function("RemoveMetaData", &wrap_MetaDataGroup_RemoveMetaData) + .function("AddMetaData", &CMetaDataGroup::AddMetaData) + ; + class_>("CTriangleSet") + .smart_ptr>("shared_ptr") + .function("SetName", &CTriangleSet::SetName) + .function("GetName", &CTriangleSet::GetName) + .function("SetIdentifier", &CTriangleSet::SetIdentifier) + .function("GetIdentifier", &CTriangleSet::GetIdentifier) + .function("AddTriangle", &CTriangleSet::AddTriangle) + .function("RemoveTriangle", &CTriangleSet::RemoveTriangle) + .function("Clear", &CTriangleSet::Clear) + .function("SetTriangleList", &CTriangleSet::SetTriangleList) + .function("GetTriangleList", &wrap_TriangleSet_GetTriangleList) + .function("AddTriangleList", &CTriangleSet::AddTriangleList) + .function("Merge", &wrap_TriangleSet_Merge) + .function("DeleteSet", &CTriangleSet::DeleteSet) + .function("Duplicate", &CTriangleSet::Duplicate) + ; + class_>("CObject") + .smart_ptr>("shared_ptr") + .function("GetType", &CObject::GetType) + .function("SetType", &CObject::SetType) + .function("GetName", &CObject::GetName) + .function("SetName", &CObject::SetName) + .function("GetPartNumber", &CObject::GetPartNumber) + .function("SetPartNumber", &CObject::SetPartNumber) + .function("IsMeshObject", &CObject::IsMeshObject) + .function("IsComponentsObject", &CObject::IsComponentsObject) + .function("IsLevelSetObject", &CObject::IsLevelSetObject) + .function("IsBooleanObject", &CObject::IsBooleanObject) + .function("IsValid", &CObject::IsValid) + .function("SetAttachmentAsThumbnail", &wrap_Object_SetAttachmentAsThumbnail) + .function("GetThumbnailAttachment", &CObject::GetThumbnailAttachment) + .function("ClearThumbnailAttachment", &CObject::ClearThumbnailAttachment) + .function("GetOutbox", &wrap_Object_GetOutbox) + .function("GetUUID", &wrap_Object_GetUUID) + .function("SetUUID", &CObject::SetUUID) + .function("GetMetaDataGroup", &CObject::GetMetaDataGroup) + .function("SetSlicesMeshResolution", &CObject::SetSlicesMeshResolution) + .function("GetSlicesMeshResolution", &CObject::GetSlicesMeshResolution) + .function("HasSlices", &CObject::HasSlices) + .function("ClearSliceStack", &CObject::ClearSliceStack) + .function("GetSliceStack", &CObject::GetSliceStack) + .function("AssignSliceStack", &wrap_Object_AssignSliceStack) + ; + class_>("CMeshObject") + .smart_ptr>("shared_ptr") + .function("GetVertexCount", &CMeshObject::GetVertexCount) + .function("GetTriangleCount", &CMeshObject::GetTriangleCount) + .function("GetVertex", &wrap_MeshObject_GetVertex) + .function("SetVertex", &wrap_MeshObject_SetVertex) + .function("AddVertex", &wrap_MeshObject_AddVertex) + .function("GetVertices", &wrap_MeshObject_GetVertices) + .function("GetTriangle", &wrap_MeshObject_GetTriangle) + .function("SetTriangle", &wrap_MeshObject_SetTriangle) + .function("AddTriangle", &wrap_MeshObject_AddTriangle) + .function("GetTriangleIndices", &wrap_MeshObject_GetTriangleIndices) + .function("SetObjectLevelProperty", &CMeshObject::SetObjectLevelProperty) + .function("GetObjectLevelProperty", &wrap_MeshObject_GetObjectLevelProperty) + .function("SetTriangleProperties", &wrap_MeshObject_SetTriangleProperties) + .function("GetTriangleProperties", &wrap_MeshObject_GetTriangleProperties) + .function("SetAllTriangleProperties", &wrap_MeshObject_SetAllTriangleProperties) + .function("GetAllTriangleProperties", &wrap_MeshObject_GetAllTriangleProperties) + .function("ClearAllProperties", &CMeshObject::ClearAllProperties) + .function("SetGeometry", &wrap_MeshObject_SetGeometry) + .function("IsManifoldAndOriented", &CMeshObject::IsManifoldAndOriented) + .function("BeamLattice", &CMeshObject::BeamLattice) + .function("GetVolumeData", &CMeshObject::GetVolumeData) + .function("SetVolumeData", &wrap_MeshObject_SetVolumeData) + .function("AddTriangleSet", &CMeshObject::AddTriangleSet) + .function("HasTriangleSet", &CMeshObject::HasTriangleSet) + .function("FindTriangleSet", &CMeshObject::FindTriangleSet) + .function("GetTriangleSetCount", &CMeshObject::GetTriangleSetCount) + .function("GetTriangleSet", &CMeshObject::GetTriangleSet) + ; + class_>("CLevelSet") + .smart_ptr>("shared_ptr") + .function("GetFunction", &CLevelSet::GetFunction) + .function("SetFunction", &wrap_LevelSet_SetFunction) + .function("GetTransform", &wrap_LevelSet_GetTransform) + .function("SetTransform", &wrap_LevelSet_SetTransform) + .function("GetChannelName", &CLevelSet::GetChannelName) + .function("SetChannelName", &CLevelSet::SetChannelName) + .function("SetMinFeatureSize", &CLevelSet::SetMinFeatureSize) + .function("GetMinFeatureSize", &CLevelSet::GetMinFeatureSize) + .function("SetFallBackValue", &CLevelSet::SetFallBackValue) + .function("GetFallBackValue", &CLevelSet::GetFallBackValue) + .function("SetMeshBBoxOnly", &CLevelSet::SetMeshBBoxOnly) + .function("GetMeshBBoxOnly", &CLevelSet::GetMeshBBoxOnly) + .function("SetMesh", &wrap_LevelSet_SetMesh) + .function("GetMesh", &CLevelSet::GetMesh) + .function("GetVolumeData", &CLevelSet::GetVolumeData) + .function("SetVolumeData", &wrap_LevelSet_SetVolumeData) + ; + class_>("CBooleanObject") + .smart_ptr>("shared_ptr") + .function("SetBaseObject", &wrap_BooleanObject_SetBaseObject) + .function("GetBaseObject", &CBooleanObject::GetBaseObject) + .function("SetBaseTransform", &wrap_BooleanObject_SetBaseTransform) + .function("GetBaseTransform", &wrap_BooleanObject_GetBaseTransform) + .function("SetOperation", &CBooleanObject::SetOperation) + .function("GetOperation", &CBooleanObject::GetOperation) + .function("SetCSGModeEnabled", &CBooleanObject::SetCSGModeEnabled) + .function("GetCSGModeEnabled", &CBooleanObject::GetCSGModeEnabled) + .function("SetExtractionGridResolution", &CBooleanObject::SetExtractionGridResolution) + .function("GetExtractionGridResolution", &CBooleanObject::GetExtractionGridResolution) + .function("GetOperandCount", &CBooleanObject::GetOperandCount) + .function("AddOperand", &wrap_BooleanObject_AddOperand) + .function("GetOperand", &wrap_BooleanObject_GetOperand) + .function("MergeToMeshObject", &CBooleanObject::MergeToMeshObject) + ; + class_>("CBeamLattice") + .smart_ptr>("shared_ptr") + .function("GetMinLength", &CBeamLattice::GetMinLength) + .function("SetMinLength", &CBeamLattice::SetMinLength) + .function("GetClipping", &wrap_BeamLattice_GetClipping) + .function("SetClipping", &CBeamLattice::SetClipping) + .function("GetRepresentation", &wrap_BeamLattice_GetRepresentation) + .function("SetRepresentation", &CBeamLattice::SetRepresentation) + .function("GetBallOptions", &wrap_BeamLattice_GetBallOptions) + .function("SetBallOptions", &CBeamLattice::SetBallOptions) + .function("GetBeamCount", &CBeamLattice::GetBeamCount) + .function("GetBeam", &wrap_BeamLattice_GetBeam) + .function("AddBeam", &wrap_BeamLattice_AddBeam) + .function("SetBeam", &wrap_BeamLattice_SetBeam) + .function("SetBeams", &wrap_BeamLattice_SetBeams) + .function("GetBeams", &wrap_BeamLattice_GetBeams) + .function("GetBallCount", &CBeamLattice::GetBallCount) + .function("GetBall", &wrap_BeamLattice_GetBall) + .function("AddBall", &wrap_BeamLattice_AddBall) + .function("SetBall", &wrap_BeamLattice_SetBall) + .function("SetBalls", &wrap_BeamLattice_SetBalls) + .function("GetBalls", &wrap_BeamLattice_GetBalls) + .function("GetBeamSetCount", &CBeamLattice::GetBeamSetCount) + .function("AddBeamSet", &CBeamLattice::AddBeamSet) + .function("GetBeamSet", &CBeamLattice::GetBeamSet) + ; + class_>("CFunctionReference") + .smart_ptr>("shared_ptr") + .function("GetFunctionResourceID", &CFunctionReference::GetFunctionResourceID) + .function("SetFunctionResourceID", &CFunctionReference::SetFunctionResourceID) + .function("GetTransform", &wrap_FunctionReference_GetTransform) + .function("SetTransform", &wrap_FunctionReference_SetTransform) + .function("GetChannelName", &CFunctionReference::GetChannelName) + .function("SetChannelName", &CFunctionReference::SetChannelName) + .function("SetMinFeatureSize", &CFunctionReference::SetMinFeatureSize) + .function("GetMinFeatureSize", &CFunctionReference::GetMinFeatureSize) + .function("SetFallBackValue", &CFunctionReference::SetFallBackValue) + .function("GetFallBackValue", &CFunctionReference::GetFallBackValue) + ; + class_>("CVolumeDataColor") + .smart_ptr>("shared_ptr") + ; + class_>("CMaterialMapping") + .smart_ptr>("shared_ptr") + ; + class_>("CVolumeDataComposite") + .smart_ptr>("shared_ptr") + .function("GetBaseMaterialGroup", &CVolumeDataComposite::GetBaseMaterialGroup) + .function("SetBaseMaterialGroup", &wrap_VolumeDataComposite_SetBaseMaterialGroup) + .function("GetMaterialMappingCount", &CVolumeDataComposite::GetMaterialMappingCount) + .function("GetMaterialMapping", &CVolumeDataComposite::GetMaterialMapping) + .function("AddMaterialMapping", &wrap_VolumeDataComposite_AddMaterialMapping) + .function("RemoveMaterialMapping", &CVolumeDataComposite::RemoveMaterialMapping) + ; + class_>("CVolumeDataProperty") + .smart_ptr>("shared_ptr") + .function("GetName", &CVolumeDataProperty::GetName) + .function("SetIsRequired", &CVolumeDataProperty::SetIsRequired) + .function("IsRequired", &CVolumeDataProperty::IsRequired) + ; + class_>("CVolumeData") + .smart_ptr>("shared_ptr") + .function("GetComposite", &CVolumeData::GetComposite) + .function("CreateNewComposite", &CVolumeData::CreateNewComposite) + .function("RemoveComposite", &CVolumeData::RemoveComposite) + .function("GetColor", &CVolumeData::GetColor) + .function("CreateNewColor", &wrap_VolumeData_CreateNewColor) + .function("RemoveColor", &CVolumeData::RemoveColor) + .function("GetPropertyCount", &CVolumeData::GetPropertyCount) + .function("GetProperty", &CVolumeData::GetProperty) + .function("AddPropertyFromFunction", &wrap_VolumeData_AddPropertyFromFunction) + .function("RemoveProperty", &CVolumeData::RemoveProperty) + ; + class_>("CComponent") + .smart_ptr>("shared_ptr") + .function("GetObjectResource", &CComponent::GetObjectResource) + .function("GetObjectResourceID", &CComponent::GetObjectResourceID) + .function("GetUUID", &wrap_Component_GetUUID) + .function("SetUUID", &CComponent::SetUUID) + .function("HasTransform", &CComponent::HasTransform) + .function("GetTransform", &wrap_Component_GetTransform) + .function("SetTransform", &wrap_Component_SetTransform) + ; + class_>("CComponentsObject") + .smart_ptr>("shared_ptr") + .function("AddComponent", &wrap_ComponentsObject_AddComponent) + .function("GetComponent", &CComponentsObject::GetComponent) + .function("GetComponentCount", &CComponentsObject::GetComponentCount) + ; + class_>("CBeamSet") + .smart_ptr>("shared_ptr") + .function("SetName", &CBeamSet::SetName) + .function("GetName", &CBeamSet::GetName) + .function("SetIdentifier", &CBeamSet::SetIdentifier) + .function("GetIdentifier", &CBeamSet::GetIdentifier) + .function("GetReferenceCount", &CBeamSet::GetReferenceCount) + .function("SetReferences", &CBeamSet::SetReferences) + .function("GetReferences", &wrap_BeamSet_GetReferences) + .function("GetBallReferenceCount", &CBeamSet::GetBallReferenceCount) + .function("SetBallReferences", &CBeamSet::SetBallReferences) + .function("GetBallReferences", &wrap_BeamSet_GetBallReferences) + ; + class_>("CBaseMaterialGroup") + .smart_ptr>("shared_ptr") + .function("GetCount", &CBaseMaterialGroup::GetCount) + .function("GetAllPropertyIDs", &wrap_BaseMaterialGroup_GetAllPropertyIDs) + .function("AddMaterial", &wrap_BaseMaterialGroup_AddMaterial) + .function("RemoveMaterial", &CBaseMaterialGroup::RemoveMaterial) + .function("GetName", &CBaseMaterialGroup::GetName) + .function("SetName", &CBaseMaterialGroup::SetName) + .function("SetDisplayColor", &wrap_BaseMaterialGroup_SetDisplayColor) + .function("GetDisplayColor", &wrap_BaseMaterialGroup_GetDisplayColor) + ; + class_>("CColorGroup") + .smart_ptr>("shared_ptr") + .function("GetCount", &CColorGroup::GetCount) + .function("GetAllPropertyIDs", &wrap_ColorGroup_GetAllPropertyIDs) + .function("AddColor", &wrap_ColorGroup_AddColor) + .function("RemoveColor", &CColorGroup::RemoveColor) + .function("SetColor", &wrap_ColorGroup_SetColor) + .function("GetColor", &wrap_ColorGroup_GetColor) + ; + class_>("CTexture2DGroup") + .smart_ptr>("shared_ptr") + .function("GetCount", &CTexture2DGroup::GetCount) + .function("GetAllPropertyIDs", &wrap_Texture2DGroup_GetAllPropertyIDs) + .function("AddTex2Coord", &wrap_Texture2DGroup_AddTex2Coord) + .function("GetTex2Coord", &wrap_Texture2DGroup_GetTex2Coord) + .function("RemoveTex2Coord", &CTexture2DGroup::RemoveTex2Coord) + .function("GetTexture2D", &CTexture2DGroup::GetTexture2D) + ; + class_>("CCompositeMaterials") + .smart_ptr>("shared_ptr") + .function("GetCount", &CCompositeMaterials::GetCount) + .function("GetAllPropertyIDs", &wrap_CompositeMaterials_GetAllPropertyIDs) + .function("GetBaseMaterialGroup", &CCompositeMaterials::GetBaseMaterialGroup) + .function("AddComposite", &wrap_CompositeMaterials_AddComposite) + .function("RemoveComposite", &CCompositeMaterials::RemoveComposite) + .function("GetComposite", &wrap_CompositeMaterials_GetComposite) + ; + class_>("CMultiPropertyGroup") + .smart_ptr>("shared_ptr") + .function("GetCount", &CMultiPropertyGroup::GetCount) + .function("GetAllPropertyIDs", &wrap_MultiPropertyGroup_GetAllPropertyIDs) + .function("AddMultiProperty", &CMultiPropertyGroup::AddMultiProperty) + .function("SetMultiProperty", &CMultiPropertyGroup::SetMultiProperty) + .function("GetMultiProperty", &wrap_MultiPropertyGroup_GetMultiProperty) + .function("RemoveMultiProperty", &CMultiPropertyGroup::RemoveMultiProperty) + .function("GetLayerCount", &CMultiPropertyGroup::GetLayerCount) + .function("AddLayer", &wrap_MultiPropertyGroup_AddLayer) + .function("GetLayer", &wrap_MultiPropertyGroup_GetLayer) + .function("RemoveLayer", &CMultiPropertyGroup::RemoveLayer) + ; + class_>("CImage3D") + .smart_ptr>("shared_ptr") + .function("GetName", &CImage3D::GetName) + .function("SetName", &CImage3D::SetName) + .function("IsImageStack", &CImage3D::IsImageStack) + ; + class_>("CImageStack") + .smart_ptr>("shared_ptr") + .function("GetRowCount", &CImageStack::GetRowCount) + .function("SetRowCount", &CImageStack::SetRowCount) + .function("GetColumnCount", &CImageStack::GetColumnCount) + .function("SetColumnCount", &CImageStack::SetColumnCount) + .function("GetSheetCount", &CImageStack::GetSheetCount) + .function("GetSheet", &CImageStack::GetSheet) + .function("SetSheet", &wrap_ImageStack_SetSheet) + .function("CreateEmptySheet", &CImageStack::CreateEmptySheet) + .function("CreateSheetFromBuffer", &CImageStack::CreateSheetFromBuffer) + .function("CreateSheetFromFile", &CImageStack::CreateSheetFromFile) + ; + class_>("CAttachment") + .smart_ptr>("shared_ptr") + .function("GetPath", &CAttachment::GetPath) + .function("SetPath", &CAttachment::SetPath) + .function("PackagePart", &CAttachment::PackagePart) + .function("GetRelationShipType", &CAttachment::GetRelationShipType) + .function("SetRelationShipType", &CAttachment::SetRelationShipType) + .function("WriteToFile", &CAttachment::WriteToFile) + .function("ReadFromFile", &CAttachment::ReadFromFile) + // .function("ReadFromCallback", &wrap_Attachment_ReadFromCallback) // Skipped due to callback + .function("GetStreamSize", &CAttachment::GetStreamSize) + .function("WriteToBuffer", &wrap_Attachment_WriteToBuffer) + .function("ReadFromBuffer", &CAttachment::ReadFromBuffer) + ; + class_>("CTexture2D") + .smart_ptr>("shared_ptr") + .function("GetAttachment", &CTexture2D::GetAttachment) + .function("SetAttachment", &wrap_Texture2D_SetAttachment) + .function("GetContentType", &CTexture2D::GetContentType) + .function("SetContentType", &CTexture2D::SetContentType) + .function("GetTileStyleUV", &wrap_Texture2D_GetTileStyleUV) + .function("SetTileStyleUV", &CTexture2D::SetTileStyleUV) + .function("GetFilter", &CTexture2D::GetFilter) + .function("SetFilter", &CTexture2D::SetFilter) + ; + class_>("CImplicitPort") + .smart_ptr>("shared_ptr") + .function("GetIdentifier", &CImplicitPort::GetIdentifier) + .function("SetIdentifier", &CImplicitPort::SetIdentifier) + .function("GetDisplayName", &CImplicitPort::GetDisplayName) + .function("SetDisplayName", &CImplicitPort::SetDisplayName) + .function("SetType", &CImplicitPort::SetType) + .function("GetType", &CImplicitPort::GetType) + .function("GetReference", &CImplicitPort::GetReference) + .function("SetReference", &CImplicitPort::SetReference) + ; + class_>("CIterator") + .smart_ptr>("shared_ptr") + .function("MoveNext", &CIterator::MoveNext) + .function("MovePrevious", &CIterator::MovePrevious) + .function("Count", &CIterator::Count) + ; + class_>("CImplicitPortIterator") + .smart_ptr>("shared_ptr") + .function("GetCurrent", &CImplicitPortIterator::GetCurrent) + ; + class_>("CImplicitNode") + .smart_ptr>("shared_ptr") + .function("GetIdentifier", &CImplicitNode::GetIdentifier) + .function("SetIdentifier", &CImplicitNode::SetIdentifier) + .function("GetDisplayName", &CImplicitNode::GetDisplayName) + .function("SetDisplayName", &CImplicitNode::SetDisplayName) + .function("GetTag", &CImplicitNode::GetTag) + .function("SetTag", &CImplicitNode::SetTag) + .function("GetNodeType", &CImplicitNode::GetNodeType) + .function("AddInput", &CImplicitNode::AddInput) + .function("GetInputs", &CImplicitNode::GetInputs) + .function("AddOutput", &CImplicitNode::AddOutput) + .function("GetOutputs", &CImplicitNode::GetOutputs) + .function("FindInput", &CImplicitNode::FindInput) + .function("FindOutput", &CImplicitNode::FindOutput) + .function("AreTypesValid", &CImplicitNode::AreTypesValid) + ; + class_>("COneInputNode") + .smart_ptr>("shared_ptr") + .function("GetInputA", &COneInputNode::GetInputA) + .function("GetOutputResult", &COneInputNode::GetOutputResult) + ; + class_>("CSinNode") + .smart_ptr>("shared_ptr") + ; + class_>("CCosNode") + .smart_ptr>("shared_ptr") + ; + class_>("CTanNode") + .smart_ptr>("shared_ptr") + ; + class_>("CArcSinNode") + .smart_ptr>("shared_ptr") + ; + class_>("CArcCosNode") + .smart_ptr>("shared_ptr") + ; + class_>("CArcTanNode") + .smart_ptr>("shared_ptr") + ; + class_>("CSinhNode") + .smart_ptr>("shared_ptr") + ; + class_>("CCoshNode") + .smart_ptr>("shared_ptr") + ; + class_>("CTanhNode") + .smart_ptr>("shared_ptr") + ; + class_>("CRoundNode") + .smart_ptr>("shared_ptr") + ; + class_>("CCeilNode") + .smart_ptr>("shared_ptr") + ; + class_>("CFloorNode") + .smart_ptr>("shared_ptr") + ; + class_>("CSignNode") + .smart_ptr>("shared_ptr") + ; + class_>("CFractNode") + .smart_ptr>("shared_ptr") + ; + class_>("CAbsNode") + .smart_ptr>("shared_ptr") + ; + class_>("CExpNode") + .smart_ptr>("shared_ptr") + ; + class_>("CLogNode") + .smart_ptr>("shared_ptr") + ; + class_>("CLog2Node") + .smart_ptr>("shared_ptr") + ; + class_>("CLog10Node") + .smart_ptr>("shared_ptr") + ; + class_>("CLengthNode") + .smart_ptr>("shared_ptr") + ; + class_>("CTransposeNode") + .smart_ptr>("shared_ptr") + ; + class_>("CInverseNode") + .smart_ptr>("shared_ptr") + ; + class_>("CSqrtNode") + .smart_ptr>("shared_ptr") + ; + class_>("CResourceIdNode") + .smart_ptr>("shared_ptr") + .function("SetResource", &wrap_ResourceIdNode_SetResource) + .function("GetResource", &CResourceIdNode::GetResource) + .function("GetOutputValue", &CResourceIdNode::GetOutputValue) + ; + class_>("CTwoInputNode") + .smart_ptr>("shared_ptr") + .function("GetInputB", &CTwoInputNode::GetInputB) + ; + class_>("CAdditionNode") + .smart_ptr>("shared_ptr") + ; + class_>("CSubtractionNode") + .smart_ptr>("shared_ptr") + ; + class_>("CMultiplicationNode") + .smart_ptr>("shared_ptr") + ; + class_>("CDivisionNode") + .smart_ptr>("shared_ptr") + ; + class_>("CDotNode") + .smart_ptr>("shared_ptr") + ; + class_>("CCrossNode") + .smart_ptr>("shared_ptr") + ; + class_>("CArcTan2Node") + .smart_ptr>("shared_ptr") + ; + class_>("CMatVecMultiplicationNode") + .smart_ptr>("shared_ptr") + ; + class_>("CMinNode") + .smart_ptr>("shared_ptr") + ; + class_>("CMaxNode") + .smart_ptr>("shared_ptr") + ; + class_>("CFmodNode") + .smart_ptr>("shared_ptr") + ; + class_>("CModNode") + .smart_ptr>("shared_ptr") + ; + class_>("CPowNode") + .smart_ptr>("shared_ptr") + ; + class_>("CSelectNode") + .smart_ptr>("shared_ptr") + .function("GetInputB", &CSelectNode::GetInputB) + .function("GetInputC", &CSelectNode::GetInputC) + .function("GetInputD", &CSelectNode::GetInputD) + ; + class_>("CClampNode") + .smart_ptr>("shared_ptr") + .function("GetInputMin", &CClampNode::GetInputMin) + .function("GetInputMax", &CClampNode::GetInputMax) + ; + class_>("CComposeVectorNode") + .smart_ptr>("shared_ptr") + .function("GetInputX", &CComposeVectorNode::GetInputX) + .function("GetInputY", &CComposeVectorNode::GetInputY) + .function("GetInputZ", &CComposeVectorNode::GetInputZ) + .function("GetOutputResult", &CComposeVectorNode::GetOutputResult) + ; + class_>("CVectorFromScalarNode") + .smart_ptr>("shared_ptr") + ; + class_>("CDecomposeVectorNode") + .smart_ptr>("shared_ptr") + .function("GetInputA", &CDecomposeVectorNode::GetInputA) + .function("GetOutputX", &CDecomposeVectorNode::GetOutputX) + .function("GetOutputY", &CDecomposeVectorNode::GetOutputY) + .function("GetOutputZ", &CDecomposeVectorNode::GetOutputZ) + ; + class_>("CComposeMatrixNode") + .smart_ptr>("shared_ptr") + .function("GetInputM00", &CComposeMatrixNode::GetInputM00) + .function("GetInputM01", &CComposeMatrixNode::GetInputM01) + .function("GetInputM02", &CComposeMatrixNode::GetInputM02) + .function("GetInputM03", &CComposeMatrixNode::GetInputM03) + .function("GetInputM10", &CComposeMatrixNode::GetInputM10) + .function("GetInputM11", &CComposeMatrixNode::GetInputM11) + .function("GetInputM12", &CComposeMatrixNode::GetInputM12) + .function("GetInputM13", &CComposeMatrixNode::GetInputM13) + .function("GetInputM20", &CComposeMatrixNode::GetInputM20) + .function("GetInputM21", &CComposeMatrixNode::GetInputM21) + .function("GetInputM22", &CComposeMatrixNode::GetInputM22) + .function("GetInputM23", &CComposeMatrixNode::GetInputM23) + .function("GetInputM30", &CComposeMatrixNode::GetInputM30) + .function("GetInputM31", &CComposeMatrixNode::GetInputM31) + .function("GetInputM32", &CComposeMatrixNode::GetInputM32) + .function("GetInputM33", &CComposeMatrixNode::GetInputM33) + .function("GetOutputResult", &CComposeMatrixNode::GetOutputResult) + ; + class_>("CMatrixFromRowsNode") + .smart_ptr>("shared_ptr") + .function("GetInputA", &CMatrixFromRowsNode::GetInputA) + .function("GetInputB", &CMatrixFromRowsNode::GetInputB) + .function("GetInputC", &CMatrixFromRowsNode::GetInputC) + .function("GetInputD", &CMatrixFromRowsNode::GetInputD) + .function("GetOutputResult", &CMatrixFromRowsNode::GetOutputResult) + ; + class_>("CMatrixFromColumnsNode") + .smart_ptr>("shared_ptr") + .function("GetInputA", &CMatrixFromColumnsNode::GetInputA) + .function("GetInputB", &CMatrixFromColumnsNode::GetInputB) + .function("GetInputC", &CMatrixFromColumnsNode::GetInputC) + .function("GetInputD", &CMatrixFromColumnsNode::GetInputD) + .function("GetOutputResult", &CMatrixFromColumnsNode::GetOutputResult) + ; + class_>("CConstantNode") + .smart_ptr>("shared_ptr") + .function("SetConstant", &CConstantNode::SetConstant) + .function("GetConstant", &CConstantNode::GetConstant) + .function("GetOutputValue", &CConstantNode::GetOutputValue) + ; + class_>("CConstVecNode") + .smart_ptr>("shared_ptr") + .function("SetVector", &wrap_ConstVecNode_SetVector) + .function("GetVector", &wrap_ConstVecNode_GetVector) + .function("GetOutputVector", &CConstVecNode::GetOutputVector) + ; + class_>("CConstMatNode") + .smart_ptr>("shared_ptr") + .function("SetMatrix", &wrap_ConstMatNode_SetMatrix) + .function("GetMatrix", &wrap_ConstMatNode_GetMatrix) + .function("GetOutputMatrix", &CConstMatNode::GetOutputMatrix) + ; + class_>("CMeshNode") + .smart_ptr>("shared_ptr") + .function("GetInputMesh", &CMeshNode::GetInputMesh) + .function("GetInputPos", &CMeshNode::GetInputPos) + .function("GetOutputDistance", &CMeshNode::GetOutputDistance) + ; + class_>("CUnsignedMeshNode") + .smart_ptr>("shared_ptr") + .function("GetInputMesh", &CUnsignedMeshNode::GetInputMesh) + .function("GetInputPos", &CUnsignedMeshNode::GetInputPos) + .function("GetOutputDistance", &CUnsignedMeshNode::GetOutputDistance) + ; + class_>("CBeamLatticeNode") + .smart_ptr>("shared_ptr") + .function("GetInputBeamLattice", &CBeamLatticeNode::GetInputBeamLattice) + .function("GetInputPos", &CBeamLatticeNode::GetInputPos) + .function("GetOutputDistance", &CBeamLatticeNode::GetOutputDistance) + .function("SetAccurateRange", &CBeamLatticeNode::SetAccurateRange) + .function("GetAccurateRange", &CBeamLatticeNode::GetAccurateRange) + ; + class_>("CFunctionGradientNode") + .smart_ptr>("shared_ptr") + .function("GetInputFunctionID", &CFunctionGradientNode::GetInputFunctionID) + .function("GetInputPos", &CFunctionGradientNode::GetInputPos) + .function("GetInputStep", &CFunctionGradientNode::GetInputStep) + .function("SetScalarOutputName", &CFunctionGradientNode::SetScalarOutputName) + .function("GetScalarOutputName", &CFunctionGradientNode::GetScalarOutputName) + .function("SetVectorInputName", &CFunctionGradientNode::SetVectorInputName) + .function("GetVectorInputName", &CFunctionGradientNode::GetVectorInputName) + .function("GetOutputNormalizedGradient", &CFunctionGradientNode::GetOutputNormalizedGradient) + .function("GetOutputGradient", &CFunctionGradientNode::GetOutputGradient) + .function("GetOutputMagnitude", &CFunctionGradientNode::GetOutputMagnitude) + ; + class_>("CNormalizeDistanceNode") + .smart_ptr>("shared_ptr") + .function("GetInputFunctionID", &CNormalizeDistanceNode::GetInputFunctionID) + .function("GetInputPos", &CNormalizeDistanceNode::GetInputPos) + .function("GetInputStep", &CNormalizeDistanceNode::GetInputStep) + .function("SetScalarOutputName", &CNormalizeDistanceNode::SetScalarOutputName) + .function("GetScalarOutputName", &CNormalizeDistanceNode::GetScalarOutputName) + .function("SetVectorInputName", &CNormalizeDistanceNode::SetVectorInputName) + .function("GetVectorInputName", &CNormalizeDistanceNode::GetVectorInputName) + .function("GetOutputResult", &CNormalizeDistanceNode::GetOutputResult) + ; + class_>("CFunctionCallNode") + .smart_ptr>("shared_ptr") + .function("GetInputFunctionID", &CFunctionCallNode::GetInputFunctionID) + ; + class_>("CNodeIterator") + .smart_ptr>("shared_ptr") + .function("GetCurrent", &CNodeIterator::GetCurrent) + ; + class_>("CFunction") + .smart_ptr>("shared_ptr") + .function("GetDisplayName", &CFunction::GetDisplayName) + .function("SetDisplayName", &CFunction::SetDisplayName) + .function("AddInput", &CFunction::AddInput) + .function("GetInputs", &CFunction::GetInputs) + .function("RemoveInput", &wrap_Function_RemoveInput) + .function("AddOutput", &CFunction::AddOutput) + .function("GetOutputs", &CFunction::GetOutputs) + .function("RemoveOutput", &wrap_Function_RemoveOutput) + .function("FindInput", &CFunction::FindInput) + .function("FindOutput", &CFunction::FindOutput) + ; + class_>("CImplicitFunction") + .smart_ptr>("shared_ptr") + .function("GetIdentifier", &CImplicitFunction::GetIdentifier) + .function("SetIdentifier", &CImplicitFunction::SetIdentifier) + .function("AddNode", &CImplicitFunction::AddNode) + .function("AddSinNode", &CImplicitFunction::AddSinNode) + .function("AddCosNode", &CImplicitFunction::AddCosNode) + .function("AddTanNode", &CImplicitFunction::AddTanNode) + .function("AddArcSinNode", &CImplicitFunction::AddArcSinNode) + .function("AddArcCosNode", &CImplicitFunction::AddArcCosNode) + .function("AddArcTan2Node", &CImplicitFunction::AddArcTan2Node) + .function("AddSinhNode", &CImplicitFunction::AddSinhNode) + .function("AddCoshNode", &CImplicitFunction::AddCoshNode) + .function("AddTanhNode", &CImplicitFunction::AddTanhNode) + .function("AddRoundNode", &CImplicitFunction::AddRoundNode) + .function("AddCeilNode", &CImplicitFunction::AddCeilNode) + .function("AddFloorNode", &CImplicitFunction::AddFloorNode) + .function("AddSignNode", &CImplicitFunction::AddSignNode) + .function("AddFractNode", &CImplicitFunction::AddFractNode) + .function("AddAbsNode", &CImplicitFunction::AddAbsNode) + .function("AddExpNode", &CImplicitFunction::AddExpNode) + .function("AddLogNode", &CImplicitFunction::AddLogNode) + .function("AddLog2Node", &CImplicitFunction::AddLog2Node) + .function("AddLog10Node", &CImplicitFunction::AddLog10Node) + .function("AddLengthNode", &CImplicitFunction::AddLengthNode) + .function("AddTransposeNode", &CImplicitFunction::AddTransposeNode) + .function("AddInverseNode", &CImplicitFunction::AddInverseNode) + .function("AddSqrtNode", &CImplicitFunction::AddSqrtNode) + .function("AddResourceIdNode", &CImplicitFunction::AddResourceIdNode) + .function("AddAdditionNode", &CImplicitFunction::AddAdditionNode) + .function("AddSubtractionNode", &CImplicitFunction::AddSubtractionNode) + .function("AddMultiplicationNode", &CImplicitFunction::AddMultiplicationNode) + .function("AddDivisionNode", &CImplicitFunction::AddDivisionNode) + .function("AddDotNode", &CImplicitFunction::AddDotNode) + .function("AddCrossNode", &CImplicitFunction::AddCrossNode) + .function("AddMatVecMultiplicationNode", &CImplicitFunction::AddMatVecMultiplicationNode) + .function("AddMinNode", &CImplicitFunction::AddMinNode) + .function("AddMaxNode", &CImplicitFunction::AddMaxNode) + .function("AddFmodNode", &CImplicitFunction::AddFmodNode) + .function("AddPowNode", &CImplicitFunction::AddPowNode) + .function("AddSelectNode", &CImplicitFunction::AddSelectNode) + .function("AddClampNode", &CImplicitFunction::AddClampNode) + .function("AddComposeVectorNode", &CImplicitFunction::AddComposeVectorNode) + .function("AddVectorFromScalarNode", &CImplicitFunction::AddVectorFromScalarNode) + .function("AddDecomposeVectorNode", &CImplicitFunction::AddDecomposeVectorNode) + .function("AddComposeMatrixNode", &CImplicitFunction::AddComposeMatrixNode) + .function("AddMatrixFromRowsNode", &CImplicitFunction::AddMatrixFromRowsNode) + .function("AddMatrixFromColumnsNode", &CImplicitFunction::AddMatrixFromColumnsNode) + .function("AddConstantNode", &CImplicitFunction::AddConstantNode) + .function("AddConstVecNode", &CImplicitFunction::AddConstVecNode) + .function("AddConstMatNode", &CImplicitFunction::AddConstMatNode) + .function("AddMeshNode", &CImplicitFunction::AddMeshNode) + .function("AddUnsignedMeshNode", &CImplicitFunction::AddUnsignedMeshNode) + .function("AddBeamLatticeNode", &CImplicitFunction::AddBeamLatticeNode) + .function("AddFunctionGradientNode", &CImplicitFunction::AddFunctionGradientNode) + .function("AddNormalizeDistanceNode", &CImplicitFunction::AddNormalizeDistanceNode) + .function("AddFunctionCallNode", &CImplicitFunction::AddFunctionCallNode) + .function("GetNodes", &CImplicitFunction::GetNodes) + .function("RemoveNode", &wrap_ImplicitFunction_RemoveNode) + .function("AddLink", &wrap_ImplicitFunction_AddLink) + .function("AddLinkByNames", &CImplicitFunction::AddLinkByNames) + .function("Clear", &CImplicitFunction::Clear) + .function("SortNodesTopologically", &CImplicitFunction::SortNodesTopologically) + ; + class_>("CFunctionFromImage3D") + .smart_ptr>("shared_ptr") + .function("GetImage3D", &CFunctionFromImage3D::GetImage3D) + .function("SetImage3D", &wrap_FunctionFromImage3D_SetImage3D) + .function("SetFilter", &CFunctionFromImage3D::SetFilter) + .function("GetFilter", &CFunctionFromImage3D::GetFilter) + .function("SetTileStyles", &CFunctionFromImage3D::SetTileStyles) + .function("GetTileStyles", &wrap_FunctionFromImage3D_GetTileStyles) + .function("GetOffset", &CFunctionFromImage3D::GetOffset) + .function("SetOffset", &CFunctionFromImage3D::SetOffset) + .function("GetScale", &CFunctionFromImage3D::GetScale) + .function("SetScale", &CFunctionFromImage3D::SetScale) + ; + class_>("CBuildItem") + .smart_ptr>("shared_ptr") + .function("GetObjectResource", &CBuildItem::GetObjectResource) + .function("GetUUID", &wrap_BuildItem_GetUUID) + .function("SetUUID", &CBuildItem::SetUUID) + .function("GetObjectResourceID", &CBuildItem::GetObjectResourceID) + .function("HasObjectTransform", &CBuildItem::HasObjectTransform) + .function("GetObjectTransform", &wrap_BuildItem_GetObjectTransform) + .function("SetObjectTransform", &wrap_BuildItem_SetObjectTransform) + .function("GetPartNumber", &CBuildItem::GetPartNumber) + .function("SetPartNumber", &CBuildItem::SetPartNumber) + .function("GetMetaDataGroup", &CBuildItem::GetMetaDataGroup) + .function("GetOutbox", &wrap_BuildItem_GetOutbox) + ; + class_>("CBuildItemIterator") + .smart_ptr>("shared_ptr") + .function("MoveNext", &CBuildItemIterator::MoveNext) + .function("MovePrevious", &CBuildItemIterator::MovePrevious) + .function("GetCurrent", &CBuildItemIterator::GetCurrent) + .function("Clone", &CBuildItemIterator::Clone) + .function("Count", &CBuildItemIterator::Count) + ; + class_>("CSlice") + .smart_ptr>("shared_ptr") + .function("SetVertices", &wrap_Slice_SetVertices) + .function("GetVertices", &wrap_Slice_GetVertices) + .function("GetVertexCount", &CSlice::GetVertexCount) + .function("GetVertex", &wrap_Slice_GetVertex) + .function("AddPolygon", &CSlice::AddPolygon) + .function("GetPolygonCount", &CSlice::GetPolygonCount) + .function("SetPolygonIndices", &CSlice::SetPolygonIndices) + .function("GetPolygonIndices", &wrap_Slice_GetPolygonIndices) + .function("GetPolygonIndexCount", &CSlice::GetPolygonIndexCount) + .function("GetZTop", &CSlice::GetZTop) + ; + class_>("CSliceStack") + .smart_ptr>("shared_ptr") + .function("GetBottomZ", &CSliceStack::GetBottomZ) + .function("GetSliceCount", &CSliceStack::GetSliceCount) + .function("GetSlice", &CSliceStack::GetSlice) + .function("AddSlice", &CSliceStack::AddSlice) + .function("GetSliceRefCount", &CSliceStack::GetSliceRefCount) + .function("AddSliceStackReference", &wrap_SliceStack_AddSliceStackReference) + .function("GetSliceStackReference", &CSliceStack::GetSliceStackReference) + .function("CollapseSliceReferences", &CSliceStack::CollapseSliceReferences) + .function("SetOwnPath", &CSliceStack::SetOwnPath) + .function("GetOwnPath", &CSliceStack::GetOwnPath) + ; + class_>("CConsumer") + .smart_ptr>("shared_ptr") + .function("GetConsumerID", &CConsumer::GetConsumerID) + .function("GetKeyID", &CConsumer::GetKeyID) + .function("GetKeyValue", &CConsumer::GetKeyValue) + ; + class_>("CAccessRight") + .smart_ptr>("shared_ptr") + .function("GetConsumer", &CAccessRight::GetConsumer) + .function("GetWrappingAlgorithm", &CAccessRight::GetWrappingAlgorithm) + .function("GetMgfAlgorithm", &CAccessRight::GetMgfAlgorithm) + .function("GetDigestMethod", &CAccessRight::GetDigestMethod) + ; + class_>("CContentEncryptionParams") + .smart_ptr>("shared_ptr") + .function("GetEncryptionAlgorithm", &CContentEncryptionParams::GetEncryptionAlgorithm) + .function("GetKey", &wrap_ContentEncryptionParams_GetKey) + .function("GetInitializationVector", &wrap_ContentEncryptionParams_GetInitializationVector) + .function("GetAuthenticationTag", &wrap_ContentEncryptionParams_GetAuthenticationTag) + .function("SetAuthenticationTag", &CContentEncryptionParams::SetAuthenticationTag) + .function("GetAdditionalAuthenticationData", &wrap_ContentEncryptionParams_GetAdditionalAuthenticationData) + .function("GetDescriptor", &CContentEncryptionParams::GetDescriptor) + .function("GetKeyUUID", &CContentEncryptionParams::GetKeyUUID) + ; + class_>("CResourceData") + .smart_ptr>("shared_ptr") + .function("GetPath", &CResourceData::GetPath) + .function("GetEncryptionAlgorithm", &CResourceData::GetEncryptionAlgorithm) + .function("GetCompression", &CResourceData::GetCompression) + .function("GetAdditionalAuthenticationData", &wrap_ResourceData_GetAdditionalAuthenticationData) + ; + class_>("CResourceDataGroup") + .smart_ptr>("shared_ptr") + .function("GetKeyUUID", &CResourceDataGroup::GetKeyUUID) + .function("AddAccessRight", &wrap_ResourceDataGroup_AddAccessRight) + .function("FindAccessRightByConsumer", &wrap_ResourceDataGroup_FindAccessRightByConsumer) + .function("RemoveAccessRight", &wrap_ResourceDataGroup_RemoveAccessRight) + ; + class_>("CKeyStore") + .smart_ptr>("shared_ptr") + .function("AddConsumer", &CKeyStore::AddConsumer) + .function("GetConsumerCount", &CKeyStore::GetConsumerCount) + .function("GetConsumer", &CKeyStore::GetConsumer) + .function("RemoveConsumer", &wrap_KeyStore_RemoveConsumer) + .function("FindConsumer", &CKeyStore::FindConsumer) + .function("GetResourceDataGroupCount", &CKeyStore::GetResourceDataGroupCount) + .function("AddResourceDataGroup", &CKeyStore::AddResourceDataGroup) + .function("GetResourceDataGroup", &CKeyStore::GetResourceDataGroup) + .function("RemoveResourceDataGroup", &wrap_KeyStore_RemoveResourceDataGroup) + .function("FindResourceDataGroup", &wrap_KeyStore_FindResourceDataGroup) + .function("AddResourceData", &wrap_KeyStore_AddResourceData) + .function("RemoveResourceData", &wrap_KeyStore_RemoveResourceData) + .function("FindResourceData", &wrap_KeyStore_FindResourceData) + .function("GetResourceDataCount", &CKeyStore::GetResourceDataCount) + .function("GetResourceData", &CKeyStore::GetResourceData) + .function("GetUUID", &wrap_KeyStore_GetUUID) + .function("SetUUID", &CKeyStore::SetUUID) + ; + class_>("CModel") + .smart_ptr>("shared_ptr") + .function("RootModelPart", &CModel::RootModelPart) + .function("FindOrCreatePackagePart", &CModel::FindOrCreatePackagePart) + .function("SetUnit", &CModel::SetUnit) + .function("GetUnit", &CModel::GetUnit) + .function("GetLanguage", &CModel::GetLanguage) + .function("SetLanguage", &CModel::SetLanguage) + .function("QueryWriter", &CModel::QueryWriter) + .function("QueryReader", &CModel::QueryReader) + .function("GetResourceByID", &CModel::GetResourceByID) + .function("GetTexture2DByID", &CModel::GetTexture2DByID) + .function("GetPropertyTypeByID", &CModel::GetPropertyTypeByID) + .function("GetBaseMaterialGroupByID", &CModel::GetBaseMaterialGroupByID) + .function("GetTexture2DGroupByID", &CModel::GetTexture2DGroupByID) + .function("GetCompositeMaterialsByID", &CModel::GetCompositeMaterialsByID) + .function("GetMultiPropertyGroupByID", &CModel::GetMultiPropertyGroupByID) + .function("GetMeshObjectByID", &CModel::GetMeshObjectByID) + .function("GetComponentsObjectByID", &CModel::GetComponentsObjectByID) + .function("GetBooleanObjectByID", &CModel::GetBooleanObjectByID) + .function("GetColorGroupByID", &CModel::GetColorGroupByID) + .function("GetSliceStackByID", &CModel::GetSliceStackByID) + .function("GetLevelSetByID", &CModel::GetLevelSetByID) + .function("GetBuildUUID", &wrap_Model_GetBuildUUID) + .function("SetBuildUUID", &CModel::SetBuildUUID) + .function("GetBuildItems", &CModel::GetBuildItems) + .function("GetOutbox", &wrap_Model_GetOutbox) + .function("GetResources", &CModel::GetResources) + .function("GetObjects", &CModel::GetObjects) + .function("GetMeshObjects", &CModel::GetMeshObjects) + .function("GetComponentsObjects", &CModel::GetComponentsObjects) + .function("GetBooleanObjects", &CModel::GetBooleanObjects) + .function("GetTexture2Ds", &CModel::GetTexture2Ds) + .function("GetBaseMaterialGroups", &CModel::GetBaseMaterialGroups) + .function("GetColorGroups", &CModel::GetColorGroups) + .function("GetTexture2DGroups", &CModel::GetTexture2DGroups) + .function("GetCompositeMaterials", &CModel::GetCompositeMaterials) + .function("GetMultiPropertyGroups", &CModel::GetMultiPropertyGroups) + .function("GetSliceStacks", &CModel::GetSliceStacks) + .function("GetImage3Ds", &CModel::GetImage3Ds) + .function("MergeToModel", &CModel::MergeToModel) + .function("MergeFromModel", &wrap_Model_MergeFromModel) + .function("AddMeshObject", &CModel::AddMeshObject) + .function("AddComponentsObject", &CModel::AddComponentsObject) + .function("AddBooleanObject", &CModel::AddBooleanObject) + .function("AddSliceStack", &CModel::AddSliceStack) + .function("AddTexture2DFromAttachment", &wrap_Model_AddTexture2DFromAttachment) + .function("AddBaseMaterialGroup", &CModel::AddBaseMaterialGroup) + .function("AddColorGroup", &CModel::AddColorGroup) + .function("AddTexture2DGroup", &wrap_Model_AddTexture2DGroup) + .function("AddCompositeMaterials", &wrap_Model_AddCompositeMaterials) + .function("AddMultiPropertyGroup", &CModel::AddMultiPropertyGroup) + .function("AddImageStack", &CModel::AddImageStack) + .function("GetImageStackByID", &CModel::GetImageStackByID) + .function("AddBuildItem", &wrap_Model_AddBuildItem) + .function("RemoveBuildItem", &wrap_Model_RemoveBuildItem) + .function("GetMetaDataGroup", &CModel::GetMetaDataGroup) + .function("AddAttachment", &CModel::AddAttachment) + .function("RemoveAttachment", &wrap_Model_RemoveAttachment) + .function("GetAttachment", &CModel::GetAttachment) + .function("FindAttachment", &CModel::FindAttachment) + .function("GetAttachmentCount", &CModel::GetAttachmentCount) + .function("HasPackageThumbnailAttachment", &CModel::HasPackageThumbnailAttachment) + .function("CreatePackageThumbnailAttachment", &CModel::CreatePackageThumbnailAttachment) + .function("GetPackageThumbnailAttachment", &CModel::GetPackageThumbnailAttachment) + .function("RemovePackageThumbnailAttachment", &CModel::RemovePackageThumbnailAttachment) + .function("AddCustomContentType", &CModel::AddCustomContentType) + .function("RemoveCustomContentType", &CModel::RemoveCustomContentType) + // .function("SetRandomNumberCallback", &wrap_Model_SetRandomNumberCallback) // Skipped due to callback + .function("GetKeyStore", &CModel::GetKeyStore) + .function("GetFunctions", &CModel::GetFunctions) + .function("AddImplicitFunction", &CModel::AddImplicitFunction) + .function("AddFunctionFromImage3D", &wrap_Model_AddFunctionFromImage3D) + .function("AddVolumeData", &CModel::AddVolumeData) + .function("AddLevelSet", &CModel::AddLevelSet) + .function("GetLevelSets", &CModel::GetLevelSets) + .function("RemoveResource", &wrap_Model_RemoveResource) + ; + // CWrapper global bindings + class_("CWrapper") + .constructor<>() + .function("GetLibraryVersion", &wrap_Wrapper_GetLibraryVersion) + .function("GetPrereleaseInformation", &wrap_Wrapper_GetPrereleaseInformation) + .function("GetBuildInformation", &wrap_Wrapper_GetBuildInformation) + .function("GetSpecificationVersion", &wrap_Wrapper_GetSpecificationVersion) + .function("CreateModel", &CWrapper::CreateModel) + .function("Release", &wrap_Wrapper_Release) + .function("Acquire", &wrap_Wrapper_Acquire) + .function("SetJournal", &CWrapper::SetJournal) + .function("GetLastError", &wrap_Wrapper_GetLastError) + // .function("GetSymbolLookupMethod", &CWrapper::GetSymbolLookupMethod) // Explicitly skipped (Returns a void pointer) + .function("RetrieveProgressMessage", &wrap_Wrapper_RetrieveProgressMessage) + .function("RGBAToColor", &wrap_Wrapper_RGBAToColor) + .function("FloatRGBAToColor", &wrap_Wrapper_FloatRGBAToColor) + .function("ColorToRGBA", &wrap_Wrapper_ColorToRGBA) + .function("ColorToFloatRGBA", &wrap_Wrapper_ColorToFloatRGBA) + .function("GetIdentityTransform", &wrap_Wrapper_GetIdentityTransform) + .function("GetUniformScaleTransform", &wrap_Wrapper_GetUniformScaleTransform) + .function("GetScaleTransform", &wrap_Wrapper_GetScaleTransform) + .function("GetTranslationTransform", &wrap_Wrapper_GetTranslationTransform) + ; +} diff --git a/Autogenerated/Source/lib3mf_abi.hpp b/Autogenerated/Source/lib3mf_abi.hpp index b7f5c96da..b247b7351 100644 --- a/Autogenerated/Source/lib3mf_abi.hpp +++ b/Autogenerated/Source/lib3mf_abi.hpp @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++-Header file in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -497,6 +497,19 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobjectiterator_getcurrentmeshobject(Lib3 */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobjectiterator_getcurrentcomponentsobject(Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); +/************************************************************************************************************************* + Class definition for BooleanObjectIterator +**************************************************************************************************************************/ + +/** +* Returns the BooleanObject the iterator points at. +* +* @param[in] pBooleanObjectIterator - BooleanObjectIterator instance. +* @param[out] pResource - returns the BooleanObject instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobjectiterator_getcurrentbooleanobject(Lib3MF_BooleanObjectIterator pBooleanObjectIterator, Lib3MF_BooleanObject * pResource); + /************************************************************************************************************************* Class definition for Texture2DIterator **************************************************************************************************************************/ @@ -1011,6 +1024,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_iscomponentsobject(Lib3MF_Object pObj */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_islevelsetobject(Lib3MF_Object pObject, bool * pIsLevelSetObject); +/** +* Retrieves, if an object is a boolean object +* +* @param[in] pObject - Object instance. +* @param[out] pIsBooleanObject - returns, whether the object is a boolean object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_isbooleanobject(Lib3MF_Object pObject, bool * pIsBooleanObject); + /** * Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * @@ -1561,6 +1583,140 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_getvolumedata(Lib3MF_LevelSet pLeve */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_levelset_setvolumedata(Lib3MF_LevelSet pLevelSet, Lib3MF_VolumeData pTheVolumeData); +/************************************************************************************************************************* + Class definition for BooleanObject +**************************************************************************************************************************/ + +/** +* Sets the base object and transform for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pBaseObject - base object of the boolean shape +* @param[in] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_setbaseobject(Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object pBaseObject, const Lib3MF::sTransform * pTransform); + +/** +* Returns the base object of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pBaseObject - base object of the boolean shape +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getbaseobject(Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object * pBaseObject); + +/** +* Sets the base transform of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_setbasetransform(Lib3MF_BooleanObject pBooleanObject, const Lib3MF::sTransform * pTransform); + +/** +* Returns the base transform of the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pTransform - transform applied to the base object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getbasetransform(Lib3MF_BooleanObject pBooleanObject, Lib3MF::sTransform * pTransform); + +/** +* Sets the boolean operation used for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] eOperation - boolean operation used for the shape +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_setoperation(Lib3MF_BooleanObject pBooleanObject, Lib3MF::eBooleanOperation eOperation); + +/** +* Returns the boolean operation used for the boolean shape. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pOperation - boolean operation used for the shape +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getoperation(Lib3MF_BooleanObject pBooleanObject, Lib3MF::eBooleanOperation * pOperation); + +/** +* Enables or disables CSG field evaluation for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] bCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_setcsgmodeenabled(Lib3MF_BooleanObject pBooleanObject, bool bCSGModeEnabled); + +/** +* Returns whether CSG field evaluation is enabled for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getcsgmodeenabled(Lib3MF_BooleanObject pBooleanObject, bool * pCSGModeEnabled); + +/** +* Sets the extraction grid resolution used for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] nGridResolution - extraction grid resolution for boolean surface extraction +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_setextractiongridresolution(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nGridResolution); + +/** +* Returns the extraction grid resolution used for boolean-to-mesh materialization. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pGridResolution - extraction grid resolution for boolean surface extraction +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getextractiongridresolution(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pGridResolution); + +/** +* Returns the number of operands in the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pCount - number of operands in the boolean sequence +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getoperandcount(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pCount); + +/** +* Adds an operand object to the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] pOperandObject - mesh object used as operand +* @param[in] pTransform - transform applied to the operand object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_addoperand(Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject pOperandObject, const Lib3MF::sTransform * pTransform); + +/** +* Returns one operand object and transform from the boolean sequence. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[in] nIndex - index of the operand in the boolean sequence +* @param[out] pOperandObject - mesh object used as operand +* @param[out] pTransform - transform applied to the operand object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getoperand(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nIndex, Lib3MF_MeshObject * pOperandObject, Lib3MF::sTransform * pTransform); + +/** +* Materializes the boolean shape into a newly created mesh object. +* +* @param[in] pBooleanObject - BooleanObject instance. +* @param[out] pMeshObject - new mesh object containing the tessellated boolean shape +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_mergetomeshobject(Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject * pMeshObject); + /************************************************************************************************************************* Class definition for BeamLattice **************************************************************************************************************************/ @@ -1926,7 +2082,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_setbasematerialgroup(Lib LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_getmaterialmappingcount(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 * pCount); /** -* Returns MaterialMappting with given index +* Returns MaterialMapping with given index * * @param[in] pVolumeDataComposite - VolumeDataComposite instance. * @param[in] nIndex - Index of the MaterialMapping in question. @@ -1936,7 +2092,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_getmaterialmappingcount( LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedatacomposite_getmaterialmapping(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 nIndex, Lib3MF_MaterialMapping * pTheMaterialMapping); /** -* Adds a the MaterialMapping +* Adds a MaterialMapping * * @param[in] pVolumeDataComposite - VolumeDataComposite instance. * @param[in] pTransform - new transformation matrix @@ -2048,7 +2204,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedata_removecolor(Lib3MF_VolumeData pVo * Returns the number of VolumeDataProperty * * @param[in] pVolumeData - VolumeData instance. -* @param[out] pCount - the number of VolumeDataProperty-elements within this VolumdeData +* @param[out] pCount - the number of VolumeDataProperty-elements within this VolumeData * @return error code or 0 (success) */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_volumedata_getpropertycount(Lib3MF_VolumeData pVolumeData, Lib3MF_uint32 * pCount); @@ -2873,7 +3029,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_setrelationshiptype(Lib3MF_Attach LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAttachment, const char * pFileName); /** -* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * * @param[in] pAttachment - Attachment instance. * @param[in] pFileName - file to read from. @@ -2882,7 +3038,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAt LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfromfile(Lib3MF_Attachment pAttachment, const char * pFileName); /** -* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * * @param[in] pAttachment - Attachment instance. * @param[in] pTheReadCallback - Callback to call for reading a data chunk @@ -2914,7 +3070,7 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getstreamsize(Lib3MF_Attachment p LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetobuffer(Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); /** -* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* Reads an attachment from a memory buffer. This buffer is immediately read (in contrast to the ReadFromCallback and ReadFromFile-methods). * * @param[in] pAttachment - Attachment instance. * @param[in] nBufferBufferSize - Number of elements in buffer @@ -4026,6 +4182,233 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_unsignedmeshnode_getinputpos(Lib3MF_Unsigned */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_unsignedmeshnode_getoutputdistance(Lib3MF_UnsignedMeshNode pUnsignedMeshNode, Lib3MF_ImplicitPort * pDistance); +/************************************************************************************************************************* + Class definition for BeamLatticeNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the model resource id of the beam lattice +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pBeamLattice - the input port for the model resource id of the beam lattice (mesh with beamlattice extension) +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_getinputbeamlattice(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pBeamLattice); + +/** +* Retrieves the input for the position +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_getinputpos(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the output +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pDistance - the output port for the signed distance to the beam lattice +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_getoutputdistance(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pDistance); + +/** +* Sets the accurate range for distance computation +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[in] dAccurateRange - the accurate range in model units +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_setaccuraterange(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double dAccurateRange); + +/** +* Retrieves the accurate range for distance computation +* +* @param[in] pBeamLatticeNode - BeamLatticeNode instance. +* @param[out] pAccurateRange - the accurate range in model units +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlatticenode_getaccuraterange(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double * pAccurateRange); + +/************************************************************************************************************************* + Class definition for FunctionGradientNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the function id +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pFunction - the input port for the function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getinputfunctionid(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pFunction); + +/** +* Retrieves the input for the position +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pPos - the input port for the position +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getinputpos(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the input for the finite difference step +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pStep - the input port for the finite difference step +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getinputstep(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pStep); + +/** +* Sets the name of the referenced scalar output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] pScalarOutputName - the name of the scalar output of the referenced function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_setscalaroutputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pScalarOutputName); + +/** +* Retrieves the name of the referenced scalar output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getscalaroutputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + +/** +* Sets the name of the referenced vector input +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_setvectorinputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pVectorInputName); + +/** +* Retrieves the name of the referenced vector input +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getvectorinputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + +/** +* Retrieves the normalized gradient output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pNormalizedGradient - the output port for the normalized gradient +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getoutputnormalizedgradient(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pNormalizedGradient); + +/** +* Retrieves the raw gradient output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pGradient - the output port for the raw gradient +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getoutputgradient(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pGradient); + +/** +* Retrieves the gradient magnitude output +* +* @param[in] pFunctionGradientNode - FunctionGradientNode instance. +* @param[out] pMagnitude - the output port for the gradient magnitude +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_functiongradientnode_getoutputmagnitude(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pMagnitude); + +/************************************************************************************************************************* + Class definition for NormalizeDistanceNode +**************************************************************************************************************************/ + +/** +* Retrieves the input for the function id +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pFunction - the input port for the function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getinputfunctionid(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pFunction); + +/** +* Retrieves the input for the position +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pPos - the input port for the position (vector) +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getinputpos(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pPos); + +/** +* Retrieves the input for the finite difference step +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pStep - the input port for the finite difference step +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getinputstep(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pStep); + +/** +* Sets the name of the referenced scalar output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] pScalarOutputName - the name of the scalar output of the referenced function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_setscalaroutputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pScalarOutputName); + +/** +* Retrieves the name of the referenced scalar output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] nScalarOutputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pScalarOutputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pScalarOutputNameBuffer - buffer of the name of the scalar output of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getscalaroutputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer); + +/** +* Sets the name of the referenced vector input +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] pVectorInputName - the name of the vector input (float3) of the referenced function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_setvectorinputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pVectorInputName); + +/** +* Retrieves the name of the referenced vector input +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[in] nVectorInputNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pVectorInputNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVectorInputNameBuffer - buffer of the name of the vector input (float3) of the referenced function, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getvectorinputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer); + +/** +* Retrieves the normalized result output +* +* @param[in] pNormalizeDistanceNode - NormalizeDistanceNode instance. +* @param[out] pResult - the output port for the normalized distance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_normalizedistancenode_getoutputresult(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pResult); + /************************************************************************************************************************* Class definition for FunctionCallNode **************************************************************************************************************************/ @@ -4801,6 +5184,42 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addmeshnode(Lib3MF_Implicit */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addunsignedmeshnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_UnsignedMeshNode * pNode); +/** +* Add a BeamLatticeNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addbeamlatticenode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_BeamLatticeNode * pNode); + +/** +* Add a FunctionGradientNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addfunctiongradientnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_FunctionGradientNode * pNode); + +/** +* Add a NormalizeDistanceNode +* +* @param[in] pImplicitFunction - ImplicitFunction instance. +* @param[in] pIdentifier - the identifier of the node +* @param[in] pDisplayName - the display name of the node +* @param[in] pTag - the tag of the node +* @param[out] pNode - the added node +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_implicitfunction_addnormalizedistancenode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_NormalizeDistanceNode * pNode); + /** * Add a FunctionCallNode * @@ -5915,6 +6334,16 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getmeshobjectbyid(Lib3MF_Model pModel, */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getcomponentsobjectbyid(Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_ComponentsObject * pComponentsObjectInstance); +/** +* finds a boolean object by its UniqueResourceID +* +* @param[in] pModel - Model instance. +* @param[in] nUniqueResourceID - UniqueResourceID +* @param[out] pBooleanObjectInstance - returns the boolean object instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getbooleanobjectbyid(Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_BooleanObject * pBooleanObjectInstance); + /** * finds a model color group by its UniqueResourceID * @@ -6020,6 +6449,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getmeshobjects(Lib3MF_Model pModel, Li */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getcomponentsobjects(Lib3MF_Model pModel, Lib3MF_ComponentsObjectIterator * pResourceIterator); +/** +* creates a resource iterator instance with all boolean object resources. +* +* @param[in] pModel - Model instance. +* @param[out] pResourceIterator - returns the iterator instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getbooleanobjects(Lib3MF_Model pModel, Lib3MF_BooleanObjectIterator * pResourceIterator); + /** * creates a Texture2DIterator instance with all texture2d resources. * @@ -6128,6 +6566,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addmeshobject(Lib3MF_Model pModel, Lib */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addcomponentsobject(Lib3MF_Model pModel, Lib3MF_ComponentsObject * pComponentsObjectInstance); +/** +* adds an empty boolean object to the model. +* +* @param[in] pModel - Model instance. +* @param[out] pBooleanObjectInstance - returns the boolean object instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addbooleanobject(Lib3MF_Model pModel, Lib3MF_BooleanObject * pBooleanObjectInstance); + /** * creates a new model slicestack by its id * diff --git a/Autogenerated/Source/lib3mf_interfaceexception.cpp b/Autogenerated/Source/lib3mf_interfaceexception.cpp index 12488ed95..29b472b15 100644 --- a/Autogenerated/Source/lib3mf_interfaceexception.cpp +++ b/Autogenerated/Source/lib3mf_interfaceexception.cpp @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++ Implementation file with the basic internal exception type in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ diff --git a/Autogenerated/Source/lib3mf_interfaceexception.hpp b/Autogenerated/Source/lib3mf_interfaceexception.hpp index b49854f94..e84ae8dba 100644 --- a/Autogenerated/Source/lib3mf_interfaceexception.hpp +++ b/Autogenerated/Source/lib3mf_interfaceexception.hpp @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++ Header file with the basic internal exception type in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ diff --git a/Autogenerated/Source/lib3mf_interfacejournal.cpp b/Autogenerated/Source/lib3mf_interfacejournal.cpp index 360f0748e..352b7774d 100644 --- a/Autogenerated/Source/lib3mf_interfacejournal.cpp +++ b/Autogenerated/Source/lib3mf_interfacejournal.cpp @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++ implementation file in order to allow easy development of the 3MF Library. It provides an automatic Journaling mechanism for the library implementation. -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -286,7 +286,7 @@ CLib3MFInterfaceJournal::CLib3MFInterfaceJournal (const std::string & sFileName) m_StartTime = std::chrono::high_resolution_clock::now(); m_Stream.open (sFileName, std::ios::out); m_Stream << "\n"; - m_Stream << "\n"; + m_Stream << "\n"; m_Stream << "\n"; } diff --git a/Autogenerated/Source/lib3mf_interfacejournal.hpp b/Autogenerated/Source/lib3mf_interfacejournal.hpp index 6916263e2..22faf6631 100644 --- a/Autogenerated/Source/lib3mf_interfacejournal.hpp +++ b/Autogenerated/Source/lib3mf_interfacejournal.hpp @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++ header file in order to allow easy development of the 3MF Library. It provides an automatic Journaling mechanism for the library implementation. -Interface version: 2.4.0 +Interface version: 2.6.0 */ diff --git a/Autogenerated/Source/lib3mf_interfaces.hpp b/Autogenerated/Source/lib3mf_interfaces.hpp index 5707b666f..9a71c58f6 100644 --- a/Autogenerated/Source/lib3mf_interfaces.hpp +++ b/Autogenerated/Source/lib3mf_interfaces.hpp @@ -24,13 +24,13 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++ header file in order to allow easy development of the 3MF Library. The implementer of the 3MF Library needs to derive concrete classes from the abstract classes in this header. -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -61,6 +61,7 @@ class ISliceStackIterator; class IObjectIterator; class IMeshObjectIterator; class IComponentsObjectIterator; +class IBooleanObjectIterator; class ITexture2DIterator; class IBaseMaterialGroupIterator; class IColorGroupIterator; @@ -76,6 +77,7 @@ class ITriangleSet; class IObject; class IMeshObject; class ILevelSet; +class IBooleanObject; class IBeamLattice; class IFunctionReference; class IVolumeDataColor; @@ -151,6 +153,9 @@ class IConstVecNode; class IConstMatNode; class IMeshNode; class IUnsignedMeshNode; +class IBeamLatticeNode; +class IFunctionGradientNode; +class INormalizeDistanceNode; class IFunctionCallNode; class INodeIterator; class IFunction; @@ -257,7 +262,7 @@ template class ParameterCache_4 : publi **************************************************************************************************************************/ class IBase { -private: +protected: std::unique_ptr m_ParameterCache; public: /** @@ -819,6 +824,32 @@ class IComponentsObjectIterator : public virtual IResourceIterator { typedef IBaseSharedPtr PIComponentsObjectIterator; +/************************************************************************************************************************* + Class interface for BooleanObjectIterator +**************************************************************************************************************************/ + +class IBooleanObjectIterator : public virtual IResourceIterator { +public: + /** + * IBooleanObjectIterator::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer + */ + Lib3MF_uint64 ClassTypeId() override + { + return 0xAFF01F512E1FF6AEUL; // First 64 bits of SHA1 of a string: "Lib3MF::BooleanObjectIterator" + } + + /** + * IBooleanObjectIterator::GetCurrentBooleanObject - Returns the BooleanObject the iterator points at. + * @return returns the BooleanObject instance. + */ + virtual IBooleanObject * GetCurrentBooleanObject() = 0; + +}; + +typedef IBaseSharedPtr PIBooleanObjectIterator; + + /************************************************************************************************************************* Class interface for Texture2DIterator **************************************************************************************************************************/ @@ -1374,6 +1405,12 @@ class IObject : public virtual IResource { */ virtual bool IsLevelSetObject() = 0; + /** + * IObject::IsBooleanObject - Retrieves, if an object is a boolean object + * @return returns, whether the object is a boolean object + */ + virtual bool IsBooleanObject() = 0; + /** * IObject::IsValid - Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * @return returns whether the object is a valid object description @@ -1786,6 +1823,114 @@ class ILevelSet : public virtual IObject { typedef IBaseSharedPtr PILevelSet; +/************************************************************************************************************************* + Class interface for BooleanObject +**************************************************************************************************************************/ + +class IBooleanObject : public virtual IObject { +public: + /** + * IBooleanObject::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer + */ + Lib3MF_uint64 ClassTypeId() override + { + return 0x85FA0E8806B6C357UL; // First 64 bits of SHA1 of a string: "Lib3MF::BooleanObject" + } + + /** + * IBooleanObject::SetBaseObject - Sets the base object and transform for the boolean shape. + * @param[in] pBaseObject - base object of the boolean shape + * @param[in] Transform - transform applied to the base object + */ + virtual void SetBaseObject(IObject* pBaseObject, const Lib3MF::sTransform Transform) = 0; + + /** + * IBooleanObject::GetBaseObject - Returns the base object of the boolean shape. + * @return base object of the boolean shape + */ + virtual IObject * GetBaseObject() = 0; + + /** + * IBooleanObject::SetBaseTransform - Sets the base transform of the boolean shape. + * @param[in] Transform - transform applied to the base object + */ + virtual void SetBaseTransform(const Lib3MF::sTransform Transform) = 0; + + /** + * IBooleanObject::GetBaseTransform - Returns the base transform of the boolean shape. + * @return transform applied to the base object + */ + virtual Lib3MF::sTransform GetBaseTransform() = 0; + + /** + * IBooleanObject::SetOperation - Sets the boolean operation used for the boolean shape. + * @param[in] eOperation - boolean operation used for the shape + */ + virtual void SetOperation(const Lib3MF::eBooleanOperation eOperation) = 0; + + /** + * IBooleanObject::GetOperation - Returns the boolean operation used for the boolean shape. + * @return boolean operation used for the shape + */ + virtual Lib3MF::eBooleanOperation GetOperation() = 0; + + /** + * IBooleanObject::SetCSGModeEnabled - Enables or disables CSG field evaluation for boolean-to-mesh materialization. + * @param[in] bCSGModeEnabled - if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback + */ + virtual void SetCSGModeEnabled(const bool bCSGModeEnabled) = 0; + + /** + * IBooleanObject::GetCSGModeEnabled - Returns whether CSG field evaluation is enabled for boolean-to-mesh materialization. + * @return if true, boolean materialization uses CSG field evaluation; otherwise, uses flattening fallback + */ + virtual bool GetCSGModeEnabled() = 0; + + /** + * IBooleanObject::SetExtractionGridResolution - Sets the extraction grid resolution used for boolean-to-mesh materialization. + * @param[in] nGridResolution - extraction grid resolution for boolean surface extraction + */ + virtual void SetExtractionGridResolution(const Lib3MF_uint32 nGridResolution) = 0; + + /** + * IBooleanObject::GetExtractionGridResolution - Returns the extraction grid resolution used for boolean-to-mesh materialization. + * @return extraction grid resolution for boolean surface extraction + */ + virtual Lib3MF_uint32 GetExtractionGridResolution() = 0; + + /** + * IBooleanObject::GetOperandCount - Returns the number of operands in the boolean sequence. + * @return number of operands in the boolean sequence + */ + virtual Lib3MF_uint32 GetOperandCount() = 0; + + /** + * IBooleanObject::AddOperand - Adds an operand object to the boolean sequence. + * @param[in] pOperandObject - mesh object used as operand + * @param[in] Transform - transform applied to the operand object + */ + virtual void AddOperand(IMeshObject* pOperandObject, const Lib3MF::sTransform Transform) = 0; + + /** + * IBooleanObject::GetOperand - Returns one operand object and transform from the boolean sequence. + * @param[in] nIndex - index of the operand in the boolean sequence + * @param[out] pOperandObject - mesh object used as operand + * @return transform applied to the operand object + */ + virtual Lib3MF::sTransform GetOperand(const Lib3MF_uint32 nIndex, IMeshObject*& pOperandObject) = 0; + + /** + * IBooleanObject::MergeToMeshObject - Materializes the boolean shape into a newly created mesh object. + * @return new mesh object containing the tessellated boolean shape + */ + virtual IMeshObject * MergeToMeshObject() = 0; + +}; + +typedef IBaseSharedPtr PIBooleanObject; + + /************************************************************************************************************************* Class interface for BeamLattice **************************************************************************************************************************/ @@ -2116,14 +2261,14 @@ class IVolumeDataComposite : public virtual IBase { virtual Lib3MF_uint32 GetMaterialMappingCount() = 0; /** - * IVolumeDataComposite::GetMaterialMapping - Returns MaterialMappting with given index + * IVolumeDataComposite::GetMaterialMapping - Returns MaterialMapping with given index * @param[in] nIndex - Index of the MaterialMapping in question. * @return MaterialMapping used in this element */ virtual IMaterialMapping * GetMaterialMapping(const Lib3MF_uint32 nIndex) = 0; /** - * IVolumeDataComposite::AddMaterialMapping - Adds a the MaterialMapping + * IVolumeDataComposite::AddMaterialMapping - Adds a MaterialMapping * @param[in] Transform - new transformation matrix * @return The new MaterialMapping */ @@ -2230,7 +2375,7 @@ class IVolumeData : public virtual IResource { /** * IVolumeData::GetPropertyCount - Returns the number of VolumeDataProperty - * @return the number of VolumeDataProperty-elements within this VolumdeData + * @return the number of VolumeDataProperty-elements within this VolumeData */ virtual Lib3MF_uint32 GetPropertyCount() = 0; @@ -2982,13 +3127,13 @@ class IAttachment : public virtual IBase { virtual void WriteToFile(const std::string & sFileName) = 0; /** - * IAttachment::ReadFromFile - Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. + * IAttachment::ReadFromFile - Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * @param[in] sFileName - file to read from. */ virtual void ReadFromFile(const std::string & sFileName) = 0; /** - * IAttachment::ReadFromCallback - Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. + * IAttachment::ReadFromCallback - Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. * @param[in] pTheReadCallback - callback function * @param[in] nStreamSize - number of bytes the callback returns * @param[in] pTheSeekCallback - callback function @@ -3011,7 +3156,7 @@ class IAttachment : public virtual IBase { virtual void WriteToBuffer(Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer) = 0; /** - * IAttachment::ReadFromBuffer - Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). + * IAttachment::ReadFromBuffer - Reads an attachment from a memory buffer. This buffer is immediately read (in contrast to the ReadFromCallback and ReadFromFile-methods). * @param[in] nBufferBufferSize - Number of elements in buffer * @param[in] pBufferBuffer - Buffer to read from */ @@ -4740,6 +4885,204 @@ class IUnsignedMeshNode : public virtual IImplicitNode { typedef IBaseSharedPtr PIUnsignedMeshNode; +/************************************************************************************************************************* + Class interface for BeamLatticeNode +**************************************************************************************************************************/ + +class IBeamLatticeNode : public virtual IImplicitNode { +public: + /** + * IBeamLatticeNode::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer + */ + Lib3MF_uint64 ClassTypeId() override + { + return 0xF3A4EE98F7FEC0CUL; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLatticeNode" + } + + /** + * IBeamLatticeNode::GetInputBeamLattice - Retrieves the input for the model resource id of the beam lattice + * @return the input port for the model resource id of the beam lattice (mesh with beamlattice extension) + */ + virtual IImplicitPort * GetInputBeamLattice() = 0; + + /** + * IBeamLatticeNode::GetInputPos - Retrieves the input for the position + * @return the input port for the position + */ + virtual IImplicitPort * GetInputPos() = 0; + + /** + * IBeamLatticeNode::GetOutputDistance - Retrieves the output + * @return the output port for the signed distance to the beam lattice + */ + virtual IImplicitPort * GetOutputDistance() = 0; + + /** + * IBeamLatticeNode::SetAccurateRange - Sets the accurate range for distance computation + * @param[in] dAccurateRange - the accurate range in model units + */ + virtual void SetAccurateRange(const Lib3MF_double dAccurateRange) = 0; + + /** + * IBeamLatticeNode::GetAccurateRange - Retrieves the accurate range for distance computation + * @return the accurate range in model units + */ + virtual Lib3MF_double GetAccurateRange() = 0; + +}; + +typedef IBaseSharedPtr PIBeamLatticeNode; + + +/************************************************************************************************************************* + Class interface for FunctionGradientNode +**************************************************************************************************************************/ + +class IFunctionGradientNode : public virtual IImplicitNode { +public: + /** + * IFunctionGradientNode::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer + */ + Lib3MF_uint64 ClassTypeId() override + { + return 0x437E27AEF740121UL; // First 64 bits of SHA1 of a string: "Lib3MF::FunctionGradientNode" + } + + /** + * IFunctionGradientNode::GetInputFunctionID - Retrieves the input for the function id + * @return the input port for the function + */ + virtual IImplicitPort * GetInputFunctionID() = 0; + + /** + * IFunctionGradientNode::GetInputPos - Retrieves the input for the position + * @return the input port for the position + */ + virtual IImplicitPort * GetInputPos() = 0; + + /** + * IFunctionGradientNode::GetInputStep - Retrieves the input for the finite difference step + * @return the input port for the finite difference step + */ + virtual IImplicitPort * GetInputStep() = 0; + + /** + * IFunctionGradientNode::SetScalarOutputName - Sets the name of the referenced scalar output + * @param[in] sScalarOutputName - the name of the scalar output of the referenced function + */ + virtual void SetScalarOutputName(const std::string & sScalarOutputName) = 0; + + /** + * IFunctionGradientNode::GetScalarOutputName - Retrieves the name of the referenced scalar output + * @return the name of the scalar output of the referenced function + */ + virtual std::string GetScalarOutputName() = 0; + + /** + * IFunctionGradientNode::SetVectorInputName - Sets the name of the referenced vector input + * @param[in] sVectorInputName - the name of the vector input (float3) of the referenced function + */ + virtual void SetVectorInputName(const std::string & sVectorInputName) = 0; + + /** + * IFunctionGradientNode::GetVectorInputName - Retrieves the name of the referenced vector input + * @return the name of the vector input (float3) of the referenced function + */ + virtual std::string GetVectorInputName() = 0; + + /** + * IFunctionGradientNode::GetOutputNormalizedGradient - Retrieves the normalized gradient output + * @return the output port for the normalized gradient + */ + virtual IImplicitPort * GetOutputNormalizedGradient() = 0; + + /** + * IFunctionGradientNode::GetOutputGradient - Retrieves the raw gradient output + * @return the output port for the raw gradient + */ + virtual IImplicitPort * GetOutputGradient() = 0; + + /** + * IFunctionGradientNode::GetOutputMagnitude - Retrieves the gradient magnitude output + * @return the output port for the gradient magnitude + */ + virtual IImplicitPort * GetOutputMagnitude() = 0; + +}; + +typedef IBaseSharedPtr PIFunctionGradientNode; + + +/************************************************************************************************************************* + Class interface for NormalizeDistanceNode +**************************************************************************************************************************/ + +class INormalizeDistanceNode : public virtual IImplicitNode { +public: + /** + * INormalizeDistanceNode::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer + */ + Lib3MF_uint64 ClassTypeId() override + { + return 0x817D2E566E73AA8FUL; // First 64 bits of SHA1 of a string: "Lib3MF::NormalizeDistanceNode" + } + + /** + * INormalizeDistanceNode::GetInputFunctionID - Retrieves the input for the function id + * @return the input port for the function + */ + virtual IImplicitPort * GetInputFunctionID() = 0; + + /** + * INormalizeDistanceNode::GetInputPos - Retrieves the input for the position + * @return the input port for the position (vector) + */ + virtual IImplicitPort * GetInputPos() = 0; + + /** + * INormalizeDistanceNode::GetInputStep - Retrieves the input for the finite difference step + * @return the input port for the finite difference step + */ + virtual IImplicitPort * GetInputStep() = 0; + + /** + * INormalizeDistanceNode::SetScalarOutputName - Sets the name of the referenced scalar output + * @param[in] sScalarOutputName - the name of the scalar output of the referenced function + */ + virtual void SetScalarOutputName(const std::string & sScalarOutputName) = 0; + + /** + * INormalizeDistanceNode::GetScalarOutputName - Retrieves the name of the referenced scalar output + * @return the name of the scalar output of the referenced function + */ + virtual std::string GetScalarOutputName() = 0; + + /** + * INormalizeDistanceNode::SetVectorInputName - Sets the name of the referenced vector input + * @param[in] sVectorInputName - the name of the vector input (float3) of the referenced function + */ + virtual void SetVectorInputName(const std::string & sVectorInputName) = 0; + + /** + * INormalizeDistanceNode::GetVectorInputName - Retrieves the name of the referenced vector input + * @return the name of the vector input (float3) of the referenced function + */ + virtual std::string GetVectorInputName() = 0; + + /** + * INormalizeDistanceNode::GetOutputResult - Retrieves the normalized result output + * @return the output port for the normalized distance + */ + virtual IImplicitPort * GetOutputResult() = 0; + +}; + +typedef IBaseSharedPtr PINormalizeDistanceNode; + + /************************************************************************************************************************* Class interface for FunctionCallNode **************************************************************************************************************************/ @@ -5381,6 +5724,33 @@ class IImplicitFunction : public virtual IFunction { */ virtual IUnsignedMeshNode * AddUnsignedMeshNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) = 0; + /** + * IImplicitFunction::AddBeamLatticeNode - Add a BeamLatticeNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + virtual IBeamLatticeNode * AddBeamLatticeNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) = 0; + + /** + * IImplicitFunction::AddFunctionGradientNode - Add a FunctionGradientNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + virtual IFunctionGradientNode * AddFunctionGradientNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) = 0; + + /** + * IImplicitFunction::AddNormalizeDistanceNode - Add a NormalizeDistanceNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + virtual INormalizeDistanceNode * AddNormalizeDistanceNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) = 0; + /** * IImplicitFunction::AddFunctionCallNode - Add a FunctionCallNode * @param[in] sIdentifier - the identifier of the node @@ -6340,6 +6710,13 @@ class IModel : public virtual IBase { */ virtual IComponentsObject * GetComponentsObjectByID(const Lib3MF_uint32 nUniqueResourceID) = 0; + /** + * IModel::GetBooleanObjectByID - finds a boolean object by its UniqueResourceID + * @param[in] nUniqueResourceID - UniqueResourceID + * @return returns the boolean object instance + */ + virtual IBooleanObject * GetBooleanObjectByID(const Lib3MF_uint32 nUniqueResourceID) = 0; + /** * IModel::GetColorGroupByID - finds a model color group by its UniqueResourceID * @param[in] nUniqueResourceID - UniqueResourceID @@ -6410,6 +6787,12 @@ class IModel : public virtual IBase { */ virtual IComponentsObjectIterator * GetComponentsObjects() = 0; + /** + * IModel::GetBooleanObjects - creates a resource iterator instance with all boolean object resources. + * @return returns the iterator instance. + */ + virtual IBooleanObjectIterator * GetBooleanObjects() = 0; + /** * IModel::GetTexture2Ds - creates a Texture2DIterator instance with all texture2d resources. * @return returns the iterator instance. @@ -6482,6 +6865,12 @@ class IModel : public virtual IBase { */ virtual IComponentsObject * AddComponentsObject() = 0; + /** + * IModel::AddBooleanObject - adds an empty boolean object to the model. + * @return returns the boolean object instance + */ + virtual IBooleanObject * AddBooleanObject() = 0; + /** * IModel::AddSliceStack - creates a new model slicestack by its id * @param[in] dZBottom - Bottom Z value of the slicestack diff --git a/Autogenerated/Source/lib3mf_interfacewrapper.cpp b/Autogenerated/Source/lib3mf_interfacewrapper.cpp index 9475cff47..d428a8267 100644 --- a/Autogenerated/Source/lib3mf_interfacewrapper.cpp +++ b/Autogenerated/Source/lib3mf_interfacewrapper.cpp @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++ implementation file in order to allow easy development of the 3MF Library. The functions in this file need to be implemented. It needs to be generated only once. -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -1634,6 +1634,46 @@ Lib3MFResult lib3mf_componentsobjectiterator_getcurrentcomponentsobject(Lib3MF_C } +/************************************************************************************************************************* + Class implementation for BooleanObjectIterator +**************************************************************************************************************************/ +Lib3MFResult lib3mf_booleanobjectiterator_getcurrentbooleanobject(Lib3MF_BooleanObjectIterator pBooleanObjectIterator, Lib3MF_BooleanObject * pResource) +{ + IBase* pIBaseClass = (IBase *)pBooleanObjectIterator; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBooleanObjectIterator, "BooleanObjectIterator", "GetCurrentBooleanObject"); + } + if (pResource == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseResource(nullptr); + IBooleanObjectIterator* pIBooleanObjectIterator = dynamic_cast(pIBaseClass); + if (!pIBooleanObjectIterator) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseResource = pIBooleanObjectIterator->GetCurrentBooleanObject(); + + *pResource = (IBase*)(pBaseResource); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Resource", *pResource); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + /************************************************************************************************************************* Class implementation for Texture2DIterator **************************************************************************************************************************/ @@ -3567,6 +3607,40 @@ Lib3MFResult lib3mf_object_islevelsetobject(Lib3MF_Object pObject, bool * pIsLev } } +Lib3MFResult lib3mf_object_isbooleanobject(Lib3MF_Object pObject, bool * pIsBooleanObject) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "IsBooleanObject"); + } + if (pIsBooleanObject == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pIsBooleanObject = pIObject->IsBooleanObject(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("IsBooleanObject", *pIsBooleanObject); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + Lib3MFResult lib3mf_object_isvalid(Lib3MF_Object pObject, bool * pIsValid) { IBase* pIBaseClass = (IBase *)pObject; @@ -5596,27 +5670,30 @@ Lib3MFResult lib3mf_levelset_setvolumedata(Lib3MF_LevelSet pLevelSet, Lib3MF_Vol /************************************************************************************************************************* - Class implementation for BeamLattice + Class implementation for BooleanObject **************************************************************************************************************************/ -Lib3MFResult lib3mf_beamlattice_getminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength) +Lib3MFResult lib3mf_booleanobject_setbaseobject(Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object pBaseObject, const sLib3MFTransform * pTransform) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pBooleanObject; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetMinLength"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBooleanObject, "BooleanObject", "SetBaseObject"); + pJournalEntry->addHandleParameter("BaseObject", pBaseObject); } - if (pMinLength == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IBase* pIBaseClassBaseObject = (IBase *)pBaseObject; + IObject* pIBaseObject = dynamic_cast(pIBaseClassBaseObject); + if (!pIBaseObject) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IBooleanObject* pIBooleanObject = dynamic_cast(pIBaseClass); + if (!pIBooleanObject) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pMinLength = pIBeamLattice->GetMinLength(); + pIBooleanObject->SetBaseObject(pIBaseObject, *pTransform); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addDoubleResult("MinLength", *pMinLength); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5632,23 +5709,27 @@ Lib3MFResult lib3mf_beamlattice_getminlength(Lib3MF_BeamLattice pBeamLattice, Li } } -Lib3MFResult lib3mf_beamlattice_setminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength) +Lib3MFResult lib3mf_booleanobject_getbaseobject(Lib3MF_BooleanObject pBooleanObject, Lib3MF_Object * pBaseObject) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pBooleanObject; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetMinLength"); - pJournalEntry->addDoubleParameter("MinLength", dMinLength); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBooleanObject, "BooleanObject", "GetBaseObject"); } - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + if (pBaseObject == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseBaseObject(nullptr); + IBooleanObject* pIBooleanObject = dynamic_cast(pIBaseClass); + if (!pIBooleanObject) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->SetMinLength(dMinLength); + pBaseBaseObject = pIBooleanObject->GetBaseObject(); + *pBaseObject = (IBase*)(pBaseBaseObject); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("BaseObject", *pBaseObject); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5664,28 +5745,22 @@ Lib3MFResult lib3mf_beamlattice_setminlength(Lib3MF_BeamLattice pBeamLattice, Li } } -Lib3MFResult lib3mf_beamlattice_getclipping(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID) +Lib3MFResult lib3mf_booleanobject_setbasetransform(Lib3MF_BooleanObject pBooleanObject, const sLib3MFTransform * pTransform) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pBooleanObject; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetClipping"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBooleanObject, "BooleanObject", "SetBaseTransform"); } - if (!pClipMode) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (!pUniqueResourceID) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IBooleanObject* pIBooleanObject = dynamic_cast(pIBaseClass); + if (!pIBooleanObject) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->GetClipping(*pClipMode, *pUniqueResourceID); + pIBooleanObject->SetBaseTransform(*pTransform); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addEnumResult("ClipMode", "BeamLatticeClipMode", (Lib3MF_int32)(*pClipMode)); - pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5701,22 +5776,22 @@ Lib3MFResult lib3mf_beamlattice_getclipping(Lib3MF_BeamLattice pBeamLattice, eLi } } -Lib3MFResult lib3mf_beamlattice_setclipping(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID) +Lib3MFResult lib3mf_booleanobject_getbasetransform(Lib3MF_BooleanObject pBooleanObject, sLib3MFTransform * pTransform) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pBooleanObject; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetClipping"); - pJournalEntry->addEnumParameter("ClipMode", "BeamLatticeClipMode", (Lib3MF_int32)(eClipMode)); - pJournalEntry->addUInt32Parameter("UniqueResourceID", nUniqueResourceID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBooleanObject, "BooleanObject", "GetBaseTransform"); } - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + if (pTransform == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBooleanObject* pIBooleanObject = dynamic_cast(pIBaseClass); + if (!pIBooleanObject) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->SetClipping(eClipMode, nUniqueResourceID); + *pTransform = pIBooleanObject->GetBaseTransform(); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -5734,28 +5809,23 @@ Lib3MFResult lib3mf_beamlattice_setclipping(Lib3MF_BeamLattice pBeamLattice, eLi } } -Lib3MFResult lib3mf_beamlattice_getrepresentation(Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID) +Lib3MFResult lib3mf_booleanobject_setoperation(Lib3MF_BooleanObject pBooleanObject, eLib3MFBooleanOperation eOperation) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pBooleanObject; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetRepresentation"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBooleanObject, "BooleanObject", "SetOperation"); + pJournalEntry->addEnumParameter("Operation", "BooleanOperation", (Lib3MF_int32)(eOperation)); } - if (pHasRepresentation == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (!pUniqueResourceID) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IBooleanObject* pIBooleanObject = dynamic_cast(pIBaseClass); + if (!pIBooleanObject) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pHasRepresentation = pIBeamLattice->GetRepresentation(*pUniqueResourceID); + pIBooleanObject->SetOperation(eOperation); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("HasRepresentation", *pHasRepresentation); - pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5771,23 +5841,25 @@ Lib3MFResult lib3mf_beamlattice_getrepresentation(Lib3MF_BeamLattice pBeamLattic } } -Lib3MFResult lib3mf_beamlattice_setrepresentation(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID) +Lib3MFResult lib3mf_booleanobject_getoperation(Lib3MF_BooleanObject pBooleanObject, eLib3MFBooleanOperation * pOperation) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pBooleanObject; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetRepresentation"); - pJournalEntry->addUInt32Parameter("UniqueResourceID", nUniqueResourceID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBooleanObject, "BooleanObject", "GetOperation"); } - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + if (pOperation == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBooleanObject* pIBooleanObject = dynamic_cast(pIBaseClass); + if (!pIBooleanObject) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->SetRepresentation(nUniqueResourceID); + *pOperation = pIBooleanObject->GetOperation(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addEnumResult("Operation", "BooleanOperation", (Lib3MF_int32)(*pOperation)); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5803,28 +5875,23 @@ Lib3MFResult lib3mf_beamlattice_setrepresentation(Lib3MF_BeamLattice pBeamLattic } } -Lib3MFResult lib3mf_beamlattice_getballoptions(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius) +Lib3MFResult lib3mf_booleanobject_setcsgmodeenabled(Lib3MF_BooleanObject pBooleanObject, bool bCSGModeEnabled) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pBooleanObject; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBallOptions"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBooleanObject, "BooleanObject", "SetCSGModeEnabled"); + pJournalEntry->addBooleanParameter("CSGModeEnabled", bCSGModeEnabled); } - if (!pBallMode) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (!pBallRadius) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IBooleanObject* pIBooleanObject = dynamic_cast(pIBaseClass); + if (!pIBooleanObject) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->GetBallOptions(*pBallMode, *pBallRadius); + pIBooleanObject->SetCSGModeEnabled(bCSGModeEnabled); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addEnumResult("BallMode", "BeamLatticeBallMode", (Lib3MF_int32)(*pBallMode)); - pJournalEntry->addDoubleResult("BallRadius", *pBallRadius); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5840,24 +5907,25 @@ Lib3MFResult lib3mf_beamlattice_getballoptions(Lib3MF_BeamLattice pBeamLattice, } } -Lib3MFResult lib3mf_beamlattice_setballoptions(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius) +Lib3MFResult lib3mf_booleanobject_getcsgmodeenabled(Lib3MF_BooleanObject pBooleanObject, bool * pCSGModeEnabled) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pBooleanObject; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBallOptions"); - pJournalEntry->addEnumParameter("BallMode", "BeamLatticeBallMode", (Lib3MF_int32)(eBallMode)); - pJournalEntry->addDoubleParameter("BallRadius", dBallRadius); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBooleanObject, "BooleanObject", "GetCSGModeEnabled"); } - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + if (pCSGModeEnabled == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBooleanObject* pIBooleanObject = dynamic_cast(pIBaseClass); + if (!pIBooleanObject) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->SetBallOptions(eBallMode, dBallRadius); + *pCSGModeEnabled = pIBooleanObject->GetCSGModeEnabled(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("CSGModeEnabled", *pCSGModeEnabled); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5873,25 +5941,23 @@ Lib3MFResult lib3mf_beamlattice_setballoptions(Lib3MF_BeamLattice pBeamLattice, } } -Lib3MFResult lib3mf_beamlattice_getbeamcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_booleanobject_setextractiongridresolution(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nGridResolution) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pBooleanObject; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeamCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBooleanObject, "BooleanObject", "SetExtractionGridResolution"); + pJournalEntry->addUInt32Parameter("GridResolution", nGridResolution); } - if (pCount == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IBooleanObject* pIBooleanObject = dynamic_cast(pIBaseClass); + if (!pIBooleanObject) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIBeamLattice->GetBeamCount(); + pIBooleanObject->SetExtractionGridResolution(nGridResolution); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5907,25 +5973,25 @@ Lib3MFResult lib3mf_beamlattice_getbeamcount(Lib3MF_BeamLattice pBeamLattice, Li } } -Lib3MFResult lib3mf_beamlattice_getbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBeam * pBeamInfo) +Lib3MFResult lib3mf_booleanobject_getextractiongridresolution(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pGridResolution) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pBooleanObject; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeam"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBooleanObject, "BooleanObject", "GetExtractionGridResolution"); } - if (pBeamInfo == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + if (pGridResolution == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBooleanObject* pIBooleanObject = dynamic_cast(pIBaseClass); + if (!pIBooleanObject) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pBeamInfo = pIBeamLattice->GetBeam(nIndex); + *pGridResolution = pIBooleanObject->GetExtractionGridResolution(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("GridResolution", *pGridResolution); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5941,25 +6007,25 @@ Lib3MFResult lib3mf_beamlattice_getbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_ } } -Lib3MFResult lib3mf_beamlattice_addbeam(Lib3MF_BeamLattice pBeamLattice, const sLib3MFBeam * pBeamInfo, Lib3MF_uint32 * pIndex) +Lib3MFResult lib3mf_booleanobject_getoperandcount(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pBooleanObject; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "AddBeam"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBooleanObject, "BooleanObject", "GetOperandCount"); } - if (pIndex == nullptr) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IBooleanObject* pIBooleanObject = dynamic_cast(pIBaseClass); + if (!pIBooleanObject) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pIndex = pIBeamLattice->AddBeam(*pBeamInfo); + *pCount = pIBooleanObject->GetOperandCount(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Index", *pIndex); + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5975,21 +6041,26 @@ Lib3MFResult lib3mf_beamlattice_addbeam(Lib3MF_BeamLattice pBeamLattice, const s } } -Lib3MFResult lib3mf_beamlattice_setbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBeam * pBeamInfo) +Lib3MFResult lib3mf_booleanobject_addoperand(Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject pOperandObject, const sLib3MFTransform * pTransform) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pBooleanObject; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBeam"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBooleanObject, "BooleanObject", "AddOperand"); + pJournalEntry->addHandleParameter("OperandObject", pOperandObject); } - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IBase* pIBaseClassOperandObject = (IBase *)pOperandObject; + IMeshObject* pIOperandObject = dynamic_cast(pIBaseClassOperandObject); + if (!pIOperandObject) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IBooleanObject* pIBooleanObject = dynamic_cast(pIBaseClass); + if (!pIBooleanObject) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->SetBeam(nIndex, *pBeamInfo); + pIBooleanObject->AddOperand(pIOperandObject, *pTransform); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -6007,24 +6078,30 @@ Lib3MFResult lib3mf_beamlattice_setbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_ } } -Lib3MFResult lib3mf_beamlattice_setbeams(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const sLib3MFBeam * pBeamInfoBuffer) +Lib3MFResult lib3mf_booleanobject_getoperand(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nIndex, Lib3MF_MeshObject * pOperandObject, sLib3MFTransform * pTransform) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pBooleanObject; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBeams"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBooleanObject, "BooleanObject", "GetOperand"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if ( (!pBeamInfoBuffer) && (nBeamInfoBufferSize>0)) + if (pOperandObject == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + if (pTransform == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMeshObject* pBaseOperandObject(nullptr); + IBooleanObject* pIBooleanObject = dynamic_cast(pIBaseClass); + if (!pIBooleanObject) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->SetBeams(nBeamInfoBufferSize, pBeamInfoBuffer); + *pTransform = pIBooleanObject->GetOperand(nIndex, pBaseOperandObject); + *pOperandObject = (IBase*)(pBaseOperandObject); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("OperandObject", *pOperandObject); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6040,24 +6117,27 @@ Lib3MFResult lib3mf_beamlattice_setbeams(Lib3MF_BeamLattice pBeamLattice, Lib3MF } } -Lib3MFResult lib3mf_beamlattice_getbeams(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, sLib3MFBeam * pBeamInfoBuffer) +Lib3MFResult lib3mf_booleanobject_mergetomeshobject(Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject * pMeshObject) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pBooleanObject; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeams"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBooleanObject, "BooleanObject", "MergeToMeshObject"); } - if ((!pBeamInfoBuffer) && !(pBeamInfoNeededCount)) + if (pMeshObject == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IBase* pBaseMeshObject(nullptr); + IBooleanObject* pIBooleanObject = dynamic_cast(pIBaseClass); + if (!pIBooleanObject) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - - pIBeamLattice->GetBeams(nBeamInfoBufferSize, pBeamInfoNeededCount, pBeamInfoBuffer); + pBaseMeshObject = pIBooleanObject->MergeToMeshObject(); + + *pMeshObject = (IBase*)(pBaseMeshObject); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("MeshObject", *pMeshObject); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6073,25 +6153,29 @@ Lib3MFResult lib3mf_beamlattice_getbeams(Lib3MF_BeamLattice pBeamLattice, const } } -Lib3MFResult lib3mf_beamlattice_getballcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) + +/************************************************************************************************************************* + Class implementation for BeamLattice +**************************************************************************************************************************/ +Lib3MFResult lib3mf_beamlattice_getminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength) { IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBallCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetMinLength"); } - if (pCount == nullptr) + if (pMinLength == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIBeamLattice->GetBallCount(); + *pMinLength = pIBeamLattice->GetMinLength(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->addDoubleResult("MinLength", *pMinLength); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6107,23 +6191,21 @@ Lib3MFResult lib3mf_beamlattice_getballcount(Lib3MF_BeamLattice pBeamLattice, Li } } -Lib3MFResult lib3mf_beamlattice_getball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBall * pBallInfo) +Lib3MFResult lib3mf_beamlattice_setminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength) { IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBall"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetMinLength"); + pJournalEntry->addDoubleParameter("MinLength", dMinLength); } - if (pBallInfo == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pBallInfo = pIBeamLattice->GetBall(nIndex); + pIBeamLattice->SetMinLength(dMinLength); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -6141,25 +6223,28 @@ Lib3MFResult lib3mf_beamlattice_getball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_ } } -Lib3MFResult lib3mf_beamlattice_addball(Lib3MF_BeamLattice pBeamLattice, const sLib3MFBall * pBallInfo, Lib3MF_uint32 * pIndex) +Lib3MFResult lib3mf_beamlattice_getclipping(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID) { IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "AddBall"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetClipping"); } - if (pIndex == nullptr) + if (!pClipMode) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (!pUniqueResourceID) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pIndex = pIBeamLattice->AddBall(*pBallInfo); + pIBeamLattice->GetClipping(*pClipMode, *pUniqueResourceID); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Index", *pIndex); + pJournalEntry->addEnumResult("ClipMode", "BeamLatticeClipMode", (Lib3MF_int32)(*pClipMode)); + pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6175,21 +6260,22 @@ Lib3MFResult lib3mf_beamlattice_addball(Lib3MF_BeamLattice pBeamLattice, const s } } -Lib3MFResult lib3mf_beamlattice_setball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBall * pBallInfo) +Lib3MFResult lib3mf_beamlattice_setclipping(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID) { IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBall"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetClipping"); + pJournalEntry->addEnumParameter("ClipMode", "BeamLatticeClipMode", (Lib3MF_int32)(eClipMode)); + pJournalEntry->addUInt32Parameter("UniqueResourceID", nUniqueResourceID); } IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->SetBall(nIndex, *pBallInfo); + pIBeamLattice->SetClipping(eClipMode, nUniqueResourceID); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -6207,24 +6293,28 @@ Lib3MFResult lib3mf_beamlattice_setball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_ } } -Lib3MFResult lib3mf_beamlattice_setballs(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const sLib3MFBall * pBallInfoBuffer) +Lib3MFResult lib3mf_beamlattice_getrepresentation(Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID) { IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBalls"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetRepresentation"); } - if ( (!pBallInfoBuffer) && (nBallInfoBufferSize>0)) + if (pHasRepresentation == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (!pUniqueResourceID) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->SetBalls(nBallInfoBufferSize, pBallInfoBuffer); + *pHasRepresentation = pIBeamLattice->GetRepresentation(*pUniqueResourceID); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("HasRepresentation", *pHasRepresentation); + pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6240,22 +6330,21 @@ Lib3MFResult lib3mf_beamlattice_setballs(Lib3MF_BeamLattice pBeamLattice, Lib3MF } } -Lib3MFResult lib3mf_beamlattice_getballs(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, sLib3MFBall * pBallInfoBuffer) +Lib3MFResult lib3mf_beamlattice_setrepresentation(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID) { IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBalls"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetRepresentation"); + pJournalEntry->addUInt32Parameter("UniqueResourceID", nUniqueResourceID); } - if ((!pBallInfoBuffer) && !(pBallInfoNeededCount)) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->GetBalls(nBallInfoBufferSize, pBallInfoNeededCount, pBallInfoBuffer); + pIBeamLattice->SetRepresentation(nUniqueResourceID); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -6273,25 +6362,28 @@ Lib3MFResult lib3mf_beamlattice_getballs(Lib3MF_BeamLattice pBeamLattice, const } } -Lib3MFResult lib3mf_beamlattice_getbeamsetcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_beamlattice_getballoptions(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius) { IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeamSetCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBallOptions"); } - if (pCount == nullptr) + if (!pBallMode) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (!pBallRadius) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIBeamLattice->GetBeamSetCount(); + pIBeamLattice->GetBallOptions(*pBallMode, *pBallRadius); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->addEnumResult("BallMode", "BeamLatticeBallMode", (Lib3MF_int32)(*pBallMode)); + pJournalEntry->addDoubleResult("BallRadius", *pBallRadius); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6307,27 +6399,24 @@ Lib3MFResult lib3mf_beamlattice_getbeamsetcount(Lib3MF_BeamLattice pBeamLattice, } } -Lib3MFResult lib3mf_beamlattice_addbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet) +Lib3MFResult lib3mf_beamlattice_setballoptions(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius) { IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "AddBeamSet"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBallOptions"); + pJournalEntry->addEnumParameter("BallMode", "BeamLatticeBallMode", (Lib3MF_int32)(eBallMode)); + pJournalEntry->addDoubleParameter("BallRadius", dBallRadius); } - if (pBeamSet == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseBeamSet(nullptr); IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseBeamSet = pIBeamLattice->AddBeamSet(); + pIBeamLattice->SetBallOptions(eBallMode, dBallRadius); - *pBeamSet = (IBase*)(pBaseBeamSet); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("BeamSet", *pBeamSet); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6343,28 +6432,25 @@ Lib3MFResult lib3mf_beamlattice_addbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3 } } -Lib3MFResult lib3mf_beamlattice_getbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet) +Lib3MFResult lib3mf_beamlattice_getbeamcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) { IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeamSet"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeamCount"); } - if (pBeamSet == nullptr) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseBeamSet(nullptr); IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseBeamSet = pIBeamLattice->GetBeamSet(nIndex); + *pCount = pIBeamLattice->GetBeamCount(); - *pBeamSet = (IBase*)(pBaseBeamSet); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("BeamSet", *pBeamSet); + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6380,29 +6466,25 @@ Lib3MFResult lib3mf_beamlattice_getbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3 } } - -/************************************************************************************************************************* - Class implementation for FunctionReference -**************************************************************************************************************************/ -Lib3MFResult lib3mf_functionreference_getfunctionresourceid(Lib3MF_FunctionReference pFunctionReference, Lib3MF_uint32 * pUniqueResourceID) +Lib3MFResult lib3mf_beamlattice_getbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBeam * pBeamInfo) { - IBase* pIBaseClass = (IBase *)pFunctionReference; + IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "GetFunctionResourceID"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeam"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if (pUniqueResourceID == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); - if (!pIFunctionReference) + if (pBeamInfo == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pUniqueResourceID = pIFunctionReference->GetFunctionResourceID(); + *pBeamInfo = pIBeamLattice->GetBeam(nIndex); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6418,23 +6500,25 @@ Lib3MFResult lib3mf_functionreference_getfunctionresourceid(Lib3MF_FunctionRefer } } -Lib3MFResult lib3mf_functionreference_setfunctionresourceid(Lib3MF_FunctionReference pFunctionReference, Lib3MF_uint32 nUniqueResourceID) +Lib3MFResult lib3mf_beamlattice_addbeam(Lib3MF_BeamLattice pBeamLattice, const sLib3MFBeam * pBeamInfo, Lib3MF_uint32 * pIndex) { - IBase* pIBaseClass = (IBase *)pFunctionReference; + IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "SetFunctionResourceID"); - pJournalEntry->addUInt32Parameter("UniqueResourceID", nUniqueResourceID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "AddBeam"); } - IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); - if (!pIFunctionReference) + if (pIndex == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIFunctionReference->SetFunctionResourceID(nUniqueResourceID); + *pIndex = pIBeamLattice->AddBeam(*pBeamInfo); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Index", *pIndex); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6450,22 +6534,21 @@ Lib3MFResult lib3mf_functionreference_setfunctionresourceid(Lib3MF_FunctionRefer } } -Lib3MFResult lib3mf_functionreference_gettransform(Lib3MF_FunctionReference pFunctionReference, sLib3MFTransform * pTransform) +Lib3MFResult lib3mf_beamlattice_setbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBeam * pBeamInfo) { - IBase* pIBaseClass = (IBase *)pFunctionReference; + IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "GetTransform"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBeam"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if (pTransform == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); - if (!pIFunctionReference) + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pTransform = pIFunctionReference->GetTransform(); + pIBeamLattice->SetBeam(nIndex, *pBeamInfo); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -6483,20 +6566,22 @@ Lib3MFResult lib3mf_functionreference_gettransform(Lib3MF_FunctionReference pFun } } -Lib3MFResult lib3mf_functionreference_settransform(Lib3MF_FunctionReference pFunctionReference, const sLib3MFTransform * pTransform) +Lib3MFResult lib3mf_beamlattice_setbeams(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const sLib3MFBeam * pBeamInfoBuffer) { - IBase* pIBaseClass = (IBase *)pFunctionReference; + IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "SetTransform"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBeams"); } - IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); - if (!pIFunctionReference) + if ( (!pBeamInfoBuffer) && (nBeamInfoBufferSize>0)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIFunctionReference->SetTransform(*pTransform); + pIBeamLattice->SetBeams(nBeamInfoBufferSize, pBeamInfoBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -6514,47 +6599,24 @@ Lib3MFResult lib3mf_functionreference_settransform(Lib3MF_FunctionReference pFun } } -Lib3MFResult lib3mf_functionreference_getchannelname(Lib3MF_FunctionReference pFunctionReference, const Lib3MF_uint32 nChannelNameBufferSize, Lib3MF_uint32* pChannelNameNeededChars, char * pChannelNameBuffer) +Lib3MFResult lib3mf_beamlattice_getbeams(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, sLib3MFBeam * pBeamInfoBuffer) { - IBase* pIBaseClass = (IBase *)pFunctionReference; + IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "GetChannelName"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeams"); } - if ( (!pChannelNameBuffer) && !(pChannelNameNeededChars) ) + if ((!pBeamInfoBuffer) && !(pBeamInfoNeededCount)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sChannelName(""); - IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); - if (!pIFunctionReference) + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pChannelNameBuffer == nullptr); - if (isCacheCall) { - sChannelName = pIFunctionReference->GetChannelName(); + pIBeamLattice->GetBeams(nBeamInfoBufferSize, pBeamInfoNeededCount, pBeamInfoBuffer); - pIFunctionReference->_setCache (new ParameterCache_1 (sChannelName)); - } - else { - auto cache = dynamic_cast*> (pIFunctionReference->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sChannelName); - pIFunctionReference->_setCache (nullptr); - } - - if (pChannelNameNeededChars) - *pChannelNameNeededChars = (Lib3MF_uint32) (sChannelName.size()+1); - if (pChannelNameBuffer) { - if (sChannelName.size() >= nChannelNameBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iChannelName = 0; iChannelName < sChannelName.size(); iChannelName++) - pChannelNameBuffer[iChannelName] = sChannelName[iChannelName]; - pChannelNameBuffer[sChannelName.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("ChannelName", sChannelName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6570,26 +6632,25 @@ Lib3MFResult lib3mf_functionreference_getchannelname(Lib3MF_FunctionReference pF } } -Lib3MFResult lib3mf_functionreference_setchannelname(Lib3MF_FunctionReference pFunctionReference, const char * pChannelName) +Lib3MFResult lib3mf_beamlattice_getballcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pFunctionReference; + IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "SetChannelName"); - pJournalEntry->addStringParameter("ChannelName", pChannelName); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBallCount"); } - if (pChannelName == nullptr) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sChannelName(pChannelName); - IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); - if (!pIFunctionReference) + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIFunctionReference->SetChannelName(sChannelName); + *pCount = pIBeamLattice->GetBallCount(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6605,21 +6666,23 @@ Lib3MFResult lib3mf_functionreference_setchannelname(Lib3MF_FunctionReference pF } } -Lib3MFResult lib3mf_functionreference_setminfeaturesize(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double dMinFeatureSize) +Lib3MFResult lib3mf_beamlattice_getball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBall * pBallInfo) { - IBase* pIBaseClass = (IBase *)pFunctionReference; + IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "SetMinFeatureSize"); - pJournalEntry->addDoubleParameter("MinFeatureSize", dMinFeatureSize); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBall"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); - if (!pIFunctionReference) + if (pBallInfo == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIFunctionReference->SetMinFeatureSize(dMinFeatureSize); + *pBallInfo = pIBeamLattice->GetBall(nIndex); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -6637,25 +6700,25 @@ Lib3MFResult lib3mf_functionreference_setminfeaturesize(Lib3MF_FunctionReference } } -Lib3MFResult lib3mf_functionreference_getminfeaturesize(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double * pMinFeatureSize) +Lib3MFResult lib3mf_beamlattice_addball(Lib3MF_BeamLattice pBeamLattice, const sLib3MFBall * pBallInfo, Lib3MF_uint32 * pIndex) { - IBase* pIBaseClass = (IBase *)pFunctionReference; + IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "GetMinFeatureSize"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "AddBall"); } - if (pMinFeatureSize == nullptr) + if (pIndex == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); - if (!pIFunctionReference) + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pMinFeatureSize = pIFunctionReference->GetMinFeatureSize(); + *pIndex = pIBeamLattice->AddBall(*pBallInfo); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addDoubleResult("MinFeatureSize", *pMinFeatureSize); + pJournalEntry->addUInt32Result("Index", *pIndex); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6671,21 +6734,21 @@ Lib3MFResult lib3mf_functionreference_getminfeaturesize(Lib3MF_FunctionReference } } -Lib3MFResult lib3mf_functionreference_setfallbackvalue(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double dFallBackValue) +Lib3MFResult lib3mf_beamlattice_setball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBall * pBallInfo) { - IBase* pIBaseClass = (IBase *)pFunctionReference; + IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "SetFallBackValue"); - pJournalEntry->addDoubleParameter("FallBackValue", dFallBackValue); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBall"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); - if (!pIFunctionReference) + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIFunctionReference->SetFallBackValue(dFallBackValue); + pIBeamLattice->SetBall(nIndex, *pBallInfo); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -6703,25 +6766,24 @@ Lib3MFResult lib3mf_functionreference_setfallbackvalue(Lib3MF_FunctionReference } } -Lib3MFResult lib3mf_functionreference_getfallbackvalue(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double * pFallBackValue) +Lib3MFResult lib3mf_beamlattice_setballs(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const sLib3MFBall * pBallInfoBuffer) { - IBase* pIBaseClass = (IBase *)pFunctionReference; + IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "GetFallBackValue"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBalls"); } - if (pFallBackValue == nullptr) + if ( (!pBallInfoBuffer) && (nBallInfoBufferSize>0)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); - if (!pIFunctionReference) + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pFallBackValue = pIFunctionReference->GetFallBackValue(); + pIBeamLattice->SetBalls(nBallInfoBufferSize, pBallInfoBuffer); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addDoubleResult("FallBackValue", *pFallBackValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6737,39 +6799,24 @@ Lib3MFResult lib3mf_functionreference_getfallbackvalue(Lib3MF_FunctionReference } } - -/************************************************************************************************************************* - Class implementation for VolumeDataColor -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for MaterialMapping -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for VolumeDataComposite -**************************************************************************************************************************/ -Lib3MFResult lib3mf_volumedatacomposite_getbasematerialgroup(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance) +Lib3MFResult lib3mf_beamlattice_getballs(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, sLib3MFBall * pBallInfoBuffer) { - IBase* pIBaseClass = (IBase *)pVolumeDataComposite; + IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataComposite, "VolumeDataComposite", "GetBaseMaterialGroup"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBalls"); } - if (pBaseMaterialGroupInstance == nullptr) + if ((!pBallInfoBuffer) && !(pBallInfoNeededCount)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseBaseMaterialGroupInstance(nullptr); - IVolumeDataComposite* pIVolumeDataComposite = dynamic_cast(pIBaseClass); - if (!pIVolumeDataComposite) + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseBaseMaterialGroupInstance = pIVolumeDataComposite->GetBaseMaterialGroup(); + pIBeamLattice->GetBalls(nBallInfoBufferSize, pBallInfoNeededCount, pBallInfoBuffer); - *pBaseMaterialGroupInstance = (IBase*)(pBaseBaseMaterialGroupInstance); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("BaseMaterialGroupInstance", *pBaseMaterialGroupInstance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6785,28 +6832,25 @@ Lib3MFResult lib3mf_volumedatacomposite_getbasematerialgroup(Lib3MF_VolumeDataCo } } -Lib3MFResult lib3mf_volumedatacomposite_setbasematerialgroup(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_BaseMaterialGroup pBaseMaterialGroupInstance) +Lib3MFResult lib3mf_beamlattice_getbeamsetcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pVolumeDataComposite; + IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataComposite, "VolumeDataComposite", "SetBaseMaterialGroup"); - pJournalEntry->addHandleParameter("BaseMaterialGroupInstance", pBaseMaterialGroupInstance); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeamSetCount"); } - IBase* pIBaseClassBaseMaterialGroupInstance = (IBase *)pBaseMaterialGroupInstance; - IBaseMaterialGroup* pIBaseMaterialGroupInstance = dynamic_cast(pIBaseClassBaseMaterialGroupInstance); - if (!pIBaseMaterialGroupInstance) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); - - IVolumeDataComposite* pIVolumeDataComposite = dynamic_cast(pIBaseClass); - if (!pIVolumeDataComposite) + if (pCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIVolumeDataComposite->SetBaseMaterialGroup(pIBaseMaterialGroupInstance); + *pCount = pIBeamLattice->GetBeamSetCount(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6822,25 +6866,27 @@ Lib3MFResult lib3mf_volumedatacomposite_setbasematerialgroup(Lib3MF_VolumeDataCo } } -Lib3MFResult lib3mf_volumedatacomposite_getmaterialmappingcount(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_beamlattice_addbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet) { - IBase* pIBaseClass = (IBase *)pVolumeDataComposite; + IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataComposite, "VolumeDataComposite", "GetMaterialMappingCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "AddBeamSet"); } - if (pCount == nullptr) + if (pBeamSet == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IVolumeDataComposite* pIVolumeDataComposite = dynamic_cast(pIBaseClass); - if (!pIVolumeDataComposite) + IBase* pBaseBeamSet(nullptr); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIVolumeDataComposite->GetMaterialMappingCount(); + pBaseBeamSet = pIBeamLattice->AddBeamSet(); + *pBeamSet = (IBase*)(pBaseBeamSet); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->addHandleResult("BeamSet", *pBeamSet); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6856,28 +6902,28 @@ Lib3MFResult lib3mf_volumedatacomposite_getmaterialmappingcount(Lib3MF_VolumeDat } } -Lib3MFResult lib3mf_volumedatacomposite_getmaterialmapping(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 nIndex, Lib3MF_MaterialMapping * pTheMaterialMapping) +Lib3MFResult lib3mf_beamlattice_getbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet) { - IBase* pIBaseClass = (IBase *)pVolumeDataComposite; + IBase* pIBaseClass = (IBase *)pBeamLattice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataComposite, "VolumeDataComposite", "GetMaterialMapping"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeamSet"); pJournalEntry->addUInt32Parameter("Index", nIndex); } - if (pTheMaterialMapping == nullptr) + if (pBeamSet == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseTheMaterialMapping(nullptr); - IVolumeDataComposite* pIVolumeDataComposite = dynamic_cast(pIBaseClass); - if (!pIVolumeDataComposite) + IBase* pBaseBeamSet(nullptr); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseTheMaterialMapping = pIVolumeDataComposite->GetMaterialMapping(nIndex); + pBaseBeamSet = pIBeamLattice->GetBeamSet(nIndex); - *pTheMaterialMapping = (IBase*)(pBaseTheMaterialMapping); + *pBeamSet = (IBase*)(pBaseBeamSet); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("TheMaterialMapping", *pTheMaterialMapping); + pJournalEntry->addHandleResult("BeamSet", *pBeamSet); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6893,27 +6939,29 @@ Lib3MFResult lib3mf_volumedatacomposite_getmaterialmapping(Lib3MF_VolumeDataComp } } -Lib3MFResult lib3mf_volumedatacomposite_addmaterialmapping(Lib3MF_VolumeDataComposite pVolumeDataComposite, const sLib3MFTransform * pTransform, Lib3MF_MaterialMapping * pTheMaterialMapping) + +/************************************************************************************************************************* + Class implementation for FunctionReference +**************************************************************************************************************************/ +Lib3MFResult lib3mf_functionreference_getfunctionresourceid(Lib3MF_FunctionReference pFunctionReference, Lib3MF_uint32 * pUniqueResourceID) { - IBase* pIBaseClass = (IBase *)pVolumeDataComposite; + IBase* pIBaseClass = (IBase *)pFunctionReference; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataComposite, "VolumeDataComposite", "AddMaterialMapping"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "GetFunctionResourceID"); } - if (pTheMaterialMapping == nullptr) + if (pUniqueResourceID == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseTheMaterialMapping(nullptr); - IVolumeDataComposite* pIVolumeDataComposite = dynamic_cast(pIBaseClass); - if (!pIVolumeDataComposite) + IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); + if (!pIFunctionReference) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseTheMaterialMapping = pIVolumeDataComposite->AddMaterialMapping(*pTransform); + *pUniqueResourceID = pIFunctionReference->GetFunctionResourceID(); - *pTheMaterialMapping = (IBase*)(pBaseTheMaterialMapping); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("TheMaterialMapping", *pTheMaterialMapping); + pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6929,21 +6977,21 @@ Lib3MFResult lib3mf_volumedatacomposite_addmaterialmapping(Lib3MF_VolumeDataComp } } -Lib3MFResult lib3mf_volumedatacomposite_removematerialmapping(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 nIndex) +Lib3MFResult lib3mf_functionreference_setfunctionresourceid(Lib3MF_FunctionReference pFunctionReference, Lib3MF_uint32 nUniqueResourceID) { - IBase* pIBaseClass = (IBase *)pVolumeDataComposite; + IBase* pIBaseClass = (IBase *)pFunctionReference; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataComposite, "VolumeDataComposite", "RemoveMaterialMapping"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "SetFunctionResourceID"); + pJournalEntry->addUInt32Parameter("UniqueResourceID", nUniqueResourceID); } - IVolumeDataComposite* pIVolumeDataComposite = dynamic_cast(pIBaseClass); - if (!pIVolumeDataComposite) + IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); + if (!pIFunctionReference) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIVolumeDataComposite->RemoveMaterialMapping(nIndex); + pIFunctionReference->SetFunctionResourceID(nUniqueResourceID); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -6961,51 +7009,24 @@ Lib3MFResult lib3mf_volumedatacomposite_removematerialmapping(Lib3MF_VolumeDataC } } - -/************************************************************************************************************************* - Class implementation for VolumeDataProperty -**************************************************************************************************************************/ -Lib3MFResult lib3mf_volumedataproperty_getname(Lib3MF_VolumeDataProperty pVolumeDataProperty, const Lib3MF_uint32 nPropertyNameBufferSize, Lib3MF_uint32* pPropertyNameNeededChars, char * pPropertyNameBuffer) +Lib3MFResult lib3mf_functionreference_gettransform(Lib3MF_FunctionReference pFunctionReference, sLib3MFTransform * pTransform) { - IBase* pIBaseClass = (IBase *)pVolumeDataProperty; + IBase* pIBaseClass = (IBase *)pFunctionReference; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataProperty, "VolumeDataProperty", "GetName"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "GetTransform"); } - if ( (!pPropertyNameBuffer) && !(pPropertyNameNeededChars) ) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sPropertyName(""); - IVolumeDataProperty* pIVolumeDataProperty = dynamic_cast(pIBaseClass); - if (!pIVolumeDataProperty) + if (pTransform == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); + if (!pIFunctionReference) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pPropertyNameBuffer == nullptr); - if (isCacheCall) { - sPropertyName = pIVolumeDataProperty->GetName(); + *pTransform = pIFunctionReference->GetTransform(); - pIVolumeDataProperty->_setCache (new ParameterCache_1 (sPropertyName)); - } - else { - auto cache = dynamic_cast*> (pIVolumeDataProperty->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sPropertyName); - pIVolumeDataProperty->_setCache (nullptr); - } - - if (pPropertyNameNeededChars) - *pPropertyNameNeededChars = (Lib3MF_uint32) (sPropertyName.size()+1); - if (pPropertyNameBuffer) { - if (sPropertyName.size() >= nPropertyNameBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iPropertyName = 0; iPropertyName < sPropertyName.size(); iPropertyName++) - pPropertyNameBuffer[iPropertyName] = sPropertyName[iPropertyName]; - pPropertyNameBuffer[sPropertyName.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("PropertyName", sPropertyName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7021,21 +7042,20 @@ Lib3MFResult lib3mf_volumedataproperty_getname(Lib3MF_VolumeDataProperty pVolume } } -Lib3MFResult lib3mf_volumedataproperty_setisrequired(Lib3MF_VolumeDataProperty pVolumeDataProperty, bool bIsRequired) +Lib3MFResult lib3mf_functionreference_settransform(Lib3MF_FunctionReference pFunctionReference, const sLib3MFTransform * pTransform) { - IBase* pIBaseClass = (IBase *)pVolumeDataProperty; + IBase* pIBaseClass = (IBase *)pFunctionReference; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataProperty, "VolumeDataProperty", "SetIsRequired"); - pJournalEntry->addBooleanParameter("IsRequired", bIsRequired); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "SetTransform"); } - IVolumeDataProperty* pIVolumeDataProperty = dynamic_cast(pIBaseClass); - if (!pIVolumeDataProperty) + IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); + if (!pIFunctionReference) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIVolumeDataProperty->SetIsRequired(bIsRequired); + pIFunctionReference->SetTransform(*pTransform); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -7053,25 +7073,47 @@ Lib3MFResult lib3mf_volumedataproperty_setisrequired(Lib3MF_VolumeDataProperty p } } -Lib3MFResult lib3mf_volumedataproperty_isrequired(Lib3MF_VolumeDataProperty pVolumeDataProperty, bool * pIsRequired) +Lib3MFResult lib3mf_functionreference_getchannelname(Lib3MF_FunctionReference pFunctionReference, const Lib3MF_uint32 nChannelNameBufferSize, Lib3MF_uint32* pChannelNameNeededChars, char * pChannelNameBuffer) { - IBase* pIBaseClass = (IBase *)pVolumeDataProperty; + IBase* pIBaseClass = (IBase *)pFunctionReference; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataProperty, "VolumeDataProperty", "IsRequired"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "GetChannelName"); } - if (pIsRequired == nullptr) + if ( (!pChannelNameBuffer) && !(pChannelNameNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IVolumeDataProperty* pIVolumeDataProperty = dynamic_cast(pIBaseClass); - if (!pIVolumeDataProperty) + std::string sChannelName(""); + IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); + if (!pIFunctionReference) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pIsRequired = pIVolumeDataProperty->IsRequired(); + bool isCacheCall = (pChannelNameBuffer == nullptr); + if (isCacheCall) { + sChannelName = pIFunctionReference->GetChannelName(); + pIFunctionReference->_setCache (new ParameterCache_1 (sChannelName)); + } + else { + auto cache = dynamic_cast*> (pIFunctionReference->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sChannelName); + pIFunctionReference->_setCache (nullptr); + } + + if (pChannelNameNeededChars) + *pChannelNameNeededChars = (Lib3MF_uint32) (sChannelName.size()+1); + if (pChannelNameBuffer) { + if (sChannelName.size() >= nChannelNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iChannelName = 0; iChannelName < sChannelName.size(); iChannelName++) + pChannelNameBuffer[iChannelName] = sChannelName[iChannelName]; + pChannelNameBuffer[sChannelName.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("IsRequired", *pIsRequired); + pJournalEntry->addStringResult("ChannelName", sChannelName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7087,31 +7129,26 @@ Lib3MFResult lib3mf_volumedataproperty_isrequired(Lib3MF_VolumeDataProperty pVol } } - -/************************************************************************************************************************* - Class implementation for VolumeData -**************************************************************************************************************************/ -Lib3MFResult lib3mf_volumedata_getcomposite(Lib3MF_VolumeData pVolumeData, Lib3MF_VolumeDataComposite * pTheCompositeData) +Lib3MFResult lib3mf_functionreference_setchannelname(Lib3MF_FunctionReference pFunctionReference, const char * pChannelName) { - IBase* pIBaseClass = (IBase *)pVolumeData; + IBase* pIBaseClass = (IBase *)pFunctionReference; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "GetComposite"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "SetChannelName"); + pJournalEntry->addStringParameter("ChannelName", pChannelName); } - if (pTheCompositeData == nullptr) + if (pChannelName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseTheCompositeData(nullptr); - IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); - if (!pIVolumeData) + std::string sChannelName(pChannelName); + IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); + if (!pIFunctionReference) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseTheCompositeData = pIVolumeData->GetComposite(); + pIFunctionReference->SetChannelName(sChannelName); - *pTheCompositeData = (IBase*)(pBaseTheCompositeData); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("TheCompositeData", *pTheCompositeData); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7127,27 +7164,23 @@ Lib3MFResult lib3mf_volumedata_getcomposite(Lib3MF_VolumeData pVolumeData, Lib3M } } -Lib3MFResult lib3mf_volumedata_createnewcomposite(Lib3MF_VolumeData pVolumeData, Lib3MF_VolumeDataComposite * pTheCompositeData) +Lib3MFResult lib3mf_functionreference_setminfeaturesize(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double dMinFeatureSize) { - IBase* pIBaseClass = (IBase *)pVolumeData; + IBase* pIBaseClass = (IBase *)pFunctionReference; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "CreateNewComposite"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "SetMinFeatureSize"); + pJournalEntry->addDoubleParameter("MinFeatureSize", dMinFeatureSize); } - if (pTheCompositeData == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseTheCompositeData(nullptr); - IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); - if (!pIVolumeData) + IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); + if (!pIFunctionReference) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseTheCompositeData = pIVolumeData->CreateNewComposite(); + pIFunctionReference->SetMinFeatureSize(dMinFeatureSize); - *pTheCompositeData = (IBase*)(pBaseTheCompositeData); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("TheCompositeData", *pTheCompositeData); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7163,22 +7196,25 @@ Lib3MFResult lib3mf_volumedata_createnewcomposite(Lib3MF_VolumeData pVolumeData, } } -Lib3MFResult lib3mf_volumedata_removecomposite(Lib3MF_VolumeData pVolumeData) +Lib3MFResult lib3mf_functionreference_getminfeaturesize(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double * pMinFeatureSize) { - IBase* pIBaseClass = (IBase *)pVolumeData; + IBase* pIBaseClass = (IBase *)pFunctionReference; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "RemoveComposite"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "GetMinFeatureSize"); } - IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); - if (!pIVolumeData) + if (pMinFeatureSize == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); + if (!pIFunctionReference) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIVolumeData->RemoveComposite(); + *pMinFeatureSize = pIFunctionReference->GetMinFeatureSize(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addDoubleResult("MinFeatureSize", *pMinFeatureSize); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7194,27 +7230,23 @@ Lib3MFResult lib3mf_volumedata_removecomposite(Lib3MF_VolumeData pVolumeData) } } -Lib3MFResult lib3mf_volumedata_getcolor(Lib3MF_VolumeData pVolumeData, Lib3MF_VolumeDataColor * pTheColorData) +Lib3MFResult lib3mf_functionreference_setfallbackvalue(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double dFallBackValue) { - IBase* pIBaseClass = (IBase *)pVolumeData; + IBase* pIBaseClass = (IBase *)pFunctionReference; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "GetColor"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "SetFallBackValue"); + pJournalEntry->addDoubleParameter("FallBackValue", dFallBackValue); } - if (pTheColorData == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseTheColorData(nullptr); - IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); - if (!pIVolumeData) + IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); + if (!pIFunctionReference) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseTheColorData = pIVolumeData->GetColor(); + pIFunctionReference->SetFallBackValue(dFallBackValue); - *pTheColorData = (IBase*)(pBaseTheColorData); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("TheColorData", *pTheColorData); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7230,33 +7262,25 @@ Lib3MFResult lib3mf_volumedata_getcolor(Lib3MF_VolumeData pVolumeData, Lib3MF_Vo } } -Lib3MFResult lib3mf_volumedata_createnewcolor(Lib3MF_VolumeData pVolumeData, Lib3MF_Function pTheFunction, Lib3MF_VolumeDataColor * pTheColorData) +Lib3MFResult lib3mf_functionreference_getfallbackvalue(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double * pFallBackValue) { - IBase* pIBaseClass = (IBase *)pVolumeData; + IBase* pIBaseClass = (IBase *)pFunctionReference; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "CreateNewColor"); - pJournalEntry->addHandleParameter("TheFunction", pTheFunction); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionReference, "FunctionReference", "GetFallBackValue"); } - if (pTheColorData == nullptr) + if (pFallBackValue == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pIBaseClassTheFunction = (IBase *)pTheFunction; - IFunction* pITheFunction = dynamic_cast(pIBaseClassTheFunction); - if (!pITheFunction) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); - - IBase* pBaseTheColorData(nullptr); - IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); - if (!pIVolumeData) + IFunctionReference* pIFunctionReference = dynamic_cast(pIBaseClass); + if (!pIFunctionReference) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseTheColorData = pIVolumeData->CreateNewColor(pITheFunction); + *pFallBackValue = pIFunctionReference->GetFallBackValue(); - *pTheColorData = (IBase*)(pBaseTheColorData); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("TheColorData", *pTheColorData); + pJournalEntry->addDoubleResult("FallBackValue", *pFallBackValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7272,56 +7296,39 @@ Lib3MFResult lib3mf_volumedata_createnewcolor(Lib3MF_VolumeData pVolumeData, Lib } } -Lib3MFResult lib3mf_volumedata_removecolor(Lib3MF_VolumeData pVolumeData) -{ - IBase* pIBaseClass = (IBase *)pVolumeData; - PLib3MFInterfaceJournalEntry pJournalEntry; - try { - if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "RemoveColor"); - } - IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); - if (!pIVolumeData) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - - pIVolumeData->RemoveColor(); +/************************************************************************************************************************* + Class implementation for VolumeDataColor +**************************************************************************************************************************/ - if (pJournalEntry.get() != nullptr) { - pJournalEntry->writeSuccess(); - } - return LIB3MF_SUCCESS; - } - catch (ELib3MFInterfaceException & Exception) { - return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); - } - catch (std::exception & StdException) { - return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); - } - catch (...) { - return handleUnhandledException(pIBaseClass, pJournalEntry.get()); - } -} +/************************************************************************************************************************* + Class implementation for MaterialMapping +**************************************************************************************************************************/ -Lib3MFResult lib3mf_volumedata_getpropertycount(Lib3MF_VolumeData pVolumeData, Lib3MF_uint32 * pCount) +/************************************************************************************************************************* + Class implementation for VolumeDataComposite +**************************************************************************************************************************/ +Lib3MFResult lib3mf_volumedatacomposite_getbasematerialgroup(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance) { - IBase* pIBaseClass = (IBase *)pVolumeData; + IBase* pIBaseClass = (IBase *)pVolumeDataComposite; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "GetPropertyCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataComposite, "VolumeDataComposite", "GetBaseMaterialGroup"); } - if (pCount == nullptr) + if (pBaseMaterialGroupInstance == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); - if (!pIVolumeData) + IBase* pBaseBaseMaterialGroupInstance(nullptr); + IVolumeDataComposite* pIVolumeDataComposite = dynamic_cast(pIBaseClass); + if (!pIVolumeDataComposite) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIVolumeData->GetPropertyCount(); + pBaseBaseMaterialGroupInstance = pIVolumeDataComposite->GetBaseMaterialGroup(); + *pBaseMaterialGroupInstance = (IBase*)(pBaseBaseMaterialGroupInstance); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->addHandleResult("BaseMaterialGroupInstance", *pBaseMaterialGroupInstance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7337,28 +7344,28 @@ Lib3MFResult lib3mf_volumedata_getpropertycount(Lib3MF_VolumeData pVolumeData, L } } -Lib3MFResult lib3mf_volumedata_getproperty(Lib3MF_VolumeData pVolumeData, Lib3MF_uint32 nIndex, Lib3MF_VolumeDataProperty * pTheVolumeDataProperty) +Lib3MFResult lib3mf_volumedatacomposite_setbasematerialgroup(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_BaseMaterialGroup pBaseMaterialGroupInstance) { - IBase* pIBaseClass = (IBase *)pVolumeData; + IBase* pIBaseClass = (IBase *)pVolumeDataComposite; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "GetProperty"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataComposite, "VolumeDataComposite", "SetBaseMaterialGroup"); + pJournalEntry->addHandleParameter("BaseMaterialGroupInstance", pBaseMaterialGroupInstance); } - if (pTheVolumeDataProperty == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseTheVolumeDataProperty(nullptr); - IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); - if (!pIVolumeData) + IBase* pIBaseClassBaseMaterialGroupInstance = (IBase *)pBaseMaterialGroupInstance; + IBaseMaterialGroup* pIBaseMaterialGroupInstance = dynamic_cast(pIBaseClassBaseMaterialGroupInstance); + if (!pIBaseMaterialGroupInstance) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IVolumeDataComposite* pIVolumeDataComposite = dynamic_cast(pIBaseClass); + if (!pIVolumeDataComposite) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseTheVolumeDataProperty = pIVolumeData->GetProperty(nIndex); + pIVolumeDataComposite->SetBaseMaterialGroup(pIBaseMaterialGroupInstance); - *pTheVolumeDataProperty = (IBase*)(pBaseTheVolumeDataProperty); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("TheVolumeDataProperty", *pTheVolumeDataProperty); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7374,37 +7381,25 @@ Lib3MFResult lib3mf_volumedata_getproperty(Lib3MF_VolumeData pVolumeData, Lib3MF } } -Lib3MFResult lib3mf_volumedata_addpropertyfromfunction(Lib3MF_VolumeData pVolumeData, const char * pName, Lib3MF_Function pTheFunction, Lib3MF_VolumeDataProperty * pTheVolumeDataProperty) +Lib3MFResult lib3mf_volumedatacomposite_getmaterialmappingcount(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pVolumeData; + IBase* pIBaseClass = (IBase *)pVolumeDataComposite; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "AddPropertyFromFunction"); - pJournalEntry->addStringParameter("Name", pName); - pJournalEntry->addHandleParameter("TheFunction", pTheFunction); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataComposite, "VolumeDataComposite", "GetMaterialMappingCount"); } - if (pName == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pTheVolumeDataProperty == nullptr) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sName(pName); - IBase* pIBaseClassTheFunction = (IBase *)pTheFunction; - IFunction* pITheFunction = dynamic_cast(pIBaseClassTheFunction); - if (!pITheFunction) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); - - IBase* pBaseTheVolumeDataProperty(nullptr); - IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); - if (!pIVolumeData) + IVolumeDataComposite* pIVolumeDataComposite = dynamic_cast(pIBaseClass); + if (!pIVolumeDataComposite) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseTheVolumeDataProperty = pIVolumeData->AddPropertyFromFunction(sName, pITheFunction); + *pCount = pIVolumeDataComposite->GetMaterialMappingCount(); - *pTheVolumeDataProperty = (IBase*)(pBaseTheVolumeDataProperty); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("TheVolumeDataProperty", *pTheVolumeDataProperty); + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7420,23 +7415,28 @@ Lib3MFResult lib3mf_volumedata_addpropertyfromfunction(Lib3MF_VolumeData pVolume } } -Lib3MFResult lib3mf_volumedata_removeproperty(Lib3MF_VolumeData pVolumeData, Lib3MF_uint32 nIndex) +Lib3MFResult lib3mf_volumedatacomposite_getmaterialmapping(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 nIndex, Lib3MF_MaterialMapping * pTheMaterialMapping) { - IBase* pIBaseClass = (IBase *)pVolumeData; + IBase* pIBaseClass = (IBase *)pVolumeDataComposite; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "RemoveProperty"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataComposite, "VolumeDataComposite", "GetMaterialMapping"); pJournalEntry->addUInt32Parameter("Index", nIndex); } - IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); - if (!pIVolumeData) + if (pTheMaterialMapping == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseTheMaterialMapping(nullptr); + IVolumeDataComposite* pIVolumeDataComposite = dynamic_cast(pIBaseClass); + if (!pIVolumeDataComposite) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIVolumeData->RemoveProperty(nIndex); + pBaseTheMaterialMapping = pIVolumeDataComposite->GetMaterialMapping(nIndex); + *pTheMaterialMapping = (IBase*)(pBaseTheMaterialMapping); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("TheMaterialMapping", *pTheMaterialMapping); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7452,31 +7452,27 @@ Lib3MFResult lib3mf_volumedata_removeproperty(Lib3MF_VolumeData pVolumeData, Lib } } - -/************************************************************************************************************************* - Class implementation for Component -**************************************************************************************************************************/ -Lib3MFResult lib3mf_component_getobjectresource(Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource) +Lib3MFResult lib3mf_volumedatacomposite_addmaterialmapping(Lib3MF_VolumeDataComposite pVolumeDataComposite, const sLib3MFTransform * pTransform, Lib3MF_MaterialMapping * pTheMaterialMapping) { - IBase* pIBaseClass = (IBase *)pComponent; + IBase* pIBaseClass = (IBase *)pVolumeDataComposite; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "GetObjectResource"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataComposite, "VolumeDataComposite", "AddMaterialMapping"); } - if (pObjectResource == nullptr) + if (pTheMaterialMapping == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseObjectResource(nullptr); - IComponent* pIComponent = dynamic_cast(pIBaseClass); - if (!pIComponent) + IBase* pBaseTheMaterialMapping(nullptr); + IVolumeDataComposite* pIVolumeDataComposite = dynamic_cast(pIBaseClass); + if (!pIVolumeDataComposite) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseObjectResource = pIComponent->GetObjectResource(); + pBaseTheMaterialMapping = pIVolumeDataComposite->AddMaterialMapping(*pTransform); - *pObjectResource = (IBase*)(pBaseObjectResource); + *pTheMaterialMapping = (IBase*)(pBaseTheMaterialMapping); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("ObjectResource", *pObjectResource); + pJournalEntry->addHandleResult("TheMaterialMapping", *pTheMaterialMapping); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7492,25 +7488,23 @@ Lib3MFResult lib3mf_component_getobjectresource(Lib3MF_Component pComponent, Lib } } -Lib3MFResult lib3mf_component_getobjectresourceid(Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID) +Lib3MFResult lib3mf_volumedatacomposite_removematerialmapping(Lib3MF_VolumeDataComposite pVolumeDataComposite, Lib3MF_uint32 nIndex) { - IBase* pIBaseClass = (IBase *)pComponent; + IBase* pIBaseClass = (IBase *)pVolumeDataComposite; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "GetObjectResourceID"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataComposite, "VolumeDataComposite", "RemoveMaterialMapping"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if (pUniqueResourceID == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IComponent* pIComponent = dynamic_cast(pIBaseClass); - if (!pIComponent) + IVolumeDataComposite* pIVolumeDataComposite = dynamic_cast(pIBaseClass); + if (!pIVolumeDataComposite) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pUniqueResourceID = pIComponent->GetObjectResourceID(); + pIVolumeDataComposite->RemoveMaterialMapping(nIndex); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7526,50 +7520,51 @@ Lib3MFResult lib3mf_component_getobjectresourceid(Lib3MF_Component pComponent, L } } -Lib3MFResult lib3mf_component_getuuid(Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) + +/************************************************************************************************************************* + Class implementation for VolumeDataProperty +**************************************************************************************************************************/ +Lib3MFResult lib3mf_volumedataproperty_getname(Lib3MF_VolumeDataProperty pVolumeDataProperty, const Lib3MF_uint32 nPropertyNameBufferSize, Lib3MF_uint32* pPropertyNameNeededChars, char * pPropertyNameBuffer) { - IBase* pIBaseClass = (IBase *)pComponent; + IBase* pIBaseClass = (IBase *)pVolumeDataProperty; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "GetUUID"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataProperty, "VolumeDataProperty", "GetName"); } - if (!pHasUUID) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if ( (!pUUIDBuffer) && !(pUUIDNeededChars) ) + if ( (!pPropertyNameBuffer) && !(pPropertyNameNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sUUID(""); - IComponent* pIComponent = dynamic_cast(pIBaseClass); - if (!pIComponent) + std::string sPropertyName(""); + IVolumeDataProperty* pIVolumeDataProperty = dynamic_cast(pIBaseClass); + if (!pIVolumeDataProperty) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pUUIDBuffer == nullptr); + bool isCacheCall = (pPropertyNameBuffer == nullptr); if (isCacheCall) { - sUUID = pIComponent->GetUUID(*pHasUUID); + sPropertyName = pIVolumeDataProperty->GetName(); - pIComponent->_setCache (new ParameterCache_2 (*pHasUUID, sUUID)); + pIVolumeDataProperty->_setCache (new ParameterCache_1 (sPropertyName)); } else { - auto cache = dynamic_cast*> (pIComponent->_getCache ()); + auto cache = dynamic_cast*> (pIVolumeDataProperty->_getCache ()); if (cache == nullptr) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (*pHasUUID, sUUID); - pIComponent->_setCache (nullptr); + cache->retrieveData (sPropertyName); + pIVolumeDataProperty->_setCache (nullptr); } - if (pUUIDNeededChars) - *pUUIDNeededChars = (Lib3MF_uint32) (sUUID.size()+1); - if (pUUIDBuffer) { - if (sUUID.size() >= nUUIDBufferSize) + if (pPropertyNameNeededChars) + *pPropertyNameNeededChars = (Lib3MF_uint32) (sPropertyName.size()+1); + if (pPropertyNameBuffer) { + if (sPropertyName.size() >= nPropertyNameBufferSize) throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iUUID = 0; iUUID < sUUID.size(); iUUID++) - pUUIDBuffer[iUUID] = sUUID[iUUID]; - pUUIDBuffer[sUUID.size()] = 0; + for (size_t iPropertyName = 0; iPropertyName < sPropertyName.size(); iPropertyName++) + pPropertyNameBuffer[iPropertyName] = sPropertyName[iPropertyName]; + pPropertyNameBuffer[sPropertyName.size()] = 0; } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("HasUUID", *pHasUUID); - pJournalEntry->addStringResult("UUID", sUUID.c_str()); + pJournalEntry->addStringResult("PropertyName", sPropertyName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7585,24 +7580,21 @@ Lib3MFResult lib3mf_component_getuuid(Lib3MF_Component pComponent, bool * pHasUU } } -Lib3MFResult lib3mf_component_setuuid(Lib3MF_Component pComponent, const char * pUUID) +Lib3MFResult lib3mf_volumedataproperty_setisrequired(Lib3MF_VolumeDataProperty pVolumeDataProperty, bool bIsRequired) { - IBase* pIBaseClass = (IBase *)pComponent; + IBase* pIBaseClass = (IBase *)pVolumeDataProperty; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "SetUUID"); - pJournalEntry->addStringParameter("UUID", pUUID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataProperty, "VolumeDataProperty", "SetIsRequired"); + pJournalEntry->addBooleanParameter("IsRequired", bIsRequired); } - if (pUUID == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sUUID(pUUID); - IComponent* pIComponent = dynamic_cast(pIBaseClass); - if (!pIComponent) + IVolumeDataProperty* pIVolumeDataProperty = dynamic_cast(pIBaseClass); + if (!pIVolumeDataProperty) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIComponent->SetUUID(sUUID); + pIVolumeDataProperty->SetIsRequired(bIsRequired); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -7620,25 +7612,25 @@ Lib3MFResult lib3mf_component_setuuid(Lib3MF_Component pComponent, const char * } } -Lib3MFResult lib3mf_component_hastransform(Lib3MF_Component pComponent, bool * pHasTransform) +Lib3MFResult lib3mf_volumedataproperty_isrequired(Lib3MF_VolumeDataProperty pVolumeDataProperty, bool * pIsRequired) { - IBase* pIBaseClass = (IBase *)pComponent; + IBase* pIBaseClass = (IBase *)pVolumeDataProperty; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "HasTransform"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeDataProperty, "VolumeDataProperty", "IsRequired"); } - if (pHasTransform == nullptr) + if (pIsRequired == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IComponent* pIComponent = dynamic_cast(pIBaseClass); - if (!pIComponent) + IVolumeDataProperty* pIVolumeDataProperty = dynamic_cast(pIBaseClass); + if (!pIVolumeDataProperty) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pHasTransform = pIComponent->HasTransform(); + *pIsRequired = pIVolumeDataProperty->IsRequired(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("HasTransform", *pHasTransform); + pJournalEntry->addBooleanResult("IsRequired", *pIsRequired); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7654,24 +7646,31 @@ Lib3MFResult lib3mf_component_hastransform(Lib3MF_Component pComponent, bool * p } } -Lib3MFResult lib3mf_component_gettransform(Lib3MF_Component pComponent, sLib3MFTransform * pTransform) + +/************************************************************************************************************************* + Class implementation for VolumeData +**************************************************************************************************************************/ +Lib3MFResult lib3mf_volumedata_getcomposite(Lib3MF_VolumeData pVolumeData, Lib3MF_VolumeDataComposite * pTheCompositeData) { - IBase* pIBaseClass = (IBase *)pComponent; + IBase* pIBaseClass = (IBase *)pVolumeData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "GetTransform"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "GetComposite"); } - if (pTransform == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IComponent* pIComponent = dynamic_cast(pIBaseClass); - if (!pIComponent) + if (pTheCompositeData == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseTheCompositeData(nullptr); + IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); + if (!pIVolumeData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pTransform = pIComponent->GetTransform(); + pBaseTheCompositeData = pIVolumeData->GetComposite(); + *pTheCompositeData = (IBase*)(pBaseTheCompositeData); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("TheCompositeData", *pTheCompositeData); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7687,22 +7686,27 @@ Lib3MFResult lib3mf_component_gettransform(Lib3MF_Component pComponent, sLib3MFT } } -Lib3MFResult lib3mf_component_settransform(Lib3MF_Component pComponent, const sLib3MFTransform * pTransform) +Lib3MFResult lib3mf_volumedata_createnewcomposite(Lib3MF_VolumeData pVolumeData, Lib3MF_VolumeDataComposite * pTheCompositeData) { - IBase* pIBaseClass = (IBase *)pComponent; + IBase* pIBaseClass = (IBase *)pVolumeData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "SetTransform"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "CreateNewComposite"); } - IComponent* pIComponent = dynamic_cast(pIBaseClass); - if (!pIComponent) + if (pTheCompositeData == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseTheCompositeData(nullptr); + IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); + if (!pIVolumeData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIComponent->SetTransform(*pTransform); + pBaseTheCompositeData = pIVolumeData->CreateNewComposite(); + *pTheCompositeData = (IBase*)(pBaseTheCompositeData); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("TheCompositeData", *pTheCompositeData); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7718,37 +7722,22 @@ Lib3MFResult lib3mf_component_settransform(Lib3MF_Component pComponent, const sL } } - -/************************************************************************************************************************* - Class implementation for ComponentsObject -**************************************************************************************************************************/ -Lib3MFResult lib3mf_componentsobject_addcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const sLib3MFTransform * pTransform, Lib3MF_Component * pComponentInstance) +Lib3MFResult lib3mf_volumedata_removecomposite(Lib3MF_VolumeData pVolumeData) { - IBase* pIBaseClass = (IBase *)pComponentsObject; + IBase* pIBaseClass = (IBase *)pVolumeData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponentsObject, "ComponentsObject", "AddComponent"); - pJournalEntry->addHandleParameter("ObjectResource", pObjectResource); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "RemoveComposite"); } - if (pComponentInstance == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pIBaseClassObjectResource = (IBase *)pObjectResource; - IObject* pIObjectResource = dynamic_cast(pIBaseClassObjectResource); - if (!pIObjectResource) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); - - IBase* pBaseComponentInstance(nullptr); - IComponentsObject* pIComponentsObject = dynamic_cast(pIBaseClass); - if (!pIComponentsObject) + IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); + if (!pIVolumeData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseComponentInstance = pIComponentsObject->AddComponent(pIObjectResource, *pTransform); + pIVolumeData->RemoveComposite(); - *pComponentInstance = (IBase*)(pBaseComponentInstance); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("ComponentInstance", *pComponentInstance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7764,28 +7753,27 @@ Lib3MFResult lib3mf_componentsobject_addcomponent(Lib3MF_ComponentsObject pCompo } } -Lib3MFResult lib3mf_componentsobject_getcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance) +Lib3MFResult lib3mf_volumedata_getcolor(Lib3MF_VolumeData pVolumeData, Lib3MF_VolumeDataColor * pTheColorData) { - IBase* pIBaseClass = (IBase *)pComponentsObject; + IBase* pIBaseClass = (IBase *)pVolumeData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponentsObject, "ComponentsObject", "GetComponent"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "GetColor"); } - if (pComponentInstance == nullptr) + if (pTheColorData == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseComponentInstance(nullptr); - IComponentsObject* pIComponentsObject = dynamic_cast(pIBaseClass); - if (!pIComponentsObject) + IBase* pBaseTheColorData(nullptr); + IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); + if (!pIVolumeData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseComponentInstance = pIComponentsObject->GetComponent(nIndex); + pBaseTheColorData = pIVolumeData->GetColor(); - *pComponentInstance = (IBase*)(pBaseComponentInstance); + *pTheColorData = (IBase*)(pBaseTheColorData); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("ComponentInstance", *pComponentInstance); + pJournalEntry->addHandleResult("TheColorData", *pTheColorData); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7801,25 +7789,33 @@ Lib3MFResult lib3mf_componentsobject_getcomponent(Lib3MF_ComponentsObject pCompo } } -Lib3MFResult lib3mf_componentsobject_getcomponentcount(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_volumedata_createnewcolor(Lib3MF_VolumeData pVolumeData, Lib3MF_Function pTheFunction, Lib3MF_VolumeDataColor * pTheColorData) { - IBase* pIBaseClass = (IBase *)pComponentsObject; + IBase* pIBaseClass = (IBase *)pVolumeData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponentsObject, "ComponentsObject", "GetComponentCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "CreateNewColor"); + pJournalEntry->addHandleParameter("TheFunction", pTheFunction); } - if (pCount == nullptr) + if (pTheColorData == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IComponentsObject* pIComponentsObject = dynamic_cast(pIBaseClass); - if (!pIComponentsObject) + IBase* pIBaseClassTheFunction = (IBase *)pTheFunction; + IFunction* pITheFunction = dynamic_cast(pIBaseClassTheFunction); + if (!pITheFunction) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IBase* pBaseTheColorData(nullptr); + IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); + if (!pIVolumeData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIComponentsObject->GetComponentCount(); + pBaseTheColorData = pIVolumeData->CreateNewColor(pITheFunction); + *pTheColorData = (IBase*)(pBaseTheColorData); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->addHandleResult("TheColorData", *pTheColorData); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7835,28 +7831,20 @@ Lib3MFResult lib3mf_componentsobject_getcomponentcount(Lib3MF_ComponentsObject p } } - -/************************************************************************************************************************* - Class implementation for BeamSet -**************************************************************************************************************************/ -Lib3MFResult lib3mf_beamset_setname(Lib3MF_BeamSet pBeamSet, const char * pName) +Lib3MFResult lib3mf_volumedata_removecolor(Lib3MF_VolumeData pVolumeData) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pVolumeData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "SetName"); - pJournalEntry->addStringParameter("Name", pName); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "RemoveColor"); } - if (pName == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sName(pName); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); + if (!pIVolumeData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamSet->SetName(sName); + pIVolumeData->RemoveColor(); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -7874,47 +7862,25 @@ Lib3MFResult lib3mf_beamset_setname(Lib3MF_BeamSet pBeamSet, const char * pName) } } -Lib3MFResult lib3mf_beamset_getname(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) +Lib3MFResult lib3mf_volumedata_getpropertycount(Lib3MF_VolumeData pVolumeData, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pVolumeData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetName"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "GetPropertyCount"); } - if ( (!pNameBuffer) && !(pNameNeededChars) ) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sName(""); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); + if (!pIVolumeData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pNameBuffer == nullptr); - if (isCacheCall) { - sName = pIBeamSet->GetName(); + *pCount = pIVolumeData->GetPropertyCount(); - pIBeamSet->_setCache (new ParameterCache_1 (sName)); - } - else { - auto cache = dynamic_cast*> (pIBeamSet->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sName); - pIBeamSet->_setCache (nullptr); - } - - if (pNameNeededChars) - *pNameNeededChars = (Lib3MF_uint32) (sName.size()+1); - if (pNameBuffer) { - if (sName.size() >= nNameBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iName = 0; iName < sName.size(); iName++) - pNameBuffer[iName] = sName[iName]; - pNameBuffer[sName.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Name", sName.c_str()); + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7930,26 +7896,28 @@ Lib3MFResult lib3mf_beamset_getname(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 } } -Lib3MFResult lib3mf_beamset_setidentifier(Lib3MF_BeamSet pBeamSet, const char * pIdentifier) +Lib3MFResult lib3mf_volumedata_getproperty(Lib3MF_VolumeData pVolumeData, Lib3MF_uint32 nIndex, Lib3MF_VolumeDataProperty * pTheVolumeDataProperty) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pVolumeData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "SetIdentifier"); - pJournalEntry->addStringParameter("Identifier", pIdentifier); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "GetProperty"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if (pIdentifier == nullptr) + if (pTheVolumeDataProperty == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sIdentifier(pIdentifier); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + IBase* pBaseTheVolumeDataProperty(nullptr); + IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); + if (!pIVolumeData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamSet->SetIdentifier(sIdentifier); + pBaseTheVolumeDataProperty = pIVolumeData->GetProperty(nIndex); + *pTheVolumeDataProperty = (IBase*)(pBaseTheVolumeDataProperty); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("TheVolumeDataProperty", *pTheVolumeDataProperty); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7965,48 +7933,38 @@ Lib3MFResult lib3mf_beamset_setidentifier(Lib3MF_BeamSet pBeamSet, const char * } } -Lib3MFResult lib3mf_beamset_getidentifier(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer) +Lib3MFResult lib3mf_volumedata_addpropertyfromfunction(Lib3MF_VolumeData pVolumeData, const char * pName, Lib3MF_Function pTheFunction, Lib3MF_VolumeDataProperty * pTheVolumeDataProperty) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pVolumeData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetIdentifier"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "AddPropertyFromFunction"); + pJournalEntry->addStringParameter("Name", pName); + pJournalEntry->addHandleParameter("TheFunction", pTheFunction); } - if ( (!pIdentifierBuffer) && !(pIdentifierNeededChars) ) + if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sIdentifier(""); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + if (pTheVolumeDataProperty == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + IBase* pIBaseClassTheFunction = (IBase *)pTheFunction; + IFunction* pITheFunction = dynamic_cast(pIBaseClassTheFunction); + if (!pITheFunction) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IBase* pBaseTheVolumeDataProperty(nullptr); + IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); + if (!pIVolumeData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pIdentifierBuffer == nullptr); - if (isCacheCall) { - sIdentifier = pIBeamSet->GetIdentifier(); + pBaseTheVolumeDataProperty = pIVolumeData->AddPropertyFromFunction(sName, pITheFunction); - pIBeamSet->_setCache (new ParameterCache_1 (sIdentifier)); - } - else { - auto cache = dynamic_cast*> (pIBeamSet->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sIdentifier); - pIBeamSet->_setCache (nullptr); - } - - if (pIdentifierNeededChars) - *pIdentifierNeededChars = (Lib3MF_uint32) (sIdentifier.size()+1); - if (pIdentifierBuffer) { - if (sIdentifier.size() >= nIdentifierBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iIdentifier = 0; iIdentifier < sIdentifier.size(); iIdentifier++) - pIdentifierBuffer[iIdentifier] = sIdentifier[iIdentifier]; - pIdentifierBuffer[sIdentifier.size()] = 0; - } - if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Identifier", sIdentifier.c_str()); - pJournalEntry->writeSuccess(); + *pTheVolumeDataProperty = (IBase*)(pBaseTheVolumeDataProperty); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("TheVolumeDataProperty", *pTheVolumeDataProperty); + pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; } @@ -8021,25 +7979,23 @@ Lib3MFResult lib3mf_beamset_getidentifier(Lib3MF_BeamSet pBeamSet, const Lib3MF_ } } -Lib3MFResult lib3mf_beamset_getreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_volumedata_removeproperty(Lib3MF_VolumeData pVolumeData, Lib3MF_uint32 nIndex) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pVolumeData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetReferenceCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pVolumeData, "VolumeData", "RemoveProperty"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if (pCount == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + IVolumeData* pIVolumeData = dynamic_cast(pIBaseClass); + if (!pIVolumeData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIBeamSet->GetReferenceCount(); + pIVolumeData->RemoveProperty(nIndex); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8055,24 +8011,31 @@ Lib3MFResult lib3mf_beamset_getreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_ui } } -Lib3MFResult lib3mf_beamset_setreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer) + +/************************************************************************************************************************* + Class implementation for Component +**************************************************************************************************************************/ +Lib3MFResult lib3mf_component_getobjectresource(Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pComponent; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "SetReferences"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "GetObjectResource"); } - if ( (!pReferencesBuffer) && (nReferencesBufferSize>0)) + if (pObjectResource == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + IBase* pBaseObjectResource(nullptr); + IComponent* pIComponent = dynamic_cast(pIBaseClass); + if (!pIComponent) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamSet->SetReferences(nReferencesBufferSize, pReferencesBuffer); + pBaseObjectResource = pIComponent->GetObjectResource(); + *pObjectResource = (IBase*)(pBaseObjectResource); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("ObjectResource", *pObjectResource); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8088,24 +8051,25 @@ Lib3MFResult lib3mf_beamset_setreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 } } -Lib3MFResult lib3mf_beamset_getreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer) +Lib3MFResult lib3mf_component_getobjectresourceid(Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pComponent; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetReferences"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "GetObjectResourceID"); } - if ((!pReferencesBuffer) && !(pReferencesNeededCount)) + if (pUniqueResourceID == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + IComponent* pIComponent = dynamic_cast(pIBaseClass); + if (!pIComponent) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamSet->GetReferences(nReferencesBufferSize, pReferencesNeededCount, pReferencesBuffer); + *pUniqueResourceID = pIComponent->GetObjectResourceID(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8121,25 +8085,50 @@ Lib3MFResult lib3mf_beamset_getreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_ } } -Lib3MFResult lib3mf_beamset_getballreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_component_getuuid(Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pComponent; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetBallReferenceCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "GetUUID"); } - if (pCount == nullptr) + if (!pHasUUID) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + if ( (!pUUIDBuffer) && !(pUUIDNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sUUID(""); + IComponent* pIComponent = dynamic_cast(pIBaseClass); + if (!pIComponent) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIBeamSet->GetBallReferenceCount(); + bool isCacheCall = (pUUIDBuffer == nullptr); + if (isCacheCall) { + sUUID = pIComponent->GetUUID(*pHasUUID); + pIComponent->_setCache (new ParameterCache_2 (*pHasUUID, sUUID)); + } + else { + auto cache = dynamic_cast*> (pIComponent->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (*pHasUUID, sUUID); + pIComponent->_setCache (nullptr); + } + + if (pUUIDNeededChars) + *pUUIDNeededChars = (Lib3MF_uint32) (sUUID.size()+1); + if (pUUIDBuffer) { + if (sUUID.size() >= nUUIDBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iUUID = 0; iUUID < sUUID.size(); iUUID++) + pUUIDBuffer[iUUID] = sUUID[iUUID]; + pUUIDBuffer[sUUID.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->addBooleanResult("HasUUID", *pHasUUID); + pJournalEntry->addStringResult("UUID", sUUID.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8155,22 +8144,24 @@ Lib3MFResult lib3mf_beamset_getballreferencecount(Lib3MF_BeamSet pBeamSet, Lib3M } } -Lib3MFResult lib3mf_beamset_setballreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer) +Lib3MFResult lib3mf_component_setuuid(Lib3MF_Component pComponent, const char * pUUID) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pComponent; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "SetBallReferences"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "SetUUID"); + pJournalEntry->addStringParameter("UUID", pUUID); } - if ( (!pBallReferencesBuffer) && (nBallReferencesBufferSize>0)) + if (pUUID == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + std::string sUUID(pUUID); + IComponent* pIComponent = dynamic_cast(pIBaseClass); + if (!pIComponent) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamSet->SetBallReferences(nBallReferencesBufferSize, pBallReferencesBuffer); + pIComponent->SetUUID(sUUID); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -8188,24 +8179,25 @@ Lib3MFResult lib3mf_beamset_setballreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_ui } } -Lib3MFResult lib3mf_beamset_getballreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer) +Lib3MFResult lib3mf_component_hastransform(Lib3MF_Component pComponent, bool * pHasTransform) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pComponent; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetBallReferences"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "HasTransform"); } - if ((!pBallReferencesBuffer) && !(pBallReferencesNeededCount)) + if (pHasTransform == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + IComponent* pIComponent = dynamic_cast(pIBaseClass); + if (!pIComponent) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamSet->GetBallReferences(nBallReferencesBufferSize, pBallReferencesNeededCount, pBallReferencesBuffer); + *pHasTransform = pIComponent->HasTransform(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("HasTransform", *pHasTransform); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8221,29 +8213,24 @@ Lib3MFResult lib3mf_beamset_getballreferences(Lib3MF_BeamSet pBeamSet, const Lib } } - -/************************************************************************************************************************* - Class implementation for BaseMaterialGroup -**************************************************************************************************************************/ -Lib3MFResult lib3mf_basematerialgroup_getcount(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_component_gettransform(Lib3MF_Component pComponent, sLib3MFTransform * pTransform) { - IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + IBase* pIBaseClass = (IBase *)pComponent; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "GetCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "GetTransform"); } - if (pCount == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); - if (!pIBaseMaterialGroup) + if (pTransform == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IComponent* pIComponent = dynamic_cast(pIBaseClass); + if (!pIComponent) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIBaseMaterialGroup->GetCount(); + *pTransform = pIComponent->GetTransform(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8259,22 +8246,20 @@ Lib3MFResult lib3mf_basematerialgroup_getcount(Lib3MF_BaseMaterialGroup pBaseMat } } -Lib3MFResult lib3mf_basematerialgroup_getallpropertyids(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult lib3mf_component_settransform(Lib3MF_Component pComponent, const sLib3MFTransform * pTransform) { - IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + IBase* pIBaseClass = (IBase *)pComponent; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "GetAllPropertyIDs"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "SetTransform"); } - if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); - if (!pIBaseMaterialGroup) + IComponent* pIComponent = dynamic_cast(pIBaseClass); + if (!pIComponent) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBaseMaterialGroup->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + pIComponent->SetTransform(*pTransform); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -8292,29 +8277,37 @@ Lib3MFResult lib3mf_basematerialgroup_getallpropertyids(Lib3MF_BaseMaterialGroup } } -Lib3MFResult lib3mf_basematerialgroup_addmaterial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const sLib3MFColor * pDisplayColor, Lib3MF_uint32 * pPropertyID) + +/************************************************************************************************************************* + Class implementation for ComponentsObject +**************************************************************************************************************************/ +Lib3MFResult lib3mf_componentsobject_addcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const sLib3MFTransform * pTransform, Lib3MF_Component * pComponentInstance) { - IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + IBase* pIBaseClass = (IBase *)pComponentsObject; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "AddMaterial"); - pJournalEntry->addStringParameter("Name", pName); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponentsObject, "ComponentsObject", "AddComponent"); + pJournalEntry->addHandleParameter("ObjectResource", pObjectResource); } - if (pName == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pPropertyID == nullptr) + if (pComponentInstance == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sName(pName); - IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); - if (!pIBaseMaterialGroup) + IBase* pIBaseClassObjectResource = (IBase *)pObjectResource; + IObject* pIObjectResource = dynamic_cast(pIBaseClassObjectResource); + if (!pIObjectResource) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IBase* pBaseComponentInstance(nullptr); + IComponentsObject* pIComponentsObject = dynamic_cast(pIBaseClass); + if (!pIComponentsObject) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pPropertyID = pIBaseMaterialGroup->AddMaterial(sName, *pDisplayColor); + pBaseComponentInstance = pIComponentsObject->AddComponent(pIObjectResource, *pTransform); + *pComponentInstance = (IBase*)(pBaseComponentInstance); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); + pJournalEntry->addHandleResult("ComponentInstance", *pComponentInstance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8330,23 +8323,28 @@ Lib3MFResult lib3mf_basematerialgroup_addmaterial(Lib3MF_BaseMaterialGroup pBase } } -Lib3MFResult lib3mf_basematerialgroup_removematerial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID) +Lib3MFResult lib3mf_componentsobject_getcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance) { - IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + IBase* pIBaseClass = (IBase *)pComponentsObject; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "RemoveMaterial"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponentsObject, "ComponentsObject", "GetComponent"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); - if (!pIBaseMaterialGroup) + if (pComponentInstance == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseComponentInstance(nullptr); + IComponentsObject* pIComponentsObject = dynamic_cast(pIBaseClass); + if (!pIComponentsObject) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBaseMaterialGroup->RemoveMaterial(nPropertyID); + pBaseComponentInstance = pIComponentsObject->GetComponent(nIndex); + *pComponentInstance = (IBase*)(pBaseComponentInstance); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("ComponentInstance", *pComponentInstance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8362,49 +8360,26 @@ Lib3MFResult lib3mf_basematerialgroup_removematerial(Lib3MF_BaseMaterialGroup pB } } -Lib3MFResult lib3mf_basematerialgroup_getname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) +Lib3MFResult lib3mf_componentsobject_getcomponentcount(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + IBase* pIBaseClass = (IBase *)pComponentsObject; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "GetName"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponentsObject, "ComponentsObject", "GetComponentCount"); } - if ( (!pNameBuffer) && !(pNameNeededChars) ) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sName(""); - IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); - if (!pIBaseMaterialGroup) + IComponentsObject* pIComponentsObject = dynamic_cast(pIBaseClass); + if (!pIComponentsObject) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pNameBuffer == nullptr); - if (isCacheCall) { - sName = pIBaseMaterialGroup->GetName(nPropertyID); + *pCount = pIComponentsObject->GetComponentCount(); - pIBaseMaterialGroup->_setCache (new ParameterCache_1 (sName)); - } - else { - auto cache = dynamic_cast*> (pIBaseMaterialGroup->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sName); - pIBaseMaterialGroup->_setCache (nullptr); - } - - if (pNameNeededChars) - *pNameNeededChars = (Lib3MF_uint32) (sName.size()+1); - if (pNameBuffer) { - if (sName.size() >= nNameBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iName = 0; iName < sName.size(); iName++) - pNameBuffer[iName] = sName[iName]; - pNameBuffer[sName.size()] = 0; - } - if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Name", sName.c_str()); - pJournalEntry->writeSuccess(); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; } @@ -8419,25 +8394,28 @@ Lib3MFResult lib3mf_basematerialgroup_getname(Lib3MF_BaseMaterialGroup pBaseMate } } -Lib3MFResult lib3mf_basematerialgroup_setname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName) + +/************************************************************************************************************************* + Class implementation for BeamSet +**************************************************************************************************************************/ +Lib3MFResult lib3mf_beamset_setname(Lib3MF_BeamSet pBeamSet, const char * pName) { - IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + IBase* pIBaseClass = (IBase *)pBeamSet; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "SetName"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "SetName"); pJournalEntry->addStringParameter("Name", pName); } if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); std::string sName(pName); - IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); - if (!pIBaseMaterialGroup) + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBaseMaterialGroup->SetName(nPropertyID, sName); + pIBeamSet->SetName(sName); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -8455,23 +8433,47 @@ Lib3MFResult lib3mf_basematerialgroup_setname(Lib3MF_BaseMaterialGroup pBaseMate } } -Lib3MFResult lib3mf_basematerialgroup_setdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor) +Lib3MFResult lib3mf_beamset_getname(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) { - IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + IBase* pIBaseClass = (IBase *)pBeamSet; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "SetDisplayColor"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetName"); } - IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); - if (!pIBaseMaterialGroup) + if ( (!pNameBuffer) && !(pNameNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(""); + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBaseMaterialGroup->SetDisplayColor(nPropertyID, *pTheColor); + bool isCacheCall = (pNameBuffer == nullptr); + if (isCacheCall) { + sName = pIBeamSet->GetName(); + pIBeamSet->_setCache (new ParameterCache_1 (sName)); + } + else { + auto cache = dynamic_cast*> (pIBeamSet->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sName); + pIBeamSet->_setCache (nullptr); + } + + if (pNameNeededChars) + *pNameNeededChars = (Lib3MF_uint32) (sName.size()+1); + if (pNameBuffer) { + if (sName.size() >= nNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iName = 0; iName < sName.size(); iName++) + pNameBuffer[iName] = sName[iName]; + pNameBuffer[sName.size()] = 0; + } if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Name", sName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8487,23 +8489,24 @@ Lib3MFResult lib3mf_basematerialgroup_setdisplaycolor(Lib3MF_BaseMaterialGroup p } } -Lib3MFResult lib3mf_basematerialgroup_getdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor) +Lib3MFResult lib3mf_beamset_setidentifier(Lib3MF_BeamSet pBeamSet, const char * pIdentifier) { - IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + IBase* pIBaseClass = (IBase *)pBeamSet; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "GetDisplayColor"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "SetIdentifier"); + pJournalEntry->addStringParameter("Identifier", pIdentifier); } - if (pTheColor == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); - if (!pIBaseMaterialGroup) + if (pIdentifier == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sIdentifier(pIdentifier); + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pTheColor = pIBaseMaterialGroup->GetDisplayColor(nPropertyID); + pIBeamSet->SetIdentifier(sIdentifier); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -8521,29 +8524,47 @@ Lib3MFResult lib3mf_basematerialgroup_getdisplaycolor(Lib3MF_BaseMaterialGroup p } } - -/************************************************************************************************************************* - Class implementation for ColorGroup -**************************************************************************************************************************/ -Lib3MFResult lib3mf_colorgroup_getcount(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_beamset_getidentifier(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer) { - IBase* pIBaseClass = (IBase *)pColorGroup; + IBase* pIBaseClass = (IBase *)pBeamSet; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "GetCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetIdentifier"); } - if (pCount == nullptr) + if ( (!pIdentifierBuffer) && !(pIdentifierNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); - if (!pIColorGroup) + std::string sIdentifier(""); + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIColorGroup->GetCount(); + bool isCacheCall = (pIdentifierBuffer == nullptr); + if (isCacheCall) { + sIdentifier = pIBeamSet->GetIdentifier(); + pIBeamSet->_setCache (new ParameterCache_1 (sIdentifier)); + } + else { + auto cache = dynamic_cast*> (pIBeamSet->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sIdentifier); + pIBeamSet->_setCache (nullptr); + } + + if (pIdentifierNeededChars) + *pIdentifierNeededChars = (Lib3MF_uint32) (sIdentifier.size()+1); + if (pIdentifierBuffer) { + if (sIdentifier.size() >= nIdentifierBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iIdentifier = 0; iIdentifier < sIdentifier.size(); iIdentifier++) + pIdentifierBuffer[iIdentifier] = sIdentifier[iIdentifier]; + pIdentifierBuffer[sIdentifier.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->addStringResult("Identifier", sIdentifier.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8559,24 +8580,25 @@ Lib3MFResult lib3mf_colorgroup_getcount(Lib3MF_ColorGroup pColorGroup, Lib3MF_ui } } -Lib3MFResult lib3mf_colorgroup_getallpropertyids(Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult lib3mf_beamset_getreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pColorGroup; + IBase* pIBaseClass = (IBase *)pBeamSet; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "GetAllPropertyIDs"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetReferenceCount"); } - if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); - if (!pIColorGroup) + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIColorGroup->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + *pCount = pIBeamSet->GetReferenceCount(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8592,25 +8614,24 @@ Lib3MFResult lib3mf_colorgroup_getallpropertyids(Lib3MF_ColorGroup pColorGroup, } } -Lib3MFResult lib3mf_colorgroup_addcolor(Lib3MF_ColorGroup pColorGroup, const sLib3MFColor * pTheColor, Lib3MF_uint32 * pPropertyID) +Lib3MFResult lib3mf_beamset_setreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer) { - IBase* pIBaseClass = (IBase *)pColorGroup; + IBase* pIBaseClass = (IBase *)pBeamSet; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "AddColor"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "SetReferences"); } - if (pPropertyID == nullptr) + if ( (!pReferencesBuffer) && (nReferencesBufferSize>0)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); - if (!pIColorGroup) + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pPropertyID = pIColorGroup->AddColor(*pTheColor); + pIBeamSet->SetReferences(nReferencesBufferSize, pReferencesBuffer); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8626,21 +8647,22 @@ Lib3MFResult lib3mf_colorgroup_addcolor(Lib3MF_ColorGroup pColorGroup, const sLi } } -Lib3MFResult lib3mf_colorgroup_removecolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID) +Lib3MFResult lib3mf_beamset_getreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer) { - IBase* pIBaseClass = (IBase *)pColorGroup; + IBase* pIBaseClass = (IBase *)pBeamSet; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "RemoveColor"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetReferences"); } - IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); - if (!pIColorGroup) + if ((!pReferencesBuffer) && !(pReferencesNeededCount)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIColorGroup->RemoveColor(nPropertyID); + pIBeamSet->GetReferences(nReferencesBufferSize, pReferencesNeededCount, pReferencesBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -8658,23 +8680,25 @@ Lib3MFResult lib3mf_colorgroup_removecolor(Lib3MF_ColorGroup pColorGroup, Lib3MF } } -Lib3MFResult lib3mf_colorgroup_setcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor) +Lib3MFResult lib3mf_beamset_getballreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pColorGroup; + IBase* pIBaseClass = (IBase *)pBeamSet; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "SetColor"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetBallReferenceCount"); } - IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); - if (!pIColorGroup) + if (pCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIColorGroup->SetColor(nPropertyID, *pTheColor); + *pCount = pIBeamSet->GetBallReferenceCount(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8690,23 +8714,22 @@ Lib3MFResult lib3mf_colorgroup_setcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_ui } } -Lib3MFResult lib3mf_colorgroup_getcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor) +Lib3MFResult lib3mf_beamset_setballreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer) { - IBase* pIBaseClass = (IBase *)pColorGroup; + IBase* pIBaseClass = (IBase *)pBeamSet; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "GetColor"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "SetBallReferences"); } - if (pTheColor == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); - if (!pIColorGroup) + if ( (!pBallReferencesBuffer) && (nBallReferencesBufferSize>0)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pTheColor = pIColorGroup->GetColor(nPropertyID); + pIBeamSet->SetBallReferences(nBallReferencesBufferSize, pBallReferencesBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -8724,29 +8747,24 @@ Lib3MFResult lib3mf_colorgroup_getcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_ui } } - -/************************************************************************************************************************* - Class implementation for Texture2DGroup -**************************************************************************************************************************/ -Lib3MFResult lib3mf_texture2dgroup_getcount(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_beamset_getballreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer) { - IBase* pIBaseClass = (IBase *)pTexture2DGroup; + IBase* pIBaseClass = (IBase *)pBeamSet; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "GetCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetBallReferences"); } - if (pCount == nullptr) + if ((!pBallReferencesBuffer) && !(pBallReferencesNeededCount)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); - if (!pITexture2DGroup) + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pITexture2DGroup->GetCount(); + pIBeamSet->GetBallReferences(nBallReferencesBufferSize, pBallReferencesNeededCount, pBallReferencesBuffer); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8762,24 +8780,29 @@ Lib3MFResult lib3mf_texture2dgroup_getcount(Lib3MF_Texture2DGroup pTexture2DGrou } } -Lib3MFResult lib3mf_texture2dgroup_getallpropertyids(Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) + +/************************************************************************************************************************* + Class implementation for BaseMaterialGroup +**************************************************************************************************************************/ +Lib3MFResult lib3mf_basematerialgroup_getcount(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pTexture2DGroup; + IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "GetAllPropertyIDs"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "GetCount"); } - if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); - if (!pITexture2DGroup) + IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); + if (!pIBaseMaterialGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pITexture2DGroup->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + *pCount = pIBaseMaterialGroup->GetCount(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8795,25 +8818,24 @@ Lib3MFResult lib3mf_texture2dgroup_getallpropertyids(Lib3MF_Texture2DGroup pText } } -Lib3MFResult lib3mf_texture2dgroup_addtex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, const sLib3MFTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID) +Lib3MFResult lib3mf_basematerialgroup_getallpropertyids(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) { - IBase* pIBaseClass = (IBase *)pTexture2DGroup; + IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "AddTex2Coord"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "GetAllPropertyIDs"); } - if (pPropertyID == nullptr) + if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); - if (!pITexture2DGroup) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); + if (!pIBaseMaterialGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pPropertyID = pITexture2DGroup->AddTex2Coord(*pUVCoordinate); + pIBaseMaterialGroup->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8829,25 +8851,29 @@ Lib3MFResult lib3mf_texture2dgroup_addtex2coord(Lib3MF_Texture2DGroup pTexture2D } } -Lib3MFResult lib3mf_texture2dgroup_gettex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, sLib3MFTex2Coord * pUVCoordinate) +Lib3MFResult lib3mf_basematerialgroup_addmaterial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const sLib3MFColor * pDisplayColor, Lib3MF_uint32 * pPropertyID) { - IBase* pIBaseClass = (IBase *)pTexture2DGroup; + IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "GetTex2Coord"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "AddMaterial"); + pJournalEntry->addStringParameter("Name", pName); } - if (pUVCoordinate == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); - if (!pITexture2DGroup) + if (pName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pPropertyID == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); + if (!pIBaseMaterialGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pUVCoordinate = pITexture2DGroup->GetTex2Coord(nPropertyID); + *pPropertyID = pIBaseMaterialGroup->AddMaterial(sName, *pDisplayColor); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8863,21 +8889,21 @@ Lib3MFResult lib3mf_texture2dgroup_gettex2coord(Lib3MF_Texture2DGroup pTexture2D } } -Lib3MFResult lib3mf_texture2dgroup_removetex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID) +Lib3MFResult lib3mf_basematerialgroup_removematerial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID) { - IBase* pIBaseClass = (IBase *)pTexture2DGroup; + IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "RemoveTex2Coord"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "RemoveMaterial"); pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); - if (!pITexture2DGroup) + IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); + if (!pIBaseMaterialGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pITexture2DGroup->RemoveTex2Coord(nPropertyID); + pIBaseMaterialGroup->RemoveMaterial(nPropertyID); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -8895,27 +8921,48 @@ Lib3MFResult lib3mf_texture2dgroup_removetex2coord(Lib3MF_Texture2DGroup pTextur } } -Lib3MFResult lib3mf_texture2dgroup_gettexture2d(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance) +Lib3MFResult lib3mf_basematerialgroup_getname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) { - IBase* pIBaseClass = (IBase *)pTexture2DGroup; + IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "GetTexture2D"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "GetName"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - if (pTexture2DInstance == nullptr) + if ( (!pNameBuffer) && !(pNameNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseTexture2DInstance(nullptr); - ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); - if (!pITexture2DGroup) + std::string sName(""); + IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); + if (!pIBaseMaterialGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseTexture2DInstance = pITexture2DGroup->GetTexture2D(); + bool isCacheCall = (pNameBuffer == nullptr); + if (isCacheCall) { + sName = pIBaseMaterialGroup->GetName(nPropertyID); - *pTexture2DInstance = (IBase*)(pBaseTexture2DInstance); + pIBaseMaterialGroup->_setCache (new ParameterCache_1 (sName)); + } + else { + auto cache = dynamic_cast*> (pIBaseMaterialGroup->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sName); + pIBaseMaterialGroup->_setCache (nullptr); + } + + if (pNameNeededChars) + *pNameNeededChars = (Lib3MF_uint32) (sName.size()+1); + if (pNameBuffer) { + if (sName.size() >= nNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iName = 0; iName < sName.size(); iName++) + pNameBuffer[iName] = sName[iName]; + pNameBuffer[sName.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Texture2DInstance", *pTexture2DInstance); + pJournalEntry->addStringResult("Name", sName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8931,29 +8978,27 @@ Lib3MFResult lib3mf_texture2dgroup_gettexture2d(Lib3MF_Texture2DGroup pTexture2D } } - -/************************************************************************************************************************* - Class implementation for CompositeMaterials -**************************************************************************************************************************/ -Lib3MFResult lib3mf_compositematerials_getcount(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_basematerialgroup_setname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName) { - IBase* pIBaseClass = (IBase *)pCompositeMaterials; + IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "GetCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "SetName"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry->addStringParameter("Name", pName); } - if (pCount == nullptr) + if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); - if (!pICompositeMaterials) + std::string sName(pName); + IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); + if (!pIBaseMaterialGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pICompositeMaterials->GetCount(); + pIBaseMaterialGroup->SetName(nPropertyID, sName); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8969,22 +9014,21 @@ Lib3MFResult lib3mf_compositematerials_getcount(Lib3MF_CompositeMaterials pCompo } } -Lib3MFResult lib3mf_compositematerials_getallpropertyids(Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult lib3mf_basematerialgroup_setdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor) { - IBase* pIBaseClass = (IBase *)pCompositeMaterials; + IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "GetAllPropertyIDs"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "SetDisplayColor"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); - if (!pICompositeMaterials) + IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); + if (!pIBaseMaterialGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pICompositeMaterials->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + pIBaseMaterialGroup->SetDisplayColor(nPropertyID, *pTheColor); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -9002,27 +9046,25 @@ Lib3MFResult lib3mf_compositematerials_getallpropertyids(Lib3MF_CompositeMateria } } -Lib3MFResult lib3mf_compositematerials_getbasematerialgroup(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance) +Lib3MFResult lib3mf_basematerialgroup_getdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor) { - IBase* pIBaseClass = (IBase *)pCompositeMaterials; + IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "GetBaseMaterialGroup"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "GetDisplayColor"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - if (pBaseMaterialGroupInstance == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseBaseMaterialGroupInstance(nullptr); - ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); - if (!pICompositeMaterials) + if (pTheColor == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); + if (!pIBaseMaterialGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseBaseMaterialGroupInstance = pICompositeMaterials->GetBaseMaterialGroup(); + *pTheColor = pIBaseMaterialGroup->GetDisplayColor(nPropertyID); - *pBaseMaterialGroupInstance = (IBase*)(pBaseBaseMaterialGroupInstance); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("BaseMaterialGroupInstance", *pBaseMaterialGroupInstance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9038,27 +9080,29 @@ Lib3MFResult lib3mf_compositematerials_getbasematerialgroup(Lib3MF_CompositeMate } } -Lib3MFResult lib3mf_compositematerials_addcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const sLib3MFCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID) + +/************************************************************************************************************************* + Class implementation for ColorGroup +**************************************************************************************************************************/ +Lib3MFResult lib3mf_colorgroup_getcount(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pCompositeMaterials; + IBase* pIBaseClass = (IBase *)pColorGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "AddComposite"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "GetCount"); } - if ( (!pCompositeBuffer) && (nCompositeBufferSize>0)) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pPropertyID == nullptr) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); - if (!pICompositeMaterials) + IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); + if (!pIColorGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pPropertyID = pICompositeMaterials->AddComposite(nCompositeBufferSize, pCompositeBuffer); + *pCount = pIColorGroup->GetCount(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9074,21 +9118,22 @@ Lib3MFResult lib3mf_compositematerials_addcomposite(Lib3MF_CompositeMaterials pC } } -Lib3MFResult lib3mf_compositematerials_removecomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID) +Lib3MFResult lib3mf_colorgroup_getallpropertyids(Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) { - IBase* pIBaseClass = (IBase *)pCompositeMaterials; + IBase* pIBaseClass = (IBase *)pColorGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "RemoveComposite"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "GetAllPropertyIDs"); } - ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); - if (!pICompositeMaterials) + if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); + if (!pIColorGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pICompositeMaterials->RemoveComposite(nPropertyID); + pIColorGroup->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -9106,25 +9151,25 @@ Lib3MFResult lib3mf_compositematerials_removecomposite(Lib3MF_CompositeMaterials } } -Lib3MFResult lib3mf_compositematerials_getcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, sLib3MFCompositeConstituent * pCompositeBuffer) +Lib3MFResult lib3mf_colorgroup_addcolor(Lib3MF_ColorGroup pColorGroup, const sLib3MFColor * pTheColor, Lib3MF_uint32 * pPropertyID) { - IBase* pIBaseClass = (IBase *)pCompositeMaterials; + IBase* pIBaseClass = (IBase *)pColorGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "GetComposite"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "AddColor"); } - if ((!pCompositeBuffer) && !(pCompositeNeededCount)) + if (pPropertyID == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); - if (!pICompositeMaterials) + IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); + if (!pIColorGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pICompositeMaterials->GetComposite(nPropertyID, nCompositeBufferSize, pCompositeNeededCount, pCompositeBuffer); + *pPropertyID = pIColorGroup->AddColor(*pTheColor); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9140,29 +9185,23 @@ Lib3MFResult lib3mf_compositematerials_getcomposite(Lib3MF_CompositeMaterials pC } } - -/************************************************************************************************************************* - Class implementation for MultiPropertyGroup -**************************************************************************************************************************/ -Lib3MFResult lib3mf_multipropertygroup_getcount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_colorgroup_removecolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pColorGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "RemoveColor"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - if (pCount == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); + if (!pIColorGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIMultiPropertyGroup->GetCount(); + pIColorGroup->RemoveColor(nPropertyID); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9178,22 +9217,21 @@ Lib3MFResult lib3mf_multipropertygroup_getcount(Lib3MF_MultiPropertyGroup pMulti } } -Lib3MFResult lib3mf_multipropertygroup_getallpropertyids(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult lib3mf_colorgroup_setcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pColorGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetAllPropertyIDs"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "SetColor"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); + if (!pIColorGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMultiPropertyGroup->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + pIColorGroup->SetColor(nPropertyID, *pTheColor); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -9211,27 +9249,25 @@ Lib3MFResult lib3mf_multipropertygroup_getallpropertyids(Lib3MF_MultiPropertyGro } } -Lib3MFResult lib3mf_multipropertygroup_addmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID) +Lib3MFResult lib3mf_colorgroup_getcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pColorGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "AddMultiProperty"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "GetColor"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - if ( (!pPropertyIDsBuffer) && (nPropertyIDsBufferSize>0)) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pPropertyID == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + if (pTheColor == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); + if (!pIColorGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pPropertyID = pIMultiPropertyGroup->AddMultiProperty(nPropertyIDsBufferSize, pPropertyIDsBuffer); + *pTheColor = pIColorGroup->GetColor(nPropertyID); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9247,25 +9283,29 @@ Lib3MFResult lib3mf_multipropertygroup_addmultiproperty(Lib3MF_MultiPropertyGrou } } -Lib3MFResult lib3mf_multipropertygroup_setmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer) + +/************************************************************************************************************************* + Class implementation for Texture2DGroup +**************************************************************************************************************************/ +Lib3MFResult lib3mf_texture2dgroup_getcount(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pTexture2DGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "SetMultiProperty"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "GetCount"); } - if ( (!pPropertyIDsBuffer) && (nPropertyIDsBufferSize>0)) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); + if (!pITexture2DGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMultiPropertyGroup->SetMultiProperty(nPropertyID, nPropertyIDsBufferSize, pPropertyIDsBuffer); + *pCount = pITexture2DGroup->GetCount(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9281,23 +9321,22 @@ Lib3MFResult lib3mf_multipropertygroup_setmultiproperty(Lib3MF_MultiPropertyGrou } } -Lib3MFResult lib3mf_multipropertygroup_getmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult lib3mf_texture2dgroup_getallpropertyids(Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pTexture2DGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetMultiProperty"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "GetAllPropertyIDs"); } if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); + if (!pITexture2DGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMultiPropertyGroup->GetMultiProperty(nPropertyID, nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + pITexture2DGroup->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -9315,23 +9354,25 @@ Lib3MFResult lib3mf_multipropertygroup_getmultiproperty(Lib3MF_MultiPropertyGrou } } -Lib3MFResult lib3mf_multipropertygroup_removemultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID) +Lib3MFResult lib3mf_texture2dgroup_addtex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, const sLib3MFTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pTexture2DGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "RemoveMultiProperty"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "AddTex2Coord"); } - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + if (pPropertyID == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); + if (!pITexture2DGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMultiPropertyGroup->RemoveMultiProperty(nPropertyID); + *pPropertyID = pITexture2DGroup->AddTex2Coord(*pUVCoordinate); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9347,25 +9388,25 @@ Lib3MFResult lib3mf_multipropertygroup_removemultiproperty(Lib3MF_MultiPropertyG } } -Lib3MFResult lib3mf_multipropertygroup_getlayercount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_texture2dgroup_gettex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, sLib3MFTex2Coord * pUVCoordinate) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pTexture2DGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetLayerCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "GetTex2Coord"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - if (pCount == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + if (pUVCoordinate == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); + if (!pITexture2DGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIMultiPropertyGroup->GetLayerCount(); + *pUVCoordinate = pITexture2DGroup->GetTex2Coord(nPropertyID); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9381,25 +9422,23 @@ Lib3MFResult lib3mf_multipropertygroup_getlayercount(Lib3MF_MultiPropertyGroup p } } -Lib3MFResult lib3mf_multipropertygroup_addlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const sLib3MFMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex) +Lib3MFResult lib3mf_texture2dgroup_removetex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pTexture2DGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "AddLayer"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "RemoveTex2Coord"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - if (pLayerIndex == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); + if (!pITexture2DGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pLayerIndex = pIMultiPropertyGroup->AddLayer(*pTheLayer); + pITexture2DGroup->RemoveTex2Coord(nPropertyID); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("LayerIndex", *pLayerIndex); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9415,25 +9454,27 @@ Lib3MFResult lib3mf_multipropertygroup_addlayer(Lib3MF_MultiPropertyGroup pMulti } } -Lib3MFResult lib3mf_multipropertygroup_getlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, sLib3MFMultiPropertyLayer * pTheLayer) +Lib3MFResult lib3mf_texture2dgroup_gettexture2d(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pTexture2DGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetLayer"); - pJournalEntry->addUInt32Parameter("LayerIndex", nLayerIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "GetTexture2D"); } - if (pTheLayer == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + if (pTexture2DInstance == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseTexture2DInstance(nullptr); + ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); + if (!pITexture2DGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pTheLayer = pIMultiPropertyGroup->GetLayer(nLayerIndex); + pBaseTexture2DInstance = pITexture2DGroup->GetTexture2D(); + *pTexture2DInstance = (IBase*)(pBaseTexture2DInstance); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Texture2DInstance", *pTexture2DInstance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9449,23 +9490,29 @@ Lib3MFResult lib3mf_multipropertygroup_getlayer(Lib3MF_MultiPropertyGroup pMulti } } -Lib3MFResult lib3mf_multipropertygroup_removelayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex) + +/************************************************************************************************************************* + Class implementation for CompositeMaterials +**************************************************************************************************************************/ +Lib3MFResult lib3mf_compositematerials_getcount(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pCompositeMaterials; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "RemoveLayer"); - pJournalEntry->addUInt32Parameter("LayerIndex", nLayerIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "GetCount"); } - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + if (pCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); + if (!pICompositeMaterials) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMultiPropertyGroup->RemoveLayer(nLayerIndex); + *pCount = pICompositeMaterials->GetCount(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9481,51 +9528,24 @@ Lib3MFResult lib3mf_multipropertygroup_removelayer(Lib3MF_MultiPropertyGroup pMu } } - -/************************************************************************************************************************* - Class implementation for Image3D -**************************************************************************************************************************/ -Lib3MFResult lib3mf_image3d_getname(Lib3MF_Image3D pImage3D, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) +Lib3MFResult lib3mf_compositematerials_getallpropertyids(Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) { - IBase* pIBaseClass = (IBase *)pImage3D; + IBase* pIBaseClass = (IBase *)pCompositeMaterials; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImage3D, "Image3D", "GetName"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "GetAllPropertyIDs"); } - if ( (!pNameBuffer) && !(pNameNeededChars) ) + if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sName(""); - IImage3D* pIImage3D = dynamic_cast(pIBaseClass); - if (!pIImage3D) + ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); + if (!pICompositeMaterials) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pNameBuffer == nullptr); - if (isCacheCall) { - sName = pIImage3D->GetName(); + pICompositeMaterials->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); - pIImage3D->_setCache (new ParameterCache_1 (sName)); - } - else { - auto cache = dynamic_cast*> (pIImage3D->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sName); - pIImage3D->_setCache (nullptr); - } - - if (pNameNeededChars) - *pNameNeededChars = (Lib3MF_uint32) (sName.size()+1); - if (pNameBuffer) { - if (sName.size() >= nNameBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iName = 0; iName < sName.size(); iName++) - pNameBuffer[iName] = sName[iName]; - pNameBuffer[sName.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Name", sName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9541,26 +9561,27 @@ Lib3MFResult lib3mf_image3d_getname(Lib3MF_Image3D pImage3D, const Lib3MF_uint32 } } -Lib3MFResult lib3mf_image3d_setname(Lib3MF_Image3D pImage3D, const char * pName) +Lib3MFResult lib3mf_compositematerials_getbasematerialgroup(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance) { - IBase* pIBaseClass = (IBase *)pImage3D; + IBase* pIBaseClass = (IBase *)pCompositeMaterials; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImage3D, "Image3D", "SetName"); - pJournalEntry->addStringParameter("Name", pName); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "GetBaseMaterialGroup"); } - if (pName == nullptr) + if (pBaseMaterialGroupInstance == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sName(pName); - IImage3D* pIImage3D = dynamic_cast(pIBaseClass); - if (!pIImage3D) + IBase* pBaseBaseMaterialGroupInstance(nullptr); + ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); + if (!pICompositeMaterials) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIImage3D->SetName(sName); + pBaseBaseMaterialGroupInstance = pICompositeMaterials->GetBaseMaterialGroup(); + *pBaseMaterialGroupInstance = (IBase*)(pBaseBaseMaterialGroupInstance); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("BaseMaterialGroupInstance", *pBaseMaterialGroupInstance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9576,25 +9597,27 @@ Lib3MFResult lib3mf_image3d_setname(Lib3MF_Image3D pImage3D, const char * pName) } } -Lib3MFResult lib3mf_image3d_isimagestack(Lib3MF_Image3D pImage3D, bool * pIsImageStack) +Lib3MFResult lib3mf_compositematerials_addcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const sLib3MFCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID) { - IBase* pIBaseClass = (IBase *)pImage3D; + IBase* pIBaseClass = (IBase *)pCompositeMaterials; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImage3D, "Image3D", "IsImageStack"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "AddComposite"); } - if (pIsImageStack == nullptr) + if ( (!pCompositeBuffer) && (nCompositeBufferSize>0)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IImage3D* pIImage3D = dynamic_cast(pIBaseClass); - if (!pIImage3D) + if (pPropertyID == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); + if (!pICompositeMaterials) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pIsImageStack = pIImage3D->IsImageStack(); + *pPropertyID = pICompositeMaterials->AddComposite(nCompositeBufferSize, pCompositeBuffer); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("IsImageStack", *pIsImageStack); + pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9610,29 +9633,23 @@ Lib3MFResult lib3mf_image3d_isimagestack(Lib3MF_Image3D pImage3D, bool * pIsImag } } - -/************************************************************************************************************************* - Class implementation for ImageStack -**************************************************************************************************************************/ -Lib3MFResult lib3mf_imagestack_getrowcount(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 * pRowCount) +Lib3MFResult lib3mf_compositematerials_removecomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID) { - IBase* pIBaseClass = (IBase *)pImageStack; + IBase* pIBaseClass = (IBase *)pCompositeMaterials; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "GetRowCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "RemoveComposite"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - if (pRowCount == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IImageStack* pIImageStack = dynamic_cast(pIBaseClass); - if (!pIImageStack) + ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); + if (!pICompositeMaterials) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pRowCount = pIImageStack->GetRowCount(); + pICompositeMaterials->RemoveComposite(nPropertyID); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("RowCount", *pRowCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9648,21 +9665,23 @@ Lib3MFResult lib3mf_imagestack_getrowcount(Lib3MF_ImageStack pImageStack, Lib3MF } } -Lib3MFResult lib3mf_imagestack_setrowcount(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nRowCount) +Lib3MFResult lib3mf_compositematerials_getcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, sLib3MFCompositeConstituent * pCompositeBuffer) { - IBase* pIBaseClass = (IBase *)pImageStack; + IBase* pIBaseClass = (IBase *)pCompositeMaterials; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "SetRowCount"); - pJournalEntry->addUInt32Parameter("RowCount", nRowCount); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "GetComposite"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - IImageStack* pIImageStack = dynamic_cast(pIBaseClass); - if (!pIImageStack) + if ((!pCompositeBuffer) && !(pCompositeNeededCount)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); + if (!pICompositeMaterials) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIImageStack->SetRowCount(nRowCount); + pICompositeMaterials->GetComposite(nPropertyID, nCompositeBufferSize, pCompositeNeededCount, pCompositeBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -9680,25 +9699,29 @@ Lib3MFResult lib3mf_imagestack_setrowcount(Lib3MF_ImageStack pImageStack, Lib3MF } } -Lib3MFResult lib3mf_imagestack_getcolumncount(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 * pColumnCount) + +/************************************************************************************************************************* + Class implementation for MultiPropertyGroup +**************************************************************************************************************************/ +Lib3MFResult lib3mf_multipropertygroup_getcount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pImageStack; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "GetColumnCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetCount"); } - if (pColumnCount == nullptr) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IImageStack* pIImageStack = dynamic_cast(pIBaseClass); - if (!pIImageStack) + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pColumnCount = pIImageStack->GetColumnCount(); + *pCount = pIMultiPropertyGroup->GetCount(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("ColumnCount", *pColumnCount); + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9714,21 +9737,22 @@ Lib3MFResult lib3mf_imagestack_getcolumncount(Lib3MF_ImageStack pImageStack, Lib } } -Lib3MFResult lib3mf_imagestack_setcolumncount(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nColumnCount) +Lib3MFResult lib3mf_multipropertygroup_getallpropertyids(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) { - IBase* pIBaseClass = (IBase *)pImageStack; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "SetColumnCount"); - pJournalEntry->addUInt32Parameter("ColumnCount", nColumnCount); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetAllPropertyIDs"); } - IImageStack* pIImageStack = dynamic_cast(pIBaseClass); - if (!pIImageStack) + if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIImageStack->SetColumnCount(nColumnCount); + pIMultiPropertyGroup->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -9746,25 +9770,27 @@ Lib3MFResult lib3mf_imagestack_setcolumncount(Lib3MF_ImageStack pImageStack, Lib } } -Lib3MFResult lib3mf_imagestack_getsheetcount(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 * pSheetCount) +Lib3MFResult lib3mf_multipropertygroup_addmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID) { - IBase* pIBaseClass = (IBase *)pImageStack; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "GetSheetCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "AddMultiProperty"); } - if (pSheetCount == nullptr) + if ( (!pPropertyIDsBuffer) && (nPropertyIDsBufferSize>0)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IImageStack* pIImageStack = dynamic_cast(pIBaseClass); - if (!pIImageStack) + if (pPropertyID == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pSheetCount = pIImageStack->GetSheetCount(); + *pPropertyID = pIMultiPropertyGroup->AddMultiProperty(nPropertyIDsBufferSize, pPropertyIDsBuffer); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("SheetCount", *pSheetCount); + pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9780,28 +9806,25 @@ Lib3MFResult lib3mf_imagestack_getsheetcount(Lib3MF_ImageStack pImageStack, Lib3 } } -Lib3MFResult lib3mf_imagestack_getsheet(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nIndex, Lib3MF_Attachment * pSheet) +Lib3MFResult lib3mf_multipropertygroup_setmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer) { - IBase* pIBaseClass = (IBase *)pImageStack; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "GetSheet"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "SetMultiProperty"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - if (pSheet == nullptr) + if ( (!pPropertyIDsBuffer) && (nPropertyIDsBufferSize>0)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseSheet(nullptr); - IImageStack* pIImageStack = dynamic_cast(pIBaseClass); - if (!pIImageStack) + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseSheet = pIImageStack->GetSheet(nIndex); + pIMultiPropertyGroup->SetMultiProperty(nPropertyID, nPropertyIDsBufferSize, pPropertyIDsBuffer); - *pSheet = (IBase*)(pBaseSheet); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Sheet", *pSheet); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9817,27 +9840,23 @@ Lib3MFResult lib3mf_imagestack_getsheet(Lib3MF_ImageStack pImageStack, Lib3MF_ui } } -Lib3MFResult lib3mf_imagestack_setsheet(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nIndex, Lib3MF_Attachment pSheet) +Lib3MFResult lib3mf_multipropertygroup_getmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) { - IBase* pIBaseClass = (IBase *)pImageStack; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "SetSheet"); - pJournalEntry->addUInt32Parameter("Index", nIndex); - pJournalEntry->addHandleParameter("Sheet", pSheet); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetMultiProperty"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - IBase* pIBaseClassSheet = (IBase *)pSheet; - IAttachment* pISheet = dynamic_cast(pIBaseClassSheet); - if (!pISheet) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); - - IImageStack* pIImageStack = dynamic_cast(pIBaseClass); - if (!pIImageStack) + if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIImageStack->SetSheet(nIndex, pISheet); + pIMultiPropertyGroup->GetMultiProperty(nPropertyID, nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -9855,32 +9874,23 @@ Lib3MFResult lib3mf_imagestack_setsheet(Lib3MF_ImageStack pImageStack, Lib3MF_ui } } -Lib3MFResult lib3mf_imagestack_createemptysheet(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nIndex, const char * pPath, Lib3MF_Attachment * pSheet) +Lib3MFResult lib3mf_multipropertygroup_removemultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID) { - IBase* pIBaseClass = (IBase *)pImageStack; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "CreateEmptySheet"); - pJournalEntry->addUInt32Parameter("Index", nIndex); - pJournalEntry->addStringParameter("Path", pPath); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "RemoveMultiProperty"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - if (pPath == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pSheet == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sPath(pPath); - IBase* pBaseSheet(nullptr); - IImageStack* pIImageStack = dynamic_cast(pIBaseClass); - if (!pIImageStack) + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseSheet = pIImageStack->CreateEmptySheet(nIndex, sPath); + pIMultiPropertyGroup->RemoveMultiProperty(nPropertyID); - *pSheet = (IBase*)(pBaseSheet); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Sheet", *pSheet); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9896,34 +9906,25 @@ Lib3MFResult lib3mf_imagestack_createemptysheet(Lib3MF_ImageStack pImageStack, L } } -Lib3MFResult lib3mf_imagestack_createsheetfrombuffer(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nIndex, const char * pPath, Lib3MF_uint64 nDataBufferSize, const Lib3MF_uint8 * pDataBuffer, Lib3MF_Attachment * pSheet) +Lib3MFResult lib3mf_multipropertygroup_getlayercount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pImageStack; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "CreateSheetFromBuffer"); - pJournalEntry->addUInt32Parameter("Index", nIndex); - pJournalEntry->addStringParameter("Path", pPath); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetLayerCount"); } - if (pPath == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if ( (!pDataBuffer) && (nDataBufferSize>0)) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pSheet == nullptr) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sPath(pPath); - IBase* pBaseSheet(nullptr); - IImageStack* pIImageStack = dynamic_cast(pIBaseClass); - if (!pIImageStack) + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseSheet = pIImageStack->CreateSheetFromBuffer(nIndex, sPath, nDataBufferSize, pDataBuffer); + *pCount = pIMultiPropertyGroup->GetLayerCount(); - *pSheet = (IBase*)(pBaseSheet); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Sheet", *pSheet); + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9939,36 +9940,25 @@ Lib3MFResult lib3mf_imagestack_createsheetfrombuffer(Lib3MF_ImageStack pImageSta } } -Lib3MFResult lib3mf_imagestack_createsheetfromfile(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nIndex, const char * pPath, const char * pFileName, Lib3MF_Attachment * pSheet) +Lib3MFResult lib3mf_multipropertygroup_addlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const sLib3MFMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex) { - IBase* pIBaseClass = (IBase *)pImageStack; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "CreateSheetFromFile"); - pJournalEntry->addUInt32Parameter("Index", nIndex); - pJournalEntry->addStringParameter("Path", pPath); - pJournalEntry->addStringParameter("FileName", pFileName); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "AddLayer"); } - if (pPath == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pFileName == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pSheet == nullptr) + if (pLayerIndex == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sPath(pPath); - std::string sFileName(pFileName); - IBase* pBaseSheet(nullptr); - IImageStack* pIImageStack = dynamic_cast(pIBaseClass); - if (!pIImageStack) + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseSheet = pIImageStack->CreateSheetFromFile(nIndex, sPath, sFileName); + *pLayerIndex = pIMultiPropertyGroup->AddLayer(*pTheLayer); - *pSheet = (IBase*)(pBaseSheet); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Sheet", *pSheet); + pJournalEntry->addUInt32Result("LayerIndex", *pLayerIndex); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -9984,51 +9974,25 @@ Lib3MFResult lib3mf_imagestack_createsheetfromfile(Lib3MF_ImageStack pImageStack } } - -/************************************************************************************************************************* - Class implementation for Attachment -**************************************************************************************************************************/ -Lib3MFResult lib3mf_attachment_getpath(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) +Lib3MFResult lib3mf_multipropertygroup_getlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, sLib3MFMultiPropertyLayer * pTheLayer) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "GetPath"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetLayer"); + pJournalEntry->addUInt32Parameter("LayerIndex", nLayerIndex); } - if ( (!pPathBuffer) && !(pPathNeededChars) ) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sPath(""); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + if (pTheLayer == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pPathBuffer == nullptr); - if (isCacheCall) { - sPath = pIAttachment->GetPath(); + *pTheLayer = pIMultiPropertyGroup->GetLayer(nLayerIndex); - pIAttachment->_setCache (new ParameterCache_1 (sPath)); - } - else { - auto cache = dynamic_cast*> (pIAttachment->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sPath); - pIAttachment->_setCache (nullptr); - } - - if (pPathNeededChars) - *pPathNeededChars = (Lib3MF_uint32) (sPath.size()+1); - if (pPathBuffer) { - if (sPath.size() >= nPathBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iPath = 0; iPath < sPath.size(); iPath++) - pPathBuffer[iPath] = sPath[iPath]; - pPathBuffer[sPath.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Path", sPath.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10044,24 +10008,21 @@ Lib3MFResult lib3mf_attachment_getpath(Lib3MF_Attachment pAttachment, const Lib3 } } -Lib3MFResult lib3mf_attachment_setpath(Lib3MF_Attachment pAttachment, const char * pPath) +Lib3MFResult lib3mf_multipropertygroup_removelayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "SetPath"); - pJournalEntry->addStringParameter("Path", pPath); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "RemoveLayer"); + pJournalEntry->addUInt32Parameter("LayerIndex", nLayerIndex); } - if (pPath == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sPath(pPath); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIAttachment->SetPath(sPath); + pIMultiPropertyGroup->RemoveLayer(nLayerIndex); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -10079,27 +10040,51 @@ Lib3MFResult lib3mf_attachment_setpath(Lib3MF_Attachment pAttachment, const char } } -Lib3MFResult lib3mf_attachment_packagepart(Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart) + +/************************************************************************************************************************* + Class implementation for Image3D +**************************************************************************************************************************/ +Lib3MFResult lib3mf_image3d_getname(Lib3MF_Image3D pImage3D, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pImage3D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "PackagePart"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImage3D, "Image3D", "GetName"); } - if (pPackagePart == nullptr) + if ( (!pNameBuffer) && !(pNameNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBasePackagePart(nullptr); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + std::string sName(""); + IImage3D* pIImage3D = dynamic_cast(pIBaseClass); + if (!pIImage3D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBasePackagePart = pIAttachment->PackagePart(); + bool isCacheCall = (pNameBuffer == nullptr); + if (isCacheCall) { + sName = pIImage3D->GetName(); - *pPackagePart = (IBase*)(pBasePackagePart); + pIImage3D->_setCache (new ParameterCache_1 (sName)); + } + else { + auto cache = dynamic_cast*> (pIImage3D->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sName); + pIImage3D->_setCache (nullptr); + } + + if (pNameNeededChars) + *pNameNeededChars = (Lib3MF_uint32) (sName.size()+1); + if (pNameBuffer) { + if (sName.size() >= nNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iName = 0; iName < sName.size(); iName++) + pNameBuffer[iName] = sName[iName]; + pNameBuffer[sName.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("PackagePart", *pPackagePart); + pJournalEntry->addStringResult("Name", sName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10115,47 +10100,26 @@ Lib3MFResult lib3mf_attachment_packagepart(Lib3MF_Attachment pAttachment, Lib3MF } } -Lib3MFResult lib3mf_attachment_getrelationshiptype(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) +Lib3MFResult lib3mf_image3d_setname(Lib3MF_Image3D pImage3D, const char * pName) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pImage3D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "GetRelationShipType"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImage3D, "Image3D", "SetName"); + pJournalEntry->addStringParameter("Name", pName); } - if ( (!pPathBuffer) && !(pPathNeededChars) ) + if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sPath(""); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + std::string sName(pName); + IImage3D* pIImage3D = dynamic_cast(pIBaseClass); + if (!pIImage3D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pPathBuffer == nullptr); - if (isCacheCall) { - sPath = pIAttachment->GetRelationShipType(); + pIImage3D->SetName(sName); - pIAttachment->_setCache (new ParameterCache_1 (sPath)); - } - else { - auto cache = dynamic_cast*> (pIAttachment->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sPath); - pIAttachment->_setCache (nullptr); - } - - if (pPathNeededChars) - *pPathNeededChars = (Lib3MF_uint32) (sPath.size()+1); - if (pPathBuffer) { - if (sPath.size() >= nPathBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iPath = 0; iPath < sPath.size(); iPath++) - pPathBuffer[iPath] = sPath[iPath]; - pPathBuffer[sPath.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Path", sPath.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10171,26 +10135,25 @@ Lib3MFResult lib3mf_attachment_getrelationshiptype(Lib3MF_Attachment pAttachment } } -Lib3MFResult lib3mf_attachment_setrelationshiptype(Lib3MF_Attachment pAttachment, const char * pPath) +Lib3MFResult lib3mf_image3d_isimagestack(Lib3MF_Image3D pImage3D, bool * pIsImageStack) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pImage3D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "SetRelationShipType"); - pJournalEntry->addStringParameter("Path", pPath); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImage3D, "Image3D", "IsImageStack"); } - if (pPath == nullptr) + if (pIsImageStack == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sPath(pPath); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + IImage3D* pIImage3D = dynamic_cast(pIBaseClass); + if (!pIImage3D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIAttachment->SetRelationShipType(sPath); + *pIsImageStack = pIImage3D->IsImageStack(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("IsImageStack", *pIsImageStack); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10206,26 +10169,29 @@ Lib3MFResult lib3mf_attachment_setrelationshiptype(Lib3MF_Attachment pAttachment } } -Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAttachment, const char * pFileName) + +/************************************************************************************************************************* + Class implementation for ImageStack +**************************************************************************************************************************/ +Lib3MFResult lib3mf_imagestack_getrowcount(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 * pRowCount) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pImageStack; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "WriteToFile"); - pJournalEntry->addStringParameter("FileName", pFileName); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "GetRowCount"); } - if (pFileName == nullptr) + if (pRowCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sFileName(pFileName); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + IImageStack* pIImageStack = dynamic_cast(pIBaseClass); + if (!pIImageStack) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIAttachment->WriteToFile(sFileName); + *pRowCount = pIImageStack->GetRowCount(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("RowCount", *pRowCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10241,24 +10207,21 @@ Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAttachment, const } } -Lib3MFResult lib3mf_attachment_readfromfile(Lib3MF_Attachment pAttachment, const char * pFileName) +Lib3MFResult lib3mf_imagestack_setrowcount(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nRowCount) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pImageStack; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "ReadFromFile"); - pJournalEntry->addStringParameter("FileName", pFileName); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "SetRowCount"); + pJournalEntry->addUInt32Parameter("RowCount", nRowCount); } - if (pFileName == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sFileName(pFileName); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + IImageStack* pIImageStack = dynamic_cast(pIBaseClass); + if (!pIImageStack) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIAttachment->ReadFromFile(sFileName); + pIImageStack->SetRowCount(nRowCount); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -10276,24 +10239,25 @@ Lib3MFResult lib3mf_attachment_readfromfile(Lib3MF_Attachment pAttachment, const } } -Lib3MFResult lib3mf_attachment_readfromcallback(Lib3MF_Attachment pAttachment, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData) +Lib3MFResult lib3mf_imagestack_getcolumncount(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 * pColumnCount) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pImageStack; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "ReadFromCallback"); - pJournalEntry->addUInt64Parameter("StreamSize", nStreamSize); - pJournalEntry->addPointerParameter("UserData", pUserData); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "GetColumnCount"); } - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + if (pColumnCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IImageStack* pIImageStack = dynamic_cast(pIBaseClass); + if (!pIImageStack) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIAttachment->ReadFromCallback(pTheReadCallback, nStreamSize, pTheSeekCallback, pUserData); + *pColumnCount = pIImageStack->GetColumnCount(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("ColumnCount", *pColumnCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10309,25 +10273,23 @@ Lib3MFResult lib3mf_attachment_readfromcallback(Lib3MF_Attachment pAttachment, L } } -Lib3MFResult lib3mf_attachment_getstreamsize(Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize) +Lib3MFResult lib3mf_imagestack_setcolumncount(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nColumnCount) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pImageStack; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "GetStreamSize"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "SetColumnCount"); + pJournalEntry->addUInt32Parameter("ColumnCount", nColumnCount); } - if (pStreamSize == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + IImageStack* pIImageStack = dynamic_cast(pIBaseClass); + if (!pIImageStack) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pStreamSize = pIAttachment->GetStreamSize(); + pIImageStack->SetColumnCount(nColumnCount); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt64Result("StreamSize", *pStreamSize); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10343,24 +10305,25 @@ Lib3MFResult lib3mf_attachment_getstreamsize(Lib3MF_Attachment pAttachment, Lib3 } } -Lib3MFResult lib3mf_attachment_writetobuffer(Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer) +Lib3MFResult lib3mf_imagestack_getsheetcount(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 * pSheetCount) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pImageStack; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "WriteToBuffer"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "GetSheetCount"); } - if ((!pBufferBuffer) && !(pBufferNeededCount)) + if (pSheetCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + IImageStack* pIImageStack = dynamic_cast(pIBaseClass); + if (!pIImageStack) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIAttachment->WriteToBuffer(nBufferBufferSize, pBufferNeededCount, pBufferBuffer); + *pSheetCount = pIImageStack->GetSheetCount(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("SheetCount", *pSheetCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10376,24 +10339,28 @@ Lib3MFResult lib3mf_attachment_writetobuffer(Lib3MF_Attachment pAttachment, cons } } -Lib3MFResult lib3mf_attachment_readfrombuffer(Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer) +Lib3MFResult lib3mf_imagestack_getsheet(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nIndex, Lib3MF_Attachment * pSheet) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pImageStack; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "ReadFromBuffer"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "GetSheet"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if ( (!pBufferBuffer) && (nBufferBufferSize>0)) + if (pSheet == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + IBase* pBaseSheet(nullptr); + IImageStack* pIImageStack = dynamic_cast(pIBaseClass); + if (!pIImageStack) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIAttachment->ReadFromBuffer(nBufferBufferSize, pBufferBuffer); + pBaseSheet = pIImageStack->GetSheet(nIndex); + *pSheet = (IBase*)(pBaseSheet); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Sheet", *pSheet); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10409,31 +10376,29 @@ Lib3MFResult lib3mf_attachment_readfrombuffer(Lib3MF_Attachment pAttachment, Lib } } - -/************************************************************************************************************************* - Class implementation for Texture2D -**************************************************************************************************************************/ -Lib3MFResult lib3mf_texture2d_getattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment) +Lib3MFResult lib3mf_imagestack_setsheet(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nIndex, Lib3MF_Attachment pSheet) { - IBase* pIBaseClass = (IBase *)pTexture2D; + IBase* pIBaseClass = (IBase *)pImageStack; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "GetAttachment"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "SetSheet"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry->addHandleParameter("Sheet", pSheet); } - if (pAttachment == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseAttachment(nullptr); - ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); - if (!pITexture2D) + IBase* pIBaseClassSheet = (IBase *)pSheet; + IAttachment* pISheet = dynamic_cast(pIBaseClassSheet); + if (!pISheet) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IImageStack* pIImageStack = dynamic_cast(pIBaseClass); + if (!pIImageStack) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseAttachment = pITexture2D->GetAttachment(); + pIImageStack->SetSheet(nIndex, pISheet); - *pAttachment = (IBase*)(pBaseAttachment); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Attachment", *pAttachment); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10449,28 +10414,32 @@ Lib3MFResult lib3mf_texture2d_getattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_ } } -Lib3MFResult lib3mf_texture2d_setattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment) +Lib3MFResult lib3mf_imagestack_createemptysheet(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nIndex, const char * pPath, Lib3MF_Attachment * pSheet) { - IBase* pIBaseClass = (IBase *)pTexture2D; + IBase* pIBaseClass = (IBase *)pImageStack; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "SetAttachment"); - pJournalEntry->addHandleParameter("Attachment", pAttachment); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "CreateEmptySheet"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry->addStringParameter("Path", pPath); } - IBase* pIBaseClassAttachment = (IBase *)pAttachment; - IAttachment* pIAttachment = dynamic_cast(pIBaseClassAttachment); - if (!pIAttachment) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); - - ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); - if (!pITexture2D) + if (pPath == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pSheet == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sPath(pPath); + IBase* pBaseSheet(nullptr); + IImageStack* pIImageStack = dynamic_cast(pIBaseClass); + if (!pIImageStack) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pITexture2D->SetAttachment(pIAttachment); + pBaseSheet = pIImageStack->CreateEmptySheet(nIndex, sPath); + *pSheet = (IBase*)(pBaseSheet); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Sheet", *pSheet); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10486,25 +10455,34 @@ Lib3MFResult lib3mf_texture2d_setattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_ } } -Lib3MFResult lib3mf_texture2d_getcontenttype(Lib3MF_Texture2D pTexture2D, eLib3MFTextureType * pContentType) +Lib3MFResult lib3mf_imagestack_createsheetfrombuffer(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nIndex, const char * pPath, Lib3MF_uint64 nDataBufferSize, const Lib3MF_uint8 * pDataBuffer, Lib3MF_Attachment * pSheet) { - IBase* pIBaseClass = (IBase *)pTexture2D; + IBase* pIBaseClass = (IBase *)pImageStack; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "GetContentType"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "CreateSheetFromBuffer"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry->addStringParameter("Path", pPath); } - if (pContentType == nullptr) + if (pPath == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); - if (!pITexture2D) + if ( (!pDataBuffer) && (nDataBufferSize>0)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pSheet == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sPath(pPath); + IBase* pBaseSheet(nullptr); + IImageStack* pIImageStack = dynamic_cast(pIBaseClass); + if (!pIImageStack) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pContentType = pITexture2D->GetContentType(); + pBaseSheet = pIImageStack->CreateSheetFromBuffer(nIndex, sPath, nDataBufferSize, pDataBuffer); + *pSheet = (IBase*)(pBaseSheet); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addEnumResult("ContentType", "TextureType", (Lib3MF_int32)(*pContentType)); + pJournalEntry->addHandleResult("Sheet", *pSheet); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10520,23 +10498,36 @@ Lib3MFResult lib3mf_texture2d_getcontenttype(Lib3MF_Texture2D pTexture2D, eLib3M } } -Lib3MFResult lib3mf_texture2d_setcontenttype(Lib3MF_Texture2D pTexture2D, eLib3MFTextureType eContentType) +Lib3MFResult lib3mf_imagestack_createsheetfromfile(Lib3MF_ImageStack pImageStack, Lib3MF_uint32 nIndex, const char * pPath, const char * pFileName, Lib3MF_Attachment * pSheet) { - IBase* pIBaseClass = (IBase *)pTexture2D; + IBase* pIBaseClass = (IBase *)pImageStack; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "SetContentType"); - pJournalEntry->addEnumParameter("ContentType", "TextureType", (Lib3MF_int32)(eContentType)); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImageStack, "ImageStack", "CreateSheetFromFile"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry->addStringParameter("Path", pPath); + pJournalEntry->addStringParameter("FileName", pFileName); } - ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); - if (!pITexture2D) + if (pPath == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pFileName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pSheet == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sPath(pPath); + std::string sFileName(pFileName); + IBase* pBaseSheet(nullptr); + IImageStack* pIImageStack = dynamic_cast(pIBaseClass); + if (!pIImageStack) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pITexture2D->SetContentType(eContentType); + pBaseSheet = pIImageStack->CreateSheetFromFile(nIndex, sPath, sFileName); + *pSheet = (IBase*)(pBaseSheet); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Sheet", *pSheet); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10552,28 +10543,51 @@ Lib3MFResult lib3mf_texture2d_setcontenttype(Lib3MF_Texture2D pTexture2D, eLib3M } } -Lib3MFResult lib3mf_texture2d_gettilestyleuv(Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle * pTileStyleU, eLib3MFTextureTileStyle * pTileStyleV) + +/************************************************************************************************************************* + Class implementation for Attachment +**************************************************************************************************************************/ +Lib3MFResult lib3mf_attachment_getpath(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) { - IBase* pIBaseClass = (IBase *)pTexture2D; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "GetTileStyleUV"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "GetPath"); } - if (!pTileStyleU) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (!pTileStyleV) + if ( (!pPathBuffer) && !(pPathNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); - if (!pITexture2D) + std::string sPath(""); + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pITexture2D->GetTileStyleUV(*pTileStyleU, *pTileStyleV); + bool isCacheCall = (pPathBuffer == nullptr); + if (isCacheCall) { + sPath = pIAttachment->GetPath(); + pIAttachment->_setCache (new ParameterCache_1 (sPath)); + } + else { + auto cache = dynamic_cast*> (pIAttachment->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sPath); + pIAttachment->_setCache (nullptr); + } + + if (pPathNeededChars) + *pPathNeededChars = (Lib3MF_uint32) (sPath.size()+1); + if (pPathBuffer) { + if (sPath.size() >= nPathBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iPath = 0; iPath < sPath.size(); iPath++) + pPathBuffer[iPath] = sPath[iPath]; + pPathBuffer[sPath.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addEnumResult("TileStyleU", "TextureTileStyle", (Lib3MF_int32)(*pTileStyleU)); - pJournalEntry->addEnumResult("TileStyleV", "TextureTileStyle", (Lib3MF_int32)(*pTileStyleV)); + pJournalEntry->addStringResult("Path", sPath.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10589,22 +10603,24 @@ Lib3MFResult lib3mf_texture2d_gettilestyleuv(Lib3MF_Texture2D pTexture2D, eLib3M } } -Lib3MFResult lib3mf_texture2d_settilestyleuv(Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle eTileStyleU, eLib3MFTextureTileStyle eTileStyleV) +Lib3MFResult lib3mf_attachment_setpath(Lib3MF_Attachment pAttachment, const char * pPath) { - IBase* pIBaseClass = (IBase *)pTexture2D; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "SetTileStyleUV"); - pJournalEntry->addEnumParameter("TileStyleU", "TextureTileStyle", (Lib3MF_int32)(eTileStyleU)); - pJournalEntry->addEnumParameter("TileStyleV", "TextureTileStyle", (Lib3MF_int32)(eTileStyleV)); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "SetPath"); + pJournalEntry->addStringParameter("Path", pPath); } - ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); - if (!pITexture2D) + if (pPath == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sPath(pPath); + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pITexture2D->SetTileStyleUV(eTileStyleU, eTileStyleV); + pIAttachment->SetPath(sPath); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -10622,25 +10638,27 @@ Lib3MFResult lib3mf_texture2d_settilestyleuv(Lib3MF_Texture2D pTexture2D, eLib3M } } -Lib3MFResult lib3mf_texture2d_getfilter(Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter * pFilter) +Lib3MFResult lib3mf_attachment_packagepart(Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart) { - IBase* pIBaseClass = (IBase *)pTexture2D; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "GetFilter"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "PackagePart"); } - if (pFilter == nullptr) + if (pPackagePart == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); - if (!pITexture2D) + IBase* pBasePackagePart(nullptr); + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pFilter = pITexture2D->GetFilter(); + pBasePackagePart = pIAttachment->PackagePart(); + *pPackagePart = (IBase*)(pBasePackagePart); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addEnumResult("Filter", "TextureFilter", (Lib3MF_int32)(*pFilter)); + pJournalEntry->addHandleResult("PackagePart", *pPackagePart); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10656,23 +10674,47 @@ Lib3MFResult lib3mf_texture2d_getfilter(Lib3MF_Texture2D pTexture2D, eLib3MFText } } -Lib3MFResult lib3mf_texture2d_setfilter(Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter eFilter) +Lib3MFResult lib3mf_attachment_getrelationshiptype(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) { - IBase* pIBaseClass = (IBase *)pTexture2D; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "SetFilter"); - pJournalEntry->addEnumParameter("Filter", "TextureFilter", (Lib3MF_int32)(eFilter)); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "GetRelationShipType"); } - ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); - if (!pITexture2D) + if ( (!pPathBuffer) && !(pPathNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sPath(""); + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pITexture2D->SetFilter(eFilter); + bool isCacheCall = (pPathBuffer == nullptr); + if (isCacheCall) { + sPath = pIAttachment->GetRelationShipType(); + pIAttachment->_setCache (new ParameterCache_1 (sPath)); + } + else { + auto cache = dynamic_cast*> (pIAttachment->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sPath); + pIAttachment->_setCache (nullptr); + } + + if (pPathNeededChars) + *pPathNeededChars = (Lib3MF_uint32) (sPath.size()+1); + if (pPathBuffer) { + if (sPath.size() >= nPathBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iPath = 0; iPath < sPath.size(); iPath++) + pPathBuffer[iPath] = sPath[iPath]; + pPathBuffer[sPath.size()] = 0; + } if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Path", sPath.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10688,51 +10730,26 @@ Lib3MFResult lib3mf_texture2d_setfilter(Lib3MF_Texture2D pTexture2D, eLib3MFText } } - -/************************************************************************************************************************* - Class implementation for ImplicitPort -**************************************************************************************************************************/ -Lib3MFResult lib3mf_implicitport_getidentifier(Lib3MF_ImplicitPort pImplicitPort, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer) +Lib3MFResult lib3mf_attachment_setrelationshiptype(Lib3MF_Attachment pAttachment, const char * pPath) { - IBase* pIBaseClass = (IBase *)pImplicitPort; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPort, "ImplicitPort", "GetIdentifier"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "SetRelationShipType"); + pJournalEntry->addStringParameter("Path", pPath); } - if ( (!pIdentifierBuffer) && !(pIdentifierNeededChars) ) + if (pPath == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sIdentifier(""); - IImplicitPort* pIImplicitPort = dynamic_cast(pIBaseClass); - if (!pIImplicitPort) + std::string sPath(pPath); + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pIdentifierBuffer == nullptr); - if (isCacheCall) { - sIdentifier = pIImplicitPort->GetIdentifier(); + pIAttachment->SetRelationShipType(sPath); - pIImplicitPort->_setCache (new ParameterCache_1 (sIdentifier)); - } - else { - auto cache = dynamic_cast*> (pIImplicitPort->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sIdentifier); - pIImplicitPort->_setCache (nullptr); - } - - if (pIdentifierNeededChars) - *pIdentifierNeededChars = (Lib3MF_uint32) (sIdentifier.size()+1); - if (pIdentifierBuffer) { - if (sIdentifier.size() >= nIdentifierBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iIdentifier = 0; iIdentifier < sIdentifier.size(); iIdentifier++) - pIdentifierBuffer[iIdentifier] = sIdentifier[iIdentifier]; - pIdentifierBuffer[sIdentifier.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Identifier", sIdentifier.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10748,24 +10765,24 @@ Lib3MFResult lib3mf_implicitport_getidentifier(Lib3MF_ImplicitPort pImplicitPort } } -Lib3MFResult lib3mf_implicitport_setidentifier(Lib3MF_ImplicitPort pImplicitPort, const char * pIdentifier) +Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAttachment, const char * pFileName) { - IBase* pIBaseClass = (IBase *)pImplicitPort; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPort, "ImplicitPort", "SetIdentifier"); - pJournalEntry->addStringParameter("Identifier", pIdentifier); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "WriteToFile"); + pJournalEntry->addStringParameter("FileName", pFileName); } - if (pIdentifier == nullptr) + if (pFileName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sIdentifier(pIdentifier); - IImplicitPort* pIImplicitPort = dynamic_cast(pIBaseClass); - if (!pIImplicitPort) + std::string sFileName(pFileName); + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIImplicitPort->SetIdentifier(sIdentifier); + pIAttachment->WriteToFile(sFileName); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -10783,47 +10800,26 @@ Lib3MFResult lib3mf_implicitport_setidentifier(Lib3MF_ImplicitPort pImplicitPort } } -Lib3MFResult lib3mf_implicitport_getdisplayname(Lib3MF_ImplicitPort pImplicitPort, const Lib3MF_uint32 nDisplayNameBufferSize, Lib3MF_uint32* pDisplayNameNeededChars, char * pDisplayNameBuffer) +Lib3MFResult lib3mf_attachment_readfromfile(Lib3MF_Attachment pAttachment, const char * pFileName) { - IBase* pIBaseClass = (IBase *)pImplicitPort; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPort, "ImplicitPort", "GetDisplayName"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "ReadFromFile"); + pJournalEntry->addStringParameter("FileName", pFileName); } - if ( (!pDisplayNameBuffer) && !(pDisplayNameNeededChars) ) + if (pFileName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sDisplayName(""); - IImplicitPort* pIImplicitPort = dynamic_cast(pIBaseClass); - if (!pIImplicitPort) + std::string sFileName(pFileName); + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pDisplayNameBuffer == nullptr); - if (isCacheCall) { - sDisplayName = pIImplicitPort->GetDisplayName(); + pIAttachment->ReadFromFile(sFileName); - pIImplicitPort->_setCache (new ParameterCache_1 (sDisplayName)); - } - else { - auto cache = dynamic_cast*> (pIImplicitPort->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sDisplayName); - pIImplicitPort->_setCache (nullptr); - } - - if (pDisplayNameNeededChars) - *pDisplayNameNeededChars = (Lib3MF_uint32) (sDisplayName.size()+1); - if (pDisplayNameBuffer) { - if (sDisplayName.size() >= nDisplayNameBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iDisplayName = 0; iDisplayName < sDisplayName.size(); iDisplayName++) - pDisplayNameBuffer[iDisplayName] = sDisplayName[iDisplayName]; - pDisplayNameBuffer[sDisplayName.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("DisplayName", sDisplayName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10839,24 +10835,22 @@ Lib3MFResult lib3mf_implicitport_getdisplayname(Lib3MF_ImplicitPort pImplicitPor } } -Lib3MFResult lib3mf_implicitport_setdisplayname(Lib3MF_ImplicitPort pImplicitPort, const char * pDisplayName) +Lib3MFResult lib3mf_attachment_readfromcallback(Lib3MF_Attachment pAttachment, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData) { - IBase* pIBaseClass = (IBase *)pImplicitPort; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPort, "ImplicitPort", "SetDisplayName"); - pJournalEntry->addStringParameter("DisplayName", pDisplayName); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "ReadFromCallback"); + pJournalEntry->addUInt64Parameter("StreamSize", nStreamSize); + pJournalEntry->addPointerParameter("UserData", pUserData); } - if (pDisplayName == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sDisplayName(pDisplayName); - IImplicitPort* pIImplicitPort = dynamic_cast(pIBaseClass); - if (!pIImplicitPort) + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIImplicitPort->SetDisplayName(sDisplayName); + pIAttachment->ReadFromCallback(pTheReadCallback, nStreamSize, pTheSeekCallback, pUserData); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -10874,23 +10868,25 @@ Lib3MFResult lib3mf_implicitport_setdisplayname(Lib3MF_ImplicitPort pImplicitPor } } -Lib3MFResult lib3mf_implicitport_settype(Lib3MF_ImplicitPort pImplicitPort, eLib3MFImplicitPortType eImplicitPortType) +Lib3MFResult lib3mf_attachment_getstreamsize(Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize) { - IBase* pIBaseClass = (IBase *)pImplicitPort; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPort, "ImplicitPort", "SetType"); - pJournalEntry->addEnumParameter("ImplicitPortType", "ImplicitPortType", (Lib3MF_int32)(eImplicitPortType)); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "GetStreamSize"); } - IImplicitPort* pIImplicitPort = dynamic_cast(pIBaseClass); - if (!pIImplicitPort) + if (pStreamSize == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIImplicitPort->SetType(eImplicitPortType); + *pStreamSize = pIAttachment->GetStreamSize(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt64Result("StreamSize", *pStreamSize); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10906,25 +10902,24 @@ Lib3MFResult lib3mf_implicitport_settype(Lib3MF_ImplicitPort pImplicitPort, eLib } } -Lib3MFResult lib3mf_implicitport_gettype(Lib3MF_ImplicitPort pImplicitPort, eLib3MFImplicitPortType * pImplicitPortType) +Lib3MFResult lib3mf_attachment_writetobuffer(Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer) { - IBase* pIBaseClass = (IBase *)pImplicitPort; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPort, "ImplicitPort", "GetType"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "WriteToBuffer"); } - if (pImplicitPortType == nullptr) + if ((!pBufferBuffer) && !(pBufferNeededCount)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IImplicitPort* pIImplicitPort = dynamic_cast(pIBaseClass); - if (!pIImplicitPort) + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pImplicitPortType = pIImplicitPort->GetType(); + pIAttachment->WriteToBuffer(nBufferBufferSize, pBufferNeededCount, pBufferBuffer); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addEnumResult("ImplicitPortType", "ImplicitPortType", (Lib3MF_int32)(*pImplicitPortType)); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10940,47 +10935,24 @@ Lib3MFResult lib3mf_implicitport_gettype(Lib3MF_ImplicitPort pImplicitPort, eLib } } -Lib3MFResult lib3mf_implicitport_getreference(Lib3MF_ImplicitPort pImplicitPort, const Lib3MF_uint32 nReferenceBufferSize, Lib3MF_uint32* pReferenceNeededChars, char * pReferenceBuffer) +Lib3MFResult lib3mf_attachment_readfrombuffer(Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer) { - IBase* pIBaseClass = (IBase *)pImplicitPort; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPort, "ImplicitPort", "GetReference"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "ReadFromBuffer"); } - if ( (!pReferenceBuffer) && !(pReferenceNeededChars) ) + if ( (!pBufferBuffer) && (nBufferBufferSize>0)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sReference(""); - IImplicitPort* pIImplicitPort = dynamic_cast(pIBaseClass); - if (!pIImplicitPort) + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pReferenceBuffer == nullptr); - if (isCacheCall) { - sReference = pIImplicitPort->GetReference(); + pIAttachment->ReadFromBuffer(nBufferBufferSize, pBufferBuffer); - pIImplicitPort->_setCache (new ParameterCache_1 (sReference)); - } - else { - auto cache = dynamic_cast*> (pIImplicitPort->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sReference); - pIImplicitPort->_setCache (nullptr); - } - - if (pReferenceNeededChars) - *pReferenceNeededChars = (Lib3MF_uint32) (sReference.size()+1); - if (pReferenceBuffer) { - if (sReference.size() >= nReferenceBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iReference = 0; iReference < sReference.size(); iReference++) - pReferenceBuffer[iReference] = sReference[iReference]; - pReferenceBuffer[sReference.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Reference", sReference.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -10996,26 +10968,31 @@ Lib3MFResult lib3mf_implicitport_getreference(Lib3MF_ImplicitPort pImplicitPort, } } -Lib3MFResult lib3mf_implicitport_setreference(Lib3MF_ImplicitPort pImplicitPort, const char * pReference) + +/************************************************************************************************************************* + Class implementation for Texture2D +**************************************************************************************************************************/ +Lib3MFResult lib3mf_texture2d_getattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment) { - IBase* pIBaseClass = (IBase *)pImplicitPort; + IBase* pIBaseClass = (IBase *)pTexture2D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPort, "ImplicitPort", "SetReference"); - pJournalEntry->addStringParameter("Reference", pReference); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "GetAttachment"); } - if (pReference == nullptr) + if (pAttachment == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sReference(pReference); - IImplicitPort* pIImplicitPort = dynamic_cast(pIBaseClass); - if (!pIImplicitPort) + IBase* pBaseAttachment(nullptr); + ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); + if (!pITexture2D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIImplicitPort->SetReference(sReference); + pBaseAttachment = pITexture2D->GetAttachment(); + *pAttachment = (IBase*)(pBaseAttachment); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Attachment", *pAttachment); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11031,29 +11008,28 @@ Lib3MFResult lib3mf_implicitport_setreference(Lib3MF_ImplicitPort pImplicitPort, } } - -/************************************************************************************************************************* - Class implementation for Iterator -**************************************************************************************************************************/ -Lib3MFResult lib3mf_iterator_movenext(Lib3MF_Iterator pIterator, bool * pHasNext) +Lib3MFResult lib3mf_texture2d_setattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment) { - IBase* pIBaseClass = (IBase *)pIterator; + IBase* pIBaseClass = (IBase *)pTexture2D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pIterator, "Iterator", "MoveNext"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "SetAttachment"); + pJournalEntry->addHandleParameter("Attachment", pAttachment); } - if (pHasNext == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IIterator* pIIterator = dynamic_cast(pIBaseClass); - if (!pIIterator) + IBase* pIBaseClassAttachment = (IBase *)pAttachment; + IAttachment* pIAttachment = dynamic_cast(pIBaseClassAttachment); + if (!pIAttachment) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); + if (!pITexture2D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pHasNext = pIIterator->MoveNext(); + pITexture2D->SetAttachment(pIAttachment); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("HasNext", *pHasNext); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11069,25 +11045,25 @@ Lib3MFResult lib3mf_iterator_movenext(Lib3MF_Iterator pIterator, bool * pHasNext } } -Lib3MFResult lib3mf_iterator_moveprevious(Lib3MF_Iterator pIterator, bool * pHasPrevious) +Lib3MFResult lib3mf_texture2d_getcontenttype(Lib3MF_Texture2D pTexture2D, eLib3MFTextureType * pContentType) { - IBase* pIBaseClass = (IBase *)pIterator; + IBase* pIBaseClass = (IBase *)pTexture2D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pIterator, "Iterator", "MovePrevious"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "GetContentType"); } - if (pHasPrevious == nullptr) + if (pContentType == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IIterator* pIIterator = dynamic_cast(pIBaseClass); - if (!pIIterator) + ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); + if (!pITexture2D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pHasPrevious = pIIterator->MovePrevious(); + *pContentType = pITexture2D->GetContentType(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("HasPrevious", *pHasPrevious); + pJournalEntry->addEnumResult("ContentType", "TextureType", (Lib3MF_int32)(*pContentType)); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11103,25 +11079,23 @@ Lib3MFResult lib3mf_iterator_moveprevious(Lib3MF_Iterator pIterator, bool * pHas } } -Lib3MFResult lib3mf_iterator_count(Lib3MF_Iterator pIterator, Lib3MF_uint64 * pCount) +Lib3MFResult lib3mf_texture2d_setcontenttype(Lib3MF_Texture2D pTexture2D, eLib3MFTextureType eContentType) { - IBase* pIBaseClass = (IBase *)pIterator; + IBase* pIBaseClass = (IBase *)pTexture2D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pIterator, "Iterator", "Count"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "SetContentType"); + pJournalEntry->addEnumParameter("ContentType", "TextureType", (Lib3MF_int32)(eContentType)); } - if (pCount == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IIterator* pIIterator = dynamic_cast(pIBaseClass); - if (!pIIterator) + ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); + if (!pITexture2D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIIterator->Count(); + pITexture2D->SetContentType(eContentType); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt64Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11137,31 +11111,28 @@ Lib3MFResult lib3mf_iterator_count(Lib3MF_Iterator pIterator, Lib3MF_uint64 * pC } } - -/************************************************************************************************************************* - Class implementation for ImplicitPortIterator -**************************************************************************************************************************/ -Lib3MFResult lib3mf_implicitportiterator_getcurrent(Lib3MF_ImplicitPortIterator pImplicitPortIterator, Lib3MF_ImplicitPort * pPort) +Lib3MFResult lib3mf_texture2d_gettilestyleuv(Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle * pTileStyleU, eLib3MFTextureTileStyle * pTileStyleV) { - IBase* pIBaseClass = (IBase *)pImplicitPortIterator; + IBase* pIBaseClass = (IBase *)pTexture2D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPortIterator, "ImplicitPortIterator", "GetCurrent"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "GetTileStyleUV"); } - if (pPort == nullptr) + if (!pTileStyleU) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBasePort(nullptr); - IImplicitPortIterator* pIImplicitPortIterator = dynamic_cast(pIBaseClass); - if (!pIImplicitPortIterator) + if (!pTileStyleV) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); + if (!pITexture2D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBasePort = pIImplicitPortIterator->GetCurrent(); + pITexture2D->GetTileStyleUV(*pTileStyleU, *pTileStyleV); - *pPort = (IBase*)(pBasePort); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Port", *pPort); + pJournalEntry->addEnumResult("TileStyleU", "TextureTileStyle", (Lib3MF_int32)(*pTileStyleU)); + pJournalEntry->addEnumResult("TileStyleV", "TextureTileStyle", (Lib3MF_int32)(*pTileStyleV)); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11177,51 +11148,24 @@ Lib3MFResult lib3mf_implicitportiterator_getcurrent(Lib3MF_ImplicitPortIterator } } - -/************************************************************************************************************************* - Class implementation for ImplicitNode -**************************************************************************************************************************/ -Lib3MFResult lib3mf_implicitnode_getidentifier(Lib3MF_ImplicitNode pImplicitNode, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer) +Lib3MFResult lib3mf_texture2d_settilestyleuv(Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle eTileStyleU, eLib3MFTextureTileStyle eTileStyleV) { - IBase* pIBaseClass = (IBase *)pImplicitNode; + IBase* pIBaseClass = (IBase *)pTexture2D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "GetIdentifier"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "SetTileStyleUV"); + pJournalEntry->addEnumParameter("TileStyleU", "TextureTileStyle", (Lib3MF_int32)(eTileStyleU)); + pJournalEntry->addEnumParameter("TileStyleV", "TextureTileStyle", (Lib3MF_int32)(eTileStyleV)); } - if ( (!pIdentifierBuffer) && !(pIdentifierNeededChars) ) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sIdentifier(""); - IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); - if (!pIImplicitNode) + ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); + if (!pITexture2D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pIdentifierBuffer == nullptr); - if (isCacheCall) { - sIdentifier = pIImplicitNode->GetIdentifier(); + pITexture2D->SetTileStyleUV(eTileStyleU, eTileStyleV); - pIImplicitNode->_setCache (new ParameterCache_1 (sIdentifier)); - } - else { - auto cache = dynamic_cast*> (pIImplicitNode->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sIdentifier); - pIImplicitNode->_setCache (nullptr); - } - - if (pIdentifierNeededChars) - *pIdentifierNeededChars = (Lib3MF_uint32) (sIdentifier.size()+1); - if (pIdentifierBuffer) { - if (sIdentifier.size() >= nIdentifierBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iIdentifier = 0; iIdentifier < sIdentifier.size(); iIdentifier++) - pIdentifierBuffer[iIdentifier] = sIdentifier[iIdentifier]; - pIdentifierBuffer[sIdentifier.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Identifier", sIdentifier.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11237,26 +11181,25 @@ Lib3MFResult lib3mf_implicitnode_getidentifier(Lib3MF_ImplicitNode pImplicitNode } } -Lib3MFResult lib3mf_implicitnode_setidentifier(Lib3MF_ImplicitNode pImplicitNode, const char * pIdentifier) +Lib3MFResult lib3mf_texture2d_getfilter(Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter * pFilter) { - IBase* pIBaseClass = (IBase *)pImplicitNode; + IBase* pIBaseClass = (IBase *)pTexture2D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "SetIdentifier"); - pJournalEntry->addStringParameter("Identifier", pIdentifier); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "GetFilter"); } - if (pIdentifier == nullptr) + if (pFilter == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sIdentifier(pIdentifier); - IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); - if (!pIImplicitNode) + ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); + if (!pITexture2D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIImplicitNode->SetIdentifier(sIdentifier); + *pFilter = pITexture2D->GetFilter(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addEnumResult("Filter", "TextureFilter", (Lib3MF_int32)(*pFilter)); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11272,47 +11215,23 @@ Lib3MFResult lib3mf_implicitnode_setidentifier(Lib3MF_ImplicitNode pImplicitNode } } -Lib3MFResult lib3mf_implicitnode_getdisplayname(Lib3MF_ImplicitNode pImplicitNode, const Lib3MF_uint32 nDisplayNameBufferSize, Lib3MF_uint32* pDisplayNameNeededChars, char * pDisplayNameBuffer) +Lib3MFResult lib3mf_texture2d_setfilter(Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter eFilter) { - IBase* pIBaseClass = (IBase *)pImplicitNode; + IBase* pIBaseClass = (IBase *)pTexture2D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "GetDisplayName"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "SetFilter"); + pJournalEntry->addEnumParameter("Filter", "TextureFilter", (Lib3MF_int32)(eFilter)); } - if ( (!pDisplayNameBuffer) && !(pDisplayNameNeededChars) ) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sDisplayName(""); - IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); - if (!pIImplicitNode) + ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); + if (!pITexture2D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pDisplayNameBuffer == nullptr); - if (isCacheCall) { - sDisplayName = pIImplicitNode->GetDisplayName(); + pITexture2D->SetFilter(eFilter); - pIImplicitNode->_setCache (new ParameterCache_1 (sDisplayName)); - } - else { - auto cache = dynamic_cast*> (pIImplicitNode->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sDisplayName); - pIImplicitNode->_setCache (nullptr); - } - - if (pDisplayNameNeededChars) - *pDisplayNameNeededChars = (Lib3MF_uint32) (sDisplayName.size()+1); - if (pDisplayNameBuffer) { - if (sDisplayName.size() >= nDisplayNameBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iDisplayName = 0; iDisplayName < sDisplayName.size(); iDisplayName++) - pDisplayNameBuffer[iDisplayName] = sDisplayName[iDisplayName]; - pDisplayNameBuffer[sDisplayName.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("DisplayName", sDisplayName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11328,26 +11247,51 @@ Lib3MFResult lib3mf_implicitnode_getdisplayname(Lib3MF_ImplicitNode pImplicitNod } } -Lib3MFResult lib3mf_implicitnode_setdisplayname(Lib3MF_ImplicitNode pImplicitNode, const char * pDisplayName) -{ - IBase* pIBaseClass = (IBase *)pImplicitNode; + +/************************************************************************************************************************* + Class implementation for ImplicitPort +**************************************************************************************************************************/ +Lib3MFResult lib3mf_implicitport_getidentifier(Lib3MF_ImplicitPort pImplicitPort, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer) +{ + IBase* pIBaseClass = (IBase *)pImplicitPort; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "SetDisplayName"); - pJournalEntry->addStringParameter("DisplayName", pDisplayName); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPort, "ImplicitPort", "GetIdentifier"); } - if (pDisplayName == nullptr) + if ( (!pIdentifierBuffer) && !(pIdentifierNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sDisplayName(pDisplayName); - IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); - if (!pIImplicitNode) + std::string sIdentifier(""); + IImplicitPort* pIImplicitPort = dynamic_cast(pIBaseClass); + if (!pIImplicitPort) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIImplicitNode->SetDisplayName(sDisplayName); + bool isCacheCall = (pIdentifierBuffer == nullptr); + if (isCacheCall) { + sIdentifier = pIImplicitPort->GetIdentifier(); + pIImplicitPort->_setCache (new ParameterCache_1 (sIdentifier)); + } + else { + auto cache = dynamic_cast*> (pIImplicitPort->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sIdentifier); + pIImplicitPort->_setCache (nullptr); + } + + if (pIdentifierNeededChars) + *pIdentifierNeededChars = (Lib3MF_uint32) (sIdentifier.size()+1); + if (pIdentifierBuffer) { + if (sIdentifier.size() >= nIdentifierBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iIdentifier = 0; iIdentifier < sIdentifier.size(); iIdentifier++) + pIdentifierBuffer[iIdentifier] = sIdentifier[iIdentifier]; + pIdentifierBuffer[sIdentifier.size()] = 0; + } if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Identifier", sIdentifier.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11363,47 +11307,26 @@ Lib3MFResult lib3mf_implicitnode_setdisplayname(Lib3MF_ImplicitNode pImplicitNod } } -Lib3MFResult lib3mf_implicitnode_gettag(Lib3MF_ImplicitNode pImplicitNode, const Lib3MF_uint32 nTagBufferSize, Lib3MF_uint32* pTagNeededChars, char * pTagBuffer) +Lib3MFResult lib3mf_implicitport_setidentifier(Lib3MF_ImplicitPort pImplicitPort, const char * pIdentifier) { - IBase* pIBaseClass = (IBase *)pImplicitNode; + IBase* pIBaseClass = (IBase *)pImplicitPort; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "GetTag"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPort, "ImplicitPort", "SetIdentifier"); + pJournalEntry->addStringParameter("Identifier", pIdentifier); } - if ( (!pTagBuffer) && !(pTagNeededChars) ) + if (pIdentifier == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sTag(""); - IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); - if (!pIImplicitNode) + std::string sIdentifier(pIdentifier); + IImplicitPort* pIImplicitPort = dynamic_cast(pIBaseClass); + if (!pIImplicitPort) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pTagBuffer == nullptr); - if (isCacheCall) { - sTag = pIImplicitNode->GetTag(); + pIImplicitPort->SetIdentifier(sIdentifier); - pIImplicitNode->_setCache (new ParameterCache_1 (sTag)); - } - else { - auto cache = dynamic_cast*> (pIImplicitNode->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sTag); - pIImplicitNode->_setCache (nullptr); - } - - if (pTagNeededChars) - *pTagNeededChars = (Lib3MF_uint32) (sTag.size()+1); - if (pTagBuffer) { - if (sTag.size() >= nTagBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iTag = 0; iTag < sTag.size(); iTag++) - pTagBuffer[iTag] = sTag[iTag]; - pTagBuffer[sTag.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Tag", sTag.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11419,26 +11342,47 @@ Lib3MFResult lib3mf_implicitnode_gettag(Lib3MF_ImplicitNode pImplicitNode, const } } -Lib3MFResult lib3mf_implicitnode_settag(Lib3MF_ImplicitNode pImplicitNode, const char * pTag) +Lib3MFResult lib3mf_implicitport_getdisplayname(Lib3MF_ImplicitPort pImplicitPort, const Lib3MF_uint32 nDisplayNameBufferSize, Lib3MF_uint32* pDisplayNameNeededChars, char * pDisplayNameBuffer) { - IBase* pIBaseClass = (IBase *)pImplicitNode; + IBase* pIBaseClass = (IBase *)pImplicitPort; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "SetTag"); - pJournalEntry->addStringParameter("Tag", pTag); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPort, "ImplicitPort", "GetDisplayName"); } - if (pTag == nullptr) + if ( (!pDisplayNameBuffer) && !(pDisplayNameNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sTag(pTag); - IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); - if (!pIImplicitNode) + std::string sDisplayName(""); + IImplicitPort* pIImplicitPort = dynamic_cast(pIBaseClass); + if (!pIImplicitPort) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIImplicitNode->SetTag(sTag); + bool isCacheCall = (pDisplayNameBuffer == nullptr); + if (isCacheCall) { + sDisplayName = pIImplicitPort->GetDisplayName(); + pIImplicitPort->_setCache (new ParameterCache_1 (sDisplayName)); + } + else { + auto cache = dynamic_cast*> (pIImplicitPort->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sDisplayName); + pIImplicitPort->_setCache (nullptr); + } + + if (pDisplayNameNeededChars) + *pDisplayNameNeededChars = (Lib3MF_uint32) (sDisplayName.size()+1); + if (pDisplayNameBuffer) { + if (sDisplayName.size() >= nDisplayNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iDisplayName = 0; iDisplayName < sDisplayName.size(); iDisplayName++) + pDisplayNameBuffer[iDisplayName] = sDisplayName[iDisplayName]; + pDisplayNameBuffer[sDisplayName.size()] = 0; + } if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("DisplayName", sDisplayName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11454,25 +11398,26 @@ Lib3MFResult lib3mf_implicitnode_settag(Lib3MF_ImplicitNode pImplicitNode, const } } -Lib3MFResult lib3mf_implicitnode_getnodetype(Lib3MF_ImplicitNode pImplicitNode, eLib3MFImplicitNodeType * pType) +Lib3MFResult lib3mf_implicitport_setdisplayname(Lib3MF_ImplicitPort pImplicitPort, const char * pDisplayName) { - IBase* pIBaseClass = (IBase *)pImplicitNode; + IBase* pIBaseClass = (IBase *)pImplicitPort; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "GetNodeType"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPort, "ImplicitPort", "SetDisplayName"); + pJournalEntry->addStringParameter("DisplayName", pDisplayName); } - if (pType == nullptr) + if (pDisplayName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); - if (!pIImplicitNode) + std::string sDisplayName(pDisplayName); + IImplicitPort* pIImplicitPort = dynamic_cast(pIBaseClass); + if (!pIImplicitPort) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pType = pIImplicitNode->GetNodeType(); + pIImplicitPort->SetDisplayName(sDisplayName); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addEnumResult("Type", "ImplicitNodeType", (Lib3MF_int32)(*pType)); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11488,35 +11433,23 @@ Lib3MFResult lib3mf_implicitnode_getnodetype(Lib3MF_ImplicitNode pImplicitNode, } } -Lib3MFResult lib3mf_implicitnode_addinput(Lib3MF_ImplicitNode pImplicitNode, const char * pIdentifier, const char * pDisplayName, Lib3MF_ImplicitPort * pPort) +Lib3MFResult lib3mf_implicitport_settype(Lib3MF_ImplicitPort pImplicitPort, eLib3MFImplicitPortType eImplicitPortType) { - IBase* pIBaseClass = (IBase *)pImplicitNode; + IBase* pIBaseClass = (IBase *)pImplicitPort; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "AddInput"); - pJournalEntry->addStringParameter("Identifier", pIdentifier); - pJournalEntry->addStringParameter("DisplayName", pDisplayName); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPort, "ImplicitPort", "SetType"); + pJournalEntry->addEnumParameter("ImplicitPortType", "ImplicitPortType", (Lib3MF_int32)(eImplicitPortType)); } - if (pIdentifier == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pDisplayName == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pPort == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sIdentifier(pIdentifier); - std::string sDisplayName(pDisplayName); - IBase* pBasePort(nullptr); - IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); - if (!pIImplicitNode) + IImplicitPort* pIImplicitPort = dynamic_cast(pIBaseClass); + if (!pIImplicitPort) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBasePort = pIImplicitNode->AddInput(sIdentifier, sDisplayName); + pIImplicitPort->SetType(eImplicitPortType); - *pPort = (IBase*)(pBasePort); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Port", *pPort); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11532,27 +11465,25 @@ Lib3MFResult lib3mf_implicitnode_addinput(Lib3MF_ImplicitNode pImplicitNode, con } } -Lib3MFResult lib3mf_implicitnode_getinputs(Lib3MF_ImplicitNode pImplicitNode, Lib3MF_ImplicitPortIterator * pIterator) +Lib3MFResult lib3mf_implicitport_gettype(Lib3MF_ImplicitPort pImplicitPort, eLib3MFImplicitPortType * pImplicitPortType) { - IBase* pIBaseClass = (IBase *)pImplicitNode; + IBase* pIBaseClass = (IBase *)pImplicitPort; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "GetInputs"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPort, "ImplicitPort", "GetType"); } - if (pIterator == nullptr) + if (pImplicitPortType == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseIterator(nullptr); - IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); - if (!pIImplicitNode) + IImplicitPort* pIImplicitPort = dynamic_cast(pIBaseClass); + if (!pIImplicitPort) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseIterator = pIImplicitNode->GetInputs(); + *pImplicitPortType = pIImplicitPort->GetType(); - *pIterator = (IBase*)(pBaseIterator); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Iterator", *pIterator); + pJournalEntry->addEnumResult("ImplicitPortType", "ImplicitPortType", (Lib3MF_int32)(*pImplicitPortType)); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11568,35 +11499,47 @@ Lib3MFResult lib3mf_implicitnode_getinputs(Lib3MF_ImplicitNode pImplicitNode, Li } } -Lib3MFResult lib3mf_implicitnode_addoutput(Lib3MF_ImplicitNode pImplicitNode, const char * pIdentifier, const char * pDisplayName, Lib3MF_ImplicitPort * pPort) +Lib3MFResult lib3mf_implicitport_getreference(Lib3MF_ImplicitPort pImplicitPort, const Lib3MF_uint32 nReferenceBufferSize, Lib3MF_uint32* pReferenceNeededChars, char * pReferenceBuffer) { - IBase* pIBaseClass = (IBase *)pImplicitNode; + IBase* pIBaseClass = (IBase *)pImplicitPort; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "AddOutput"); - pJournalEntry->addStringParameter("Identifier", pIdentifier); - pJournalEntry->addStringParameter("DisplayName", pDisplayName); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPort, "ImplicitPort", "GetReference"); } - if (pIdentifier == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pDisplayName == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pPort == nullptr) + if ( (!pReferenceBuffer) && !(pReferenceNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sIdentifier(pIdentifier); - std::string sDisplayName(pDisplayName); - IBase* pBasePort(nullptr); - IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); - if (!pIImplicitNode) + std::string sReference(""); + IImplicitPort* pIImplicitPort = dynamic_cast(pIBaseClass); + if (!pIImplicitPort) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBasePort = pIImplicitNode->AddOutput(sIdentifier, sDisplayName); + bool isCacheCall = (pReferenceBuffer == nullptr); + if (isCacheCall) { + sReference = pIImplicitPort->GetReference(); - *pPort = (IBase*)(pBasePort); + pIImplicitPort->_setCache (new ParameterCache_1 (sReference)); + } + else { + auto cache = dynamic_cast*> (pIImplicitPort->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sReference); + pIImplicitPort->_setCache (nullptr); + } + + if (pReferenceNeededChars) + *pReferenceNeededChars = (Lib3MF_uint32) (sReference.size()+1); + if (pReferenceBuffer) { + if (sReference.size() >= nReferenceBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iReference = 0; iReference < sReference.size(); iReference++) + pReferenceBuffer[iReference] = sReference[iReference]; + pReferenceBuffer[sReference.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Port", *pPort); + pJournalEntry->addStringResult("Reference", sReference.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11612,27 +11555,26 @@ Lib3MFResult lib3mf_implicitnode_addoutput(Lib3MF_ImplicitNode pImplicitNode, co } } -Lib3MFResult lib3mf_implicitnode_getoutputs(Lib3MF_ImplicitNode pImplicitNode, Lib3MF_ImplicitPortIterator * pIterator) +Lib3MFResult lib3mf_implicitport_setreference(Lib3MF_ImplicitPort pImplicitPort, const char * pReference) { - IBase* pIBaseClass = (IBase *)pImplicitNode; + IBase* pIBaseClass = (IBase *)pImplicitPort; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "GetOutputs"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPort, "ImplicitPort", "SetReference"); + pJournalEntry->addStringParameter("Reference", pReference); } - if (pIterator == nullptr) + if (pReference == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseIterator(nullptr); - IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); - if (!pIImplicitNode) + std::string sReference(pReference); + IImplicitPort* pIImplicitPort = dynamic_cast(pIBaseClass); + if (!pIImplicitPort) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseIterator = pIImplicitNode->GetOutputs(); + pIImplicitPort->SetReference(sReference); - *pIterator = (IBase*)(pBaseIterator); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Iterator", *pIterator); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11648,31 +11590,29 @@ Lib3MFResult lib3mf_implicitnode_getoutputs(Lib3MF_ImplicitNode pImplicitNode, L } } -Lib3MFResult lib3mf_implicitnode_findinput(Lib3MF_ImplicitNode pImplicitNode, const char * pIdentifier, Lib3MF_ImplicitPort * pInput) + +/************************************************************************************************************************* + Class implementation for Iterator +**************************************************************************************************************************/ +Lib3MFResult lib3mf_iterator_movenext(Lib3MF_Iterator pIterator, bool * pHasNext) { - IBase* pIBaseClass = (IBase *)pImplicitNode; + IBase* pIBaseClass = (IBase *)pIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "FindInput"); - pJournalEntry->addStringParameter("Identifier", pIdentifier); + pJournalEntry = m_GlobalJournal->beginClassMethod(pIterator, "Iterator", "MoveNext"); } - if (pIdentifier == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pInput == nullptr) + if (pHasNext == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sIdentifier(pIdentifier); - IBase* pBaseInput(nullptr); - IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); - if (!pIImplicitNode) + IIterator* pIIterator = dynamic_cast(pIBaseClass); + if (!pIIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseInput = pIImplicitNode->FindInput(sIdentifier); + *pHasNext = pIIterator->MoveNext(); - *pInput = (IBase*)(pBaseInput); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Input", *pInput); + pJournalEntry->addBooleanResult("HasNext", *pHasNext); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11688,31 +11628,25 @@ Lib3MFResult lib3mf_implicitnode_findinput(Lib3MF_ImplicitNode pImplicitNode, co } } -Lib3MFResult lib3mf_implicitnode_findoutput(Lib3MF_ImplicitNode pImplicitNode, const char * pIdentifier, Lib3MF_ImplicitPort * pOutput) +Lib3MFResult lib3mf_iterator_moveprevious(Lib3MF_Iterator pIterator, bool * pHasPrevious) { - IBase* pIBaseClass = (IBase *)pImplicitNode; + IBase* pIBaseClass = (IBase *)pIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "FindOutput"); - pJournalEntry->addStringParameter("Identifier", pIdentifier); + pJournalEntry = m_GlobalJournal->beginClassMethod(pIterator, "Iterator", "MovePrevious"); } - if (pIdentifier == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pOutput == nullptr) + if (pHasPrevious == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sIdentifier(pIdentifier); - IBase* pBaseOutput(nullptr); - IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); - if (!pIImplicitNode) + IIterator* pIIterator = dynamic_cast(pIBaseClass); + if (!pIIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseOutput = pIImplicitNode->FindOutput(sIdentifier); + *pHasPrevious = pIIterator->MovePrevious(); - *pOutput = (IBase*)(pBaseOutput); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Output", *pOutput); + pJournalEntry->addBooleanResult("HasPrevious", *pHasPrevious); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11728,25 +11662,25 @@ Lib3MFResult lib3mf_implicitnode_findoutput(Lib3MF_ImplicitNode pImplicitNode, c } } -Lib3MFResult lib3mf_implicitnode_aretypesvalid(Lib3MF_ImplicitNode pImplicitNode, bool * pValid) +Lib3MFResult lib3mf_iterator_count(Lib3MF_Iterator pIterator, Lib3MF_uint64 * pCount) { - IBase* pIBaseClass = (IBase *)pImplicitNode; + IBase* pIBaseClass = (IBase *)pIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "AreTypesValid"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pIterator, "Iterator", "Count"); } - if (pValid == nullptr) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); - if (!pIImplicitNode) + IIterator* pIIterator = dynamic_cast(pIBaseClass); + if (!pIIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pValid = pIImplicitNode->AreTypesValid(); + *pCount = pIIterator->Count(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("Valid", *pValid); + pJournalEntry->addUInt64Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11764,29 +11698,29 @@ Lib3MFResult lib3mf_implicitnode_aretypesvalid(Lib3MF_ImplicitNode pImplicitNode /************************************************************************************************************************* - Class implementation for OneInputNode + Class implementation for ImplicitPortIterator **************************************************************************************************************************/ -Lib3MFResult lib3mf_oneinputnode_getinputa(Lib3MF_OneInputNode pOneInputNode, Lib3MF_ImplicitPort * pInput) +Lib3MFResult lib3mf_implicitportiterator_getcurrent(Lib3MF_ImplicitPortIterator pImplicitPortIterator, Lib3MF_ImplicitPort * pPort) { - IBase* pIBaseClass = (IBase *)pOneInputNode; + IBase* pIBaseClass = (IBase *)pImplicitPortIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pOneInputNode, "OneInputNode", "GetInputA"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitPortIterator, "ImplicitPortIterator", "GetCurrent"); } - if (pInput == nullptr) + if (pPort == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseInput(nullptr); - IOneInputNode* pIOneInputNode = dynamic_cast(pIBaseClass); - if (!pIOneInputNode) + IBase* pBasePort(nullptr); + IImplicitPortIterator* pIImplicitPortIterator = dynamic_cast(pIBaseClass); + if (!pIImplicitPortIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseInput = pIOneInputNode->GetInputA(); + pBasePort = pIImplicitPortIterator->GetCurrent(); - *pInput = (IBase*)(pBaseInput); + *pPort = (IBase*)(pBasePort); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Input", *pInput); + pJournalEntry->addHandleResult("Port", *pPort); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11802,27 +11736,51 @@ Lib3MFResult lib3mf_oneinputnode_getinputa(Lib3MF_OneInputNode pOneInputNode, Li } } -Lib3MFResult lib3mf_oneinputnode_getoutputresult(Lib3MF_OneInputNode pOneInputNode, Lib3MF_ImplicitPort * pResult) + +/************************************************************************************************************************* + Class implementation for ImplicitNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_implicitnode_getidentifier(Lib3MF_ImplicitNode pImplicitNode, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer) { - IBase* pIBaseClass = (IBase *)pOneInputNode; + IBase* pIBaseClass = (IBase *)pImplicitNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pOneInputNode, "OneInputNode", "GetOutputResult"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "GetIdentifier"); } - if (pResult == nullptr) + if ( (!pIdentifierBuffer) && !(pIdentifierNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseResult(nullptr); - IOneInputNode* pIOneInputNode = dynamic_cast(pIBaseClass); - if (!pIOneInputNode) + std::string sIdentifier(""); + IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); + if (!pIImplicitNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseResult = pIOneInputNode->GetOutputResult(); + bool isCacheCall = (pIdentifierBuffer == nullptr); + if (isCacheCall) { + sIdentifier = pIImplicitNode->GetIdentifier(); - *pResult = (IBase*)(pBaseResult); + pIImplicitNode->_setCache (new ParameterCache_1 (sIdentifier)); + } + else { + auto cache = dynamic_cast*> (pIImplicitNode->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sIdentifier); + pIImplicitNode->_setCache (nullptr); + } + + if (pIdentifierNeededChars) + *pIdentifierNeededChars = (Lib3MF_uint32) (sIdentifier.size()+1); + if (pIdentifierBuffer) { + if (sIdentifier.size() >= nIdentifierBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iIdentifier = 0; iIdentifier < sIdentifier.size(); iIdentifier++) + pIdentifierBuffer[iIdentifier] = sIdentifier[iIdentifier]; + pIdentifierBuffer[sIdentifier.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Result", *pResult); + pJournalEntry->addStringResult("Identifier", sIdentifier.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11838,122 +11796,24 @@ Lib3MFResult lib3mf_oneinputnode_getoutputresult(Lib3MF_OneInputNode pOneInputNo } } - -/************************************************************************************************************************* - Class implementation for SinNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for CosNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for TanNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for ArcSinNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for ArcCosNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for ArcTanNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for SinhNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for CoshNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for TanhNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for RoundNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for CeilNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for FloorNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for SignNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for FractNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for AbsNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for ExpNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for LogNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for Log2Node -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for Log10Node -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for LengthNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for TransposeNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for InverseNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for SqrtNode -**************************************************************************************************************************/ - -/************************************************************************************************************************* - Class implementation for ResourceIdNode -**************************************************************************************************************************/ -Lib3MFResult lib3mf_resourceidnode_setresource(Lib3MF_ResourceIdNode pResourceIdNode, Lib3MF_Resource pResource) +Lib3MFResult lib3mf_implicitnode_setidentifier(Lib3MF_ImplicitNode pImplicitNode, const char * pIdentifier) { - IBase* pIBaseClass = (IBase *)pResourceIdNode; + IBase* pIBaseClass = (IBase *)pImplicitNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pResourceIdNode, "ResourceIdNode", "SetResource"); - pJournalEntry->addHandleParameter("Resource", pResource); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "SetIdentifier"); + pJournalEntry->addStringParameter("Identifier", pIdentifier); } - IBase* pIBaseClassResource = (IBase *)pResource; - IResource* pIResource = dynamic_cast(pIBaseClassResource); - if (!pIResource) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); - - IResourceIdNode* pIResourceIdNode = dynamic_cast(pIBaseClass); - if (!pIResourceIdNode) + if (pIdentifier == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sIdentifier(pIdentifier); + IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); + if (!pIImplicitNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIResourceIdNode->SetResource(pIResource); + pIImplicitNode->SetIdentifier(sIdentifier); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -11971,27 +11831,1382 @@ Lib3MFResult lib3mf_resourceidnode_setresource(Lib3MF_ResourceIdNode pResourceId } } -Lib3MFResult lib3mf_resourceidnode_getresource(Lib3MF_ResourceIdNode pResourceIdNode, Lib3MF_Resource * pResource) +Lib3MFResult lib3mf_implicitnode_getdisplayname(Lib3MF_ImplicitNode pImplicitNode, const Lib3MF_uint32 nDisplayNameBufferSize, Lib3MF_uint32* pDisplayNameNeededChars, char * pDisplayNameBuffer) { - IBase* pIBaseClass = (IBase *)pResourceIdNode; + IBase* pIBaseClass = (IBase *)pImplicitNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pResourceIdNode, "ResourceIdNode", "GetResource"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "GetDisplayName"); } - if (pResource == nullptr) + if ( (!pDisplayNameBuffer) && !(pDisplayNameNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseResource(nullptr); - IResourceIdNode* pIResourceIdNode = dynamic_cast(pIBaseClass); - if (!pIResourceIdNode) + std::string sDisplayName(""); + IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); + if (!pIImplicitNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseResource = pIResourceIdNode->GetResource(); - + bool isCacheCall = (pDisplayNameBuffer == nullptr); + if (isCacheCall) { + sDisplayName = pIImplicitNode->GetDisplayName(); + + pIImplicitNode->_setCache (new ParameterCache_1 (sDisplayName)); + } + else { + auto cache = dynamic_cast*> (pIImplicitNode->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sDisplayName); + pIImplicitNode->_setCache (nullptr); + } + + if (pDisplayNameNeededChars) + *pDisplayNameNeededChars = (Lib3MF_uint32) (sDisplayName.size()+1); + if (pDisplayNameBuffer) { + if (sDisplayName.size() >= nDisplayNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iDisplayName = 0; iDisplayName < sDisplayName.size(); iDisplayName++) + pDisplayNameBuffer[iDisplayName] = sDisplayName[iDisplayName]; + pDisplayNameBuffer[sDisplayName.size()] = 0; + } + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("DisplayName", sDisplayName.c_str()); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_implicitnode_setdisplayname(Lib3MF_ImplicitNode pImplicitNode, const char * pDisplayName) +{ + IBase* pIBaseClass = (IBase *)pImplicitNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "SetDisplayName"); + pJournalEntry->addStringParameter("DisplayName", pDisplayName); + } + if (pDisplayName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sDisplayName(pDisplayName); + IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); + if (!pIImplicitNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIImplicitNode->SetDisplayName(sDisplayName); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_implicitnode_gettag(Lib3MF_ImplicitNode pImplicitNode, const Lib3MF_uint32 nTagBufferSize, Lib3MF_uint32* pTagNeededChars, char * pTagBuffer) +{ + IBase* pIBaseClass = (IBase *)pImplicitNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "GetTag"); + } + if ( (!pTagBuffer) && !(pTagNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sTag(""); + IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); + if (!pIImplicitNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + bool isCacheCall = (pTagBuffer == nullptr); + if (isCacheCall) { + sTag = pIImplicitNode->GetTag(); + + pIImplicitNode->_setCache (new ParameterCache_1 (sTag)); + } + else { + auto cache = dynamic_cast*> (pIImplicitNode->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sTag); + pIImplicitNode->_setCache (nullptr); + } + + if (pTagNeededChars) + *pTagNeededChars = (Lib3MF_uint32) (sTag.size()+1); + if (pTagBuffer) { + if (sTag.size() >= nTagBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iTag = 0; iTag < sTag.size(); iTag++) + pTagBuffer[iTag] = sTag[iTag]; + pTagBuffer[sTag.size()] = 0; + } + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Tag", sTag.c_str()); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_implicitnode_settag(Lib3MF_ImplicitNode pImplicitNode, const char * pTag) +{ + IBase* pIBaseClass = (IBase *)pImplicitNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "SetTag"); + pJournalEntry->addStringParameter("Tag", pTag); + } + if (pTag == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sTag(pTag); + IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); + if (!pIImplicitNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIImplicitNode->SetTag(sTag); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_implicitnode_getnodetype(Lib3MF_ImplicitNode pImplicitNode, eLib3MFImplicitNodeType * pType) +{ + IBase* pIBaseClass = (IBase *)pImplicitNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "GetNodeType"); + } + if (pType == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); + if (!pIImplicitNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pType = pIImplicitNode->GetNodeType(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addEnumResult("Type", "ImplicitNodeType", (Lib3MF_int32)(*pType)); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_implicitnode_addinput(Lib3MF_ImplicitNode pImplicitNode, const char * pIdentifier, const char * pDisplayName, Lib3MF_ImplicitPort * pPort) +{ + IBase* pIBaseClass = (IBase *)pImplicitNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "AddInput"); + pJournalEntry->addStringParameter("Identifier", pIdentifier); + pJournalEntry->addStringParameter("DisplayName", pDisplayName); + } + if (pIdentifier == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pDisplayName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pPort == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sIdentifier(pIdentifier); + std::string sDisplayName(pDisplayName); + IBase* pBasePort(nullptr); + IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); + if (!pIImplicitNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBasePort = pIImplicitNode->AddInput(sIdentifier, sDisplayName); + + *pPort = (IBase*)(pBasePort); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Port", *pPort); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_implicitnode_getinputs(Lib3MF_ImplicitNode pImplicitNode, Lib3MF_ImplicitPortIterator * pIterator) +{ + IBase* pIBaseClass = (IBase *)pImplicitNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "GetInputs"); + } + if (pIterator == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseIterator(nullptr); + IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); + if (!pIImplicitNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseIterator = pIImplicitNode->GetInputs(); + + *pIterator = (IBase*)(pBaseIterator); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Iterator", *pIterator); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_implicitnode_addoutput(Lib3MF_ImplicitNode pImplicitNode, const char * pIdentifier, const char * pDisplayName, Lib3MF_ImplicitPort * pPort) +{ + IBase* pIBaseClass = (IBase *)pImplicitNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "AddOutput"); + pJournalEntry->addStringParameter("Identifier", pIdentifier); + pJournalEntry->addStringParameter("DisplayName", pDisplayName); + } + if (pIdentifier == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pDisplayName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pPort == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sIdentifier(pIdentifier); + std::string sDisplayName(pDisplayName); + IBase* pBasePort(nullptr); + IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); + if (!pIImplicitNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBasePort = pIImplicitNode->AddOutput(sIdentifier, sDisplayName); + + *pPort = (IBase*)(pBasePort); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Port", *pPort); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_implicitnode_getoutputs(Lib3MF_ImplicitNode pImplicitNode, Lib3MF_ImplicitPortIterator * pIterator) +{ + IBase* pIBaseClass = (IBase *)pImplicitNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "GetOutputs"); + } + if (pIterator == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseIterator(nullptr); + IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); + if (!pIImplicitNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseIterator = pIImplicitNode->GetOutputs(); + + *pIterator = (IBase*)(pBaseIterator); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Iterator", *pIterator); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_implicitnode_findinput(Lib3MF_ImplicitNode pImplicitNode, const char * pIdentifier, Lib3MF_ImplicitPort * pInput) +{ + IBase* pIBaseClass = (IBase *)pImplicitNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "FindInput"); + pJournalEntry->addStringParameter("Identifier", pIdentifier); + } + if (pIdentifier == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pInput == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sIdentifier(pIdentifier); + IBase* pBaseInput(nullptr); + IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); + if (!pIImplicitNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseInput = pIImplicitNode->FindInput(sIdentifier); + + *pInput = (IBase*)(pBaseInput); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Input", *pInput); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_implicitnode_findoutput(Lib3MF_ImplicitNode pImplicitNode, const char * pIdentifier, Lib3MF_ImplicitPort * pOutput) +{ + IBase* pIBaseClass = (IBase *)pImplicitNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "FindOutput"); + pJournalEntry->addStringParameter("Identifier", pIdentifier); + } + if (pIdentifier == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pOutput == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sIdentifier(pIdentifier); + IBase* pBaseOutput(nullptr); + IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); + if (!pIImplicitNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseOutput = pIImplicitNode->FindOutput(sIdentifier); + + *pOutput = (IBase*)(pBaseOutput); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Output", *pOutput); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_implicitnode_aretypesvalid(Lib3MF_ImplicitNode pImplicitNode, bool * pValid) +{ + IBase* pIBaseClass = (IBase *)pImplicitNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitNode, "ImplicitNode", "AreTypesValid"); + } + if (pValid == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IImplicitNode* pIImplicitNode = dynamic_cast(pIBaseClass); + if (!pIImplicitNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pValid = pIImplicitNode->AreTypesValid(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("Valid", *pValid); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for OneInputNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_oneinputnode_getinputa(Lib3MF_OneInputNode pOneInputNode, Lib3MF_ImplicitPort * pInput) +{ + IBase* pIBaseClass = (IBase *)pOneInputNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pOneInputNode, "OneInputNode", "GetInputA"); + } + if (pInput == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseInput(nullptr); + IOneInputNode* pIOneInputNode = dynamic_cast(pIBaseClass); + if (!pIOneInputNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseInput = pIOneInputNode->GetInputA(); + + *pInput = (IBase*)(pBaseInput); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Input", *pInput); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_oneinputnode_getoutputresult(Lib3MF_OneInputNode pOneInputNode, Lib3MF_ImplicitPort * pResult) +{ + IBase* pIBaseClass = (IBase *)pOneInputNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pOneInputNode, "OneInputNode", "GetOutputResult"); + } + if (pResult == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseResult(nullptr); + IOneInputNode* pIOneInputNode = dynamic_cast(pIBaseClass); + if (!pIOneInputNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseResult = pIOneInputNode->GetOutputResult(); + + *pResult = (IBase*)(pBaseResult); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Result", *pResult); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for SinNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for CosNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for TanNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for ArcSinNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for ArcCosNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for ArcTanNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for SinhNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for CoshNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for TanhNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for RoundNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for CeilNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for FloorNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for SignNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for FractNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for AbsNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for ExpNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for LogNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for Log2Node +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for Log10Node +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for LengthNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for TransposeNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for InverseNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for SqrtNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for ResourceIdNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_resourceidnode_setresource(Lib3MF_ResourceIdNode pResourceIdNode, Lib3MF_Resource pResource) +{ + IBase* pIBaseClass = (IBase *)pResourceIdNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pResourceIdNode, "ResourceIdNode", "SetResource"); + pJournalEntry->addHandleParameter("Resource", pResource); + } + IBase* pIBaseClassResource = (IBase *)pResource; + IResource* pIResource = dynamic_cast(pIBaseClassResource); + if (!pIResource) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IResourceIdNode* pIResourceIdNode = dynamic_cast(pIBaseClass); + if (!pIResourceIdNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIResourceIdNode->SetResource(pIResource); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_resourceidnode_getresource(Lib3MF_ResourceIdNode pResourceIdNode, Lib3MF_Resource * pResource) +{ + IBase* pIBaseClass = (IBase *)pResourceIdNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pResourceIdNode, "ResourceIdNode", "GetResource"); + } + if (pResource == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseResource(nullptr); + IResourceIdNode* pIResourceIdNode = dynamic_cast(pIBaseClass); + if (!pIResourceIdNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseResource = pIResourceIdNode->GetResource(); + *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Resource", *pResource); + pJournalEntry->addHandleResult("Resource", *pResource); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_resourceidnode_getoutputvalue(Lib3MF_ResourceIdNode pResourceIdNode, Lib3MF_ImplicitPort * pValue) +{ + IBase* pIBaseClass = (IBase *)pResourceIdNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pResourceIdNode, "ResourceIdNode", "GetOutputValue"); + } + if (pValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseValue(nullptr); + IResourceIdNode* pIResourceIdNode = dynamic_cast(pIBaseClass); + if (!pIResourceIdNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseValue = pIResourceIdNode->GetOutputValue(); + + *pValue = (IBase*)(pBaseValue); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Value", *pValue); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for TwoInputNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_twoinputnode_getinputb(Lib3MF_TwoInputNode pTwoInputNode, Lib3MF_ImplicitPort * pB) +{ + IBase* pIBaseClass = (IBase *)pTwoInputNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pTwoInputNode, "TwoInputNode", "GetInputB"); + } + if (pB == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseB(nullptr); + ITwoInputNode* pITwoInputNode = dynamic_cast(pIBaseClass); + if (!pITwoInputNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseB = pITwoInputNode->GetInputB(); + + *pB = (IBase*)(pBaseB); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("B", *pB); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for AdditionNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for SubtractionNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for MultiplicationNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for DivisionNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for DotNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for CrossNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for ArcTan2Node +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for MatVecMultiplicationNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for MinNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for MaxNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for FmodNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for ModNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for PowNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for SelectNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_selectnode_getinputb(Lib3MF_SelectNode pSelectNode, Lib3MF_ImplicitPort * pB) +{ + IBase* pIBaseClass = (IBase *)pSelectNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pSelectNode, "SelectNode", "GetInputB"); + } + if (pB == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseB(nullptr); + ISelectNode* pISelectNode = dynamic_cast(pIBaseClass); + if (!pISelectNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseB = pISelectNode->GetInputB(); + + *pB = (IBase*)(pBaseB); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("B", *pB); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_selectnode_getinputc(Lib3MF_SelectNode pSelectNode, Lib3MF_ImplicitPort * pC) +{ + IBase* pIBaseClass = (IBase *)pSelectNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pSelectNode, "SelectNode", "GetInputC"); + } + if (pC == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseC(nullptr); + ISelectNode* pISelectNode = dynamic_cast(pIBaseClass); + if (!pISelectNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseC = pISelectNode->GetInputC(); + + *pC = (IBase*)(pBaseC); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("C", *pC); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_selectnode_getinputd(Lib3MF_SelectNode pSelectNode, Lib3MF_ImplicitPort * pD) +{ + IBase* pIBaseClass = (IBase *)pSelectNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pSelectNode, "SelectNode", "GetInputD"); + } + if (pD == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseD(nullptr); + ISelectNode* pISelectNode = dynamic_cast(pIBaseClass); + if (!pISelectNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseD = pISelectNode->GetInputD(); + + *pD = (IBase*)(pBaseD); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("D", *pD); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for ClampNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_clampnode_getinputmin(Lib3MF_ClampNode pClampNode, Lib3MF_ImplicitPort * pMin) +{ + IBase* pIBaseClass = (IBase *)pClampNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pClampNode, "ClampNode", "GetInputMin"); + } + if (pMin == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseMin(nullptr); + IClampNode* pIClampNode = dynamic_cast(pIBaseClass); + if (!pIClampNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseMin = pIClampNode->GetInputMin(); + + *pMin = (IBase*)(pBaseMin); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Min", *pMin); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_clampnode_getinputmax(Lib3MF_ClampNode pClampNode, Lib3MF_ImplicitPort * pMax) +{ + IBase* pIBaseClass = (IBase *)pClampNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pClampNode, "ClampNode", "GetInputMax"); + } + if (pMax == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseMax(nullptr); + IClampNode* pIClampNode = dynamic_cast(pIBaseClass); + if (!pIClampNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseMax = pIClampNode->GetInputMax(); + + *pMax = (IBase*)(pBaseMax); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Max", *pMax); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for ComposeVectorNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_composevectornode_getinputx(Lib3MF_ComposeVectorNode pComposeVectorNode, Lib3MF_ImplicitPort * pX) +{ + IBase* pIBaseClass = (IBase *)pComposeVectorNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeVectorNode, "ComposeVectorNode", "GetInputX"); + } + if (pX == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseX(nullptr); + IComposeVectorNode* pIComposeVectorNode = dynamic_cast(pIBaseClass); + if (!pIComposeVectorNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseX = pIComposeVectorNode->GetInputX(); + + *pX = (IBase*)(pBaseX); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("X", *pX); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_composevectornode_getinputy(Lib3MF_ComposeVectorNode pComposeVectorNode, Lib3MF_ImplicitPort * pY) +{ + IBase* pIBaseClass = (IBase *)pComposeVectorNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeVectorNode, "ComposeVectorNode", "GetInputY"); + } + if (pY == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseY(nullptr); + IComposeVectorNode* pIComposeVectorNode = dynamic_cast(pIBaseClass); + if (!pIComposeVectorNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseY = pIComposeVectorNode->GetInputY(); + + *pY = (IBase*)(pBaseY); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Y", *pY); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_composevectornode_getinputz(Lib3MF_ComposeVectorNode pComposeVectorNode, Lib3MF_ImplicitPort * pZ) +{ + IBase* pIBaseClass = (IBase *)pComposeVectorNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeVectorNode, "ComposeVectorNode", "GetInputZ"); + } + if (pZ == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseZ(nullptr); + IComposeVectorNode* pIComposeVectorNode = dynamic_cast(pIBaseClass); + if (!pIComposeVectorNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseZ = pIComposeVectorNode->GetInputZ(); + + *pZ = (IBase*)(pBaseZ); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Z", *pZ); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_composevectornode_getoutputresult(Lib3MF_ComposeVectorNode pComposeVectorNode, Lib3MF_ImplicitPort * pResult) +{ + IBase* pIBaseClass = (IBase *)pComposeVectorNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeVectorNode, "ComposeVectorNode", "GetOutputResult"); + } + if (pResult == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseResult(nullptr); + IComposeVectorNode* pIComposeVectorNode = dynamic_cast(pIBaseClass); + if (!pIComposeVectorNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseResult = pIComposeVectorNode->GetOutputResult(); + + *pResult = (IBase*)(pBaseResult); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Result", *pResult); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for VectorFromScalarNode +**************************************************************************************************************************/ + +/************************************************************************************************************************* + Class implementation for DecomposeVectorNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_decomposevectornode_getinputa(Lib3MF_DecomposeVectorNode pDecomposeVectorNode, Lib3MF_ImplicitPort * pA) +{ + IBase* pIBaseClass = (IBase *)pDecomposeVectorNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pDecomposeVectorNode, "DecomposeVectorNode", "GetInputA"); + } + if (pA == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseA(nullptr); + IDecomposeVectorNode* pIDecomposeVectorNode = dynamic_cast(pIBaseClass); + if (!pIDecomposeVectorNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseA = pIDecomposeVectorNode->GetInputA(); + + *pA = (IBase*)(pBaseA); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("A", *pA); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_decomposevectornode_getoutputx(Lib3MF_DecomposeVectorNode pDecomposeVectorNode, Lib3MF_ImplicitPort * pX) +{ + IBase* pIBaseClass = (IBase *)pDecomposeVectorNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pDecomposeVectorNode, "DecomposeVectorNode", "GetOutputX"); + } + if (pX == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseX(nullptr); + IDecomposeVectorNode* pIDecomposeVectorNode = dynamic_cast(pIBaseClass); + if (!pIDecomposeVectorNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseX = pIDecomposeVectorNode->GetOutputX(); + + *pX = (IBase*)(pBaseX); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("X", *pX); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_decomposevectornode_getoutputy(Lib3MF_DecomposeVectorNode pDecomposeVectorNode, Lib3MF_ImplicitPort * pY) +{ + IBase* pIBaseClass = (IBase *)pDecomposeVectorNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pDecomposeVectorNode, "DecomposeVectorNode", "GetOutputY"); + } + if (pY == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseY(nullptr); + IDecomposeVectorNode* pIDecomposeVectorNode = dynamic_cast(pIBaseClass); + if (!pIDecomposeVectorNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseY = pIDecomposeVectorNode->GetOutputY(); + + *pY = (IBase*)(pBaseY); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Y", *pY); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_decomposevectornode_getoutputz(Lib3MF_DecomposeVectorNode pDecomposeVectorNode, Lib3MF_ImplicitPort * pZ) +{ + IBase* pIBaseClass = (IBase *)pDecomposeVectorNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pDecomposeVectorNode, "DecomposeVectorNode", "GetOutputZ"); + } + if (pZ == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseZ(nullptr); + IDecomposeVectorNode* pIDecomposeVectorNode = dynamic_cast(pIBaseClass); + if (!pIDecomposeVectorNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseZ = pIDecomposeVectorNode->GetOutputZ(); + + *pZ = (IBase*)(pBaseZ); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Z", *pZ); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for ComposeMatrixNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_composematrixnode_getinputm00(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM00) +{ + IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM00"); + } + if (pM00 == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseM00(nullptr); + IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); + if (!pIComposeMatrixNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseM00 = pIComposeMatrixNode->GetInputM00(); + + *pM00 = (IBase*)(pBaseM00); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("M00", *pM00); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12007,27 +13222,27 @@ Lib3MFResult lib3mf_resourceidnode_getresource(Lib3MF_ResourceIdNode pResourceId } } -Lib3MFResult lib3mf_resourceidnode_getoutputvalue(Lib3MF_ResourceIdNode pResourceIdNode, Lib3MF_ImplicitPort * pValue) +Lib3MFResult lib3mf_composematrixnode_getinputm01(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM01) { - IBase* pIBaseClass = (IBase *)pResourceIdNode; + IBase* pIBaseClass = (IBase *)pComposeMatrixNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pResourceIdNode, "ResourceIdNode", "GetOutputValue"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM01"); } - if (pValue == nullptr) + if (pM01 == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseValue(nullptr); - IResourceIdNode* pIResourceIdNode = dynamic_cast(pIBaseClass); - if (!pIResourceIdNode) + IBase* pBaseM01(nullptr); + IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); + if (!pIComposeMatrixNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseValue = pIResourceIdNode->GetOutputValue(); + pBaseM01 = pIComposeMatrixNode->GetInputM01(); - *pValue = (IBase*)(pBaseValue); + *pM01 = (IBase*)(pBaseM01); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Value", *pValue); + pJournalEntry->addHandleResult("M01", *pM01); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12043,31 +13258,27 @@ Lib3MFResult lib3mf_resourceidnode_getoutputvalue(Lib3MF_ResourceIdNode pResourc } } - -/************************************************************************************************************************* - Class implementation for TwoInputNode -**************************************************************************************************************************/ -Lib3MFResult lib3mf_twoinputnode_getinputb(Lib3MF_TwoInputNode pTwoInputNode, Lib3MF_ImplicitPort * pB) +Lib3MFResult lib3mf_composematrixnode_getinputm02(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM02) { - IBase* pIBaseClass = (IBase *)pTwoInputNode; + IBase* pIBaseClass = (IBase *)pComposeMatrixNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTwoInputNode, "TwoInputNode", "GetInputB"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM02"); } - if (pB == nullptr) + if (pM02 == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseB(nullptr); - ITwoInputNode* pITwoInputNode = dynamic_cast(pIBaseClass); - if (!pITwoInputNode) + IBase* pBaseM02(nullptr); + IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); + if (!pIComposeMatrixNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseB = pITwoInputNode->GetInputB(); + pBaseM02 = pIComposeMatrixNode->GetInputM02(); - *pB = (IBase*)(pBaseB); + *pM02 = (IBase*)(pBaseM02); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("B", *pB); + pJournalEntry->addHandleResult("M02", *pM02); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12083,83 +13294,207 @@ Lib3MFResult lib3mf_twoinputnode_getinputb(Lib3MF_TwoInputNode pTwoInputNode, Li } } +Lib3MFResult lib3mf_composematrixnode_getinputm03(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM03) +{ + IBase* pIBaseClass = (IBase *)pComposeMatrixNode; -/************************************************************************************************************************* - Class implementation for AdditionNode -**************************************************************************************************************************/ + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM03"); + } + if (pM03 == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseM03(nullptr); + IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); + if (!pIComposeMatrixNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseM03 = pIComposeMatrixNode->GetInputM03(); -/************************************************************************************************************************* - Class implementation for SubtractionNode -**************************************************************************************************************************/ + *pM03 = (IBase*)(pBaseM03); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("M03", *pM03); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} -/************************************************************************************************************************* - Class implementation for MultiplicationNode -**************************************************************************************************************************/ +Lib3MFResult lib3mf_composematrixnode_getinputm10(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM10) +{ + IBase* pIBaseClass = (IBase *)pComposeMatrixNode; -/************************************************************************************************************************* - Class implementation for DivisionNode -**************************************************************************************************************************/ + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM10"); + } + if (pM10 == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseM10(nullptr); + IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); + if (!pIComposeMatrixNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseM10 = pIComposeMatrixNode->GetInputM10(); -/************************************************************************************************************************* - Class implementation for DotNode -**************************************************************************************************************************/ + *pM10 = (IBase*)(pBaseM10); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("M10", *pM10); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} -/************************************************************************************************************************* - Class implementation for CrossNode -**************************************************************************************************************************/ +Lib3MFResult lib3mf_composematrixnode_getinputm11(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM11) +{ + IBase* pIBaseClass = (IBase *)pComposeMatrixNode; -/************************************************************************************************************************* - Class implementation for ArcTan2Node -**************************************************************************************************************************/ + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM11"); + } + if (pM11 == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseM11(nullptr); + IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); + if (!pIComposeMatrixNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseM11 = pIComposeMatrixNode->GetInputM11(); -/************************************************************************************************************************* - Class implementation for MatVecMultiplicationNode -**************************************************************************************************************************/ + *pM11 = (IBase*)(pBaseM11); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("M11", *pM11); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} -/************************************************************************************************************************* - Class implementation for MinNode -**************************************************************************************************************************/ +Lib3MFResult lib3mf_composematrixnode_getinputm12(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM12) +{ + IBase* pIBaseClass = (IBase *)pComposeMatrixNode; -/************************************************************************************************************************* - Class implementation for MaxNode -**************************************************************************************************************************/ + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM12"); + } + if (pM12 == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseM12(nullptr); + IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); + if (!pIComposeMatrixNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseM12 = pIComposeMatrixNode->GetInputM12(); -/************************************************************************************************************************* - Class implementation for FmodNode -**************************************************************************************************************************/ + *pM12 = (IBase*)(pBaseM12); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("M12", *pM12); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} -/************************************************************************************************************************* - Class implementation for ModNode -**************************************************************************************************************************/ +Lib3MFResult lib3mf_composematrixnode_getinputm13(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM13) +{ + IBase* pIBaseClass = (IBase *)pComposeMatrixNode; -/************************************************************************************************************************* - Class implementation for PowNode -**************************************************************************************************************************/ + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM13"); + } + if (pM13 == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseM13(nullptr); + IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); + if (!pIComposeMatrixNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseM13 = pIComposeMatrixNode->GetInputM13(); -/************************************************************************************************************************* - Class implementation for SelectNode -**************************************************************************************************************************/ -Lib3MFResult lib3mf_selectnode_getinputb(Lib3MF_SelectNode pSelectNode, Lib3MF_ImplicitPort * pB) + *pM13 = (IBase*)(pBaseM13); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("M13", *pM13); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_composematrixnode_getinputm20(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM20) { - IBase* pIBaseClass = (IBase *)pSelectNode; + IBase* pIBaseClass = (IBase *)pComposeMatrixNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pSelectNode, "SelectNode", "GetInputB"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM20"); } - if (pB == nullptr) + if (pM20 == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseB(nullptr); - ISelectNode* pISelectNode = dynamic_cast(pIBaseClass); - if (!pISelectNode) + IBase* pBaseM20(nullptr); + IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); + if (!pIComposeMatrixNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseB = pISelectNode->GetInputB(); + pBaseM20 = pIComposeMatrixNode->GetInputM20(); - *pB = (IBase*)(pBaseB); + *pM20 = (IBase*)(pBaseM20); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("B", *pB); + pJournalEntry->addHandleResult("M20", *pM20); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12175,27 +13510,27 @@ Lib3MFResult lib3mf_selectnode_getinputb(Lib3MF_SelectNode pSelectNode, Lib3MF_I } } -Lib3MFResult lib3mf_selectnode_getinputc(Lib3MF_SelectNode pSelectNode, Lib3MF_ImplicitPort * pC) +Lib3MFResult lib3mf_composematrixnode_getinputm21(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM21) { - IBase* pIBaseClass = (IBase *)pSelectNode; + IBase* pIBaseClass = (IBase *)pComposeMatrixNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pSelectNode, "SelectNode", "GetInputC"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM21"); } - if (pC == nullptr) + if (pM21 == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseC(nullptr); - ISelectNode* pISelectNode = dynamic_cast(pIBaseClass); - if (!pISelectNode) + IBase* pBaseM21(nullptr); + IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); + if (!pIComposeMatrixNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseC = pISelectNode->GetInputC(); + pBaseM21 = pIComposeMatrixNode->GetInputM21(); - *pC = (IBase*)(pBaseC); + *pM21 = (IBase*)(pBaseM21); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("C", *pC); + pJournalEntry->addHandleResult("M21", *pM21); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12211,27 +13546,27 @@ Lib3MFResult lib3mf_selectnode_getinputc(Lib3MF_SelectNode pSelectNode, Lib3MF_I } } -Lib3MFResult lib3mf_selectnode_getinputd(Lib3MF_SelectNode pSelectNode, Lib3MF_ImplicitPort * pD) +Lib3MFResult lib3mf_composematrixnode_getinputm22(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM22) { - IBase* pIBaseClass = (IBase *)pSelectNode; + IBase* pIBaseClass = (IBase *)pComposeMatrixNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pSelectNode, "SelectNode", "GetInputD"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM22"); } - if (pD == nullptr) + if (pM22 == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseD(nullptr); - ISelectNode* pISelectNode = dynamic_cast(pIBaseClass); - if (!pISelectNode) + IBase* pBaseM22(nullptr); + IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); + if (!pIComposeMatrixNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseD = pISelectNode->GetInputD(); + pBaseM22 = pIComposeMatrixNode->GetInputM22(); - *pD = (IBase*)(pBaseD); + *pM22 = (IBase*)(pBaseM22); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("D", *pD); + pJournalEntry->addHandleResult("M22", *pM22); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12247,31 +13582,27 @@ Lib3MFResult lib3mf_selectnode_getinputd(Lib3MF_SelectNode pSelectNode, Lib3MF_I } } - -/************************************************************************************************************************* - Class implementation for ClampNode -**************************************************************************************************************************/ -Lib3MFResult lib3mf_clampnode_getinputmin(Lib3MF_ClampNode pClampNode, Lib3MF_ImplicitPort * pMin) +Lib3MFResult lib3mf_composematrixnode_getinputm23(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM23) { - IBase* pIBaseClass = (IBase *)pClampNode; + IBase* pIBaseClass = (IBase *)pComposeMatrixNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pClampNode, "ClampNode", "GetInputMin"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM23"); } - if (pMin == nullptr) + if (pM23 == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseMin(nullptr); - IClampNode* pIClampNode = dynamic_cast(pIBaseClass); - if (!pIClampNode) + IBase* pBaseM23(nullptr); + IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); + if (!pIComposeMatrixNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseMin = pIClampNode->GetInputMin(); + pBaseM23 = pIComposeMatrixNode->GetInputM23(); - *pMin = (IBase*)(pBaseMin); + *pM23 = (IBase*)(pBaseM23); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Min", *pMin); + pJournalEntry->addHandleResult("M23", *pM23); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12287,27 +13618,27 @@ Lib3MFResult lib3mf_clampnode_getinputmin(Lib3MF_ClampNode pClampNode, Lib3MF_Im } } -Lib3MFResult lib3mf_clampnode_getinputmax(Lib3MF_ClampNode pClampNode, Lib3MF_ImplicitPort * pMax) +Lib3MFResult lib3mf_composematrixnode_getinputm30(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM30) { - IBase* pIBaseClass = (IBase *)pClampNode; + IBase* pIBaseClass = (IBase *)pComposeMatrixNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pClampNode, "ClampNode", "GetInputMax"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM30"); } - if (pMax == nullptr) + if (pM30 == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseMax(nullptr); - IClampNode* pIClampNode = dynamic_cast(pIBaseClass); - if (!pIClampNode) + IBase* pBaseM30(nullptr); + IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); + if (!pIComposeMatrixNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseMax = pIClampNode->GetInputMax(); + pBaseM30 = pIComposeMatrixNode->GetInputM30(); - *pMax = (IBase*)(pBaseMax); + *pM30 = (IBase*)(pBaseM30); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Max", *pMax); + pJournalEntry->addHandleResult("M30", *pM30); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12323,31 +13654,27 @@ Lib3MFResult lib3mf_clampnode_getinputmax(Lib3MF_ClampNode pClampNode, Lib3MF_Im } } - -/************************************************************************************************************************* - Class implementation for ComposeVectorNode -**************************************************************************************************************************/ -Lib3MFResult lib3mf_composevectornode_getinputx(Lib3MF_ComposeVectorNode pComposeVectorNode, Lib3MF_ImplicitPort * pX) +Lib3MFResult lib3mf_composematrixnode_getinputm31(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM31) { - IBase* pIBaseClass = (IBase *)pComposeVectorNode; + IBase* pIBaseClass = (IBase *)pComposeMatrixNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeVectorNode, "ComposeVectorNode", "GetInputX"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM31"); } - if (pX == nullptr) + if (pM31 == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseX(nullptr); - IComposeVectorNode* pIComposeVectorNode = dynamic_cast(pIBaseClass); - if (!pIComposeVectorNode) + IBase* pBaseM31(nullptr); + IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); + if (!pIComposeMatrixNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseX = pIComposeVectorNode->GetInputX(); + pBaseM31 = pIComposeMatrixNode->GetInputM31(); - *pX = (IBase*)(pBaseX); + *pM31 = (IBase*)(pBaseM31); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("X", *pX); + pJournalEntry->addHandleResult("M31", *pM31); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12363,27 +13690,27 @@ Lib3MFResult lib3mf_composevectornode_getinputx(Lib3MF_ComposeVectorNode pCompos } } -Lib3MFResult lib3mf_composevectornode_getinputy(Lib3MF_ComposeVectorNode pComposeVectorNode, Lib3MF_ImplicitPort * pY) +Lib3MFResult lib3mf_composematrixnode_getinputm32(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM32) { - IBase* pIBaseClass = (IBase *)pComposeVectorNode; + IBase* pIBaseClass = (IBase *)pComposeMatrixNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeVectorNode, "ComposeVectorNode", "GetInputY"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM32"); } - if (pY == nullptr) + if (pM32 == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseY(nullptr); - IComposeVectorNode* pIComposeVectorNode = dynamic_cast(pIBaseClass); - if (!pIComposeVectorNode) + IBase* pBaseM32(nullptr); + IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); + if (!pIComposeMatrixNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseY = pIComposeVectorNode->GetInputY(); + pBaseM32 = pIComposeMatrixNode->GetInputM32(); - *pY = (IBase*)(pBaseY); + *pM32 = (IBase*)(pBaseM32); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Y", *pY); + pJournalEntry->addHandleResult("M32", *pM32); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12399,27 +13726,27 @@ Lib3MFResult lib3mf_composevectornode_getinputy(Lib3MF_ComposeVectorNode pCompos } } -Lib3MFResult lib3mf_composevectornode_getinputz(Lib3MF_ComposeVectorNode pComposeVectorNode, Lib3MF_ImplicitPort * pZ) +Lib3MFResult lib3mf_composematrixnode_getinputm33(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM33) { - IBase* pIBaseClass = (IBase *)pComposeVectorNode; + IBase* pIBaseClass = (IBase *)pComposeMatrixNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeVectorNode, "ComposeVectorNode", "GetInputZ"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM33"); } - if (pZ == nullptr) + if (pM33 == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseZ(nullptr); - IComposeVectorNode* pIComposeVectorNode = dynamic_cast(pIBaseClass); - if (!pIComposeVectorNode) + IBase* pBaseM33(nullptr); + IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); + if (!pIComposeMatrixNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseZ = pIComposeVectorNode->GetInputZ(); + pBaseM33 = pIComposeMatrixNode->GetInputM33(); - *pZ = (IBase*)(pBaseZ); + *pM33 = (IBase*)(pBaseM33); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Z", *pZ); + pJournalEntry->addHandleResult("M33", *pM33); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12435,23 +13762,23 @@ Lib3MFResult lib3mf_composevectornode_getinputz(Lib3MF_ComposeVectorNode pCompos } } -Lib3MFResult lib3mf_composevectornode_getoutputresult(Lib3MF_ComposeVectorNode pComposeVectorNode, Lib3MF_ImplicitPort * pResult) +Lib3MFResult lib3mf_composematrixnode_getoutputresult(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pResult) { - IBase* pIBaseClass = (IBase *)pComposeVectorNode; + IBase* pIBaseClass = (IBase *)pComposeMatrixNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeVectorNode, "ComposeVectorNode", "GetOutputResult"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetOutputResult"); } if (pResult == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); IBase* pBaseResult(nullptr); - IComposeVectorNode* pIComposeVectorNode = dynamic_cast(pIBaseClass); - if (!pIComposeVectorNode) + IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); + if (!pIComposeMatrixNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseResult = pIComposeVectorNode->GetOutputResult(); + pBaseResult = pIComposeMatrixNode->GetOutputResult(); *pResult = (IBase*)(pBaseResult); if (pJournalEntry.get() != nullptr) { @@ -12473,33 +13800,101 @@ Lib3MFResult lib3mf_composevectornode_getoutputresult(Lib3MF_ComposeVectorNode p /************************************************************************************************************************* - Class implementation for VectorFromScalarNode + Class implementation for MatrixFromRowsNode **************************************************************************************************************************/ +Lib3MFResult lib3mf_matrixfromrowsnode_getinputa(Lib3MF_MatrixFromRowsNode pMatrixFromRowsNode, Lib3MF_ImplicitPort * pRow0) +{ + IBase* pIBaseClass = (IBase *)pMatrixFromRowsNode; -/************************************************************************************************************************* - Class implementation for DecomposeVectorNode -**************************************************************************************************************************/ -Lib3MFResult lib3mf_decomposevectornode_getinputa(Lib3MF_DecomposeVectorNode pDecomposeVectorNode, Lib3MF_ImplicitPort * pA) + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromRowsNode, "MatrixFromRowsNode", "GetInputA"); + } + if (pRow0 == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseRow0(nullptr); + IMatrixFromRowsNode* pIMatrixFromRowsNode = dynamic_cast(pIBaseClass); + if (!pIMatrixFromRowsNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseRow0 = pIMatrixFromRowsNode->GetInputA(); + + *pRow0 = (IBase*)(pBaseRow0); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Row0", *pRow0); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_matrixfromrowsnode_getinputb(Lib3MF_MatrixFromRowsNode pMatrixFromRowsNode, Lib3MF_ImplicitPort * pRow1) +{ + IBase* pIBaseClass = (IBase *)pMatrixFromRowsNode; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromRowsNode, "MatrixFromRowsNode", "GetInputB"); + } + if (pRow1 == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseRow1(nullptr); + IMatrixFromRowsNode* pIMatrixFromRowsNode = dynamic_cast(pIBaseClass); + if (!pIMatrixFromRowsNode) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseRow1 = pIMatrixFromRowsNode->GetInputB(); + + *pRow1 = (IBase*)(pBaseRow1); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Row1", *pRow1); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_matrixfromrowsnode_getinputc(Lib3MF_MatrixFromRowsNode pMatrixFromRowsNode, Lib3MF_ImplicitPort * pRow2) { - IBase* pIBaseClass = (IBase *)pDecomposeVectorNode; + IBase* pIBaseClass = (IBase *)pMatrixFromRowsNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pDecomposeVectorNode, "DecomposeVectorNode", "GetInputA"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromRowsNode, "MatrixFromRowsNode", "GetInputC"); } - if (pA == nullptr) + if (pRow2 == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseA(nullptr); - IDecomposeVectorNode* pIDecomposeVectorNode = dynamic_cast(pIBaseClass); - if (!pIDecomposeVectorNode) + IBase* pBaseRow2(nullptr); + IMatrixFromRowsNode* pIMatrixFromRowsNode = dynamic_cast(pIBaseClass); + if (!pIMatrixFromRowsNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseA = pIDecomposeVectorNode->GetInputA(); + pBaseRow2 = pIMatrixFromRowsNode->GetInputC(); - *pA = (IBase*)(pBaseA); + *pRow2 = (IBase*)(pBaseRow2); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("A", *pA); + pJournalEntry->addHandleResult("Row2", *pRow2); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12515,27 +13910,27 @@ Lib3MFResult lib3mf_decomposevectornode_getinputa(Lib3MF_DecomposeVectorNode pDe } } -Lib3MFResult lib3mf_decomposevectornode_getoutputx(Lib3MF_DecomposeVectorNode pDecomposeVectorNode, Lib3MF_ImplicitPort * pX) +Lib3MFResult lib3mf_matrixfromrowsnode_getinputd(Lib3MF_MatrixFromRowsNode pMatrixFromRowsNode, Lib3MF_ImplicitPort * pRow3) { - IBase* pIBaseClass = (IBase *)pDecomposeVectorNode; + IBase* pIBaseClass = (IBase *)pMatrixFromRowsNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pDecomposeVectorNode, "DecomposeVectorNode", "GetOutputX"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromRowsNode, "MatrixFromRowsNode", "GetInputD"); } - if (pX == nullptr) + if (pRow3 == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseX(nullptr); - IDecomposeVectorNode* pIDecomposeVectorNode = dynamic_cast(pIBaseClass); - if (!pIDecomposeVectorNode) + IBase* pBaseRow3(nullptr); + IMatrixFromRowsNode* pIMatrixFromRowsNode = dynamic_cast(pIBaseClass); + if (!pIMatrixFromRowsNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseX = pIDecomposeVectorNode->GetOutputX(); + pBaseRow3 = pIMatrixFromRowsNode->GetInputD(); - *pX = (IBase*)(pBaseX); + *pRow3 = (IBase*)(pBaseRow3); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("X", *pX); + pJournalEntry->addHandleResult("Row3", *pRow3); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12551,27 +13946,27 @@ Lib3MFResult lib3mf_decomposevectornode_getoutputx(Lib3MF_DecomposeVectorNode pD } } -Lib3MFResult lib3mf_decomposevectornode_getoutputy(Lib3MF_DecomposeVectorNode pDecomposeVectorNode, Lib3MF_ImplicitPort * pY) +Lib3MFResult lib3mf_matrixfromrowsnode_getoutputresult(Lib3MF_MatrixFromRowsNode pMatrixFromRowsNode, Lib3MF_ImplicitPort * pResult) { - IBase* pIBaseClass = (IBase *)pDecomposeVectorNode; + IBase* pIBaseClass = (IBase *)pMatrixFromRowsNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pDecomposeVectorNode, "DecomposeVectorNode", "GetOutputY"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromRowsNode, "MatrixFromRowsNode", "GetOutputResult"); } - if (pY == nullptr) + if (pResult == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseY(nullptr); - IDecomposeVectorNode* pIDecomposeVectorNode = dynamic_cast(pIBaseClass); - if (!pIDecomposeVectorNode) + IBase* pBaseResult(nullptr); + IMatrixFromRowsNode* pIMatrixFromRowsNode = dynamic_cast(pIBaseClass); + if (!pIMatrixFromRowsNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseY = pIDecomposeVectorNode->GetOutputY(); + pBaseResult = pIMatrixFromRowsNode->GetOutputResult(); - *pY = (IBase*)(pBaseY); + *pResult = (IBase*)(pBaseResult); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Y", *pY); + pJournalEntry->addHandleResult("Result", *pResult); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12587,27 +13982,31 @@ Lib3MFResult lib3mf_decomposevectornode_getoutputy(Lib3MF_DecomposeVectorNode pD } } -Lib3MFResult lib3mf_decomposevectornode_getoutputz(Lib3MF_DecomposeVectorNode pDecomposeVectorNode, Lib3MF_ImplicitPort * pZ) + +/************************************************************************************************************************* + Class implementation for MatrixFromColumnsNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_matrixfromcolumnsnode_getinputa(Lib3MF_MatrixFromColumnsNode pMatrixFromColumnsNode, Lib3MF_ImplicitPort * pColumn0) { - IBase* pIBaseClass = (IBase *)pDecomposeVectorNode; + IBase* pIBaseClass = (IBase *)pMatrixFromColumnsNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pDecomposeVectorNode, "DecomposeVectorNode", "GetOutputZ"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromColumnsNode, "MatrixFromColumnsNode", "GetInputA"); } - if (pZ == nullptr) + if (pColumn0 == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseZ(nullptr); - IDecomposeVectorNode* pIDecomposeVectorNode = dynamic_cast(pIBaseClass); - if (!pIDecomposeVectorNode) + IBase* pBaseColumn0(nullptr); + IMatrixFromColumnsNode* pIMatrixFromColumnsNode = dynamic_cast(pIBaseClass); + if (!pIMatrixFromColumnsNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseZ = pIDecomposeVectorNode->GetOutputZ(); + pBaseColumn0 = pIMatrixFromColumnsNode->GetInputA(); - *pZ = (IBase*)(pBaseZ); + *pColumn0 = (IBase*)(pBaseColumn0); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Z", *pZ); + pJournalEntry->addHandleResult("Column0", *pColumn0); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12623,31 +14022,27 @@ Lib3MFResult lib3mf_decomposevectornode_getoutputz(Lib3MF_DecomposeVectorNode pD } } - -/************************************************************************************************************************* - Class implementation for ComposeMatrixNode -**************************************************************************************************************************/ -Lib3MFResult lib3mf_composematrixnode_getinputm00(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM00) +Lib3MFResult lib3mf_matrixfromcolumnsnode_getinputb(Lib3MF_MatrixFromColumnsNode pMatrixFromColumnsNode, Lib3MF_ImplicitPort * pColumn1) { - IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + IBase* pIBaseClass = (IBase *)pMatrixFromColumnsNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM00"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromColumnsNode, "MatrixFromColumnsNode", "GetInputB"); } - if (pM00 == nullptr) + if (pColumn1 == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseM00(nullptr); - IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); - if (!pIComposeMatrixNode) + IBase* pBaseColumn1(nullptr); + IMatrixFromColumnsNode* pIMatrixFromColumnsNode = dynamic_cast(pIBaseClass); + if (!pIMatrixFromColumnsNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseM00 = pIComposeMatrixNode->GetInputM00(); + pBaseColumn1 = pIMatrixFromColumnsNode->GetInputB(); - *pM00 = (IBase*)(pBaseM00); + *pColumn1 = (IBase*)(pBaseColumn1); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("M00", *pM00); + pJournalEntry->addHandleResult("Column1", *pColumn1); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12663,27 +14058,27 @@ Lib3MFResult lib3mf_composematrixnode_getinputm00(Lib3MF_ComposeMatrixNode pComp } } -Lib3MFResult lib3mf_composematrixnode_getinputm01(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM01) +Lib3MFResult lib3mf_matrixfromcolumnsnode_getinputc(Lib3MF_MatrixFromColumnsNode pMatrixFromColumnsNode, Lib3MF_ImplicitPort * pColumn2) { - IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + IBase* pIBaseClass = (IBase *)pMatrixFromColumnsNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM01"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromColumnsNode, "MatrixFromColumnsNode", "GetInputC"); } - if (pM01 == nullptr) + if (pColumn2 == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseM01(nullptr); - IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); - if (!pIComposeMatrixNode) + IBase* pBaseColumn2(nullptr); + IMatrixFromColumnsNode* pIMatrixFromColumnsNode = dynamic_cast(pIBaseClass); + if (!pIMatrixFromColumnsNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseM01 = pIComposeMatrixNode->GetInputM01(); + pBaseColumn2 = pIMatrixFromColumnsNode->GetInputC(); - *pM01 = (IBase*)(pBaseM01); + *pColumn2 = (IBase*)(pBaseColumn2); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("M01", *pM01); + pJournalEntry->addHandleResult("Column2", *pColumn2); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12699,27 +14094,27 @@ Lib3MFResult lib3mf_composematrixnode_getinputm01(Lib3MF_ComposeMatrixNode pComp } } -Lib3MFResult lib3mf_composematrixnode_getinputm02(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM02) +Lib3MFResult lib3mf_matrixfromcolumnsnode_getinputd(Lib3MF_MatrixFromColumnsNode pMatrixFromColumnsNode, Lib3MF_ImplicitPort * pColumn3) { - IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + IBase* pIBaseClass = (IBase *)pMatrixFromColumnsNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM02"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromColumnsNode, "MatrixFromColumnsNode", "GetInputD"); } - if (pM02 == nullptr) + if (pColumn3 == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseM02(nullptr); - IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); - if (!pIComposeMatrixNode) + IBase* pBaseColumn3(nullptr); + IMatrixFromColumnsNode* pIMatrixFromColumnsNode = dynamic_cast(pIBaseClass); + if (!pIMatrixFromColumnsNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseM02 = pIComposeMatrixNode->GetInputM02(); + pBaseColumn3 = pIMatrixFromColumnsNode->GetInputD(); - *pM02 = (IBase*)(pBaseM02); + *pColumn3 = (IBase*)(pBaseColumn3); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("M02", *pM02); + pJournalEntry->addHandleResult("Column3", *pColumn3); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12735,27 +14130,27 @@ Lib3MFResult lib3mf_composematrixnode_getinputm02(Lib3MF_ComposeMatrixNode pComp } } -Lib3MFResult lib3mf_composematrixnode_getinputm03(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM03) +Lib3MFResult lib3mf_matrixfromcolumnsnode_getoutputresult(Lib3MF_MatrixFromColumnsNode pMatrixFromColumnsNode, Lib3MF_ImplicitPort * pResult) { - IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + IBase* pIBaseClass = (IBase *)pMatrixFromColumnsNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM03"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromColumnsNode, "MatrixFromColumnsNode", "GetOutputResult"); } - if (pM03 == nullptr) + if (pResult == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseM03(nullptr); - IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); - if (!pIComposeMatrixNode) + IBase* pBaseResult(nullptr); + IMatrixFromColumnsNode* pIMatrixFromColumnsNode = dynamic_cast(pIBaseClass); + if (!pIMatrixFromColumnsNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseM03 = pIComposeMatrixNode->GetInputM03(); + pBaseResult = pIMatrixFromColumnsNode->GetOutputResult(); - *pM03 = (IBase*)(pBaseM03); + *pResult = (IBase*)(pBaseResult); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("M03", *pM03); + pJournalEntry->addHandleResult("Result", *pResult); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12771,27 +14166,27 @@ Lib3MFResult lib3mf_composematrixnode_getinputm03(Lib3MF_ComposeMatrixNode pComp } } -Lib3MFResult lib3mf_composematrixnode_getinputm10(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM10) + +/************************************************************************************************************************* + Class implementation for ConstantNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_constantnode_setconstant(Lib3MF_ConstantNode pConstantNode, Lib3MF_double dValue) { - IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + IBase* pIBaseClass = (IBase *)pConstantNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM10"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pConstantNode, "ConstantNode", "SetConstant"); + pJournalEntry->addDoubleParameter("Value", dValue); } - if (pM10 == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseM10(nullptr); - IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); - if (!pIComposeMatrixNode) + IConstantNode* pIConstantNode = dynamic_cast(pIBaseClass); + if (!pIConstantNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseM10 = pIComposeMatrixNode->GetInputM10(); + pIConstantNode->SetConstant(dValue); - *pM10 = (IBase*)(pBaseM10); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("M10", *pM10); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12807,27 +14202,25 @@ Lib3MFResult lib3mf_composematrixnode_getinputm10(Lib3MF_ComposeMatrixNode pComp } } -Lib3MFResult lib3mf_composematrixnode_getinputm11(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM11) +Lib3MFResult lib3mf_constantnode_getconstant(Lib3MF_ConstantNode pConstantNode, Lib3MF_double * pValue) { - IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + IBase* pIBaseClass = (IBase *)pConstantNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM11"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pConstantNode, "ConstantNode", "GetConstant"); } - if (pM11 == nullptr) + if (pValue == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseM11(nullptr); - IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); - if (!pIComposeMatrixNode) + IConstantNode* pIConstantNode = dynamic_cast(pIBaseClass); + if (!pIConstantNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseM11 = pIComposeMatrixNode->GetInputM11(); + *pValue = pIConstantNode->GetConstant(); - *pM11 = (IBase*)(pBaseM11); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("M11", *pM11); + pJournalEntry->addDoubleResult("Value", *pValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12843,27 +14236,27 @@ Lib3MFResult lib3mf_composematrixnode_getinputm11(Lib3MF_ComposeMatrixNode pComp } } -Lib3MFResult lib3mf_composematrixnode_getinputm12(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM12) +Lib3MFResult lib3mf_constantnode_getoutputvalue(Lib3MF_ConstantNode pConstantNode, Lib3MF_ImplicitPort * pValue) { - IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + IBase* pIBaseClass = (IBase *)pConstantNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM12"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pConstantNode, "ConstantNode", "GetOutputValue"); } - if (pM12 == nullptr) + if (pValue == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseM12(nullptr); - IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); - if (!pIComposeMatrixNode) + IBase* pBaseValue(nullptr); + IConstantNode* pIConstantNode = dynamic_cast(pIBaseClass); + if (!pIConstantNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseM12 = pIComposeMatrixNode->GetInputM12(); + pBaseValue = pIConstantNode->GetOutputValue(); - *pM12 = (IBase*)(pBaseM12); + *pValue = (IBase*)(pBaseValue); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("M12", *pM12); + pJournalEntry->addHandleResult("Value", *pValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12879,27 +14272,26 @@ Lib3MFResult lib3mf_composematrixnode_getinputm12(Lib3MF_ComposeMatrixNode pComp } } -Lib3MFResult lib3mf_composematrixnode_getinputm13(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM13) + +/************************************************************************************************************************* + Class implementation for ConstVecNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_constvecnode_setvector(Lib3MF_ConstVecNode pConstVecNode, const sLib3MFVector * pValue) { - IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + IBase* pIBaseClass = (IBase *)pConstVecNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM13"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pConstVecNode, "ConstVecNode", "SetVector"); } - if (pM13 == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseM13(nullptr); - IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); - if (!pIComposeMatrixNode) + IConstVecNode* pIConstVecNode = dynamic_cast(pIBaseClass); + if (!pIConstVecNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseM13 = pIComposeMatrixNode->GetInputM13(); + pIConstVecNode->SetVector(*pValue); - *pM13 = (IBase*)(pBaseM13); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("M13", *pM13); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12915,27 +14307,24 @@ Lib3MFResult lib3mf_composematrixnode_getinputm13(Lib3MF_ComposeMatrixNode pComp } } -Lib3MFResult lib3mf_composematrixnode_getinputm20(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM20) +Lib3MFResult lib3mf_constvecnode_getvector(Lib3MF_ConstVecNode pConstVecNode, sLib3MFVector * pValue) { - IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + IBase* pIBaseClass = (IBase *)pConstVecNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM20"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pConstVecNode, "ConstVecNode", "GetVector"); } - if (pM20 == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseM20(nullptr); - IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); - if (!pIComposeMatrixNode) + if (pValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IConstVecNode* pIConstVecNode = dynamic_cast(pIBaseClass); + if (!pIConstVecNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseM20 = pIComposeMatrixNode->GetInputM20(); + *pValue = pIConstVecNode->GetVector(); - *pM20 = (IBase*)(pBaseM20); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("M20", *pM20); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12951,27 +14340,27 @@ Lib3MFResult lib3mf_composematrixnode_getinputm20(Lib3MF_ComposeMatrixNode pComp } } -Lib3MFResult lib3mf_composematrixnode_getinputm21(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM21) +Lib3MFResult lib3mf_constvecnode_getoutputvector(Lib3MF_ConstVecNode pConstVecNode, Lib3MF_ImplicitPort * pVector) { - IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + IBase* pIBaseClass = (IBase *)pConstVecNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM21"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pConstVecNode, "ConstVecNode", "GetOutputVector"); } - if (pM21 == nullptr) + if (pVector == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseM21(nullptr); - IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); - if (!pIComposeMatrixNode) + IBase* pBaseVector(nullptr); + IConstVecNode* pIConstVecNode = dynamic_cast(pIBaseClass); + if (!pIConstVecNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseM21 = pIComposeMatrixNode->GetInputM21(); + pBaseVector = pIConstVecNode->GetOutputVector(); - *pM21 = (IBase*)(pBaseM21); + *pVector = (IBase*)(pBaseVector); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("M21", *pM21); + pJournalEntry->addHandleResult("Vector", *pVector); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -12987,27 +14376,26 @@ Lib3MFResult lib3mf_composematrixnode_getinputm21(Lib3MF_ComposeMatrixNode pComp } } -Lib3MFResult lib3mf_composematrixnode_getinputm22(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM22) + +/************************************************************************************************************************* + Class implementation for ConstMatNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_constmatnode_setmatrix(Lib3MF_ConstMatNode pConstMatNode, const sLib3MFMatrix4x4 * pValue) { - IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + IBase* pIBaseClass = (IBase *)pConstMatNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM22"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pConstMatNode, "ConstMatNode", "SetMatrix"); } - if (pM22 == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseM22(nullptr); - IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); - if (!pIComposeMatrixNode) + IConstMatNode* pIConstMatNode = dynamic_cast(pIBaseClass); + if (!pIConstMatNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseM22 = pIComposeMatrixNode->GetInputM22(); + pIConstMatNode->SetMatrix(*pValue); - *pM22 = (IBase*)(pBaseM22); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("M22", *pM22); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13023,27 +14411,24 @@ Lib3MFResult lib3mf_composematrixnode_getinputm22(Lib3MF_ComposeMatrixNode pComp } } -Lib3MFResult lib3mf_composematrixnode_getinputm23(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM23) +Lib3MFResult lib3mf_constmatnode_getmatrix(Lib3MF_ConstMatNode pConstMatNode, sLib3MFMatrix4x4 * pValue) { - IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + IBase* pIBaseClass = (IBase *)pConstMatNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM23"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pConstMatNode, "ConstMatNode", "GetMatrix"); } - if (pM23 == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseM23(nullptr); - IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); - if (!pIComposeMatrixNode) + if (pValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IConstMatNode* pIConstMatNode = dynamic_cast(pIBaseClass); + if (!pIConstMatNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseM23 = pIComposeMatrixNode->GetInputM23(); + *pValue = pIConstMatNode->GetMatrix(); - *pM23 = (IBase*)(pBaseM23); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("M23", *pM23); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13059,27 +14444,27 @@ Lib3MFResult lib3mf_composematrixnode_getinputm23(Lib3MF_ComposeMatrixNode pComp } } -Lib3MFResult lib3mf_composematrixnode_getinputm30(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM30) +Lib3MFResult lib3mf_constmatnode_getoutputmatrix(Lib3MF_ConstMatNode pConstMatNode, Lib3MF_ImplicitPort * pMatrix) { - IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + IBase* pIBaseClass = (IBase *)pConstMatNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM30"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pConstMatNode, "ConstMatNode", "GetOutputMatrix"); } - if (pM30 == nullptr) + if (pMatrix == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseM30(nullptr); - IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); - if (!pIComposeMatrixNode) + IBase* pBaseMatrix(nullptr); + IConstMatNode* pIConstMatNode = dynamic_cast(pIBaseClass); + if (!pIConstMatNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseM30 = pIComposeMatrixNode->GetInputM30(); + pBaseMatrix = pIConstMatNode->GetOutputMatrix(); - *pM30 = (IBase*)(pBaseM30); + *pMatrix = (IBase*)(pBaseMatrix); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("M30", *pM30); + pJournalEntry->addHandleResult("Matrix", *pMatrix); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13095,27 +14480,31 @@ Lib3MFResult lib3mf_composematrixnode_getinputm30(Lib3MF_ComposeMatrixNode pComp } } -Lib3MFResult lib3mf_composematrixnode_getinputm31(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM31) + +/************************************************************************************************************************* + Class implementation for MeshNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_meshnode_getinputmesh(Lib3MF_MeshNode pMeshNode, Lib3MF_ImplicitPort * pMesh) { - IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + IBase* pIBaseClass = (IBase *)pMeshNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM31"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshNode, "MeshNode", "GetInputMesh"); } - if (pM31 == nullptr) + if (pMesh == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseM31(nullptr); - IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); - if (!pIComposeMatrixNode) + IBase* pBaseMesh(nullptr); + IMeshNode* pIMeshNode = dynamic_cast(pIBaseClass); + if (!pIMeshNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseM31 = pIComposeMatrixNode->GetInputM31(); + pBaseMesh = pIMeshNode->GetInputMesh(); - *pM31 = (IBase*)(pBaseM31); + *pMesh = (IBase*)(pBaseMesh); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("M31", *pM31); + pJournalEntry->addHandleResult("Mesh", *pMesh); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13131,27 +14520,27 @@ Lib3MFResult lib3mf_composematrixnode_getinputm31(Lib3MF_ComposeMatrixNode pComp } } -Lib3MFResult lib3mf_composematrixnode_getinputm32(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM32) +Lib3MFResult lib3mf_meshnode_getinputpos(Lib3MF_MeshNode pMeshNode, Lib3MF_ImplicitPort * pPos) { - IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + IBase* pIBaseClass = (IBase *)pMeshNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM32"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshNode, "MeshNode", "GetInputPos"); } - if (pM32 == nullptr) + if (pPos == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseM32(nullptr); - IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); - if (!pIComposeMatrixNode) + IBase* pBasePos(nullptr); + IMeshNode* pIMeshNode = dynamic_cast(pIBaseClass); + if (!pIMeshNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseM32 = pIComposeMatrixNode->GetInputM32(); + pBasePos = pIMeshNode->GetInputPos(); - *pM32 = (IBase*)(pBaseM32); + *pPos = (IBase*)(pBasePos); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("M32", *pM32); + pJournalEntry->addHandleResult("Pos", *pPos); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13167,27 +14556,27 @@ Lib3MFResult lib3mf_composematrixnode_getinputm32(Lib3MF_ComposeMatrixNode pComp } } -Lib3MFResult lib3mf_composematrixnode_getinputm33(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pM33) +Lib3MFResult lib3mf_meshnode_getoutputdistance(Lib3MF_MeshNode pMeshNode, Lib3MF_ImplicitPort * pDistance) { - IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + IBase* pIBaseClass = (IBase *)pMeshNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetInputM33"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshNode, "MeshNode", "GetOutputDistance"); } - if (pM33 == nullptr) + if (pDistance == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseM33(nullptr); - IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); - if (!pIComposeMatrixNode) + IBase* pBaseDistance(nullptr); + IMeshNode* pIMeshNode = dynamic_cast(pIBaseClass); + if (!pIMeshNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseM33 = pIComposeMatrixNode->GetInputM33(); + pBaseDistance = pIMeshNode->GetOutputDistance(); - *pM33 = (IBase*)(pBaseM33); + *pDistance = (IBase*)(pBaseDistance); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("M33", *pM33); + pJournalEntry->addHandleResult("Distance", *pDistance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13203,27 +14592,31 @@ Lib3MFResult lib3mf_composematrixnode_getinputm33(Lib3MF_ComposeMatrixNode pComp } } -Lib3MFResult lib3mf_composematrixnode_getoutputresult(Lib3MF_ComposeMatrixNode pComposeMatrixNode, Lib3MF_ImplicitPort * pResult) + +/************************************************************************************************************************* + Class implementation for UnsignedMeshNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_unsignedmeshnode_getinputmesh(Lib3MF_UnsignedMeshNode pUnsignedMeshNode, Lib3MF_ImplicitPort * pMesh) { - IBase* pIBaseClass = (IBase *)pComposeMatrixNode; + IBase* pIBaseClass = (IBase *)pUnsignedMeshNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComposeMatrixNode, "ComposeMatrixNode", "GetOutputResult"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pUnsignedMeshNode, "UnsignedMeshNode", "GetInputMesh"); } - if (pResult == nullptr) + if (pMesh == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseResult(nullptr); - IComposeMatrixNode* pIComposeMatrixNode = dynamic_cast(pIBaseClass); - if (!pIComposeMatrixNode) + IBase* pBaseMesh(nullptr); + IUnsignedMeshNode* pIUnsignedMeshNode = dynamic_cast(pIBaseClass); + if (!pIUnsignedMeshNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseResult = pIComposeMatrixNode->GetOutputResult(); + pBaseMesh = pIUnsignedMeshNode->GetInputMesh(); - *pResult = (IBase*)(pBaseResult); + *pMesh = (IBase*)(pBaseMesh); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Result", *pResult); + pJournalEntry->addHandleResult("Mesh", *pMesh); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13239,31 +14632,27 @@ Lib3MFResult lib3mf_composematrixnode_getoutputresult(Lib3MF_ComposeMatrixNode p } } - -/************************************************************************************************************************* - Class implementation for MatrixFromRowsNode -**************************************************************************************************************************/ -Lib3MFResult lib3mf_matrixfromrowsnode_getinputa(Lib3MF_MatrixFromRowsNode pMatrixFromRowsNode, Lib3MF_ImplicitPort * pRow0) +Lib3MFResult lib3mf_unsignedmeshnode_getinputpos(Lib3MF_UnsignedMeshNode pUnsignedMeshNode, Lib3MF_ImplicitPort * pPos) { - IBase* pIBaseClass = (IBase *)pMatrixFromRowsNode; + IBase* pIBaseClass = (IBase *)pUnsignedMeshNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromRowsNode, "MatrixFromRowsNode", "GetInputA"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pUnsignedMeshNode, "UnsignedMeshNode", "GetInputPos"); } - if (pRow0 == nullptr) + if (pPos == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseRow0(nullptr); - IMatrixFromRowsNode* pIMatrixFromRowsNode = dynamic_cast(pIBaseClass); - if (!pIMatrixFromRowsNode) + IBase* pBasePos(nullptr); + IUnsignedMeshNode* pIUnsignedMeshNode = dynamic_cast(pIBaseClass); + if (!pIUnsignedMeshNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseRow0 = pIMatrixFromRowsNode->GetInputA(); + pBasePos = pIUnsignedMeshNode->GetInputPos(); - *pRow0 = (IBase*)(pBaseRow0); + *pPos = (IBase*)(pBasePos); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Row0", *pRow0); + pJournalEntry->addHandleResult("Pos", *pPos); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13279,27 +14668,27 @@ Lib3MFResult lib3mf_matrixfromrowsnode_getinputa(Lib3MF_MatrixFromRowsNode pMatr } } -Lib3MFResult lib3mf_matrixfromrowsnode_getinputb(Lib3MF_MatrixFromRowsNode pMatrixFromRowsNode, Lib3MF_ImplicitPort * pRow1) +Lib3MFResult lib3mf_unsignedmeshnode_getoutputdistance(Lib3MF_UnsignedMeshNode pUnsignedMeshNode, Lib3MF_ImplicitPort * pDistance) { - IBase* pIBaseClass = (IBase *)pMatrixFromRowsNode; + IBase* pIBaseClass = (IBase *)pUnsignedMeshNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromRowsNode, "MatrixFromRowsNode", "GetInputB"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pUnsignedMeshNode, "UnsignedMeshNode", "GetOutputDistance"); } - if (pRow1 == nullptr) + if (pDistance == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseRow1(nullptr); - IMatrixFromRowsNode* pIMatrixFromRowsNode = dynamic_cast(pIBaseClass); - if (!pIMatrixFromRowsNode) + IBase* pBaseDistance(nullptr); + IUnsignedMeshNode* pIUnsignedMeshNode = dynamic_cast(pIBaseClass); + if (!pIUnsignedMeshNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseRow1 = pIMatrixFromRowsNode->GetInputB(); + pBaseDistance = pIUnsignedMeshNode->GetOutputDistance(); - *pRow1 = (IBase*)(pBaseRow1); + *pDistance = (IBase*)(pBaseDistance); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Row1", *pRow1); + pJournalEntry->addHandleResult("Distance", *pDistance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13315,27 +14704,31 @@ Lib3MFResult lib3mf_matrixfromrowsnode_getinputb(Lib3MF_MatrixFromRowsNode pMatr } } -Lib3MFResult lib3mf_matrixfromrowsnode_getinputc(Lib3MF_MatrixFromRowsNode pMatrixFromRowsNode, Lib3MF_ImplicitPort * pRow2) + +/************************************************************************************************************************* + Class implementation for BeamLatticeNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_beamlatticenode_getinputbeamlattice(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pBeamLattice) { - IBase* pIBaseClass = (IBase *)pMatrixFromRowsNode; + IBase* pIBaseClass = (IBase *)pBeamLatticeNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromRowsNode, "MatrixFromRowsNode", "GetInputC"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLatticeNode, "BeamLatticeNode", "GetInputBeamLattice"); } - if (pRow2 == nullptr) + if (pBeamLattice == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseRow2(nullptr); - IMatrixFromRowsNode* pIMatrixFromRowsNode = dynamic_cast(pIBaseClass); - if (!pIMatrixFromRowsNode) + IBase* pBaseBeamLattice(nullptr); + IBeamLatticeNode* pIBeamLatticeNode = dynamic_cast(pIBaseClass); + if (!pIBeamLatticeNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseRow2 = pIMatrixFromRowsNode->GetInputC(); + pBaseBeamLattice = pIBeamLatticeNode->GetInputBeamLattice(); - *pRow2 = (IBase*)(pBaseRow2); + *pBeamLattice = (IBase*)(pBaseBeamLattice); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Row2", *pRow2); + pJournalEntry->addHandleResult("BeamLattice", *pBeamLattice); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13351,27 +14744,27 @@ Lib3MFResult lib3mf_matrixfromrowsnode_getinputc(Lib3MF_MatrixFromRowsNode pMatr } } -Lib3MFResult lib3mf_matrixfromrowsnode_getinputd(Lib3MF_MatrixFromRowsNode pMatrixFromRowsNode, Lib3MF_ImplicitPort * pRow3) +Lib3MFResult lib3mf_beamlatticenode_getinputpos(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pPos) { - IBase* pIBaseClass = (IBase *)pMatrixFromRowsNode; + IBase* pIBaseClass = (IBase *)pBeamLatticeNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromRowsNode, "MatrixFromRowsNode", "GetInputD"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLatticeNode, "BeamLatticeNode", "GetInputPos"); } - if (pRow3 == nullptr) + if (pPos == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseRow3(nullptr); - IMatrixFromRowsNode* pIMatrixFromRowsNode = dynamic_cast(pIBaseClass); - if (!pIMatrixFromRowsNode) + IBase* pBasePos(nullptr); + IBeamLatticeNode* pIBeamLatticeNode = dynamic_cast(pIBaseClass); + if (!pIBeamLatticeNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseRow3 = pIMatrixFromRowsNode->GetInputD(); + pBasePos = pIBeamLatticeNode->GetInputPos(); - *pRow3 = (IBase*)(pBaseRow3); + *pPos = (IBase*)(pBasePos); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Row3", *pRow3); + pJournalEntry->addHandleResult("Pos", *pPos); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13387,27 +14780,27 @@ Lib3MFResult lib3mf_matrixfromrowsnode_getinputd(Lib3MF_MatrixFromRowsNode pMatr } } -Lib3MFResult lib3mf_matrixfromrowsnode_getoutputresult(Lib3MF_MatrixFromRowsNode pMatrixFromRowsNode, Lib3MF_ImplicitPort * pResult) +Lib3MFResult lib3mf_beamlatticenode_getoutputdistance(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_ImplicitPort * pDistance) { - IBase* pIBaseClass = (IBase *)pMatrixFromRowsNode; + IBase* pIBaseClass = (IBase *)pBeamLatticeNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromRowsNode, "MatrixFromRowsNode", "GetOutputResult"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLatticeNode, "BeamLatticeNode", "GetOutputDistance"); } - if (pResult == nullptr) + if (pDistance == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseResult(nullptr); - IMatrixFromRowsNode* pIMatrixFromRowsNode = dynamic_cast(pIBaseClass); - if (!pIMatrixFromRowsNode) + IBase* pBaseDistance(nullptr); + IBeamLatticeNode* pIBeamLatticeNode = dynamic_cast(pIBaseClass); + if (!pIBeamLatticeNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseResult = pIMatrixFromRowsNode->GetOutputResult(); + pBaseDistance = pIBeamLatticeNode->GetOutputDistance(); - *pResult = (IBase*)(pBaseResult); + *pDistance = (IBase*)(pBaseDistance); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Result", *pResult); + pJournalEntry->addHandleResult("Distance", *pDistance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13423,31 +14816,23 @@ Lib3MFResult lib3mf_matrixfromrowsnode_getoutputresult(Lib3MF_MatrixFromRowsNode } } - -/************************************************************************************************************************* - Class implementation for MatrixFromColumnsNode -**************************************************************************************************************************/ -Lib3MFResult lib3mf_matrixfromcolumnsnode_getinputa(Lib3MF_MatrixFromColumnsNode pMatrixFromColumnsNode, Lib3MF_ImplicitPort * pColumn0) +Lib3MFResult lib3mf_beamlatticenode_setaccuraterange(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double dAccurateRange) { - IBase* pIBaseClass = (IBase *)pMatrixFromColumnsNode; + IBase* pIBaseClass = (IBase *)pBeamLatticeNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromColumnsNode, "MatrixFromColumnsNode", "GetInputA"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLatticeNode, "BeamLatticeNode", "SetAccurateRange"); + pJournalEntry->addDoubleParameter("AccurateRange", dAccurateRange); } - if (pColumn0 == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseColumn0(nullptr); - IMatrixFromColumnsNode* pIMatrixFromColumnsNode = dynamic_cast(pIBaseClass); - if (!pIMatrixFromColumnsNode) + IBeamLatticeNode* pIBeamLatticeNode = dynamic_cast(pIBaseClass); + if (!pIBeamLatticeNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseColumn0 = pIMatrixFromColumnsNode->GetInputA(); + pIBeamLatticeNode->SetAccurateRange(dAccurateRange); - *pColumn0 = (IBase*)(pBaseColumn0); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Column0", *pColumn0); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13463,27 +14848,25 @@ Lib3MFResult lib3mf_matrixfromcolumnsnode_getinputa(Lib3MF_MatrixFromColumnsNode } } -Lib3MFResult lib3mf_matrixfromcolumnsnode_getinputb(Lib3MF_MatrixFromColumnsNode pMatrixFromColumnsNode, Lib3MF_ImplicitPort * pColumn1) +Lib3MFResult lib3mf_beamlatticenode_getaccuraterange(Lib3MF_BeamLatticeNode pBeamLatticeNode, Lib3MF_double * pAccurateRange) { - IBase* pIBaseClass = (IBase *)pMatrixFromColumnsNode; + IBase* pIBaseClass = (IBase *)pBeamLatticeNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromColumnsNode, "MatrixFromColumnsNode", "GetInputB"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLatticeNode, "BeamLatticeNode", "GetAccurateRange"); } - if (pColumn1 == nullptr) + if (pAccurateRange == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseColumn1(nullptr); - IMatrixFromColumnsNode* pIMatrixFromColumnsNode = dynamic_cast(pIBaseClass); - if (!pIMatrixFromColumnsNode) + IBeamLatticeNode* pIBeamLatticeNode = dynamic_cast(pIBaseClass); + if (!pIBeamLatticeNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseColumn1 = pIMatrixFromColumnsNode->GetInputB(); + *pAccurateRange = pIBeamLatticeNode->GetAccurateRange(); - *pColumn1 = (IBase*)(pBaseColumn1); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Column1", *pColumn1); + pJournalEntry->addDoubleResult("AccurateRange", *pAccurateRange); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13499,27 +14882,31 @@ Lib3MFResult lib3mf_matrixfromcolumnsnode_getinputb(Lib3MF_MatrixFromColumnsNode } } -Lib3MFResult lib3mf_matrixfromcolumnsnode_getinputc(Lib3MF_MatrixFromColumnsNode pMatrixFromColumnsNode, Lib3MF_ImplicitPort * pColumn2) + +/************************************************************************************************************************* + Class implementation for FunctionGradientNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_functiongradientnode_getinputfunctionid(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pFunction) { - IBase* pIBaseClass = (IBase *)pMatrixFromColumnsNode; + IBase* pIBaseClass = (IBase *)pFunctionGradientNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromColumnsNode, "MatrixFromColumnsNode", "GetInputC"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionGradientNode, "FunctionGradientNode", "GetInputFunctionID"); } - if (pColumn2 == nullptr) + if (pFunction == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseColumn2(nullptr); - IMatrixFromColumnsNode* pIMatrixFromColumnsNode = dynamic_cast(pIBaseClass); - if (!pIMatrixFromColumnsNode) + IBase* pBaseFunction(nullptr); + IFunctionGradientNode* pIFunctionGradientNode = dynamic_cast(pIBaseClass); + if (!pIFunctionGradientNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseColumn2 = pIMatrixFromColumnsNode->GetInputC(); + pBaseFunction = pIFunctionGradientNode->GetInputFunctionID(); - *pColumn2 = (IBase*)(pBaseColumn2); + *pFunction = (IBase*)(pBaseFunction); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Column2", *pColumn2); + pJournalEntry->addHandleResult("Function", *pFunction); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13535,27 +14922,27 @@ Lib3MFResult lib3mf_matrixfromcolumnsnode_getinputc(Lib3MF_MatrixFromColumnsNode } } -Lib3MFResult lib3mf_matrixfromcolumnsnode_getinputd(Lib3MF_MatrixFromColumnsNode pMatrixFromColumnsNode, Lib3MF_ImplicitPort * pColumn3) +Lib3MFResult lib3mf_functiongradientnode_getinputpos(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pPos) { - IBase* pIBaseClass = (IBase *)pMatrixFromColumnsNode; + IBase* pIBaseClass = (IBase *)pFunctionGradientNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromColumnsNode, "MatrixFromColumnsNode", "GetInputD"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionGradientNode, "FunctionGradientNode", "GetInputPos"); } - if (pColumn3 == nullptr) + if (pPos == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseColumn3(nullptr); - IMatrixFromColumnsNode* pIMatrixFromColumnsNode = dynamic_cast(pIBaseClass); - if (!pIMatrixFromColumnsNode) + IBase* pBasePos(nullptr); + IFunctionGradientNode* pIFunctionGradientNode = dynamic_cast(pIBaseClass); + if (!pIFunctionGradientNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseColumn3 = pIMatrixFromColumnsNode->GetInputD(); + pBasePos = pIFunctionGradientNode->GetInputPos(); - *pColumn3 = (IBase*)(pBaseColumn3); + *pPos = (IBase*)(pBasePos); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Column3", *pColumn3); + pJournalEntry->addHandleResult("Pos", *pPos); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13571,27 +14958,27 @@ Lib3MFResult lib3mf_matrixfromcolumnsnode_getinputd(Lib3MF_MatrixFromColumnsNode } } -Lib3MFResult lib3mf_matrixfromcolumnsnode_getoutputresult(Lib3MF_MatrixFromColumnsNode pMatrixFromColumnsNode, Lib3MF_ImplicitPort * pResult) +Lib3MFResult lib3mf_functiongradientnode_getinputstep(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pStep) { - IBase* pIBaseClass = (IBase *)pMatrixFromColumnsNode; + IBase* pIBaseClass = (IBase *)pFunctionGradientNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMatrixFromColumnsNode, "MatrixFromColumnsNode", "GetOutputResult"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionGradientNode, "FunctionGradientNode", "GetInputStep"); } - if (pResult == nullptr) + if (pStep == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseResult(nullptr); - IMatrixFromColumnsNode* pIMatrixFromColumnsNode = dynamic_cast(pIBaseClass); - if (!pIMatrixFromColumnsNode) + IBase* pBaseStep(nullptr); + IFunctionGradientNode* pIFunctionGradientNode = dynamic_cast(pIBaseClass); + if (!pIFunctionGradientNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseResult = pIMatrixFromColumnsNode->GetOutputResult(); + pBaseStep = pIFunctionGradientNode->GetInputStep(); - *pResult = (IBase*)(pBaseResult); + *pStep = (IBase*)(pBaseStep); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Result", *pResult); + pJournalEntry->addHandleResult("Step", *pStep); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13607,25 +14994,24 @@ Lib3MFResult lib3mf_matrixfromcolumnsnode_getoutputresult(Lib3MF_MatrixFromColum } } - -/************************************************************************************************************************* - Class implementation for ConstantNode -**************************************************************************************************************************/ -Lib3MFResult lib3mf_constantnode_setconstant(Lib3MF_ConstantNode pConstantNode, Lib3MF_double dValue) +Lib3MFResult lib3mf_functiongradientnode_setscalaroutputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pScalarOutputName) { - IBase* pIBaseClass = (IBase *)pConstantNode; + IBase* pIBaseClass = (IBase *)pFunctionGradientNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pConstantNode, "ConstantNode", "SetConstant"); - pJournalEntry->addDoubleParameter("Value", dValue); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionGradientNode, "FunctionGradientNode", "SetScalarOutputName"); + pJournalEntry->addStringParameter("ScalarOutputName", pScalarOutputName); } - IConstantNode* pIConstantNode = dynamic_cast(pIBaseClass); - if (!pIConstantNode) + if (pScalarOutputName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sScalarOutputName(pScalarOutputName); + IFunctionGradientNode* pIFunctionGradientNode = dynamic_cast(pIBaseClass); + if (!pIFunctionGradientNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIConstantNode->SetConstant(dValue); + pIFunctionGradientNode->SetScalarOutputName(sScalarOutputName); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -13643,25 +15029,47 @@ Lib3MFResult lib3mf_constantnode_setconstant(Lib3MF_ConstantNode pConstantNode, } } -Lib3MFResult lib3mf_constantnode_getconstant(Lib3MF_ConstantNode pConstantNode, Lib3MF_double * pValue) +Lib3MFResult lib3mf_functiongradientnode_getscalaroutputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer) { - IBase* pIBaseClass = (IBase *)pConstantNode; + IBase* pIBaseClass = (IBase *)pFunctionGradientNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pConstantNode, "ConstantNode", "GetConstant"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionGradientNode, "FunctionGradientNode", "GetScalarOutputName"); } - if (pValue == nullptr) + if ( (!pScalarOutputNameBuffer) && !(pScalarOutputNameNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IConstantNode* pIConstantNode = dynamic_cast(pIBaseClass); - if (!pIConstantNode) + std::string sScalarOutputName(""); + IFunctionGradientNode* pIFunctionGradientNode = dynamic_cast(pIBaseClass); + if (!pIFunctionGradientNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pValue = pIConstantNode->GetConstant(); + bool isCacheCall = (pScalarOutputNameBuffer == nullptr); + if (isCacheCall) { + sScalarOutputName = pIFunctionGradientNode->GetScalarOutputName(); + pIFunctionGradientNode->_setCache (new ParameterCache_1 (sScalarOutputName)); + } + else { + auto cache = dynamic_cast*> (pIFunctionGradientNode->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sScalarOutputName); + pIFunctionGradientNode->_setCache (nullptr); + } + + if (pScalarOutputNameNeededChars) + *pScalarOutputNameNeededChars = (Lib3MF_uint32) (sScalarOutputName.size()+1); + if (pScalarOutputNameBuffer) { + if (sScalarOutputName.size() >= nScalarOutputNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iScalarOutputName = 0; iScalarOutputName < sScalarOutputName.size(); iScalarOutputName++) + pScalarOutputNameBuffer[iScalarOutputName] = sScalarOutputName[iScalarOutputName]; + pScalarOutputNameBuffer[sScalarOutputName.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addDoubleResult("Value", *pValue); + pJournalEntry->addStringResult("ScalarOutputName", sScalarOutputName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13677,27 +15085,26 @@ Lib3MFResult lib3mf_constantnode_getconstant(Lib3MF_ConstantNode pConstantNode, } } -Lib3MFResult lib3mf_constantnode_getoutputvalue(Lib3MF_ConstantNode pConstantNode, Lib3MF_ImplicitPort * pValue) +Lib3MFResult lib3mf_functiongradientnode_setvectorinputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const char * pVectorInputName) { - IBase* pIBaseClass = (IBase *)pConstantNode; + IBase* pIBaseClass = (IBase *)pFunctionGradientNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pConstantNode, "ConstantNode", "GetOutputValue"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionGradientNode, "FunctionGradientNode", "SetVectorInputName"); + pJournalEntry->addStringParameter("VectorInputName", pVectorInputName); } - if (pValue == nullptr) + if (pVectorInputName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseValue(nullptr); - IConstantNode* pIConstantNode = dynamic_cast(pIBaseClass); - if (!pIConstantNode) + std::string sVectorInputName(pVectorInputName); + IFunctionGradientNode* pIFunctionGradientNode = dynamic_cast(pIBaseClass); + if (!pIFunctionGradientNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseValue = pIConstantNode->GetOutputValue(); + pIFunctionGradientNode->SetVectorInputName(sVectorInputName); - *pValue = (IBase*)(pBaseValue); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Value", *pValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13713,26 +15120,47 @@ Lib3MFResult lib3mf_constantnode_getoutputvalue(Lib3MF_ConstantNode pConstantNod } } - -/************************************************************************************************************************* - Class implementation for ConstVecNode -**************************************************************************************************************************/ -Lib3MFResult lib3mf_constvecnode_setvector(Lib3MF_ConstVecNode pConstVecNode, const sLib3MFVector * pValue) +Lib3MFResult lib3mf_functiongradientnode_getvectorinputname(Lib3MF_FunctionGradientNode pFunctionGradientNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer) { - IBase* pIBaseClass = (IBase *)pConstVecNode; + IBase* pIBaseClass = (IBase *)pFunctionGradientNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pConstVecNode, "ConstVecNode", "SetVector"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionGradientNode, "FunctionGradientNode", "GetVectorInputName"); } - IConstVecNode* pIConstVecNode = dynamic_cast(pIBaseClass); - if (!pIConstVecNode) + if ( (!pVectorInputNameBuffer) && !(pVectorInputNameNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sVectorInputName(""); + IFunctionGradientNode* pIFunctionGradientNode = dynamic_cast(pIBaseClass); + if (!pIFunctionGradientNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIConstVecNode->SetVector(*pValue); + bool isCacheCall = (pVectorInputNameBuffer == nullptr); + if (isCacheCall) { + sVectorInputName = pIFunctionGradientNode->GetVectorInputName(); + pIFunctionGradientNode->_setCache (new ParameterCache_1 (sVectorInputName)); + } + else { + auto cache = dynamic_cast*> (pIFunctionGradientNode->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sVectorInputName); + pIFunctionGradientNode->_setCache (nullptr); + } + + if (pVectorInputNameNeededChars) + *pVectorInputNameNeededChars = (Lib3MF_uint32) (sVectorInputName.size()+1); + if (pVectorInputNameBuffer) { + if (sVectorInputName.size() >= nVectorInputNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iVectorInputName = 0; iVectorInputName < sVectorInputName.size(); iVectorInputName++) + pVectorInputNameBuffer[iVectorInputName] = sVectorInputName[iVectorInputName]; + pVectorInputNameBuffer[sVectorInputName.size()] = 0; + } if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("VectorInputName", sVectorInputName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13748,24 +15176,27 @@ Lib3MFResult lib3mf_constvecnode_setvector(Lib3MF_ConstVecNode pConstVecNode, co } } -Lib3MFResult lib3mf_constvecnode_getvector(Lib3MF_ConstVecNode pConstVecNode, sLib3MFVector * pValue) +Lib3MFResult lib3mf_functiongradientnode_getoutputnormalizedgradient(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pNormalizedGradient) { - IBase* pIBaseClass = (IBase *)pConstVecNode; + IBase* pIBaseClass = (IBase *)pFunctionGradientNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pConstVecNode, "ConstVecNode", "GetVector"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionGradientNode, "FunctionGradientNode", "GetOutputNormalizedGradient"); } - if (pValue == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IConstVecNode* pIConstVecNode = dynamic_cast(pIBaseClass); - if (!pIConstVecNode) + if (pNormalizedGradient == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseNormalizedGradient(nullptr); + IFunctionGradientNode* pIFunctionGradientNode = dynamic_cast(pIBaseClass); + if (!pIFunctionGradientNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pValue = pIConstVecNode->GetVector(); + pBaseNormalizedGradient = pIFunctionGradientNode->GetOutputNormalizedGradient(); + *pNormalizedGradient = (IBase*)(pBaseNormalizedGradient); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("NormalizedGradient", *pNormalizedGradient); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13781,27 +15212,27 @@ Lib3MFResult lib3mf_constvecnode_getvector(Lib3MF_ConstVecNode pConstVecNode, sL } } -Lib3MFResult lib3mf_constvecnode_getoutputvector(Lib3MF_ConstVecNode pConstVecNode, Lib3MF_ImplicitPort * pVector) +Lib3MFResult lib3mf_functiongradientnode_getoutputgradient(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pGradient) { - IBase* pIBaseClass = (IBase *)pConstVecNode; + IBase* pIBaseClass = (IBase *)pFunctionGradientNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pConstVecNode, "ConstVecNode", "GetOutputVector"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionGradientNode, "FunctionGradientNode", "GetOutputGradient"); } - if (pVector == nullptr) + if (pGradient == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseVector(nullptr); - IConstVecNode* pIConstVecNode = dynamic_cast(pIBaseClass); - if (!pIConstVecNode) + IBase* pBaseGradient(nullptr); + IFunctionGradientNode* pIFunctionGradientNode = dynamic_cast(pIBaseClass); + if (!pIFunctionGradientNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseVector = pIConstVecNode->GetOutputVector(); + pBaseGradient = pIFunctionGradientNode->GetOutputGradient(); - *pVector = (IBase*)(pBaseVector); + *pGradient = (IBase*)(pBaseGradient); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Vector", *pVector); + pJournalEntry->addHandleResult("Gradient", *pGradient); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13817,26 +15248,27 @@ Lib3MFResult lib3mf_constvecnode_getoutputvector(Lib3MF_ConstVecNode pConstVecNo } } - -/************************************************************************************************************************* - Class implementation for ConstMatNode -**************************************************************************************************************************/ -Lib3MFResult lib3mf_constmatnode_setmatrix(Lib3MF_ConstMatNode pConstMatNode, const sLib3MFMatrix4x4 * pValue) +Lib3MFResult lib3mf_functiongradientnode_getoutputmagnitude(Lib3MF_FunctionGradientNode pFunctionGradientNode, Lib3MF_ImplicitPort * pMagnitude) { - IBase* pIBaseClass = (IBase *)pConstMatNode; + IBase* pIBaseClass = (IBase *)pFunctionGradientNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pConstMatNode, "ConstMatNode", "SetMatrix"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pFunctionGradientNode, "FunctionGradientNode", "GetOutputMagnitude"); } - IConstMatNode* pIConstMatNode = dynamic_cast(pIBaseClass); - if (!pIConstMatNode) + if (pMagnitude == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseMagnitude(nullptr); + IFunctionGradientNode* pIFunctionGradientNode = dynamic_cast(pIBaseClass); + if (!pIFunctionGradientNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIConstMatNode->SetMatrix(*pValue); + pBaseMagnitude = pIFunctionGradientNode->GetOutputMagnitude(); + *pMagnitude = (IBase*)(pBaseMagnitude); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Magnitude", *pMagnitude); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13852,24 +15284,31 @@ Lib3MFResult lib3mf_constmatnode_setmatrix(Lib3MF_ConstMatNode pConstMatNode, co } } -Lib3MFResult lib3mf_constmatnode_getmatrix(Lib3MF_ConstMatNode pConstMatNode, sLib3MFMatrix4x4 * pValue) + +/************************************************************************************************************************* + Class implementation for NormalizeDistanceNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_normalizedistancenode_getinputfunctionid(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pFunction) { - IBase* pIBaseClass = (IBase *)pConstMatNode; + IBase* pIBaseClass = (IBase *)pNormalizeDistanceNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pConstMatNode, "ConstMatNode", "GetMatrix"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pNormalizeDistanceNode, "NormalizeDistanceNode", "GetInputFunctionID"); } - if (pValue == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IConstMatNode* pIConstMatNode = dynamic_cast(pIBaseClass); - if (!pIConstMatNode) + if (pFunction == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseFunction(nullptr); + INormalizeDistanceNode* pINormalizeDistanceNode = dynamic_cast(pIBaseClass); + if (!pINormalizeDistanceNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pValue = pIConstMatNode->GetMatrix(); + pBaseFunction = pINormalizeDistanceNode->GetInputFunctionID(); + *pFunction = (IBase*)(pBaseFunction); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Function", *pFunction); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13885,27 +15324,27 @@ Lib3MFResult lib3mf_constmatnode_getmatrix(Lib3MF_ConstMatNode pConstMatNode, sL } } -Lib3MFResult lib3mf_constmatnode_getoutputmatrix(Lib3MF_ConstMatNode pConstMatNode, Lib3MF_ImplicitPort * pMatrix) +Lib3MFResult lib3mf_normalizedistancenode_getinputpos(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pPos) { - IBase* pIBaseClass = (IBase *)pConstMatNode; + IBase* pIBaseClass = (IBase *)pNormalizeDistanceNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pConstMatNode, "ConstMatNode", "GetOutputMatrix"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pNormalizeDistanceNode, "NormalizeDistanceNode", "GetInputPos"); } - if (pMatrix == nullptr) + if (pPos == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseMatrix(nullptr); - IConstMatNode* pIConstMatNode = dynamic_cast(pIBaseClass); - if (!pIConstMatNode) + IBase* pBasePos(nullptr); + INormalizeDistanceNode* pINormalizeDistanceNode = dynamic_cast(pIBaseClass); + if (!pINormalizeDistanceNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseMatrix = pIConstMatNode->GetOutputMatrix(); + pBasePos = pINormalizeDistanceNode->GetInputPos(); - *pMatrix = (IBase*)(pBaseMatrix); + *pPos = (IBase*)(pBasePos); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Matrix", *pMatrix); + pJournalEntry->addHandleResult("Pos", *pPos); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13921,31 +15360,27 @@ Lib3MFResult lib3mf_constmatnode_getoutputmatrix(Lib3MF_ConstMatNode pConstMatNo } } - -/************************************************************************************************************************* - Class implementation for MeshNode -**************************************************************************************************************************/ -Lib3MFResult lib3mf_meshnode_getinputmesh(Lib3MF_MeshNode pMeshNode, Lib3MF_ImplicitPort * pMesh) +Lib3MFResult lib3mf_normalizedistancenode_getinputstep(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pStep) { - IBase* pIBaseClass = (IBase *)pMeshNode; + IBase* pIBaseClass = (IBase *)pNormalizeDistanceNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshNode, "MeshNode", "GetInputMesh"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pNormalizeDistanceNode, "NormalizeDistanceNode", "GetInputStep"); } - if (pMesh == nullptr) + if (pStep == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseMesh(nullptr); - IMeshNode* pIMeshNode = dynamic_cast(pIBaseClass); - if (!pIMeshNode) + IBase* pBaseStep(nullptr); + INormalizeDistanceNode* pINormalizeDistanceNode = dynamic_cast(pIBaseClass); + if (!pINormalizeDistanceNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseMesh = pIMeshNode->GetInputMesh(); + pBaseStep = pINormalizeDistanceNode->GetInputStep(); - *pMesh = (IBase*)(pBaseMesh); + *pStep = (IBase*)(pBaseStep); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Mesh", *pMesh); + pJournalEntry->addHandleResult("Step", *pStep); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13961,27 +15396,26 @@ Lib3MFResult lib3mf_meshnode_getinputmesh(Lib3MF_MeshNode pMeshNode, Lib3MF_Impl } } -Lib3MFResult lib3mf_meshnode_getinputpos(Lib3MF_MeshNode pMeshNode, Lib3MF_ImplicitPort * pPos) +Lib3MFResult lib3mf_normalizedistancenode_setscalaroutputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pScalarOutputName) { - IBase* pIBaseClass = (IBase *)pMeshNode; + IBase* pIBaseClass = (IBase *)pNormalizeDistanceNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshNode, "MeshNode", "GetInputPos"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pNormalizeDistanceNode, "NormalizeDistanceNode", "SetScalarOutputName"); + pJournalEntry->addStringParameter("ScalarOutputName", pScalarOutputName); } - if (pPos == nullptr) + if (pScalarOutputName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBasePos(nullptr); - IMeshNode* pIMeshNode = dynamic_cast(pIBaseClass); - if (!pIMeshNode) + std::string sScalarOutputName(pScalarOutputName); + INormalizeDistanceNode* pINormalizeDistanceNode = dynamic_cast(pIBaseClass); + if (!pINormalizeDistanceNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBasePos = pIMeshNode->GetInputPos(); + pINormalizeDistanceNode->SetScalarOutputName(sScalarOutputName); - *pPos = (IBase*)(pBasePos); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Pos", *pPos); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -13997,27 +15431,47 @@ Lib3MFResult lib3mf_meshnode_getinputpos(Lib3MF_MeshNode pMeshNode, Lib3MF_Impli } } -Lib3MFResult lib3mf_meshnode_getoutputdistance(Lib3MF_MeshNode pMeshNode, Lib3MF_ImplicitPort * pDistance) +Lib3MFResult lib3mf_normalizedistancenode_getscalaroutputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nScalarOutputNameBufferSize, Lib3MF_uint32* pScalarOutputNameNeededChars, char * pScalarOutputNameBuffer) { - IBase* pIBaseClass = (IBase *)pMeshNode; + IBase* pIBaseClass = (IBase *)pNormalizeDistanceNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshNode, "MeshNode", "GetOutputDistance"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pNormalizeDistanceNode, "NormalizeDistanceNode", "GetScalarOutputName"); } - if (pDistance == nullptr) + if ( (!pScalarOutputNameBuffer) && !(pScalarOutputNameNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseDistance(nullptr); - IMeshNode* pIMeshNode = dynamic_cast(pIBaseClass); - if (!pIMeshNode) + std::string sScalarOutputName(""); + INormalizeDistanceNode* pINormalizeDistanceNode = dynamic_cast(pIBaseClass); + if (!pINormalizeDistanceNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseDistance = pIMeshNode->GetOutputDistance(); + bool isCacheCall = (pScalarOutputNameBuffer == nullptr); + if (isCacheCall) { + sScalarOutputName = pINormalizeDistanceNode->GetScalarOutputName(); - *pDistance = (IBase*)(pBaseDistance); + pINormalizeDistanceNode->_setCache (new ParameterCache_1 (sScalarOutputName)); + } + else { + auto cache = dynamic_cast*> (pINormalizeDistanceNode->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sScalarOutputName); + pINormalizeDistanceNode->_setCache (nullptr); + } + + if (pScalarOutputNameNeededChars) + *pScalarOutputNameNeededChars = (Lib3MF_uint32) (sScalarOutputName.size()+1); + if (pScalarOutputNameBuffer) { + if (sScalarOutputName.size() >= nScalarOutputNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iScalarOutputName = 0; iScalarOutputName < sScalarOutputName.size(); iScalarOutputName++) + pScalarOutputNameBuffer[iScalarOutputName] = sScalarOutputName[iScalarOutputName]; + pScalarOutputNameBuffer[sScalarOutputName.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Distance", *pDistance); + pJournalEntry->addStringResult("ScalarOutputName", sScalarOutputName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -14033,31 +15487,26 @@ Lib3MFResult lib3mf_meshnode_getoutputdistance(Lib3MF_MeshNode pMeshNode, Lib3MF } } - -/************************************************************************************************************************* - Class implementation for UnsignedMeshNode -**************************************************************************************************************************/ -Lib3MFResult lib3mf_unsignedmeshnode_getinputmesh(Lib3MF_UnsignedMeshNode pUnsignedMeshNode, Lib3MF_ImplicitPort * pMesh) +Lib3MFResult lib3mf_normalizedistancenode_setvectorinputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const char * pVectorInputName) { - IBase* pIBaseClass = (IBase *)pUnsignedMeshNode; + IBase* pIBaseClass = (IBase *)pNormalizeDistanceNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pUnsignedMeshNode, "UnsignedMeshNode", "GetInputMesh"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pNormalizeDistanceNode, "NormalizeDistanceNode", "SetVectorInputName"); + pJournalEntry->addStringParameter("VectorInputName", pVectorInputName); } - if (pMesh == nullptr) + if (pVectorInputName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseMesh(nullptr); - IUnsignedMeshNode* pIUnsignedMeshNode = dynamic_cast(pIBaseClass); - if (!pIUnsignedMeshNode) + std::string sVectorInputName(pVectorInputName); + INormalizeDistanceNode* pINormalizeDistanceNode = dynamic_cast(pIBaseClass); + if (!pINormalizeDistanceNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseMesh = pIUnsignedMeshNode->GetInputMesh(); + pINormalizeDistanceNode->SetVectorInputName(sVectorInputName); - *pMesh = (IBase*)(pBaseMesh); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Mesh", *pMesh); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -14073,27 +15522,47 @@ Lib3MFResult lib3mf_unsignedmeshnode_getinputmesh(Lib3MF_UnsignedMeshNode pUnsig } } -Lib3MFResult lib3mf_unsignedmeshnode_getinputpos(Lib3MF_UnsignedMeshNode pUnsignedMeshNode, Lib3MF_ImplicitPort * pPos) +Lib3MFResult lib3mf_normalizedistancenode_getvectorinputname(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, const Lib3MF_uint32 nVectorInputNameBufferSize, Lib3MF_uint32* pVectorInputNameNeededChars, char * pVectorInputNameBuffer) { - IBase* pIBaseClass = (IBase *)pUnsignedMeshNode; + IBase* pIBaseClass = (IBase *)pNormalizeDistanceNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pUnsignedMeshNode, "UnsignedMeshNode", "GetInputPos"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pNormalizeDistanceNode, "NormalizeDistanceNode", "GetVectorInputName"); } - if (pPos == nullptr) + if ( (!pVectorInputNameBuffer) && !(pVectorInputNameNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBasePos(nullptr); - IUnsignedMeshNode* pIUnsignedMeshNode = dynamic_cast(pIBaseClass); - if (!pIUnsignedMeshNode) + std::string sVectorInputName(""); + INormalizeDistanceNode* pINormalizeDistanceNode = dynamic_cast(pIBaseClass); + if (!pINormalizeDistanceNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBasePos = pIUnsignedMeshNode->GetInputPos(); + bool isCacheCall = (pVectorInputNameBuffer == nullptr); + if (isCacheCall) { + sVectorInputName = pINormalizeDistanceNode->GetVectorInputName(); - *pPos = (IBase*)(pBasePos); + pINormalizeDistanceNode->_setCache (new ParameterCache_1 (sVectorInputName)); + } + else { + auto cache = dynamic_cast*> (pINormalizeDistanceNode->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sVectorInputName); + pINormalizeDistanceNode->_setCache (nullptr); + } + + if (pVectorInputNameNeededChars) + *pVectorInputNameNeededChars = (Lib3MF_uint32) (sVectorInputName.size()+1); + if (pVectorInputNameBuffer) { + if (sVectorInputName.size() >= nVectorInputNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iVectorInputName = 0; iVectorInputName < sVectorInputName.size(); iVectorInputName++) + pVectorInputNameBuffer[iVectorInputName] = sVectorInputName[iVectorInputName]; + pVectorInputNameBuffer[sVectorInputName.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Pos", *pPos); + pJournalEntry->addStringResult("VectorInputName", sVectorInputName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -14109,27 +15578,27 @@ Lib3MFResult lib3mf_unsignedmeshnode_getinputpos(Lib3MF_UnsignedMeshNode pUnsign } } -Lib3MFResult lib3mf_unsignedmeshnode_getoutputdistance(Lib3MF_UnsignedMeshNode pUnsignedMeshNode, Lib3MF_ImplicitPort * pDistance) +Lib3MFResult lib3mf_normalizedistancenode_getoutputresult(Lib3MF_NormalizeDistanceNode pNormalizeDistanceNode, Lib3MF_ImplicitPort * pResult) { - IBase* pIBaseClass = (IBase *)pUnsignedMeshNode; + IBase* pIBaseClass = (IBase *)pNormalizeDistanceNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pUnsignedMeshNode, "UnsignedMeshNode", "GetOutputDistance"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pNormalizeDistanceNode, "NormalizeDistanceNode", "GetOutputResult"); } - if (pDistance == nullptr) + if (pResult == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseDistance(nullptr); - IUnsignedMeshNode* pIUnsignedMeshNode = dynamic_cast(pIBaseClass); - if (!pIUnsignedMeshNode) + IBase* pBaseResult(nullptr); + INormalizeDistanceNode* pINormalizeDistanceNode = dynamic_cast(pIBaseClass); + if (!pINormalizeDistanceNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseDistance = pIUnsignedMeshNode->GetOutputDistance(); + pBaseResult = pINormalizeDistanceNode->GetOutputResult(); - *pDistance = (IBase*)(pBaseDistance); + *pResult = (IBase*)(pBaseResult); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Distance", *pDistance); + pJournalEntry->addHandleResult("Result", *pResult); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -17116,6 +18585,150 @@ Lib3MFResult lib3mf_implicitfunction_addunsignedmeshnode(Lib3MF_ImplicitFunction } } +Lib3MFResult lib3mf_implicitfunction_addbeamlatticenode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_BeamLatticeNode * pNode) +{ + IBase* pIBaseClass = (IBase *)pImplicitFunction; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitFunction, "ImplicitFunction", "AddBeamLatticeNode"); + pJournalEntry->addStringParameter("Identifier", pIdentifier); + pJournalEntry->addStringParameter("DisplayName", pDisplayName); + pJournalEntry->addStringParameter("Tag", pTag); + } + if (pIdentifier == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pDisplayName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pTag == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pNode == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sIdentifier(pIdentifier); + std::string sDisplayName(pDisplayName); + std::string sTag(pTag); + IBase* pBaseNode(nullptr); + IImplicitFunction* pIImplicitFunction = dynamic_cast(pIBaseClass); + if (!pIImplicitFunction) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseNode = pIImplicitFunction->AddBeamLatticeNode(sIdentifier, sDisplayName, sTag); + + *pNode = (IBase*)(pBaseNode); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Node", *pNode); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_implicitfunction_addfunctiongradientnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_FunctionGradientNode * pNode) +{ + IBase* pIBaseClass = (IBase *)pImplicitFunction; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitFunction, "ImplicitFunction", "AddFunctionGradientNode"); + pJournalEntry->addStringParameter("Identifier", pIdentifier); + pJournalEntry->addStringParameter("DisplayName", pDisplayName); + pJournalEntry->addStringParameter("Tag", pTag); + } + if (pIdentifier == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pDisplayName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pTag == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pNode == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sIdentifier(pIdentifier); + std::string sDisplayName(pDisplayName); + std::string sTag(pTag); + IBase* pBaseNode(nullptr); + IImplicitFunction* pIImplicitFunction = dynamic_cast(pIBaseClass); + if (!pIImplicitFunction) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseNode = pIImplicitFunction->AddFunctionGradientNode(sIdentifier, sDisplayName, sTag); + + *pNode = (IBase*)(pBaseNode); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Node", *pNode); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_implicitfunction_addnormalizedistancenode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_NormalizeDistanceNode * pNode) +{ + IBase* pIBaseClass = (IBase *)pImplicitFunction; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pImplicitFunction, "ImplicitFunction", "AddNormalizeDistanceNode"); + pJournalEntry->addStringParameter("Identifier", pIdentifier); + pJournalEntry->addStringParameter("DisplayName", pDisplayName); + pJournalEntry->addStringParameter("Tag", pTag); + } + if (pIdentifier == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pDisplayName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pTag == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pNode == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sIdentifier(pIdentifier); + std::string sDisplayName(pDisplayName); + std::string sTag(pTag); + IBase* pBaseNode(nullptr); + IImplicitFunction* pIImplicitFunction = dynamic_cast(pIBaseClass); + if (!pIImplicitFunction) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseNode = pIImplicitFunction->AddNormalizeDistanceNode(sIdentifier, sDisplayName, sTag); + + *pNode = (IBase*)(pBaseNode); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Node", *pNode); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + Lib3MFResult lib3mf_implicitfunction_addfunctioncallnode(Lib3MF_ImplicitFunction pImplicitFunction, const char * pIdentifier, const char * pDisplayName, const char * pTag, Lib3MF_FunctionCallNode * pNode) { IBase* pIBaseClass = (IBase *)pImplicitFunction; @@ -21283,6 +22896,43 @@ Lib3MFResult lib3mf_model_getcomponentsobjectbyid(Lib3MF_Model pModel, Lib3MF_ui } } +Lib3MFResult lib3mf_model_getbooleanobjectbyid(Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_BooleanObject * pBooleanObjectInstance) +{ + IBase* pIBaseClass = (IBase *)pModel; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pModel, "Model", "GetBooleanObjectByID"); + pJournalEntry->addUInt32Parameter("UniqueResourceID", nUniqueResourceID); + } + if (pBooleanObjectInstance == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseBooleanObjectInstance(nullptr); + IModel* pIModel = dynamic_cast(pIBaseClass); + if (!pIModel) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseBooleanObjectInstance = pIModel->GetBooleanObjectByID(nUniqueResourceID); + + *pBooleanObjectInstance = (IBase*)(pBaseBooleanObjectInstance); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("BooleanObjectInstance", *pBooleanObjectInstance); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + Lib3MFResult lib3mf_model_getcolorgroupbyid(Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_ColorGroup * pColorGroupInstance) { IBase* pIBaseClass = (IBase *)pModel; @@ -21701,6 +23351,42 @@ Lib3MFResult lib3mf_model_getcomponentsobjects(Lib3MF_Model pModel, Lib3MF_Compo } } +Lib3MFResult lib3mf_model_getbooleanobjects(Lib3MF_Model pModel, Lib3MF_BooleanObjectIterator * pResourceIterator) +{ + IBase* pIBaseClass = (IBase *)pModel; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pModel, "Model", "GetBooleanObjects"); + } + if (pResourceIterator == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseResourceIterator(nullptr); + IModel* pIModel = dynamic_cast(pIBaseClass); + if (!pIModel) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseResourceIterator = pIModel->GetBooleanObjects(); + + *pResourceIterator = (IBase*)(pBaseResourceIterator); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("ResourceIterator", *pResourceIterator); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + Lib3MFResult lib3mf_model_gettexture2ds(Lib3MF_Model pModel, Lib3MF_Texture2DIterator * pResourceIterator) { IBase* pIBaseClass = (IBase *)pModel; @@ -22134,6 +23820,42 @@ Lib3MFResult lib3mf_model_addcomponentsobject(Lib3MF_Model pModel, Lib3MF_Compon } } +Lib3MFResult lib3mf_model_addbooleanobject(Lib3MF_Model pModel, Lib3MF_BooleanObject * pBooleanObjectInstance) +{ + IBase* pIBaseClass = (IBase *)pModel; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pModel, "Model", "AddBooleanObject"); + } + if (pBooleanObjectInstance == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseBooleanObjectInstance(nullptr); + IModel* pIModel = dynamic_cast(pIBaseClass); + if (!pIModel) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseBooleanObjectInstance = pIModel->AddBooleanObject(); + + *pBooleanObjectInstance = (IBase*)(pBaseBooleanObjectInstance); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("BooleanObjectInstance", *pBooleanObjectInstance); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + Lib3MFResult lib3mf_model_addslicestack(Lib3MF_Model pModel, Lib3MF_double dZBottom, Lib3MF_SliceStack * pSliceStackInstance) { IBase* pIBaseClass = (IBase *)pModel; @@ -23425,6 +25147,8 @@ Lib3MFResult Lib3MF::Impl::Lib3MF_GetProcAddress (const char * pProcName, void * *ppProcAddress = (void*) &lib3mf_meshobjectiterator_getcurrentmeshobject; if (sProcName == "lib3mf_componentsobjectiterator_getcurrentcomponentsobject") *ppProcAddress = (void*) &lib3mf_componentsobjectiterator_getcurrentcomponentsobject; + if (sProcName == "lib3mf_booleanobjectiterator_getcurrentbooleanobject") + *ppProcAddress = (void*) &lib3mf_booleanobjectiterator_getcurrentbooleanobject; if (sProcName == "lib3mf_texture2diterator_getcurrenttexture2d") *ppProcAddress = (void*) &lib3mf_texture2diterator_getcurrenttexture2d; if (sProcName == "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup") @@ -23521,6 +25245,8 @@ Lib3MFResult Lib3MF::Impl::Lib3MF_GetProcAddress (const char * pProcName, void * *ppProcAddress = (void*) &lib3mf_object_iscomponentsobject; if (sProcName == "lib3mf_object_islevelsetobject") *ppProcAddress = (void*) &lib3mf_object_islevelsetobject; + if (sProcName == "lib3mf_object_isbooleanobject") + *ppProcAddress = (void*) &lib3mf_object_isbooleanobject; if (sProcName == "lib3mf_object_isvalid") *ppProcAddress = (void*) &lib3mf_object_isvalid; if (sProcName == "lib3mf_object_setattachmentasthumbnail") @@ -23635,6 +25361,34 @@ Lib3MFResult Lib3MF::Impl::Lib3MF_GetProcAddress (const char * pProcName, void * *ppProcAddress = (void*) &lib3mf_levelset_getvolumedata; if (sProcName == "lib3mf_levelset_setvolumedata") *ppProcAddress = (void*) &lib3mf_levelset_setvolumedata; + if (sProcName == "lib3mf_booleanobject_setbaseobject") + *ppProcAddress = (void*) &lib3mf_booleanobject_setbaseobject; + if (sProcName == "lib3mf_booleanobject_getbaseobject") + *ppProcAddress = (void*) &lib3mf_booleanobject_getbaseobject; + if (sProcName == "lib3mf_booleanobject_setbasetransform") + *ppProcAddress = (void*) &lib3mf_booleanobject_setbasetransform; + if (sProcName == "lib3mf_booleanobject_getbasetransform") + *ppProcAddress = (void*) &lib3mf_booleanobject_getbasetransform; + if (sProcName == "lib3mf_booleanobject_setoperation") + *ppProcAddress = (void*) &lib3mf_booleanobject_setoperation; + if (sProcName == "lib3mf_booleanobject_getoperation") + *ppProcAddress = (void*) &lib3mf_booleanobject_getoperation; + if (sProcName == "lib3mf_booleanobject_setcsgmodeenabled") + *ppProcAddress = (void*) &lib3mf_booleanobject_setcsgmodeenabled; + if (sProcName == "lib3mf_booleanobject_getcsgmodeenabled") + *ppProcAddress = (void*) &lib3mf_booleanobject_getcsgmodeenabled; + if (sProcName == "lib3mf_booleanobject_setextractiongridresolution") + *ppProcAddress = (void*) &lib3mf_booleanobject_setextractiongridresolution; + if (sProcName == "lib3mf_booleanobject_getextractiongridresolution") + *ppProcAddress = (void*) &lib3mf_booleanobject_getextractiongridresolution; + if (sProcName == "lib3mf_booleanobject_getoperandcount") + *ppProcAddress = (void*) &lib3mf_booleanobject_getoperandcount; + if (sProcName == "lib3mf_booleanobject_addoperand") + *ppProcAddress = (void*) &lib3mf_booleanobject_addoperand; + if (sProcName == "lib3mf_booleanobject_getoperand") + *ppProcAddress = (void*) &lib3mf_booleanobject_getoperand; + if (sProcName == "lib3mf_booleanobject_mergetomeshobject") + *ppProcAddress = (void*) &lib3mf_booleanobject_mergetomeshobject; if (sProcName == "lib3mf_beamlattice_getminlength") *ppProcAddress = (void*) &lib3mf_beamlattice_getminlength; if (sProcName == "lib3mf_beamlattice_setminlength") @@ -24089,6 +25843,52 @@ Lib3MFResult Lib3MF::Impl::Lib3MF_GetProcAddress (const char * pProcName, void * *ppProcAddress = (void*) &lib3mf_unsignedmeshnode_getinputpos; if (sProcName == "lib3mf_unsignedmeshnode_getoutputdistance") *ppProcAddress = (void*) &lib3mf_unsignedmeshnode_getoutputdistance; + if (sProcName == "lib3mf_beamlatticenode_getinputbeamlattice") + *ppProcAddress = (void*) &lib3mf_beamlatticenode_getinputbeamlattice; + if (sProcName == "lib3mf_beamlatticenode_getinputpos") + *ppProcAddress = (void*) &lib3mf_beamlatticenode_getinputpos; + if (sProcName == "lib3mf_beamlatticenode_getoutputdistance") + *ppProcAddress = (void*) &lib3mf_beamlatticenode_getoutputdistance; + if (sProcName == "lib3mf_beamlatticenode_setaccuraterange") + *ppProcAddress = (void*) &lib3mf_beamlatticenode_setaccuraterange; + if (sProcName == "lib3mf_beamlatticenode_getaccuraterange") + *ppProcAddress = (void*) &lib3mf_beamlatticenode_getaccuraterange; + if (sProcName == "lib3mf_functiongradientnode_getinputfunctionid") + *ppProcAddress = (void*) &lib3mf_functiongradientnode_getinputfunctionid; + if (sProcName == "lib3mf_functiongradientnode_getinputpos") + *ppProcAddress = (void*) &lib3mf_functiongradientnode_getinputpos; + if (sProcName == "lib3mf_functiongradientnode_getinputstep") + *ppProcAddress = (void*) &lib3mf_functiongradientnode_getinputstep; + if (sProcName == "lib3mf_functiongradientnode_setscalaroutputname") + *ppProcAddress = (void*) &lib3mf_functiongradientnode_setscalaroutputname; + if (sProcName == "lib3mf_functiongradientnode_getscalaroutputname") + *ppProcAddress = (void*) &lib3mf_functiongradientnode_getscalaroutputname; + if (sProcName == "lib3mf_functiongradientnode_setvectorinputname") + *ppProcAddress = (void*) &lib3mf_functiongradientnode_setvectorinputname; + if (sProcName == "lib3mf_functiongradientnode_getvectorinputname") + *ppProcAddress = (void*) &lib3mf_functiongradientnode_getvectorinputname; + if (sProcName == "lib3mf_functiongradientnode_getoutputnormalizedgradient") + *ppProcAddress = (void*) &lib3mf_functiongradientnode_getoutputnormalizedgradient; + if (sProcName == "lib3mf_functiongradientnode_getoutputgradient") + *ppProcAddress = (void*) &lib3mf_functiongradientnode_getoutputgradient; + if (sProcName == "lib3mf_functiongradientnode_getoutputmagnitude") + *ppProcAddress = (void*) &lib3mf_functiongradientnode_getoutputmagnitude; + if (sProcName == "lib3mf_normalizedistancenode_getinputfunctionid") + *ppProcAddress = (void*) &lib3mf_normalizedistancenode_getinputfunctionid; + if (sProcName == "lib3mf_normalizedistancenode_getinputpos") + *ppProcAddress = (void*) &lib3mf_normalizedistancenode_getinputpos; + if (sProcName == "lib3mf_normalizedistancenode_getinputstep") + *ppProcAddress = (void*) &lib3mf_normalizedistancenode_getinputstep; + if (sProcName == "lib3mf_normalizedistancenode_setscalaroutputname") + *ppProcAddress = (void*) &lib3mf_normalizedistancenode_setscalaroutputname; + if (sProcName == "lib3mf_normalizedistancenode_getscalaroutputname") + *ppProcAddress = (void*) &lib3mf_normalizedistancenode_getscalaroutputname; + if (sProcName == "lib3mf_normalizedistancenode_setvectorinputname") + *ppProcAddress = (void*) &lib3mf_normalizedistancenode_setvectorinputname; + if (sProcName == "lib3mf_normalizedistancenode_getvectorinputname") + *ppProcAddress = (void*) &lib3mf_normalizedistancenode_getvectorinputname; + if (sProcName == "lib3mf_normalizedistancenode_getoutputresult") + *ppProcAddress = (void*) &lib3mf_normalizedistancenode_getoutputresult; if (sProcName == "lib3mf_functioncallnode_getinputfunctionid") *ppProcAddress = (void*) &lib3mf_functioncallnode_getinputfunctionid; if (sProcName == "lib3mf_nodeiterator_getcurrent") @@ -24215,6 +26015,12 @@ Lib3MFResult Lib3MF::Impl::Lib3MF_GetProcAddress (const char * pProcName, void * *ppProcAddress = (void*) &lib3mf_implicitfunction_addmeshnode; if (sProcName == "lib3mf_implicitfunction_addunsignedmeshnode") *ppProcAddress = (void*) &lib3mf_implicitfunction_addunsignedmeshnode; + if (sProcName == "lib3mf_implicitfunction_addbeamlatticenode") + *ppProcAddress = (void*) &lib3mf_implicitfunction_addbeamlatticenode; + if (sProcName == "lib3mf_implicitfunction_addfunctiongradientnode") + *ppProcAddress = (void*) &lib3mf_implicitfunction_addfunctiongradientnode; + if (sProcName == "lib3mf_implicitfunction_addnormalizedistancenode") + *ppProcAddress = (void*) &lib3mf_implicitfunction_addnormalizedistancenode; if (sProcName == "lib3mf_implicitfunction_addfunctioncallnode") *ppProcAddress = (void*) &lib3mf_implicitfunction_addfunctioncallnode; if (sProcName == "lib3mf_implicitfunction_getnodes") @@ -24433,6 +26239,8 @@ Lib3MFResult Lib3MF::Impl::Lib3MF_GetProcAddress (const char * pProcName, void * *ppProcAddress = (void*) &lib3mf_model_getmeshobjectbyid; if (sProcName == "lib3mf_model_getcomponentsobjectbyid") *ppProcAddress = (void*) &lib3mf_model_getcomponentsobjectbyid; + if (sProcName == "lib3mf_model_getbooleanobjectbyid") + *ppProcAddress = (void*) &lib3mf_model_getbooleanobjectbyid; if (sProcName == "lib3mf_model_getcolorgroupbyid") *ppProcAddress = (void*) &lib3mf_model_getcolorgroupbyid; if (sProcName == "lib3mf_model_getslicestackbyid") @@ -24455,6 +26263,8 @@ Lib3MFResult Lib3MF::Impl::Lib3MF_GetProcAddress (const char * pProcName, void * *ppProcAddress = (void*) &lib3mf_model_getmeshobjects; if (sProcName == "lib3mf_model_getcomponentsobjects") *ppProcAddress = (void*) &lib3mf_model_getcomponentsobjects; + if (sProcName == "lib3mf_model_getbooleanobjects") + *ppProcAddress = (void*) &lib3mf_model_getbooleanobjects; if (sProcName == "lib3mf_model_gettexture2ds") *ppProcAddress = (void*) &lib3mf_model_gettexture2ds; if (sProcName == "lib3mf_model_getbasematerialgroups") @@ -24479,6 +26289,8 @@ Lib3MFResult Lib3MF::Impl::Lib3MF_GetProcAddress (const char * pProcName, void * *ppProcAddress = (void*) &lib3mf_model_addmeshobject; if (sProcName == "lib3mf_model_addcomponentsobject") *ppProcAddress = (void*) &lib3mf_model_addcomponentsobject; + if (sProcName == "lib3mf_model_addbooleanobject") + *ppProcAddress = (void*) &lib3mf_model_addbooleanobject; if (sProcName == "lib3mf_model_addslicestack") *ppProcAddress = (void*) &lib3mf_model_addslicestack; if (sProcName == "lib3mf_model_addtexture2dfromattachment") diff --git a/Autogenerated/Source/lib3mf_types.hpp b/Autogenerated/Source/lib3mf_types.hpp index 6a9ff486d..09f6a3441 100644 --- a/Autogenerated/Source/lib3mf_types.hpp +++ b/Autogenerated/Source/lib3mf_types.hpp @@ -24,12 +24,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-alpha. +This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.1-develop. Abstract: This is an autogenerated C++-Header file with basic types in order to allow an easy use of the 3MF Library -Interface version: 2.4.0 +Interface version: 2.6.0 */ @@ -83,7 +83,7 @@ typedef void * Lib3MF_pvoid; **************************************************************************************************************************/ #define LIB3MF_VERSION_MAJOR 2 -#define LIB3MF_VERSION_MINOR 4 +#define LIB3MF_VERSION_MINOR 6 #define LIB3MF_VERSION_MICRO 0 #define LIB3MF_VERSION_PRERELEASEINFO "" #define LIB3MF_VERSION_BUILDINFO "" @@ -219,6 +219,7 @@ typedef Lib3MFHandle Lib3MF_SliceStackIterator; typedef Lib3MFHandle Lib3MF_ObjectIterator; typedef Lib3MFHandle Lib3MF_MeshObjectIterator; typedef Lib3MFHandle Lib3MF_ComponentsObjectIterator; +typedef Lib3MFHandle Lib3MF_BooleanObjectIterator; typedef Lib3MFHandle Lib3MF_Texture2DIterator; typedef Lib3MFHandle Lib3MF_BaseMaterialGroupIterator; typedef Lib3MFHandle Lib3MF_ColorGroupIterator; @@ -234,6 +235,7 @@ typedef Lib3MFHandle Lib3MF_TriangleSet; typedef Lib3MFHandle Lib3MF_Object; typedef Lib3MFHandle Lib3MF_MeshObject; typedef Lib3MFHandle Lib3MF_LevelSet; +typedef Lib3MFHandle Lib3MF_BooleanObject; typedef Lib3MFHandle Lib3MF_BeamLattice; typedef Lib3MFHandle Lib3MF_FunctionReference; typedef Lib3MFHandle Lib3MF_VolumeDataColor; @@ -309,6 +311,9 @@ typedef Lib3MFHandle Lib3MF_ConstVecNode; typedef Lib3MFHandle Lib3MF_ConstMatNode; typedef Lib3MFHandle Lib3MF_MeshNode; typedef Lib3MFHandle Lib3MF_UnsignedMeshNode; +typedef Lib3MFHandle Lib3MF_BeamLatticeNode; +typedef Lib3MFHandle Lib3MF_FunctionGradientNode; +typedef Lib3MFHandle Lib3MF_NormalizeDistanceNode; typedef Lib3MFHandle Lib3MF_FunctionCallNode; typedef Lib3MFHandle Lib3MF_NodeIterator; typedef Lib3MFHandle Lib3MF_Function; @@ -359,7 +364,14 @@ namespace Lib3MF { Other = 0, Model = 1, Support = 2, - SolidSupport = 3 + SolidSupport = 3, + Surface = 4 + }; + + enum class eBooleanOperation : Lib3MF_int32 { + Union = 0, + Difference = 1, + Intersection = 2 }; enum class eTextureType : Lib3MF_int32 { @@ -473,11 +485,11 @@ namespace Lib3MF { MatVecMultiplication = 14, /** Multiplies a matrix with a vector */ Transpose = 15, /** Transposes a matrix */ Inverse = 16, /** Computes the inverse of a matrix */ - Sinus = 17, /** Calculates the sinus */ - Cosinus = 18, /** Calculates the cosinus */ + Sinus = 17, /** Calculates the sine */ + Cosinus = 18, /** Calculates the cosine */ Tan = 19, /** Calculates the tangent */ - ArcSin = 20, /** Calculates the arcsinus */ - ArcCos = 21, /** Calculates the arccosinus */ + ArcSin = 20, /** Calculates the arcsine */ + ArcCos = 21, /** Calculates the arccosine */ ArcTan = 22, /** Calculates the arctangent */ ArcTan2 = 23, /** Calculates the arctangent */ Min = 24, /** Calculates the minimum of two values */ @@ -487,9 +499,9 @@ namespace Lib3MF { Pow = 28, /** Calculates the power A^B */ Sqrt = 29, /** Calculates the square root */ Exp = 30, /** Exponential function */ - Log = 31, /** Natural logarithmus */ - Log2 = 32, /** Logarithmus to the base 2 */ - Log10 = 33, /** Logarithmus to the base 10 */ + Log = 31, /** Natural logarithm */ + Log2 = 32, /** Logarithm to the base 2 */ + Log10 = 33, /** Logarithm to the base 10 */ Select = 34, /** If A is less than B returns C, else D */ Clamp = 35, /** Clamps the input value to min and max */ Sinh = 36, /** Calculates the hyperbolic sine */ @@ -504,9 +516,12 @@ namespace Lib3MF { Mesh = 45, /** Calculates the signed distance to a mesh */ Length = 46, /** Calculates the length of a vector */ ConstResourceID = 47, /** Selects a resource (function, mesh etc.) */ - VectorFromScalar = 48, /** Creates a vector from one scalar values */ + VectorFromScalar = 48, /** Creates a vector from one scalar value */ UnsignedMesh = 49, /** Calculates the unsigned distance to a mesh */ - Mod = 50 /** Calculates the modulo of two values (same behaviour as glsl mod) */ + Mod = 50, /** Calculates the modulo of two values (same behaviour as glsl mod) */ + BeamLattice = 51, /** Calculates the signed distance to a beam lattice */ + FunctionGradient = 52, /** Calculates the gradient of a function */ + NormalizeDistance = 53 /** Normalizes a distance field */ }; /** @@ -715,6 +730,7 @@ typedef Lib3MF::ePropertyType eLib3MFPropertyType; typedef Lib3MF::eSlicesMeshResolution eLib3MFSlicesMeshResolution; typedef Lib3MF::eModelUnit eLib3MFModelUnit; typedef Lib3MF::eObjectType eLib3MFObjectType; +typedef Lib3MF::eBooleanOperation eLib3MFBooleanOperation; typedef Lib3MF::eTextureType eLib3MFTextureType; typedef Lib3MF::eTextureTileStyle eLib3MFTextureTileStyle; typedef Lib3MF::eTextureFilter eLib3MFTextureFilter; diff --git a/AutomaticComponentToolkit/_githash_act.txt b/AutomaticComponentToolkit/_githash_act.txt index 68935dbe4..9c4a173e1 100644 --- a/AutomaticComponentToolkit/_githash_act.txt +++ b/AutomaticComponentToolkit/_githash_act.txt @@ -1,2 +1,2 @@ -7e4f1fc0dd3523c807427b4efc0db165bdb1a936 -https://github.com/Autodesk/AutomaticComponentToolkit/releases/tag/v1.8.0-alpha \ No newline at end of file +5f800d355908a6f7156c45c69d2cb02572911b31 +https://github.com/Autodesk/AutomaticComponentToolkit/tree/refs/heads/develop \ No newline at end of file diff --git a/AutomaticComponentToolkit/act.arm.linux32 b/AutomaticComponentToolkit/act.arm.linux32 index c621583aa..bd27dfa5e 100755 Binary files a/AutomaticComponentToolkit/act.arm.linux32 and b/AutomaticComponentToolkit/act.arm.linux32 differ diff --git a/AutomaticComponentToolkit/act.arm.linux64 b/AutomaticComponentToolkit/act.arm.linux64 index bb7df5aad..0dba48f89 100755 Binary files a/AutomaticComponentToolkit/act.arm.linux64 and b/AutomaticComponentToolkit/act.arm.linux64 differ diff --git a/AutomaticComponentToolkit/act.darwin b/AutomaticComponentToolkit/act.darwin index af2fa872b..c7ee561d1 100755 Binary files a/AutomaticComponentToolkit/act.darwin and b/AutomaticComponentToolkit/act.darwin differ diff --git a/AutomaticComponentToolkit/act.linux32 b/AutomaticComponentToolkit/act.linux32 index 7f3432c37..526ae84fd 100755 Binary files a/AutomaticComponentToolkit/act.linux32 and b/AutomaticComponentToolkit/act.linux32 differ diff --git a/AutomaticComponentToolkit/act.linux64 b/AutomaticComponentToolkit/act.linux64 index 699c3fd7e..ed13c7722 100755 Binary files a/AutomaticComponentToolkit/act.linux64 and b/AutomaticComponentToolkit/act.linux64 differ diff --git a/AutomaticComponentToolkit/act.win32.exe b/AutomaticComponentToolkit/act.win32.exe index 0fb0bd78e..c9345596b 100755 Binary files a/AutomaticComponentToolkit/act.win32.exe and b/AutomaticComponentToolkit/act.win32.exe differ diff --git a/AutomaticComponentToolkit/act.win64.exe b/AutomaticComponentToolkit/act.win64.exe index 295d92769..2f4a1aa21 100755 Binary files a/AutomaticComponentToolkit/act.win64.exe and b/AutomaticComponentToolkit/act.win64.exe differ diff --git a/AutomaticComponentToolkit/generateWrapperAndBindingsLinux64.sh b/AutomaticComponentToolkit/generateWrapperAndBindingsLinux64.sh index 4b9751618..902cb4fab 100755 --- a/AutomaticComponentToolkit/generateWrapperAndBindingsLinux64.sh +++ b/AutomaticComponentToolkit/generateWrapperAndBindingsLinux64.sh @@ -1,8 +1,9 @@ #!/bin/sh ./act.linux64 lib3mf.xml -bindings ../Autogenerated/Bindings -interfaces ../Autogenerated/Source -stubs ../Source/API -suppresslicense -suppressexamples ./act.linux64 lib3mf.xml -stubs ../Include/API -suppresslicense -suppressexamples -suppressbindings -suppressinterfaces +python3 ../patch_wasm_bindings.py # remove header form ../Source/API find ../Source/API -name "*.hpp" -type f -delete # remove cpp from ../Include/API -find ../Include/API -name "*.cpp" -type f -delete \ No newline at end of file +find ../Include/API -name "*.cpp" -type f -delete diff --git a/AutomaticComponentToolkit/lib3mf.xml b/AutomaticComponentToolkit/lib3mf.xml index a1215bbac..704df7c59 100644 --- a/AutomaticComponentToolkit/lib3mf.xml +++ b/AutomaticComponentToolkit/lib3mf.xml @@ -1,5 +1,5 @@ - + @@ -33,12 +33,15 @@ - + + + + @@ -149,6 +152,13 @@ + + + + + + @@ -848,6 +866,11 @@ + + + @@ -1144,6 +1167,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1355,13 +1459,13 @@ - + - + + description="the number of VolumeDataProperty-elements within this VolumeData" /> - + - + - + @@ -1962,11 +2066,11 @@ value="14" /> + decription="the input for the m21 element" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3923,6 +4190,12 @@ + + + + @@ -3980,6 +4253,11 @@ + + + + + + @@ -4360,4 +4643,4 @@ - \ No newline at end of file + diff --git a/CI/integration_test.py b/CI/integration_test.py index dbfb7bb3f..fd619d169 100644 --- a/CI/integration_test.py +++ b/CI/integration_test.py @@ -63,6 +63,9 @@ def ExtractInfo(execCommand, fileName): root = os.path.dirname(os.path.realpath(__file__)) + if "LIB3MF_STRICT_READER" not in os.environ: + os.environ["LIB3MF_STRICT_READER"] = "1" + execCommand = os.path.join(root, "Example_ExtractInfo") print("Execute once for testing") diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e1911e52..0e0e4607d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.0) +cmake_minimum_required (VERSION 3.10) cmake_policy(SET CMP0054 NEW) cmake_policy(SET CMP0048 NEW) @@ -7,10 +7,11 @@ cmake_policy(SET CMP0048 NEW) set_property(GLOBAL PROPERTY USE_FOLDERS ON) include(GNUInstallDirs) +include(CMakePackageConfigHelpers) # Define Version set(LIB3MF_VERSION_MAJOR 2) # increase on every backward-compatibility breaking change of the API -set(LIB3MF_VERSION_MINOR 4) # increase on every backward compatible change of the API +set(LIB3MF_VERSION_MINOR 6) # increase on every backward compatible change of the API set(LIB3MF_VERSION_MICRO 0) # increase on on every change that does not alter the API set(LIB3MF_VERSION_PRERELEASE "") # denotes pre-release information of a version of lib3mf set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version") @@ -19,6 +20,11 @@ project(lib3mf DESCRIPTION "An implementation of the 3D Manufacturing Format file standard" ) +# macOS: ensure zlib includes (affects ALL targets incl. Tests) +if(APPLE) + add_compile_definitions(Z_HAVE_UNISTD_H=1) +endif() + find_program(buildcache_program buildcache) if(buildcache_program) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${buildcache_program}") @@ -26,36 +32,69 @@ endif() set(CMAKE_INSTALL_BINDIR bin CACHE PATH "directory for installing binary files") set(CMAKE_INSTALL_LIBDIR lib CACHE PATH "directory for installing library files") -set(CMAKE_INSTALL_INCLUDEDIR include/lib3mf CACHE PATH "directory for installing header files") +set(CMAKE_INSTALL_INCLUDEDIR include CACHE PATH "directory for installing header files") + +# Build lib3mf as shared by default, but do not implicitly switch third-party +# dependencies (which often key off BUILD_SHARED_LIBS) to shared as well. +set(_lib3mf_build_shared_default ON) +if(DEFINED BUILD_SHARED_LIBS) + set(_lib3mf_build_shared_default "${BUILD_SHARED_LIBS}") +endif() +option(LIB3MF_BUILD_SHARED "Build lib3mf as shared library" ${_lib3mf_build_shared_default}) +unset(_lib3mf_build_shared_default) +option(LIB3MF_BUILD_WASM "Build JavaScript/WebAssembly embind bindings from ACT generated sources" OFF) option(USE_INCLUDED_ZLIB "Use included zlib" ON) option(USE_INCLUDED_LIBZIP "Use included libzip" ON) option(USE_INCLUDED_SSL "Use included libressl" ON) +option(USE_INCLUDED_CPPBASE64 "Use included cpp-base64 sources" ON) +option(USE_INCLUDED_FASTFLOAT "Use included fast_float headers" ON) option(BUILD_FOR_CODECOVERAGE "Build for code coverage analysis" OFF) option(STRIP_BINARIES "Strip binaries (on non-apple)" ON) option(USE_PLATFORM_UUID "Use UUID geneator that is provided by the OS (always ON for Windows)" OFF) +option(LIB3MF_ENABLE_EXPENSIVE_TESTS "Enable expensive/long-running tests" OFF) +set(_lib3mf_tinybvh_threaded_builds_default ON) +if (MINGW OR EMSCRIPTEN) + set(_lib3mf_tinybvh_threaded_builds_default OFF) +endif() +option(LIB3MF_TINYBVH_THREADED_BUILDS "Enable threaded tinybvh build path" ${_lib3mf_tinybvh_threaded_builds_default}) +unset(_lib3mf_tinybvh_threaded_builds_default) + +if (LIB3MF_BUILD_WASM) + if (NOT EMSCRIPTEN) + message(FATAL_ERROR "LIB3MF_BUILD_WASM requires the Emscripten toolchain. Configure with emcmake.") + endif() + if (LIB3MF_BUILD_SHARED) + message(STATUS "LIB3MF_BUILD_WASM forces LIB3MF_BUILD_SHARED=OFF for static linking into the WASM module.") + set(LIB3MF_BUILD_SHARED OFF CACHE BOOL "Build lib3mf as shared library" FORCE) + endif() +endif() add_compile_options($<$:/MP>) set (CMAKE_CXX_STANDARD 17) -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - # using GCC - add_definitions(-DBUILD_DLL) - add_compile_options(-Wall) - if (CMAKE_BUILD_TYPE MATCHES DEBUG) - add_compile_options(-g) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Og") - else() + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # using GCC + if (LIB3MF_BUILD_SHARED) + add_definitions(-DBUILD_DLL) + endif() + add_compile_options(-Wall) + if (CMAKE_BUILD_TYPE MATCHES DEBUG) + add_compile_options(-g) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Og") + else() SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O2") endif(CMAKE_BUILD_TYPE MATCHES DEBUG) -elseif ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") - # using GCC - add_definitions(-DBUILD_DLL) - add_compile_options(-Wall) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O2") - set(CMAKE_MACOSX_RPATH ON) -endif() + elseif ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") + # using GCC + if (LIB3MF_BUILD_SHARED) + add_definitions(-DBUILD_DLL) + endif() + add_compile_options(-Wall) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O2") + set(CMAKE_MACOSX_RPATH ON) + endif() if (${MSVC}) # using Visual Studio C++ @@ -122,11 +161,17 @@ endif() ######################################################### -# Shared library -add_library(${PROJECT_NAME} SHARED ${SRCS_COMMON} ${HDRS_COMMON} - ${ACT_GENERATED_SOURCE} - ${VERSION_FILES_OUTPUTLOCATION} -) +if (LIB3MF_BUILD_SHARED) + add_library(${PROJECT_NAME} SHARED ${SRCS_COMMON} ${HDRS_COMMON} + ${ACT_GENERATED_SOURCE} + ${VERSION_FILES_OUTPUTLOCATION} + ) +else() + add_library(${PROJECT_NAME} STATIC ${SRCS_COMMON} ${HDRS_COMMON} + ${ACT_GENERATED_SOURCE} + ${VERSION_FILES_OUTPUTLOCATION} + ) +endif() if (${MSVC}) # using Visual Studio C++ @@ -156,9 +201,17 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${LIBS_INCLUDE}) # allow FASTFLOAT_ALLOWS_LEADING_PLUS add_definitions(-DFASTFLOAT_ALLOWS_LEADING_PLUS=1) +if (NOT LIB3MF_TINYBVH_THREADED_BUILDS) + target_compile_definitions(${PROJECT_NAME} PRIVATE NO_THREADED_BUILDS=1) +endif() + target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR_AUTOGENERATED}/Source) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Include/API) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Include) +target_include_directories(${PROJECT_NAME} PUBLIC + $ + $ +) if (USE_INCLUDED_LIBZIP) # Something goes here to check if submodules exist and initialize the submodules if it does not @@ -177,49 +230,120 @@ if (USE_INCLUDED_LIBZIP) # create libzip autogenerated platform specific headers if(NOT EXISTS ${CMAKE_BINARY_DIR}/libzip) + set(LIBZIP_CONFIGURE_ARGS + "-DZLIB_INCLUDE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/submodules/zlib" + "-DZLIB_LIBRARY=zlibstatic" + "-DENABLE_COMMONCRYPTO=OFF" + "-DENABLE_GNUTLS=OFF" + "-DENABLE_MBEDTLS=OFF" + "-DENABLE_OPENSSL=OFF" + "-DENABLE_WINDOWS_CRYPTO=OFF" + "-DENABLE_BZIP2=OFF" + "-DENABLE_LZMA=OFF" + "-DENABLE_ZSTD=OFF" + "-DBUILD_TOOLS=OFF" + "-DBUILD_REGRESS=OFF" + "-DBUILD_EXAMPLES=OFF" + "-DBUILD_DOC=OFF" + "-DBUILD_SHARED_LIBS=OFF" + "-DLIBZIP_DO_INSTALL=OFF" + ) + if(EMSCRIPTEN) + # Avoid libzip's legacy endian probe failing during cross-compilation. + list(APPEND LIBZIP_CONFIGURE_ARGS "-DCMAKE_C_BYTE_ORDER=LITTLE_ENDIAN") + endif() execute_process( - COMMAND ${CMAKE_COMMAND} "-DZLIB_INCLUDE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/submodules/zlib" - "-DZLIB_LIBRARY=zlibstatic" "-DENABLE_COMMONCRYPTO=OFF" "-DENABLE_GNUTLS=OFF" "-DENABLE_MBEDTLS=OFF" - "-DENABLE_OPENSSL=OFF" "-DENABLE_WINDOWS_CRYPTO=OFF" - "-DENABLE_BZIP2=OFF" "-DENABLE_LZMA=OFF" "-DENABLE_ZSTD=OFF" - "-DBUILD_TOOLS=OFF" "-DBUILD_REGRESS=OFF" - "-DBUILD_EXAMPLES=OFF" "-DBUILD_DOC=OFF" "-DBUILD_SHARED_LIBS=OFF" "-DLIBZIP_DO_INSTALL=OFF" + COMMAND ${CMAKE_COMMAND} ${LIBZIP_CONFIGURE_ARGS} "-S" "${CMAKE_CURRENT_SOURCE_DIR}/submodules/libzip" "-B" "${CMAKE_CURRENT_BINARY_DIR}/libzip" RESULT_VARIABLE CMD_ERROR OUTPUT_QUIET) MESSAGE( STATUS "CMD_ERROR:" ${CMD_ERROR}) + unset(LIBZIP_CONFIGURE_ARGS) endif() target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/libzip) - if (UNIX OR MINGW) + if ((UNIX OR MINGW) AND NOT EMSCRIPTEN) target_compile_options(${PROJECT_NAME} PRIVATE "-DHAVE_FSEEKO") target_compile_options(${PROJECT_NAME} PRIVATE "-DHAVE_FTELLO") target_compile_options(${PROJECT_NAME} PRIVATE "-DHAVE_STRCASECMP") target_compile_options(${PROJECT_NAME} PRIVATE "-DHAVE_UNISTD_H") endif() + if (EMSCRIPTEN) + target_compile_definitions(${PROJECT_NAME} PRIVATE SIZEOF_OFF_T=8 SIZEOF_SIZE_T=4) + endif() else() - find_package(PkgConfig REQUIRED) - pkg_check_modules(LIBZIP REQUIRED libzip) - target_link_libraries(${PROJECT_NAME} ${LIBZIP_LIBRARIES}) + set(_lib3mf_external_link_visibility PRIVATE) + if (NOT LIB3MF_BUILD_SHARED) + set(_lib3mf_external_link_visibility PUBLIC) + endif() + + find_package(libzip CONFIG QUIET) + if (TARGET libzip::zip) + target_link_libraries(${PROJECT_NAME} ${_lib3mf_external_link_visibility} libzip::zip) + else() + find_package(PkgConfig REQUIRED) + pkg_check_modules(LIBZIP REQUIRED libzip) + target_include_directories(${PROJECT_NAME} PRIVATE ${LIBZIP_INCLUDE_DIRS}) + target_link_directories(${PROJECT_NAME} PRIVATE ${LIBZIP_LIBRARY_DIRS}) + target_link_libraries(${PROJECT_NAME} ${_lib3mf_external_link_visibility} ${LIBZIP_LIBRARIES}) + endif() + + unset(_lib3mf_external_link_visibility) endif() if (USE_INCLUDED_ZLIB) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/zlib/Include) + + if(APPLE OR EMSCRIPTEN) + # Ensure zlib includes unistd.h where needed (e.g. macOS, Emscripten). + target_compile_definitions(${PROJECT_NAME} PRIVATE Z_HAVE_UNISTD_H=1) + endif() + else() - find_package(PkgConfig REQUIRED) - pkg_check_modules(ZLIB REQUIRED zlib) - target_link_libraries(${PROJECT_NAME} ${ZLIB_LIBRARIES}) + set(_lib3mf_external_link_visibility PRIVATE) + if (NOT LIB3MF_BUILD_SHARED) + set(_lib3mf_external_link_visibility PUBLIC) + endif() + + find_package(ZLIB QUIET) + if (TARGET ZLIB::ZLIB) + target_link_libraries(${PROJECT_NAME} ${_lib3mf_external_link_visibility} ZLIB::ZLIB) + else() + find_package(PkgConfig REQUIRED) + pkg_check_modules(ZLIB REQUIRED zlib) + target_include_directories(${PROJECT_NAME} PRIVATE ${ZLIB_INCLUDE_DIRS}) + target_link_directories(${PROJECT_NAME} PRIVATE ${ZLIB_LIBRARY_DIRS}) + target_link_libraries(${PROJECT_NAME} ${_lib3mf_external_link_visibility} ${ZLIB_LIBRARIES}) + endif() + + unset(_lib3mf_external_link_visibility) endif() -target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/submodules/fast_float/include) +if (USE_INCLUDED_CPPBASE64) + target_compile_definitions(${PROJECT_NAME} PRIVATE LIB3MF_USE_INCLUDED_CPPBASE64=1) +else() + find_path(CPPBASE64_INCLUDE_DIR NAMES base64.h PATH_SUFFIXES cpp-base64 REQUIRED) + find_file(CPPBASE64_SOURCE_FILE NAMES base64.cpp PATH_SUFFIXES cpp-base64 REQUIRED) + target_include_directories(${PROJECT_NAME} PRIVATE ${CPPBASE64_INCLUDE_DIR}) + target_sources(${PROJECT_NAME} PRIVATE ${CPPBASE64_SOURCE_FILE}) +endif() + +if (USE_INCLUDED_FASTFLOAT) + target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/submodules/fast_float/include) +else() + find_package(FastFloat CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE FastFloat::fast_float) +endif() set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" IMPORT_PREFIX "" ) -# This makes sure symbols are exported -target_compile_options(${PROJECT_NAME} PRIVATE "-D__LIB3MF_EXPORTS") +# This makes sure symbols are exported (shared builds only) +if (LIB3MF_BUILD_SHARED) + target_compile_options(${PROJECT_NAME} PRIVATE "-D__LIB3MF_EXPORTS") +endif() # The following two properties are crucial to reduce the number of undesirably exported symbols set_target_properties(${PROJECT_NAME} PROPERTIES C_VISIBILITY_PRESET hidden) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden) @@ -228,17 +352,23 @@ set_target_properties(${PROJECT_NAME} PROPERTIES VISIBILITY_INLINES_HIDDEN ON) set(STARTUPPROJECT ${PROJECT_NAME}) ######################################################### -if (UNIX OR MINGW) +if (${MSVC}) + # wd4996 masks the deprecated-warning + target_compile_options(${PROJECT_NAME} PUBLIC "$<$:/Od;/Ob0;/sdl;/W3;/WX;/FC;/wd4996>") + target_compile_options(${PROJECT_NAME} PUBLIC "$<$:/O2;/sdl;/WX;/Oi;/Gy;/FC;/wd4996>") +elseif ((UNIX OR MINGW) AND LIB3MF_BUILD_SHARED) # Uncomment the following to put the version info into the .so-file. set_target_properties(${PROJECT_NAME} PROPERTIES VERSION "${LIB3MF_VERSION_MAJOR}.${LIB3MF_VERSION_MINOR}.${LIB3MF_VERSION_MICRO}.${BUILD_NUMBER}") set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION "${LIB3MF_VERSION_MAJOR}") + target_compile_options(${PROJECT_NAME} PRIVATE -Wno-incompatible-pointer-types) if (STRIP_BINARIES AND NOT APPLE) set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS -s) endif() -else() - # wd4996 masks the deprecated-warning - target_compile_options(${PROJECT_NAME} PUBLIC "$<$:/Od;/Ob0;/sdl;/W3;/WX;/FC;/wd4996>") - target_compile_options(${PROJECT_NAME} PUBLIC "$<$:/O2;/sdl;/WX;/Oi;/Gy;/FC;/wd4996>") +endif() + +# Static build usability (e.g. linking into shared libs) +if (NOT LIB3MF_BUILD_SHARED) + set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() ## UUID @@ -248,7 +378,7 @@ if(WIN32) else() if (USE_PLATFORM_UUID) if (APPLE) - target_compile_definitions(${PROJECT_NAME} PRIVATE GUID_CFUUID) + target_compile_definitions(${PROJECT_NAME} PRIVATE GUID_CFUUID HAVE_UNISTD_H=1) target_link_libraries(${PROJECT_NAME} "-framework Foundation") else() target_compile_definitions(${PROJECT_NAME} PRIVATE GUID_LIBUUID) @@ -260,17 +390,87 @@ else() endif(WIN32) configure_file(lib3mf.pc.in lib3mf.pc @ONLY) +set(LIB3MF_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/lib3mf") +configure_package_config_file( + cmake/lib3mfConfig.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/lib3mfConfig.cmake" + INSTALL_DESTINATION "${LIB3MF_CONFIG_INSTALL_DIR}" +) +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/lib3mfConfigVersion.cmake" + VERSION "${PROJECT_VERSION}" + COMPATIBILITY SameMajorVersion +) install(FILES ${CMAKE_BINARY_DIR}/lib3mf.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) -install(FILES cmake/lib3mfConfig.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lib3mf) +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/lib3mfConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/lib3mfConfigVersion.cmake" + DESTINATION "${LIB3MF_CONFIG_INSTALL_DIR}" +) install(TARGETS ${PROJECT_NAME} + EXPORT lib3mfTargets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") +install(EXPORT lib3mfTargets + FILE lib3mfTargets.cmake + NAMESPACE lib3mf:: + DESTINATION "${LIB3MF_CONFIG_INSTALL_DIR}" +) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR_AUTOGENERATED}/Bindings DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") +if (LIB3MF_BUILD_WASM) + set(LIB3MF_WASM_BINDINGS_SOURCE "${CMAKE_CURRENT_SOURCE_DIR_AUTOGENERATED}/Bindings/WASM/lib3mf_bindings.cpp") + if (NOT EXISTS "${LIB3MF_WASM_BINDINGS_SOURCE}") + message(FATAL_ERROR "Missing ACT-generated WASM bindings source: ${LIB3MF_WASM_BINDINGS_SOURCE}") + endif() + + find_package(Python3 COMPONENTS Interpreter QUIET) + if (NOT Python3_Interpreter_FOUND) + message(FATAL_ERROR "LIB3MF_BUILD_WASM requires Python3 to run patch_wasm_bindings.py") + endif() + + set(LIB3MF_WASM_BINDINGS_PATCH_STAMP "${CMAKE_CURRENT_BINARY_DIR}/lib3mf_wasm_bindings_patch.stamp") + add_custom_command( + OUTPUT "${LIB3MF_WASM_BINDINGS_PATCH_STAMP}" + COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/patch_wasm_bindings.py" "${LIB3MF_WASM_BINDINGS_SOURCE}" + COMMAND "${CMAKE_COMMAND}" -E touch "${LIB3MF_WASM_BINDINGS_PATCH_STAMP}" + DEPENDS "${LIB3MF_WASM_BINDINGS_SOURCE}" "${CMAKE_CURRENT_SOURCE_DIR}/patch_wasm_bindings.py" + COMMENT "Patching ACT-generated WASM bindings for struct-return/vector wrapper compatibility" + VERBATIM + ) + add_custom_target(lib3mf_wasm_bindings_patch DEPENDS "${LIB3MF_WASM_BINDINGS_PATCH_STAMP}") + + add_executable(lib3mf_wasm ${LIB3MF_WASM_BINDINGS_SOURCE}) + add_dependencies(lib3mf_wasm lib3mf_wasm_bindings_patch) + target_include_directories(lib3mf_wasm PRIVATE ${CMAKE_CURRENT_SOURCE_DIR_AUTOGENERATED}/Bindings) + target_link_libraries(lib3mf_wasm PRIVATE ${PROJECT_NAME}) + set_target_properties(lib3mf_wasm PROPERTIES OUTPUT_NAME "lib3mf" SUFFIX ".js") + target_link_options(lib3mf_wasm PRIVATE + "-sWASM=1" + "-sMODULARIZE=1" + "-sEXPORT_ES6=1" + "-sUSE_ES6_IMPORT_META=1" + "-sENVIRONMENT=web,worker,node" + "-sINITIAL_MEMORY=1073741824" + "-sALLOW_MEMORY_GROWTH=1" + "-sMAXIMUM_MEMORY=4294967296" + "-sFORCE_FILESYSTEM=1" + "-sEXPORTED_RUNTIME_METHODS=['FS','ccall','cwrap']" + "--bind" + "-sEXCEPTION_CATCHING_ALLOWED=['*']" + "-sASSERTIONS=1" + "--no-entry" + ) +endif() + ######################################################### -option(LIB3MF_TESTS "Switch whether the tests of lib3mf should be build" ON) +set(_lib3mf_tests_default ON) +if(EMSCRIPTEN OR LIB3MF_BUILD_WASM) + set(_lib3mf_tests_default OFF) +endif() +option(LIB3MF_TESTS "Switch whether the tests of lib3mf should be build" ${_lib3mf_tests_default}) +unset(_lib3mf_tests_default) message("LIB3MF_TESTS ... " ${LIB3MF_TESTS}) if(LIB3MF_TESTS) @@ -299,8 +499,12 @@ set(CPACK_PACKAGE_VERSION_PATCH "${LIB3MF_VERSION_MICRO}") set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") set(CPACK_PACKAGE_CONTACT "lib3mf@3mf.io") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "3MF Consortium") -set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}") -set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Source") +set(LIB3MF_VERSION_FULL "${CPACK_PACKAGE_VERSION}") +if (DEFINED LIB3MF_VERSION_PRERELEASE AND NOT "${LIB3MF_VERSION_PRERELEASE}" STREQUAL "") + set(LIB3MF_VERSION_FULL "${LIB3MF_VERSION_FULL}-${LIB3MF_VERSION_PRERELEASE}") +endif() +set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${LIB3MF_VERSION_FULL}-${CMAKE_SYSTEM_NAME}") +set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${LIB3MF_VERSION_FULL}-Source") ######################################################### include(CPack) diff --git a/CMakePresets.json b/CMakePresets.json index dffe08f11..3b93ba150 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,4 +1,5 @@ { + "version": 3, "configurePresets": [ { "name": "windows-base", @@ -47,7 +48,135 @@ "CMAKE_BUILD_TYPE": "RelWithDebInfo", "CMAKE_CXX_FLAGS_DEBUG": "/Z7" } + }, + { + "name": "linux-base", + "displayName": "Linux Base (Ninja)", + "description": "Base preset for Linux using Ninja.", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/${presetName}", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_INSTALL_PREFIX": "/usr/local", + "LIB3MF_TESTS": "ON", + "USE_INCLUDED_ZLIB": "OFF", + "USE_INCLUDED_LIBZIP": "OFF", + "USE_INCLUDED_SSL": "OFF" + } + }, + { + "name": "linux-debug", + "displayName": "Linux Debug", + "description": "Debug build on Linux with tests enabled.", + "inherits": "linux-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "linux-relwithdebinfo", + "displayName": "Linux RelWithDebInfo", + "description": "RelWithDebInfo build on Linux with tests enabled.", + "inherits": "linux-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } + }, + { + "name": "linux-release", + "displayName": "Linux Release", + "description": "Release build on Linux with tests enabled.", + "inherits": "linux-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } } ], - "version": 3 + "buildPresets": [ + { + "name": "x64-debug", + "displayName": "Build (Windows x64 Debug)", + "configurePreset": "x64-debug" + }, + { + "name": "x64-release", + "displayName": "Build (Windows x64 Release)", + "configurePreset": "x64-release" + }, + { + "name": "x64-release-debug", + "displayName": "Build (Windows x64 Release with Debug)", + "configurePreset": "x64-release-debug" + }, + { + "name": "linux-debug", + "displayName": "Build (Linux Debug)", + "configurePreset": "linux-debug" + }, + { + "name": "linux-relwithdebinfo", + "displayName": "Build (Linux RelWithDebInfo)", + "configurePreset": "linux-relwithdebinfo" + }, + { + "name": "linux-release", + "displayName": "Build (Linux Release)", + "configurePreset": "linux-release" + } + ], + "testPresets": [ + { + "name": "x64-debug", + "displayName": "Test (Windows x64 Debug)", + "configurePreset": "x64-debug", + "output": { + "outputOnFailure": true + } + }, + { + "name": "x64-release", + "displayName": "Test (Windows x64 Release)", + "configurePreset": "x64-release", + "output": { + "outputOnFailure": true + } + }, + { + "name": "x64-release-debug", + "displayName": "Test (Windows x64 Release with Debug)", + "configurePreset": "x64-release-debug", + "output": { + "outputOnFailure": true + } + }, + { + "name": "linux-debug", + "displayName": "Test (Linux Debug)", + "configurePreset": "linux-debug", + "output": { + "outputOnFailure": true + } + }, + { + "name": "linux-relwithdebinfo", + "displayName": "Test (Linux RelWithDebInfo)", + "configurePreset": "linux-relwithdebinfo", + "output": { + "outputOnFailure": true + } + }, + { + "name": "linux-release", + "displayName": "Test (Linux Release)", + "configurePreset": "linux-release", + "output": { + "outputOnFailure": true + } + } + ] } \ No newline at end of file diff --git a/Documentation/conf.py b/Documentation/conf.py index 70c28f068..4bb2b41fb 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -22,7 +22,7 @@ author = '3MF Consortium' # The full version, including alpha/beta/rc tags -release = 'v2.3.2' +release = 'v2.5.0' master_doc = 'index' diff --git a/Documentation/index.rst b/Documentation/index.rst index 4eb80031d..03db22d99 100644 --- a/Documentation/index.rst +++ b/Documentation/index.rst @@ -1,7 +1,7 @@ .. lib3mf documentation master file ********************************************* -lib3mf v2.3.2 documentation +lib3mf v2.5.0 documentation ********************************************* .. image:: https://github.com/3MFConsortium/lib3mf/workflows/Build/badge.svg?branch=master @@ -27,7 +27,7 @@ lib3mf v2.3.2 documentation :language: bash -Welcome! This is the documentation for lib3mf v2.3.2. +Welcome! This is the documentation for lib3mf v2.5.0. lib3mf is an implementation of the 3D Manufacturing Format file standard. diff --git a/Documentation/source/Cpp/lib3mf-types.rst b/Documentation/source/Cpp/lib3mf-types.rst index f2667a6de..02b575994 100644 --- a/Documentation/source/Cpp/lib3mf-types.rst +++ b/Documentation/source/Cpp/lib3mf-types.rst @@ -64,6 +64,7 @@ Enumerations .. cpp:enumerator:: Model = 1 .. cpp:enumerator:: Support = 2 .. cpp:enumerator:: SolidSupport = 3 + .. cpp:enumerator:: Surface = 4 .. cpp:enum-class:: eTextureType : Lib3MF_int32 @@ -96,12 +97,12 @@ Enumerations .. cpp:enumerator:: Inside = 1 .. cpp:enumerator:: Outside = 2 - .. cpp:enum-class:: eBeamLatticeBallMode : Lib3MF_int32 + .. cpp:enum-class:: eBeamLatticeBallMode : Lib3MF_int32 - .. cpp:enumerator:: None = 0 + .. cpp:enumerator:: BeamLatticeBallModeNone = 0 .. cpp:enumerator:: Mixed = 1 .. cpp:enumerator:: All = 2 - + .. cpp:enum-class:: eProgressIdentifier : Lib3MF_int32 .. cpp:enumerator:: QUERYCANCELED = 0 @@ -135,6 +136,97 @@ Enumerations .. cpp:enumerator:: Mix = 1 .. cpp:enumerator:: Multiply = 2 + .. cpp:enum-class:: eChannelName : Lib3MF_int32 + + .. cpp:enumerator:: Red = 0 + .. cpp:enumerator:: Green = 1 + .. cpp:enumerator:: Blue = 2 + .. cpp:enumerator:: Alpha = 3 + + .. cpp:enum-class:: eCompositionMethod : Lib3MF_int32 + + .. cpp:enumerator:: WeightedSum = 0 + .. cpp:enumerator:: Multiply = 1 + .. cpp:enumerator:: Min = 2 + .. cpp:enumerator:: Max = 3 + .. cpp:enumerator:: Mask = 4 + + .. cpp:enum-class:: eCompositionSpace : Lib3MF_int32 + + .. cpp:enumerator:: Raw = 0 + .. cpp:enumerator:: LinearColor = 1 + + .. cpp:enum-class:: eImplicitNodeType : Lib3MF_int32 + + .. cpp:enumerator:: Addition = 0 + .. cpp:enumerator:: Subtraction = 1 + .. cpp:enumerator:: Multiplication = 2 + .. cpp:enumerator:: Division = 3 + .. cpp:enumerator:: Constant = 4 + .. cpp:enumerator:: ConstVec = 5 + .. cpp:enumerator:: ConstMat = 6 + .. cpp:enumerator:: ComposeVector = 7 + .. cpp:enumerator:: DecomposeVector = 8 + .. cpp:enumerator:: ComposeMatrix = 9 + .. cpp:enumerator:: MatrixFromColumns = 10 + .. cpp:enumerator:: MatrixFromRows = 11 + .. cpp:enumerator:: Dot = 12 + .. cpp:enumerator:: Cross = 13 + .. cpp:enumerator:: MatVecMultiplication = 14 + .. cpp:enumerator:: Transpose = 15 + .. cpp:enumerator:: Inverse = 16 + .. cpp:enumerator:: Sinus = 17 + .. cpp:enumerator:: Cosinus = 18 + .. cpp:enumerator:: Tan = 19 + .. cpp:enumerator:: ArcSin = 20 + .. cpp:enumerator:: ArcCos = 21 + .. cpp:enumerator:: ArcTan = 22 + .. cpp:enumerator:: ArcTan2 = 23 + .. cpp:enumerator:: Min = 24 + .. cpp:enumerator:: Max = 25 + .. cpp:enumerator:: Abs = 26 + .. cpp:enumerator:: Fmod = 27 + .. cpp:enumerator:: Pow = 28 + .. cpp:enumerator:: Sqrt = 29 + .. cpp:enumerator:: Exp = 30 + .. cpp:enumerator:: Log = 31 + .. cpp:enumerator:: Log2 = 32 + .. cpp:enumerator:: Log10 = 33 + .. cpp:enumerator:: Select = 34 + .. cpp:enumerator:: Clamp = 35 + .. cpp:enumerator:: Sinh = 36 + .. cpp:enumerator:: Cosh = 37 + .. cpp:enumerator:: Tanh = 38 + .. cpp:enumerator:: Round = 39 + .. cpp:enumerator:: Ceil = 40 + .. cpp:enumerator:: Floor = 41 + .. cpp:enumerator:: Sign = 42 + .. cpp:enumerator:: Fract = 43 + .. cpp:enumerator:: FunctionCall = 44 + .. cpp:enumerator:: Mesh = 45 + .. cpp:enumerator:: Length = 46 + .. cpp:enumerator:: ConstResourceID = 47 + .. cpp:enumerator:: VectorFromScalar = 48 + .. cpp:enumerator:: UnsignedMesh = 49 + .. cpp:enumerator:: Mod = 50 + .. cpp:enumerator:: BeamLattice = 51 + .. cpp:enumerator:: FunctionGradient = 52 + .. cpp:enumerator:: NormalizeDistance = 53 + + .. cpp:enum-class:: eImplicitPortType : Lib3MF_int32 + + .. cpp:enumerator:: Scalar = 0 + .. cpp:enumerator:: Vector = 1 + .. cpp:enumerator:: Matrix = 2 + .. cpp:enumerator:: ResourceID = 3 + + .. cpp:enum-class:: eImplicitNodeConfiguration : Lib3MF_int32 + + .. cpp:enumerator:: Default = 0 + .. cpp:enumerator:: ScalarToScalar = 1 + .. cpp:enumerator:: VectorToVector = 2 + .. cpp:enumerator:: MatrixToMatrix = 3 + .. cpp:enum-class:: eEncryptionAlgorithm : Lib3MF_int32 .. cpp:enumerator:: AES256_GCM = 1 @@ -251,6 +343,17 @@ Structs .. cpp:member:: Lib3MF_uint32 m_Index .. cpp:member:: Lib3MF_double m_Radius + + + .. cpp:struct:: sVector + + .. cpp:member:: Lib3MF_double m_Coordinates[3] + + + .. cpp:struct:: sMatrix4x4 + + .. cpp:member:: Lib3MF_double m_Field[4][4] + Function types diff --git a/Documentation/source/Cpp/lib3mf.rst b/Documentation/source/Cpp/lib3mf.rst index 27dc4c4fe..4045874a2 100644 --- a/Documentation/source/Cpp/lib3mf.rst +++ b/Documentation/source/Cpp/lib3mf.rst @@ -53,14 +53,14 @@ The wrapper class CWrapper :returns: returns an empty model instance - .. cpp:function:: void Release(CBase * pInstance) + .. cpp:function:: void Release(classParam pInstance) releases shared ownership of an object instance :param pInstance: the object instance to release - .. cpp:function:: void Acquire(CBase * pInstance) + .. cpp:function:: void Acquire(classParam pInstance) acquires shared ownership of an object instance @@ -74,7 +74,7 @@ The wrapper class CWrapper :param sJournalPath: File name of the journal file - .. cpp:function:: bool GetLastError(CBase * pInstance, std::string & sLastErrorString) + .. cpp:function:: bool GetLastError(classParam pInstance, std::string & sLastErrorString) Retrieves the last error string of an instance @@ -83,6 +83,13 @@ The wrapper class CWrapper :returns: Returns if the instance has a last error. + .. cpp:function:: Lib3MF_pvoid GetSymbolLookupMethod() + + Returns the address of the SymbolLookupMethod + + :returns: Address of the SymbolAddressMethod + + .. cpp:function:: void RetrieveProgressMessage(const eProgressIdentifier eTheProgressIdentifier, std::string & sProgressMessage) Return an English text for a progress identifier.|Note: this is the only function you can call from your callback function. diff --git a/Documentation/source/Cpp/lib3mf_AbsNode.rst b/Documentation/source/Cpp/lib3mf_AbsNode.rst new file mode 100644 index 000000000..24eacafcc --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_AbsNode.rst @@ -0,0 +1,16 @@ + +CAbsNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CAbsNode : public COneInputNode + + Calculates the absolute value + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PAbsNode + + Shared pointer to CAbsNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_AdditionNode.rst b/Documentation/source/Cpp/lib3mf_AdditionNode.rst new file mode 100644 index 000000000..7c7ba3739 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_AdditionNode.rst @@ -0,0 +1,16 @@ + +CAdditionNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CAdditionNode : public CTwoInputNode + + Adds two values (scalar or vector) + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PAdditionNode + + Shared pointer to CAdditionNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_ArcCosNode.rst b/Documentation/source/Cpp/lib3mf_ArcCosNode.rst new file mode 100644 index 000000000..58db95be5 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ArcCosNode.rst @@ -0,0 +1,16 @@ + +CArcCosNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CArcCosNode : public COneInputNode + + Calculates the arccosinus + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PArcCosNode + + Shared pointer to CArcCosNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_ArcSinNode.rst b/Documentation/source/Cpp/lib3mf_ArcSinNode.rst new file mode 100644 index 000000000..5d05650a2 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ArcSinNode.rst @@ -0,0 +1,16 @@ + +CArcSinNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CArcSinNode : public COneInputNode + + Calculates the arcsinus + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PArcSinNode + + Shared pointer to CArcSinNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_ArcTan2Node.rst b/Documentation/source/Cpp/lib3mf_ArcTan2Node.rst new file mode 100644 index 000000000..ec8af65ec --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ArcTan2Node.rst @@ -0,0 +1,16 @@ + +CArcTan2Node +==================================================================================================== + + +.. cpp:class:: Lib3MF::CArcTan2Node : public CTwoInputNode + + Calculates the arctangent with two arguments + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PArcTan2Node + + Shared pointer to CArcTan2Node to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_ArcTanNode.rst b/Documentation/source/Cpp/lib3mf_ArcTanNode.rst new file mode 100644 index 000000000..2fe19210a --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ArcTanNode.rst @@ -0,0 +1,16 @@ + +CArcTanNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CArcTanNode : public COneInputNode + + Calculates the arctangent + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PArcTanNode + + Shared pointer to CArcTanNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_Attachment.rst b/Documentation/source/Cpp/lib3mf_Attachment.rst index b09cf9308..2dffde576 100644 --- a/Documentation/source/Cpp/lib3mf_Attachment.rst +++ b/Documentation/source/Cpp/lib3mf_Attachment.rst @@ -54,11 +54,21 @@ CAttachment .. cpp:function:: void ReadFromFile(const std::string & sFileName) - Reads an attachment from a file. + Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. :param sFileName: file to read from. + .. cpp:function:: void ReadFromCallback(const ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData) + + Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer methods. + + :param pTheReadCallback: Callback to call for reading a data chunk + :param nStreamSize: number of bytes the callback returns + :param pTheSeekCallback: Callback to call for seeking in the stream. + :param pUserData: Userdata that is passed to the callback function + + .. cpp:function:: Lib3MF_uint64 GetStreamSize() Retrieves the size of the attachment stream @@ -75,7 +85,7 @@ CAttachment .. cpp:function:: void ReadFromBuffer(const CInputVector & BufferBuffer) - Reads an attachment from a memory buffer + Reads an attachment from a memory buffer. This buffer is immediately read (in contrast to the ReadFromCallback and ReadFromFile-methods). :param BufferBuffer: Buffer to read from diff --git a/Documentation/source/Cpp/lib3mf_Base.rst b/Documentation/source/Cpp/lib3mf_Base.rst index 306afb1bb..a77975764 100644 --- a/Documentation/source/Cpp/lib3mf_Base.rst +++ b/Documentation/source/Cpp/lib3mf_Base.rst @@ -10,6 +10,13 @@ CBase + .. cpp:function:: Lib3MF_uint64 ClassTypeId() + + Get Class Type Id + + :returns: Class type as a 64 bits integer + + .. cpp:type:: std::shared_ptr Lib3MF::PBase Shared pointer to CBase to easily allow reference counting. diff --git a/Documentation/source/Cpp/lib3mf_BeamLattice.rst b/Documentation/source/Cpp/lib3mf_BeamLattice.rst index 0dd03ac5e..96b4b85ab 100644 --- a/Documentation/source/Cpp/lib3mf_BeamLattice.rst +++ b/Documentation/source/Cpp/lib3mf_BeamLattice.rst @@ -53,11 +53,11 @@ CBeamLattice Sets the representation-mesh for the beamlattice of this mesh. :param nUniqueResourceID: the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. - - - .. cpp:function:: void GetBallOptions(eBeamLatticeBallMode & eBallMode, Lib3MF_double & dBallRadius) - Returns the ball mode and the default ball radius for the beamlattice of this mesh.Returns the ball mode and the default ball radius for the beamlattice of this mesh. + + .. cpp:function:: void GetBallOptions(eBeamLatticeBallMode & eBallMode, Lib3MF_double & dBallRadius) + + Returns the ball mode and the default ball radius for the beamlattice of this mesh. :param eBallMode: contains the ball mode of this mesh :param dBallRadius: default ball radius of balls for the beamlattice @@ -70,6 +70,7 @@ CBeamLattice :param eBallMode: contains the ball mode of this mesh :param dBallRadius: default ball radius of balls for the beamlattice + .. cpp:function:: Lib3MF_uint32 GetBeamCount() Returns the beam count of a mesh object. @@ -115,7 +116,7 @@ CBeamLattice :param BeamInfoBuffer: contains information of all beams - .. cpp:function:: Lib3MF_uint32 GetBallCount() + .. cpp:function:: Lib3MF_uint32 GetBallCount() Returns the ball count of a mesh object. @@ -150,7 +151,7 @@ CBeamLattice Sets all ball indices and radii of a mesh object. - :param BallInfoBuffer: contains information of a number of balls + :param BallInfoBuffer: contains information of a number of balls .. cpp:function:: void GetBalls(std::vector & BallInfoBuffer) diff --git a/Documentation/source/Cpp/lib3mf_BeamLatticeNode.rst b/Documentation/source/Cpp/lib3mf_BeamLatticeNode.rst new file mode 100644 index 000000000..2c6877a0d --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_BeamLatticeNode.rst @@ -0,0 +1,51 @@ + +CBeamLatticeNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CBeamLatticeNode : public CImplicitNode + + Signed distance to beam lattice + + + + + .. cpp:function:: PImplicitPort GetInputBeamLattice() + + Retrieves the input for the model resource id of the beam lattice + + :returns: the input port for the model resource id of the beam lattice (mesh with beamlattice extension) + + + .. cpp:function:: PImplicitPort GetInputPos() + + Retrieves the input for the position + + :returns: the input port for the position + + + .. cpp:function:: PImplicitPort GetOutputDistance() + + Retrieves the output + + :returns: the output port for the signed distance to the beam lattice + + + .. cpp:function:: void SetAccurateRange(const Lib3MF_double dAccurateRange) + + Sets the accurate range for distance computation + + :param dAccurateRange: the accurate range in model units + + + .. cpp:function:: Lib3MF_double GetAccurateRange() + + Retrieves the accurate range for distance computation + + :returns: the accurate range in model units + + +.. cpp:type:: std::shared_ptr Lib3MF::PBeamLatticeNode + + Shared pointer to CBeamLatticeNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_CeilNode.rst b/Documentation/source/Cpp/lib3mf_CeilNode.rst new file mode 100644 index 000000000..f3dcb245b --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_CeilNode.rst @@ -0,0 +1,16 @@ + +CCeilNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CCeilNode : public COneInputNode + + Rounds a scalar value up to the nearest integer + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PCeilNode + + Shared pointer to CCeilNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_ClampNode.rst b/Documentation/source/Cpp/lib3mf_ClampNode.rst new file mode 100644 index 000000000..b00fc8795 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ClampNode.rst @@ -0,0 +1,30 @@ + +CClampNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CClampNode : public COneInputNode + + Clamps the input value to min and max + + + + + .. cpp:function:: PImplicitPort GetInputMin() + + Retrieves the input for the lower limit + + :returns: the input for the lower limit + + + .. cpp:function:: PImplicitPort GetInputMax() + + Retrieves the input for the upper limit + + :returns: the input for the upper limit + + +.. cpp:type:: std::shared_ptr Lib3MF::PClampNode + + Shared pointer to CClampNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_ComponentsObject.rst b/Documentation/source/Cpp/lib3mf_ComponentsObject.rst index fe39e78e7..16cfb57eb 100644 --- a/Documentation/source/Cpp/lib3mf_ComponentsObject.rst +++ b/Documentation/source/Cpp/lib3mf_ComponentsObject.rst @@ -10,7 +10,7 @@ CComponentsObject - .. cpp:function:: PComponent AddComponent(CObject * pObjectResource, const sTransform & Transform) + .. cpp:function:: PComponent AddComponent(classParam pObjectResource, const sTransform & Transform) Adds a new component to a components object. diff --git a/Documentation/source/Cpp/lib3mf_ComposeMatrixNode.rst b/Documentation/source/Cpp/lib3mf_ComposeMatrixNode.rst new file mode 100644 index 000000000..614632ba5 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ComposeMatrixNode.rst @@ -0,0 +1,135 @@ + +CComposeMatrixNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CComposeMatrixNode : public CImplicitNode + + Composes a 4x4 matrix from 16 scalar values + + + + + .. cpp:function:: PImplicitPort GetInputM00() + + Retrieves the input for the element 0 0 + + :returns: the input for the m00 element + + + .. cpp:function:: PImplicitPort GetInputM01() + + Retrieves the input for the element 0 1 + + :returns: the input for the m01 element + + + .. cpp:function:: PImplicitPort GetInputM02() + + Retrieves the input for the element 0 2 + + :returns: the input for the m02 element + + + .. cpp:function:: PImplicitPort GetInputM03() + + Retrieves the input for the element 0 3 + + :returns: the input for the m03 element + + + .. cpp:function:: PImplicitPort GetInputM10() + + Retrieves the input for the element 1 0 + + :returns: the input for the m10 element + + + .. cpp:function:: PImplicitPort GetInputM11() + + Retrieves the input for the element 1 1 + + :returns: the input for the m11 element + + + .. cpp:function:: PImplicitPort GetInputM12() + + Retrieves the input for the element 1 2 + + :returns: the input for the m12 element + + + .. cpp:function:: PImplicitPort GetInputM13() + + Retrieves the input for the element 1 3 + + :returns: the input for the m13 element + + + .. cpp:function:: PImplicitPort GetInputM20() + + Retrieves the input for the element 2 0 + + :returns: the input for the m20 element + + + .. cpp:function:: PImplicitPort GetInputM21() + + Retrieves the input for the element 2 1 + + :returns: + + + .. cpp:function:: PImplicitPort GetInputM22() + + Retrieves the input for the element 2 2 + + :returns: the input for the m22 element + + + .. cpp:function:: PImplicitPort GetInputM23() + + Retrieves the input for the element 2 3 + + :returns: the input for the m23 element + + + .. cpp:function:: PImplicitPort GetInputM30() + + Retrieves the input for the element 3 0 + + :returns: the input for the m30 element + + + .. cpp:function:: PImplicitPort GetInputM31() + + Retrieves the input for the element 3 1 + + :returns: the input for the m31 element + + + .. cpp:function:: PImplicitPort GetInputM32() + + Retrieves the input for the element 3 2 + + :returns: the input for the m32 element + + + .. cpp:function:: PImplicitPort GetInputM33() + + Retrieves the input for the element 3 3 + + :returns: the input for the m33 element + + + .. cpp:function:: PImplicitPort GetOutputResult() + + Retrieves the output + + :returns: the output + + +.. cpp:type:: std::shared_ptr Lib3MF::PComposeMatrixNode + + Shared pointer to CComposeMatrixNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_ComposeVectorNode.rst b/Documentation/source/Cpp/lib3mf_ComposeVectorNode.rst new file mode 100644 index 000000000..dbb624fbf --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ComposeVectorNode.rst @@ -0,0 +1,44 @@ + +CComposeVectorNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CComposeVectorNode : public CImplicitNode + + Creates a vector from three scalar values + + + + + .. cpp:function:: PImplicitPort GetInputX() + + Retrieves the input for the x component + + :returns: the input for the x component + + + .. cpp:function:: PImplicitPort GetInputY() + + Retrieves the input for the y component + + :returns: the input for the y component + + + .. cpp:function:: PImplicitPort GetInputZ() + + Retrieves the input for the z component + + :returns: the input for the z component + + + .. cpp:function:: PImplicitPort GetOutputResult() + + Retrieves the output + + :returns: the output + + +.. cpp:type:: std::shared_ptr Lib3MF::PComposeVectorNode + + Shared pointer to CComposeVectorNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_ConstMatNode.rst b/Documentation/source/Cpp/lib3mf_ConstMatNode.rst new file mode 100644 index 000000000..24fc03cc0 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ConstMatNode.rst @@ -0,0 +1,37 @@ + +CConstMatNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CConstMatNode : public CImplicitNode + + Constant matrix + + + + + .. cpp:function:: void SetMatrix(const sMatrix4x4 & Value) + + Sets the matrix value of the node + + :param Value: the value + + + .. cpp:function:: sMatrix4x4 GetMatrix() + + Retrieves the matrix value of the node + + :returns: the matrix + + + .. cpp:function:: PImplicitPort GetOutputMatrix() + + Retrieves the output + + :returns: the output + + +.. cpp:type:: std::shared_ptr Lib3MF::PConstMatNode + + Shared pointer to CConstMatNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_ConstVecNode.rst b/Documentation/source/Cpp/lib3mf_ConstVecNode.rst new file mode 100644 index 000000000..0347b680e --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ConstVecNode.rst @@ -0,0 +1,37 @@ + +CConstVecNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CConstVecNode : public CImplicitNode + + Constant vector + + + + + .. cpp:function:: void SetVector(const sVector & Value) + + Sets the vector value of the node + + :param Value: the value + + + .. cpp:function:: sVector GetVector() + + Retrieves the vector value of the node + + :returns: the value + + + .. cpp:function:: PImplicitPort GetOutputVector() + + Retrieves the output + + :returns: the output + + +.. cpp:type:: std::shared_ptr Lib3MF::PConstVecNode + + Shared pointer to CConstVecNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_ConstantNode.rst b/Documentation/source/Cpp/lib3mf_ConstantNode.rst new file mode 100644 index 000000000..91150f49f --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ConstantNode.rst @@ -0,0 +1,37 @@ + +CConstantNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CConstantNode : public CImplicitNode + + Constant value + + + + + .. cpp:function:: void SetConstant(const Lib3MF_double dValue) + + Sets the constant value of the node + + :param dValue: the value + + + .. cpp:function:: Lib3MF_double GetConstant() + + Retrieves the constant value of the node + + :returns: the value + + + .. cpp:function:: PImplicitPort GetOutputValue() + + Retrieves the output + + :returns: the output + + +.. cpp:type:: std::shared_ptr Lib3MF::PConstantNode + + Shared pointer to CConstantNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_CosNode.rst b/Documentation/source/Cpp/lib3mf_CosNode.rst new file mode 100644 index 000000000..1a5ae4910 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_CosNode.rst @@ -0,0 +1,16 @@ + +CCosNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CCosNode : public COneInputNode + + Calculates the cosinus + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PCosNode + + Shared pointer to CCosNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_CoshNode.rst b/Documentation/source/Cpp/lib3mf_CoshNode.rst new file mode 100644 index 000000000..bacf6b0a0 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_CoshNode.rst @@ -0,0 +1,16 @@ + +CCoshNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CCoshNode : public COneInputNode + + Calculates the hyperbolic cosine + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PCoshNode + + Shared pointer to CCoshNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_CrossNode.rst b/Documentation/source/Cpp/lib3mf_CrossNode.rst new file mode 100644 index 000000000..629998e03 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_CrossNode.rst @@ -0,0 +1,16 @@ + +CCrossNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CCrossNode : public CTwoInputNode + + Calculates the cross product of two vector values + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PCrossNode + + Shared pointer to CCrossNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_DecomposeVectorNode.rst b/Documentation/source/Cpp/lib3mf_DecomposeVectorNode.rst new file mode 100644 index 000000000..9465e1589 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_DecomposeVectorNode.rst @@ -0,0 +1,44 @@ + +CDecomposeVectorNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CDecomposeVectorNode : public CImplicitNode + + Decomposes a vector into three scalar values + + + + + .. cpp:function:: PImplicitPort GetInputA() + + Retrieves the input + + :returns: the input port for the vector to decompose + + + .. cpp:function:: PImplicitPort GetOutputX() + + Retrieves the output for the x component + + :returns: the output for the x component + + + .. cpp:function:: PImplicitPort GetOutputY() + + Retrieves the output for the y component + + :returns: the output for the y component + + + .. cpp:function:: PImplicitPort GetOutputZ() + + Retrieves the output for the z component + + :returns: the output for the z component + + +.. cpp:type:: std::shared_ptr Lib3MF::PDecomposeVectorNode + + Shared pointer to CDecomposeVectorNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_DivisionNode.rst b/Documentation/source/Cpp/lib3mf_DivisionNode.rst new file mode 100644 index 000000000..b63fcfbd2 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_DivisionNode.rst @@ -0,0 +1,16 @@ + +CDivisionNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CDivisionNode : public CTwoInputNode + + Divides two values (scalar or vector) + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PDivisionNode + + Shared pointer to CDivisionNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_DotNode.rst b/Documentation/source/Cpp/lib3mf_DotNode.rst new file mode 100644 index 000000000..84558689b --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_DotNode.rst @@ -0,0 +1,16 @@ + +CDotNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CDotNode : public CTwoInputNode + + Calculates the dot product of two vector values + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PDotNode + + Shared pointer to CDotNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_ExpNode.rst b/Documentation/source/Cpp/lib3mf_ExpNode.rst new file mode 100644 index 000000000..400bb499f --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ExpNode.rst @@ -0,0 +1,16 @@ + +CExpNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CExpNode : public COneInputNode + + Exponential function + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PExpNode + + Shared pointer to CExpNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_FloorNode.rst b/Documentation/source/Cpp/lib3mf_FloorNode.rst new file mode 100644 index 000000000..c67dd8db6 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_FloorNode.rst @@ -0,0 +1,16 @@ + +CFloorNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CFloorNode : public COneInputNode + + Rounds a scalar value down to the nearest integer + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PFloorNode + + Shared pointer to CFloorNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_FmodNode.rst b/Documentation/source/Cpp/lib3mf_FmodNode.rst new file mode 100644 index 000000000..83e396d7b --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_FmodNode.rst @@ -0,0 +1,16 @@ + +CFmodNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CFmodNode : public CTwoInputNode + + Calculates the modulo of two values (C fmod) + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PFmodNode + + Shared pointer to CFmodNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_FractNode.rst b/Documentation/source/Cpp/lib3mf_FractNode.rst new file mode 100644 index 000000000..c14bbdf41 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_FractNode.rst @@ -0,0 +1,16 @@ + +CFractNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CFractNode : public COneInputNode + + Returns the fractional part + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PFractNode + + Shared pointer to CFractNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_Function.rst b/Documentation/source/Cpp/lib3mf_Function.rst new file mode 100644 index 000000000..22c93ad17 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_Function.rst @@ -0,0 +1,94 @@ + +CFunction +==================================================================================================== + + +.. cpp:class:: Lib3MF::CFunction : public CResource + + + + + + + .. cpp:function:: std::string GetDisplayName() + + Retrieves the display name of the function + + :returns: the display name + + + .. cpp:function:: void SetDisplayName(const std::string & sDisplayName) + + Sets the display name of the function + + :param sDisplayName: the display name + + + .. cpp:function:: PImplicitPort AddInput(const std::string & sIdentifier, const std::string & sDisplayName, const eImplicitPortType eType) + + Add an input + + :param sIdentifier: the identifier of the input + :param sDisplayName: the display name of the input + :param eType: the type of the input + :returns: The added input port + + + .. cpp:function:: PImplicitPortIterator GetInputs() + + Retrieves the inputs + + :returns: iterator for the list of inputs + + + .. cpp:function:: void RemoveInput(classParam pInput) + + Removes an input + + :param pInput: The input to be removed + + + .. cpp:function:: PImplicitPort AddOutput(const std::string & sIdentifier, const std::string & sDisplayName, const eImplicitPortType eType) + + Add an output + + :param sIdentifier: the identifier of the output + :param sDisplayName: the display name of the output + :param eType: the type of the input + :returns: The added input port + + + .. cpp:function:: PImplicitPortIterator GetOutputs() + + Retrieves the outputs + + :returns: iterator for the outputs + + + .. cpp:function:: void RemoveOutput(classParam pOutput) + + Removes an output + + :param pOutput: The output to be removed + + + .. cpp:function:: PImplicitPort FindInput(const std::string & sIdentifier) + + Retrieves an input + + :param sIdentifier: the identifier of the input + :returns: the input port + + + .. cpp:function:: PImplicitPort FindOutput(const std::string & sIdentifier) + + Retrieves an output + + :param sIdentifier: the identifier of the output + :returns: the output port + + +.. cpp:type:: std::shared_ptr Lib3MF::PFunction + + Shared pointer to CFunction to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_FunctionCallNode.rst b/Documentation/source/Cpp/lib3mf_FunctionCallNode.rst new file mode 100644 index 000000000..6239b29ba --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_FunctionCallNode.rst @@ -0,0 +1,23 @@ + +CFunctionCallNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CFunctionCallNode : public CImplicitNode + + Function call + + + + + .. cpp:function:: PImplicitPort GetInputFunctionID() + + Retrieves the input for the function id + + :returns: the input port for the function + + +.. cpp:type:: std::shared_ptr Lib3MF::PFunctionCallNode + + Shared pointer to CFunctionCallNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_FunctionFromImage3D.rst b/Documentation/source/Cpp/lib3mf_FunctionFromImage3D.rst new file mode 100644 index 000000000..722e9257f --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_FunctionFromImage3D.rst @@ -0,0 +1,90 @@ + +CFunctionFromImage3D +==================================================================================================== + + +.. cpp:class:: Lib3MF::CFunctionFromImage3D : public CFunction + + + + + + + .. cpp:function:: PImage3D GetImage3D() + + Returns the selected 3D image. + + :returns: image instance + + + .. cpp:function:: void SetImage3D(classParam pImage3D) + + Sets the 3D image of the selector. + + :param pImage3D: image instance + + + .. cpp:function:: void SetFilter(const eTextureFilter eFilter) + + Sets the texture filter of the selector. + + :param eFilter: texture filter + + + .. cpp:function:: eTextureFilter GetFilter() + + Returns the texture filter of the selector. + + :returns: texture filter + + + .. cpp:function:: void SetTileStyles(const eTextureTileStyle eTileStyleU, const eTextureTileStyle eTileStyleV, const eTextureTileStyle eTileStyleW) + + Sets the tile styles of the selector. + + :param eTileStyleU: tile style in U + :param eTileStyleV: tile style in V + :param eTileStyleW: tile style in W + + + .. cpp:function:: void GetTileStyles(eTextureTileStyle & eTileStyleU, eTextureTileStyle & eTileStyleV, eTextureTileStyle & eTileStyleW) + + Retrieves the tile styles of the selector. + + :param eTileStyleU: tile style in U + :param eTileStyleV: tile style in V + :param eTileStyleW: tile style in W + + + .. cpp:function:: Lib3MF_double GetOffset() + + returns the offset value for the pixel values in the Image3D + + :returns: the offset value for the pixel values in the Image3D + + + .. cpp:function:: void SetOffset(const Lib3MF_double dOffset) + + Sets the offset value for the pixel values in the Image3D + + :param dOffset: the offset value for the pixel values in the Image3D + + + .. cpp:function:: Lib3MF_double GetScale() + + returns the scale value for the pixel values in the Image3D + + :returns: the scale value for the pixel values in the Image3D + + + .. cpp:function:: void SetScale(const Lib3MF_double dScale) + + Sets the scale value for the pixel values in the Image3D + + :param dScale: the scale value for the pixel values in the Image3D + + +.. cpp:type:: std::shared_ptr Lib3MF::PFunctionFromImage3D + + Shared pointer to CFunctionFromImage3D to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_FunctionGradientNode.rst b/Documentation/source/Cpp/lib3mf_FunctionGradientNode.rst new file mode 100644 index 000000000..4da92a279 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_FunctionGradientNode.rst @@ -0,0 +1,86 @@ + +CFunctionGradientNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CFunctionGradientNode : public CImplicitNode + + Gradient of a function + + + + + .. cpp:function:: PImplicitPort GetInputFunctionID() + + Retrieves the input for the function id + + :returns: the input port for the function + + + .. cpp:function:: PImplicitPort GetInputPos() + + Retrieves the input for the position + + :returns: the input port for the position + + + .. cpp:function:: PImplicitPort GetInputStep() + + Retrieves the input for the finite difference step + + :returns: the input port for the finite difference step + + + .. cpp:function:: void SetScalarOutputName(const std::string & sScalarOutputName) + + Sets the name of the referenced scalar output + + :param sScalarOutputName: the name of the scalar output of the referenced function + + + .. cpp:function:: std::string GetScalarOutputName() + + Retrieves the name of the referenced scalar output + + :returns: the name of the scalar output of the referenced function + + + .. cpp:function:: void SetVectorInputName(const std::string & sVectorInputName) + + Sets the name of the referenced vector input + + :param sVectorInputName: the name of the vector input (float3) of the referenced function + + + .. cpp:function:: std::string GetVectorInputName() + + Retrieves the name of the referenced vector input + + :returns: the name of the vector input (float3) of the referenced function + + + .. cpp:function:: PImplicitPort GetOutputNormalizedGradient() + + Retrieves the normalized gradient output + + :returns: the output port for the normalized gradient + + + .. cpp:function:: PImplicitPort GetOutputGradient() + + Retrieves the raw gradient output + + :returns: the output port for the raw gradient + + + .. cpp:function:: PImplicitPort GetOutputMagnitude() + + Retrieves the gradient magnitude output + + :returns: the output port for the gradient magnitude + + +.. cpp:type:: std::shared_ptr Lib3MF::PFunctionGradientNode + + Shared pointer to CFunctionGradientNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_FunctionIterator.rst b/Documentation/source/Cpp/lib3mf_FunctionIterator.rst new file mode 100644 index 000000000..18e492e08 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_FunctionIterator.rst @@ -0,0 +1,23 @@ + +CFunctionIterator +==================================================================================================== + + +.. cpp:class:: Lib3MF::CFunctionIterator : public CResourceIterator + + + + + + + .. cpp:function:: PFunction GetCurrentFunction() + + Returns the Function the iterator points at. + + :returns: returns the Function instance. + + +.. cpp:type:: std::shared_ptr Lib3MF::PFunctionIterator + + Shared pointer to CFunctionIterator to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_FunctionReference.rst b/Documentation/source/Cpp/lib3mf_FunctionReference.rst new file mode 100644 index 000000000..c102ab3a1 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_FunctionReference.rst @@ -0,0 +1,86 @@ + +CFunctionReference +==================================================================================================== + + +.. cpp:class:: Lib3MF::CFunctionReference : public CBase + + + + + + + .. cpp:function:: Lib3MF_uint32 GetFunctionResourceID() + + Returns the UniqueResourceID of the Function. Only functions with a 'pos'-input are allowed. + + :returns: returns the UniqueResourceID. + + + .. cpp:function:: void SetFunctionResourceID(const Lib3MF_uint32 nUniqueResourceID) + + Sets the UniqueResourceID to refer to. + + :param nUniqueResourceID: UniqueResourceID of the function + + + .. cpp:function:: sTransform GetTransform() + + Returns the transformation matrix into the coordinate system of the referenced Function. + + :returns: the transformation matrix + + + .. cpp:function:: void SetTransform(const sTransform & Transform) + + Sets the transformation matrix into the coordinate system of the referenced Function. + + :param Transform: new transformation matrix + + + .. cpp:function:: std::string GetChannelName() + + Returns the name of the function output channel to use. + + :returns: the name of the function output channel + + + .. cpp:function:: void SetChannelName(const std::string & sChannelName) + + Sets the name of the function output channel to use. + + :param sChannelName: new name of the function output channel + + + .. cpp:function:: void SetMinFeatureSize(const Lib3MF_double dMinFeatureSize) + + Sets the minimal feature size as a hint for the function evaluator + + :param dMinFeatureSize: minimal feature size + + + .. cpp:function:: Lib3MF_double GetMinFeatureSize() + + Returns the minimal feature size as a hint for the function evaluator + + :returns: minimal feature size + + + .. cpp:function:: void SetFallBackValue(const Lib3MF_double dFallBackValue) + + Sets the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). + + :param dFallBackValue: fallback value + + + .. cpp:function:: Lib3MF_double GetFallBackValue() + + Returns the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). + + :returns: fallback value + + +.. cpp:type:: std::shared_ptr Lib3MF::PFunctionReference + + Shared pointer to CFunctionReference to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_Image3D.rst b/Documentation/source/Cpp/lib3mf_Image3D.rst new file mode 100644 index 000000000..7ac1b79e8 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_Image3D.rst @@ -0,0 +1,37 @@ + +CImage3D +==================================================================================================== + + +.. cpp:class:: Lib3MF::CImage3D : public CResource + + + + + + + .. cpp:function:: std::string GetName() + + returns the name of this Image3D + + :returns: the name of this Image3D + + + .. cpp:function:: void SetName(const std::string & sName) + + sets a new name of this Image3D + + :param sName: the new name of this Image3D + + + .. cpp:function:: bool IsImageStack() + + Retrieves, if this Image3D is a ImageStack + + :returns: returns, whether the Image3D is an ImageStack + + +.. cpp:type:: std::shared_ptr Lib3MF::PImage3D + + Shared pointer to CImage3D to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_Image3DIterator.rst b/Documentation/source/Cpp/lib3mf_Image3DIterator.rst new file mode 100644 index 000000000..7247c7891 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_Image3DIterator.rst @@ -0,0 +1,23 @@ + +CImage3DIterator +==================================================================================================== + + +.. cpp:class:: Lib3MF::CImage3DIterator : public CResourceIterator + + + + + + + .. cpp:function:: PImage3D GetCurrentImage3D() + + Returns the Image3D the iterator points at. + + :returns: returns the Image3D instance. + + +.. cpp:type:: std::shared_ptr Lib3MF::PImage3DIterator + + Shared pointer to CImage3DIterator to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_ImageStack.rst b/Documentation/source/Cpp/lib3mf_ImageStack.rst new file mode 100644 index 000000000..8c963f636 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ImageStack.rst @@ -0,0 +1,96 @@ + +CImageStack +==================================================================================================== + + +.. cpp:class:: Lib3MF::CImageStack : public CImage3D + + + + + + + .. cpp:function:: Lib3MF_uint32 GetRowCount() + + Retrieves the number of rows in each image of this image3d + + :returns: number of rows + + + .. cpp:function:: void SetRowCount(const Lib3MF_uint32 nRowCount) + + Sets the number of rows in each image of this image3d + + :param nRowCount: number of rows + + + .. cpp:function:: Lib3MF_uint32 GetColumnCount() + + Retrieves the number of columns in each image of this image3d + + :returns: number of columns + + + .. cpp:function:: void SetColumnCount(const Lib3MF_uint32 nColumnCount) + + Sets the number of columns in each image of this image3d + + :param nColumnCount: number of columns + + + .. cpp:function:: Lib3MF_uint32 GetSheetCount() + + Retrieves the number of images in the stack. + + :returns: number of images + + + .. cpp:function:: PAttachment GetSheet(const Lib3MF_uint32 nIndex) + + Retrieves a sheet of the stack. Raises an error if sheet is not set. + + :param nIndex: index of the image (0-based) + :returns: attachment containing the image + + + .. cpp:function:: void SetSheet(const Lib3MF_uint32 nIndex, classParam pSheet) + + Sets a sheet to an existing attachment. + + :param nIndex: index of the image (0-based) + :param pSheet: attachment containing the image + + + .. cpp:function:: PAttachment CreateEmptySheet(const Lib3MF_uint32 nIndex, const std::string & sPath) + + Creates a new sheet attachment with empty data. + + :param nIndex: index of the image (0-based) + :param sPath: path of part in the package + :returns: attachment containing the image + + + .. cpp:function:: PAttachment CreateSheetFromBuffer(const Lib3MF_uint32 nIndex, const std::string & sPath, const CInputVector & DataBuffer) + + Creates a new sheet attachment from a memory buffer. + + :param nIndex: index of the image (0-based) + :param sPath: path of part in the package + :param DataBuffer: binary image data + :returns: attachment containing the image + + + .. cpp:function:: PAttachment CreateSheetFromFile(const Lib3MF_uint32 nIndex, const std::string & sPath, const std::string & sFileName) + + Creates a new sheet attachment from a file on disk. + + :param nIndex: index of the image (0-based) + :param sPath: path of part in the package + :param sFileName: file name to read from + :returns: attachment containing the image + + +.. cpp:type:: std::shared_ptr Lib3MF::PImageStack + + Shared pointer to CImageStack to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_ImplicitFunction.rst b/Documentation/source/Cpp/lib3mf_ImplicitFunction.rst new file mode 100644 index 000000000..410ec0790 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ImplicitFunction.rst @@ -0,0 +1,635 @@ + +CImplicitFunction +==================================================================================================== + + +.. cpp:class:: Lib3MF::CImplicitFunction : public CFunction + + + + + + + .. cpp:function:: std::string GetIdentifier() + + Retrieves the identifier of the function + + :returns: the identifier + + + .. cpp:function:: void SetIdentifier(const std::string & sIdentifier) + + Sets the identifier of the function + + :param sIdentifier: the identifier + + + .. cpp:function:: PImplicitNode AddNode(const eImplicitNodeType eNodeType, const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a node + + :param eNodeType: the type of the node + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PSinNode AddSinNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a SinNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PCosNode AddCosNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a CosNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PTanNode AddTanNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a TanNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PArcSinNode AddArcSinNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a ArcSinNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PArcCosNode AddArcCosNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a ArcCosNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PArcTan2Node AddArcTan2Node(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a ArcTan2Node + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PSinhNode AddSinhNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a SinhNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PCoshNode AddCoshNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a CoshNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PTanhNode AddTanhNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a TanhNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PRoundNode AddRoundNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a RoundNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PCeilNode AddCeilNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a CeilNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PFloorNode AddFloorNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a FloorNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PSignNode AddSignNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a SignNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PFractNode AddFractNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a FractNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PAbsNode AddAbsNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a AbsNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PExpNode AddExpNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a ExpNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PLogNode AddLogNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a LogNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PLog2Node AddLog2Node(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a Log2Node + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PLog10Node AddLog10Node(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a Log10Node + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PLengthNode AddLengthNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a LengthNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PTransposeNode AddTransposeNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a TransposeNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PInverseNode AddInverseNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a InverseNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PSqrtNode AddSqrtNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a SqrtNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PResourceIdNode AddResourceIdNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a ResourceIdNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PAdditionNode AddAdditionNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add an AdditionNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PSubtractionNode AddSubtractionNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a SubtractionNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PMultiplicationNode AddMultiplicationNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a MultiplicationNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PDivisionNode AddDivisionNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a DivisionNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PDotNode AddDotNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a DotNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PCrossNode AddCrossNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a CrossNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PMatVecMultiplicationNode AddMatVecMultiplicationNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a MatVecMultiplicationNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PMinNode AddMinNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a MinNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PMaxNode AddMaxNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a MaxNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PFmodNode AddFmodNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a FmodNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PPowNode AddPowNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a PowNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PSelectNode AddSelectNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a SelectNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PClampNode AddClampNode(const std::string & sIdentifier, const eImplicitNodeConfiguration eConfiguration, const std::string & sDisplayName, const std::string & sTag) + + Add a ClampNode + + :param sIdentifier: the identifier of the node + :param eConfiguration: the configuration of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PComposeVectorNode AddComposeVectorNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a ComposeVectorNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PVectorFromScalarNode AddVectorFromScalarNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a VectorFromScalar + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PDecomposeVectorNode AddDecomposeVectorNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a DecomposeVectorNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PComposeMatrixNode AddComposeMatrixNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a ComposeMatrixNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PMatrixFromRowsNode AddMatrixFromRowsNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a MatrixFromRowsNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PMatrixFromColumnsNode AddMatrixFromColumnsNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a MatrixFromColumnsNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PConstantNode AddConstantNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a ConstantNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PConstVecNode AddConstVecNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a ConstVecNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PConstMatNode AddConstMatNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a ConstMatNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PMeshNode AddMeshNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a MeshNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PUnsignedMeshNode AddUnsignedMeshNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a UnsignedMeshNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PBeamLatticeNode AddBeamLatticeNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a BeamLatticeNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PFunctionGradientNode AddFunctionGradientNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a FunctionGradientNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PNormalizeDistanceNode AddNormalizeDistanceNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a NormalizeDistanceNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PFunctionCallNode AddFunctionCallNode(const std::string & sIdentifier, const std::string & sDisplayName, const std::string & sTag) + + Add a FunctionCallNode + + :param sIdentifier: the identifier of the node + :param sDisplayName: the display name of the node + :param sTag: the tag of the node + :returns: the added node + + + .. cpp:function:: PNodeIterator GetNodes() + + Retrieves the nodes + + :returns: iterator for the list of nodes + + + .. cpp:function:: void RemoveNode(classParam pNode) + + Removes a node + + :param pNode: The node to be removed + + + .. cpp:function:: void AddLink(classParam pSource, classParam pTarget) + + Add a link + + :param pSource: the source port + :param pTarget: the target port + + + .. cpp:function:: void AddLinkByNames(const std::string & sSource, const std::string & sTarget) + + Add a link + + :param sSource: name of the source port in the format nodename.portname + :param sTarget: name of the target port in the format nodename.portname + + + .. cpp:function:: void Clear() + + Clears the function + + + + .. cpp:function:: void SortNodesTopologically() + + Sorts the nodes topologically + + + +.. cpp:type:: std::shared_ptr Lib3MF::PImplicitFunction + + Shared pointer to CImplicitFunction to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_ImplicitNode.rst b/Documentation/source/Cpp/lib3mf_ImplicitNode.rst new file mode 100644 index 000000000..916d405e6 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ImplicitNode.rst @@ -0,0 +1,120 @@ + +CImplicitNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CImplicitNode : public CBase + + + + + + + .. cpp:function:: std::string GetIdentifier() + + Retrieves the identifier of the node + + :returns: the identifier + + + .. cpp:function:: void SetIdentifier(const std::string & sIdentifier) + + Sets the identifier of the node + + :param sIdentifier: the identifier + + + .. cpp:function:: std::string GetDisplayName() + + Retrieves the display name of the node + + :returns: the display name + + + .. cpp:function:: void SetDisplayName(const std::string & sDisplayName) + + Sets the display name of the node + + :param sDisplayName: the display name + + + .. cpp:function:: std::string GetTag() + + Retrieves the tag of the node + + :returns: the tag + + + .. cpp:function:: void SetTag(const std::string & sTag) + + Sets the tag of the node + + :param sTag: the tag + + + .. cpp:function:: eImplicitNodeType GetNodeType() + + Retrieves the type of the node + + :returns: the type of the node + + + .. cpp:function:: PImplicitPort AddInput(const std::string & sIdentifier, const std::string & sDisplayName) + + Add an input + + :param sIdentifier: the identifier of the input + :param sDisplayName: the display name of the input + :returns: + + + .. cpp:function:: PImplicitPortIterator GetInputs() + + Retrieves the inputs + + :returns: the iterator for the inputs + + + .. cpp:function:: PImplicitPort AddOutput(const std::string & sIdentifier, const std::string & sDisplayName) + + Add an output + + :param sIdentifier: the identifier of the output + :param sDisplayName: the display name of the output + :returns: + + + .. cpp:function:: PImplicitPortIterator GetOutputs() + + Retrieves the outputs + + :returns: the iterator the outputs + + + .. cpp:function:: PImplicitPort FindInput(const std::string & sIdentifier) + + Retrieves an input + + :param sIdentifier: the identifier of the input + :returns: the input port + + + .. cpp:function:: PImplicitPort FindOutput(const std::string & sIdentifier) + + Retrieves an output + + :param sIdentifier: the identifier of the output + :returns: the output port + + + .. cpp:function:: bool AreTypesValid() + + Checks if the types of the input and output ports are valid for the node type + + :returns: true, if the types are valid + + +.. cpp:type:: std::shared_ptr Lib3MF::PImplicitNode + + Shared pointer to CImplicitNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_ImplicitPort.rst b/Documentation/source/Cpp/lib3mf_ImplicitPort.rst new file mode 100644 index 000000000..624c915fc --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ImplicitPort.rst @@ -0,0 +1,72 @@ + +CImplicitPort +==================================================================================================== + + +.. cpp:class:: Lib3MF::CImplicitPort : public CBase + + + + + + + .. cpp:function:: std::string GetIdentifier() + + Retrieves the identifier of the port + + :returns: the identifier + + + .. cpp:function:: void SetIdentifier(const std::string & sIdentifier) + + Sets the identifier of the port + + :param sIdentifier: the identifier + + + .. cpp:function:: std::string GetDisplayName() + + Retrieves the display name of the port + + :returns: the display name + + + .. cpp:function:: void SetDisplayName(const std::string & sDisplayName) + + Sets the display name of the port + + :param sDisplayName: the display name + + + .. cpp:function:: void SetType(const eImplicitPortType eImplicitPortType) + + Sets the type of the port + + :param eImplicitPortType: the type + + + .. cpp:function:: eImplicitPortType GetType() + + Retrieves the type of the port + + :returns: the type + + + .. cpp:function:: std::string GetReference() + + Retrieves the reference of the port, only used for input ports + + :returns: the reference + + + .. cpp:function:: void SetReference(const std::string & sReference) + + Sets the reference of the port, only used for input ports + + :param sReference: the reference + + +.. cpp:type:: std::shared_ptr Lib3MF::PImplicitPort + + Shared pointer to CImplicitPort to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_ImplicitPortIterator.rst b/Documentation/source/Cpp/lib3mf_ImplicitPortIterator.rst new file mode 100644 index 000000000..7af7a56c0 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ImplicitPortIterator.rst @@ -0,0 +1,23 @@ + +CImplicitPortIterator +==================================================================================================== + + +.. cpp:class:: Lib3MF::CImplicitPortIterator : public CIterator + + + + + + + .. cpp:function:: PImplicitPort GetCurrent() + + Returns the current element + + :returns: The current element + + +.. cpp:type:: std::shared_ptr Lib3MF::PImplicitPortIterator + + Shared pointer to CImplicitPortIterator to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_InverseNode.rst b/Documentation/source/Cpp/lib3mf_InverseNode.rst new file mode 100644 index 000000000..4572fad08 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_InverseNode.rst @@ -0,0 +1,16 @@ + +CInverseNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CInverseNode : public COneInputNode + + Computes the inverse of a matrix + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PInverseNode + + Shared pointer to CInverseNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_Iterator.rst b/Documentation/source/Cpp/lib3mf_Iterator.rst new file mode 100644 index 000000000..1133a9daf --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_Iterator.rst @@ -0,0 +1,37 @@ + +CIterator +==================================================================================================== + + +.. cpp:class:: Lib3MF::CIterator : public CBase + + + + + + + .. cpp:function:: bool MoveNext() + + Iterates to the next item in the list. + + :returns: Iterates to the next item in the list. + + + .. cpp:function:: bool MovePrevious() + + Iterates to the previous item in the list. + + :returns: Iterates to the previous item in the list. + + + .. cpp:function:: Lib3MF_uint64 Count() + + Returns the number of items the iterator captures. + + :returns: returns the number of items the iterator captures. + + +.. cpp:type:: std::shared_ptr Lib3MF::PIterator + + Shared pointer to CIterator to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_KeyStore.rst b/Documentation/source/Cpp/lib3mf_KeyStore.rst index a60c35630..42a880bc8 100644 --- a/Documentation/source/Cpp/lib3mf_KeyStore.rst +++ b/Documentation/source/Cpp/lib3mf_KeyStore.rst @@ -35,7 +35,7 @@ CKeyStore :returns: The consumer instance - .. cpp:function:: void RemoveConsumer(CConsumer * pConsumer) + .. cpp:function:: void RemoveConsumer(classParam pConsumer) Removes a consumer from the keystore @@ -72,14 +72,14 @@ CKeyStore :returns: The resource data group instance - .. cpp:function:: void RemoveResourceDataGroup(CResourceDataGroup * pResourceDataGroup) + .. cpp:function:: void RemoveResourceDataGroup(classParam pResourceDataGroup) Removes a resource data group :param pResourceDataGroup: The resource data group instance - .. cpp:function:: PResourceDataGroup FindResourceDataGroup(CPackagePart * pPartPath) + .. cpp:function:: PResourceDataGroup FindResourceDataGroup(classParam pPartPath) Finds a resource data group that contains a particular resourcedata @@ -87,7 +87,7 @@ CKeyStore :returns: The data resource instance - .. cpp:function:: PResourceData AddResourceData(CResourceDataGroup * pResourceDataGroup, CPackagePart * pPartPath, const eEncryptionAlgorithm eAlgorithm, const eCompression eCompression, const CInputVector & AdditionalAuthenticationDataBuffer) + .. cpp:function:: PResourceData AddResourceData(classParam pResourceDataGroup, classParam pPartPath, const eEncryptionAlgorithm eAlgorithm, const eCompression eCompression, const CInputVector & AdditionalAuthenticationDataBuffer) Add resourcedata to resourcedatagroup element @@ -99,14 +99,14 @@ CKeyStore :returns: The data resource instance - .. cpp:function:: void RemoveResourceData(CResourceData * pResourceData) + .. cpp:function:: void RemoveResourceData(classParam pResourceData) Removes a resource data :param pResourceData: The resource data to be removed - .. cpp:function:: PResourceData FindResourceData(CPackagePart * pResourcePath) + .. cpp:function:: PResourceData FindResourceData(classParam pResourcePath) Finds a resource data on this resource group diff --git a/Documentation/source/Cpp/lib3mf_LengthNode.rst b/Documentation/source/Cpp/lib3mf_LengthNode.rst new file mode 100644 index 000000000..fe1b9e065 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_LengthNode.rst @@ -0,0 +1,16 @@ + +CLengthNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CLengthNode : public COneInputNode + + Calculates the length of a vector + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PLengthNode + + Shared pointer to CLengthNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_LevelSet.rst b/Documentation/source/Cpp/lib3mf_LevelSet.rst new file mode 100644 index 000000000..ac3c01632 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_LevelSet.rst @@ -0,0 +1,128 @@ + +CLevelSet +==================================================================================================== + + +.. cpp:class:: Lib3MF::CLevelSet : public CObject + + + + + + + .. cpp:function:: PFunction GetFunction() + + Returns the function that is used as boundary shape. + + :returns: the function to use as boundary shape + + + .. cpp:function:: void SetFunction(classParam pTheFunction) + + Sets the function to use as boundary shape. + + :param pTheFunction: the function to use as boundary shape + + + .. cpp:function:: sTransform GetTransform() + + Returns the transformation matrix into the coordinate system of the referenced Function. + + :returns: the transformation matrix + + + .. cpp:function:: void SetTransform(const sTransform & Transform) + + Sets the transformation matrix into the coordinate system of the referenced Function. + + :param Transform: new transformation matrix + + + .. cpp:function:: std::string GetChannelName() + + Returns the name of the function output channel to use. + + :returns: the name of the function output channel + + + .. cpp:function:: void SetChannelName(const std::string & sChannelName) + + Sets the name of the function output channel to use. + + :param sChannelName: new name of the function output channel + + + .. cpp:function:: void SetMinFeatureSize(const Lib3MF_double dMinFeatureSize) + + Sets the minimal feature size as a hint for the function evaluator + + :param dMinFeatureSize: minimal feature size + + + .. cpp:function:: Lib3MF_double GetMinFeatureSize() + + Returns the minimal feature size as a hint for the function evaluator + + :returns: minimal feature size + + + .. cpp:function:: void SetFallBackValue(const Lib3MF_double dFallBackValue) + + Sets the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). + + :param dFallBackValue: fallback value + + + .. cpp:function:: Lib3MF_double GetFallBackValue() + + Returns the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf). + + :returns: fallback value + + + .. cpp:function:: void SetMeshBBoxOnly(const bool bMeshBBoxOnly) + + If set only the bounding box of the mesh is intersected with the boundary + + :param bMeshBBoxOnly: If set only the bounding box of the mesh is intersected with the boundary + + + .. cpp:function:: bool GetMeshBBoxOnly() + + If set only the bounding box of the mesh is intersected with the boundary + + :returns: If set only the bounding box of the mesh is intersected with the boundary + + + .. cpp:function:: void SetMesh(classParam pTheMesh) + + Sets the mesh to use as evaluation domain + + :param pTheMesh: The mesh + + + .. cpp:function:: PMeshObject GetMesh() + + Returns the mesh that is used as evaluation domain + + :returns: The mesh + + + .. cpp:function:: PVolumeData GetVolumeData() + + Retrieves the VolumeData this Object. + + :returns: the VolumeData of this Object + + + .. cpp:function:: void SetVolumeData(classParam pTheVolumeData) + + Sets the VolumeData of this LevelSet. + + :param pTheVolumeData: the VolumeData of this MeshObject + + +.. cpp:type:: std::shared_ptr Lib3MF::PLevelSet + + Shared pointer to CLevelSet to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_LevelSetIterator.rst b/Documentation/source/Cpp/lib3mf_LevelSetIterator.rst new file mode 100644 index 000000000..39b0c6758 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_LevelSetIterator.rst @@ -0,0 +1,23 @@ + +CLevelSetIterator +==================================================================================================== + + +.. cpp:class:: Lib3MF::CLevelSetIterator : public CResourceIterator + + + + + + + .. cpp:function:: PLevelSet GetCurrentLevelSet() + + Returns the LevelSet the iterator points at. + + :returns: returns the MeshObject instance. + + +.. cpp:type:: std::shared_ptr Lib3MF::PLevelSetIterator + + Shared pointer to CLevelSetIterator to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_Log10Node.rst b/Documentation/source/Cpp/lib3mf_Log10Node.rst new file mode 100644 index 000000000..52030158a --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_Log10Node.rst @@ -0,0 +1,16 @@ + +CLog10Node +==================================================================================================== + + +.. cpp:class:: Lib3MF::CLog10Node : public COneInputNode + + Logarithmus to the base 10 + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PLog10Node + + Shared pointer to CLog10Node to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_Log2Node.rst b/Documentation/source/Cpp/lib3mf_Log2Node.rst new file mode 100644 index 000000000..96575cde7 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_Log2Node.rst @@ -0,0 +1,16 @@ + +CLog2Node +==================================================================================================== + + +.. cpp:class:: Lib3MF::CLog2Node : public COneInputNode + + Logarithmus to the base 2 + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PLog2Node + + Shared pointer to CLog2Node to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_LogNode.rst b/Documentation/source/Cpp/lib3mf_LogNode.rst new file mode 100644 index 000000000..33000dd63 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_LogNode.rst @@ -0,0 +1,16 @@ + +CLogNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CLogNode : public COneInputNode + + Natural logarithmus + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PLogNode + + Shared pointer to CLogNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_MatVecMultiplicationNode.rst b/Documentation/source/Cpp/lib3mf_MatVecMultiplicationNode.rst new file mode 100644 index 000000000..c04f5a549 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_MatVecMultiplicationNode.rst @@ -0,0 +1,16 @@ + +CMatVecMultiplicationNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CMatVecMultiplicationNode : public CTwoInputNode + + Multiplies a matrix with a vector + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PMatVecMultiplicationNode + + Shared pointer to CMatVecMultiplicationNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_MaterialMapping.rst b/Documentation/source/Cpp/lib3mf_MaterialMapping.rst new file mode 100644 index 000000000..736325858 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_MaterialMapping.rst @@ -0,0 +1,16 @@ + +CMaterialMapping +==================================================================================================== + + +.. cpp:class:: Lib3MF::CMaterialMapping : public CFunctionReference + + + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PMaterialMapping + + Shared pointer to CMaterialMapping to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_MatrixFromColumnsNode.rst b/Documentation/source/Cpp/lib3mf_MatrixFromColumnsNode.rst new file mode 100644 index 000000000..676952ca8 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_MatrixFromColumnsNode.rst @@ -0,0 +1,51 @@ + +CMatrixFromColumnsNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CMatrixFromColumnsNode : public CImplicitNode + + Composes a 4x4 matrix from four column vectors A,B,C,D + + + + + .. cpp:function:: PImplicitPort GetInputA() + + Retrieves the input for the first column + + :returns: the input for the first column + + + .. cpp:function:: PImplicitPort GetInputB() + + Retrieves the input for the second column + + :returns: the input for the second column + + + .. cpp:function:: PImplicitPort GetInputC() + + Retrieves the input for the third column + + :returns: the input for the third column + + + .. cpp:function:: PImplicitPort GetInputD() + + Retrieves the input for the fourth column + + :returns: the input for the fourth column + + + .. cpp:function:: PImplicitPort GetOutputResult() + + Retrieves the output + + :returns: the output + + +.. cpp:type:: std::shared_ptr Lib3MF::PMatrixFromColumnsNode + + Shared pointer to CMatrixFromColumnsNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_MatrixFromRowsNode.rst b/Documentation/source/Cpp/lib3mf_MatrixFromRowsNode.rst new file mode 100644 index 000000000..40ebb7685 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_MatrixFromRowsNode.rst @@ -0,0 +1,51 @@ + +CMatrixFromRowsNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CMatrixFromRowsNode : public CImplicitNode + + Composes a 4x4 matrix from four row vectors A,B,C,D + + + + + .. cpp:function:: PImplicitPort GetInputA() + + Retrieves the input for the first row + + :returns: the input for the first row + + + .. cpp:function:: PImplicitPort GetInputB() + + Retrieves the input for the second row + + :returns: the input for the second row + + + .. cpp:function:: PImplicitPort GetInputC() + + Retrieves the input for the third row + + :returns: the input for the third row + + + .. cpp:function:: PImplicitPort GetInputD() + + Retrieves the input for the fourth row + + :returns: the input for the fourth row + + + .. cpp:function:: PImplicitPort GetOutputResult() + + Retrieves the output + + :returns: the output + + +.. cpp:type:: std::shared_ptr Lib3MF::PMatrixFromRowsNode + + Shared pointer to CMatrixFromRowsNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_MaxNode.rst b/Documentation/source/Cpp/lib3mf_MaxNode.rst new file mode 100644 index 000000000..c3d142892 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_MaxNode.rst @@ -0,0 +1,16 @@ + +CMaxNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CMaxNode : public CTwoInputNode + + Calculates the maximum of two values + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PMaxNode + + Shared pointer to CMaxNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_MeshNode.rst b/Documentation/source/Cpp/lib3mf_MeshNode.rst new file mode 100644 index 000000000..096d96cb4 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_MeshNode.rst @@ -0,0 +1,37 @@ + +CMeshNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CMeshNode : public CImplicitNode + + Signed distance to mesh + + + + + .. cpp:function:: PImplicitPort GetInputMesh() + + Retrieves the input for the model resource id of the mesh + + :returns: the input port for the model resource id of the mesh + + + .. cpp:function:: PImplicitPort GetInputPos() + + Retrieves the input for the position + + :returns: the input port for the position + + + .. cpp:function:: PImplicitPort GetOutputDistance() + + Retrieves the output + + :returns: the output port for the signed distance to the mesh + + +.. cpp:type:: std::shared_ptr Lib3MF::PMeshNode + + Shared pointer to CMeshNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_MeshObject.rst b/Documentation/source/Cpp/lib3mf_MeshObject.rst index 00cea2dd9..53e009acc 100644 --- a/Documentation/source/Cpp/lib3mf_MeshObject.rst +++ b/Documentation/source/Cpp/lib3mf_MeshObject.rst @@ -161,6 +161,60 @@ CMeshObject :returns: the BeamLattice within this MeshObject + .. cpp:function:: PVolumeData GetVolumeData() + + Retrieves the VolumeData of this MeshObject. + + :returns: the VolumeData of this MeshObject + + + .. cpp:function:: void SetVolumeData(classParam pTheVolumeData) + + Sets the VolumeData of this MeshObject. + + :param pTheVolumeData: the VolumeData of this MeshObject + + + .. cpp:function:: PTriangleSet AddTriangleSet(const std::string & sIdentifier, const std::string & sName) + + Adds a new triangle set. + + :param sIdentifier: the new identifier. MUST be unique within the mesh. MUST NOT be an empty string + :param sName: the human readable name. MUST NOT be an empty string + :returns: the new Triangle Set Instance. + + + .. cpp:function:: bool HasTriangleSet(const std::string & sIdentifier) + + Checks if a triangle set exists. + + :param sIdentifier: the identifier to be found. + :returns: flag if the triangles set exists. + + + .. cpp:function:: PTriangleSet FindTriangleSet(const std::string & sIdentifier) + + Finds a new triangle set by identifier. Fails if not existing. + + :param sIdentifier: the identifier to be found. + :returns: the triangle Set Instance. + + + .. cpp:function:: Lib3MF_uint32 GetTriangleSetCount() + + Returns number of triangle sets. + + :returns: the number of triangle sets of this mesh. + + + .. cpp:function:: PTriangleSet GetTriangleSet(const Lib3MF_uint32 nIndex) + + Returns a specific triangle set by index. + + :param nIndex: the index of the triangle set. + :returns: the triangle Set Instance. + + .. cpp:type:: std::shared_ptr Lib3MF::PMeshObject Shared pointer to CMeshObject to easily allow reference counting. diff --git a/Documentation/source/Cpp/lib3mf_MetaDataGroup.rst b/Documentation/source/Cpp/lib3mf_MetaDataGroup.rst index 466b68cee..6645b87c0 100644 --- a/Documentation/source/Cpp/lib3mf_MetaDataGroup.rst +++ b/Documentation/source/Cpp/lib3mf_MetaDataGroup.rst @@ -41,7 +41,7 @@ CMetaDataGroup :param nIndex: Index of the metadata to remove - .. cpp:function:: void RemoveMetaData(CMetaData * pTheMetaData) + .. cpp:function:: void RemoveMetaData(classParam pTheMetaData) removes metadata from the model. @@ -56,7 +56,7 @@ CMetaDataGroup :param sName: the name of the metadata :param sValue: the value of the metadata :param sType: the type of the metadata - :param bMustPreserve: shuold the metadata be preserved + :param bMustPreserve: should the metadata be preserved :returns: a new instance of the metadata diff --git a/Documentation/source/Cpp/lib3mf_MinNode.rst b/Documentation/source/Cpp/lib3mf_MinNode.rst new file mode 100644 index 000000000..fa3cc0c6c --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_MinNode.rst @@ -0,0 +1,16 @@ + +CMinNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CMinNode : public CTwoInputNode + + Calculates the minimum of two values + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PMinNode + + Shared pointer to CMinNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_ModNode.rst b/Documentation/source/Cpp/lib3mf_ModNode.rst new file mode 100644 index 000000000..5e7cf71f5 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ModNode.rst @@ -0,0 +1,16 @@ + +CModNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CModNode : public CTwoInputNode + + Calculates the modulo of two values (GLSL mod) + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PModNode + + Shared pointer to CModNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_Model.rst b/Documentation/source/Cpp/lib3mf_Model.rst index 40726b357..d29144139 100644 --- a/Documentation/source/Cpp/lib3mf_Model.rst +++ b/Documentation/source/Cpp/lib3mf_Model.rst @@ -69,6 +69,14 @@ CModel :returns: string identifier for the file type + .. cpp:function:: PResource GetResourceByID(const Lib3MF_uint32 nUniqueResourceID) + + finds a model resource by its UniqueResourceID + + :param nUniqueResourceID: UniqueResourceID + :returns: returns the resource instance + + .. cpp:function:: PTexture2D GetTexture2DByID(const Lib3MF_uint32 nUniqueResourceID) finds a model texture by its UniqueResourceID @@ -149,6 +157,14 @@ CModel :returns: returns the slicestack instance + .. cpp:function:: PLevelSet GetLevelSetByID(const Lib3MF_uint32 nUniqueResourceID) + + finds a level set object by its UniqueResourceID + + :param nUniqueResourceID: UniqueResourceID + :returns: returns the level set object instance + + .. cpp:function:: std::string GetBuildUUID(bool & bHasUUID) returns, whether a build has a UUID and, if true, the build's UUID @@ -255,6 +271,13 @@ CModel :returns: returns the iterator instance. + .. cpp:function:: PImage3DIterator GetImage3Ds() + + creates a resource iterator instance with all image3d resources. + + :returns: returns the iterator instance. + + .. cpp:function:: PModel MergeToModel() Merges all components and objects which are referenced by a build item into a mesh. The memory is duplicated and a new model is created. @@ -262,6 +285,13 @@ CModel :returns: returns the merged model instance + .. cpp:function:: void MergeFromModel(classParam pModelInstance) + + Merges the given model into this model. + + :param pModelInstance: model to be merged + + .. cpp:function:: PMeshObject AddMeshObject() adds an empty mesh object to the model. @@ -284,7 +314,7 @@ CModel :returns: returns the new slicestack instance - .. cpp:function:: PTexture2D AddTexture2DFromAttachment(CAttachment * pTextureAttachment) + .. cpp:function:: PTexture2D AddTexture2DFromAttachment(classParam pTextureAttachment) adds a texture2d resource to the model. Its path is given by that of an existing attachment. @@ -306,7 +336,7 @@ CModel :returns: returns the new ColorGroup instance. - .. cpp:function:: PTexture2DGroup AddTexture2DGroup(CTexture2D * pTexture2DInstance) + .. cpp:function:: PTexture2DGroup AddTexture2DGroup(classParam pTexture2DInstance) adds an empty Texture2DGroup resource to the model. @@ -314,7 +344,7 @@ CModel :returns: returns the new Texture2DGroup instance. - .. cpp:function:: PCompositeMaterials AddCompositeMaterials(CBaseMaterialGroup * pBaseMaterialGroupInstance) + .. cpp:function:: PCompositeMaterials AddCompositeMaterials(classParam pBaseMaterialGroupInstance) adds an empty CompositeMaterials resource to the model. @@ -329,7 +359,25 @@ CModel :returns: returns the new MultiPropertyGroup instance. - .. cpp:function:: PBuildItem AddBuildItem(CObject * pObject, const sTransform & Transform) + .. cpp:function:: PImageStack AddImageStack(const Lib3MF_uint32 nColumnCount, const Lib3MF_uint32 nRowCount, const Lib3MF_uint32 nSheetCount) + + creates a new 3D Image Resource + + :param nColumnCount: the number of columns in each sheet. + :param nRowCount: the number of rows in each sheet. + :param nSheetCount: the number of sheets in the image stack. + :returns: returns the new ImageStack instance + + + .. cpp:function:: PImageStack GetImageStackByID(const Lib3MF_uint32 nUniqueResourceID) + + finds an ImageStack object by its UniqueResourceID + + :param nUniqueResourceID: UniqueResourceID + :returns: returns the image stack instance + + + .. cpp:function:: PBuildItem AddBuildItem(classParam pObject, const sTransform & Transform) adds a build item to the model. @@ -338,7 +386,7 @@ CModel :returns: returns the build item instance. - .. cpp:function:: void RemoveBuildItem(CBuildItem * pBuildItemInstance) + .. cpp:function:: void RemoveBuildItem(classParam pBuildItemInstance) removes a build item from the model @@ -361,7 +409,7 @@ CModel :returns: Instance of the attachment object - .. cpp:function:: void RemoveAttachment(CAttachment * pAttachmentInstance) + .. cpp:function:: void RemoveAttachment(classParam pAttachmentInstance) Removes attachment from the model. @@ -448,6 +496,56 @@ CModel :returns: The package keystore + .. cpp:function:: PFunctionIterator GetFunctions() + + creates a resource iterator for all functions + + :returns: returns the resource iterator + + + .. cpp:function:: PImplicitFunction AddImplicitFunction() + + adds a function described by nodes to the model + + :returns: returns the function instance + + + .. cpp:function:: PFunctionFromImage3D AddFunctionFromImage3D(classParam pImage3DInstance) + + adds a function defined by an image3d to the model + + :param pImage3DInstance: the Image3D-instance used for this function + :returns: returns the function instance + + + .. cpp:function:: PVolumeData AddVolumeData() + + adds a volume data resource to the model. + + :returns: returns the new volume data instance. + + + .. cpp:function:: PLevelSet AddLevelSet() + + adds an empty boundary shape object to the model. + + :returns: returns the mesh object instance + + + .. cpp:function:: PLevelSetIterator GetLevelSets() + + creates a resource iterator instance with all boundary shape resources. + + :returns: returns the iterator instance. + + + .. cpp:function:: void RemoveResource(classParam pResource) + + Removes a resource from the model + + :param pResource: The resource to remove + + .. cpp:type:: std::shared_ptr Lib3MF::PModel Shared pointer to CModel to easily allow reference counting. diff --git a/Documentation/source/Cpp/lib3mf_MultiplicationNode.rst b/Documentation/source/Cpp/lib3mf_MultiplicationNode.rst new file mode 100644 index 000000000..78d827ff0 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_MultiplicationNode.rst @@ -0,0 +1,16 @@ + +CMultiplicationNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CMultiplicationNode : public CTwoInputNode + + Multiplies two values (scalar or vector) + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PMultiplicationNode + + Shared pointer to CMultiplicationNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_NodeIterator.rst b/Documentation/source/Cpp/lib3mf_NodeIterator.rst new file mode 100644 index 000000000..b344906b3 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_NodeIterator.rst @@ -0,0 +1,23 @@ + +CNodeIterator +==================================================================================================== + + +.. cpp:class:: Lib3MF::CNodeIterator : public CIterator + + + + + + + .. cpp:function:: PImplicitNode GetCurrent() + + Returns the current element + + :returns: The current element + + +.. cpp:type:: std::shared_ptr Lib3MF::PNodeIterator + + Shared pointer to CNodeIterator to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_NormalizeDistanceNode.rst b/Documentation/source/Cpp/lib3mf_NormalizeDistanceNode.rst new file mode 100644 index 000000000..58fb3d6de --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_NormalizeDistanceNode.rst @@ -0,0 +1,72 @@ + +CNormalizeDistanceNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CNormalizeDistanceNode : public CImplicitNode + + Normalized signed distance from referenced function + + + + + .. cpp:function:: PImplicitPort GetInputFunctionID() + + Retrieves the input for the function id + + :returns: the input port for the function + + + .. cpp:function:: PImplicitPort GetInputPos() + + Retrieves the input for the position + + :returns: the input port for the position (vector) + + + .. cpp:function:: PImplicitPort GetInputStep() + + Retrieves the input for the finite difference step + + :returns: the input port for the finite difference step + + + .. cpp:function:: void SetScalarOutputName(const std::string & sScalarOutputName) + + Sets the name of the referenced scalar output + + :param sScalarOutputName: the name of the scalar output of the referenced function + + + .. cpp:function:: std::string GetScalarOutputName() + + Retrieves the name of the referenced scalar output + + :returns: the name of the scalar output of the referenced function + + + .. cpp:function:: void SetVectorInputName(const std::string & sVectorInputName) + + Sets the name of the referenced vector input + + :param sVectorInputName: the name of the vector input (float3) of the referenced function + + + .. cpp:function:: std::string GetVectorInputName() + + Retrieves the name of the referenced vector input + + :returns: the name of the vector input (float3) of the referenced function + + + .. cpp:function:: PImplicitPort GetOutputResult() + + Retrieves the normalized result output + + :returns: the output port for the normalized distance + + +.. cpp:type:: std::shared_ptr Lib3MF::PNormalizeDistanceNode + + Shared pointer to CNormalizeDistanceNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_Object.rst b/Documentation/source/Cpp/lib3mf_Object.rst index 4f497cc10..b425764c1 100644 --- a/Documentation/source/Cpp/lib3mf_Object.rst +++ b/Documentation/source/Cpp/lib3mf_Object.rst @@ -66,6 +66,13 @@ CObject :returns: returns, whether the object is a components object + .. cpp:function:: bool IsLevelSetObject() + + Retrieves, if an object is a level set object + + :returns: returns, whether the object is a level set object + + .. cpp:function:: bool IsValid() Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. @@ -73,7 +80,7 @@ CObject :returns: returns whether the object is a valid object description - .. cpp:function:: void SetAttachmentAsThumbnail(CAttachment * pAttachment) + .. cpp:function:: void SetAttachmentAsThumbnail(classParam pAttachment) Use an existing attachment as thumbnail for this object @@ -157,7 +164,7 @@ CObject :returns: returns the slicestack instance - .. cpp:function:: void AssignSliceStack(CSliceStack * pSliceStackInstance) + .. cpp:function:: void AssignSliceStack(classParam pSliceStackInstance) assigns a slicestack to the object diff --git a/Documentation/source/Cpp/lib3mf_OneInputNode.rst b/Documentation/source/Cpp/lib3mf_OneInputNode.rst new file mode 100644 index 000000000..f6ad910fe --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_OneInputNode.rst @@ -0,0 +1,30 @@ + +COneInputNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::COneInputNode : public CImplicitNode + + Node with one input + + + + + .. cpp:function:: PImplicitPort GetInputA() + + Retrieves the input + + :returns: the input + + + .. cpp:function:: PImplicitPort GetOutputResult() + + Retrieves the output + + :returns: the output + + +.. cpp:type:: std::shared_ptr Lib3MF::POneInputNode + + Shared pointer to COneInputNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_PowNode.rst b/Documentation/source/Cpp/lib3mf_PowNode.rst new file mode 100644 index 000000000..917afb6a2 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_PowNode.rst @@ -0,0 +1,16 @@ + +CPowNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CPowNode : public CTwoInputNode + + Calculates the power A by B + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PPowNode + + Shared pointer to CPowNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_Resource.rst b/Documentation/source/Cpp/lib3mf_Resource.rst index 28156d560..d30576ed2 100644 --- a/Documentation/source/Cpp/lib3mf_Resource.rst +++ b/Documentation/source/Cpp/lib3mf_Resource.rst @@ -31,7 +31,7 @@ CResource :returns: the PackagePart within which this resource resides. - .. cpp:function:: void SetPackagePart(CPackagePart * pPackagePart) + .. cpp:function:: void SetPackagePart(classParam pPackagePart) Sets the new PackagePart within which this resource resides diff --git a/Documentation/source/Cpp/lib3mf_ResourceDataGroup.rst b/Documentation/source/Cpp/lib3mf_ResourceDataGroup.rst index eef15ab28..3b83e6cab 100644 --- a/Documentation/source/Cpp/lib3mf_ResourceDataGroup.rst +++ b/Documentation/source/Cpp/lib3mf_ResourceDataGroup.rst @@ -17,7 +17,7 @@ CResourceDataGroup :returns: The new resourcedatagroup keyuuid. - .. cpp:function:: PAccessRight AddAccessRight(CConsumer * pConsumer, const eWrappingAlgorithm eWrappingAlgorithm, const eMgfAlgorithm eMgfAlgorithm, const eDigestMethod eDigestMethod) + .. cpp:function:: PAccessRight AddAccessRight(classParam pConsumer, const eWrappingAlgorithm eWrappingAlgorithm, const eMgfAlgorithm eMgfAlgorithm, const eDigestMethod eDigestMethod) Add accessright to resourcedatagroup element @@ -28,7 +28,7 @@ CResourceDataGroup :returns: The acess right instance - .. cpp:function:: PAccessRight FindAccessRightByConsumer(CConsumer * pConsumer) + .. cpp:function:: PAccessRight FindAccessRightByConsumer(classParam pConsumer) Finds the AccessRight associated with a Consumer @@ -36,7 +36,7 @@ CResourceDataGroup :returns: The AcessRight instance - .. cpp:function:: void RemoveAccessRight(CConsumer * pConsumer) + .. cpp:function:: void RemoveAccessRight(classParam pConsumer) Removes access from a Consumer on this resource data group diff --git a/Documentation/source/Cpp/lib3mf_ResourceIdNode.rst b/Documentation/source/Cpp/lib3mf_ResourceIdNode.rst new file mode 100644 index 000000000..2b1632f6e --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_ResourceIdNode.rst @@ -0,0 +1,37 @@ + +CResourceIdNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CResourceIdNode : public CImplicitNode + + Resource ID + + + + + .. cpp:function:: void SetResource(classParam pResource) + + Sets the Resource that the resourceid attribute of the node will point to + + :param pResource: the resource + + + .. cpp:function:: PResource GetResource() + + Retrieves the resource of the node + + :returns: the resource + + + .. cpp:function:: PImplicitPort GetOutputValue() + + Retrieves the output + + :returns: the output + + +.. cpp:type:: std::shared_ptr Lib3MF::PResourceIdNode + + Shared pointer to CResourceIdNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_RoundNode.rst b/Documentation/source/Cpp/lib3mf_RoundNode.rst new file mode 100644 index 000000000..9cee926bf --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_RoundNode.rst @@ -0,0 +1,16 @@ + +CRoundNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CRoundNode : public COneInputNode + + Rounds a scalar value to the nearest integer + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PRoundNode + + Shared pointer to CRoundNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_SelectNode.rst b/Documentation/source/Cpp/lib3mf_SelectNode.rst new file mode 100644 index 000000000..5ddf94904 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_SelectNode.rst @@ -0,0 +1,37 @@ + +CSelectNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CSelectNode : public COneInputNode + + If A is less B returns C, else D + + + + + .. cpp:function:: PImplicitPort GetInputB() + + Retrieves the second input + + :returns: the second input + + + .. cpp:function:: PImplicitPort GetInputC() + + Retrieves the third input + + :returns: the third input + + + .. cpp:function:: PImplicitPort GetInputD() + + Retrieves the fourth input + + :returns: the fourth input + + +.. cpp:type:: std::shared_ptr Lib3MF::PSelectNode + + Shared pointer to CSelectNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_SignNode.rst b/Documentation/source/Cpp/lib3mf_SignNode.rst new file mode 100644 index 000000000..600d856de --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_SignNode.rst @@ -0,0 +1,16 @@ + +CSignNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CSignNode : public COneInputNode + + Returns the sign + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PSignNode + + Shared pointer to CSignNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_SinNode.rst b/Documentation/source/Cpp/lib3mf_SinNode.rst new file mode 100644 index 000000000..d660aa172 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_SinNode.rst @@ -0,0 +1,16 @@ + +CSinNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CSinNode : public COneInputNode + + Calculates the sinus + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PSinNode + + Shared pointer to CSinNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_SinhNode.rst b/Documentation/source/Cpp/lib3mf_SinhNode.rst new file mode 100644 index 000000000..763bfa8f7 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_SinhNode.rst @@ -0,0 +1,16 @@ + +CSinhNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CSinhNode : public COneInputNode + + Calculates the hyperbolic sine + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PSinhNode + + Shared pointer to CSinhNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_SliceStack.rst b/Documentation/source/Cpp/lib3mf_SliceStack.rst index 50494d405..ad540fd53 100644 --- a/Documentation/source/Cpp/lib3mf_SliceStack.rst +++ b/Documentation/source/Cpp/lib3mf_SliceStack.rst @@ -47,7 +47,7 @@ CSliceStack :returns: the number of slicereferences - .. cpp:function:: void AddSliceStackReference(CSliceStack * pTheSliceStack) + .. cpp:function:: void AddSliceStackReference(classParam pTheSliceStack) Adds another existing slicestack as sliceref in this slicestack diff --git a/Documentation/source/Cpp/lib3mf_SqrtNode.rst b/Documentation/source/Cpp/lib3mf_SqrtNode.rst new file mode 100644 index 000000000..3a351dabb --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_SqrtNode.rst @@ -0,0 +1,16 @@ + +CSqrtNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CSqrtNode : public COneInputNode + + Calculates the square root + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PSqrtNode + + Shared pointer to CSqrtNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_SubtractionNode.rst b/Documentation/source/Cpp/lib3mf_SubtractionNode.rst new file mode 100644 index 000000000..e7837b3b3 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_SubtractionNode.rst @@ -0,0 +1,16 @@ + +CSubtractionNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CSubtractionNode : public CTwoInputNode + + Subtracts two values (scalar or vector) + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PSubtractionNode + + Shared pointer to CSubtractionNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_TanNode.rst b/Documentation/source/Cpp/lib3mf_TanNode.rst new file mode 100644 index 000000000..8edee45d1 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_TanNode.rst @@ -0,0 +1,16 @@ + +CTanNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CTanNode : public COneInputNode + + Calculates the tangent + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PTanNode + + Shared pointer to CTanNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_TanhNode.rst b/Documentation/source/Cpp/lib3mf_TanhNode.rst new file mode 100644 index 000000000..48f88c824 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_TanhNode.rst @@ -0,0 +1,16 @@ + +CTanhNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CTanhNode : public COneInputNode + + Calculates the hyperbolic tangent + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PTanhNode + + Shared pointer to CTanhNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_Texture2D.rst b/Documentation/source/Cpp/lib3mf_Texture2D.rst index 69d57e526..e95155a93 100644 --- a/Documentation/source/Cpp/lib3mf_Texture2D.rst +++ b/Documentation/source/Cpp/lib3mf_Texture2D.rst @@ -17,7 +17,7 @@ CTexture2D :returns: attachment that holds the texture's image information. - .. cpp:function:: void SetAttachment(CAttachment * pAttachment) + .. cpp:function:: void SetAttachment(classParam pAttachment) Sets the texture's package path to the path of the attachment. diff --git a/Documentation/source/Cpp/lib3mf_TransposeNode.rst b/Documentation/source/Cpp/lib3mf_TransposeNode.rst new file mode 100644 index 000000000..5572b0ce6 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_TransposeNode.rst @@ -0,0 +1,16 @@ + +CTransposeNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CTransposeNode : public COneInputNode + + Transposes a matrix + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PTransposeNode + + Shared pointer to CTransposeNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_TriangleSet.rst b/Documentation/source/Cpp/lib3mf_TriangleSet.rst new file mode 100644 index 000000000..c9525cb78 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_TriangleSet.rst @@ -0,0 +1,107 @@ + +CTriangleSet +==================================================================================================== + + +.. cpp:class:: Lib3MF::CTriangleSet : public CBase + + + + + + + .. cpp:function:: void SetName(const std::string & sName) + + sets the name of the triangle set + + :param sName: the new name + + + .. cpp:function:: std::string GetName() + + returns the name of the triangle set + + :returns: returns the name + + + .. cpp:function:: void SetIdentifier(const std::string & sIdentifier) + + sets the identifier of the triangle set. + + :param sIdentifier: the new identifier. MUST be unique within the mesh. MUST NOT be an empty string + + + .. cpp:function:: std::string GetIdentifier() + + returns the identifier of the triangle set + + :returns: returns the identifier + + + .. cpp:function:: void AddTriangle(const Lib3MF_uint32 nTriangleIndex) + + adds a triangle to the set. Does nothing if triangle is already in the set. + + :param nTriangleIndex: Triangle index to add. MUST be between 0 and TriangleCount - 1. + + + .. cpp:function:: void RemoveTriangle(const Lib3MF_uint32 nTriangleIndex) + + removes a triangle from the set + + :param nTriangleIndex: Triangle index to remove. MUST be between 0 and TriangleCount - 1. + + + .. cpp:function:: void Clear() + + clears all triangles from the list + + + + .. cpp:function:: void SetTriangleList(const CInputVector & TriangleIndicesBuffer) + + Sets all triangles in the list, while clearing old values. Duplicates will be merged. + + :param TriangleIndicesBuffer: Triangle indices to add. Every element MUST be between 0 and TriangleCount - 1. + + + .. cpp:function:: void GetTriangleList(std::vector & TriangleIndicesBuffer) + + Retrieves all the triangles in the TriangleSet + + :param TriangleIndicesBuffer: retrieves the indices of the triangles in this TriangleSet + + + .. cpp:function:: void AddTriangleList(const CInputVector & TriangleIndicesBuffer) + + Adds multiple triangles in the list. Duplicates will be merged. + + :param TriangleIndicesBuffer: Triangle indices to add. Every element MUST be between 0 and TriangleCount - 1. + + + .. cpp:function:: void Merge(classParam pOtherTriangleSet, const bool bDeleteOther) + + Merges another Triangle set. + + :param pOtherTriangleSet: Other triangle set to merge. + :param bDeleteOther: Flag if other triangle set is getting removed. + + + .. cpp:function:: void DeleteSet() + + Deletes the whole set from the mesh. + + + + .. cpp:function:: PTriangleSet Duplicate(const std::string & sIdentifier) + + Duplicates the set in the mesh. + + :param sIdentifier: the new identifier. MUST be unique within the mesh. MUST NOT be an empty string + :returns: Copy of the triangle set. + + +.. cpp:type:: std::shared_ptr Lib3MF::PTriangleSet + + Shared pointer to CTriangleSet to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_TwoInputNode.rst b/Documentation/source/Cpp/lib3mf_TwoInputNode.rst new file mode 100644 index 000000000..7160ef1be --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_TwoInputNode.rst @@ -0,0 +1,23 @@ + +CTwoInputNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CTwoInputNode : public COneInputNode + + Node + + + + + .. cpp:function:: PImplicitPort GetInputB() + + Retrieves the second input + + :returns: the second input + + +.. cpp:type:: std::shared_ptr Lib3MF::PTwoInputNode + + Shared pointer to CTwoInputNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_UnsignedMeshNode.rst b/Documentation/source/Cpp/lib3mf_UnsignedMeshNode.rst new file mode 100644 index 000000000..ac7dfe30b --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_UnsignedMeshNode.rst @@ -0,0 +1,37 @@ + +CUnsignedMeshNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CUnsignedMeshNode : public CImplicitNode + + Unsigned distance to mesh + + + + + .. cpp:function:: PImplicitPort GetInputMesh() + + Retrieves the input for the model resource id of the mesh + + :returns: the input port for the model resource id of the mesh + + + .. cpp:function:: PImplicitPort GetInputPos() + + Retrieves the input for the position + + :returns: the input port for the position + + + .. cpp:function:: PImplicitPort GetOutputDistance() + + Retrieves the output + + :returns: the output port for the unsigned distance to the mesh + + +.. cpp:type:: std::shared_ptr Lib3MF::PUnsignedMeshNode + + Shared pointer to CUnsignedMeshNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_VectorFromScalarNode.rst b/Documentation/source/Cpp/lib3mf_VectorFromScalarNode.rst new file mode 100644 index 000000000..b8a2a664b --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_VectorFromScalarNode.rst @@ -0,0 +1,16 @@ + +CVectorFromScalarNode +==================================================================================================== + + +.. cpp:class:: Lib3MF::CVectorFromScalarNode : public COneInputNode + + Creates a vector from one scalar values + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PVectorFromScalarNode + + Shared pointer to CVectorFromScalarNode to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_VolumeData.rst b/Documentation/source/Cpp/lib3mf_VolumeData.rst new file mode 100644 index 000000000..818ce52a6 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_VolumeData.rst @@ -0,0 +1,88 @@ + +CVolumeData +==================================================================================================== + + +.. cpp:class:: Lib3MF::CVolumeData : public CResource + + + + + + + .. cpp:function:: PVolumeDataComposite GetComposite() + + Returns the VolumeDataComposite of this VolumeData instance + + :returns: filled with the VolumeDataComposite of this VolumeData instance. + + + .. cpp:function:: PVolumeDataComposite CreateNewComposite() + + Creates a new VolumeDataComposite for this VolumeData instance + + :returns: The new VolumeDataComposite of this VolumeData instance. + + + .. cpp:function:: void RemoveComposite() + + Removes the VolumeDataComposite of this VolumeData instance + + + + .. cpp:function:: PVolumeDataColor GetColor() + + Returns the VolumeDataColor of this VolumeData instance + + :returns: filled with the VolumeDataColor of this VolumeData instance. + + + .. cpp:function:: PVolumeDataColor CreateNewColor(classParam pTheFunction) + + Creates a new VolumeDataColor for this VolumeData instance + + :param pTheFunction: Function used in this element + :returns: The new VolumeDataColor of this VolumeData instance. + + + .. cpp:function:: void RemoveColor() + + Removes the VolumeDataColor of this VolumeData instance + + + + .. cpp:function:: Lib3MF_uint32 GetPropertyCount() + + Returns the number of VolumeDataProperty + + :returns: the number of VolumeDataProperty-elements within this VolumeData + + + .. cpp:function:: PVolumeDataProperty GetProperty(const Lib3MF_uint32 nIndex) + + Returns the VolumeDataProperty at a given Index + + :param nIndex: the index of the VolumeDataProperty to be returned. + :returns: the VolumeDataProperty at the given index. + + + .. cpp:function:: PVolumeDataProperty AddPropertyFromFunction(const std::string & sName, classParam pTheFunction) + + Adds a new VolumeDataProperty from a Function + + :param sName: the qualified name (namespace+name) of the Property + :param pTheFunction: Function used in this element + :returns: the newly created VolumeDataProperty. + + + .. cpp:function:: void RemoveProperty(const Lib3MF_uint32 nIndex) + + Removes the VolumeDataProperty with a given index + + :param nIndex: the index of the VolumeDataProperty to be removed. + + +.. cpp:type:: std::shared_ptr Lib3MF::PVolumeData + + Shared pointer to CVolumeData to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_VolumeDataColor.rst b/Documentation/source/Cpp/lib3mf_VolumeDataColor.rst new file mode 100644 index 000000000..27840b063 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_VolumeDataColor.rst @@ -0,0 +1,16 @@ + +CVolumeDataColor +==================================================================================================== + + +.. cpp:class:: Lib3MF::CVolumeDataColor : public CFunctionReference + + + + + + +.. cpp:type:: std::shared_ptr Lib3MF::PVolumeDataColor + + Shared pointer to CVolumeDataColor to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_VolumeDataComposite.rst b/Documentation/source/Cpp/lib3mf_VolumeDataComposite.rst new file mode 100644 index 000000000..4d0e80908 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_VolumeDataComposite.rst @@ -0,0 +1,60 @@ + +CVolumeDataComposite +==================================================================================================== + + +.. cpp:class:: Lib3MF::CVolumeDataComposite : public CBase + + + + + + + .. cpp:function:: PBaseMaterialGroup GetBaseMaterialGroup() + + Returns the BaseMaterialGroup used within this volume data item + + :returns: The BaseMaterialGroup instance of this VolumeDataComposite element + + + .. cpp:function:: void SetBaseMaterialGroup(classParam pBaseMaterialGroupInstance) + + Sets the BaseMaterialGroup to use within this volume data item. + + :param pBaseMaterialGroupInstance: The new BaseMaterialGroup instance of this VolumeDataComposite element + + + .. cpp:function:: Lib3MF_uint32 GetMaterialMappingCount() + + Returns the number of material mappings of this VolumeDataComposite element + + :returns: the number of material mappings. + + + .. cpp:function:: PMaterialMapping GetMaterialMapping(const Lib3MF_uint32 nIndex) + + Returns MaterialMapping with given index + + :param nIndex: Index of the MaterialMapping in question. + :returns: MaterialMapping used in this element + + + .. cpp:function:: PMaterialMapping AddMaterialMapping(const sTransform & Transform) + + Adds a MaterialMapping + + :param Transform: new transformation matrix + :returns: The new MaterialMapping + + + .. cpp:function:: void RemoveMaterialMapping(const Lib3MF_uint32 nIndex) + + Removes the MaterialMapping with given index + + :param nIndex: The index of the MaterialMapping to be removed. + + +.. cpp:type:: std::shared_ptr Lib3MF::PVolumeDataComposite + + Shared pointer to CVolumeDataComposite to easily allow reference counting. + diff --git a/Documentation/source/Cpp/lib3mf_VolumeDataProperty.rst b/Documentation/source/Cpp/lib3mf_VolumeDataProperty.rst new file mode 100644 index 000000000..da385d543 --- /dev/null +++ b/Documentation/source/Cpp/lib3mf_VolumeDataProperty.rst @@ -0,0 +1,37 @@ + +CVolumeDataProperty +==================================================================================================== + + +.. cpp:class:: Lib3MF::CVolumeDataProperty : public CFunctionReference + + + + + + + .. cpp:function:: std::string GetName() + + Gets the qualified name of this property. + + :returns: The qualified name of this property. + + + .. cpp:function:: void SetIsRequired(const bool bIsRequired) + + Sets whether this property is required to process this 3MF document instance. + + :param bIsRequired: New value for whether this property is required to process this 3MF document instance. + + + .. cpp:function:: bool IsRequired() + + Returns whether this property is required to process this 3MF document instance. + + :returns: Is this property required to process this 3MF document instance? + + +.. cpp:type:: std::shared_ptr Lib3MF::PVolumeDataProperty + + Shared pointer to CVolumeDataProperty to easily allow reference counting. + diff --git a/Include/API/lib3mf_beamlatticenode.hpp b/Include/API/lib3mf_beamlatticenode.hpp new file mode 100644 index 000000000..fcaf4acaf --- /dev/null +++ b/Include/API/lib3mf_beamlatticenode.hpp @@ -0,0 +1,98 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is the class declaration of CBeamLatticeNode + +*/ + + +#ifndef __LIB3MF_BEAMLATTICENODE +#define __LIB3MF_BEAMLATTICENODE + +#include "lib3mf_interfaces.hpp" + +// Parent classes +#include "lib3mf_implicitnode.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. + + +namespace Lib3MF { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CBeamLatticeNode +**************************************************************************************************************************/ + +class CBeamLatticeNode : public virtual IBeamLatticeNode, public virtual CImplicitNode { +private: + + /** + * Put private members here. + */ + +protected: + + /** + * Put protected members here. + */ + +public: + + /** + * Put additional public members here. They will not be visible in the external API. + */ + + CBeamLatticeNode(NMR::PModelImplicitNode pImplicitNode); + + /** + * Public member functions to implement. + */ + + IImplicitPort * GetInputBeamLattice() override; + + IImplicitPort * GetInputPos() override; + + IImplicitPort * GetOutputDistance() override; + + void SetAccurateRange(const Lib3MF_double dAccurateRange) override; + + Lib3MF_double GetAccurateRange() override; + +}; + +} // namespace Impl +} // namespace Lib3MF + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIB3MF_BEAMLATTICENODE diff --git a/Include/API/lib3mf_booleanobject.hpp b/Include/API/lib3mf_booleanobject.hpp new file mode 100644 index 000000000..d39dcd00a --- /dev/null +++ b/Include/API/lib3mf_booleanobject.hpp @@ -0,0 +1,125 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is the class declaration of CBooleanObject + +*/ + + +#ifndef __LIB3MF_BOOLEANOBJECT +#define __LIB3MF_BOOLEANOBJECT + +#include "lib3mf_interfaces.hpp" + +// Parent classes +#include "lib3mf_object.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. +#include "Model/Classes/NMR_ModelBooleanObject.h" + +namespace Lib3MF { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CBooleanObject +**************************************************************************************************************************/ + +class CBooleanObject : public virtual IBooleanObject, public virtual CObject { +private: + + /** + * Put private members here. + */ + +protected: + + /** + * Put protected members here. + */ + +public: + + /** + * Put additional public members here. They will not be visible in the external API. + */ + + + CBooleanObject() = delete; + CBooleanObject(NMR::PModelResource pResource); + + NMR::PModelBooleanObject booleanObject(); + + /** + * Public member functions to implement. + */ + + bool IsBooleanObject() override; + bool IsMeshObject() override; + bool IsComponentsObject() override; + bool IsLevelSetObject() override; + + void SetBaseObject(IObject* pBaseObject, const Lib3MF::sTransform Transform) override; + + IObject * GetBaseObject() override; + + void SetBaseTransform(const Lib3MF::sTransform Transform) override; + + Lib3MF::sTransform GetBaseTransform() override; + + void SetOperation(const Lib3MF::eBooleanOperation eOperation) override; + + Lib3MF::eBooleanOperation GetOperation() override; + + void SetCSGModeEnabled(const bool bCSGModeEnabled) override; + + bool GetCSGModeEnabled() override; + + void SetExtractionGridResolution(const Lib3MF_uint32 nGridResolution) override; + + Lib3MF_uint32 GetExtractionGridResolution() override; + + Lib3MF_uint32 GetOperandCount() override; + + void AddOperand(IMeshObject* pOperandObject, const Lib3MF::sTransform Transform) override; + + Lib3MF::sTransform GetOperand(const Lib3MF_uint32 nIndex, IMeshObject*& pOperandObject) override; + + IMeshObject * MergeToMeshObject() override; + +}; + +} // namespace Impl +} // namespace Lib3MF + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIB3MF_BOOLEANOBJECT diff --git a/Include/API/lib3mf_booleanobjectiterator.hpp b/Include/API/lib3mf_booleanobjectiterator.hpp new file mode 100644 index 000000000..077473799 --- /dev/null +++ b/Include/API/lib3mf_booleanobjectiterator.hpp @@ -0,0 +1,89 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is the class declaration of CBooleanObjectIterator + +*/ + + +#ifndef __LIB3MF_BOOLEANOBJECTITERATOR +#define __LIB3MF_BOOLEANOBJECTITERATOR + +#include "lib3mf_interfaces.hpp" + +// Parent classes +#include "lib3mf_resourceiterator.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. + + +namespace Lib3MF { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CBooleanObjectIterator +**************************************************************************************************************************/ + +class CBooleanObjectIterator : public virtual IBooleanObjectIterator, public virtual CResourceIterator { +private: + + /** + * Put private members here. + */ + +protected: + + /** + * Put protected members here. + */ + +public: + + /** + * Put additional public members here. They will not be visible in the external API. + */ + + + /** + * Public member functions to implement. + */ + + IBooleanObject * GetCurrentBooleanObject() override; + +}; + +} // namespace Impl +} // namespace Lib3MF + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIB3MF_BOOLEANOBJECTITERATOR diff --git a/Include/API/lib3mf_componentsobject.hpp b/Include/API/lib3mf_componentsobject.hpp index 2206a2540..0af611d8b 100644 --- a/Include/API/lib3mf_componentsobject.hpp +++ b/Include/API/lib3mf_componentsobject.hpp @@ -87,6 +87,8 @@ class CComponentsObject : public virtual IComponentsObject, public virtual CObje bool IsComponentsObject(); bool IsLevelSetObject() override; + + bool IsBooleanObject() override; }; } diff --git a/Include/API/lib3mf_functiongradientnode.hpp b/Include/API/lib3mf_functiongradientnode.hpp new file mode 100644 index 000000000..7ee920c3c --- /dev/null +++ b/Include/API/lib3mf_functiongradientnode.hpp @@ -0,0 +1,108 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is the class declaration of CFunctionGradientNode + +*/ + + +#ifndef __LIB3MF_FUNCTIONGRADIENTNODE +#define __LIB3MF_FUNCTIONGRADIENTNODE + +#include "lib3mf_interfaces.hpp" + +// Parent classes +#include "lib3mf_implicitnode.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. + + +namespace Lib3MF { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CFunctionGradientNode +**************************************************************************************************************************/ + +class CFunctionGradientNode : public virtual IFunctionGradientNode, public virtual CImplicitNode { +private: + + /** + * Put private members here. + */ + +protected: + + /** + * Put protected members here. + */ + +public: + + /** + * Put additional public members here. They will not be visible in the external API. + */ + + CFunctionGradientNode(NMR::PModelImplicitNode pImplicitNode); + + /** + * Public member functions to implement. + */ + + IImplicitPort * GetInputFunctionID() override; + + IImplicitPort * GetInputPos() override; + + IImplicitPort * GetInputStep() override; + + void SetScalarOutputName(const std::string & sScalarOutputName) override; + + std::string GetScalarOutputName() override; + + void SetVectorInputName(const std::string & sVectorInputName) override; + + std::string GetVectorInputName() override; + + IImplicitPort * GetOutputNormalizedGradient() override; + + IImplicitPort * GetOutputGradient() override; + + IImplicitPort * GetOutputMagnitude() override; + +}; + +} // namespace Impl +} // namespace Lib3MF + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIB3MF_FUNCTIONGRADIENTNODE diff --git a/Include/API/lib3mf_implicitfunction.hpp b/Include/API/lib3mf_implicitfunction.hpp index ec009b86e..e569a63f1 100644 --- a/Include/API/lib3mf_implicitfunction.hpp +++ b/Include/API/lib3mf_implicitfunction.hpp @@ -744,6 +744,39 @@ namespace Lib3MF const std::string& sIdentifier, const std::string& sDisplayName, const std::string& sTag) override; + /** + * IImplicitFunction::AddBeamLatticeNode - Add a BeamLatticeNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + IBeamLatticeNode* AddBeamLatticeNode( + const std::string& sIdentifier, const std::string& sDisplayName, + const std::string& sTag) override; + + /** + * IImplicitFunction::AddFunctionGradientNode - Add a FunctionGradientNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + IFunctionGradientNode* AddFunctionGradientNode( + const std::string& sIdentifier, const std::string& sDisplayName, + const std::string& sTag) override; + + /** + * IImplicitFunction::AddNormalizeDistanceNode - Add a NormalizeDistanceNode + * @param[in] sIdentifier - the identifier of the node + * @param[in] sDisplayName - the display name of the node + * @param[in] sTag - the tag of the node + * @return the added node + */ + INormalizeDistanceNode* AddNormalizeDistanceNode( + const std::string& sIdentifier, const std::string& sDisplayName, + const std::string& sTag) override; + /** * IImplicitFunction::GetNodes - Retrieves the nodes * @return the accessor to the nodes diff --git a/Include/API/lib3mf_levelset.hpp b/Include/API/lib3mf_levelset.hpp index be1c11e4a..9241dbca1 100644 --- a/Include/API/lib3mf_levelset.hpp +++ b/Include/API/lib3mf_levelset.hpp @@ -183,6 +183,8 @@ class CLevelSet : public virtual ILevelSet, public virtual CObject { bool IsComponentsObject() override; bool IsLevelSetObject() override; + + bool IsBooleanObject() override; }; } // namespace Impl diff --git a/Include/API/lib3mf_meshobject.hpp b/Include/API/lib3mf_meshobject.hpp index c2d4c4b6f..92f2dc459 100644 --- a/Include/API/lib3mf_meshobject.hpp +++ b/Include/API/lib3mf_meshobject.hpp @@ -112,6 +112,8 @@ class CMeshObject : public virtual IMeshObject, public virtual CObject { bool IsLevelSetObject() override; + bool IsBooleanObject() override; + bool IsValid(); virtual IBeamLattice * BeamLattice() override; diff --git a/Include/API/lib3mf_model.hpp b/Include/API/lib3mf_model.hpp index 6326c1227..0f7784395 100644 --- a/Include/API/lib3mf_model.hpp +++ b/Include/API/lib3mf_model.hpp @@ -44,6 +44,8 @@ Abstract: This is the class declaration of CModel // Include custom headers here. #include "Model/Classes/NMR_Model.h" #include "Model/Classes/NMR_KeyStore.h" +#include "lib3mf_booleanobject.hpp" +#include "lib3mf_booleanobjectiterator.hpp" namespace Lib3MF { namespace Impl { @@ -109,6 +111,8 @@ class CModel : public virtual IModel, public virtual CBase { IComponentsObject * GetComponentsObjectByID(const Lib3MF_uint32 nUniqueResourceID) override; + IBooleanObject * GetBooleanObjectByID(const Lib3MF_uint32 nUniqueResourceID) override; + IColorGroup * GetColorGroupByID(const Lib3MF_uint32 nUniqueResourceID) override; ITexture2DGroup * GetTexture2DGroupByID(const Lib3MF_uint32 nUniqueResourceID) override; @@ -135,6 +139,8 @@ class CModel : public virtual IModel, public virtual CBase { IComponentsObjectIterator * GetComponentsObjects() override; + IBooleanObjectIterator * GetBooleanObjects() override; + ITexture2DIterator * GetTexture2Ds() override; IBaseMaterialGroupIterator * GetBaseMaterialGroups() override; @@ -157,6 +163,8 @@ class CModel : public virtual IModel, public virtual CBase { IComponentsObject * AddComponentsObject() override; + IBooleanObject * AddBooleanObject() override; + ISliceStack * AddSliceStack(const Lib3MF_double dZBottom) override; ITexture2D * AddTexture2DFromAttachment(IAttachment* pTextureAttachment) override; diff --git a/Include/API/lib3mf_normalizedistancenode.hpp b/Include/API/lib3mf_normalizedistancenode.hpp new file mode 100644 index 000000000..8bb53358b --- /dev/null +++ b/Include/API/lib3mf_normalizedistancenode.hpp @@ -0,0 +1,104 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is the class declaration of CNormalizeDistanceNode + +*/ + + +#ifndef __LIB3MF_NORMALIZEDISTANCENODE +#define __LIB3MF_NORMALIZEDISTANCENODE + +#include "lib3mf_interfaces.hpp" + +// Parent classes +#include "lib3mf_implicitnode.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. + + +namespace Lib3MF { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CNormalizeDistanceNode +**************************************************************************************************************************/ + +class CNormalizeDistanceNode : public virtual INormalizeDistanceNode, public virtual CImplicitNode { +private: + + /** + * Put private members here. + */ + +protected: + + /** + * Put protected members here. + */ + +public: + + /** + * Put additional public members here. They will not be visible in the external API. + */ + + CNormalizeDistanceNode(NMR::PModelImplicitNode pImplicitNode); + + /** + * Public member functions to implement. + */ + + IImplicitPort * GetInputFunctionID() override; + + IImplicitPort * GetInputPos() override; + + IImplicitPort * GetInputStep() override; + + void SetScalarOutputName(const std::string & sScalarOutputName) override; + + std::string GetScalarOutputName() override; + + void SetVectorInputName(const std::string & sVectorInputName) override; + + std::string GetVectorInputName() override; + + IImplicitPort * GetOutputResult() override; + +}; + +} // namespace Impl +} // namespace Lib3MF + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIB3MF_NORMALIZEDISTANCENODE diff --git a/Include/API/lib3mf_object.hpp b/Include/API/lib3mf_object.hpp index 1b92133ff..259c6d018 100644 --- a/Include/API/lib3mf_object.hpp +++ b/Include/API/lib3mf_object.hpp @@ -94,6 +94,8 @@ class CObject : public virtual IObject, public virtual CResource { virtual bool IsLevelSetObject (); + virtual bool IsBooleanObject (); + virtual IMeshObject * AsMeshObject(); virtual IComponentsObject * AsComponentsObject(); diff --git a/Include/Common/Boolean/NMR_BooleanDistanceField.h b/Include/Common/Boolean/NMR_BooleanDistanceField.h new file mode 100644 index 000000000..5f91f464f --- /dev/null +++ b/Include/Common/Boolean/NMR_BooleanDistanceField.h @@ -0,0 +1,64 @@ +/*++ + +Copyright (C) 2026 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +Signed-distance field generation for boolean CSG evaluation. + +--*/ + +#ifndef __NMR_BOOLEANDISTANCEFIELD +#define __NMR_BOOLEANDISTANCEFIELD + +#include "Common/Mesh/NMR_Mesh.h" +#include "Model/Classes/NMR_ModelBooleanObject.h" + +#include + +namespace NMR::Boolean { + + struct sBooleanVec3d { + double x = 0.0; + double y = 0.0; + double z = 0.0; + }; + + struct sBooleanFieldData { + std::vector values; + int resolution = 0; + sBooleanVec3d minCorner; + sBooleanVec3d maxCorner; + }; + + sBooleanFieldData buildCSGField( + _In_ CMesh * pBaseMesh, + _In_ const std::vector & operandMeshes, + _In_ eModelBooleanOperation operation, + _In_ nfUint32 nGridResolution); + +} + +#endif // __NMR_BOOLEANDISTANCEFIELD diff --git a/Include/Common/Boolean/NMR_BooleanEngine.h b/Include/Common/Boolean/NMR_BooleanEngine.h new file mode 100644 index 000000000..7b76aca2a --- /dev/null +++ b/Include/Common/Boolean/NMR_BooleanEngine.h @@ -0,0 +1,53 @@ +/*++ + +Copyright (C) 2026 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +Winding-number based boolean engine with volumetric iso-surface extraction. + +--*/ + +#ifndef __NMR_BOOLEANENGINE +#define __NMR_BOOLEANENGINE + +#include "Common/Mesh/NMR_Mesh.h" +#include "Model/Classes/NMR_ModelBooleanObject.h" + +namespace NMR { + + class CBooleanEngine { + public: + static void evaluate( + _In_ CMesh * pBaseMesh, + _In_ const std::vector & operandMeshes, + _In_ eModelBooleanOperation operation, + _In_ CMesh * pResultMesh, + _In_ nfUint32 nGridResolution = 40); + }; + +} + +#endif // __NMR_BOOLEANENGINE diff --git a/Include/Common/Boolean/NMR_BooleanSurfacePostProcess.h b/Include/Common/Boolean/NMR_BooleanSurfacePostProcess.h new file mode 100644 index 000000000..f2158dd3b --- /dev/null +++ b/Include/Common/Boolean/NMR_BooleanSurfacePostProcess.h @@ -0,0 +1,46 @@ +/*++ + +Copyright (C) 2026 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +Surface smoothing and zero-level-set projection for extracted boolean meshes. + +--*/ + +#ifndef __NMR_BOOLEANSURFACEPOSTPROCESS +#define __NMR_BOOLEANSURFACEPOSTPROCESS + +#include "Common/Boolean/NMR_BooleanDistanceField.h" + +namespace NMR::Boolean { + + void smoothAndProjectExtractedSurface( + _In_ CMesh * pMesh, + _In_ const sBooleanFieldData & fieldData); + +} + +#endif // __NMR_BOOLEANSURFACEPOSTPROCESS diff --git a/Include/Common/Boolean/NMR_MarchingCubes.h b/Include/Common/Boolean/NMR_MarchingCubes.h new file mode 100644 index 000000000..6fe90d53e --- /dev/null +++ b/Include/Common/Boolean/NMR_MarchingCubes.h @@ -0,0 +1,52 @@ +/*++ + +Copyright (C) 2026 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +Marching-cubes iso-surface extraction utilities for boolean field materialization. + +--*/ + +#ifndef __NMR_MARCHINGCUBES +#define __NMR_MARCHINGCUBES + +#include "Common/Mesh/NMR_Mesh.h" + +#include +#include + +namespace NMR::Boolean { + + void extractIsoSurfaceMarchingCubes( + _In_ CMesh * pResultMesh, + _In_ const std::vector & fieldValues, + _In_ int resolution, + _In_ const std::array & minCorner, + _In_ const std::array & maxCorner); + +} + +#endif // __NMR_MARCHINGCUBES diff --git a/Include/Common/NMR_ErrorConst.h b/Include/Common/NMR_ErrorConst.h index 007b4f7e7..e15d7b95a 100644 --- a/Include/Common/NMR_ErrorConst.h +++ b/Include/Common/NMR_ErrorConst.h @@ -1250,6 +1250,9 @@ Model error codes (0x8XXX) // A keystore element is not base64 encoded #define NMR_ERROR_KEYSTOREINVALIDENCODING 0x810E +// Boolean-object must not have an Object-Level PID +#define NMR_ERROR_OBJECTLEVELPID_ON_BOOLEANOBJECT 0x810F + // errors for the volumetric extension 0x88xx // Invalid Image3D Size diff --git a/Include/Common/NMR_StringUtils.h b/Include/Common/NMR_StringUtils.h index 4cafe3a76..b32bc76a1 100644 --- a/Include/Common/NMR_StringUtils.h +++ b/Include/Common/NMR_StringUtils.h @@ -37,7 +37,7 @@ and Exception-safe #include "Common/NMR_Types.h" #include "Common/NMR_Local.h" -#include +#include #include #include diff --git a/Include/Common/Winding/NMR_WindingNumber.h b/Include/Common/Winding/NMR_WindingNumber.h new file mode 100644 index 000000000..2e5dfbc54 --- /dev/null +++ b/Include/Common/Winding/NMR_WindingNumber.h @@ -0,0 +1,96 @@ +#pragma once + +/*++ + +Copyright (C) 2026 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +Internal generalized winding number helper used by boolean processing. +Copyright remains with 3MF Consortium; this file is licensed under +the BSD terms above for inclusion in lib3mf. + +--*/ + +#include +#include +#include + +namespace tg { + struct windingSettings { + double accuracy = 2.0; + int taylorOrder = 2; + unsigned int threads = 0; + int kNeighbors = 12; + }; + + class windingNumber { + public: + using Point = std::array; + using Triangle = std::array; + using Settings = windingSettings; + + windingNumber(const std::vector &vertices, + const std::vector &triangles, + Settings s = {}); + + explicit windingNumber(const std::vector &points, Settings s = {}); + + windingNumber(const std::vector &points, + const std::vector &normals, + Settings s = {}); + + windingNumber(const std::vector &points, + const std::vector &normals, + const std::vector &areas, + Settings s = {}); + + // For closed, consistently oriented shapes: + // query(...) ~ 1 => inside, ~ 0 => outside. + // Practical thresholds: + // w > 0.5 => inside + // w < 0.5 => outside + // Optional conservative bands often used in practice: + // w > 0.75 => confidently inside + // w < 0.25 => confidently outside + double query(const Point &p) const; + + std::vector query(const std::vector &points) const; + + ~windingNumber(); + + windingNumber(windingNumber &&) noexcept; + + windingNumber &operator=(windingNumber &&) noexcept; + + windingNumber(const windingNumber &) = delete; + + windingNumber &operator=(const windingNumber &) = delete; + + private: + struct Impl; + std::unique_ptr impl_; + }; +} // namespace tg diff --git a/Include/Model/Classes/NMR_ModelBooleanObject.h b/Include/Model/Classes/NMR_ModelBooleanObject.h new file mode 100644 index 000000000..bdb2d3128 --- /dev/null +++ b/Include/Model/Classes/NMR_ModelBooleanObject.h @@ -0,0 +1,90 @@ +/*++ + +Copyright (C) 2026 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +Minimal in-memory representation of a boolean object. + +--*/ + +#ifndef __NMR_MODELBOOLEANOBJECT +#define __NMR_MODELBOOLEANOBJECT + +#include "Model/Classes/NMR_ModelObject.h" +#include "Model/Classes/NMR_ModelComponent.h" + +namespace NMR { + + enum class eModelBooleanOperation { + Union = 0, + Difference = 1, + Intersection = 2 + }; + + class CModelBooleanObject : public CModelObject { + private: + PModelComponent m_pBaseObject; + std::vector m_Operands; + eModelBooleanOperation m_eOperation; + nfBool m_bCSGModeEnabled; + nfUint32 m_nExtractionGridResolution; + + public: + CModelBooleanObject() = delete; + CModelBooleanObject(_In_ const ModelResourceID sID, _In_ CModel * pModel); + ~CModelBooleanObject() override; + + void setBaseObject(_In_ CModelObject * pObject, _In_ const NMATRIX3 & mTransform); + CModelObject * getBaseObject() const; + void setBaseTransform(_In_ const NMATRIX3 & mTransform); + NMATRIX3 getBaseTransform() const; + + void setOperation(_In_ eModelBooleanOperation eOperation); + eModelBooleanOperation getOperation() const; + std::string getOperationString() const; + nfBool setOperationString(_In_ const std::string & sOperation, _In_ nfBool bRaiseException); + void setCSGModeEnabled(_In_ nfBool bEnabled); + nfBool getCSGModeEnabled() const; + void setExtractionGridResolution(_In_ nfUint32 nGridResolution); + nfUint32 getExtractionGridResolution() const; + + void addOperand(_In_ CModelObject * pObject, _In_ const NMATRIX3 & mTransform); + nfUint32 getOperandCount() const; + PModelComponent getOperand(_In_ nfUint32 nIdx) const; + + void mergeToMesh(_In_ CMesh * pMesh, _In_ const NMATRIX3 mMatrix) override; + nfBool isValid() override; + void calculateComponentDepthLevel(nfUint32 nLevel) override; + nfBool hasSlices(nfBool bRecursive) override; + nfBool isValidForSlices(const NMATRIX3& totalParentMatrix) override; + void extendOutbox(_Out_ NOUTBOX3& vOutBox, _In_ const NMATRIX3 mAccumulatedMatrix) override; + ResourceDependencies getDependencies() override; + }; + + typedef std::shared_ptr PModelBooleanObject; +} + +#endif diff --git a/Include/Model/Classes/NMR_ModelConstants.h b/Include/Model/Classes/NMR_ModelConstants.h index b110fd649..ce77e4484 100644 --- a/Include/Model/Classes/NMR_ModelConstants.h +++ b/Include/Model/Classes/NMR_ModelConstants.h @@ -80,6 +80,7 @@ These are given by the 3MF Standard #define XML_3MF_NAMESPACE_MATERIALSPEC "http://schemas.microsoft.com/3dmanufacturing/material/2015/02" #define XML_3MF_NAMESPACE_PRODUCTIONSPEC "http://schemas.microsoft.com/3dmanufacturing/production/2015/06" #define XML_3MF_NAMESPACE_BEAMLATTICESPEC "http://schemas.microsoft.com/3dmanufacturing/beamlattice/2017/02" +#define XML_3MF_NAMESPACE_BEAMLATTICEBALLSSPEC "http://schemas.microsoft.com/3dmanufacturing/beamlattice/balls/2020/07" #define XML_3MF_NAMESPACE_TRIANGLESETS "http://schemas.microsoft.com/3dmanufacturing/trianglesets/2021/07" #define XML_3MF_NAMESPACE_SLICESPEC "http://schemas.microsoft.com/3dmanufacturing/slice/2015/07" #define XML_3MF_NAMESPACE_SECURECONTENTSPEC "http://schemas.microsoft.com/3dmanufacturing/securecontent/2019/04" @@ -87,15 +88,18 @@ These are given by the 3MF Standard #define XML_3MF_NAMESPACE_CIPHERVALUESPEC "http://www.w3.org/2001/04/xmlenc#" #define XML_3MF_NAMESPACE_VOLUMETRICSPEC "http://schemas.3mf.io/3dmanufacturing/volumetric/2022/01" #define XML_3MF_NAMESPACE_IMPLICITSPEC "http://schemas.3mf.io/3dmanufacturing/implicit/2023/12" +#define XML_3MF_NAMESPACE_BOOLEANSPEC "http://schemas.3mf.io/3dmanufacturing/booleanoperations/2023/07" #define XML_3MF_NAMESPACEPREFIX_MATERIAL "m" #define XML_3MF_NAMESPACEPREFIX_PRODUCTION "p" #define XML_3MF_NAMESPACEPREFIX_BEAMLATTICE "b" +#define XML_3MF_NAMESPACEPREFIX_BEAMLATTICEBALLS "b2" #define XML_3MF_NAMESPACEPREFIX_SLICE "s" #define XML_3MF_NAMESPACEPREFIX_SECURECONTENT "sc" #define XML_3MF_NAMESPACEPREFIX_VOLUMETRIC "v" #define XML_3MF_NAMESPACEPREFIX_IMPLICIT "i" #define XML_3MF_NAMESPACEPREFIX_TRIANGLESETS "t" +#define XML_3MF_NAMESPACEPREFIX_BOOLEAN "bo" #define XML_3MF_ATTRIBUTE_XMLNS "xmlns" #define XML_3MF_ATTRIBUTE_PREFIX_XML "xml" @@ -287,6 +291,9 @@ These are given by the 3MF Standard #define XML_3MF_ATTRIBUTE_IMPLICIT_PORT_ID "identifier" #define XML_3MF_ATTRIBUTE_IMPLICIT_PORT_DISPLAY_NAME "displayname" #define XML_3MF_ATTRIBUTE_IMPLICIT_PORT_REFERENCE "ref" +#define XML_3MF_ATTRIBUTE_IMPLICIT_NODE_ACCURATERANGE "accuraterange" +#define XML_3MF_ATTRIBUTE_IMPLICIT_NODE_SCALAROUTPUT "scalaroutput" +#define XML_3MF_ATTRIBUTE_IMPLICIT_NODE_VECTORINPUT "vectorinput" #define XML_3MF_ELEMENT_IMPLICIT_PORT_TYPE_SCALAR "scalar" #define XML_3MF_ELEMENT_IMPLICIT_PORT_TYPE_VECTOR "vector" #define XML_3MF_ELEMENT_IMPLICIT_PORT_TYPE_MATRIX "matrix" @@ -310,6 +317,8 @@ These are given by the 3MF Standard #define XML_3MF_ELEMENT_BOUNDARY_SHAPE "levelset" +#define XML_3MF_ELEMENT_BOOLEANSHAPE "booleanshape" +#define XML_3MF_ELEMENT_BOOLEAN "boolean" #define XML_3MF_ATTRIBUTE_LEVELSET_VOLUMEDATA "volumeid" #define XML_3MF_ATTRIBUTE_BOUNDARY_SHAPE_ID "id" #define XML_3MF_ATTRIBUTE_BOUNDARY_SHAPE_FUNCTION_ID "functionid" @@ -350,6 +359,15 @@ These are given by the 3MF Standard #define XML_3MF_ATTRIBUTE_COMPONENT_OBJECTID "objectid" #define XML_3MF_ATTRIBUTE_COMPONENT_TRANSFORM "transform" +#define XML_3MF_ATTRIBUTE_BOOLEAN_OBJECTID "objectid" +#define XML_3MF_ATTRIBUTE_BOOLEAN_OPERATION "operation" +#define XML_3MF_ATTRIBUTE_BOOLEAN_TRANSFORM "transform" +#define XML_3MF_ATTRIBUTE_BOOLEAN_PATH "path" + +#define XML_3MF_VALUE_BOOLEAN_OPERATION_UNION "union" +#define XML_3MF_VALUE_BOOLEAN_OPERATION_DIFFERENCE "difference" +#define XML_3MF_VALUE_BOOLEAN_OPERATION_INTERSECTION "intersection" + // Color resource group #define XML_3MF_ELEMENT_COLORGROUP "colorgroup" #define XML_3MF_ATTRIBUTE_COLORS_COLOR "color" diff --git a/Include/Model/Classes/NMR_ModelImplicitNode.h b/Include/Model/Classes/NMR_ModelImplicitNode.h index ca010c614..acaca85fe 100644 --- a/Include/Model/Classes/NMR_ModelImplicitNode.h +++ b/Include/Model/Classes/NMR_ModelImplicitNode.h @@ -64,6 +64,11 @@ namespace NMR // resource ID that is unique in the scope of a model to reference mesh objects, functions etc. ModelResourceID m_modelResourceID; + // Attributes specific to new nodes + double m_accurateRange = 0.0; // For BeamLatticeNode + std::string m_scalarOutputName; // For FunctionGradient and NormalizeDistance + std::string m_vectorInputName; // For FunctionGradient and NormalizeDistance + CModelImplicitFunction * m_parent = nullptr; // ID of the node in the graph, used for the topological sort @@ -114,6 +119,16 @@ namespace NMR ModelResourceID getModelResourceID() const; PModelResource getResource() const; + // BeamLatticeNode attribute + void setAccurateRange(double accurateRange); + double getAccurateRange() const; + + // FunctionGradient and NormalizeDistance attributes + void setScalarOutputName(const std::string& name); + std::string getScalarOutputName() const; + void setVectorInputName(const std::string& name); + std::string getVectorInputName() const; + bool arePortsValid() const; void setGraphID(GraphID id); diff --git a/Include/Model/Reader/Boolean2307/NMR_ModelReaderNode_Boolean2307_Boolean.h b/Include/Model/Reader/Boolean2307/NMR_ModelReaderNode_Boolean2307_Boolean.h new file mode 100644 index 000000000..e88168df2 --- /dev/null +++ b/Include/Model/Reader/Boolean2307/NMR_ModelReaderNode_Boolean2307_Boolean.h @@ -0,0 +1,34 @@ +/*++ +--*/ +#ifndef __NMR_MODELREADERNODE_BOOLEAN2307_BOOLEAN +#define __NMR_MODELREADERNODE_BOOLEAN2307_BOOLEAN + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelObject.h" + +namespace NMR { + class CModelReaderNode_Boolean2307_Boolean : public CModelReaderNode { + private: + CModel * m_pModel; + ModelResourceID m_nObjectID; + std::string m_sPath; + nfBool m_bHasObjectID; + nfBool m_bHasTransform; + nfBool m_bHasPath; + NMATRIX3 m_mTransform; + + public: + CModelReaderNode_Boolean2307_Boolean() = delete; + CModelReaderNode_Boolean2307_Boolean(_In_ CModel * pModel, _In_ PModelWarnings pWarnings); + + void parseXML(_In_ CXmlReader * pXMLReader) override; + CModelObject * getObject(); + NMATRIX3 getTransform() const; + +protected: + void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) override; + void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) override; + }; +} + +#endif diff --git a/Include/Model/Reader/Boolean2307/NMR_ModelReaderNode_Boolean2307_BooleanShape.h b/Include/Model/Reader/Boolean2307/NMR_ModelReaderNode_Boolean2307_BooleanShape.h new file mode 100644 index 000000000..2d8897b5e --- /dev/null +++ b/Include/Model/Reader/Boolean2307/NMR_ModelReaderNode_Boolean2307_BooleanShape.h @@ -0,0 +1,34 @@ +/*++ +--*/ +#ifndef __NMR_MODELREADERNODE_BOOLEAN2307_BOOLEANSHAPE +#define __NMR_MODELREADERNODE_BOOLEAN2307_BOOLEANSHAPE + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelBooleanObject.h" + +namespace NMR { + class CModelReaderNode_Boolean2307_BooleanShape : public CModelReaderNode { + private: + CModel * m_pModel; + PModelBooleanObject m_pBooleanObject; + ModelResourceID m_nObjectID; + std::string m_sPath; + nfBool m_bHasObjectID; + nfBool m_bHasTransform; + nfBool m_bHasPath; + NMATRIX3 m_mTransform; + + public: + CModelReaderNode_Boolean2307_BooleanShape() = delete; + CModelReaderNode_Boolean2307_BooleanShape(_In_ CModel * pModel, _In_ PModelBooleanObject pBooleanObject, _In_ PModelWarnings pWarnings); + + void parseXML(_In_ CXmlReader * pXMLReader) override; + + protected: + void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) override; + void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) override; + void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) override; + }; +} + +#endif diff --git a/Include/Model/Writer/v100/NMR_ModelWriterNode100_Mesh.h b/Include/Model/Writer/v100/NMR_ModelWriterNode100_Mesh.h index 072de84c3..6b7c5178f 100644 --- a/Include/Model/Writer/v100/NMR_ModelWriterNode100_Mesh.h +++ b/Include/Model/Writer/v100/NMR_ModelWriterNode100_Mesh.h @@ -50,12 +50,12 @@ This is the class for exporting the 3mf mesh node. #define MODELWRITERMESH100_TRIANGLELINESTARTLENGTH 14 #define MODELWRITERMESH100_BEAMLATTICE_BEAMLINESTART " in your code. + * + * Macros that are observed in this file: + * - NANOFLANN_NO_THREADS: If defined, single thread will be enforced. + * - NANOFLANN_FIRST_MATCH: If defined, in case of a tie in distances the item with the smallest + * index will be returned. + * - NANOFLANN_NODE_ALIGNMENT: The memory alignment, in bytes, for kd-tree nodes. Default: 16 + * + * See: + * - [Online README](https://github.com/jlblancoc/nanoflann) + * - [C++ API documentation](https://jlblancoc.github.io/nanoflann/) + */ + +#pragma once + +#include +#include +#include +#include +#include // for abs() +#include +#include // for abs() +#include // std::reference_wrapper +#include +#include +#include // std::numeric_limits +#include +#include +#include +#include +#include + +/** Library version: 0xMmP (M=Major,m=minor,P=patch) */ +#define NANOFLANN_VERSION 0x190 + +// Avoid conflicting declaration of min/max macros in Windows headers +#if !defined(NOMINMAX) && (defined(_WIN32) || defined(_WIN32_) || defined(WIN32) || defined(_WIN64)) +#define NOMINMAX +#ifdef max +#undef max +#undef min +#endif +#endif +// Avoid conflicts with X11 headers +#ifdef None +#undef None +#endif + +// Handle restricted pointers +#if defined(__GNUC__) || defined(__clang__) +#define NANOFLANN_RESTRICT __restrict__ +#elif defined(_MSC_VER) +#define NANOFLANN_RESTRICT __restrict +#else +#define NANOFLANN_RESTRICT +#endif + +// Memory alignment of KD-tree nodes: +#ifndef NANOFLANN_NODE_ALIGNMENT +#define NANOFLANN_NODE_ALIGNMENT 16 +#endif + +namespace nanoflann +{ +/** @addtogroup nanoflann_grp nanoflann C++ library for KD-trees + * @{ */ + +/** the PI constant (required to avoid MSVC missing symbols) */ +template +constexpr T pi_const() +{ + return static_cast(3.14159265358979323846); +} + +/** + * Traits if object is resizable and assignable (typically has a resize | assign + * method) + */ +template +struct has_resize : std::false_type +{ +}; + +template +struct has_resize().resize(1), 0)> : std::true_type +{ +}; + +template +struct has_assign : std::false_type +{ +}; + +template +struct has_assign().assign(1, 0), 0)> : std::true_type +{ +}; + +/** + * Free function to resize a resizable object + */ +template +inline typename std::enable_if::value, void>::type resize( + Container& c, const size_t nElements) +{ + c.resize(nElements); +} + +/** + * Free function that has no effects on non resizable containers (e.g. + * std::array) It raises an exception if the expected size does not match + */ +template +inline typename std::enable_if::value, void>::type resize( + Container& c, const size_t nElements) +{ + if (nElements != c.size()) throw std::logic_error("Attempt to resize a fixed size container."); +} + +/** + * Free function to assign to a container + */ +template +inline typename std::enable_if::value, void>::type assign( + Container& c, const size_t nElements, const T& value) +{ + c.assign(nElements, value); +} + +/** + * Free function to assign to a std::array + */ +template +inline typename std::enable_if::value, void>::type assign( + Container& c, const size_t nElements, const T& value) +{ + for (size_t i = 0; i < nElements; i++) c[i] = value; +} + +/** operator "<" for std::sort() */ +struct IndexDist_Sorter +{ + /** PairType will be typically: ResultItem */ + template + bool operator()(const PairType& p1, const PairType& p2) const + { + return p1.second < p2.second; + } +}; + +/** + * Each result element in RadiusResultSet. Note that distances and indices + * are named `first` and `second` to keep backward-compatibility with the + * `std::pair<>` type used in the past. In contrast, this structure is ensured + * to be `std::is_standard_layout` so it can be used in wrappers to other + * languages. + * See: https://github.com/jlblancoc/nanoflann/issues/166 + */ +template +struct ResultItem +{ + ResultItem() = default; + ResultItem(const IndexType index, const DistanceType distance) : first(index), second(distance) + { + } + + IndexType first; //!< Index of the sample in the dataset + DistanceType second; //!< Distance from sample to query point +}; + +/** @addtogroup result_sets_grp Result set classes + * @{ */ + +/** Result set for KNN searches (N-closest neighbors) */ +template +class KNNResultSet +{ + public: + using DistanceType = _DistanceType; + using IndexType = _IndexType; + using CountType = _CountType; + + private: + IndexType* indices; + DistanceType* dists; + CountType capacity; + CountType count; + + public: + explicit KNNResultSet(CountType capacity_) + : indices(nullptr), dists(nullptr), capacity(capacity_), count(0) + { + } + + void init(IndexType* indices_, DistanceType* dists_) + { + indices = indices_; + dists = dists_; + count = 0; + } + + CountType size() const noexcept { return count; } + bool empty() const noexcept { return count == 0; } + bool full() const noexcept { return count == capacity; } + + /** + * Called during search to add an element matching the criteria. + * @return true if the search should be continued, false if the results are + * sufficient + */ + bool addPoint(DistanceType dist, IndexType index) + { + CountType i; + for (i = count; i > 0; --i) + { + /** If defined and two points have the same distance, the one with + * the lowest-index will be returned first. */ +#ifdef NANOFLANN_FIRST_MATCH + if ((dists[i - 1] > dist) || ((dist == dists[i - 1]) && (indices[i - 1] > index))) + { +#else + if (dists[i - 1] > dist) + { +#endif + if (i < capacity) + { + dists[i] = dists[i - 1]; + indices[i] = indices[i - 1]; + } + } + else + break; + } + if (i < capacity) + { + dists[i] = dist; + indices[i] = index; + } + if (count < capacity) count++; + + // tell caller that the search shall continue + return true; + } + + //! Returns the worst distance among found solutions if the search result is + //! full, or the maximum possible distance, if not full yet. + DistanceType worstDist() const noexcept + { + return (count < capacity || !count) ? std::numeric_limits::max() + : dists[count - 1]; + } + + void sort() + { + // already sorted + } +}; + +/** Result set for RKNN searches (N-closest neighbors with a maximum radius) */ +template +class RKNNResultSet +{ + public: + using DistanceType = _DistanceType; + using IndexType = _IndexType; + using CountType = _CountType; + + private: + IndexType* indices; + DistanceType* dists; + CountType capacity; + CountType count; + DistanceType maximumSearchDistanceSquared; + + public: + explicit RKNNResultSet(CountType capacity_, DistanceType maximumSearchDistanceSquared_) + : indices(nullptr), + dists(nullptr), + capacity(capacity_), + count(0), + maximumSearchDistanceSquared(maximumSearchDistanceSquared_) + { + } + + void init(IndexType* indices_, DistanceType* dists_) + { + indices = indices_; + dists = dists_; + count = 0; + if (capacity) dists[capacity - 1] = maximumSearchDistanceSquared; + } + + CountType size() const noexcept { return count; } + bool empty() const noexcept { return count == 0; } + bool full() const noexcept { return count == capacity; } + + /** + * Called during search to add an element matching the criteria. + * @return true if the search should be continued, false if the results are + * sufficient + */ + bool addPoint(DistanceType dist, IndexType index) + { + CountType i; + for (i = count; i > 0; --i) + { + /** If defined and two points have the same distance, the one with + * the lowest-index will be returned first. */ +#ifdef NANOFLANN_FIRST_MATCH + if ((dists[i - 1] > dist) || ((dist == dists[i - 1]) && (indices[i - 1] > index))) + { +#else + if (dists[i - 1] > dist) + { +#endif + if (i < capacity) + { + dists[i] = dists[i - 1]; + indices[i] = indices[i - 1]; + } + } + else + break; + } + if (i < capacity) + { + dists[i] = dist; + indices[i] = index; + } + if (count < capacity) count++; + + // tell caller that the search shall continue + return true; + } + + //! Returns the worst distance among found solutions if the search result is + //! full, or the maximum possible distance, if not full yet. + DistanceType worstDist() const noexcept + { + return (count < capacity || !count) ? maximumSearchDistanceSquared : dists[count - 1]; + } + + void sort() + { + // already sorted + } +}; + +/** + * A result-set class used when performing a radius based search. + */ +template +class RadiusResultSet +{ + public: + using DistanceType = _DistanceType; + using IndexType = _IndexType; + + public: + const DistanceType radius; + + std::vector>& m_indices_dists; + + explicit RadiusResultSet( + DistanceType radius_, std::vector>& indices_dists) + : radius(radius_), m_indices_dists(indices_dists) + { + init(); + } + + void init() { clear(); } + void clear() { m_indices_dists.clear(); } + + size_t size() const noexcept { return m_indices_dists.size(); } + bool empty() const noexcept { return m_indices_dists.empty(); } + bool full() const noexcept { return true; } + + /** + * Called during search to add an element matching the criteria. + * @return true if the search should be continued, false if the results are + * sufficient + */ + bool addPoint(DistanceType dist, IndexType index) + { + if (dist < radius) m_indices_dists.emplace_back(index, dist); + return true; + } + + DistanceType worstDist() const noexcept { return radius; } + + /** + * Find the worst result (farthest neighbor) without copying or sorting + * Pre-conditions: size() > 0 + */ + ResultItem worst_item() const + { + if (m_indices_dists.empty()) + throw std::runtime_error( + "Cannot invoke RadiusResultSet::worst_item() on " + "an empty list of results."); + auto it = + std::max_element(m_indices_dists.begin(), m_indices_dists.end(), IndexDist_Sorter()); + return *it; + } + + void sort() { std::sort(m_indices_dists.begin(), m_indices_dists.end(), IndexDist_Sorter()); } +}; + +/** @} */ + +/** @addtogroup loadsave_grp Load/save auxiliary functions + * @{ */ +template +void save_value(std::ostream& stream, const T& value) +{ + stream.write(reinterpret_cast(&value), sizeof(T)); +} + +template +void save_value(std::ostream& stream, const std::vector& value) +{ + size_t size = value.size(); + stream.write(reinterpret_cast(&size), sizeof(size_t)); + stream.write(reinterpret_cast(value.data()), sizeof(T) * size); +} + +template +void load_value(std::istream& stream, T& value) +{ + stream.read(reinterpret_cast(&value), sizeof(T)); +} + +template +void load_value(std::istream& stream, std::vector& value) +{ + size_t size; + stream.read(reinterpret_cast(&size), sizeof(size_t)); + value.resize(size); + stream.read(reinterpret_cast(value.data()), sizeof(T) * size); +} +/** @} */ + +/** @addtogroup metric_grp Metric (distance) classes + * @{ */ + +struct Metric +{ +}; + +/** Manhattan distance functor (generic version, optimized for + * high-dimensionality data sets). Corresponding distance traits: + * nanoflann::metric_L1 + * + * \tparam T Type of the elements (e.g. double, float, uint8_t) + * \tparam DataSource Source of the data, i.e. where the vectors are stored + * \tparam _DistanceType Type of distance variables (must be signed) + * \tparam IndexType Type of the arguments with which the data can be + * accessed (e.g. float, double, int64_t, T*) + */ +template +struct L1_Adaptor +{ + using ElementType = T; + using DistanceType = _DistanceType; + + const DataSource& data_source; + + L1_Adaptor(const DataSource& _data_source) : data_source(_data_source) {} + + inline DistanceType evalMetric( + const T* NANOFLANN_RESTRICT a, const IndexType b_idx, size_t size, + DistanceType worst_dist = -1) const + { + DistanceType result = DistanceType(); + const size_t multof4 = (size >> 2) << 2; // largest multiple of 4, i.e. 1 << 2 + size_t d; + + /* Process 4 items with each loop for efficiency. */ + if (worst_dist <= 0) + { + /* No checks with worst_dist. */ + for (d = 0; d < multof4; d += 4) + { + const DistanceType diff0 = + std::abs(a[d + 0] - data_source.kdtree_get_pt(b_idx, d + 0)); + const DistanceType diff1 = + std::abs(a[d + 1] - data_source.kdtree_get_pt(b_idx, d + 1)); + const DistanceType diff2 = + std::abs(a[d + 2] - data_source.kdtree_get_pt(b_idx, d + 2)); + const DistanceType diff3 = + std::abs(a[d + 3] - data_source.kdtree_get_pt(b_idx, d + 3)); + /* Parentheses break dependency chain: */ + result += (diff0 + diff1) + (diff2 + diff3); + } + } + else + { + /* Check with worst_dist. */ + for (d = 0; d < multof4; d += 4) + { + const DistanceType diff0 = + std::abs(a[d + 0] - data_source.kdtree_get_pt(b_idx, d + 0)); + const DistanceType diff1 = + std::abs(a[d + 1] - data_source.kdtree_get_pt(b_idx, d + 1)); + const DistanceType diff2 = + std::abs(a[d + 2] - data_source.kdtree_get_pt(b_idx, d + 2)); + const DistanceType diff3 = + std::abs(a[d + 3] - data_source.kdtree_get_pt(b_idx, d + 3)); + /* Parentheses break dependency chain: */ + result += (diff0 + diff1) + (diff2 + diff3); + if (result > worst_dist) + { + return result; + } + } + } + /* Process last 0-3 components. Unrolled loop with fall-through switch. + */ + switch (size - multof4) + { + case 3: + result += std::abs(a[d + 2] - data_source.kdtree_get_pt(b_idx, d + 2)); + case 2: + result += std::abs(a[d + 1] - data_source.kdtree_get_pt(b_idx, d + 1)); + case 1: + result += std::abs(a[d + 0] - data_source.kdtree_get_pt(b_idx, d + 0)); + case 0: + break; + } + return result; + } + + template + inline DistanceType accum_dist(const U a, const V b, const size_t) const + { + return std::abs(a - b); + } +}; + +/** **Squared** Euclidean distance functor (generic version, optimized for + * high-dimensionality data sets). Corresponding distance traits: + * nanoflann::metric_L2 + * + * \tparam T Type of the elements (e.g. double, float, uint8_t) + * \tparam DataSource Source of the data, i.e. where the vectors are stored + * \tparam _DistanceType Type of distance variables (must be signed) + * \tparam IndexType Type of the arguments with which the data can be + * accessed (e.g. float, double, int64_t, T*) + */ +template +struct L2_Adaptor +{ + using ElementType = T; + using DistanceType = _DistanceType; + + const DataSource& data_source; + + L2_Adaptor(const DataSource& _data_source) : data_source(_data_source) {} + + inline DistanceType evalMetric( + const T* NANOFLANN_RESTRICT a, const IndexType b_idx, size_t size, + DistanceType worst_dist = -1) const + { + DistanceType result = DistanceType(); + const size_t multof4 = (size >> 2) << 2; // largest multiple of 4, i.e. 1 << 2 + size_t d; + + /* Process 4 items with each loop for efficiency. */ + if (worst_dist <= 0) + { + /* No checks with worst_dist. */ + for (d = 0; d < multof4; d += 4) + { + const DistanceType diff0 = a[d + 0] - data_source.kdtree_get_pt(b_idx, d + 0); + const DistanceType diff1 = a[d + 1] - data_source.kdtree_get_pt(b_idx, d + 1); + const DistanceType diff2 = a[d + 2] - data_source.kdtree_get_pt(b_idx, d + 2); + const DistanceType diff3 = a[d + 3] - data_source.kdtree_get_pt(b_idx, d + 3); + /* Parentheses break dependency chain: */ + result += (diff0 * diff0 + diff1 * diff1) + (diff2 * diff2 + diff3 * diff3); + } + } + else + { + /* Check with worst_dist. */ + for (d = 0; d < multof4; d += 4) + { + const DistanceType diff0 = a[d + 0] - data_source.kdtree_get_pt(b_idx, d + 0); + const DistanceType diff1 = a[d + 1] - data_source.kdtree_get_pt(b_idx, d + 1); + const DistanceType diff2 = a[d + 2] - data_source.kdtree_get_pt(b_idx, d + 2); + const DistanceType diff3 = a[d + 3] - data_source.kdtree_get_pt(b_idx, d + 3); + /* Parentheses break dependency chain: */ + result += (diff0 * diff0 + diff1 * diff1) + (diff2 * diff2 + diff3 * diff3); + if (result > worst_dist) + { + return result; + } + } + } + /* Process last 0-3 components. Unrolled loop with fall-through switch. + */ + DistanceType diff; + switch (size - multof4) + { + case 3: + diff = a[d + 2] - data_source.kdtree_get_pt(b_idx, d + 2); + result += diff * diff; + case 2: + diff = a[d + 1] - data_source.kdtree_get_pt(b_idx, d + 1); + result += diff * diff; + case 1: + diff = a[d + 0] - data_source.kdtree_get_pt(b_idx, d + 0); + result += diff * diff; + case 0: + break; + } + return result; + } + + template + inline DistanceType accum_dist(const U a, const V b, const size_t) const + { + auto diff = a - b; + return diff * diff; + } +}; + +/** **Squared** Euclidean (L2) distance functor (suitable for low-dimensionality + * datasets, like 2D or 3D point clouds) Corresponding distance traits: + * nanoflann::metric_L2_Simple + * + * \tparam T Type of the elements (e.g. double, float, uint8_t) + * \tparam DataSource Source of the data, i.e. where the vectors are stored + * \tparam _DistanceType Type of distance variables (must be signed) + * \tparam IndexType Type of the arguments with which the data can be + * accessed (e.g. float, double, int64_t, T*) + */ +template +struct L2_Simple_Adaptor +{ + using ElementType = T; + using DistanceType = _DistanceType; + + const DataSource& data_source; + + L2_Simple_Adaptor(const DataSource& _data_source) : data_source(_data_source) {} + + inline DistanceType evalMetric(const T* a, const IndexType b_idx, size_t size) const + { + DistanceType result = DistanceType(); + for (size_t i = 0; i < size; ++i) + { + const DistanceType diff = a[i] - data_source.kdtree_get_pt(b_idx, i); + result += diff * diff; + } + return result; + } + + template + inline DistanceType accum_dist(const U a, const V b, const size_t) const + { + auto diff = a - b; + return diff * diff; + } +}; + +/** SO2 distance functor + * Corresponding distance traits: nanoflann::metric_SO2 + * + * \tparam T Type of the elements (e.g. double, float, uint8_t) + * \tparam DataSource Source of the data, i.e. where the vectors are stored + * \tparam _DistanceType Type of distance variables (must be signed) (e.g. + * float, double) orientation is constrained to be in [-pi, pi] + * \tparam IndexType Type of the arguments with which the data can be + * accessed (e.g. float, double, int64_t, T*) + */ +template +struct SO2_Adaptor +{ + using ElementType = T; + using DistanceType = _DistanceType; + + const DataSource& data_source; + + SO2_Adaptor(const DataSource& _data_source) : data_source(_data_source) {} + + inline DistanceType evalMetric(const T* a, const IndexType b_idx, size_t size) const + { + return accum_dist(a[size - 1], data_source.kdtree_get_pt(b_idx, size - 1), size - 1); + } + + /** Note: this assumes that input angles are already in the range [-pi,pi] + */ + template + inline DistanceType accum_dist(const U a, const V b, const size_t) const + { + DistanceType result = DistanceType(); + DistanceType PI = pi_const(); + result = b - a; + if (result > PI) + result -= 2 * PI; + else if (result < -PI) + result += 2 * PI; + return result; + } +}; + +/** SO3 distance functor (Uses L2_Simple) + * Corresponding distance traits: nanoflann::metric_SO3 + * + * \tparam T Type of the elements (e.g. double, float, uint8_t) + * \tparam DataSource Source of the data, i.e. where the vectors are stored + * \tparam _DistanceType Type of distance variables (must be signed) (e.g. + * float, double) + * \tparam IndexType Type of the arguments with which the data can be + * accessed (e.g. float, double, int64_t, T*) + */ +template +struct SO3_Adaptor +{ + using ElementType = T; + using DistanceType = _DistanceType; + + L2_Simple_Adaptor distance_L2_Simple; + + SO3_Adaptor(const DataSource& _data_source) : distance_L2_Simple(_data_source) {} + + inline DistanceType evalMetric(const T* a, const IndexType b_idx, size_t size) const + { + return distance_L2_Simple.evalMetric(a, b_idx, size); + } + + template + inline DistanceType accum_dist(const U a, const V b, const size_t idx) const + { + return distance_L2_Simple.accum_dist(a, b, idx); + } +}; + +/** Metaprogramming helper traits class for the L1 (Manhattan) metric */ +struct metric_L1 : public Metric +{ + template + struct traits + { + using distance_t = L1_Adaptor; + }; +}; +/** Metaprogramming helper traits class for the L2 (Euclidean) **squared** + * distance metric */ +struct metric_L2 : public Metric +{ + template + struct traits + { + using distance_t = L2_Adaptor; + }; +}; +/** Metaprogramming helper traits class for the L2_simple (Euclidean) + * **squared** distance metric */ +struct metric_L2_Simple : public Metric +{ + template + struct traits + { + using distance_t = L2_Simple_Adaptor; + }; +}; +/** Metaprogramming helper traits class for the SO3_InnerProdQuat metric */ +struct metric_SO2 : public Metric +{ + template + struct traits + { + using distance_t = SO2_Adaptor; + }; +}; +/** Metaprogramming helper traits class for the SO3_InnerProdQuat metric */ +struct metric_SO3 : public Metric +{ + template + struct traits + { + using distance_t = SO3_Adaptor; + }; +}; + +/** @} */ + +/** @addtogroup param_grp Parameter structs + * @{ */ + +enum class KDTreeSingleIndexAdaptorFlags +{ + None = 0, + SkipInitialBuildIndex = 1 +}; + +inline std::underlying_type::type operator&( + KDTreeSingleIndexAdaptorFlags lhs, KDTreeSingleIndexAdaptorFlags rhs) +{ + using underlying = typename std::underlying_type::type; + return static_cast(lhs) & static_cast(rhs); +} + +/** Parameters (see README.md) */ +struct KDTreeSingleIndexAdaptorParams +{ + KDTreeSingleIndexAdaptorParams( + size_t _leaf_max_size = 10, + KDTreeSingleIndexAdaptorFlags _flags = KDTreeSingleIndexAdaptorFlags::None, + unsigned int _n_thread_build = 1) + : leaf_max_size(_leaf_max_size), flags(_flags), n_thread_build(_n_thread_build) + { + } + + size_t leaf_max_size; + KDTreeSingleIndexAdaptorFlags flags; + unsigned int n_thread_build; +}; + +/** Search options for KDTreeSingleIndexAdaptor::findNeighbors() */ +struct SearchParameters +{ + SearchParameters(float eps_ = 0, bool sorted_ = true) : eps(eps_), sorted(sorted_) {} + + float eps; //!< search for eps-approximate neighbours (default: 0) + bool sorted; //!< only for radius search, require neighbours sorted by + //!< distance (default: true) +}; +/** @} */ + +/** @addtogroup memalloc_grp Memory allocation + * @{ */ + +/** + * Pooled storage allocator + * + * The following routines allow for the efficient allocation of storage in + * small chunks from a specified pool. Rather than allowing each structure + * to be freed individually, an entire pool of storage is freed at once. + * This method has two advantages over just using malloc() and free(). First, + * it is far more efficient for allocating small objects, as there is + * no overhead for remembering all the information needed to free each + * object or consolidating fragmented memory. Second, the decision about + * how long to keep an object is made at the time of allocation, and there + * is no need to track down all the objects to free them. + * + */ +class PooledAllocator +{ + static constexpr size_t WORDSIZE = 16; // WORDSIZE must >= 8 + static constexpr size_t BLOCKSIZE = 8192; + + /* We maintain memory alignment to word boundaries by requiring that all + allocations be in multiples of the machine wordsize. */ + /* Size of machine word in bytes. Must be power of 2. */ + /* Minimum number of bytes requested at a time from the system. Must be + * multiple of WORDSIZE. */ + + using Size = size_t; + + Size remaining_ = 0; //!< Number of bytes left in current block of storage + void* base_ = nullptr; //!< Pointer to base of current block of storage + void* loc_ = nullptr; //!< Current location in block to next allocate + + void internal_init() + { + remaining_ = 0; + base_ = nullptr; + usedMemory = 0; + wastedMemory = 0; + } + + public: + Size usedMemory = 0; + Size wastedMemory = 0; + + /** + Default constructor. Initializes a new pool. + */ + PooledAllocator() { internal_init(); } + + /** + * Destructor. Frees all the memory allocated in this pool. + */ + ~PooledAllocator() { free_all(); } + + /** Frees all allocated memory chunks */ + void free_all() + { + while (base_ != nullptr) + { + // Get pointer to prev block + void* prev = *(static_cast(base_)); + ::free(base_); + base_ = prev; + } + internal_init(); + } + + /** + * Returns a pointer to a piece of new memory of the given size in bytes + * allocated from the pool. + */ + void* malloc(const size_t req_size) + { + /* Round size up to a multiple of wordsize. The following expression + only works for WORDSIZE that is a power of 2, by masking last bits + of incremented size to zero. + */ + const Size size = (req_size + (WORDSIZE - 1)) & ~(WORDSIZE - 1); + + /* Check whether a new block must be allocated. Note that the first + word of a block is reserved for a pointer to the previous block. + */ + if (size > remaining_) + { + wastedMemory += remaining_; + + /* Allocate new storage. */ + const Size blocksize = size > BLOCKSIZE ? size + WORDSIZE : BLOCKSIZE + WORDSIZE; + + // use the standard C malloc to allocate memory + void* m = ::malloc(blocksize); + if (!m) + { + throw std::bad_alloc(); + } + + /* Fill first word of new block with pointer to previous block. */ + static_cast(m)[0] = base_; + base_ = m; + + remaining_ = blocksize - WORDSIZE; + loc_ = static_cast(m) + WORDSIZE; + } + void* rloc = loc_; + loc_ = static_cast(loc_) + size; + remaining_ -= size; + + usedMemory += size; + + return rloc; + } + + /** + * Allocates (using this pool) a generic type T. + * + * Params: + * count = number of instances to allocate. + * Returns: pointer (of type T*) to memory buffer + */ + template + T* allocate(const size_t count = 1) + { + T* mem = static_cast(this->malloc(sizeof(T) * count)); + return mem; + } +}; +/** @} */ + +/** @addtogroup nanoflann_metaprog_grp Auxiliary metaprogramming stuff + * @{ */ + +/** Used to declare fixed-size arrays when DIM>0, dynamically-allocated vectors + * when DIM=-1. Fixed size version for a generic DIM: + */ +template +struct array_or_vector +{ + using type = std::array; +}; +/** Dynamic size version */ +template +struct array_or_vector<-1, T> +{ + using type = std::vector; +}; + +/** @} */ + +/** kd-tree base-class + * + * Contains the member functions common to the classes KDTreeSingleIndexAdaptor + * and KDTreeSingleIndexDynamicAdaptor_. + * + * \tparam Derived The name of the class which inherits this class. + * \tparam DatasetAdaptor The user-provided adaptor, which must be ensured to + * have a lifetime equal or longer than the instance of this class. + * \tparam Distance The distance metric to use, these are all classes derived + * from nanoflann::Metric + * \tparam DIM Dimensionality of data points (e.g. 3 for 3D points) + * \tparam IndexType Type of the arguments with which the data can be + * accessed (e.g. float, double, int64_t, T*) + */ +template < + class Derived, typename Distance, class DatasetAdaptor, int32_t DIM = -1, + typename index_t = uint32_t> +class KDTreeBaseClass +{ + public: + /** Frees the previously-built index. Automatically called within + * buildIndex(). */ + void freeIndex(Derived& obj) + { + obj.pool_.free_all(); + obj.root_node_ = nullptr; + obj.size_at_index_build_ = 0; + } + + using ElementType = typename Distance::ElementType; + using DistanceType = typename Distance::DistanceType; + using IndexType = index_t; + + /** + * Array of indices to vectors in the dataset_. + */ + std::vector vAcc_; + + using Offset = typename decltype(vAcc_)::size_type; + using Size = typename decltype(vAcc_)::size_type; + using Dimension = int32_t; + + /*------------------------------------------------------------------- + * Internal Data Structures + * + * "Node" below can be declared with alignas(N) to improve + * cache friendliness and SIMD load/store performance. + * + * The optimal N depends on the underlying hardware: + * + Intel x86-64: 16 for SSE, 32 for AVX/AVX2 and 64 for AVX-512 + * + NVIDIA Jetson: 16 for ARM + NEON and CUDA float4/ + * To avoid unnecessary padding, the smallest alignment + * compatible with a platform's vector width should be chosen. + * ------------------------------------------------------------------*/ + struct alignas(NANOFLANN_NODE_ALIGNMENT) Node + { + /** Union used because a node can be either a LEAF node or a non-leaf + * node, so both data fields are never used simultaneously */ + union + { + struct leaf + { + Offset left, right; //!< Indices of points in leaf node + } lr; + struct nonleaf + { + Dimension divfeat; //!< Dimension used for subdivision. + /// The values used for subdivision. + DistanceType divlow, divhigh; + } sub; + } node_type; + + /** Child nodes (both=nullptr mean its a leaf node) */ + Node *child1 = nullptr, *child2 = nullptr; + }; + + using NodePtr = Node*; + using NodeConstPtr = const Node*; + + struct Interval + { + ElementType low, high; + }; + + NodePtr root_node_ = nullptr; + + Size leaf_max_size_ = 0; + + /// Number of thread for concurrent tree build + Size n_thread_build_ = 1; + /// Number of current points in the dataset + Size size_ = 0; + /// Number of points in the dataset when the index was built + Size size_at_index_build_ = 0; + Dimension dim_ = 0; //!< Dimensionality of each data point + + /** Define "BoundingBox" as a fixed-size or variable-size container + * depending on "DIM" */ + using BoundingBox = typename array_or_vector::type; + + /** Define "distance_vector_t" as a fixed-size or variable-size container + * depending on "DIM" */ + using distance_vector_t = typename array_or_vector::type; + + /** The KD-tree used to find neighbours */ + BoundingBox root_bbox_; + + /** + * Pooled memory allocator. + * + * Using a pooled memory allocator is more efficient + * than allocating memory directly when there is a large + * number small of memory allocations. + */ + PooledAllocator pool_; + + /** Returns number of points in dataset */ + Size size(const Derived& obj) const { return obj.size_; } + + /** Returns the length of each point in the dataset */ + Size veclen(const Derived& obj) const { return DIM > 0 ? DIM : obj.dim_; } + + /// Helper accessor to the dataset points: + ElementType dataset_get(const Derived& obj, IndexType element, Dimension component) const + { + return obj.dataset_.kdtree_get_pt(element, component); + } + + /** + * Computes the index memory usage + * Returns: memory used by the index + */ + Size usedMemory(const Derived& obj) const + { + return obj.pool_.usedMemory + obj.pool_.wastedMemory + + obj.dataset_.kdtree_get_point_count() * + sizeof(IndexType); // pool memory and vind array memory + } + + /** + * Compute the minimum and maximum element values in the specified dimension + */ + void computeMinMax( + const Derived& obj, Offset ind, Size count, Dimension element, ElementType& min_elem, + ElementType& max_elem) const + { + min_elem = dataset_get(obj, vAcc_[ind], element); + max_elem = min_elem; + for (Offset i = 1; i < count; ++i) + { + ElementType val = dataset_get(obj, vAcc_[ind + i], element); + if (val < min_elem) min_elem = val; + if (val > max_elem) max_elem = val; + } + } + + /** + * Create a tree node that subdivides the list of vecs from vind[first] + * to vind[last]. The routine is called recursively on each sublist. + * + * @param left index of the first vector + * @param right index of the last vector + * @param bbox bounding box used as input for splitting and output for + * parent node + */ + NodePtr divideTree(Derived& obj, const Offset left, const Offset right, BoundingBox& bbox) + { + assert(left < obj.dataset_.kdtree_get_point_count()); + + NodePtr node = obj.pool_.template allocate(); // allocate memory + const auto dims = (DIM > 0 ? DIM : obj.dim_); + + /* If too few exemplars remain, then make this a leaf node. */ + if ((right - left) <= static_cast(obj.leaf_max_size_)) + { + node->child1 = node->child2 = nullptr; /* Mark as leaf node. */ + node->node_type.lr.left = left; + node->node_type.lr.right = right; + + // compute bounding-box of leaf points + for (Dimension i = 0; i < dims; ++i) + { + bbox[i].low = dataset_get(obj, obj.vAcc_[left], i); + bbox[i].high = dataset_get(obj, obj.vAcc_[left], i); + } + for (Offset k = left + 1; k < right; ++k) + { + for (Dimension i = 0; i < dims; ++i) + { + const auto val = dataset_get(obj, obj.vAcc_[k], i); + if (bbox[i].low > val) bbox[i].low = val; + if (bbox[i].high < val) bbox[i].high = val; + } + } + } + else + { + /* Determine the index, dimension and value for split plane */ + Offset idx; + Dimension cutfeat; + DistanceType cutval; + middleSplit_(obj, left, right - left, idx, cutfeat, cutval, bbox); + + node->node_type.sub.divfeat = cutfeat; + + /* Recurse on left */ + BoundingBox left_bbox(bbox); + left_bbox[cutfeat].high = cutval; + node->child1 = this->divideTree(obj, left, left + idx, left_bbox); + + /* Recurse on right */ + BoundingBox right_bbox(bbox); + right_bbox[cutfeat].low = cutval; + node->child2 = this->divideTree(obj, left + idx, right, right_bbox); + + node->node_type.sub.divlow = left_bbox[cutfeat].high; + node->node_type.sub.divhigh = right_bbox[cutfeat].low; + + for (Dimension i = 0; i < dims; ++i) + { + bbox[i].low = std::min(left_bbox[i].low, right_bbox[i].low); + bbox[i].high = std::max(left_bbox[i].high, right_bbox[i].high); + } + } + + return node; + } + + /** + * Create a tree node that subdivides the list of vecs from vind[first] to + * vind[last] concurrently. The routine is called recursively on each + * sublist. + * + * @param left index of the first vector + * @param right index of the last vector + * @param bbox bounding box used as input for splitting and output for + * parent node + * @param thread_count count of std::async threads + * @param mutex mutex for mempool allocation + */ + NodePtr divideTreeConcurrent( + Derived& obj, const Offset left, const Offset right, BoundingBox& bbox, + std::atomic& thread_count, std::mutex& mutex) + { + std::unique_lock lock(mutex); + NodePtr node = obj.pool_.template allocate(); // allocate memory + lock.unlock(); + + const auto dims = (DIM > 0 ? DIM : obj.dim_); + + /* If too few exemplars remain, then make this a leaf node. */ + if ((right - left) <= static_cast(obj.leaf_max_size_)) + { + node->child1 = node->child2 = nullptr; /* Mark as leaf node. */ + node->node_type.lr.left = left; + node->node_type.lr.right = right; + + // compute bounding-box of leaf points + for (Dimension i = 0; i < dims; ++i) + { + bbox[i].low = dataset_get(obj, obj.vAcc_[left], i); + bbox[i].high = dataset_get(obj, obj.vAcc_[left], i); + } + for (Offset k = left + 1; k < right; ++k) + { + for (Dimension i = 0; i < dims; ++i) + { + const auto val = dataset_get(obj, obj.vAcc_[k], i); + if (bbox[i].low > val) bbox[i].low = val; + if (bbox[i].high < val) bbox[i].high = val; + } + } + } + else + { + /* Determine the index, dimension and value for split plane */ + Offset idx; + Dimension cutfeat; + DistanceType cutval; + middleSplit_(obj, left, right - left, idx, cutfeat, cutval, bbox); + + node->node_type.sub.divfeat = cutfeat; + + std::future right_future; + + /* Recurse on right concurrently, if possible */ + + BoundingBox right_bbox(bbox); + right_bbox[cutfeat].low = cutval; + if (++thread_count < n_thread_build_) + { + /* Concurrent thread for right recursion */ + + right_future = std::async( + std::launch::async, &KDTreeBaseClass::divideTreeConcurrent, this, std::ref(obj), + left + idx, right, std::ref(right_bbox), std::ref(thread_count), + std::ref(mutex)); + } + else + { + --thread_count; + } + + /* Recurse on left in this thread */ + + BoundingBox left_bbox(bbox); + left_bbox[cutfeat].high = cutval; + node->child1 = + this->divideTreeConcurrent(obj, left, left + idx, left_bbox, thread_count, mutex); + + if (right_future.valid()) + { + /* Block and wait for concurrent right from above */ + + node->child2 = right_future.get(); + --thread_count; + } + else + { + /* Otherwise, recurse on right in this thread */ + + node->child2 = this->divideTreeConcurrent( + obj, left + idx, right, right_bbox, thread_count, mutex); + } + + node->node_type.sub.divlow = left_bbox[cutfeat].high; + node->node_type.sub.divhigh = right_bbox[cutfeat].low; + + for (Dimension i = 0; i < dims; ++i) + { + bbox[i].low = std::min(left_bbox[i].low, right_bbox[i].low); + bbox[i].high = std::max(left_bbox[i].high, right_bbox[i].high); + } + } + + return node; + } + + void middleSplit_( + const Derived& obj, const Offset ind, const Size count, Offset& index, Dimension& cutfeat, + DistanceType& cutval, const BoundingBox& bbox) + { + const auto dims = (DIM > 0 ? DIM : obj.dim_); + const auto EPS = static_cast(0.00001); + + // Pre-compute max_span once + ElementType max_span = bbox[0].high - bbox[0].low; + for (Dimension i = 1; i < dims; ++i) + { + ElementType span = bbox[i].high - bbox[i].low; + if (span > max_span) max_span = span; + } + + // Single-pass min/max computation for candidate dimensions + cutfeat = 0; + ElementType max_spread = -1; + ElementType min_elem = 0, max_elem = 0; + + // Only check dimensions within (1-EPS) of max_span + std::vector candidates; + candidates.reserve(dims); + for (Dimension i = 0; i < dims; ++i) + { + if (bbox[i].high - bbox[i].low >= (1 - EPS) * max_span) + { + candidates.push_back(i); + } + } + + // Vectorized min/max for candidates + for (Dimension dim : candidates) + { + ElementType local_min = dataset_get(obj, vAcc_[ind], dim); + ElementType local_max = local_min; + + // Unrolled loop for better performance + constexpr size_t UNROLL = 4; + Offset k = 1; + for (; k + UNROLL <= count; k += UNROLL) + { + ElementType v0 = dataset_get(obj, vAcc_[ind + k], dim); + ElementType v1 = dataset_get(obj, vAcc_[ind + k + 1], dim); + ElementType v2 = dataset_get(obj, vAcc_[ind + k + 2], dim); + ElementType v3 = dataset_get(obj, vAcc_[ind + k + 3], dim); + + local_min = std::min({local_min, v0, v1, v2, v3}); + local_max = std::max({local_max, v0, v1, v2, v3}); + } + + // Handle remainder + for (; k < count; ++k) + { + ElementType val = dataset_get(obj, vAcc_[ind + k], dim); + local_min = std::min(local_min, val); + local_max = std::max(local_max, val); + } + + ElementType spread = local_max - local_min; + if (spread > max_spread) + { + cutfeat = dim; + max_spread = spread; + min_elem = local_min; + max_elem = local_max; + } + } + + // Median-of-three for better balance + DistanceType split_val = (bbox[cutfeat].low + bbox[cutfeat].high) / 2; + if (split_val < min_elem) split_val = min_elem; + if (split_val > max_elem) split_val = max_elem; + + cutval = split_val; + + // Optimized partitioning + Offset lim1, lim2; + planeSplit(obj, ind, count, cutfeat, cutval, lim1, lim2); + + index = (lim1 > count / 2) ? lim1 : (lim2 < count / 2) ? lim2 : count / 2; + } + + /** + * Subdivide the list of points by a plane perpendicular on the axis + * corresponding to the 'cutfeat' dimension at 'cutval' position. + * + * On return: + * dataset[ind[0..lim1-1]][cutfeat] < cutval + * dataset[ind[lim1..lim2-1]][cutfeat] == cutval + * dataset[ind[lim2..count]][cutfeat] > cutval + */ + void planeSplit( + const Derived& obj, const Offset ind, const Size count, const Dimension cutfeat, + const DistanceType& cutval, Offset& lim1, Offset& lim2) + { + // Dutch National Flag algorithm for three-way partitioning + Offset left = 0; + Offset mid = 0; + Offset right = count - 1; + + while (mid <= right) + { + ElementType val = dataset_get(obj, vAcc_[ind + mid], cutfeat); + + if (val < cutval) + { + std::swap(vAcc_[ind + left], vAcc_[ind + mid]); + left++; + mid++; + } + else if (val > cutval) + { + std::swap(vAcc_[ind + mid], vAcc_[ind + right]); + right--; + } + else + { + mid++; + } + } + + lim1 = left; + lim2 = mid; + } + + DistanceType computeInitialDistances( + const Derived& obj, const ElementType* vec, distance_vector_t& dists) const + { + assert(vec); + DistanceType dist = DistanceType(); + + for (Dimension i = 0; i < (DIM > 0 ? DIM : obj.dim_); ++i) + { + if (vec[i] < obj.root_bbox_[i].low) + { + dists[i] = obj.distance_.accum_dist(vec[i], obj.root_bbox_[i].low, i); + dist += dists[i]; + } + if (vec[i] > obj.root_bbox_[i].high) + { + dists[i] = obj.distance_.accum_dist(vec[i], obj.root_bbox_[i].high, i); + dist += dists[i]; + } + } + return dist; + } + + static void save_tree(const Derived& obj, std::ostream& stream, const NodeConstPtr tree) + { + save_value(stream, *tree); + if (tree->child1 != nullptr) + { + save_tree(obj, stream, tree->child1); + } + if (tree->child2 != nullptr) + { + save_tree(obj, stream, tree->child2); + } + } + + static void load_tree(Derived& obj, std::istream& stream, NodePtr& tree) + { + tree = obj.pool_.template allocate(); + load_value(stream, *tree); + if (tree->child1 != nullptr) + { + load_tree(obj, stream, tree->child1); + } + if (tree->child2 != nullptr) + { + load_tree(obj, stream, tree->child2); + } + } + + /** Stores the index in a binary file. + * IMPORTANT NOTE: The set of data points is NOT stored in the file, so + * when loading the index object it must be constructed associated to the + * same source of data points used while building it. See the example: + * examples/saveload_example.cpp \sa loadIndex */ + void saveIndex(const Derived& obj, std::ostream& stream) const + { + save_value(stream, obj.size_); + save_value(stream, obj.dim_); + save_value(stream, obj.root_bbox_); + save_value(stream, obj.leaf_max_size_); + save_value(stream, obj.vAcc_); + if (obj.root_node_) save_tree(obj, stream, obj.root_node_); + } + + /** Loads a previous index from a binary file. + * IMPORTANT NOTE: The set of data points is NOT stored in the file, so + * the index object must be constructed associated to the same source of + * data points used while building the index. See the example: + * examples/saveload_example.cpp \sa loadIndex */ + void loadIndex(Derived& obj, std::istream& stream) + { + load_value(stream, obj.size_); + load_value(stream, obj.dim_); + load_value(stream, obj.root_bbox_); + load_value(stream, obj.leaf_max_size_); + load_value(stream, obj.vAcc_); + load_tree(obj, stream, obj.root_node_); + } +}; + +/** @addtogroup kdtrees_grp KD-tree classes and adaptors + * @{ */ + +/** kd-tree static index + * + * Contains the k-d trees and other information for indexing a set of points + * for nearest-neighbor matching. + * + * The class "DatasetAdaptor" must provide the following interface (can be + * non-virtual, inlined methods): + * + * \code + * // Must return the number of data poins + * size_t kdtree_get_point_count() const { ... } + * + * + * // Must return the dim'th component of the idx'th point in the class: + * T kdtree_get_pt(const size_t idx, const size_t dim) const { ... } + * + * // Optional bounding-box computation: return false to default to a standard + * bbox computation loop. + * // Return true if the BBOX was already computed by the class and returned + * in "bb" so it can be avoided to redo it again. + * // Look at bb.size() to find out the expected dimensionality (e.g. 2 or 3 + * for point clouds) template bool kdtree_get_bbox(BBOX &bb) const + * { + * bb[0].low = ...; bb[0].high = ...; // 0th dimension limits + * bb[1].low = ...; bb[1].high = ...; // 1st dimension limits + * ... + * return true; + * } + * + * \endcode + * + * \tparam DatasetAdaptor The user-provided adaptor, which must be ensured to + * have a lifetime equal or longer than the instance of this class. + * \tparam Distance The distance metric to use: nanoflann::metric_L1, + * nanoflann::metric_L2, nanoflann::metric_L2_Simple, etc. \tparam DIM + * Dimensionality of data points (e.g. 3 for 3D points) \tparam IndexType Will + * be typically size_t or int + */ +template +class KDTreeSingleIndexAdaptor + : public KDTreeBaseClass< + KDTreeSingleIndexAdaptor, Distance, + DatasetAdaptor, DIM, index_t> +{ + public: + /** Deleted copy constructor*/ + explicit KDTreeSingleIndexAdaptor( + const KDTreeSingleIndexAdaptor&) = delete; + + /** The data source used by this index */ + const DatasetAdaptor& dataset_; + + const KDTreeSingleIndexAdaptorParams indexParams; + + Distance distance_; + + using Base = typename nanoflann::KDTreeBaseClass< + nanoflann::KDTreeSingleIndexAdaptor, Distance, + DatasetAdaptor, DIM, index_t>; + + using Offset = typename Base::Offset; + using Size = typename Base::Size; + using Dimension = typename Base::Dimension; + + using ElementType = typename Base::ElementType; + using DistanceType = typename Base::DistanceType; + using IndexType = typename Base::IndexType; + + using Node = typename Base::Node; + using NodePtr = Node*; + + using Interval = typename Base::Interval; + + /** Define "BoundingBox" as a fixed-size or variable-size container + * depending on "DIM" */ + using BoundingBox = typename Base::BoundingBox; + + /** Define "distance_vector_t" as a fixed-size or variable-size container + * depending on "DIM" */ + using distance_vector_t = typename Base::distance_vector_t; + + /** + * KDTree constructor + * + * Refer to docs in README.md or online in + * https://github.com/jlblancoc/nanoflann + * + * The KD-Tree point dimension (the length of each point in the datase, e.g. + * 3 for 3D points) is determined by means of: + * - The \a DIM template parameter if >0 (highest priority) + * - Otherwise, the \a dimensionality parameter of this constructor. + * + * @param inputData Dataset with the input features. Its lifetime must be + * equal or longer than that of the instance of this class. + * @param params Basically, the maximum leaf node size + * + * Note that there is a variable number of optional additional parameters + * which will be forwarded to the metric class constructor. Refer to example + * `examples/pointcloud_custom_metric.cpp` for a use case. + * + */ + template + explicit KDTreeSingleIndexAdaptor( + const Dimension dimensionality, const DatasetAdaptor& inputData, + const KDTreeSingleIndexAdaptorParams& params, Args&&... args) + : dataset_(inputData), + indexParams(params), + distance_(inputData, std::forward(args)...) + { + init(dimensionality, params); + } + + explicit KDTreeSingleIndexAdaptor( + const Dimension dimensionality, const DatasetAdaptor& inputData, + const KDTreeSingleIndexAdaptorParams& params = {}) + : dataset_(inputData), indexParams(params), distance_(inputData) + { + init(dimensionality, params); + } + + private: + void init(const Dimension dimensionality, const KDTreeSingleIndexAdaptorParams& params) + { + Base::size_ = dataset_.kdtree_get_point_count(); + Base::size_at_index_build_ = Base::size_; + Base::dim_ = dimensionality; + if (DIM > 0) Base::dim_ = DIM; + Base::leaf_max_size_ = params.leaf_max_size; + if (params.n_thread_build > 0) + { + Base::n_thread_build_ = params.n_thread_build; + } + else + { + Base::n_thread_build_ = std::max(std::thread::hardware_concurrency(), 1u); + } + + if (!(params.flags & KDTreeSingleIndexAdaptorFlags::SkipInitialBuildIndex)) + { + // Build KD-tree: + buildIndex(); + } + } + + public: + /** + * Builds the index + */ + void buildIndex() + { + Base::size_ = dataset_.kdtree_get_point_count(); + Base::size_at_index_build_ = Base::size_; + init_vind(); + this->freeIndex(*this); + Base::size_at_index_build_ = Base::size_; + if (Base::size_ == 0) return; + computeBoundingBox(Base::root_bbox_); + // construct the tree + if (Base::n_thread_build_ == 1) + { + Base::root_node_ = this->divideTree(*this, 0, Base::size_, Base::root_bbox_); + } + else + { +#ifndef NANOFLANN_NO_THREADS + std::atomic thread_count(0u); + std::mutex mutex; + Base::root_node_ = this->divideTreeConcurrent( + *this, 0, Base::size_, Base::root_bbox_, thread_count, mutex); +#else /* NANOFLANN_NO_THREADS */ + throw std::runtime_error("Multithreading is disabled"); +#endif /* NANOFLANN_NO_THREADS */ + } + } + + /** \name Query methods + * @{ */ + + /** + * Find set of nearest neighbors to vec[0:dim-1]. Their indices are stored + * inside the result object. + * + * Params: + * result = the result object in which the indices of the + * nearest-neighbors are stored vec = the vector for which to search the + * nearest neighbors + * + * \tparam RESULTSET Should be any ResultSet + * \return True if the requested neighbors could be found. + * \sa knnSearch, radiusSearch + * + * \note If L2 norms are used, all returned distances are actually squared + * distances. + */ + template + bool findNeighbors( + RESULTSET& result, const ElementType* vec, const SearchParameters& searchParams = {}) const + { + assert(vec); + if (this->size(*this) == 0) return false; + if (!Base::root_node_) + throw std::runtime_error( + "[nanoflann] findNeighbors() called before building the " + "index."); + float epsError = 1 + searchParams.eps; + + // fixed or variable-sized container (depending on DIM) + distance_vector_t dists; + // Fill it with zeros. + auto zero = static_cast(0); + assign(dists, (DIM > 0 ? DIM : Base::dim_), zero); + DistanceType dist = this->computeInitialDistances(*this, vec, dists); + searchLevel(result, vec, Base::root_node_, dist, dists, epsError); + + if (searchParams.sorted) result.sort(); + + return result.full(); + } + + /** + * Find all points contained within the specified bounding box. Their + * indices are stored inside the result object. + * + * Params: + * result = the result object in which the indices of the points + * within the bounding box are stored + * bbox = the bounding box defining the search region + * + * \tparam RESULTSET Should be any ResultSet + * \return Number of points found within the bounding box. + * \sa findNeighbors, knnSearch, radiusSearch + * + * \note The search is inclusive - points on the boundary are included. + */ + template + Size findWithinBox(RESULTSET& result, const BoundingBox& bbox) const + { + if (this->size(*this) == 0) return 0; + if (!Base::root_node_) + throw std::runtime_error( + "[nanoflann] findWithinBox() called before building the " + "index."); + + std::stack stack; + stack.push(Base::root_node_); + + while (!stack.empty()) + { + const NodePtr node = stack.top(); + stack.pop(); + + // If this is a leaf node, then do check and return. + if (!node->child1) // (if one node is nullptr, both are) + { + for (Offset i = node->node_type.lr.left; i < node->node_type.lr.right; ++i) + { + if (contains(bbox, Base::vAcc_[i])) + { + if (!result.addPoint(0, Base::vAcc_[i])) + { + // the resultset doesn't want to receive any more + // points, we're done searching! + return result.size(); + } + } + } + } + else + { + const int idx = node->node_type.sub.divfeat; + const auto low_bound = node->node_type.sub.divlow; + const auto high_bound = node->node_type.sub.divhigh; + + if (bbox[idx].low <= low_bound) stack.push(node->child1); + if (bbox[idx].high >= high_bound) stack.push(node->child2); + } + } + + return result.size(); + } + + /** + * Find the "num_closest" nearest neighbors to the \a query_point[0:dim-1]. + * Their indices and distances are stored in the provided pointers to + * array/vector. + * + * \sa radiusSearch, findNeighbors + * \return Number `N` of valid points in the result set. + * + * \note If L2 norms are used, all returned distances are actually squared + * distances. + * + * \note Only the first `N` entries in `out_indices` and `out_distances` + * will be valid. Return is less than `num_closest` only if the + * number of elements in the tree is less than `num_closest`. + */ + Size knnSearch( + const ElementType* query_point, const Size num_closest, IndexType* out_indices, + DistanceType* out_distances) const + { + nanoflann::KNNResultSet resultSet(num_closest); + resultSet.init(out_indices, out_distances); + findNeighbors(resultSet, query_point); + return resultSet.size(); + } + + /** + * Find all the neighbors to \a query_point[0:dim-1] within a maximum + * radius. The output is given as a vector of pairs, of which the first + * element is a point index and the second the corresponding distance. + * Previous contents of \a IndicesDists are cleared. + * + * If searchParams.sorted==true, the output list is sorted by ascending + * distances. + * + * For a better performance, it is advisable to do a .reserve() on the + * vector if you have any wild guess about the number of expected matches. + * + * \sa knnSearch, findNeighbors, radiusSearchCustomCallback + * \return The number of points within the given radius (i.e. indices.size() + * or dists.size() ) + * + * \note If L2 norms are used, search radius and all returned distances + * are actually squared distances. + */ + Size radiusSearch( + const ElementType* query_point, const DistanceType& radius, + std::vector>& IndicesDists, + const SearchParameters& searchParams = {}) const + { + RadiusResultSet resultSet(radius, IndicesDists); + const Size nFound = radiusSearchCustomCallback(query_point, resultSet, searchParams); + return nFound; + } + + /** + * Just like radiusSearch() but with a custom callback class for each point + * found in the radius of the query. See the source of RadiusResultSet<> as + * a start point for your own classes. \sa radiusSearch + */ + template + Size radiusSearchCustomCallback( + const ElementType* query_point, SEARCH_CALLBACK& resultSet, + const SearchParameters& searchParams = {}) const + { + findNeighbors(resultSet, query_point, searchParams); + return resultSet.size(); + } + + /** + * Find the first N neighbors to \a query_point[0:dim-1] within a maximum + * radius. The output is given as a vector of pairs, of which the first + * element is a point index and the second the corresponding distance. + * Previous contents of \a IndicesDists are cleared. + * + * \sa radiusSearch, findNeighbors + * \return Number `N` of valid points in the result set. + * + * \note If L2 norms are used, all returned distances are actually squared + * distances. + * + * \note Only the first `N` entries in `out_indices` and `out_distances` + * will be valid. Return is less than `num_closest` only if the + * number of elements in the tree is less than `num_closest`. + */ + Size rknnSearch( + const ElementType* query_point, const Size num_closest, IndexType* out_indices, + DistanceType* out_distances, const DistanceType& radius) const + { + nanoflann::RKNNResultSet resultSet(num_closest, radius); + resultSet.init(out_indices, out_distances); + findNeighbors(resultSet, query_point); + return resultSet.size(); + } + + /** @} */ + + public: + /** Make sure the auxiliary list \a vind has the same size as the + * current dataset, and re-generate if size has changed. */ + void init_vind() + { + // Create a permutable array of indices to the input vectors. + Base::size_ = dataset_.kdtree_get_point_count(); + if (Base::vAcc_.size() != Base::size_) Base::vAcc_.resize(Base::size_); + for (IndexType i = 0; i < static_cast(Base::size_); i++) Base::vAcc_[i] = i; + } + + void computeBoundingBox(BoundingBox& bbox) + { + const auto dims = (DIM > 0 ? DIM : Base::dim_); + resize(bbox, dims); + if (dataset_.kdtree_get_bbox(bbox)) + { + // Done! It was implemented in derived class + } + else + { + const Size N = dataset_.kdtree_get_point_count(); + if (!N) + throw std::runtime_error( + "[nanoflann] computeBoundingBox() called but " + "no data points found."); + for (Dimension i = 0; i < dims; ++i) + { + bbox[i].low = bbox[i].high = this->dataset_get(*this, Base::vAcc_[0], i); + } + for (Offset k = 1; k < N; ++k) + { + for (Dimension i = 0; i < dims; ++i) + { + const auto val = this->dataset_get(*this, Base::vAcc_[k], i); + if (val < bbox[i].low) bbox[i].low = val; + if (val > bbox[i].high) bbox[i].high = val; + } + } + } + } + + bool contains(const BoundingBox& bbox, IndexType idx) const + { + const auto dims = (DIM > 0 ? DIM : Base::dim_); + for (Dimension i = 0; i < dims; ++i) + { + const auto point = this->dataset_.kdtree_get_pt(idx, i); + if (point < bbox[i].low || point > bbox[i].high) return false; + } + return true; + } + + /** + * Performs an exact search in the tree starting from a node. + * \tparam RESULTSET Should be any ResultSet + * \return true if the search should be continued, false if the results are + * sufficient + */ + template + bool searchLevel( + RESULTSET& result_set, const ElementType* vec, const NodePtr node, DistanceType mindist, + distance_vector_t& dists, const float epsError) const + { + // If this is a leaf node, then do check and return. + if (!node->child1) // (if one node is nullptr, both are) + { + for (Offset i = node->node_type.lr.left; i < node->node_type.lr.right; ++i) + { + const IndexType accessor = Base::vAcc_[i]; // reorder... : i; + DistanceType dist = + distance_.evalMetric(vec, accessor, (DIM > 0 ? DIM : Base::dim_)); + if (dist < result_set.worstDist()) + { + if (!result_set.addPoint(dist, Base::vAcc_[i])) + { + // the resultset doesn't want to receive any more + // points, we're done searching! + return false; + } + } + } + return true; + } + + /* Which child branch should be taken first? */ + Dimension idx = node->node_type.sub.divfeat; + ElementType val = vec[idx]; + DistanceType diff1 = val - node->node_type.sub.divlow; + DistanceType diff2 = val - node->node_type.sub.divhigh; + + NodePtr bestChild; + NodePtr otherChild; + DistanceType cut_dist; + if ((diff1 + diff2) < 0) + { + bestChild = node->child1; + otherChild = node->child2; + cut_dist = distance_.accum_dist(val, node->node_type.sub.divhigh, idx); + } + else + { + bestChild = node->child2; + otherChild = node->child1; + cut_dist = distance_.accum_dist(val, node->node_type.sub.divlow, idx); + } + + /* Call recursively to search next level down. */ + if (!searchLevel(result_set, vec, bestChild, mindist, dists, epsError)) + { + // the resultset doesn't want to receive any more points, we're done + // searching! + return false; + } + + DistanceType dst = dists[idx]; + mindist = mindist + cut_dist - dst; + dists[idx] = cut_dist; + if (mindist * epsError <= result_set.worstDist()) + { + if (!searchLevel(result_set, vec, otherChild, mindist, dists, epsError)) + { + // the resultset doesn't want to receive any more points, we're + // done searching! + return false; + } + } + dists[idx] = dst; + return true; + } + + public: + /** Stores the index in a binary file. + * IMPORTANT NOTE: The set of data points is NOT stored in the file, so + * when loading the index object it must be constructed associated to the + * same source of data points used while building it. See the example: + * examples/saveload_example.cpp \sa loadIndex */ + void saveIndex(std::ostream& stream) const { Base::saveIndex(*this, stream); } + + /** Loads a previous index from a binary file. + * IMPORTANT NOTE: The set of data points is NOT stored in the file, so + * the index object must be constructed associated to the same source of + * data points used while building the index. See the example: + * examples/saveload_example.cpp \sa loadIndex */ + void loadIndex(std::istream& stream) { Base::loadIndex(*this, stream); } + +}; // class KDTree + +/** kd-tree dynamic index + * + * Contains the k-d trees and other information for indexing a set of points + * for nearest-neighbor matching. + * + * The class "DatasetAdaptor" must provide the following interface (can be + * non-virtual, inlined methods): + * + * \code + * // Must return the number of data poins + * size_t kdtree_get_point_count() const { ... } + * + * // Must return the dim'th component of the idx'th point in the class: + * T kdtree_get_pt(const size_t idx, const size_t dim) const { ... } + * + * // Optional bounding-box computation: return false to default to a standard + * bbox computation loop. + * // Return true if the BBOX was already computed by the class and returned + * in "bb" so it can be avoided to redo it again. + * // Look at bb.size() to find out the expected dimensionality (e.g. 2 or 3 + * for point clouds) template bool kdtree_get_bbox(BBOX &bb) const + * { + * bb[0].low = ...; bb[0].high = ...; // 0th dimension limits + * bb[1].low = ...; bb[1].high = ...; // 1st dimension limits + * ... + * return true; + * } + * + * \endcode + * + * \tparam DatasetAdaptor The user-provided adaptor (see comments above). + * \tparam Distance The distance metric to use: nanoflann::metric_L1, + * nanoflann::metric_L2, nanoflann::metric_L2_Simple, etc. + * \tparam DIM Dimensionality of data points (e.g. 3 for 3D points) + * \tparam IndexType Type of the arguments with which the data can be + * accessed (e.g. float, double, int64_t, T*) + */ +template +class KDTreeSingleIndexDynamicAdaptor_ + : public KDTreeBaseClass< + KDTreeSingleIndexDynamicAdaptor_, Distance, + DatasetAdaptor, DIM, IndexType> +{ + public: + /** + * The dataset used by this index + */ + const DatasetAdaptor& dataset_; //!< The source of our data + + KDTreeSingleIndexAdaptorParams index_params_; + + std::vector& treeIndex_; + + Distance distance_; + + using Base = typename nanoflann::KDTreeBaseClass< + nanoflann::KDTreeSingleIndexDynamicAdaptor_, + Distance, DatasetAdaptor, DIM, IndexType>; + + using ElementType = typename Base::ElementType; + using DistanceType = typename Base::DistanceType; + + using Offset = typename Base::Offset; + using Size = typename Base::Size; + using Dimension = typename Base::Dimension; + + using Node = typename Base::Node; + using NodePtr = Node*; + + using Interval = typename Base::Interval; + /** Define "BoundingBox" as a fixed-size or variable-size container + * depending on "DIM" */ + using BoundingBox = typename Base::BoundingBox; + + /** Define "distance_vector_t" as a fixed-size or variable-size container + * depending on "DIM" */ + using distance_vector_t = typename Base::distance_vector_t; + + /** + * KDTree constructor + * + * Refer to docs in README.md or online in + * https://github.com/jlblancoc/nanoflann + * + * The KD-Tree point dimension (the length of each point in the datase, e.g. + * 3 for 3D points) is determined by means of: + * - The \a DIM template parameter if >0 (highest priority) + * - Otherwise, the \a dimensionality parameter of this constructor. + * + * @param inputData Dataset with the input features. Its lifetime must be + * equal or longer than that of the instance of this class. + * @param params Basically, the maximum leaf node size + */ + KDTreeSingleIndexDynamicAdaptor_( + const Dimension dimensionality, const DatasetAdaptor& inputData, + std::vector& treeIndex, + const KDTreeSingleIndexAdaptorParams& params = KDTreeSingleIndexAdaptorParams()) + : dataset_(inputData), index_params_(params), treeIndex_(treeIndex), distance_(inputData) + { + Base::size_ = 0; + Base::size_at_index_build_ = 0; + for (auto& v : Base::root_bbox_) v = {}; + Base::dim_ = dimensionality; + if (DIM > 0) Base::dim_ = DIM; + Base::leaf_max_size_ = params.leaf_max_size; + if (params.n_thread_build > 0) + { + Base::n_thread_build_ = params.n_thread_build; + } + else + { + Base::n_thread_build_ = std::max(std::thread::hardware_concurrency(), 1u); + } + } + + /** Explicitly default the copy constructor */ + KDTreeSingleIndexDynamicAdaptor_(const KDTreeSingleIndexDynamicAdaptor_& rhs) = default; + + /** Assignment operator definiton */ + KDTreeSingleIndexDynamicAdaptor_ operator=(const KDTreeSingleIndexDynamicAdaptor_& rhs) + { + KDTreeSingleIndexDynamicAdaptor_ tmp(rhs); + std::swap(Base::vAcc_, tmp.Base::vAcc_); + std::swap(Base::leaf_max_size_, tmp.Base::leaf_max_size_); + std::swap(index_params_, tmp.index_params_); + std::swap(treeIndex_, tmp.treeIndex_); + std::swap(Base::size_, tmp.Base::size_); + std::swap(Base::size_at_index_build_, tmp.Base::size_at_index_build_); + std::swap(Base::root_node_, tmp.Base::root_node_); + std::swap(Base::root_bbox_, tmp.Base::root_bbox_); + std::swap(Base::pool_, tmp.Base::pool_); + return *this; + } + + /** + * Builds the index + */ + void buildIndex() + { + Base::size_ = Base::vAcc_.size(); + this->freeIndex(*this); + Base::size_at_index_build_ = Base::size_; + if (Base::size_ == 0) return; + computeBoundingBox(Base::root_bbox_); + // construct the tree + if (Base::n_thread_build_ == 1) + { + Base::root_node_ = this->divideTree(*this, 0, Base::size_, Base::root_bbox_); + } + else + { +#ifndef NANOFLANN_NO_THREADS + std::atomic thread_count(0u); + std::mutex mutex; + Base::root_node_ = this->divideTreeConcurrent( + *this, 0, Base::size_, Base::root_bbox_, thread_count, mutex); +#else /* NANOFLANN_NO_THREADS */ + throw std::runtime_error("Multithreading is disabled"); +#endif /* NANOFLANN_NO_THREADS */ + } + } + + /** \name Query methods + * @{ */ + + /** + * Find set of nearest neighbors to vec[0:dim-1]. Their indices are stored + * inside the result object. + * This is the core search function, all others are wrappers around this + * one. + * + * \param result The result object in which the indices of the + * nearest-neighbors are stored. + * \param vec The vector of the query point for which to search the + * nearest neighbors. + * \param searchParams Optional parameters for the search. + * + * \tparam RESULTSET Should be any ResultSet + * \return True if the requested neighbors could be found. + * + * \sa knnSearch(), radiusSearch(), radiusSearchCustomCallback() + * + * \note If L2 norms are used, all returned distances are actually squared + * distances. + */ + template + bool findNeighbors( + RESULTSET& result, const ElementType* vec, const SearchParameters& searchParams = {}) const + { + assert(vec); + if (this->size(*this) == 0) return false; + if (!Base::root_node_) return false; + float epsError = 1 + searchParams.eps; + + // fixed or variable-sized container (depending on DIM) + distance_vector_t dists; + // Fill it with zeros. + assign( + dists, (DIM > 0 ? DIM : Base::dim_), + static_cast(0)); + DistanceType dist = this->computeInitialDistances(*this, vec, dists); + searchLevel(result, vec, Base::root_node_, dist, dists, epsError); + + if (searchParams.sorted) result.sort(); + + return result.full(); + } + + /** + * Find the "num_closest" nearest neighbors to the \a query_point[0:dim-1]. + * Their indices are stored inside the result object. \sa radiusSearch, + * findNeighbors + * \return Number `N` of valid points in + * the result set. + * + * \note If L2 norms are used, all returned distances are actually squared + * distances. + * + * \note Only the first `N` entries in `out_indices` and `out_distances` + * will be valid. Return may be less than `num_closest` only if the + * number of elements in the tree is less than `num_closest`. + */ + Size knnSearch( + const ElementType* query_point, const Size num_closest, IndexType* out_indices, + DistanceType* out_distances, const SearchParameters& searchParams = {}) const + { + nanoflann::KNNResultSet resultSet(num_closest); + resultSet.init(out_indices, out_distances); + findNeighbors(resultSet, query_point, searchParams); + return resultSet.size(); + } + + /** + * Find all the neighbors to \a query_point[0:dim-1] within a maximum + * radius. The output is given as a vector of pairs, of which the first + * element is a point index and the second the corresponding distance. + * Previous contents of \a IndicesDists are cleared. + * + * If searchParams.sorted==true, the output list is sorted by ascending + * distances. + * + * For a better performance, it is advisable to do a .reserve() on the + * vector if you have any wild guess about the number of expected matches. + * + * \sa knnSearch, findNeighbors, radiusSearchCustomCallback + * \return The number of points within the given radius (i.e. indices.size() + * or dists.size() ) + * + * \note If L2 norms are used, search radius and all returned distances + * are actually squared distances. + */ + Size radiusSearch( + const ElementType* query_point, const DistanceType& radius, + std::vector>& IndicesDists, + const SearchParameters& searchParams = {}) const + { + RadiusResultSet resultSet(radius, IndicesDists); + const size_t nFound = radiusSearchCustomCallback(query_point, resultSet, searchParams); + return nFound; + } + + /** + * Just like radiusSearch() but with a custom callback class for each point + * found in the radius of the query. See the source of RadiusResultSet<> as + * a start point for your own classes. \sa radiusSearch + */ + template + Size radiusSearchCustomCallback( + const ElementType* query_point, SEARCH_CALLBACK& resultSet, + const SearchParameters& searchParams = {}) const + { + findNeighbors(resultSet, query_point, searchParams); + return resultSet.size(); + } + + /** @} */ + + public: + void computeBoundingBox(BoundingBox& bbox) + { + const auto dims = (DIM > 0 ? DIM : Base::dim_); + resize(bbox, dims); + + if (dataset_.kdtree_get_bbox(bbox)) + { + // Done! It was implemented in derived class + } + else + { + const Size N = Base::size_; + if (!N) + throw std::runtime_error( + "[nanoflann] computeBoundingBox() called but " + "no data points found."); + for (Dimension i = 0; i < dims; ++i) + { + bbox[i].low = bbox[i].high = this->dataset_get(*this, Base::vAcc_[0], i); + } + for (Offset k = 1; k < N; ++k) + { + for (Dimension i = 0; i < dims; ++i) + { + const auto val = this->dataset_get(*this, Base::vAcc_[k], i); + if (val < bbox[i].low) bbox[i].low = val; + if (val > bbox[i].high) bbox[i].high = val; + } + } + } + } + + /** + * Performs an exact search in the tree starting from a node. + * \tparam RESULTSET Should be any ResultSet + */ + template + void searchLevel( + RESULTSET& result_set, const ElementType* vec, const NodePtr node, DistanceType mindist, + distance_vector_t& dists, const float epsError) const + { + // If this is a leaf node, then do check and return. + if (!node->child1) // (if one node is nullptr, both are) + { + for (Offset i = node->node_type.lr.left; i < node->node_type.lr.right; ++i) + { + const IndexType index = Base::vAcc_[i]; // reorder... : i; + if (treeIndex_[index] == -1) continue; + DistanceType dist = distance_.evalMetric(vec, index, (DIM > 0 ? DIM : Base::dim_)); + if (dist < result_set.worstDist()) + { + if (!result_set.addPoint( + static_cast(dist), + static_cast(Base::vAcc_[i]))) + { + // the resultset doesn't want to receive any more + // points, we're done searching! + return; // false; + } + } + } + return; + } + + /* Which child branch should be taken first? */ + Dimension idx = node->node_type.sub.divfeat; + ElementType val = vec[idx]; + DistanceType diff1 = val - node->node_type.sub.divlow; + DistanceType diff2 = val - node->node_type.sub.divhigh; + + NodePtr bestChild; + NodePtr otherChild; + DistanceType cut_dist; + if ((diff1 + diff2) < 0) + { + bestChild = node->child1; + otherChild = node->child2; + cut_dist = distance_.accum_dist(val, node->node_type.sub.divhigh, idx); + } + else + { + bestChild = node->child2; + otherChild = node->child1; + cut_dist = distance_.accum_dist(val, node->node_type.sub.divlow, idx); + } + + /* Call recursively to search next level down. */ + searchLevel(result_set, vec, bestChild, mindist, dists, epsError); + + DistanceType dst = dists[idx]; + mindist = mindist + cut_dist - dst; + dists[idx] = cut_dist; + if (mindist * epsError <= result_set.worstDist()) + { + searchLevel(result_set, vec, otherChild, mindist, dists, epsError); + } + dists[idx] = dst; + } + + public: + /** Stores the index in a binary file. + * IMPORTANT NOTE: The set of data points is NOT stored in the file, so + * when loading the index object it must be constructed associated to the + * same source of data points used while building it. See the example: + * examples/saveload_example.cpp \sa loadIndex */ + void saveIndex(std::ostream& stream) { saveIndex(*this, stream); } + + /** Loads a previous index from a binary file. + * IMPORTANT NOTE: The set of data points is NOT stored in the file, so + * the index object must be constructed associated to the same source of + * data points used while building the index. See the example: + * examples/saveload_example.cpp \sa loadIndex */ + void loadIndex(std::istream& stream) { loadIndex(*this, stream); } +}; + +/** kd-tree dynaimic index + * + * class to create multiple static index and merge their results to behave as + * single dynamic index as proposed in Logarithmic Approach. + * + * Example of usage: + * examples/dynamic_pointcloud_example.cpp + * + * \tparam DatasetAdaptor The user-provided adaptor (see comments above). + * \tparam Distance The distance metric to use: nanoflann::metric_L1, + * nanoflann::metric_L2, nanoflann::metric_L2_Simple, etc. \tparam DIM + * Dimensionality of data points (e.g. 3 for 3D points) \tparam IndexType + * Will be typically size_t or int + */ +template +class KDTreeSingleIndexDynamicAdaptor +{ + public: + using ElementType = typename Distance::ElementType; + using DistanceType = typename Distance::DistanceType; + + using Offset = typename KDTreeSingleIndexDynamicAdaptor_::Offset; + using Size = typename KDTreeSingleIndexDynamicAdaptor_::Size; + using Dimension = + typename KDTreeSingleIndexDynamicAdaptor_::Dimension; + + protected: + Size leaf_max_size_; + Size treeCount_; + Size pointCount_; + + /** + * The dataset used by this index + */ + const DatasetAdaptor& dataset_; //!< The source of our data + + /** treeIndex[idx] is the index of tree in which point at idx is stored. + * treeIndex[idx]=-1 means that point has been removed. */ + std::vector treeIndex_; + std::unordered_set removedPoints_; + + KDTreeSingleIndexAdaptorParams index_params_; + + Dimension dim_; //!< Dimensionality of each data point + + using index_container_t = + KDTreeSingleIndexDynamicAdaptor_; + std::vector index_; + + public: + /** Get a const ref to the internal list of indices; the number of indices + * is adapted dynamically as the dataset grows in size. */ + const std::vector& getAllIndices() const { return index_; } + + private: + /** finds position of least significant unset bit */ + int First0Bit(IndexType num) + { + int pos = 0; + while (num & 1) + { + num = num >> 1; + pos++; + } + return pos; + } + + /** Creates multiple empty trees to handle dynamic support */ + void init() + { + using my_kd_tree_t = + KDTreeSingleIndexDynamicAdaptor_; + std::vector index( + treeCount_, my_kd_tree_t(dim_ /*dim*/, dataset_, treeIndex_, index_params_)); + index_ = index; + } + + public: + Distance distance_; + + /** + * KDTree constructor + * + * Refer to docs in README.md or online in + * https://github.com/jlblancoc/nanoflann + * + * The KD-Tree point dimension (the length of each point in the datase, e.g. + * 3 for 3D points) is determined by means of: + * - The \a DIM template parameter if >0 (highest priority) + * - Otherwise, the \a dimensionality parameter of this constructor. + * + * @param inputData Dataset with the input features. Its lifetime must be + * equal or longer than that of the instance of this class. + * @param params Basically, the maximum leaf node size + */ + explicit KDTreeSingleIndexDynamicAdaptor( + const int dimensionality, const DatasetAdaptor& inputData, + const KDTreeSingleIndexAdaptorParams& params = KDTreeSingleIndexAdaptorParams(), + const size_t maximumPointCount = 1000000000U) + : dataset_(inputData), index_params_(params), distance_(inputData) + { + treeCount_ = static_cast(std::log2(maximumPointCount)) + 1; + pointCount_ = 0U; + dim_ = dimensionality; + treeIndex_.clear(); + if (DIM > 0) dim_ = DIM; + leaf_max_size_ = params.leaf_max_size; + init(); + const size_t num_initial_points = dataset_.kdtree_get_point_count(); + if (num_initial_points > 0) + { + addPoints(0, num_initial_points - 1); + } + } + + /** Deleted copy constructor*/ + explicit KDTreeSingleIndexDynamicAdaptor( + const KDTreeSingleIndexDynamicAdaptor&) = delete; + + /** Add points to the set, Inserts all points from [start, end] */ + void addPoints(IndexType start, IndexType end) + { + const Size count = end - start + 1; + int maxIndex = 0; + treeIndex_.resize(treeIndex_.size() + count); + for (IndexType idx = start; idx <= end; idx++) + { + const int pos = First0Bit(pointCount_); + maxIndex = std::max(pos, maxIndex); + treeIndex_[pointCount_] = pos; + + const auto it = removedPoints_.find(idx); + if (it != removedPoints_.end()) + { + removedPoints_.erase(it); + treeIndex_[idx] = pos; + } + + for (int i = 0; i < pos; i++) + { + for (int j = 0; j < static_cast(index_[i].vAcc_.size()); j++) + { + index_[pos].vAcc_.push_back(index_[i].vAcc_[j]); + if (treeIndex_[index_[i].vAcc_[j]] != -1) treeIndex_[index_[i].vAcc_[j]] = pos; + } + index_[i].vAcc_.clear(); + } + index_[pos].vAcc_.push_back(idx); + pointCount_++; + } + + for (int i = 0; i <= maxIndex; ++i) + { + index_[i].freeIndex(index_[i]); + if (!index_[i].vAcc_.empty()) index_[i].buildIndex(); + } + } + + /** Remove a point from the set (Lazy Deletion) */ + void removePoint(size_t idx) + { + if (idx >= pointCount_) return; + removedPoints_.insert(idx); + treeIndex_[idx] = -1; + } + + /** + * Find set of nearest neighbors to vec[0:dim-1]. Their indices are stored + * inside the result object. + * + * Params: + * result = the result object in which the indices of the + * nearest-neighbors are stored vec = the vector for which to search the + * nearest neighbors + * + * \tparam RESULTSET Should be any ResultSet + * \return True if the requested neighbors could be found. + * \sa knnSearch, radiusSearch + * + * \note If L2 norms are used, all returned distances are actually squared + * distances. + */ + template + bool findNeighbors( + RESULTSET& result, const ElementType* vec, const SearchParameters& searchParams = {}) const + { + for (size_t i = 0; i < treeCount_; i++) + { + index_[i].findNeighbors(result, &vec[0], searchParams); + } + return result.full(); + } +}; + +/** An L2-metric KD-tree adaptor for working with data directly stored in an + * Eigen Matrix, without duplicating the data storage. You can select whether a + * row or column in the matrix represents a point in the state space. + * + * Example of usage: + * \code + * Eigen::Matrix mat; + * + * // Fill out "mat"... + * using my_kd_tree_t = nanoflann::KDTreeEigenMatrixAdaptor< + * Eigen::Matrix>; + * + * const int max_leaf = 10; + * my_kd_tree_t mat_index(mat, max_leaf); + * mat_index.index->... + * \endcode + * + * \tparam DIM If set to >0, it specifies a compile-time fixed dimensionality + * for the points in the data set, allowing more compiler optimizations. + * \tparam Distance The distance metric to use: nanoflann::metric_L1, + * nanoflann::metric_L2, nanoflann::metric_L2_Simple, etc. + * \tparam row_major If set to true the rows of the matrix are used as the + * points, if set to false the columns of the matrix are used as the + * points. + */ +template < + class MatrixType, int32_t DIM = -1, class Distance = nanoflann::metric_L2, + bool row_major = true> +struct KDTreeEigenMatrixAdaptor +{ + using self_t = KDTreeEigenMatrixAdaptor; + using num_t = typename MatrixType::Scalar; + using IndexType = typename MatrixType::Index; + using metric_t = typename Distance::template traits::distance_t; + + using index_t = KDTreeSingleIndexAdaptor< + metric_t, self_t, row_major ? MatrixType::ColsAtCompileTime : MatrixType::RowsAtCompileTime, + IndexType>; + + index_t* index_; //! The kd-tree index for the user to call its methods as + //! usual with any other FLANN index. + + using Offset = typename index_t::Offset; + using Size = typename index_t::Size; + using Dimension = typename index_t::Dimension; + + /// Constructor: takes a const ref to the matrix object with the data points + explicit KDTreeEigenMatrixAdaptor( + const Dimension dimensionality, const std::reference_wrapper& mat, + const int leaf_max_size = 10, const unsigned int n_thread_build = 1) + : m_data_matrix(mat) + { + const auto dims = row_major ? mat.get().cols() : mat.get().rows(); + if (static_cast(dims) != dimensionality) + throw std::runtime_error( + "Error: 'dimensionality' must match column count in data " + "matrix"); + if (DIM > 0 && static_cast(dims) != DIM) + throw std::runtime_error( + "Data set dimensionality does not match the 'DIM' template " + "argument"); + index_ = new index_t( + dims, *this /* adaptor */, + nanoflann::KDTreeSingleIndexAdaptorParams( + leaf_max_size, nanoflann::KDTreeSingleIndexAdaptorFlags::None, n_thread_build)); + } + + public: + /** Deleted copy constructor */ + KDTreeEigenMatrixAdaptor(const self_t&) = delete; + + ~KDTreeEigenMatrixAdaptor() { delete index_; } + + const std::reference_wrapper m_data_matrix; + + /** Query for the \a num_closest closest points to a given point (entered as + * query_point[0:dim-1]). Note that this is a short-cut method for + * index->findNeighbors(). The user can also call index->... methods as + * desired. + * + * \note If L2 norms are used, all returned distances are actually squared + * distances. + */ + void query( + const num_t* query_point, const Size num_closest, IndexType* out_indices, + num_t* out_distances) const + { + nanoflann::KNNResultSet resultSet(num_closest); + resultSet.init(out_indices, out_distances); + index_->findNeighbors(resultSet, query_point); + } + + /** @name Interface expected by KDTreeSingleIndexAdaptor + * @{ */ + + inline const self_t& derived() const noexcept { return *this; } + inline self_t& derived() noexcept { return *this; } + + // Must return the number of data points + inline Size kdtree_get_point_count() const + { + if (row_major) + return m_data_matrix.get().rows(); + else + return m_data_matrix.get().cols(); + } + + // Returns the dim'th component of the idx'th point in the class: + inline num_t kdtree_get_pt(const IndexType idx, size_t dim) const + { + if (row_major) + return m_data_matrix.get().coeff(idx, IndexType(dim)); + else + return m_data_matrix.get().coeff(IndexType(dim), idx); + } + + // Optional bounding-box computation: return false to default to a standard + // bbox computation loop. + // Return true if the BBOX was already computed by the class and returned + // in "bb" so it can be avoided to redo it again. Look at bb.size() to + // find out the expected dimensionality (e.g. 2 or 3 for point clouds) + template + inline bool kdtree_get_bbox(BBOX& /*bb*/) const + { + return false; + } + + /** @} */ + +}; // end of KDTreeEigenMatrixAdaptor +/** @} */ + +/** @} */ // end of grouping +} // namespace nanoflann + +#undef NANOFLANN_RESTRICT diff --git a/Libraries/nanoflann/README.md b/Libraries/nanoflann/README.md new file mode 100644 index 000000000..5830ad992 --- /dev/null +++ b/Libraries/nanoflann/README.md @@ -0,0 +1,10 @@ +Vendored dependency: `nanoflann` + +- File: `Include/nanoflann.hpp` +- Upstream project: https://github.com/jlblancoc/nanoflann +- Imported from the winding-number integration source snapshot +- License: BSD-style (license header retained in vendored file) + +Notes: +- This is vendored for boolean/winding integration in lib3mf. +- Future work may switch this dependency to package-manager resolution (e.g. vcpkg). diff --git a/Libraries/tinybvh/Include/tiny_bvh.h b/Libraries/tinybvh/Include/tiny_bvh.h new file mode 100644 index 000000000..c56346d7a --- /dev/null +++ b/Libraries/tinybvh/Include/tiny_bvh.h @@ -0,0 +1,8852 @@ +/* +The MIT License (MIT) + +Copyright (c) 2024-2025, Jacco Bikker / Breda University of Applied Sciences. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +// How to use: +// +// Use this in *one* .c or .cpp +// #define TINYBVH_IMPLEMENTATION +// #include "tiny_bvh.h" +// Instantiate a BVH and build it for a list of triangles: +// BVH bvh; +// bvh.Build( (bvhvec4*)myVerts, numTriangles ); +// Ray ray( bvhvec3( 0, 0, 0 ), bvhvec3( 0, 0, 1 ), 1e30f ); +// bvh.Intersect( ray ); +// After this, intersection information is in ray.hit. + +// tinybvh can use custom vector types by defining TINYBVH_USE_CUSTOM_VECTOR_TYPES once before inclusion. +// To define custom vector types create a tinybvh namespace with the appropriate using directives, e.g.: +// namespace tinybvh +// { +// using bvhint2 = math::int2; +// using bvhint3 = math::int3; +// using bvhuint2 = math::uint2; +// using bvhuint3 = math::uint3; +// using bvhuint4 = math::uint4; +// using bvhvec2 = math::float2; +// using bvhvec3 = math::float3; +// using bvhvec4 = math::float4; +// using bvhdbl3 = math::double3; +// using bvhmat4 = math::mat4x4; +// } +// +// #define TINYBVH_USE_CUSTOM_VECTOR_TYPES +// #include + +// tinybvh can be further configured using #defines, to be specified before the #include: +// #define BVHBINS 8 - the number of bins to use in regular BVH construction. Default is 8. +// #define HQBVHBINS 32 - the number of bins to use in SBVH construction. Default is 8. +// #define INST_IDX_BITS 10 - the number of bits to use for the instance index. Default is 32, +// which stores the bits in a separate field in tinybvh::Intersection. +// #define C_INT 1 - the estimated cost of a primitive intersection test. Default is 1. +// #define C_TRAV 1 - the estimated cost of a traversal step. Default is 1. + +// See tiny_bvh_test.cpp for basic usage. In short: +// instantiate a BVH: tinybvh::BVH bvh; +// build it: bvh.Build( (tinybvh::bvhvec4*)triangleData, TRIANGLE_COUNT ); +// ..where triangleData is an array of four-component float vectors: +// - For a single triangle, provide 3 vertices, +// - For each vertex provide x, y and z. +// The fourth float in each vertex is a dummy value and exists purely for +// a more efficient layout of the data in memory. + +// More information about the BVH data structure: +// https://jacco.ompf2.com/2022/04/13/how-to-build-a-bvh-part-1-basics + +// Further references: See README.md + +// Author and contributors: +// Jacco Bikker: BVH code and examples +// Eddy L O Jansson: g++ / clang support +// Aras Pranckevičius: non-Intel architecture support +// Jefferson Amstutz: CMake support +// Christian Oliveros: WASM / EMSCRIPTEN support +// Thierry Cantenot: user-defined alloc & free +// David Peicho: slices & Rust bindings, API advice +// Aytek Aman: C++11 threading implementation + +#ifndef TINY_BVH_H_ +#define TINY_BVH_H_ + +// Library version: +#define TINY_BVH_VERSION_MAJOR 1 +#define TINY_BVH_VERSION_MINOR 6 +#define TINY_BVH_VERSION_SUB 7 + +// Cached BVH file version - increases only when file layout changes. +#define TINY_BVH_CACHE_VERSION 166 + +// Run-time checks / debuggin. +// #define PARANOID // checks out-of-bound access of slices +// #define SLICEDUMP // dumps the slice used for building to a file - debug feature. + +// Binned BVH building: bin count. +#ifndef BVHBINS +#define BVHBINS 8 +#endif +#ifndef HQBVHBINS +#define HQBVHBINS 8 +#define MAXHQBINS 256 +#endif +#define AVXBINS 8 // must stay at 8. + +// TLAS setting +// Note: Except when INST_IDX_BITS is set to 32, the instance index is encoded in +// the top bits of the prim idx field. +// Max number of instances in TLAS: 2 ^ INST_IDX_BITS +// Max number of primitives per BLAS: 2 ^ (32 - INST_IDX_BITS) +#ifndef INST_IDX_BITS +#define INST_IDX_BITS 32 // Use 4..~12 to use prim field bits for instance id, or set to 32 to store index in separate field. +#endif + +// SAH BVH building: Heuristic parameters +// CPU traversal: C_INT = 1, C_TRAV = 1 seems optimal. +// These are defaults, which initialize the public members c_int and c_trav in +// BVHBase (and thus each BVH instance). +#ifndef C_INT +#define C_INT 1 +#endif +#ifndef C_TRAV +#define C_TRAV 1 +#endif +#ifndef W_EPO +#define W_EPO 0.71f +#endif + +// SBVH: "Unsplitting" +#define SBVH_UNSPLITTING +#define RDH_MAX_WEIGHT 0.8f + +// Triangle intersection: "Watertight" +// #define WATERTIGHT_TRITEST + +// 'Infinity' values +#define BVH_FAR 1e30f // actual valid ieee range: 3.40282347E+38 +#define BVH_DBL_FAR 1e300 // actual valid ieee range: 1.797693134862315E+308 + +// Threaded BuildAVX +#ifndef MT_BUILD_THRESHOLD +#define MT_BUILD_THRESHOLD 50000 // single-threaded builds below this triangle count +#endif + +// Features +#ifndef NO_DOUBLE_PRECISION_SUPPORT +#define DOUBLE_PRECISION_SUPPORT +#endif +// #define TINYBVH_USE_CUSTOM_VECTOR_TYPES +// #define TINYBVH_NO_SIMD +#ifndef NO_INDEXED_GEOMETRY +#define ENABLE_INDEXED_GEOMETRY +#endif +#ifndef NO_CUSTOM_GEOMETRY +#define ENABLE_CUSTOM_GEOMETRY +#endif +#ifndef NO_THREADED_BUILDS +#define ENABLE_THREADED_BUILDS +#endif + +// Experimental / WIP features + +// CWBVH triangle format - doesn't seem to help on GPU? +// #define CWBVH_COMPRESSED_TRIS +// BVH4 triangle format +// #define BVH4_GPU_COMPRESSED_TRIS + +// BVH8_CPU align to big boundaries - experimental. +#define BVH8_ALIGN_4K +// #define BVH8_ALIGN_32K + +// ============================================================================ +// +// P R E L I M I N A R I E S +// +// ============================================================================ + +// needful includes +#ifdef _MSC_VER // Visual Studio / C11 +#include // for alloc/free +#include // for fprintf +#include // for sqrtf, fabs +#include // for memset +#include // for exit(1) +#else // Emscripten / gcc / clang +#include +#include +#include +#include +#endif +#include +#include // for SBVH builds +#include +#include // for threaded builds + +// Platform-independent compile-time warnings. +#define EMIT_COMPILER_WARNING_STRINGIFY0(x) #x +#define EMIT_COMPILER_WARNING_STRINGIFY1(x) EMIT_COMPILER_WARNING_STRINGIFY0(x) +#ifdef __GNUC__ +#define EMIT_COMPILER_WARNING_COMPOSE(x) GCC warning x +#else +#define EMIT_COMPILER_MESSAGE_PREFACE(type) \ +__FILE__ "(" EMIT_COMPILER_WARNING_STRINGIFY1(__LINE__) "): " type ": " +#define EMIT_COMPILER_WARNING_COMPOSE(x) message(EMIT_COMPILER_MESSAGE_PREFACE("warning C0000") x) +#endif +#define WARNING(x) _Pragma(EMIT_COMPILER_WARNING_STRINGIFY1(EMIT_COMPILER_WARNING_COMPOSE(x))) + +// SSE/AVX/AVX2/NEON support. +// SSE4.2 availability: Since Nehalem (2008) +// AVX1 availability: Since Sandy Bridge (2011) +// AVX2 availability: Since Haswell (2013) +#ifndef TINYBVH_NO_SIMD +#if defined __x86_64__ || defined _M_X64 || defined __wasm_simd128__ || defined __wasm_relaxed_simd__ +#if !defined __SSE4_2__ && !defined _MSC_VER +WARNING( "SSE4.2 not enabled in compilation." ) +#else +#define BVH_USESSE +#ifndef __SSE4_2__ +#define __SSE4_2__ // msvc doesn't set the SSE flag +#endif +#endif +#if !defined __AVX__ +WARNING( "AVX not enabled in compilation." ) +#define TINYBVH_NO_SIMD +#else +#define BVH_USEAVX // required for BuildAVX, BVH_SoA and others +#define BVH_USESSE +#endif +#if !defined __AVX2__ || (!defined __FMA__ && !defined _MSC_VER) +WARNING( "AVX2 and FMA not enabled in compilation." ) +#define TINYBVH_NO_SIMD +#else +#define BVH_USEAVX2 // required for BVH8_CPU +#define BVH_USEAVX +#define BVH_USESSE +#endif +#include "immintrin.h" // for __m128 and __m256 +#elif defined __aarch64__ || defined _M_ARM64 +#if !defined __ARM_NEON && !defined __APPLE__ +WARNING( "NEON not enabled in compilation." ) +#define TINYBVH_NO_SIMD +#else +#define BVH_USENEON +#include "arm_neon.h" +#endif +#endif +#endif // TINYBVH_NO_SIMD + +// aligned memory allocation +// note: formally, size needs to be a multiple of 'alignment', see: +// https://en.cppreference.com/w/c/memory/aligned_alloc. +// EMSCRIPTEN enforces this. +// Copy of the same construct in tinyocl, in a different namespace. +namespace tinybvh { +inline size_t make_multiple_of( size_t x, size_t alignment ) { return (x + (alignment - 1)) & ~(alignment - 1); } +#ifdef _MSC_VER // Visual Studio / C11 +#define ALIGNED( x ) __declspec( align( x ) ) +#define _ALIGNED_ALLOC(alignment,size) _aligned_malloc( make_multiple_of( size, alignment ), alignment ); +#define _ALIGNED_FREE(ptr) _aligned_free( ptr ); +#else // EMSCRIPTEN / gcc / clang +#define ALIGNED( x ) __attribute__( ( aligned( x ) ) ) +#if !defined TINYBVH_NO_SIMD && (defined __x86_64__ || defined _M_X64 || defined __wasm_simd128__ || defined __wasm_relaxed_simd__) +#include +#define _ALIGNED_ALLOC(alignment,size) _mm_malloc( make_multiple_of( size, alignment ), alignment ); +#define _ALIGNED_FREE(ptr) _mm_free( ptr ); +#else +#if defined __APPLE__ || defined __aarch64__ || (defined __ANDROID_API__ && (__ANDROID_API__ >= 28)) +#define _ALIGNED_ALLOC(alignment,size) aligned_alloc( alignment, make_multiple_of( size, alignment ) ); +#elif defined __GNUC__ +#if defined __linux__ || defined __EMSCRIPTEN__ +#define _ALIGNED_ALLOC(alignment,size) aligned_alloc( alignment, make_multiple_of( size, alignment ) ); +#else +#define _ALIGNED_ALLOC(alignment,size) _aligned_malloc( alignment, make_multiple_of( size, alignment ) ); +#endif +#endif +#define _ALIGNED_FREE(ptr) free( ptr ); +#endif +#endif +inline void* malloc64( size_t size, void* = nullptr ) { return size == 0 ? 0 : _ALIGNED_ALLOC( 64, size ); } +inline void* malloc4k( size_t size, void* = nullptr ) { return size == 0 ? 0 : _ALIGNED_ALLOC( 4096, size ); } +inline void* malloc32k( size_t size, void* = nullptr ) { return size == 0 ? 0 : _ALIGNED_ALLOC( 32768, size ); } +inline void free64( void* ptr, void* = nullptr ) { _ALIGNED_FREE( ptr ); } +inline void free4k( void* ptr, void* = nullptr ) { _ALIGNED_FREE( ptr ); } +inline void free32k( void* ptr, void* = nullptr ) { _ALIGNED_FREE( ptr ); } +}; // namespace tiybvh + +// Derived TLAS things; for convenience. +#define INST_IDX_SHFT (32 - INST_IDX_BITS) +#if INST_IDX_BITS == 32 +#define PRIM_IDX_MASK 0xffffffff // instance index stored separately. +#else +#define PRIM_IDX_MASK ((1 << INST_IDX_SHFT) - 1) // instance index stored in top bits of hit.prim. +#endif + +// Forced inlining. +#ifdef _MSC_VER +#define __FORCEINLINE __forceinline +#else +#define __FORCEINLINE __attribute__((always_inline)) inline +#endif + +namespace tinybvh { + +// We'll use this whenever a layout has no specialized shadow ray query. +#define FALLBACK_SHADOW_QUERY( s ) { Ray r = s; float d = s.hit.t; Intersect( r ); return r.hit.t < d; } + +#ifdef _MSC_VER +// Suppress a warning caused by the union of x,y,.. and cell[..] in vectors. +// We need this union to address vector components either by name or by index. +// The warning is re-enabled right after the definition of the data types. +#pragma warning ( push ) +#pragma warning ( disable: 4201 /* nameless struct / union */ ) +#endif + +#ifndef TINYBVH_USE_CUSTOM_VECTOR_TYPES + +struct bvhvec3; +struct ALIGNED( 16 ) bvhvec4 +{ + // vector naming is designed to not cause any name clashes. + bvhvec4() = default; + bvhvec4( const float a, const float b, const float c, const float d ) : x( a ), y( b ), z( c ), w( d ) {} + bvhvec4( const float a ) : x( a ), y( a ), z( a ), w( a ) {} + bvhvec4( const bvhvec3 & a ); + bvhvec4( const bvhvec3 & a, float b ); + float& operator [] ( const int32_t i ) { return cell[i]; } + const float& operator [] ( const int32_t i ) const { return cell[i]; } + union { struct { float x, y, z, w; }; float cell[4]; }; +}; + +struct ALIGNED( 8 ) bvhvec2 +{ + bvhvec2() = default; + bvhvec2( const float a, const float b ) : x( a ), y( b ) {} + bvhvec2( const float a ) : x( a ), y( a ) {} + bvhvec2( const bvhvec4 a ) : x( a.x ), y( a.y ) {} + float& operator [] ( const int32_t i ) { return cell[i]; } + const float& operator [] ( const int32_t i ) const { return cell[i]; } + union { struct { float x, y; }; float cell[2]; }; +}; + +struct bvhvec3 +{ + bvhvec3() = default; + bvhvec3( const float a, const float b, const float c ) : x( a ), y( b ), z( c ) {} + bvhvec3( const float a ) : x( a ), y( a ), z( a ) {} + bvhvec3( const bvhvec4 a ) : x( a.x ), y( a.y ), z( a.z ) {} + float& operator [] ( const int32_t i ) { return cell[i]; } + const float& operator [] ( const int32_t i ) const { return cell[i]; } + union { struct { float x, y, z; }; float cell[3]; }; +}; + +struct bvhint3 +{ + bvhint3() = default; + bvhint3( const int32_t a, const int32_t b, const int32_t c ) : x( a ), y( b ), z( c ) {} + bvhint3( const int32_t a ) : x( a ), y( a ), z( a ) {} + bvhint3( const bvhvec3& a ) { x = (int32_t)a.x, y = (int32_t)a.y, z = (int32_t)a.z; } + int32_t& operator [] ( const int32_t i ) { return cell[i]; } + const int32_t& operator [] ( const int32_t i ) const { return cell[i]; } + union { struct { int32_t x, y, z; }; int32_t cell[3]; }; +}; + +struct bvhint2 +{ + bvhint2() = default; + bvhint2( const int32_t a, const int32_t b ) : x( a ), y( b ) {} + bvhint2( const int32_t a ) : x( a ), y( a ) {} + int32_t& operator [] ( const int32_t i ) { return cell[i]; } + const int32_t& operator [] ( const int32_t i ) const { return cell[i]; } + union { struct { int32_t x, y; }; int32_t cell[2]; }; +}; + +struct bvhuint2 +{ + bvhuint2() = default; + bvhuint2( const uint32_t a, const uint32_t b ) : x( a ), y( b ) {} + bvhuint2( const uint32_t a ) : x( a ), y( a ) {} + uint32_t& operator [] ( const int32_t i ) { return cell[i]; } + const uint32_t& operator [] ( const int32_t i ) const { return cell[i]; } + union { struct { uint32_t x, y; }; uint32_t cell[2]; }; +}; + +struct bvhuint3 +{ + bvhuint3() = default; + bvhuint3( const uint32_t a, const uint32_t b, const uint32_t c ) : x( a ), y( b ), z( c ) {} + bvhuint3( const uint32_t a ) : x( a ), y( a ), z( a ) {} + uint32_t& operator [] ( const int32_t i ) { return cell[i]; } + const uint32_t& operator [] ( const int32_t i ) const { return cell[i]; } + union { struct { uint32_t x, y, z; }; uint32_t cell[3]; }; +}; + +struct bvhuint4 +{ + bvhuint4() = default; + bvhuint4( const uint32_t a, const uint32_t b, const uint32_t c, const uint32_t d ) : x( a ), y( b ), z( c ), w( d ) {} + bvhuint4( const uint32_t a ) : x( a ), y( a ), z( a ), w( a ) {} + uint32_t& operator [] ( const int32_t i ) { return cell[i]; } + const uint32_t& operator [] ( const int32_t i ) const { return cell[i]; } + union { struct { uint32_t x, y, z, w; }; uint32_t cell[4]; }; +}; + +struct bvhmat4 // exists only so we can use tinybvh types conveniently in tinyscene. +{ + bvhmat4() = default; + float& operator [] ( const int32_t i ) { return cell[i]; } + const float& operator [] ( const int32_t i ) const { return cell[i]; } + bvhmat4& operator += ( const bvhmat4& a ) { for (int i = 0; i < 16; i++) cell[i] += a.cell[i]; return *this; } + float cell[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 }; +}; + +#endif // TINYBVH_USE_CUSTOM_VECTOR_TYPES + +struct ALIGNED( 32 ) bvhaabb +{ + bvhvec3 minBounds; uint32_t dummy1; + bvhvec3 maxBounds; uint32_t dummy2; +}; + +struct bvhvec4slice +{ + bvhvec4slice() = default; + bvhvec4slice( const bvhvec4* data, uint32_t count, uint32_t stride = sizeof( bvhvec4 ) ); + operator bool() const { return !!data; } + const bvhvec4& operator [] ( size_t i ) const; + const int8_t* data = nullptr; + uint32_t count, stride; +}; + +// Math operations. +// Note: Since this header file is expected to be included in a source file +// of a separate project, the static keyword doesn't provide sufficient +// isolation; hence the tinybvh_ prefix. +inline float tinybvh_safercp( const float x ) { if (x > 1e-12f || x < -1e-12f) return 1.0f / x; else return x >= 0 ? BVH_FAR : -BVH_FAR; } +inline bvhvec3 tinybvh_safercp( const bvhvec3 a ) { return bvhvec3( tinybvh_safercp( a.x ), tinybvh_safercp( a.y ), tinybvh_safercp( a.z ) ); } +inline bvhvec3 tinybvh_rcp( const bvhvec3 a ) { return tinybvh_safercp( a ); /* bvhvec3( 1.0f / a.x, 1.0f / a.y, 1.0f / a.z ); */ } +inline float tinybvh_min( const float a, const float b ) { return a < b ? a : b; } +inline float tinybvh_max( const float a, const float b ) { return a > b ? a : b; } +inline double tinybvh_min( const double a, const double b ) { return a < b ? a : b; } +inline double tinybvh_max( const double a, const double b ) { return a > b ? a : b; } +inline int32_t tinybvh_min( const int32_t a, const int32_t b ) { return a < b ? a : b; } +inline int32_t tinybvh_max( const int32_t a, const int32_t b ) { return a > b ? a : b; } +inline uint32_t tinybvh_min( const uint32_t a, const uint32_t b ) { return a < b ? a : b; } +inline uint32_t tinybvh_max( const uint32_t a, const uint32_t b ) { return a > b ? a : b; } +inline bvhvec3 tinybvh_min( const bvhvec3& a, const bvhvec3& b ) { return bvhvec3( tinybvh_min( a.x, b.x ), tinybvh_min( a.y, b.y ), tinybvh_min( a.z, b.z ) ); } +inline bvhvec4 tinybvh_min( const bvhvec4& a, const bvhvec4& b ) { return bvhvec4( tinybvh_min( a.x, b.x ), tinybvh_min( a.y, b.y ), tinybvh_min( a.z, b.z ), tinybvh_min( a.w, b.w ) ); } +inline bvhvec3 tinybvh_max( const bvhvec3& a, const bvhvec3& b ) { return bvhvec3( tinybvh_max( a.x, b.x ), tinybvh_max( a.y, b.y ), tinybvh_max( a.z, b.z ) ); } +inline bvhvec4 tinybvh_max( const bvhvec4& a, const bvhvec4& b ) { return bvhvec4( tinybvh_max( a.x, b.x ), tinybvh_max( a.y, b.y ), tinybvh_max( a.z, b.z ), tinybvh_max( a.w, b.w ) ); } +inline float tinybvh_clamp( const float x, const float a, const float b ) { return x > a ? (x < b ? x : b) : a; /* NaN safe */ } +inline int32_t tinybvh_clamp( const int32_t x, const int32_t a, const int32_t b ) { return x > a ? (x < b ? x : b) : a; /* NaN safe */ } +template inline static void tinybvh_swap( T& a, T& b ) { T t = a; a = b; b = t; } +inline float tinybvh_half_area( const bvhvec3& v ) { return v.x < -BVH_FAR ? 0 : (v.x * v.y + v.y * v.z + v.z * v.x); } // for SAH calculations +inline uint32_t tinybvh_maxdim( const bvhvec3& v ) { uint32_t r = fabs( v.x ) > fabs( v.y ) ? 0 : 1; return fabs( v.z ) > fabs( v[r] ) ? 2 : r; } + +// Operator overloads. +// Only a minimal set is provided. +#ifndef TINYBVH_USE_CUSTOM_VECTOR_TYPES + +inline bvhvec2 operator-( const bvhvec2& a ) { return bvhvec2( -a.x, -a.y ); } +inline bvhvec3 operator-( const bvhvec3& a ) { return bvhvec3( -a.x, -a.y, -a.z ); } +inline bvhvec4 operator-( const bvhvec4& a ) { return bvhvec4( -a.x, -a.y, -a.z, -a.w ); } +inline bvhvec2 operator+( const bvhvec2& a, const bvhvec2& b ) { return bvhvec2( a.x + b.x, a.y + b.y ); } +inline bvhvec3 operator+( const bvhvec3& a, const bvhvec3& b ) { return bvhvec3( a.x + b.x, a.y + b.y, a.z + b.z ); } +inline bvhvec4 operator+( const bvhvec4& a, const bvhvec4& b ) { return bvhvec4( a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w ); } +inline bvhvec4 operator+( const bvhvec4& a, const bvhvec3& b ) { return bvhvec4( a.x + b.x, a.y + b.y, a.z + b.z, a.w ); } +inline bvhvec2 operator-( const bvhvec2& a, const bvhvec2& b ) { return bvhvec2( a.x - b.x, a.y - b.y ); } +inline bvhvec3 operator-( const bvhvec3& a, const bvhvec3& b ) { return bvhvec3( a.x - b.x, a.y - b.y, a.z - b.z ); } +inline bvhvec4 operator-( const bvhvec4& a, const bvhvec4& b ) { return bvhvec4( a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w ); } +inline void operator+=( bvhvec2& a, const bvhvec2& b ) { a.x += b.x; a.y += b.y; } +inline void operator+=( bvhvec3& a, const bvhvec3& b ) { a.x += b.x; a.y += b.y; a.z += b.z; } +inline void operator+=( bvhvec4& a, const bvhvec4& b ) { a.x += b.x; a.y += b.y; a.z += b.z; a.w += b.w; } +inline bvhvec2 operator*( const bvhvec2& a, const bvhvec2& b ) { return bvhvec2( a.x * b.x, a.y * b.y ); } +inline bvhvec3 operator*( const bvhvec3& a, const bvhvec3& b ) { return bvhvec3( a.x * b.x, a.y * b.y, a.z * b.z ); } +inline bvhvec4 operator*( const bvhvec4& a, const bvhvec4& b ) { return bvhvec4( a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w ); } +inline bvhvec2 operator*( const bvhvec2& a, float b ) { return bvhvec2( a.x * b, a.y * b ); } +inline bvhvec3 operator*( const bvhvec3& a, float b ) { return bvhvec3( a.x * b, a.y * b, a.z * b ); } +inline bvhvec4 operator*( const bvhvec4& a, float b ) { return bvhvec4( a.x * b, a.y * b, a.z * b, a.w * b ); } +inline bvhvec2 operator*( float b, const bvhvec2& a ) { return bvhvec2( b * a.x, b * a.y ); } +inline bvhvec3 operator*( float b, const bvhvec3& a ) { return bvhvec3( b * a.x, b * a.y, b * a.z ); } +inline bvhvec4 operator*( float b, const bvhvec4& a ) { return bvhvec4( b * a.x, b * a.y, b * a.z, b * a.w ); } +inline bvhvec2 operator/( float b, const bvhvec2& a ) { return bvhvec2( b / a.x, b / a.y ); } +inline bvhvec3 operator/( float b, const bvhvec3& a ) { return bvhvec3( b / a.x, b / a.y, b / a.z ); } +inline bvhvec4 operator/( float b, const bvhvec4& a ) { return bvhvec4( b / a.x, b / a.y, b / a.z, b / a.w ); } +inline bvhvec3 operator/( bvhvec3 b, const bvhvec3& a ) { return bvhvec3( b.x / a.x, b.y / a.y, b.z / a.z ); } +inline void operator*=( bvhvec3& a, const float b ) { a.x *= b; a.y *= b; a.z *= b; } + +#endif // TINYBVH_USE_CUSTOM_VECTOR_TYPES + +// Vector math: cross and dot. +inline bvhvec3 tinybvh_cross( const bvhvec3& a, const bvhvec3& b ) +{ + return bvhvec3( a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x ); +} +inline float tinybvh_dot( const bvhvec2& a, const bvhvec2& b ) { return a.x * b.x + a.y * b.y; } +inline float tinybvh_dot( const bvhvec3& a, const bvhvec3& b ) { return a.x * b.x + a.y * b.y + a.z * b.z; } +inline float tinybvh_dot( const bvhvec4& a, const bvhvec4& b ) { return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w; } + +// Vector math: common operations. +inline float tinybvh_length( const bvhvec3& a ) { return sqrtf( a.x * a.x + a.y * a.y + a.z * a.z ); } +inline bvhvec3 tinybvh_normalize( const bvhvec3& a ) +{ + float l = tinybvh_length( a ), rl = l == 0 ? 0 : (1.0f / l); + return a * rl; +} +inline bvhvec3 tinybvh_transform_point( const bvhvec3& v, const bvhmat4& T ) +{ + const float* Tcell = (const float*)&T; + const bvhvec3 res( + Tcell[0] * v.x + Tcell[1] * v.y + Tcell[2] * v.z + Tcell[3], + Tcell[4] * v.x + Tcell[5] * v.y + Tcell[6] * v.z + Tcell[7], + Tcell[8] * v.x + Tcell[9] * v.y + Tcell[10] * v.z + Tcell[11] ); + const float w = Tcell[12] * v.x + Tcell[13] * v.y + Tcell[14] * v.z + Tcell[15]; + if (w == 1) return res; else return res * (1.f / w); +} +inline bvhvec3 tinybvh_transform_vector( const bvhvec3& v, const bvhmat4& T ) +{ + const float* Tcell = (const float*)&T; + return bvhvec3( Tcell[0] * v.x + Tcell[1] * v.y + Tcell[2] * v.z, Tcell[4] * v.x + + Tcell[5] * v.y + Tcell[6] * v.z, Tcell[8] * v.x + Tcell[9] * v.y + Tcell[10] * v.z ); +} + +#ifdef DOUBLE_PRECISION_SUPPORT +// Double-precision math + +#ifndef TINYBVH_USE_CUSTOM_VECTOR_TYPES + +struct bvhdbl3 +{ + bvhdbl3() = default; + bvhdbl3( const double a, const double b, const double c ) : x( a ), y( b ), z( c ) {} + bvhdbl3( const double a ) : x( a ), y( a ), z( a ) {} + bvhdbl3( const bvhvec3 a ) : x( (double)a.x ), y( (double)a.y ), z( (double)a.z ) {} + double& operator [] ( const int32_t i ) { return cell[i]; } + const double& operator [] ( const int32_t i ) const { return cell[i]; } + union { struct { double x, y, z; }; double cell[3]; }; +}; + +#endif // TINYBVH_USE_CUSTOM_VECTOR_TYPES + +#ifdef _MSC_VER +#pragma warning ( pop ) +#endif + +inline bvhdbl3 tinybvh_min( const bvhdbl3& a, const bvhdbl3& b ) { return bvhdbl3( tinybvh_min( a.x, b.x ), tinybvh_min( a.y, b.y ), tinybvh_min( a.z, b.z ) ); } +inline bvhdbl3 tinybvh_max( const bvhdbl3& a, const bvhdbl3& b ) { return bvhdbl3( tinybvh_max( a.x, b.x ), tinybvh_max( a.y, b.y ), tinybvh_max( a.z, b.z ) ); } + +#ifndef TINYBVH_USE_CUSTOM_VECTOR_TYPES + +inline bvhdbl3 operator-( const bvhdbl3& a ) { return bvhdbl3( -a.x, -a.y, -a.z ); } +inline bvhdbl3 operator+( const bvhdbl3& a, const bvhdbl3& b ) { return bvhdbl3( a.x + b.x, a.y + b.y, a.z + b.z ); } +inline bvhdbl3 operator-( const bvhdbl3& a, const bvhdbl3& b ) { return bvhdbl3( a.x - b.x, a.y - b.y, a.z - b.z ); } +inline void operator+=( bvhdbl3& a, const bvhdbl3& b ) { a.x += b.x; a.y += b.y; a.z += b.z; } +inline bvhdbl3 operator*( const bvhdbl3& a, const bvhdbl3& b ) { return bvhdbl3( a.x * b.x, a.y * b.y, a.z * b.z ); } +inline bvhdbl3 operator*( const bvhdbl3& a, double b ) { return bvhdbl3( a.x * b, a.y * b, a.z * b ); } +inline bvhdbl3 operator*( double b, const bvhdbl3& a ) { return bvhdbl3( b * a.x, b * a.y, b * a.z ); } +inline bvhdbl3 operator/( double b, const bvhdbl3& a ) { return bvhdbl3( b / a.x, b / a.y, b / a.z ); } +inline bvhdbl3 operator/( bvhdbl3 b, const bvhdbl3& a ) { return bvhdbl3( b.x / a.x, b.y / a.y, b.z / a.z ); } +inline bvhdbl3 operator*=( bvhdbl3& a, const double b ) { return bvhdbl3( a.x * b, a.y * b, a.z * b ); } + +#endif // TINYBVH_USE_CUSTOM_VECTOR_TYPES + +inline double tinybvh_length( const bvhdbl3& a ) { return sqrt( a.x * a.x + a.y * a.y + a.z * a.z ); } +inline bvhdbl3 tinybvh_normalize( const bvhdbl3& a ) +{ + double l = tinybvh_length( a ), rl = l == 0 ? 0 : (1.0 / l); + return a * rl; +} +inline bvhdbl3 tinybvh_transform_point( const bvhdbl3& v, const double* T ) +{ + const bvhdbl3 res( + T[0] * v.x + T[1] * v.y + T[2] * v.z + T[3], + T[4] * v.x + T[5] * v.y + T[6] * v.z + T[7], + T[8] * v.x + T[9] * v.y + T[10] * v.z + T[11] ); + const double w = T[12] * v.x + T[13] * v.y + T[14] * v.z + T[15]; + if (w == 1) return res; else return res * (1. / w); +} +inline bvhdbl3 tinybvh_transform_vector( const bvhdbl3& v, const double* T ) +{ + return bvhdbl3( T[0] * v.x + T[1] * v.y + T[2] * v.z, T[4] * v.x + + T[5] * v.y + T[6] * v.z, T[8] * v.x + T[9] * v.y + T[10] * v.z ); +} + +inline bvhdbl3 tinybvh_cross( const bvhdbl3& a, const bvhdbl3& b ) +{ + return bvhdbl3( a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x ); +} +inline double tinybvh_dot( const bvhdbl3& a, const bvhdbl3& b ) { return a.x * b.x + a.y * b.y + a.z * b.z; } + +inline double tinybvh_half_area( const bvhdbl3& v ) { return v.x < -BVH_FAR ? 0 : (v.x * v.y + v.y * v.z + v.z * v.x); } // for SAH calculations + +#endif // DOUBLE_PRECISION_SUPPORT + +// SIMD typedef, helps keeping the interface generic +#if defined BVH_USESSE +typedef __m128 SIMDVEC4; +typedef __m128i SIMDIVEC4; +#define SIMD_SETVEC(a,b,c,d) _mm_set_ps( a, b, c, d ) +#define SIMD_SETRVEC(a,b,c,d) _mm_set_ps( d, c, b, a ) +#elif defined BVH_USENEON +typedef float32x4_t SIMDVEC4; +typedef int32x4_t SIMDIVEC4; +inline float32x4_t SIMD_SETVEC( float w, float z, float y, float x ) +{ + ALIGNED( 64 ) float data[4] = { x, y, z, w }; + return vld1q_f32( data ); +} +inline float32x4_t SIMD_SETRVEC( float x, float y, float z, float w ) +{ + ALIGNED( 64 ) float data[4] = { x, y, z, w }; + return vld1q_f32( data ); +} +inline uint32x4_t SIMD_SETRVECU( uint32_t x, uint32_t y, uint32_t z, uint32_t w ) +{ + ALIGNED( 64 ) uint32_t data[4] = { x, y, z, w }; + return vld1q_u32( data ); +} +inline int32x4_t SIMD_SETRVECS( int32_t x, int32_t y, int32_t z, int32_t w ) +{ + ALIGNED( 64 ) int32_t data[4] = { x, y, z, w }; + return vld1q_s32( data ); +} +#else +typedef bvhvec4 SIMDVEC4; +typedef struct { int x, y, z, w; } SIMDIVEC4; +#define SIMD_SETVEC(a,b,c,d) bvhvec4( d, c, b, a ) +#define SIMD_SETRVEC(a,b,c,d) bvhvec4( a, b, c, d ) +#endif +#ifdef BVH_USEAVX +typedef __m256 SIMDVEC8; +typedef __m256i SIMDIVEC8; +#elif defined BVH_USENEON +typedef float32x4x2_t SIMDVEC8; +typedef int32x4x2_t SIMDIVEC8; +#else +typedef struct { float v0, v1, v2, v3, v4, v5, v6, v7; } SIMDVEC8; +typedef struct { int v0, v1, v2, v3, v4, v5, v6, v7; } SIMDIVEC8; +#endif + +// ============================================================================ +// +// T I N Y _ B V H I N T E R F A C E +// +// ============================================================================ + +#if defined _MSC_VER || defined __GNUC__ +#pragma pack(push, 4) // is there a good alternative for Clang / EMSCRIPTEN? +#endif +struct Intersection +{ + // An intersection result is designed to fit in no more than + // four 32-bit values. This allows efficient storage of a result in + // GPU code. The obvious missing result is an instance id; consider + // squeezing this in the 'prim' field in some way. + // Using this data and the original triangle data, all other info for + // shading (such as normal, texture color etc.) can be reconstructed. +#if INST_IDX_BITS == 32 + uint32_t inst; // instance index. Stored in top bits of prim if INST_IDX_BITS != 32. +#endif + float t, u, v; // distance along ray & barycentric coordinates of the intersection + uint32_t prim; // primitive index + // 64 byte of custom data - + // assuming struct Ray is aligned, this starts at a cache line boundary. + void* auxData; + union + { + unsigned char userChar[56]; + float userFloat[14]; + uint32_t userInt32[14]; + double userDouble[7]; + uint64_t userInt64[7]; + }; +}; +#if defined _MSC_VER || defined __GNUC__ +#pragma pack(pop) // is there a good alternative for Clang / EMSCRIPTEN? +#endif + +// 16 bits of mask to tell which BLASInstance to intersect or not. +// By default the mask will be initialized to intersect all instances. +#define RAY_MASK_INTERSECT_ALL 0xFFFF + +struct ALIGNED( 64 ) Ray +{ + // Basic ray class. Note: For single blas traversal it is expected + // that Ray::rD is properly initialized. For tlas/blas traversal this + // field is typically updated for each blas. + Ray() = default; + Ray( bvhvec3 origin, bvhvec3 direction, float t = BVH_FAR, uint32_t rayMask = RAY_MASK_INTERSECT_ALL ) + { + memset( this, 0, sizeof( Ray ) ); + O = origin, D = tinybvh_normalize( direction ), rD = tinybvh_rcp( D ); + hit.t = t; + mask = rayMask & RAY_MASK_INTERSECT_ALL; + } + ALIGNED( 16 ) bvhvec3 O; uint32_t mask = RAY_MASK_INTERSECT_ALL; + ALIGNED( 16 ) bvhvec3 D; uint32_t instIdx = 0; + ALIGNED( 16 ) bvhvec3 rD; +#if INST_IDX_BITS != 32 + uint32_t dummy2; // align to 16 bytes if field 'hit' is 16 bytes; otherwise don't. +#endif + Intersection hit; +}; + +inline float tinybvh_intersect_aabb( Ray& ray, const bvhvec3& aabbMin, const bvhvec3& aabbMax ) +{ + // "slab test" ray/AABB intersection + float tx1 = (aabbMin.x - ray.O.x) * ray.rD.x, tx2 = (aabbMax.x - ray.O.x) * ray.rD.x; + float tmin = tinybvh_min( tx1, tx2 ), tmax = tinybvh_max( tx1, tx2 ); + float ty1 = (aabbMin.y - ray.O.y) * ray.rD.y, ty2 = (aabbMax.y - ray.O.y) * ray.rD.y; + tmin = tinybvh_max( tmin, tinybvh_min( ty1, ty2 ) ); + tmax = tinybvh_min( tmax, tinybvh_max( ty1, ty2 ) ); + float tz1 = (aabbMin.z - ray.O.z) * ray.rD.z, tz2 = (aabbMax.z - ray.O.z) * ray.rD.z; + tmin = tinybvh_max( tmin, tinybvh_min( tz1, tz2 ) ); + tmax = tinybvh_min( tmax, tinybvh_max( tz1, tz2 ) ); + if (tmax >= tmin && tmin < ray.hit.t && tmax >= 0) return tmin; else return BVH_FAR; +} + +inline bool tinybvh_aabbs_overlap( const bvhvec3& bmin1, const bvhvec3& bmax1, const bvhvec3& bmin2, const bvhvec3& bmax2 ) +{ + return bmin1.x <= bmax2.x && bmax1.x >= bmin2.x && bmin1.y <= bmax2.y && + bmax1.y >= bmin2.y && bmin1.z <= bmax2.z && bmax1.z >= bmin2.z; +} + +#ifdef DOUBLE_PRECISION_SUPPORT + +struct IntersectionEx +{ + // Double-precision hit record. + double t, u, v; // distance along ray & barycentric coordinates of the intersection + uint64_t inst, prim; // instance and primitive index +}; + +struct RayEx +{ + // Double-precision ray definition. + RayEx() = default; + RayEx( bvhdbl3 origin, bvhdbl3 direction, double tmax = BVH_DBL_FAR, uint32_t rayMask = RAY_MASK_INTERSECT_ALL ) + { + memset( this, 0, sizeof( RayEx ) ); + O = origin, D = direction; + double rl = 1.0 / sqrt( D.x * D.x + D.y * D.y + D.z * D.z ); + D.x *= rl, D.y *= rl, D.z *= rl; + rD.x = 1.0 / D.x, rD.y = 1.0 / D.y, rD.z = 1.0 / D.z; + hit.u = hit.v = 0, hit.t = tmax; + instIdx = 0; + mask = rayMask & RAY_MASK_INTERSECT_ALL; + } + bvhdbl3 O, D, rD; + IntersectionEx hit; + uint64_t instIdx; + uint64_t mask; +}; + +#endif + +struct BVHContext +{ + void* (*malloc)(size_t size, void* userdata) = malloc64; + void (*free)(void* ptr, void* userdata) = free64; + void* userdata = nullptr; +}; + +class BVHBase +{ +public: + enum BVHType : uint32_t + { + // Every BVHJ class is derived from BVHBase, but we don't use virtual functions, for + // performance reasons. For a TLAS over a mix of BVH layouts we do however need this + // kind of behavior when transitioning from a TLAS leaf to a BLAS root node. + UNDEFINED = 0, + LAYOUT_BVH = 1, + LAYOUT_BVH_VERBOSE, + LAYOUT_BVH_DOUBLE, + LAYOUT_BVH_SOA, + LAYOUT_BVH_GPU, + LAYOUT_MBVH, + LAYOUT_BVH4_CPU, + LAYOUT_BVH4_GPU, + LAYOUT_MBVH8, + LAYOUT_CWBVH, + LAYOUT_BVH8_AVX2, + LAYOUT_VOXELSET + }; + struct ALIGNED( 32 ) Fragment + { + // A fragment stores the bounds of an input primitive. The name 'Fragment' is from + // "Parallel Spatial Splits in Bounding Volume Hierarchies", 2016, Fuetterling et al., + // and refers to the potential splitting of these boxes for SBVH construction. + bvhvec3 bmin; // AABB min x, y and z + uint32_t primIdx; // index of the original primitive + bvhvec3 bmax; // AABB max x, y and z + uint32_t clipped = 0; // Fragment is the result of clipping if > 0. + bool validBox() { return bmin.x < BVH_FAR; } + }; + // BVH flags, maintainted by tiny_bvh. + bool rebuildable = true; // rebuilds are safe only if a tree has not been converted. + bool refittable = true; // refits are safe only if the tree has no spatial splits. + bool may_have_holes = false; // threaded builds and MergeLeafs produce BVHs with unused nodes. + bool bvh_over_aabbs = false; // a BVH over AABBs is useful for e.g. TLAS traversal. + bool bvh_over_indices = false; // a BVH over indices cannot translate primitive index to vertex index. + BVHContext context; // context used to provide user-defined allocation functions. + BVHType layout = UNDEFINED; // BVH layout identifier. + // Keep track of allocated buffer size to avoid repeated allocation during layout conversion. + uint32_t allocatedNodes = 0; // number of nodes allocated for the BVH. + uint32_t usedNodes = 0; // number of nodes used for the BVH. + uint32_t triCount = 0; // number of primitives in the BVH. + uint32_t idxCount = 0; // number of primitive indices; can exceed triCount for SBVH. + float c_trav = C_TRAV; // cost of a traversal step, used to steer SAH construction. + float c_int = C_INT; // cost of a primitive intersection, used to steer SAH construction. + bool l_quads = false; // some layouts have 4 prims in each leaf; adjust SAH cost for this. + uint32_t hqbvhbins = HQBVHBINS; // number of bins to use in SBVH construction. + bool hqbvhoddeven = false; // if true, odd levels will use one extra bin during construction. + bvhvec3 aabbMin, aabbMax; // bounds of the root node of the BVH. + // Opacity maps support. + uint32_t opmapN = 0; // opacity micro map subdivision: 0 = no maps. + uint32_t* opmap = 0; // opacity micro maps; opmapN^2 bits per triangle. + bool hasOpacityMicroMaps() const { return opmapN > 0; } + void SetOpacityMicroMaps( uint32_t* mapData, uint32_t N ) { opmap = mapData, opmapN = N; } + // Custom memory allocation + void* AlignedAlloc( size_t size ); + void AlignedFree( void* ptr ); + // Common methods + void CopyBasePropertiesFrom( const BVHBase& original ); // copy flags from one BVH to another +protected: + ~BVHBase() {} + __FORCEINLINE void IntersectTri( Ray& ray, const uint32_t idx, const bvhvec4slice& verts, const uint32_t i0, const uint32_t i1, const uint32_t i2 ) const; + __FORCEINLINE bool TriOccludes( const Ray& ray, const bvhvec4slice& verts, const uint32_t triIdx, const uint32_t i0, const uint32_t i1, const uint32_t i2 ) const; + static void PrecomputeTriangle( const bvhvec4slice& vert, const uint32_t ti0, const uint32_t ti1, const uint32_t ti2, float* T ); + static float SA( const bvhvec3& aabbMin, const bvhvec3& aabbMax ); +}; + +class BLASInstance; +class BVH_Verbose; +class BVH : public BVHBase +{ +public: + friend class BVH_GPU; + friend class BVH_SoA; + friend class BVH4_CPU; + friend class BVH8_CPU; + friend class BVH8_CWBVH; + template friend class MBVH; + struct SubdivTask { uint32_t node, sliceStart, sliceEnd, depth; }; + enum BuildFlags : uint32_t + { + NONE = 0, // Default building behavior (binned, SAH-driven). + FULLSPLIT = 1 // Split as far as possible, even when SAH doesn't agree. + }; + struct BVHNode + { + // 'Traditional' 32-byte BVH node layout, as proposed by Ingo Wald. + // When aligned to a cache line boundary, two of these fit together. + bvhvec3 aabbMin; uint32_t leftFirst; // 16 bytes + bvhvec3 aabbMax; uint32_t triCount; // 16 bytes, total: 32 bytes + bool isLeaf() const { return triCount > 0; /* empty BVH leaves do not exist */ } + bool Intersect( const bvhvec3& bmin, const bvhvec3& bmax ) const; + float SurfaceArea() const { return BVH::SA( aabbMin, aabbMax ); } + }; + BVH( BVHContext ctx = {} ) { layout = LAYOUT_BVH; context = ctx; } + BVH( const BVH_Verbose& original ) { layout = LAYOUT_BVH; ConvertFrom( original ); } + BVH( const bvhvec4* vertices, const uint32_t primCount ) { layout = LAYOUT_BVH; Build( vertices, primCount ); } + BVH( const bvhvec4slice& vertices ) { layout = LAYOUT_BVH; Build( vertices ); } + ~BVH(); + void ConvertFrom( const BVH_Verbose& original, bool compact = true ); + void SplitLeafs( const uint32_t maxPrims ); + float SAHCost( const uint32_t nodeIdx = 0 ) const; + float EPOCost( const uint32_t nodeIdx = 0 ) const; + int32_t NodeCount() const; + int32_t LeafCount() const; + int32_t PrimCount( const uint32_t nodeIdx = 0 ) const; + void Compact(); + void Save( const char* fileName ); + bool Load( const char* fileName, const bvhvec4* vertices, const uint32_t primCount ); + bool Load( const char* fileName, const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ); + bool Load( const char* fileName, const bvhvec4slice& vertices, const uint32_t* indices = 0, const uint32_t primCount = 0 ); + void BuildQuick( const bvhvec4* vertices, const uint32_t primCount ); + void BuildQuick( const bvhvec4slice& vertices ); + void Build( const bvhvec4* vertices, const uint32_t primCount ); + void Build( const bvhvec4slice& vertices ); + void Build( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ); + void Build( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); + void Build( BLASInstance* instances, const uint32_t instCount, BVHBase** blasses, const uint32_t blasCount ); + void Build( void (*customGetAABB)(const unsigned, bvhvec3&, bvhvec3&), const uint32_t primCount ); + void BuildHQ( const bvhvec4* vertices, const uint32_t primCount ); + void BuildHQ( const bvhvec4slice& vertices ); + void BuildHQ( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ); + void BuildHQ( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); + void BuildAVX( const bvhvec4* vertices, const uint32_t primCount ); + void BuildAVX( const bvhvec4slice& vertices ); + void BuildAVX( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ); + void BuildAVX( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); +#ifdef BVH_USENEON + void BuildNEON( const bvhvec4* vertices, const uint32_t primCount ); + void BuildNEON( const bvhvec4slice& vertices ); + void BuildNEON( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ); + void BuildNEON( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); + void PrepareNEONBuild( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); + void BuildNEON(); +#endif + void Refit( const uint32_t nodeIdx = 0 ); + void Optimize( const uint32_t iterations = 25, bool extreme = false, bool stochastic = false ); + uint32_t CombineLeafs( const uint32_t primCount, uint32_t& firstIdx, uint32_t nodeIdx = 0 ); + void CombineLeafs( const uint32_t nodeIdx = 0 ); + int32_t Intersect( Ray& ray ) const; + bool IntersectSphere( const bvhvec3& pos, const float r ) const; + bool IsOccluded( const Ray& ray ) const; + void Intersect256Rays( Ray* first ) const; + void Intersect256RaysSSE( Ray* packet ) const; // requires BVH_USEAVX + // private: + void PrepareBuild( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); + void Build( uint32_t nodeIdx = 0, uint32_t depth = 0 ); + void BuildFullSweep( uint32_t nodeIdx = 0, uint32_t depth = 0 ); + bool IsOccludedTLAS( const Ray& ray ) const; + int32_t IntersectTLAS( Ray& ray ) const; + void PrepareAVXBuild( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); + void BuildAVXSubtree( uint32_t nodeIdx = 0, uint32_t depth = 0 ); + void PrepareHQBuild( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t prims ); + void BuildHQ(); + void BuildHQTask( uint32_t nodeIdx, uint32_t depth, const uint32_t maxDepth, uint32_t sliceStart, uint32_t sliceEnd, uint32_t* triIdxB ); + bool ClipFrag( const Fragment& orig, Fragment& newFrag, bvhvec3 bmin, bvhvec3 bmax, bvhvec3 minDim, const uint32_t splitAxis ) const; + void SplitFrag( const Fragment& orig, Fragment& left, Fragment& right, const bvhvec3& minDim, const uint32_t splitAxis, const float splitPos, bool& leftOK, bool& rightOK ) const; +protected: + template int32_t Intersect( Ray& ray ) const; + template int32_t IntersectTLAS( Ray& ray ) const; + template bool IsOccluded( const Ray& ray ) const; + template bool IsOccludedTLAS( const Ray& ray ) const; + void BuildDefault( const bvhvec4* vertices, const uint32_t primCount ); + void BuildDefault( const bvhvec4slice& vertices ); + void BuildDefault( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ); + void BuildDefault( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); + // Helpers + inline float SplitCostSAH( const float rAparent, const float Aleft, const int Nleft, const float Aright, const int Nright ) const; + inline float NoSplitCostSAH( const int Nparent ) const; + float EPOArea( const uint32_t subtreeRoot, const uint32_t nodeIdx = 0 ) const; + float PrimArea( const uint32_t p ) const; +public: + // BVH type identification + bool isTLAS() const { return instList != 0; } + bool isBLAS() const { return instList == 0; } + bool isIndexed() const { return vertIdx != 0; } + bool hasCustomGeom() const { return customIntersect != 0; } + // Basic BVH data + bvhvec4slice verts = {}; // pointer to input primitive array: 3x16 bytes per tri. + uint32_t* vertIdx = 0; // vertex indices, only used in case the BVH is built over indexed prims. + uint32_t* primIdx = 0; // primitive index array. + uint32_t* rrsHits = 0; // for RDH: ray hit count per triangle. + BLASInstance* instList = 0; // instance array, for top-level acceleration structure. + BVHBase** blasList = 0; // blas array, for TLAS traversal. + uint32_t blasCount = 0; // number of blasses in blasList. + BVHNode* bvhNode = 0; // BVH node pool, Wald 32-byte format. Root is always in node 0. + uint32_t newNodePtr = 0; // used during build to keep track of next free node in pool. + uint32_t nextFrag = 0; // used during SBVH build to keep track of next free fragment. + Fragment* fragment = 0; // input primitive bounding boxes. + bool useFullSweep = false; // for experiments only; full-sweep SAH builder. + bool threadedBuild = true; // will be disabled for small meshes. + // Custom geometry intersection callback + bool (*customIntersect)(Ray&, const unsigned) = 0; + bool (*customIsOccluded)(const Ray&, const unsigned) = 0; +private: + // Atomic counters for threaded builds + std::atomic* atomicNewNodePtr = 0; + std::atomic* atomicNextFrag = 0; + // data for full sweep builder + uint8_t* flag = 0; + uint32_t* tmp = 0, *sortedIdx[3] = { 0 }; + float* SARs = 0; +#ifdef BVH_USEAVX + // static AVX data members + static __m128 half4, two4, min1, mask3, binmul3; + static __m128i maxbin4; + static __m256 max8, mask6, signFlip8; +public: + // helper for AVX binning + void BuildAVXBinTask( const uint32_t first, const uint32_t last, __m256* binbox, __m256* orig, + uint32_t* count, const __m128& nmin4, const __m128& rpd4 ); +#endif +}; + +class VoxelSet : public BVHBase // just so it can be attached conveniently in a TLAS +{ +public: + struct DDAState + { + uint32_t X, Y, Z; // 12 bytes + float dummy1 = 0; // 16 bytes + bvhvec3 tmax; + float dummy2 = 0; // 16 values, 64 bytes in total + }; + VoxelSet(); + void Set( const uint32_t x, const uint32_t y, const uint32_t z, const uint32_t v ); + void UpdateTopGrid(); + bvhvec3 GetNormal( const Ray& ray ) const; + int32_t Intersect( Ray& ray ) const; + bool IsOccluded( const Ray& ray ) const; +private: + bool Setup3DDDA( const Ray& ray, const bvhvec3& Dsign, DDAState& state, const bvhint3& step, bvhvec3& tdelta, float& t ) const; + // lowest level: 1 32-bit value per voxel +public: + static constexpr int objectDim = 256; // 64, 128 or 256. +private: + static constexpr int objectSize = objectDim * objectDim * objectDim; + // grid level: collection of bricks + static constexpr int brickDim = 8; + static constexpr int brickSize = brickDim * brickDim * brickDim; + static constexpr int gridDim = objectDim / brickDim; + static constexpr int gridSize = gridDim * gridDim * gridDim; + // topgrid level: 1 bit for each group of bricks + static constexpr int groupDim = 4; + static constexpr int groupSize = groupDim * groupDim * groupDim; + static constexpr int topGridDim = gridDim / groupDim; + static constexpr int topGridSize = topGridDim * topGridDim * topGridDim; + // masks + static constexpr uint32_t topResMask = gridDim - groupDim; + static constexpr uint32_t superMask = topResMask + topResMask * gridDim + topResMask * gridDim * gridDim; + // non-static data + uint32_t* grid = 0; + uint32_t* brick = 0; + uint32_t brickCount = (objectDim * objectDim) / 16; // will grow as needed; scales roughly quadratically with objectDim + uint32_t freeBrickPtr = 1; // skip 1, as 0 denotes an empty brick in the topgrid. + uint32_t* topGrid = 0; +}; + +#ifdef DOUBLE_PRECISION_SUPPORT + +class BLASInstanceEx; +class BVH_Double : public BVHBase +{ +public: + struct BVHNode + { + // Double precision 'traditional' BVH node layout. + // Compared to the default BVHNode, child node indices and triangle indices + // are also expanded to 64bit values to support massive scenes. + bvhdbl3 aabbMin, aabbMax; // 2x24 bytes + uint64_t leftFirst; // 8 bytes + uint64_t triCount; // 8 bytes, total: 64 bytes + bool isLeaf() const { return triCount > 0; /* empty BVH leaves do not exist */ } + double Intersect( const RayEx& ray ) const; + double SurfaceArea() const; + }; + struct Fragment + { + // Double-precision version of the fragment sruct. + bvhdbl3 bmin, bmax; // AABB + uint64_t primIdx; // index of the original primitive + }; + BVH_Double( BVHContext ctx = {} ) { layout = LAYOUT_BVH_DOUBLE; context = ctx; } + ~BVH_Double(); + void Build( const bvhdbl3* vertices, const uint64_t primCount ); + void Build( BLASInstanceEx* bvhs, const uint64_t instCount, BVH_Double** blasses, const uint64_t blasCount ); + void Build( void (*customGetAABB)(const uint64_t, bvhdbl3&, bvhdbl3&), const uint64_t primCount ); + void PrepareBuild( const bvhdbl3* vertices, const uint64_t primCount ); + void Build( uint64_t nodeIdx = 0, uint32_t depth = 0 ); + double SAHCost( const uint64_t nodeIdx = 0 ) const; + int32_t Intersect( RayEx& ray ) const; + bool IsOccluded( const RayEx& ray ) const; + bool IsOccludedTLAS( const RayEx& ray ) const; + int32_t IntersectTLAS( RayEx& ray ) const; + bvhdbl3* verts = 0; // pointer to input primitive array, double-precision, 3x24 bytes per tri. + Fragment* fragment = 0; // input primitive bounding boxes, double-precision. + BVHNode* bvhNode = 0; // BVH node, double precision format. + uint64_t* primIdx = 0; // primitive index array for double-precision bvh. + BLASInstanceEx* instList = 0; // instance array, for top-level acceleration structure. + BVH_Double** blasList = 0; // blas array, for TLAS traversal. + uint64_t blasCount = 0; // number of blasses in blasList. + // 64-bit base overrides + uint64_t newNodePtr = 0; // next free bvh pool entry to allocate + uint64_t usedNodes = 0; // number of nodes used for the BVH. + uint64_t allocatedNodes = 0; // number of nodes allocated for the BVH. + uint64_t triCount = 0; // number of primitives in the BVH. + uint64_t idxCount = 0; // number of primitive indices. + bvhdbl3 aabbMin, aabbMax; // bounds of the root node of the BVH. + // Custom geometry intersection callback + bool (*customIntersect)(RayEx&, uint64_t) = 0; + bool (*customIsOccluded)(const RayEx&, uint64_t) = 0; +private: + // Atomic counter for threaded builds + std::atomic* atomicNewNodePtr = 0; +}; + +#endif // DOUBLE_PRECISION_SUPPORT + +class BVH_GPU : public BVHBase +{ +public: + struct BVHNode + { + // Alternative 64-byte BVH node layout, which specifies the bounds of + // the children rather than the node itself. This layout is used by + // Aila and Laine in their seminal GPU ray tracing paper. + bvhvec3 lmin; uint32_t left; + bvhvec3 lmax; uint32_t right; + bvhvec3 rmin; uint32_t triCount; + bvhvec3 rmax; uint32_t firstTri; // total: 64 bytes + bool isLeaf() const { return triCount > 0; } + }; + BVH_GPU( BVHContext ctx = {} ) { layout = LAYOUT_BVH_GPU; context = ctx; } + BVH_GPU( const BVH& original ) { /* DEPRICATED */ ConvertFrom( original ); } + ~BVH_GPU(); + void Build( const bvhvec4* vertices, const uint32_t primCount ); + void Build( const bvhvec4slice& vertices ); + void Build( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ); + void Build( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); + void Build( BLASInstance* instances, const uint32_t instCount, BVHBase** blasses, const uint32_t blasCount ); + void BuildHQ( const bvhvec4* vertices, const uint32_t primCount ); + void BuildHQ( const bvhvec4slice& vertices ); + void BuildHQ( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ); + void BuildHQ( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); + void Optimize( const uint32_t iterations = 25, bool extreme = false ); + float SAHCost( const uint32_t nodeIdx = 0 ) const { return bvh.SAHCost( nodeIdx ); } + void ConvertFrom( const BVH& original, bool compact = true ); + int32_t Intersect( Ray& ray ) const; + bool IsOccluded( const Ray& ray ) const { FALLBACK_SHADOW_QUERY( ray ); } + // BVH data + BVHNode* bvhNode = 0; // BVH node in Aila & Laine format. + BVH bvh; // BVH4 is created from BVH and uses its data. + bool ownBVH = true; // False when ConvertFrom receives an external bvh. +}; + +class BVH_SoA : public BVHBase +{ +public: + struct BVHNode + { + // Second alternative 64-byte BVH node layout, same as BVHAilaLaine but + // with child AABBs stored in SoA order. + SIMDVEC4 xxxx, yyyy, zzzz; + uint32_t left, right, triCount, firstTri; // total: 64 bytes + bool isLeaf() const { return triCount > 0; } + }; + BVH_SoA( BVHContext ctx = {} ) { layout = LAYOUT_BVH_SOA; context = ctx; } + BVH_SoA( const BVH& original ) { /* DEPRICATED */ layout = LAYOUT_BVH_SOA; ConvertFrom( original ); } + ~BVH_SoA(); + void Build( const bvhvec4* vertices, const uint32_t primCount ); + void Build( const bvhvec4slice& vertices ); + void Build( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ); + void Build( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); + void BuildHQ( const bvhvec4* vertices, const uint32_t primCount ); + void BuildHQ( const bvhvec4slice& vertices ); + void BuildHQ( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ); + void BuildHQ( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); + void Optimize( const uint32_t iterations = 25, bool extreme = false ); + float SAHCost( const uint32_t nodeIdx = 0 ) const { return bvh.SAHCost( nodeIdx ); } + void Save( const char* fileName ); + bool Load( const char* fileName, const bvhvec4* vertices, const uint32_t primCount ); + bool Load( const char* fileName, const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ); + bool Load( const char* fileName, const bvhvec4slice& vertices, const uint32_t* indices = 0, const uint32_t primCount = 0 ); + void ConvertFrom( const BVH& original, bool compact = true ); + int32_t Intersect( Ray& ray ) const; + bool IsOccluded( const Ray& ray ) const; + // BVH data + BVHNode* bvhNode = 0; // BVH node in 'structure of arrays' format. + BVH bvh; // BVH_SoA is created from BVH and uses its data. + bool ownBVH = true; // False when ConvertFrom receives an external bvh. +}; + +class BVH_Verbose : public BVHBase +{ +public: + struct BVHNode + { + // This node layout has some extra data per node: It stores left and right + // child node indices explicitly, and stores the index of the parent node. + // This format exists primarily for the BVH optimizer. + bvhvec3 aabbMin; uint32_t left; + bvhvec3 aabbMax; uint32_t right; + uint32_t triCount, firstTri, parent; + float dummy[5]; // total: 64 bytes. + bool isLeaf() const { return triCount > 0; } + float SA() const { return BVH::SA( aabbMin, aabbMax ); } + }; + BVH_Verbose( BVHContext ctx = {} ) { layout = LAYOUT_BVH_VERBOSE; context = ctx; } + BVH_Verbose( const BVH& original ) { /* DEPRECATED */ layout = LAYOUT_BVH_VERBOSE; ConvertFrom( original ); } + ~BVH_Verbose() { AlignedFree( bvhNode ); } + void ConvertFrom( const BVH& original, bool compact = true ); + float SAHCost( const uint32_t nodeIdx = 0 ) const; + int32_t NodeCount() const; + int32_t PrimCount( const uint32_t nodeIdx = 0 ) const; + void Refit( const uint32_t nodeIdx = 0, bool skipLeafs = false ); + void CheckFit( const uint32_t nodeIdx = 0, bool skipLeafs = false ); + void Compact(); + void SortIndices(); + void SplitLeafs( const uint32_t maxPrims = 1 ); + void MergeLeafs(); + void Optimize( const uint32_t iterations = 25, bool extreme = false, bool stochastic = false ); +private: + struct SortItem { uint32_t idx; float cost; }; + void RefitUp( uint32_t nodeIdx ); + float SAHCostUp( uint32_t nodeIdx ) const; + uint32_t FindBestNewPosition( const uint32_t Lid ) const; + uint32_t CountSubtreeTris( const uint32_t nodeIdx, uint32_t* counters ); + void MergeSubtree( const uint32_t nodeIdx, uint32_t* newIdx, uint32_t& newIdxPtr ); +public: + // BVH data + bvhvec4slice verts = {}; // pointer to input primitive array: 3x16 bytes per tri. + Fragment* fragment = 0; // input primitive bounding boxes, double-precision. + uint32_t* primIdx = 0; // primitive index array - pointer copied from original. + BVHNode* bvhNode = 0; // BVH node with additional info, for BVH optimizer. +}; + +template class MBVH : public BVHBase +{ +public: + struct MBVHNode + { + // M-wide (aka 'shallow') BVH layout. + bvhvec3 aabbMin; uint32_t firstTri; + bvhvec3 aabbMax; uint32_t triCount; + uint32_t child[M]; + uint32_t childCount; + uint32_t dummy[((30 - M) & 3) + 1]; // dummies are for alignment. + bool isLeaf() const { return triCount > 0; } + }; + MBVH( BVHContext ctx = {} ) { layout = LAYOUT_MBVH; context = ctx; } + MBVH( const BVH& original ) { /* DEPRECATED */ layout = LAYOUT_MBVH; ConvertFrom( original ); } + ~MBVH(); + void Build( const bvhvec4* vertices, const uint32_t primCount ); + void Build( const bvhvec4slice& vertices ); + void Build( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ); + void Build( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); + void BuildHQ( const bvhvec4* vertices, const uint32_t primCount ); + void BuildHQ( const bvhvec4slice& vertices ); + void BuildHQ( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ); + void BuildHQ( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); + void Optimize( const uint32_t iterations = 25, bool extreme = false ); + void Refit( const uint32_t nodeIdx = 0 ); + uint32_t LeafCount( const uint32_t nodeIdx = 0 ) const; + float SAHCost( const uint32_t nodeIdx = 0 ) const; + void ConvertFrom( const BVH& original, bool compact = true ); + // BVH data + MBVHNode* mbvhNode = 0; // BVH node for M-wide BVH. + BVH bvh; // MBVH is created from BVH and uses its data. + bool ownBVH = true; // False when ConvertFrom receives an external bvh. +}; + +class BVH4_GPU : public BVHBase +{ +public: + struct BVHNode // actual struct is unused; left here to show structure of data in bvh4Data. + { + // 4-way BVH node, optimized for GPU rendering + struct aabb8 { uint8_t xmin, ymin, zmin, xmax, ymax, zmax; }; // quantized + bvhvec3 aabbMin; uint32_t c0Info; // 16 + bvhvec3 aabbExt; uint32_t c1Info; // 16 + aabb8 c0bounds, c1bounds; uint32_t c2Info; // 16 + aabb8 c2bounds, c3bounds; uint32_t c3Info; // 16; total: 64 bytes + // childInfo, 32bit: + // msb: 0=interior, 1=leaf + // leaf: 16 bits: relative start of triangle data, 15 bits: triangle count. + // interior: 31 bits: child node address, in float4s from BVH data start. + // Triangle data: directly follows nodes with leaves. Per tri: + // - bvhvec4 vert0, vert1, vert2 + // - uint vert0.w stores original triangle index. + // We can make the node smaller by storing child nodes sequentially, but + // there is no way we can shave off a full 16 bytes, unless aabbExt is stored + // as chars as well, as in CWBVH. + }; + BVH4_GPU( BVHContext ctx = {} ) { layout = LAYOUT_BVH4_GPU; context = ctx; } + BVH4_GPU( const MBVH<4>& bvh4 ) { /* DEPRECATED */ layout = LAYOUT_BVH4_GPU; ConvertFrom( bvh4 ); } + ~BVH4_GPU(); + void Build( const bvhvec4* vertices, const uint32_t primCount ); + void Build( const bvhvec4slice& vertices ); + void Build( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ); + void Build( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); + void BuildHQ( const bvhvec4* vertices, const uint32_t primCount ); + void BuildHQ( const bvhvec4slice& vertices ); + void BuildHQ( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ); + void BuildHQ( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); + void Optimize( const uint32_t iterations = 25, bool extreme = false ); + void ConvertFrom( const MBVH<4>& original, bool compact = true ); + float SAHCost( const uint32_t nodeIdx = 0 ) const { return bvh4.SAHCost( nodeIdx ); } + int32_t Intersect( Ray& ray ) const; + bool IsOccluded( const Ray& ray ) const { FALLBACK_SHADOW_QUERY( ray ); } + // BVH data + bvhvec4* bvh4Data = 0; // 64-byte 4-wide BVH node for efficient GPU rendering. + uint32_t allocatedBlocks = 0; // node data and triangles are stored in 16-byte blocks. + uint32_t usedBlocks = 0; // actually used storage. + MBVH<4> bvh4; // BVH4_GPU is created from BVH4 and uses its data. + bool ownBVH4 = true; // False when ConvertFrom receives an external bvh. +}; + +class BVH4_CPU : public BVHBase +{ +public: + enum { EMPTY_BIT = 1 << 31, LEAF_BIT = 1 << 30 }; + struct BVHNode + { + // 4-way BVH node, optimized for CPU rendering. + // SSE version. + SIMDVEC4 xmin4, xmax4; + SIMDVEC4 ymin4, ymax4; + SIMDVEC4 zmin4, zmax4; + SIMDIVEC4 child4, perm4; // total 128 bytes. + }; + struct CacheLine { SIMDVEC4 a, b, c, d; }; + BVH4_CPU( BVHContext ctx = {} ) { layout = LAYOUT_BVH4_CPU; context = ctx; c_int = 2; l_quads = true; } + ~BVH4_CPU(); + void Save( const char* fileName ); + bool Load( const char* fileName, const uint32_t expectedTris ); + void Build( const bvhvec4* vertices, const uint32_t primCount ); + void Build( const bvhvec4slice& vertices ); + void Build( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ); + void Build( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ); + void BuildHQ( const bvhvec4* vertices, const uint32_t primCount ); + void BuildHQ( const bvhvec4slice& vertices ); + void BuildHQ( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ); + void BuildHQ( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ); + void Optimize( const uint32_t iterations, bool extreme ); + void Refit(); + float SAHCost( const uint32_t nodeIdx ) const; + void ConvertFrom( MBVH<4>& original ); + int32_t Intersect( Ray& ray ) const; + bool IsOccluded( const Ray& ray ) const; + // Intersect / IsOccluded specialize for ray octant using templated functions. + template int32_t Intersect( Ray& ray ) const; + template bool IsOccluded( const Ray& ray ) const; + // BVH8 data + CacheLine* bvh4Data = 0; // Interleaved interior (128b) and leaf (192b) data. + MBVH<4> bvh4; // BVH4_CPU is created from BVH4 and uses its data. + bool ownBVH4 = true; // false when ConvertFrom receives an external bvh4. + uint32_t allocatedBlocks = 0; // node data and triangles are stored in 16-byte blocks. + uint32_t usedBlocks = 0; // the amount of data actually used. +}; + +class BVH8_CWBVH : public BVHBase +{ +public: + BVH8_CWBVH( BVHContext ctx = {} ) { layout = LAYOUT_CWBVH; context = ctx; } + BVH8_CWBVH( MBVH<8>& bvh8 ) { /* DEPRECATED */ layout = LAYOUT_CWBVH; ConvertFrom( bvh8 ); } + ~BVH8_CWBVH(); + void Save( const char* fileName ); + bool Load( const char* fileName, const uint32_t expectedTris ); + void Build( const bvhvec4* vertices, const uint32_t primCount ); + void Build( const bvhvec4slice& vertices ); + void Build( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ); + void Build( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); + void BuildHQ( const bvhvec4* vertices, const uint32_t primCount ); + void BuildHQ( const bvhvec4slice& vertices ); + void BuildHQ( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ); + void BuildHQ( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ); + void Optimize( const uint32_t iterations = 25, bool extreme = false ); + void ConvertFrom( MBVH<8>& original, bool compact = true ); + float SAHCost( const uint32_t nodeIdx = 0 ) const; + int32_t Intersect( Ray& ray ) const; + bool IsOccluded( const Ray& ray ) const { FALLBACK_SHADOW_QUERY( ray ); } + // BVH8 data + bvhvec4* bvh8Data = 0; // nodes in CWBVH format. + bvhvec4* bvh8Tris = 0; // triangle data for CWBVH nodes. + uint32_t allocatedBlocks = 0; // node data is stored in blocks of 16 byte. + uint32_t usedBlocks = 0; // actually used blocks. + MBVH<8> bvh8; // BVH8_CWBVH is created from BVH8 and uses its data. + bool ownBVH8 = true; // false when ConvertFrom receives an external bvh8. +}; + +// Storage for up to four triangles, in SoA layout, for BVH8_CPU. +struct BVHTri4Leaf +{ + SIMDVEC4 v0x4, v0y4, v0z4; + SIMDVEC4 e1x4, e1y4, e1z4; + SIMDVEC4 e2x4, e2y4, e2z4; + uint32_t primIdx[4]; // total: 160 bytes. + SIMDVEC4 dummy0, dummy1; // pad to 3 full cachelines. + inline void SetData( const bvhvec3& v0, const bvhvec3& e1, const bvhvec3& e2, const uint32_t pidx, const uint32_t slot ) + { + ((float*)&v0x4)[slot] = v0.x, ((float*)&v0y4)[slot] = v0.y, ((float*)&v0z4)[slot] = v0.z; + ((float*)&e1x4)[slot] = e1.x, ((float*)&e1y4)[slot] = e1.y, ((float*)&e1z4)[slot] = e1.z; + ((float*)&e2x4)[slot] = e2.x, ((float*)&e2y4)[slot] = e2.y, ((float*)&e2z4)[slot] = e2.z, primIdx[slot] = pidx; + } +}; + +// Storage for a single triangle, for BVH8_CPU. +struct BVHTri1Leaf +{ + bvhvec3 v0, e1, e2; + uint32_t primIdx; // total: 40 bytes +}; + +class BVH8_CPU : public BVHBase +{ +public: + enum { EMPTY_BIT = 1 << 31, LEAF_BIT = 1 << 30 }; + struct BVHNode + { + // 8-way BVH node, optimized for CPU rendering. + // Based on: "Accelerated Single Ray Tracing for Wide Vector Units", Fuetterling et al., 2017, + // and the implementation by Mathijs Molenaar, https://github.com/mathijs727/pandora + SIMDVEC8 xmin8, xmax8; + SIMDVEC8 ymin8, ymax8; + SIMDVEC8 zmin8, zmax8; + SIMDIVEC8 child8; // bits: 31..29 = flags, 28..0: node index. + SIMDIVEC8 perm8; + // flag bits: 000 is an empty node, 010 is an interior node. 1xx is leaf; xx = tricount. + }; + struct BVHNodeCompact + { + // Novel 128-byte 8-way BVH node. + SIMDIVEC8 child8, perm8; // 64 + float d0, bminx, bminy, bminz, d1, bextx, bexty, bextz; // 32 + SIMDIVEC4 cbminmaxx8, cbminmaxy8; // 32, total: 128 + }; + struct CacheLine { SIMDVEC8 a, b; }; + BVH8_CPU( BVHContext ctx = {} ) { layout = LAYOUT_BVH8_AVX2; context = ctx; c_int = 2; l_quads = true; } + ~BVH8_CPU(); + void Save( const char* fileName ); + bool Load( const char* fileName, const uint32_t expectedTris ); + void Build( const bvhvec4* vertices, const uint32_t primCount ); + void Build( const bvhvec4slice& vertices ); + void Build( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ); + void Build( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ); + void BuildHQ( const bvhvec4* vertices, const uint32_t primCount ); + void BuildHQ( const bvhvec4slice& vertices ); + void BuildHQ( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ); + void BuildHQ( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ); + void Optimize( const uint32_t iterations, bool extreme ); + void Refit(); + float SAHCost( const uint32_t nodeIdx ) const; + void ConvertFrom( MBVH<8>& original ); + int32_t Intersect( Ray& ray ) const; + bool IsOccluded( const Ray& ray ) const; + // Intersect / IsOccluded specialize for ray octant using templated functions. + template int32_t Intersect( Ray& ray ) const; + template bool IsOccluded( const Ray& ray ) const; + // BVH8 data + CacheLine* bvh8Data = 0; // Interleaved interior (256b) and leaf (192b) data. + MBVH<8> bvh8; // BVH8_CPU is created from BVH8 and uses its data. + bool ownBVH8 = true; // false when ConvertFrom receives an external bvh8. + uint32_t allocatedBlocks = 0; // node data and triangles are stored in 16-byte blocks. + uint32_t usedBlocks = 0; // the amount of data actually used. +}; + +// BLASInstance: A TLAS is built over BLAS instances, where a single BLAS can be +// used with multiple transforms, and multiple BLASses can be combined in a complex +// scene. The TLAS is built over the world-space AABBs of the BLAS root nodes. +class ALIGNED( 64 ) BLASInstance +{ +public: + BLASInstance() = default; + BLASInstance( uint32_t idx ) : blasIdx( idx ) {} + bvhmat4 transform; // defaults to identity + bvhmat4 invTransform; // defaults to identity + bvhvec3 aabbMin = bvhvec3( BVH_FAR ); + uint32_t blasIdx = 0; + bvhvec3 aabbMax = bvhvec3( -BVH_FAR ); + uint32_t mask = (uint32_t)RAY_MASK_INTERSECT_ALL; // set to intersect with all rays by default + uint32_t dummy[8]; // pad struct to 64 byte + void Update( BVHBase * blas ); + void InvertTransform(); +}; + +#ifdef DOUBLE_PRECISION_SUPPORT + +// BLASInstanceEx: Double-precision version of BLASInstance. +class BLASInstanceEx +{ +public: + BLASInstanceEx() = default; + BLASInstanceEx( uint64_t idx ) : blasIdx( idx ) {} + double transform[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 }; // identity + double invTransform[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 }; // identity + bvhdbl3 aabbMin = bvhdbl3( BVH_DBL_FAR ); + uint64_t blasIdx = 0; + bvhdbl3 aabbMax = bvhdbl3( -BVH_DBL_FAR ); + uint64_t mask = RAY_MASK_INTERSECT_ALL; // set to intersect with all rays by default + void Update( BVH_Double* blas ); + void InvertTransform(); +}; + +#endif + +} // namespace tinybvh + +#endif // TINY_BVH_H_ + +// ============================================================================ +// +// I M P L E M E N T A T I O N +// +// ============================================================================ + +#ifdef TINYBVH_IMPLEMENTATION + +#include // for assert +#ifdef _MSC_VER +#include // for __lzcnt +#endif +#include // fstream + +// job manager includes +#include +#include +#include +#include +#include + +// We need quite a bit of type reinterpretation, so we'll +// turn off the gcc warning here until the end of the file. +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif + +// Some constexpr stuff to produce nice-looking branches in +// *::Intersect with proper dead code elinimation. +#ifdef ENABLE_INDEXED_GEOMETRY +static constexpr bool indexedEnabled = true; +#else +static constexpr bool indexedEnabled = false; +#endif +#ifdef ENABLE_CUSTOM_GEOMETRY +static constexpr bool customEnabled = true; +#else +static constexpr bool customEnabled = false; +#endif + +namespace tinybvh { + +#if defined BVH_USESSE || defined BVH_USENEON +inline uint32_t __bfind( uint32_t x ) // https://github.com/mackron/refcode/blob/master/lzcnt.c +{ +#if defined _MSC_VER && !defined __clang__ + return 31 - __lzcnt( x ); +#elif defined __EMSCRIPTEN__ + return 31 - __builtin_clz( x ); +#elif defined __GNUC__ || defined __clang__ +#if defined __APPLE__ || __has_builtin(__builtin_clz) + return 31 - __builtin_clz( x ); +#else + uint32_t r; + __asm__ __volatile__( "lzcnt{l %1, %0| %0, %1}" : "=r"(r) : "r"(x) : "cc" ); + return 31 - r; +#endif +#endif +} +#endif + +// array element counting; https://stackoverflow.com/questions/12784136 +#define BVH_NUM_ELEMS(a) (sizeof(a)/sizeof 0[a]) + +// random numbers +uint32_t tinybvh_rnduint( uint32_t& s ) { s ^= s << 13, s ^= s >> 17, s ^= s << 5; return s; } +float tinybvh_rndfloat( uint32_t& s ) { return tinybvh_rnduint( s ) * 2.3283064365387e-10f; } + +// random unit vector +bvhvec3 tinybvh_rndvec3( uint32_t& s ) +{ + bvhvec3 R; +loop: R = bvhvec3( tinybvh_rndfloat( s ) - 0.5f, tinybvh_rndfloat( s ) * 0.5f, tinybvh_rndfloat( s ) * 0.5f ); + if (tinybvh_dot( R, R ) > 0.25f) goto loop; + return tinybvh_normalize( R ); +} + +// radix sort +static inline unsigned FloatToKey( const float value ) +{ + // Integer comparisons between numbers returned from this function behave + // as if the original float values where compared. + // Simple reinterpretation works only for [0, ...], but this also handles negatives + const unsigned f = *(unsigned*)&value, mask = (unsigned)((int)f >> 31 | (1 << 31)); + return f ^ mask; +} +template static inline void RadixSort( T* input, T* output, int len, Func getKey ) +{ + // http://stereopsis.com/radix.html - Beats std::sort unless for small inputs (say len <= ~64) + const int radixSize = 11, binSize = 1 << radixSize, mask = binSize - 1, passes = 3; + int prefixSum[binSize * passes] = { 0 }; + auto getPrefixSumRef = [=, &prefixSum]( unsigned key, int pass ) -> int& { + const unsigned radix = (key >> (pass * radixSize)) & mask; + int& offset = prefixSum[radix + pass * binSize]; + return offset; + }; + // Compute histogram for all passes + for (int i = 0; i < len; i++) + { + const unsigned key = getKey( input[i] ); + getPrefixSumRef( key, 0 )++, getPrefixSumRef( key, 1 )++, getPrefixSumRef( key, 2 )++; + } + // Compute prefix sum for all passes + int sum0 = 0, sum1 = 0, sum2 = 0; + for (int i = 0; i < binSize; i++) + { + const int temp0 = prefixSum[i + 0 * binSize]; + const int temp1 = prefixSum[i + 1 * binSize]; + const int temp2 = prefixSum[i + 2 * binSize]; + prefixSum[i + 0 * binSize] = sum0; + prefixSum[i + 1 * binSize] = sum1; + prefixSum[i + 2 * binSize] = sum2; + sum0 += temp0, sum1 += temp1, sum2 += temp2; + } + // Sort from LSB to MSB in radix-sized steps + for (int i = 0; i < passes; i++) + { + for (int j = 0; j < len; j++) + { + const T element = input[j]; + const unsigned key0 = getKey( element ); + output[getPrefixSumRef( key0, i )++] = element; + } + tinybvh_swap( input, output ); + } +} + +// error handling +#ifdef _WINDOWS_ // windows.h has been included +#define BVH_FATAL_ERROR_IF(c,s) if (c) { char t[512]; sprintf( t, \ + "Fatal error in tiny_bvh.h, line %i:\n%s\n", __LINE__, s ); \ + MessageBox( NULL, t, "Fatal error", MB_OK ); exit( 1 ); } +#else +#define BVH_FATAL_ERROR_IF(c,s) if (c) { fprintf( stderr, \ + "Fatal error in tiny_bvh.h, line %i:\n%s\n", __LINE__, s ); exit( 1 ); } +#endif +#define BVH_FATAL_ERROR(s) BVH_FATAL_ERROR_IF(1,s) + +// Fallbacks to be used in the absence of HW SIMD support. +#if !defined BVH_USESSE || defined BVH_USENEON +int32_t BVH4_CPU::Intersect( Ray& ) const { BVH_FATAL_ERROR( "BVH4_CPU::Intersect requires SSE. " ); } +bool BVH4_CPU::IsOccluded( const Ray& ) const { BVH_FATAL_ERROR( "BVH4_CPU::IsOccluded requires SSE. " ); } +#endif +#if !defined BVH_USEAVX || defined BVH_USENEON +void BVH::BuildAVX( const bvhvec4*, const uint32_t ) { BVH_FATAL_ERROR( "BVH::BuildAVX requires AVX." ); } +void BVH::BuildAVX( const bvhvec4slice& ) { BVH_FATAL_ERROR( "BVH::BuildAVX requires AVX." ); } +void BVH::BuildAVX( const bvhvec4*, const uint32_t*, const uint32_t ) { BVH_FATAL_ERROR( "BVH::BuildAVX requires AVX." ); } +void BVH::BuildAVX( const bvhvec4slice&, const uint32_t*, const uint32_t ) { BVH_FATAL_ERROR( "BVH::BuildAVX requires AVX." ); } +int32_t BVH8_CWBVH::Intersect( Ray& ) const { BVH_FATAL_ERROR( "BVH8_CWBVH::Intersect requires AVX." ); } +#endif // BVH_USEAVX +#if !defined BVH_USEAVX2 || defined BVH_USENEON +int32_t BVH8_CPU::Intersect( Ray& ) const { BVH_FATAL_ERROR( "BVH8_CPU::Intersect requires AVX2 and FMA." ); } +bool BVH8_CPU::IsOccluded( const Ray& ) const { BVH_FATAL_ERROR( "BVH8_CPU::IsOccluded requires AVX2 and FMA." ); } +#endif // BVH_USEAVX2 +#if !defined BVH_USEAVX && !defined BVH_USENEON +int32_t BVH_SoA::Intersect( Ray& ) const { BVH_FATAL_ERROR( "BVH_SoA::Intersect requires AVX or NEON." ); } +bool BVH_SoA::IsOccluded( const Ray& ) const { BVH_FATAL_ERROR( "BVH_SoA::IsOccluded requires AVX or NEON." ); } +#endif // !(BVH_USEAVX && BVH_USENEON) + +// code compaction: Moeller-Trumbore ray/tri test. +#define MOLLER_TRUMBORE_TEST( tmax, exit ) \ + const bvhvec3 h = tinybvh_cross( ray.D, e2 ); \ + const float a = tinybvh_dot( e1, h ); \ + if (fabs( a ) < 0.000001f) exit; \ + const float f = 1 / a; \ + const bvhvec3 s = ray.O - v0; \ + const float u = f * tinybvh_dot( s, h ); \ + const bvhvec3 q = tinybvh_cross( s, e1 ); \ + const float v = f * tinybvh_dot( ray.D, q ); \ + const bool miss = u < 0 || v < 0 || u + v > 1; \ + if (miss) exit; \ + const float t = f * tinybvh_dot( e2, q ); \ + if (t < 0 || t > tmax) exit; + +// code compaction: fetching triangle vertices, with or without indices. +#define GET_PRIM_INDICES_I0_I1_I2( bvh, idx ) if (indexedEnabled && bvh.vertIdx != 0) \ + i0 = bvh.vertIdx[idx * 3], i1 = bvh.vertIdx[idx * 3 + 1], i2 = bvh.vertIdx[idx * 3 + 2]; \ + else i0 = idx * 3, i1 = idx * 3 + 1, i2 = idx * 3 + 2; + +// ray validation: throw an error if the input ray contains nans. +#define VALIDATE_RAY(r) { float test = r.D.x + r.D.y + r.D.z + ray.hit.t + r.O.x \ + + r.O.y + r.O.z; BVH_FATAL_ERROR_IF( std::isnan( test ), "Input ray contains NaNs." ); } + +#ifndef TINYBVH_USE_CUSTOM_VECTOR_TYPES + +bvhmat4 operator*( const float s, const bvhmat4& a ) +{ + bvhmat4 r; + for (uint32_t i = 0; i < 16; i++) r[i] = a[i] * s; + return r; +} +bvhmat4 operator*( const bvhmat4& a, const bvhmat4& b ) +{ + bvhmat4 r; + for (uint32_t i = 0; i < 16; i += 4) for (uint32_t j = 0; j < 4; ++j) + r[i + j] = (a[i + 0] * b[j + 0]) + (a[i + 1] * b[j + 4]) + + (a[i + 2] * b[j + 8]) + (a[i + 3] * b[j + 12]); + return r; +} +bvhvec4::bvhvec4( const bvhvec3& a ) { x = a.x; y = a.y; z = a.z; w = 0; } +bvhvec4::bvhvec4( const bvhvec3& a, float b ) { x = a.x; y = a.y; z = a.z; w = b; } + +#endif + +bvhvec4slice::bvhvec4slice( const bvhvec4* data, uint32_t count, uint32_t stride ) : + data{ reinterpret_cast(data) }, + count{ count }, stride{ stride } { +} + +const bvhvec4& bvhvec4slice::operator[]( size_t i ) const +{ +#ifdef PARANOID + BVH_FATAL_ERROR_IF( i >= count, "bvhvec4slice::[..], Reading outside slice." ); +#endif + return *reinterpret_cast(data + stride * i); +} + +void* BVHBase::AlignedAlloc( size_t size ) +{ + return context.malloc ? context.malloc( size, context.userdata ) : nullptr; +} + +void BVHBase::AlignedFree( void* ptr ) +{ + if (context.free) + context.free( ptr, context.userdata ); +} + +void BVHBase::CopyBasePropertiesFrom( const BVHBase& original ) +{ + this->rebuildable = original.rebuildable; + this->refittable = original.refittable; + this->may_have_holes = original.may_have_holes; + this->bvh_over_aabbs = original.bvh_over_aabbs; + this->bvh_over_indices = original.bvh_over_indices; + this->context = original.context; + this->triCount = original.triCount; + this->idxCount = original.idxCount; + this->c_int = original.c_int, this->c_trav = original.c_trav; + this->aabbMin = original.aabbMin, this->aabbMax = original.aabbMax; +} + +// BVH implementation +// ---------------------------------------------------------------------------- + +// static variable declarations +#ifdef BVH_USEAVX +__m128 BVH::half4 = _mm_set1_ps( 0.5f ); +__m128 BVH::two4 = _mm_set1_ps( 2.0f ), BVH::min1 = _mm_set1_ps( -1 ); +__m128i BVH::maxbin4 = _mm_set1_epi32( 7 ); +__m128 BVH::mask3 = _mm_cmpeq_ps( _mm_setr_ps( 0, 0, 0, 1 ), _mm_setzero_ps() ); +__m128 BVH::binmul3 = _mm_set1_ps( AVXBINS * 0.49999f ); +__m256 BVH::max8 = _mm256_set1_ps( -BVH_FAR ), BVH::mask6 = _mm256_set_m128( mask3, mask3 ); +__m256 BVH::signFlip8 = _mm256_setr_ps( -0.0f, -0.0f, -0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f ); +#endif + +BVH::~BVH() +{ + AlignedFree( bvhNode ); + AlignedFree( primIdx ); + AlignedFree( fragment ); +} + +void BVH::Save( const char* fileName ) +{ + // saving is easy, it's the loadingn that will be complex. + std::fstream s{ fileName, s.binary | s.out }; + uint32_t header = TINY_BVH_CACHE_VERSION /* 16 bit */ + (layout << 24); + s.write( (char*)&header, sizeof( uint32_t ) ); + s.write( (char*)&triCount, sizeof( uint32_t ) ); + s.write( (char*)this, sizeof( BVH ) ); + s.write( (char*)bvhNode, usedNodes * sizeof( BVHNode ) ); + s.write( (char*)primIdx, idxCount * sizeof( uint32_t ) ); +} + +bool BVH::Load( const char* fileName, const bvhvec4* vertices, const uint32_t primCount ) +{ + return Load( fileName, bvhvec4slice{ vertices, primCount * 3, sizeof( bvhvec4 ) } ); +} + +bool BVH::Load( const char* fileName, const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ) +{ + return Load( fileName, bvhvec4slice{ vertices, primCount * 3, sizeof( bvhvec4 ) }, indices, primCount ); +} + +bool BVH::Load( const char* fileName, const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ) +{ + // open file and check contents + std::fstream s{ fileName, s.binary | s.in }; + if (!s) return false; + BVHContext tmp = context; + bool expectIndexed = (indices != nullptr), saveNewVersion = false; + uint32_t header, fileTriCount; + s.read( (char*)&header, sizeof( uint32_t ) ); + if ((header >> 24) != layout) return false; + if ((header & 0xffffff) != TINY_BVH_CACHE_VERSION) return false; + s.read( (char*)&fileTriCount, sizeof( uint32_t ) ); + if (expectIndexed && fileTriCount != primCount) return false; + if (!expectIndexed && fileTriCount != vertices.count / 3) return false; + // all checks passed; safe to overwrite *this + s.read( (char*)this, sizeof( BVH ) ); + bool fileIsIndexed = vertIdx != nullptr; + if (expectIndexed != fileIsIndexed) return false; // not what we expected. + if (blasList != nullptr || instList != nullptr) return false; // can't load/save TLAS. + context = tmp; // can't load context; function pointers will differ. + bvhNode = (BVHNode*)AlignedAlloc( allocatedNodes * sizeof( BVHNode ) ); + primIdx = (uint32_t*)AlignedAlloc( idxCount * sizeof( uint32_t ) ); + fragment = 0; // no need for this in a BVH that can't be rebuilt. + s.read( (char*)bvhNode, usedNodes * sizeof( BVHNode ) ); + s.read( (char*)primIdx, idxCount * sizeof( uint32_t ) ); + verts = vertices; // we can't load vertices since the BVH doesn't own this data. + vertIdx = (uint32_t*)indices; + // all ok. + if (saveNewVersion) Save( fileName ); + return true; +} + +void BVH::BuildDefault( const bvhvec4* vertices, const uint32_t primCount ) +{ + // access point for builds over a raw list of vertices. The stride of + // the vertex data must be 16 bytes. + // The list will be encapsulated in a 'slice'. The slice can also be used + // directly to provide data with a different stride, which enables use of + // vertex buffers created for rasterization. + BuildDefault( bvhvec4slice{ vertices, primCount * 3, sizeof( bvhvec4 ) } ); +} + +void BVH::BuildDefault( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ) +{ + // access point for builders over an indexed list of raw vertices. + BuildDefault( bvhvec4slice{ vertices, primCount * 3, sizeof( bvhvec4 ) }, indices, primCount ); +} + +void BVH::BuildDefault( const bvhvec4slice& vertices ) +{ + // default builder: used internally when constructing a BVH layout requires + // a regular BVH. Currently, this is the case for all of them. +#if defined BVH_USEAVX + // if AVX is supported, BuildAVX is the optimal option. Tree quality is + // identical to the reference builder, but speed is much better. + BuildAVX( vertices ); +#elif defined BVH_USENEON + BuildNEON( vertices ); +#else + // fallback option, in case neither AVX or NEON is not supported: the reference + // builder, which should work on all platforms. + Build( vertices ); +#endif +} + +void BVH::BuildDefault( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ) +{ + // default builder for indexed vertices. See notes above. +#if defined BVH_USEAVX + BuildAVX( vertices, indices, primCount ); +#elif defined BVH_USENEON + BuildNEON( vertices, indices, primCount ); +#else + Build( vertices, indices, primCount ); +#endif +} + +void BVH::ConvertFrom( const BVH_Verbose& original, bool compact ) +{ + // allocate space + const uint32_t spaceNeeded = compact ? original.usedNodes : original.allocatedNodes; + if (allocatedNodes < spaceNeeded) + { + AlignedFree( bvhNode ); + bvhNode = (BVHNode*)AlignedAlloc( triCount * 2 * sizeof( BVHNode ) ); + allocatedNodes = spaceNeeded; + } + memset( bvhNode, 0, sizeof( BVHNode ) * spaceNeeded ); + CopyBasePropertiesFrom( original ); + this->verts = original.verts; + this->primIdx = original.primIdx; + // start conversion + uint32_t srcNodeIdx = 0, dstNodeIdx = 0; + newNodePtr = 2; + uint32_t srcStack[1024], dstStack[1024], stackPtr = 0; + while (1) + { + const BVH_Verbose::BVHNode& orig = original.bvhNode[srcNodeIdx]; + bvhNode[dstNodeIdx].aabbMin = orig.aabbMin; + bvhNode[dstNodeIdx].aabbMax = orig.aabbMax; + if (orig.isLeaf()) + { + bvhNode[dstNodeIdx].triCount = orig.triCount; + bvhNode[dstNodeIdx].leftFirst = orig.firstTri; + if (stackPtr == 0) break; + srcNodeIdx = srcStack[--stackPtr]; + dstNodeIdx = dstStack[stackPtr]; + } + else + { + bvhNode[dstNodeIdx].leftFirst = newNodePtr; + uint32_t srcRightIdx = orig.right; + srcNodeIdx = orig.left, dstNodeIdx = newNodePtr++; + srcStack[stackPtr] = srcRightIdx; + dstStack[stackPtr++] = newNodePtr++; + } + } + usedNodes = original.usedNodes; +} + +float BVH::SAHCost( const uint32_t nodeIdx ) const +{ + // Determine the SAH cost of the tree. This provides an indication + // of the quality of the BVH: Lower is better. + const BVHNode& n = bvhNode[nodeIdx]; + if (n.isLeaf()) return c_int * n.SurfaceArea() * n.triCount; + float cost = c_trav * n.SurfaceArea() + SAHCost( n.leftFirst ) + SAHCost( n.leftFirst + 1 ); + return nodeIdx == 0 ? (cost / n.SurfaceArea()) : cost; +} + +float BVH::PrimArea( const uint32_t p ) const +{ + uint32_t vidx = primIdx[p] * 3; + bvhvec3 v0, v1, v2; + if (vertIdx) v0 = verts[vertIdx[vidx]], v1 = verts[vertIdx[vidx + 1]], v2 = verts[vertIdx[vidx + 2]]; + else v0 = verts[vidx], v1 = verts[vidx + 1], v2 = verts[vidx + 2]; + return 0.5f * tinybvh_length( tinybvh_cross( v1 - v0, v2 - v0 ) ); +} + +float BVH::EPOArea( const uint32_t subtreeRoot, const uint32_t nodeIdx ) const +{ + // abort if we reached the subtree + if (nodeIdx == subtreeRoot) return 0; + const BVHNode& n = bvhNode[nodeIdx]; + const BVHNode& subtree = bvhNode[subtreeRoot]; + // handle case where n is a leaf node + float area = 0; + if (n.isLeaf()) + { + // clip triangles to AABB of subtreeRoot and sum resulting areas + const bvhvec3 bmin = subtree.aabbMin, bmax = subtree.aabbMax; + for (unsigned i = 0; i < n.triCount; i++) + { + // Sutherland-Hodgeman against six bounding planes + uint32_t Nin = 3, vidx = primIdx[n.leftFirst + i] * 3; + bvhvec3 vin[10], vout[10], C; + if (vertIdx) + vin[0] = verts[vertIdx[vidx]], vin[1] = verts[vertIdx[vidx + 1]], vin[2] = verts[vertIdx[vidx + 2]]; + else + vin[0] = verts[vidx], vin[1] = verts[vidx + 1], vin[2] = verts[vidx + 2]; + for (uint32_t a = 0; a < 3; a++) + { + uint32_t Nout = 0; + const float l = bmin[a], r = bmax[a]; + for (uint32_t v = 0; v < Nin; v++) + { + bvhvec3 v0 = vin[v], v1 = vin[(v + 1) % Nin]; + const bool v0in = v0[a] >= l, v1in = v1[a] >= l; + if (!(v0in || v1in)) continue; else if (v0in ^ v1in) + C = v0 + (l - v0[a]) / (v1[a] - v0[a]) * (v1 - v0), + C[a] = l /* accurate */, vout[Nout++] = C; + if (v1in) vout[Nout++] = v1; + } + Nin = 0; + for (uint32_t v = 0; v < Nout; v++) + { + bvhvec3 v0 = vout[v], v1 = vout[(v + 1) % Nout]; + const bool v0in = v0[a] <= r, v1in = v1[a] <= r; + if (!(v0in || v1in)) continue; else if (v0in ^ v1in) + C = v0 + (r - v0[a]) / (v1[a] - v0[a]) * (v1 - v0), + C[a] = r /* accurate */, vin[Nin++] = C; + if (v1in) vin[Nin++] = v1; + } + } + if (Nin < 3) continue; + // calculate area of remaining convex shape in vin + const uint32_t tris = Nin - 2; + bvhvec3 v0 = vin[0], v1, v2; + for (uint32_t j = 0; j < tris; j++) + v1 = vin[j + 1], v2 = vin[j + 2], + area += 0.5f * tinybvh_length( tinybvh_cross( v1 - v0, v2 - v0 ) ); + } + return area; + } + // recurse if n is an inner node + BVHNode& left = bvhNode[n.leftFirst], & right = bvhNode[n.leftFirst + 1]; + if (tinybvh_aabbs_overlap( left.aabbMin, left.aabbMax, subtree.aabbMin, subtree.aabbMax )) + area += EPOArea( subtreeRoot, n.leftFirst ); + if (tinybvh_aabbs_overlap( right.aabbMin, right.aabbMax, subtree.aabbMin, subtree.aabbMax )) + area += EPOArea( subtreeRoot, n.leftFirst + 1 ); + return area; +} + +float BVH::EPOCost( const uint32_t nodeIdx ) const +{ + // Determine the EPO cost of the tree. See: + // "On Quality Metrics of Bounding Volume Hierarchies", Aila et al., 2013. + const BVHNode& n = bvhNode[nodeIdx]; + float area = EPOArea( nodeIdx ); + float cost = (n.isLeaf() ? (c_int * n.triCount) : c_trav) * area; + if (!n.isLeaf()) cost += EPOCost( n.leftFirst ) + EPOCost( n.leftFirst + 1 ); + if (nodeIdx > 0) return cost; + // recursion ends with node 0: Finalize EPO calculation + float totalArea = 0; + for (unsigned i = 0; i < triCount; i++) totalArea += PrimArea( i ); + cost /= totalArea; + return (1.0f - W_EPO) * SAHCost( 0 ) + W_EPO * cost; +} + +void BVH::SplitLeafs( const uint32_t maxPrims ) +{ + uint32_t stack[64], stackPtr = 0, nodeIdx = 0; + while (1) + { + BVHNode& node = bvhNode[nodeIdx]; + if (node.isLeaf()) + { + if (node.triCount > maxPrims) + { + BVHNode& left = bvhNode[newNodePtr], & right = bvhNode[newNodePtr + 1]; + left = node, right = node; + right.leftFirst = node.leftFirst + maxPrims; + right.triCount = node.triCount - maxPrims; + left.triCount = maxPrims, node.leftFirst = newNodePtr, node.triCount = 0, newNodePtr += 2; + } + else + { + if (!stackPtr) break; + nodeIdx = stack[--stackPtr]; + } + } + else + { + nodeIdx = node.leftFirst; + stack[stackPtr++] = node.leftFirst + 1; + } + } + usedNodes = newNodePtr; +} + +int32_t BVH::PrimCount( const uint32_t nodeIdx ) const +{ + // Determine the total number of primitives / fragments in leaf nodes. + const BVHNode& n = bvhNode[nodeIdx]; + return n.isLeaf() ? n.triCount : (PrimCount( n.leftFirst ) + PrimCount( n.leftFirst + 1 )); +} + +// Basic single-function BVH builder, using mid-point splits. +// This builder yields a correct BVH in little time, but the quality of the +// structure will be low. Use this only if build time is the bottleneck in +// your application, e.g., when you need to trace few rays. +void BVH::BuildQuick( const bvhvec4* vertices, const uint32_t primCount ) +{ + // build the BVH with a continuous array of bvhvec4 vertices: + // in this case, the stride for the slice is 16 bytes. + BuildQuick( bvhvec4slice{ vertices, primCount * 3, sizeof( bvhvec4 ) } ); +} + +void BVH::BuildQuick( const bvhvec4slice& vertices ) +{ + BVH_FATAL_ERROR_IF( vertices.count == 0, "BVH::BuildQuick( .. ), primCount == 0." ); + // allocate on first build + const uint32_t primCount = vertices.count / 3; + const uint32_t spaceNeeded = primCount * 2; // upper limit + if (allocatedNodes < spaceNeeded) + { + AlignedFree( bvhNode ); + AlignedFree( primIdx ); + AlignedFree( fragment ); + bvhNode = (BVHNode*)AlignedAlloc( spaceNeeded * sizeof( BVHNode ) ); + allocatedNodes = spaceNeeded; + memset( &bvhNode[1], 0, 32 ); // node 1 remains unused, for cache line alignment. + primIdx = (uint32_t*)AlignedAlloc( primCount * sizeof( uint32_t ) ); + fragment = (Fragment*)AlignedAlloc( primCount * sizeof( Fragment ) ); + } + else BVH_FATAL_ERROR_IF( !rebuildable, "BVH::BuildQuick( .. ), bvh not rebuildable." ); + verts = vertices; // note: we're not copying this data; don't delete. + idxCount = triCount = primCount; + // reset node pool + newNodePtr = 2; + // assign all triangles to the root node + BVHNode& root = bvhNode[0]; + root.leftFirst = 0, root.triCount = triCount, root.aabbMin = bvhvec3( BVH_FAR ), root.aabbMax = bvhvec3( -BVH_FAR ); + // initialize fragments and initialize root node bounds + for (uint32_t i = 0; i < triCount; i++) + { + fragment[i].bmin = tinybvh_min( tinybvh_min( verts[i * 3], verts[i * 3 + 1] ), verts[i * 3 + 2] ); + fragment[i].bmax = tinybvh_max( tinybvh_max( verts[i * 3], verts[i * 3 + 1] ), verts[i * 3 + 2] ); + root.aabbMin = tinybvh_min( root.aabbMin, fragment[i].bmin ); + root.aabbMax = tinybvh_max( root.aabbMax, fragment[i].bmax ), primIdx[i] = i; + } + // subdivide recursively + uint32_t task[256], taskCount = 0, nodeIdx = 0; + while (1) + { + while (1) + { + BVHNode& node = bvhNode[nodeIdx]; + // in-place partition against midpoint on longest axis + uint32_t j = node.leftFirst + node.triCount, src = node.leftFirst; + bvhvec3 extent = node.aabbMax - node.aabbMin; + uint32_t axis = 0; + if (extent.y > extent.x && extent.y > extent.z) axis = 1; + if (extent.z > extent.x && extent.z > extent.y) axis = 2; + float splitPos = node.aabbMin[axis] + extent[axis] * 0.5f, centroid; + bvhvec3 lbmin( BVH_FAR ), lbmax( -BVH_FAR ), rbmin( BVH_FAR ), rbmax( -BVH_FAR ), fmin, fmax; + for (uint32_t fi, i = 0; i < node.triCount; i++) + { + fi = primIdx[src], fmin = fragment[fi].bmin, fmax = fragment[fi].bmax; + centroid = (fmin[axis] + fmax[axis]) * 0.5f; + if (centroid < splitPos) + lbmin = tinybvh_min( lbmin, fmin ), lbmax = tinybvh_max( lbmax, fmax ), src++; + else + { + rbmin = tinybvh_min( rbmin, fmin ), rbmax = tinybvh_max( rbmax, fmax ); + tinybvh_swap( primIdx[src], primIdx[--j] ); + } + } + // create child nodes + const uint32_t leftCount = src - node.leftFirst, rightCount = node.triCount - leftCount; + if (leftCount == 0 || rightCount == 0 || taskCount == BVH_NUM_ELEMS( task )) break; // split did not work out. + const int32_t lci = newNodePtr++, rci = newNodePtr++; + bvhNode[lci].aabbMin = lbmin, bvhNode[lci].aabbMax = lbmax; + bvhNode[lci].leftFirst = node.leftFirst, bvhNode[lci].triCount = leftCount; + bvhNode[rci].aabbMin = rbmin, bvhNode[rci].aabbMax = rbmax; + bvhNode[rci].leftFirst = j, bvhNode[rci].triCount = rightCount; + node.leftFirst = lci, node.triCount = 0; + // recurse + task[taskCount++] = rci, nodeIdx = lci; + } + // fetch subdivision task from stack + if (taskCount == 0) break; else nodeIdx = task[--taskCount]; + } + // all done. + aabbMin = bvhNode[0].aabbMin, aabbMax = bvhNode[0].aabbMax; + refittable = true; // not using spatial splits: can refit this BVH + may_have_holes = false; // the reference builder produces a continuous list of nodes + usedNodes = newNodePtr; +} + +// Basic single-function binned-SAH-builder. +// This is the reference builder; it yields a decent tree suitable for ray tracing on the CPU. +// This code uses no SIMD instructions. Faster code, using SSE/AVX, is available for x64 CPUs. +// For GPU rendering: The resulting BVH should be converted to a more optimal +// format after construction, e.g. BVH_GPU, BVH4_GPU or BVH8_CWBVH. +void BVH::Build( const bvhvec4* vertices, const uint32_t prims ) +{ + // build the BVH with a continuous array of bvhvec4 vertices: + // in this case, the stride for the slice is 16 bytes. + Build( bvhvec4slice{ vertices, prims * 3, sizeof( bvhvec4 ) } ); +} + +void BVH::Build( const bvhvec4slice& vertices ) +{ + // build the BVH from vertices stored in a slice. + PrepareBuild( vertices, 0, 0 /* empty index list; primcount is derived from slice */ ); + if (useFullSweep) BuildFullSweep(); else Build(); +} + +void BVH::Build( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ) +{ + // build the BVH with a continuous array of bvhvec4 vertices, indexed by 'indices'. + Build( bvhvec4slice{ vertices, prims * 3, sizeof( bvhvec4 ) }, indices, prims ); +} + +void BVH::Build( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ) +{ + // build the BVH from vertices stored in a slice, indexed by 'indices'. + PrepareBuild( vertices, indices, prims ); + if (useFullSweep) BuildFullSweep(); else Build(); +} + +void BVH::Build( void (*customGetAABB)(const unsigned, bvhvec3&, bvhvec3&), const uint32_t primCount ) +{ + BVH_FATAL_ERROR_IF( primCount == 0, "BVH::Build( void (*customGetAABB)( .. ), instCount ), instCount == 0." ); + triCount = idxCount = primCount; + const uint32_t spaceNeeded = primCount * 2; // upper limit + if (allocatedNodes < spaceNeeded) + { + AlignedFree( bvhNode ); + AlignedFree( primIdx ); + AlignedFree( fragment ); + bvhNode = (BVHNode*)AlignedAlloc( spaceNeeded * sizeof( BVHNode ) ); + allocatedNodes = spaceNeeded; + memset( &bvhNode[1], 0, 32 ); // node 1 remains unused, for cache line alignment. + primIdx = (uint32_t*)AlignedAlloc( primCount * sizeof( uint32_t ) ); + fragment = (Fragment*)AlignedAlloc( primCount * sizeof( Fragment ) ); + } + // copy relevant data from instance array + BVHNode& root = bvhNode[0]; + root.leftFirst = 0, root.triCount = primCount, root.aabbMin = bvhvec3( BVH_FAR ), root.aabbMax = bvhvec3( -BVH_FAR ); + for (uint32_t i = 0; i < primCount; i++) + { + customGetAABB( i, fragment[i].bmin, fragment[i].bmax ); + fragment[i].primIdx = i, fragment[i].clipped = 0, primIdx[i] = i; + root.aabbMin = tinybvh_min( root.aabbMin, fragment[i].bmin ); + root.aabbMax = tinybvh_max( root.aabbMax, fragment[i].bmax ); + } + // start build + newNodePtr = 2; + Build(); // or BuildAVX, for large TLAS. +} + +void BVH::Build( BLASInstance* instances, const uint32_t instCount, BVHBase** blasses, const uint32_t bCount ) +{ + BVH_FATAL_ERROR_IF( instCount == 0, "BVH::Build( BLASInstance*, instCount ), instCount == 0." ); + triCount = idxCount = instCount; + const uint32_t spaceNeeded = instCount * 2; // upper limit + if (allocatedNodes < spaceNeeded) + { + AlignedFree( bvhNode ); + AlignedFree( primIdx ); + AlignedFree( fragment ); + bvhNode = (BVHNode*)AlignedAlloc( spaceNeeded * sizeof( BVHNode ) ); + allocatedNodes = spaceNeeded; + memset( &bvhNode[1], 0, 32 ); // node 1 remains unused, for cache line alignment. + primIdx = (uint32_t*)AlignedAlloc( instCount * sizeof( uint32_t ) ); + fragment = (Fragment*)AlignedAlloc( instCount * sizeof( Fragment ) ); + } + instList = instances; + blasList = blasses; + blasCount = bCount; + // copy relevant data from instance array + BVHNode& root = bvhNode[0]; + root.leftFirst = 0, root.triCount = instCount, root.aabbMin = bvhvec3( BVH_FAR ), root.aabbMax = bvhvec3( -BVH_FAR ); + for (uint32_t i = 0; i < instCount; i++) + { + if (blasList) // if a null pointer is passed, we'll assume the BLASInstances have been updated elsewhere. + { + uint32_t blasIdx = instList[i].blasIdx; + BVH* blas = (BVH*)blasList[blasIdx]; + instList[i].Update( blas ); + } + fragment[i].bmin = instList[i].aabbMin, fragment[i].primIdx = i; + fragment[i].bmax = instList[i].aabbMax, fragment[i].clipped = 0; + root.aabbMin = tinybvh_min( root.aabbMin, instList[i].aabbMin ); + root.aabbMax = tinybvh_max( root.aabbMax, instList[i].aabbMax ), primIdx[i] = i; + } + // start build + newNodePtr = 2; + Build(); // or BuildAVX, for large TLAS. +} + +void BVH::PrepareBuild( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t prims ) +{ +#ifdef SLICEDUMP + // this code dumps the passed geometry data to a file - for debugging only. + std::fstream df{ "dump.bin", df.binary | df.out }; + uint32_t vcount = vertices.count, indexed = indices == 0 ? 0 : 1, stride = vertices.stride; + uint32_t pcount = indices ? prims : (vertices.count / 3); + df.write( (char*)&pcount, 4 ); + df.write( (char*)&vcount, 4 ); + df.write( (char*)&stride, 4 ); + df.write( (char*)&indexed, sizeof( uint32_t ) ); + df.write( (char*)vertices.data, vertices.stride * vertices.count ); + if (indexed) df.write( (char*)indices, prims * 3 * 4 ); +#endif + uint32_t primCount = prims > 0 ? prims : vertices.count / 3; + const uint32_t spaceNeeded = primCount * 2; // upper limit + // allocate memory on first build + if (allocatedNodes < spaceNeeded) + { + AlignedFree( bvhNode ); + AlignedFree( primIdx ); + AlignedFree( fragment ); + bvhNode = (BVHNode*)AlignedAlloc( spaceNeeded * sizeof( BVHNode ) ); + allocatedNodes = spaceNeeded; + memset( &bvhNode[1], 0, 32 ); // node 1 remains unused, for cache line alignment. + primIdx = (uint32_t*)AlignedAlloc( primCount * sizeof( uint32_t ) ); + if (vertices) fragment = (Fragment*)AlignedAlloc( primCount * sizeof( Fragment ) ); + else BVH_FATAL_ERROR_IF( fragment == 0, "BVH::PrepareBuild( 0, .. ), not called from ::Build( aabb )." ); + } + else BVH_FATAL_ERROR_IF( !rebuildable, "BVH::PrepareBuild( .. ), bvh not rebuildable." ); + verts = vertices, idxCount = triCount = primCount, vertIdx = (uint32_t*)indices; + // prepare fragments + BVH_FATAL_ERROR_IF( vertices.count == 0, "BVH::PrepareBuild( .. ), empty vertex slice." ); + BVHNode& root = bvhNode[0]; + root.leftFirst = 0, root.triCount = triCount, root.aabbMin = bvhvec3( BVH_FAR ), root.aabbMax = bvhvec3( -BVH_FAR ); + if (!indices) + { + BVH_FATAL_ERROR_IF( prims != 0, "BVH::PrepareBuild( .. ), indices == 0." ); + // building a BVH over triangles specified as three 16-byte vertices each. + for (uint32_t i = 0; i < triCount; i++) + { + const bvhvec4 v0 = verts[i * 3], v1 = verts[i * 3 + 1], v2 = verts[i * 3 + 2]; + const bvhvec4 fmin = tinybvh_min( v0, tinybvh_min( v1, v2 ) ); + const bvhvec4 fmax = tinybvh_max( v0, tinybvh_max( v1, v2 ) ); + fragment[i].bmin = fmin, fragment[i].bmax = fmax, fragment[i].primIdx = i; + root.aabbMin = tinybvh_min( root.aabbMin, fragment[i].bmin ); + root.aabbMax = tinybvh_max( root.aabbMax, fragment[i].bmax ), primIdx[i] = i; + } + } + else + { + BVH_FATAL_ERROR_IF( prims == 0, "BVH::PrepareBuild( .. ), prims == 0." ); + // building a BVH over triangles consisting of vertices indexed by 'indices'. + for (uint32_t i = 0; i < triCount; i++) + { + const uint32_t i0 = indices[i * 3], i1 = indices[i * 3 + 1], i2 = indices[i * 3 + 2]; + const bvhvec4 v0 = verts[i0], v1 = verts[i1], v2 = verts[i2]; + const bvhvec4 fmin = tinybvh_min( v0, tinybvh_min( v1, v2 ) ); + const bvhvec4 fmax = tinybvh_max( v0, tinybvh_max( v1, v2 ) ); + fragment[i].bmin = fmin, fragment[i].bmax = fmax, fragment[i].primIdx = i; + root.aabbMin = tinybvh_min( root.aabbMin, fragment[i].bmin ); + root.aabbMax = tinybvh_max( root.aabbMax, fragment[i].bmax ), primIdx[i] = i; + } + } + // reset node pool + newNodePtr = 2; + bvh_over_indices = indices != nullptr; + // all set; actual build happens in BVH::Build. +} + +void Build_( uint32_t nodeIdx, uint32_t depth, BVH* bvh ) { bvh->Build( nodeIdx, depth ); } +void BVH::Build( uint32_t nodeIdx, uint32_t depth ) +{ + // avoid threaded building for small meshes: not efficient; build multiple in parallel instead. + if (depth == 0) + { + #ifdef NO_THREADED_BUILDS + threadedBuild = false; + #else + if (triCount < MT_BUILD_THRESHOLD) threadedBuild = false; else + { + atomicNewNodePtr = new std::atomic( newNodePtr ); + } + #endif + } + // subdivide root node recursively + uint32_t task[256], taskCount = 0; + BVHNode& root = bvhNode[0]; + bvhvec3 minDim = (root.aabbMax - root.aabbMin) * 1e-20f; + bvhvec3 bestLMin( 0 ), bestLMax( 0 ), bestRMin( 0 ), bestRMax( 0 ); + while (1) + { + while (1) + { + BVHNode& node = bvhNode[nodeIdx]; + // find optimal object split + bvhvec3 binMin[3][BVHBINS], binMax[3][BVHBINS]; + for (uint32_t a = 0; a < 3; a++) for (uint32_t i = 0; i < BVHBINS; i++) + binMin[a][i] = bvhvec3( BVH_FAR ), binMax[a][i] = bvhvec3( -BVH_FAR ); + uint32_t count[3][BVHBINS]; + memset( count, 0, BVHBINS * 3 * sizeof( uint32_t ) ); + const bvhvec3 rpd3 = bvhvec3( bvhvec3( BVHBINS ) / (node.aabbMax - node.aabbMin) ), nmin3 = node.aabbMin; + for (uint32_t i = 0; i < node.triCount; i++) // process all tris for x,y and z at once + { + const uint32_t fi = primIdx[node.leftFirst + i]; + bvhint3 bi = bvhint3( ((fragment[fi].bmin + fragment[fi].bmax) * 0.5f - nmin3) * rpd3 ); + bi.x = tinybvh_clamp( bi.x, 0, BVHBINS - 1 ); + bi.y = tinybvh_clamp( bi.y, 0, BVHBINS - 1 ); + bi.z = tinybvh_clamp( bi.z, 0, BVHBINS - 1 ); + binMin[0][bi.x] = tinybvh_min( binMin[0][bi.x], fragment[fi].bmin ); + binMax[0][bi.x] = tinybvh_max( binMax[0][bi.x], fragment[fi].bmax ), count[0][bi.x]++; + binMin[1][bi.y] = tinybvh_min( binMin[1][bi.y], fragment[fi].bmin ); + binMax[1][bi.y] = tinybvh_max( binMax[1][bi.y], fragment[fi].bmax ), count[1][bi.y]++; + binMin[2][bi.z] = tinybvh_min( binMin[2][bi.z], fragment[fi].bmin ); + binMax[2][bi.z] = tinybvh_max( binMax[2][bi.z], fragment[fi].bmax ), count[2][bi.z]++; + } + // calculate per-split totals + float splitCost = BVH_FAR, rSAV = 1.0f / node.SurfaceArea(); + uint32_t bestAxis = 0, bestPos = 0; + for (int32_t a = 0; a < 3; a++) if ((node.aabbMax[a] - node.aabbMin[a]) > minDim[a]) + { + bvhvec3 lBMin[BVHBINS - 1], rBMin[BVHBINS - 1], l1( BVH_FAR ), l2( -BVH_FAR ); + bvhvec3 lBMax[BVHBINS - 1], rBMax[BVHBINS - 1], r1( BVH_FAR ), r2( -BVH_FAR ); + float ANL[BVHBINS - 1], ANR[BVHBINS - 1]; + for (uint32_t lN = 0, rN = 0, i = 0; i < BVHBINS - 1; i++) + { + lBMin[i] = l1 = tinybvh_min( l1, binMin[a][i] ); + rBMin[BVHBINS - 2 - i] = r1 = tinybvh_min( r1, binMin[a][BVHBINS - 1 - i] ); + lBMax[i] = l2 = tinybvh_max( l2, binMax[a][i] ); + rBMax[BVHBINS - 2 - i] = r2 = tinybvh_max( r2, binMax[a][BVHBINS - 1 - i] ); + lN += count[a][i], rN += count[a][BVHBINS - 1 - i]; + ANL[i] = lN == 0 ? BVH_FAR : (tinybvh_half_area( l2 - l1 ) * (float)lN); + ANR[BVHBINS - 2 - i] = rN == 0 ? BVH_FAR : (tinybvh_half_area( r2 - r1 ) * (float)rN); + } + // evaluate bin totals to find best position for object split + for (uint32_t i = 0; i < BVHBINS - 1; i++) + { + const float C = ANL[i] + ANR[i]; + if (C < splitCost) + { + splitCost = C, bestAxis = a, bestPos = i; + bestLMin = lBMin[i], bestRMin = rBMin[i], bestLMax = lBMax[i], bestRMax = rBMax[i]; + } + } + } + splitCost = c_trav + c_int * rSAV * splitCost; + float noSplitCost = (float)node.triCount * c_int; + if (splitCost >= noSplitCost) + { + if (node.triCount > 512) printf( "Warning: failed to split large node (%i tris).\n", node.triCount ); + break; // not splitting is better. + } + // in-place partition + uint32_t j = node.leftFirst + node.triCount, src = node.leftFirst; + const float rpd = rpd3[bestAxis], nmin = nmin3[bestAxis]; + for (uint32_t i = 0; i < node.triCount; i++) + { + const uint32_t fi = primIdx[src]; + int32_t bi = (uint32_t)(((fragment[fi].bmin[bestAxis] + fragment[fi].bmax[bestAxis]) * 0.5f - nmin) * rpd); + bi = tinybvh_clamp( bi, 0, BVHBINS - 1 ); + if ((uint32_t)bi <= bestPos) src++; else tinybvh_swap( primIdx[src], primIdx[--j] ); + } + // create child nodes + uint32_t leftCount = src - node.leftFirst, rightCount = node.triCount - leftCount; + if (leftCount == 0 || rightCount == 0 || taskCount == BVH_NUM_ELEMS( task )) break; // should not happen. + int32_t n; + if (threadedBuild) n = atomicNewNodePtr->fetch_add( 2 ); else n = newNodePtr, newNodePtr += 2; + bvhNode[n].aabbMin = bestLMin, bvhNode[n].aabbMax = bestLMax; + bvhNode[n].leftFirst = node.leftFirst, bvhNode[n].triCount = leftCount; + bvhNode[n + 1].aabbMin = bestRMin, bvhNode[n + 1].aabbMax = bestRMax; + bvhNode[n + 1].leftFirst = j, bvhNode[n + 1].triCount = rightCount; + node.leftFirst = n, node.triCount = 0; + if (depth < 5 && threadedBuild) + { + std::thread t1( &Build_, n, depth + 1, this ); + std::thread t2( &Build_, n + 1, depth + 1, this ); + t1.join(); + t2.join(); // TODO: join is only needed in the 'all done' section below. + break; + } + task[taskCount++] = n + 1, nodeIdx = n; + } + // fetch subdivision task from stack + if (taskCount == 0) break; else nodeIdx = task[--taskCount]; + } + // all done. + if (depth == 0) + { + if (threadedBuild) + { + newNodePtr = atomicNewNodePtr->load(); + delete atomicNewNodePtr; + atomicNewNodePtr = 0; + } + usedNodes = newNodePtr; + aabbMin = bvhNode[0].aabbMin, aabbMax = bvhNode[0].aabbMax; + refittable = true; // not using spatial splits: can refit this BVH + may_have_holes = false; // the reference builder produces a continuous list of nodes + bvh_over_aabbs = (verts == 0); // bvh over aabbs is suitable as TLAS + } +} + +// Full-sweep SAH builder. +// Instead of using binning, this builder evaluates all possible split plane +// candidates for each axis. Not efficient; e.g. sorting for each split can +// be prevented. +void BuildFullSweep_( uint32_t n, uint32_t d, BVH* bvh ) { bvh->BuildFullSweep( n, d ); } +void BVH::BuildFullSweep( uint32_t nodeIdx, uint32_t depth ) +{ + if (depth == 0) + { + // allocate data for O(N) stable partition + flag = (uint8_t*)AlignedAlloc( triCount ); + tmp = (uint32_t*)AlignedAlloc( triCount * 4 ); + for (int a = 0; a < 3; a++) sortedIdx[a] = (uint32_t*)AlignedAlloc( triCount * 4 ); + BVH* thisBVH = this; + for (uint32_t a = 0; a < 3; a++) + RadixSort( primIdx, sortedIdx[a], triCount, [=]( int index ) { + return FloatToKey( thisBVH->fragment[index].bmin[a] + thisBVH->fragment[index].bmax[a] ); + } ); + // allocate space for right sweep + SARs = (float*)AlignedAlloc( triCount * sizeof( float ) ); + // prepare threading + #ifdef NO_THREADED_BUILDS + threadedBuild = false; + #else + if (triCount < MT_BUILD_THRESHOLD) threadedBuild = false; else + { + atomicNewNodePtr = new std::atomic( newNodePtr ); + } + #endif + } + // subdivide root node recursively + uint32_t task[256], taskCount = 0; + bvhvec3 minDim = (bvhNode->aabbMax - bvhNode->aabbMin) * 1e-20f; + while (1) + { + while (1) + { + BVHNode& node = bvhNode[nodeIdx]; + // update node bounds + node.aabbMin = bvhvec3( BVH_FAR ), node.aabbMax = bvhvec3( -BVH_FAR ); + for (uint32_t i = 0; i < node.triCount; i++) + { + const uint32_t fi = sortedIdx[0][node.leftFirst + i]; + node.aabbMin = tinybvh_min( node.aabbMin, fragment[fi].bmin ); + node.aabbMax = tinybvh_max( node.aabbMax, fragment[fi].bmax ); + } + if (node.triCount == 1) break; // can't split one triangle. + const float rSAV = 1.0f / node.SurfaceArea(); + const bvhvec3 extent = node.aabbMax - node.aabbMin; + // iterate over x,y,z + float splitCost = (float)node.triCount; + uint32_t splitAxis = 0, splitPos = 0; + for (uint32_t a = 0; a < 3; a++) if (extent[a] > minDim[a]) + { + // sweep from right to left + bvhvec3 Rmin( BVH_FAR ), Rmax( -BVH_FAR ); + uint32_t firstRightTri = 1; + for (uint32_t i = 0; i < node.triCount; i++) + { + const uint32_t fi = sortedIdx[a][node.leftFirst + node.triCount - i - 1]; + const float SAR = (float)i * tinybvh_half_area( Rmax - Rmin ) * rSAV; + SARs[node.leftFirst + node.triCount - i - 1] = SAR; + Rmin = tinybvh_min( Rmin, fragment[fi].bmin ); + Rmax = tinybvh_max( Rmax, fragment[fi].bmax ); + if (SAR >= splitCost) + { + // Right side's cost is already greater than lowest cost and will only increase. Stop early + firstRightTri = node.triCount - i; + break; + } + } + // sweep from left to right + bvhvec3 Lmin( BVH_FAR ), Lmax( -BVH_FAR ); + for (uint32_t i = 0; i < firstRightTri - 1; i++) + { + const uint32_t fi = sortedIdx[a][node.leftFirst + i]; + Lmin = tinybvh_min( Lmin, fragment[fi].bmin ); + Lmax = tinybvh_max( Lmax, fragment[fi].bmax ); + } + for (uint32_t i = firstRightTri - 1; i < node.triCount - 1; i++) + { + const uint32_t fi = sortedIdx[a][node.leftFirst + i]; + Lmin = tinybvh_min( Lmin, fragment[fi].bmin ); + Lmax = tinybvh_max( Lmax, fragment[fi].bmax ); + const float SAL = (float)(i + 1) * tinybvh_half_area( Lmax - Lmin ) * rSAV; + const float C = SAL + SARs[node.leftFirst + i]; + if (C < splitCost) splitCost = C, splitPos = i + 1, splitAxis = a; + else if (SAL >= splitCost) break; + } + } + float noSplitCost = c_int * (float)node.triCount; + splitCost = c_trav + (c_int * splitCost); + if (splitCost >= noSplitCost) break; // not splitting turns out to be better. + // partition + for (uint32_t i = 0; i < splitPos; i++) flag[sortedIdx[splitAxis][node.leftFirst + i]] = 0; // "left" + for (uint32_t i = splitPos; i < node.triCount; i++) flag[sortedIdx[splitAxis][node.leftFirst + i]] = 1; // "right" + for (uint32_t a = 0; a < 3; a++) if (a != splitAxis) + { + int p0 = 0, p1 = 0; + for (uint32_t i = 0; i < node.triCount; i++) + { + const uint32_t fi = sortedIdx[a][node.leftFirst + i]; + if (flag[fi]) tmp[node.leftFirst + p1++] = fi; else sortedIdx[a][node.leftFirst + p0++] = fi; + } + memcpy( &sortedIdx[a][node.leftFirst + p0], tmp + node.leftFirst, p1 * 4 ); + } + // create child nodes + uint32_t leftCount = splitPos, rightCount = node.triCount - leftCount; + if (leftCount >= node.triCount || rightCount >= node.triCount || taskCount == BVH_NUM_ELEMS( task )) break; + memcpy( primIdx + node.leftFirst, sortedIdx[splitAxis] + node.leftFirst, node.triCount * 4 ); + int32_t n; + if (threadedBuild) n = atomicNewNodePtr->fetch_add( 2 ); else n = newNodePtr, newNodePtr += 2; + bvhNode[n].leftFirst = node.leftFirst; + bvhNode[n].triCount = leftCount; + bvhNode[n + 1].leftFirst = node.leftFirst + leftCount; + bvhNode[n + 1].triCount = rightCount; + node.leftFirst = n, node.triCount = 0; + if (leftCount + rightCount > 2000 && depth < 5 && threadedBuild) + { + std::thread t1( &BuildFullSweep_, n, depth + 1, this ); + std::thread t2( &BuildFullSweep_, n + 1, depth + 1, this ); + t1.join(); + t2.join(); // TODO: join is only needed in the 'all done' section below. + break; + } + // recurse + task[taskCount++] = n + 1, nodeIdx = n; + } + // fetch subdivision task from stack + if (taskCount == 0) break; else nodeIdx = task[--taskCount]; + } + // cleanup allocated buffers when done + if (depth == 0) + { + for (int a = 0; a < 3; a++) AlignedFree( sortedIdx[a] ); + AlignedFree( SARs ); + AlignedFree( flag ); + AlignedFree( tmp ); + aabbMin = bvhNode[0].aabbMin, aabbMax = bvhNode[0].aabbMax; + refittable = true; // not using spatial splits: can refit this BVH + may_have_holes = false; // this builder produces a continuous list of nodes + bvh_over_aabbs = (verts == 0); // bvh over aabbs is suitable as TLAS + if (threadedBuild) + { + newNodePtr = atomicNewNodePtr->load(); + delete atomicNewNodePtr; + atomicNewNodePtr = 0; + } + usedNodes = newNodePtr; + } +} + +// SBVH builder. +// Besides the regular object splits used in the reference builder, the SBVH +// algorithm also considers spatial splits, where primitives may be cut in +// multiple parts. This increases primitive count but may reduce overlap of +// BVH nodes. The cost of each option is considered per split. +// For typical geometry, SBVH yields a tree that can be traversed 25% faster. +// This comes at greatly increased construction cost, making the SBVH +// primarily useful for static geometry. +void BVH::BuildHQ( const bvhvec4* vertices, const uint32_t primCount ) +{ + BuildHQ( bvhvec4slice{ vertices, primCount * 3, sizeof( bvhvec4 ) } ); +} + +void BVH::BuildHQ( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ) +{ + // build the BVH with a continuous array of bvhvec4 vertices, indexed by 'indices'. + BuildHQ( bvhvec4slice{ vertices, prims * 3, sizeof( bvhvec4 ) }, indices, prims ); +} + +void BVH::BuildHQ( const bvhvec4slice& vertices ) +{ + PrepareHQBuild( vertices, 0, 0 ); + BuildHQ(); +} + +void BVH::BuildHQ( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ) +{ + // build the BVH from vertices stored in a slice, indexed by 'indices'. + PrepareHQBuild( vertices, indices, prims ); + BuildHQ(); +} + +void BVH::PrepareHQBuild( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t prims ) +{ + uint32_t primCount = prims > 0 ? prims : vertices.count / 3; + const uint32_t slack = primCount >> 1; // for split prims + const uint32_t spaceNeeded = primCount * 3; + // allocate memory on first build + if (allocatedNodes < spaceNeeded) + { + AlignedFree( bvhNode ); + AlignedFree( primIdx ); + AlignedFree( fragment ); + bvhNode = (BVHNode*)AlignedAlloc( spaceNeeded * sizeof( BVHNode ) ); + allocatedNodes = spaceNeeded; + memset( &bvhNode[1], 0, 32 ); // node 1 remains unused, for cache line alignment. + primIdx = (uint32_t*)AlignedAlloc( (primCount + slack) * sizeof( uint32_t ) ); + fragment = (Fragment*)AlignedAlloc( (primCount + slack) * sizeof( Fragment ) ); + } + else BVH_FATAL_ERROR_IF( !rebuildable, "BVH::PrepareHQBuild( .. ), bvh not rebuildable." ); + verts = vertices; // note: we're not copying this data; don't delete. + idxCount = primCount + slack, triCount = primCount, vertIdx = (uint32_t*)indices; + // prepare fragments + BVHNode& root = bvhNode[0]; + root.leftFirst = 0, root.triCount = triCount, root.aabbMin = bvhvec3( BVH_FAR ), root.aabbMax = bvhvec3( -BVH_FAR ); + if (!indices) + { + BVH_FATAL_ERROR_IF( vertices.count == 0, "BVH::PrepareHQBuild( .. ), primCount == 0." ); + BVH_FATAL_ERROR_IF( prims != 0, "BVH::PrepareHQBuild( .. ), indices == 0." ); + // building a BVH over triangles specified as three 16-byte vertices each. + for (uint32_t i = 0; i < triCount; i++) + { + const bvhvec4 v0 = verts[i * 3], v1 = verts[i * 3 + 1], v2 = verts[i * 3 + 2]; + const bvhvec4 fmin = tinybvh_min( v0, tinybvh_min( v1, v2 ) ); + const bvhvec4 fmax = tinybvh_max( v0, tinybvh_max( v1, v2 ) ); + fragment[i].bmin = fmin, fragment[i].bmax = fmax, fragment[i].primIdx = i, fragment[i].clipped = 0; + root.aabbMin = tinybvh_min( root.aabbMin, fragment[i].bmin ); + root.aabbMax = tinybvh_max( root.aabbMax, fragment[i].bmax ), primIdx[i] = i; + } + } + else + { + BVH_FATAL_ERROR_IF( vertices.count == 0, "BVH::PrepareHQBuild( .. ), empty vertex slice." ); + BVH_FATAL_ERROR_IF( prims == 0, "BVH::PrepareHQBuild( .. ), prims == 0." ); + // building a BVH over triangles consisting of vertices indexed by 'indices'. + for (uint32_t i = 0; i < triCount; i++) + { + const uint32_t i0 = indices[i * 3], i1 = indices[i * 3 + 1], i2 = indices[i * 3 + 2]; + const bvhvec4 v0 = verts[i0], v1 = verts[i1], v2 = verts[i2]; + const bvhvec4 fmin = tinybvh_min( v0, tinybvh_min( v1, v2 ) ); + const bvhvec4 fmax = tinybvh_max( v0, tinybvh_max( v1, v2 ) ); + fragment[i].bmin = fmin, fragment[i].bmax = fmax, fragment[i].primIdx = i, fragment[i].clipped = 0; + root.aabbMin = tinybvh_min( root.aabbMin, fragment[i].bmin ); + root.aabbMax = tinybvh_max( root.aabbMax, fragment[i].bmax ), primIdx[i] = i; + } + } + // clear remainder of index array + memset( primIdx + triCount, 0, slack * 4 ); + bvh_over_indices = indices != nullptr; + // threading +#ifdef NO_THREADED_BUILDS + threadedBuild = false; +#else + if (primCount < MT_BUILD_THRESHOLD) threadedBuild = false; +#endif + // all set; actual build happens in BVH::BuildHQ. +} + +float BVH::SplitCostSAH( const float rAparent, const float Aleft, const int Nleft, const float Aright, const int Nright ) const +{ + const int lN = l_quads ? (((Nleft + 3) >> 2) * 4) : Nleft; + const int rN = l_quads ? (((Nright + 3) >> 2) * 4) : Nright; + return c_trav + c_int * rAparent * (Aleft * (float)lN + Aright * (float)rN); +} + +float BVH::NoSplitCostSAH( const int Nparent ) const +{ + return (float)(l_quads ? (((Nparent + 3) >> 2) * 4) : Nparent) * c_int; +} + +void BuildHQTask_( + uint32_t nodeIdx, uint32_t depth, const uint32_t maxDepth, + uint32_t sliceStart, uint32_t sliceEnd, uint32_t* idxTmp, BVH* bvh +) +{ + bvh->BuildHQTask( nodeIdx, depth, maxDepth, sliceStart, sliceEnd, idxTmp ); +} +void BVH::BuildHQTask( + uint32_t nodeIdx, uint32_t depth, const uint32_t maxDepth, + uint32_t sliceStart, uint32_t sliceEnd, uint32_t* idxTmp +) +{ + // prepare subdivision + ALIGNED( 64 ) SubdivTask localTask[512]; + uint32_t localTasks = 0; + bvhvec3 bestLMin( 0 ), bestLMax( 0 ), bestRMin( 0 ), bestRMax( 0 ); + BVHNode& root = bvhNode[0]; + const float rootArea = tinybvh_half_area( root.aabbMax - root.aabbMin ); + const bvhvec3 minDim = (root.aabbMax - root.aabbMin) * 1e-7f /* don't touch, carefully picked */; + // subdivide + uint32_t binCount = hqbvhbins; + while (1) + { + while (1) + { + // fetch node to subdivide + BVHNode& node = bvhNode[nodeIdx]; + // alternating bin counts for optimizer. + if (hqbvhoddeven) binCount = hqbvhbins + (depth & 1); // odd levels get one more + // find optimal object split + bvhvec3 binMin[3][MAXHQBINS], binMax[3][MAXHQBINS]; + for (uint32_t a = 0; a < 3; a++) for (uint32_t i = 0; i < binCount; i++) + binMin[a][i] = bvhvec3( BVH_FAR ), binMax[a][i] = bvhvec3( -BVH_FAR ); + uint32_t count[3][MAXHQBINS]; + for (uint32_t i = 0; i < 3; i++) memset( count[i], 0, binCount * 4 ); + const bvhvec3 rpd3 = bvhvec3( bvhvec3( (float)binCount ) / (node.aabbMax - node.aabbMin) ), nmin3 = node.aabbMin; + for (uint32_t i = 0; i < node.triCount; i++) // process all tris for x,y and z at once + { + const uint32_t fi = primIdx[node.leftFirst + i]; + bvhint3 bi = bvhint3( ((fragment[fi].bmin + fragment[fi].bmax) * 0.5f - nmin3) * rpd3 ); + bi.x = tinybvh_clamp( bi.x, 0, binCount - 1 ); + bi.y = tinybvh_clamp( bi.y, 0, binCount - 1 ); + bi.z = tinybvh_clamp( bi.z, 0, binCount - 1 ); + binMin[0][bi.x] = tinybvh_min( binMin[0][bi.x], fragment[fi].bmin ); + binMax[0][bi.x] = tinybvh_max( binMax[0][bi.x], fragment[fi].bmax ), count[0][bi.x]++; + binMin[1][bi.y] = tinybvh_min( binMin[1][bi.y], fragment[fi].bmin ); + binMax[1][bi.y] = tinybvh_max( binMax[1][bi.y], fragment[fi].bmax ), count[1][bi.y]++; + binMin[2][bi.z] = tinybvh_min( binMin[2][bi.z], fragment[fi].bmin ); + binMax[2][bi.z] = tinybvh_max( binMax[2][bi.z], fragment[fi].bmax ), count[2][bi.z]++; + } + // calculate per-split totals + float noSplitCost = NoSplitCostSAH( node.triCount ); + float splitCost = noSplitCost, rSAV = 1.0f / node.SurfaceArea(); + uint32_t bestAxis = 0, bestPos = 0; + for (int32_t a = 0; a < 3; a++) if ((node.aabbMax[a] - node.aabbMin[a]) > minDim[a]) + { + bvhvec3 lBMin[MAXHQBINS - 1], rBMin[MAXHQBINS - 1], l1( BVH_FAR ), l2( -BVH_FAR ); + bvhvec3 lBMax[MAXHQBINS - 1], rBMax[MAXHQBINS - 1], r1( BVH_FAR ), r2( -BVH_FAR ); + float AL[MAXHQBINS - 1], AR[MAXHQBINS - 1]; // left and right area per split plane + int NL[MAXHQBINS - 1], NR[MAXHQBINS - 1]; // summed left and right tricount + for (uint32_t lN = 0, rN = 0, i = 0; i < binCount - 1; i++) + { + lBMin[i] = l1 = tinybvh_min( l1, binMin[a][i] ); + rBMin[binCount - 2 - i] = r1 = tinybvh_min( r1, binMin[a][binCount - 1 - i] ); + lBMax[i] = l2 = tinybvh_max( l2, binMax[a][i] ); + rBMax[binCount - 2 - i] = r2 = tinybvh_max( r2, binMax[a][binCount - 1 - i] ); + lN += count[a][i], rN += count[a][binCount - 1 - i]; + NL[i] = lN, NR[binCount - 2 - i] = rN; + AL[i] = lN == 0 ? BVH_FAR : tinybvh_half_area( l2 - l1 ); + AR[binCount - 2 - i] = rN == 0 ? BVH_FAR : tinybvh_half_area( r2 - r1 ); + } + // evaluate bin totals to find best position for object split + for (uint32_t i = 0; i < binCount - 1; i++) + { + const float C = SplitCostSAH( rSAV, AL[i], NL[i], AR[i], NR[i] ); + if (C >= splitCost) continue; + splitCost = C, bestAxis = a, bestPos = i; + bestLMin = lBMin[i], bestRMin = rBMin[i], bestLMax = lBMax[i], bestRMax = rBMax[i]; + } + } + // consider a spatial split + bool spatial = false; + int bestNL = 0, bestNR = 0, budget = (int)(sliceEnd - sliceStart); + bvhvec3 spatialUnion = bestLMax - bestRMin; + float spatialOverlap = (tinybvh_half_area( spatialUnion )) / rootArea; + if (budget > (int)node.triCount && (spatialOverlap > 1e-4f || splitCost >= noSplitCost)) + { + float minSplitCost = splitCost * 0.985f; // don't accept a spatial split for minimal gain + for (int a = 0; a < 3; a++) if ((node.aabbMax[a] - node.aabbMin[a]) > minDim[a]) + { + // setup bins + bvhvec3 sbinMin[MAXHQBINS], sbinMax[MAXHQBINS]; + int countIn[MAXHQBINS], countOut[MAXHQBINS]; + memset( countIn, 0, binCount * 4 ); + memset( countOut, 0, binCount * 4 ); + for (uint32_t i = 0; i < binCount; i++) sbinMin[i] = bvhvec3( BVH_FAR ), sbinMax[i] = bvhvec3( -BVH_FAR ); + // populate bins with clipped fragments + const float planeDist = (node.aabbMax[a] - node.aabbMin[a]) / (binCount * 0.9999f); + const float rPlaneDist = 1.0f / planeDist, nodeMin = node.aabbMin[a]; + for (unsigned i = 0; i < node.triCount; i++) + { + const uint32_t fi = primIdx[node.leftFirst + i]; + const int bin1 = tinybvh_clamp( (int32_t)((fragment[fi].bmin[a] - nodeMin) * rPlaneDist), 0, binCount - 1 ); + const int bin2 = tinybvh_clamp( (int32_t)((fragment[fi].bmax[a] - nodeMin) * rPlaneDist), 0, binCount - 1 ); + countIn[bin1]++, countOut[bin2]++; + if (bin2 == bin1) // fragment fits in a single bin + sbinMin[bin1] = tinybvh_min( sbinMin[bin1], fragment[fi].bmin ), + sbinMax[bin1] = tinybvh_max( sbinMax[bin1], fragment[fi].bmax ); + else for (int j = bin1; j <= bin2; j++) + { + // clip fragment to each bin it overlaps + bvhvec3 bmin = node.aabbMin, bmax = node.aabbMax; + bmin[a] = nodeMin + planeDist * j; + bmax[a] = j == (int)(binCount - 2) ? node.aabbMax[a] : (bmin[a] + planeDist); + Fragment orig = fragment[fi]; + Fragment tmpFrag; + if (!ClipFrag( orig, tmpFrag, bmin, bmax, minDim, a )) continue; + sbinMin[j] = tinybvh_min( sbinMin[j], tmpFrag.bmin ); + sbinMax[j] = tinybvh_max( sbinMax[j], tmpFrag.bmax ); + } + } + // evaluate split candidates + bvhvec3 lBMin[MAXHQBINS - 1], rBMin[MAXHQBINS - 1], l1( BVH_FAR ), l2( -BVH_FAR ); + bvhvec3 lBMax[MAXHQBINS - 1], rBMax[MAXHQBINS - 1], r1( BVH_FAR ), r2( -BVH_FAR ); + float AL[MAXHQBINS], AR[MAXHQBINS]; + int NL[MAXHQBINS], NR[MAXHQBINS]; + for (uint32_t lN = 0, rN = 0, i = 0; i < binCount - 1; i++) + { + lBMin[i] = l1 = tinybvh_min( l1, sbinMin[i] ), rBMin[binCount - 2 - i] = r1 = tinybvh_min( r1, sbinMin[binCount - 1 - i] ); + lBMax[i] = l2 = tinybvh_max( l2, sbinMax[i] ), rBMax[binCount - 2 - i] = r2 = tinybvh_max( r2, sbinMax[binCount - 1 - i] ); + lN += countIn[i], rN += countOut[binCount - 1 - i]; + AL[i] = lN == 0 ? BVH_FAR : tinybvh_half_area( l2 - l1 ); + AR[binCount - 2 - i] = rN == 0 ? BVH_FAR : tinybvh_half_area( r2 - r1 ); + NL[i] = lN, NR[binCount - 2 - i] = rN; + } + // find best position for spatial split + for (uint32_t i = 0; i < binCount - 1; i++) + { + const float Cspatial = SplitCostSAH( rSAV, AL[i], NL[i], AR[i], NR[i] ); + if (Cspatial < minSplitCost && NL[i] + NR[i] < budget && NL[i] * NR[i] > 0) + { + spatial = true, minSplitCost = splitCost = Cspatial, bestAxis = a, bestPos = i; + bestLMin = lBMin[i], bestLMax = lBMax[i], bestRMin = rBMin[i], bestRMax = rBMax[i]; + bestNL = NL[i], bestNR = NR[i]; // for unsplitting + bestLMax[a] = bestRMin[a]; // accurate + } + } + } + } + // evaluate best split cost + if (splitCost >= noSplitCost) + { + for (uint32_t i = 0; i < node.triCount; i++) + primIdx[node.leftFirst + i] = fragment[primIdx[node.leftFirst + i]].primIdx; + break; // not splitting is better. + } + // double-buffered partition + uint32_t A = sliceStart, B = sliceEnd, src = node.leftFirst; + if (spatial) + { + // spatial partitioning + const float planeDist = (node.aabbMax[bestAxis] - node.aabbMin[bestAxis]) / (binCount * 0.9999f); + const float rPlaneDist = 1.0f / planeDist, nodeMin = node.aabbMin[bestAxis]; + for (uint32_t i = 0; i < node.triCount; i++) + { + const uint32_t fragIdx = primIdx[src++]; + const uint32_t bin1 = (uint32_t)tinybvh_max( (fragment[fragIdx].bmin[bestAxis] - nodeMin) * rPlaneDist, 0.0f ); + const uint32_t bin2 = (uint32_t)tinybvh_max( (fragment[fragIdx].bmax[bestAxis] - nodeMin) * rPlaneDist, 0.0f ); + if (bin2 <= bestPos) idxTmp[A++] = fragIdx; else if (bin1 > bestPos) idxTmp[--B] = fragIdx; else + { + #if defined SBVH_UNSPLITTING + // unsplitting: 1. Calculate what happens if we add this primitive entirely to the left side + if (bestNR > 1) + { + bvhvec3 unsplitLMin = tinybvh_min( bestLMin, fragment[fragIdx].bmin ); + bvhvec3 unsplitLMax = tinybvh_max( bestLMax, fragment[fragIdx].bmax ); + float AL = tinybvh_half_area( unsplitLMax - unsplitLMin ); + float AR = tinybvh_half_area( bestRMax - bestRMin ); + float CunsplitLeft = SplitCostSAH( rSAV, AL, bestNL, AR, bestNR - 1 ); + if (CunsplitLeft <= splitCost) + { + bestNR--, splitCost = CunsplitLeft, idxTmp[A++] = fragIdx; + bestLMin = unsplitLMin, bestLMax = unsplitLMax; + continue; + } + } + // 2. Calculate what happens if we add this primitive entirely to the right side + if (bestNL > 1) + { + const bvhvec3 unsplitRMin = tinybvh_min( bestRMin, fragment[fragIdx].bmin ); + const bvhvec3 unsplitRMax = tinybvh_max( bestRMax, fragment[fragIdx].bmax ); + const float AL = tinybvh_half_area( bestLMax - bestLMin ); + const float AR = tinybvh_half_area( unsplitRMax - unsplitRMin ); + const float CunsplitRight = SplitCostSAH( rSAV, AL, bestNL - 1, AR, bestNR ); + if (CunsplitRight <= splitCost) + { + bestNL--, splitCost = CunsplitRight, idxTmp[--B] = fragIdx; + bestRMin = unsplitRMin, bestRMax = unsplitRMax; + continue; + } + } + #endif + // split straddler + ALIGNED( 64 ) Fragment part1, part2; // keep all clipping in a single cacheline. + bool leftOK = false, rightOK = false; + float splitPos = bestLMax[bestAxis]; + SplitFrag( fragment[fragIdx], part1, part2, minDim, bestAxis, splitPos, leftOK, rightOK ); + if (leftOK && rightOK) + { + uint32_t newFragIdx = threadedBuild ? atomicNextFrag->fetch_add( 1 ) : nextFrag++; + fragment[fragIdx] = part1, idxTmp[A++] = fragIdx, + fragment[newFragIdx] = part2, idxTmp[--B] = newFragIdx; + } + else // didn't work out; unsplit (rare) + if (leftOK) idxTmp[A++] = fragIdx; else idxTmp[--B] = fragIdx; + } + } + // for spatial splits, we fully refresh the bounds: clipping is never fully stable.. + bestLMin = bestRMin = bvhvec3( BVH_FAR ), bestLMax = bestRMax = bvhvec3( -BVH_FAR ); + for (uint32_t i = sliceStart; i < A; i++) + bestLMin = tinybvh_min( bestLMin, fragment[idxTmp[i]].bmin ), + bestLMax = tinybvh_max( bestLMax, fragment[idxTmp[i]].bmax ); + for (uint32_t i = B; i < sliceEnd; i++) + bestRMin = tinybvh_min( bestRMin, fragment[idxTmp[i]].bmin ), + bestRMax = tinybvh_max( bestRMax, fragment[idxTmp[i]].bmax ); + } + else + { + // object partitioning + const float rpd = rpd3[bestAxis], nmin = nmin3[bestAxis]; + for (uint32_t i = 0; i < node.triCount; i++) + { + const uint32_t fr = primIdx[src + i]; + int32_t bi = (int32_t)(((fragment[fr].bmin[bestAxis] + fragment[fr].bmax[bestAxis]) * 0.5f - nmin) * rpd); + bi = tinybvh_clamp( bi, 0, binCount - 1 ); + if (bi <= (int32_t)bestPos) idxTmp[A++] = fr; else idxTmp[--B] = fr; + } + } + // copy back slice data + memcpy( primIdx + sliceStart, idxTmp + sliceStart, (sliceEnd - sliceStart) * 4 ); + // create child nodes + uint32_t leftCount = A - sliceStart, rightCount = sliceEnd - B; + if (leftCount == 0 || rightCount == 0) + { + // spatial split failed. We shouldn't get here, but we do sometimes.. + for (uint32_t i = 0; i < node.triCount; i++) + primIdx[node.leftFirst + i] = fragment[primIdx[node.leftFirst + i]].primIdx; + node.aabbMin = tinybvh_min( bestLMin, bestRMin ); + node.aabbMax = tinybvh_max( bestLMax, bestRMax ); + break; + } + int32_t leftChildIdx; + if (threadedBuild) leftChildIdx = atomicNewNodePtr->fetch_add( 2 ); else leftChildIdx = newNodePtr, newNodePtr += 2; + int32_t rightChildIdx = leftChildIdx + 1; + bvhNode[leftChildIdx].aabbMin = bestLMin, bvhNode[leftChildIdx].aabbMax = bestLMax; + bvhNode[leftChildIdx].leftFirst = sliceStart, bvhNode[leftChildIdx].triCount = leftCount; + bvhNode[rightChildIdx].aabbMin = bestRMin, bvhNode[rightChildIdx].aabbMax = bestRMax; + bvhNode[rightChildIdx].leftFirst = B, bvhNode[rightChildIdx].triCount = rightCount; + node.leftFirst = leftChildIdx, node.triCount = 0; + // recurse + if (depth < maxDepth && threadedBuild) + { + std::thread t1( &BuildHQTask_, leftChildIdx, depth + 1, maxDepth, sliceStart, (A + B) >> 1, idxTmp, this ); + std::thread t2( &BuildHQTask_, rightChildIdx, depth + 1, maxDepth, (A + B) >> 1, sliceEnd, idxTmp, this ); + t1.join(); + t2.join(); // TODO: join is only needed in the 'all done' section below. + break; + } + // proceed with left child, push right child on local stack + localTask[localTasks].node = rightChildIdx, localTask[localTasks].depth = depth; + localTask[localTasks].sliceStart = (A + B) >> 1, localTask[localTasks++].sliceEnd = sliceEnd; + nodeIdx = leftChildIdx, sliceEnd = (A + B) >> 1; + } + // pop a local task, if any are left + if (localTasks == 0) break; + nodeIdx = localTask[--localTasks].node, depth = localTask[localTasks].depth; + sliceStart = localTask[localTasks].sliceStart, sliceEnd = localTask[localTasks].sliceEnd; + } +} + +void BVH::BuildHQ() +{ + const uint32_t slack = triCount >> 1; // for split prims + uint32_t* idxTmp = (uint32_t*)AlignedAlloc( (triCount + slack) * sizeof( uint32_t ) ); + memset( idxTmp, 0, (triCount + slack) * 4 ); + // reset node pool + if (threadedBuild) + { + atomicNewNodePtr = new std::atomic( 2 ); + atomicNextFrag = new std::atomic( triCount ); + } + else + { + newNodePtr = 2; + nextFrag = triCount; + } + // subdivide recursively + uint32_t nodeIdx = 0, sliceStart = 0, sliceEnd = triCount + slack, depth = 0; + BuildHQTask( nodeIdx, depth, 5, sliceStart, sliceEnd, idxTmp ); + // all done. + AlignedFree( idxTmp ); + aabbMin = bvhNode[0].aabbMin, aabbMax = bvhNode[0].aabbMax; + refittable = false; // can't refit an SBVH + may_have_holes = false; // there may be holes in the index list, but not in the node list + if (threadedBuild) + { + newNodePtr = atomicNewNodePtr->load(); + nextFrag = atomicNextFrag->load(); + } + usedNodes = newNodePtr; + delete atomicNewNodePtr; + delete atomicNextFrag; + atomicNewNodePtr = 0; + atomicNextFrag = 0; + Compact(); +} + +// Optimize: Will happen via BVH_Verbose. +void BVH::Optimize( const uint32_t iterations, bool extreme, bool stochastic ) +{ + BVH_Verbose* verbose = new BVH_Verbose(); + verbose->ConvertFrom( *this ); + verbose->Optimize( iterations, extreme, stochastic ); + ConvertFrom( *verbose ); +} + +// Refitting: For animated meshes, where the topology remains intact. This +// includes trees waving in the wind, or subsequent frames for skinned +// animations. Repeated refitting tends to lead to deteriorated BVHs and +// slower ray tracing. Rebuild when this happens. +void BVH::Refit( const uint32_t /* unused */ ) +{ + BVH_FATAL_ERROR_IF( !refittable, "BVH::Refit( .. ), refitting an SBVH." ); + BVH_FATAL_ERROR_IF( bvhNode == 0, "BVH::Refit( .. ), bvhNode == 0." ); + BVH_FATAL_ERROR_IF( may_have_holes, "BVH::Refit( .. ), bvh may have holes." ); + BVH_FATAL_ERROR_IF( isTLAS(), "BVH::Refit( .. ), do not refit a TLAS, use Build(..)." ); + for (int32_t i = usedNodes - 1; i >= 0; i--) if (i != 1) + { + BVHNode& node = bvhNode[i]; + if (node.isLeaf()) // leaf: adjust to current triangle vertex positions + { + bvhvec4 bmin( BVH_FAR ), bmax( -BVH_FAR ); + if (vertIdx) for (uint32_t first = node.leftFirst, j = 0; j < node.triCount; j++) + { + const uint32_t vidx = primIdx[first + j] * 3; + const uint32_t i0 = vertIdx[vidx], i1 = vertIdx[vidx + 1], i2 = vertIdx[vidx + 2]; + const bvhvec4 v0 = verts[i0], v1 = verts[i1], v2 = verts[i2]; + const bvhvec4 t1 = tinybvh_min( v0, bmin ), t2 = tinybvh_max( v0, bmax ); + const bvhvec4 t3 = tinybvh_min( v1, v2 ), t4 = tinybvh_max( v1, v2 ); + bmin = tinybvh_min( t1, t3 ), bmax = tinybvh_max( t2, t4 ); + } + else for (uint32_t first = node.leftFirst, j = 0; j < node.triCount; j++) + { + const uint32_t vidx = primIdx[first + j] * 3; + const bvhvec4 v0 = verts[vidx], v1 = verts[vidx + 1], v2 = verts[vidx + 2]; + const bvhvec4 t1 = tinybvh_min( v0, bmin ), t2 = tinybvh_max( v0, bmax ); + const bvhvec4 t3 = tinybvh_min( v1, v2 ), t4 = tinybvh_max( v1, v2 ); + bmin = tinybvh_min( t1, t3 ), bmax = tinybvh_max( t2, t4 ); + } + node.aabbMin = bmin, node.aabbMax = bmax; + continue; + } + // interior node: adjust to child bounds + const BVHNode& left = bvhNode[node.leftFirst], & right = bvhNode[node.leftFirst + 1]; + node.aabbMin = tinybvh_min( left.aabbMin, right.aabbMin ); + node.aabbMax = tinybvh_max( left.aabbMax, right.aabbMax ); + } + aabbMin = bvhNode[0].aabbMin, aabbMax = bvhNode[0].aabbMax; +} + +#define FIX_COMBINE_LEAFS 1 + +// CombineLeafs: Collapse subtrees if the summed leaf prim count does not +// exceed the specified number. For BVH8_CPU construction. +uint32_t BVH::CombineLeafs( const uint32_t primCount, uint32_t& firstIdx, uint32_t nodeIdx ) +{ + BVHNode& node = bvhNode[nodeIdx]; + if (node.isLeaf()) + { + firstIdx = node.leftFirst; + return node.triCount; + } + uint32_t firstLeft = 0, leftCount = CombineLeafs( primCount, firstLeft, node.leftFirst ); + uint32_t firstRight = 0, rightCount = CombineLeafs( primCount, firstRight, node.leftFirst + 1 ); + firstIdx = tinybvh_min( firstLeft, firstRight ); + if (leftCount + rightCount <= primCount) + node.triCount = leftCount + rightCount, + node.leftFirst = firstIdx; + return leftCount + rightCount; +} + +// CombineLeafs: Combine leaf nodes if this improves tree SAH cost. For HPLOC postprocessing. +void BVH::CombineLeafs( const uint32_t nodeIdx ) +{ + BVHNode& node = bvhNode[nodeIdx]; + if (node.isLeaf()) return; + BVHNode& left = bvhNode[node.leftFirst]; + BVHNode& right = bvhNode[node.leftFirst + 1]; + if (left.isLeaf() && right.isLeaf()) + { + int combinedCount = left.triCount + right.triCount; + float rAnode = 1.0f / tinybvh_half_area( node.aabbMax - node.aabbMin ); + float Cnode = c_int * combinedCount; + float Cleft = c_int * left.triCount * tinybvh_half_area( left.aabbMax - left.aabbMin ) * rAnode; + float Cright = c_int * right.triCount * tinybvh_half_area( right.aabbMax - right.aabbMin ) * rAnode; + float Csplit = Cleft + Cright + c_trav; + if (Cnode < Csplit) if (right.leftFirst == (left.leftFirst + left.triCount)) + node.leftFirst = left.leftFirst, + node.triCount = combinedCount; + return; + } + CombineLeafs( node.leftFirst ); + CombineLeafs( node.leftFirst + 1 ); +} + +bool BVH::IntersectSphere( const bvhvec3& pos, const float r ) const +{ + const bvhvec3 bmin = pos - bvhvec3( r ), bmax = pos + bvhvec3( r ); + BVHNode* node = &bvhNode[0], * stack[64]; + uint32_t stackPtr = 0; + const float r2 = r * r; + while (1) + { + if (node->isLeaf()) + { + // check if the leaf aabb overlaps the sphere: https://gamedev.stackexchange.com/a/156877 + float dist2 = 0; + if (pos.x < node->aabbMin.x) dist2 += (node->aabbMin.x - pos.x) * (node->aabbMin.x - pos.x); + if (pos.x > node->aabbMax.x) dist2 += (pos.x - node->aabbMax.x) * (pos.x - node->aabbMax.x); + if (pos.y < node->aabbMin.y) dist2 += (node->aabbMin.y - pos.y) * (node->aabbMin.y - pos.y); + if (pos.y > node->aabbMax.y) dist2 += (pos.y - node->aabbMax.y) * (pos.y - node->aabbMax.y); + if (pos.z < node->aabbMin.z) dist2 += (node->aabbMin.z - pos.z) * (node->aabbMin.z - pos.z); + if (pos.z > node->aabbMax.z) dist2 += (pos.z - node->aabbMax.z) * (pos.z - node->aabbMax.z); + if (dist2 <= r2) + { + // tri/sphere test: https://gist.github.com/yomotsu/d845f21e2e1eb49f647f#file-gistfile1-js-L223 + for (uint32_t i = 0; i < node->triCount; i++) + { + uint32_t idx = primIdx[node->leftFirst + i]; + bvhvec3 a, b, c; + if (!vertIdx) idx *= 3, a = verts[idx], b = verts[idx + 1], c = verts[idx + 2]; else + { + const uint32_t i0 = vertIdx[idx * 3], i1 = vertIdx[idx * 3 + 1], i2 = vertIdx[idx * 3 + 2]; + a = verts[i0], b = verts[i1], c = verts[i2]; + } + const bvhvec3 A = a - pos, B = b - pos, C = c - pos; + const float rr = r * r; + const bvhvec3 V = tinybvh_cross( B - A, C - A ); + const float d = tinybvh_dot( A, V ), e = tinybvh_dot( V, V ); + if (d * d > rr * e) continue; + const float aa = tinybvh_dot( A, A ), ab = tinybvh_dot( A, B ), ac = tinybvh_dot( A, C ); + const float bb = tinybvh_dot( B, B ), bc = tinybvh_dot( B, C ), cc = tinybvh_dot( C, C ); + if ((aa > rr && ab > aa && ac > aa) || (bb > rr && ab > bb && bc > bb) || + (cc > rr && ac > cc && bc > cc)) continue; + const bvhvec3 AB = B - A, BC = C - B, CA = A - C; + const float d1 = ab - aa, d2 = bc - bb, d3 = ac - cc; + const float e1 = tinybvh_dot( AB, AB ), e2 = tinybvh_dot( BC, BC ), e3 = tinybvh_dot( CA, CA ); + const bvhvec3 Q1 = A * e1 - AB * d1, Q2 = B * e2 - BC * d2, Q3 = C * e3 - CA * d3; + const bvhvec3 QC = C * e1 - Q1, QA = A * e2 - Q2, QB = B * e3 - Q3; + if ((tinybvh_dot( Q1, Q1 ) > rr * e1 * e1 && tinybvh_dot( Q1, QC ) >= 0) || + (tinybvh_dot( Q2, Q2 ) > rr * e2 * e2 && tinybvh_dot( Q2, QA ) >= 0) || + (tinybvh_dot( Q3, Q3 ) > rr * e3 * e3 && tinybvh_dot( Q3, QB ) >= 0)) continue; + // const float dist = sqrtf( d * d / e ) - r; // we're not using this. + return true; + } + } + if (stackPtr == 0) break; else node = stack[--stackPtr]; + } + BVHNode* child1 = &bvhNode[node->leftFirst], * child2 = &bvhNode[node->leftFirst + 1]; + bool hit1 = child1->Intersect( bmin, bmax ), hit2 = child2->Intersect( bmin, bmax ); + if (hit1 && hit2) stack[stackPtr++] = child2, node = child1; + else if (hit1) node = child1; else if (hit2) node = child2; + else { if (stackPtr == 0) break; node = stack[--stackPtr]; } + } + return false; +} + +#define SLAB_TEST_TWO_NODES \ + float tx1a = (posX ? child1->aabbMin.x : child1->aabbMax.x) * ray.rD.x - rox; /* expect fma. */ \ + float ty1a = (posY ? child1->aabbMin.y : child1->aabbMax.y) * ray.rD.y - roy; \ + float tz1a = (posZ ? child1->aabbMin.z : child1->aabbMax.z) * ray.rD.z - roz; \ + float tx1b = (posX ? child2->aabbMin.x : child2->aabbMax.x) * ray.rD.x - rox; \ + float ty1b = (posY ? child2->aabbMin.y : child2->aabbMax.y) * ray.rD.y - roy; \ + float tz1b = (posZ ? child2->aabbMin.z : child2->aabbMax.z) * ray.rD.z - roz; \ + float tx2a = (posX ? child1->aabbMax.x : child1->aabbMin.x) * ray.rD.x - rox; \ + float ty2a = (posY ? child1->aabbMax.y : child1->aabbMin.y) * ray.rD.y - roy; \ + float tz2a = (posZ ? child1->aabbMax.z : child1->aabbMin.z) * ray.rD.z - roz; \ + float tx2b = (posX ? child2->aabbMax.x : child2->aabbMin.x) * ray.rD.x - rox; \ + float ty2b = (posY ? child2->aabbMax.y : child2->aabbMin.y) * ray.rD.y - roy; \ + float tz2b = (posZ ? child2->aabbMax.z : child2->aabbMin.z) * ray.rD.z - roz; \ + float tmina = tinybvh_max( tinybvh_max( tx1a, ty1a ), tinybvh_max( tz1a, 0.0f ) ); \ + float tminb = tinybvh_max( tinybvh_max( tx1b, ty1b ), tinybvh_max( tz1b, 0.0f ) ); \ + float tmaxa = tinybvh_min( tinybvh_min( tx2a, ty2a ), tinybvh_min( tz2a, ray.hit.t ) ); \ + float tmaxb = tinybvh_min( tinybvh_min( tx2b, ty2b ), tinybvh_min( tz2b, ray.hit.t ) ); \ + if (tmaxa >= tmina) dist1 = tmina; \ + if (tmaxb >= tminb) dist2 = tminb; + +int32_t BVH::Intersect( Ray& ray ) const +{ + VALIDATE_RAY( ray ); + if (!isTLAS()) + { + const bool posX = ray.D.x >= 0, posY = ray.D.y >= 0, posZ = ray.D.z >= 0; + if (!posX) goto negx1; + if (posY) { if (posZ) return Intersect( ray ); else return Intersect( ray ); } + if (posZ) return Intersect( ray ); else return Intersect( ray ); + negx1: + if (posY) { if (posZ) return Intersect( ray ); else return Intersect( ray ); } + if (posZ) return Intersect( ray ); else return Intersect( ray ); + } + else + { + const bool posX = ray.D.x >= 0, posY = ray.D.y >= 0, posZ = ray.D.z >= 0; + if (!posX) goto negx2; + if (posY) { if (posZ) return IntersectTLAS( ray ); else return IntersectTLAS( ray ); } + if (posZ) return IntersectTLAS( ray ); else return IntersectTLAS( ray ); + negx2: + if (posY) { if (posZ) return IntersectTLAS( ray ); else return IntersectTLAS( ray ); } + if (posZ) return IntersectTLAS( ray ); else return IntersectTLAS( ray ); + } +} + +template int32_t BVH::Intersect( Ray& ray ) const +{ + BVHNode* node = &bvhNode[0], * stack[256]; + uint32_t stackPtr = 0; + float cost = 0; + const float rox = ray.O.x * ray.rD.x; + const float roy = ray.O.y * ray.rD.y; + const float roz = ray.O.z * ray.rD.z; + while (1) + { + cost += c_trav; + if (node->isLeaf()) + { + // Performance note: if indexed primitives (ENABLE_INDEXED_GEOMETRY) and custom + // geometry (ENABLE_CUSTOM_GEOMETRY) are both disabled, this leaf code reduces + // to a regular loop over triangles. Otherwise, the extra flexibility comes at + // a small performance cost. + if (indexedEnabled && vertIdx != 0) for (uint32_t i = 0; i < node->triCount; i++, cost += c_int) + { + const uint32_t pi = primIdx[node->leftFirst + i]; + const uint32_t i0 = vertIdx[pi * 3], i1 = vertIdx[pi * 3 + 1], i2 = vertIdx[pi * 3 + 2]; + IntersectTri( ray, pi, verts, i0, i1, i2 ); + } + else if (customEnabled && customIntersect != 0) for (uint32_t i = 0; i < node->triCount; i++, cost += c_int) + { + if ((*customIntersect)(ray, primIdx[node->leftFirst + i])) + { + #if INST_IDX_BITS == 32 + ray.hit.inst = ray.instIdx; + #else + ray.hit.prim = (ray.hit.prim & PRIM_IDX_MASK) + ray.instIdx; + #endif + } + } + else for (uint32_t i = 0; i < node->triCount; i++, cost += c_int) + { + const uint32_t pi = primIdx[node->leftFirst + i]; + IntersectTri( ray, pi, verts, pi * 3, pi * 3 + 1, pi * 3 + 2 ); + } + if (stackPtr == 0) break; else node = stack[--stackPtr]; + continue; + } + BVHNode* child1 = &bvhNode[node->leftFirst], * child2 = &bvhNode[node->leftFirst + 1]; + float dist1 = BVH_FAR, dist2 = BVH_FAR; + SLAB_TEST_TWO_NODES; + if (dist1 > dist2) { tinybvh_swap( dist1, dist2 ); tinybvh_swap( child1, child2 ); } + if (dist1 == BVH_FAR /* missed both child nodes */) + { + if (stackPtr == 0) break; else node = stack[--stackPtr]; + } + else /* hit at least one node */ + { + node = child1; /* continue with the nearest */ + if (dist2 != BVH_FAR) stack[stackPtr++] = child2; /* push far child */ + } + } + return (int32_t)cost; // cast to not break interface. +} + +template int32_t BVH::IntersectTLAS( Ray& ray ) const +{ + BVHNode* node = &bvhNode[0], * stack[64]; + uint32_t stackPtr = 0; + float cost = 0; + const float rox = ray.O.x * ray.rD.x; + const float roy = ray.O.y * ray.rD.y; + const float roz = ray.O.z * ray.rD.z; + while (1) + { + cost += c_trav; + if (node->isLeaf()) + { + Ray tmp; + for (uint32_t i = 0; i < node->triCount; i++) + { + // BLAS traversal + const uint32_t instIdx = primIdx[node->leftFirst + i]; + const BLASInstance& inst = instList[instIdx]; + // Check if the ray should intersect this BLAS Instance, otherwise skip it + if (!(inst.mask & ray.mask)) continue; + const BVHBase* blas = blasList[inst.blasIdx]; + // 1. Transform ray with the inverse of the instance transform + tmp.O = tinybvh_transform_point( ray.O, inst.invTransform ); + tmp.D = tinybvh_transform_vector( ray.D, inst.invTransform ); + tmp.instIdx = instIdx << (32 - INST_IDX_BITS); + tmp.hit = ray.hit; + tmp.rD = tinybvh_rcp( tmp.D ); + // 2. Traverse BLAS with the transformed ray + // Note: Valid BVH layout options for BLASses are the regular BVH layout, + // the AVX-optimized BVH_SOA layout and the wide BVH4_CPU layout. When all + // BLASses are of the same layout this reduces to nearly zero cost for + // a small set of predictable branches. + assert( blas->layout == LAYOUT_BVH || blas->layout == LAYOUT_BVH4_CPU || + blas->layout == LAYOUT_BVH_SOA || blas->layout == LAYOUT_BVH8_AVX2 ); + if (blas->layout == LAYOUT_BVH) + { + // regular (triangle) BVH traversal + cost += ((BVH*)blas)->Intersect( tmp ); + } + else + { + #ifdef BVH_USESSE + if (blas->layout == LAYOUT_BVH4_CPU) cost += ((BVH4_CPU*)blas)->Intersect( tmp ); + #endif + #ifdef BVH_USEAVX + if (blas->layout == LAYOUT_BVH_SOA) cost += ((BVH_SoA*)blas)->Intersect( tmp ); + #endif + #ifdef BVH_USEAVX2 + if (blas->layout == LAYOUT_BVH8_AVX2) cost += ((BVH8_CPU*)blas)->Intersect( tmp ); + #endif + if (blas->layout == LAYOUT_VOXELSET) cost += ((VoxelSet*)blas)->Intersect( tmp ); + } + // 3. Restore ray + ray.hit = tmp.hit; + } + if (stackPtr == 0) break; else node = stack[--stackPtr]; + continue; + } + BVHNode* child1 = &bvhNode[node->leftFirst], * child2 = &bvhNode[node->leftFirst + 1]; + float dist1 = BVH_FAR, dist2 = BVH_FAR; + SLAB_TEST_TWO_NODES; + if (dist1 > dist2) { tinybvh_swap( dist1, dist2 ); tinybvh_swap( child1, child2 ); } + if (dist1 == BVH_FAR /* missed both child nodes */) + { + if (stackPtr == 0) break; else node = stack[--stackPtr]; + } + else /* hit at least one node */ + { + node = child1; /* continue with the nearest */ + if (dist2 != BVH_FAR) stack[stackPtr++] = child2; /* push far child */ + } + } + return (int32_t)cost; +} + +bool BVH::IsOccluded( const Ray& ray ) const +{ + VALIDATE_RAY( ray ); + if (!isTLAS()) + { + const bool posX = ray.D.x >= 0, posY = ray.D.y >= 0, posZ = ray.D.z >= 0; + if (!posX) goto negx1; + if (posY) { if (posZ) return IsOccluded( ray ); else return IsOccluded( ray ); } + if (posZ) return IsOccluded( ray ); else return IsOccluded( ray ); + negx1: + if (posY) { if (posZ) return IsOccluded( ray ); else return IsOccluded( ray ); } + if (posZ) return IsOccluded( ray ); else return IsOccluded( ray ); + } + else + { + const bool posX = ray.D.x >= 0, posY = ray.D.y >= 0, posZ = ray.D.z >= 0; + if (!posX) goto negx2; + if (posY) { if (posZ) return IsOccludedTLAS( ray ); else return IsOccludedTLAS( ray ); } + if (posZ) return IsOccludedTLAS( ray ); else return IsOccludedTLAS( ray ); + negx2: + if (posY) { if (posZ) return IsOccludedTLAS( ray ); else return IsOccludedTLAS( ray ); } + if (posZ) return IsOccludedTLAS( ray ); else return IsOccludedTLAS( ray ); + } +} + +template bool BVH::IsOccluded( const Ray& ray ) const +{ + BVHNode* node = &bvhNode[0], * stack[64]; + uint32_t stackPtr = 0; + const float rox = ray.O.x * ray.rD.x; + const float roy = ray.O.y * ray.rD.y; + const float roz = ray.O.z * ray.rD.z; + while (1) + { + if (node->isLeaf()) + { + if (indexedEnabled && vertIdx != 0) for (uint32_t i = 0; i < node->triCount; i++) + { + const uint32_t pi = primIdx[node->leftFirst + i], vi0 = pi * 3; + const uint32_t i0 = vertIdx[vi0], i1 = vertIdx[vi0 + 1], i2 = vertIdx[vi0 + 2]; + if (TriOccludes( ray, verts, pi, i0, i1, i2 )) return true; + } + else if (customEnabled && customIsOccluded != 0) + { + for (uint32_t i = 0; i < node->triCount; i++) + if ((*customIsOccluded)(ray, primIdx[node->leftFirst + i])) return true; + } + else for (uint32_t i = 0; i < node->triCount; i++) + { + const uint32_t pi = primIdx[node->leftFirst + i], vi0 = pi * 3; + if (TriOccludes( ray, verts, pi, vi0, vi0 + 1, vi0 + 2 )) return true; + } + if (stackPtr == 0) break; else node = stack[--stackPtr]; + continue; + } + BVHNode* child1 = &bvhNode[node->leftFirst]; + BVHNode* child2 = &bvhNode[node->leftFirst + 1]; + float dist1 = BVH_FAR, dist2 = BVH_FAR; + SLAB_TEST_TWO_NODES; + if (dist1 > dist2) { tinybvh_swap( dist1, dist2 ); tinybvh_swap( child1, child2 ); } + if (dist1 == BVH_FAR /* missed both child nodes */) + { + if (stackPtr == 0) break; else node = stack[--stackPtr]; + } + else /* hit at least one node */ + { + node = child1; /* continue with the nearest */ + if (dist2 != BVH_FAR) stack[stackPtr++] = child2; /* push far child */ + } + } + return false; +} + +template bool BVH::IsOccludedTLAS( const Ray& ray ) const +{ + BVHNode* node = &bvhNode[0], * stack[64]; + uint32_t stackPtr = 0; + Ray tmp; + const float rox = ray.O.x * ray.rD.x; + const float roy = ray.O.y * ray.rD.y; + const float roz = ray.O.z * ray.rD.z; + while (1) + { + if (node->isLeaf()) + { + for (uint32_t i = 0; i < node->triCount; i++) + { + // BLAS traversal + BLASInstance& inst = instList[primIdx[node->leftFirst + i]]; + const BVHBase* blas = blasList[inst.blasIdx]; + // Check if the ray should intersect this BLAS Instance, otherwise skip it + if (!(inst.mask & ray.mask)) continue; + // 1. Transform ray with the inverse of the instance transform + tmp.O = tinybvh_transform_point( ray.O, inst.invTransform ); + tmp.D = tinybvh_transform_vector( ray.D, inst.invTransform ); + tmp.hit.t = ray.hit.t; + tmp.rD = tinybvh_rcp( tmp.D ); + // 2. Traverse BLAS with the transformed ray + assert( blas->layout == LAYOUT_BVH || blas->layout == LAYOUT_BVH_SOA || + blas->layout == LAYOUT_BVH8_AVX2 || blas->layout == LAYOUT_BVH4_CPU ); + if (blas->layout == LAYOUT_BVH) + { + // regular (triangle) BVH traversal + if (((BVH*)blas)->IsOccluded( tmp )) return true; + } + else + { + #ifdef BVH_USESSE + if (blas->layout == LAYOUT_BVH4_CPU) { if (((BVH4_CPU*)blas)->IsOccluded( tmp )) return true; } + #endif + #ifdef BVH_USEAVX + if (blas->layout == LAYOUT_BVH_SOA) { if (((BVH_SoA*)blas)->IsOccluded( tmp )) return true; } + #endif + #ifdef BVH_USEAVX2 + if (blas->layout == LAYOUT_BVH8_AVX2) { if (((BVH8_CPU*)blas)->IsOccluded( tmp )) return true; } + #endif + if (blas->layout == LAYOUT_VOXELSET) { if (((VoxelSet*)blas)->IsOccluded( tmp )) return true; } + } + } + if (stackPtr == 0) break; else node = stack[--stackPtr]; + continue; + } + BVHNode* child1 = &bvhNode[node->leftFirst], * child2 = &bvhNode[node->leftFirst + 1]; + float dist1 = BVH_FAR, dist2 = BVH_FAR; + SLAB_TEST_TWO_NODES; + if (dist1 > dist2) { tinybvh_swap( dist1, dist2 ); tinybvh_swap( child1, child2 ); } + if (dist1 == BVH_FAR /* missed both child nodes */) + { + if (stackPtr == 0) break; else node = stack[--stackPtr]; + } + else /* hit at least one node */ + { + node = child1; /* continue with the nearest */ + if (dist2 != BVH_FAR) stack[stackPtr++] = child2; /* push far child */ + } + } + return false; +} + +// Intersect a WALD_32BYTE BVH with a ray packet. +// The 256 rays travel together to better utilize the caches and to amortize the cost +// of memory transfers over the rays in the bundle. +// Note that this basic implementation assumes a specific layout of the rays. Provided +// as 'proof of concept', should not be used in production code. +// Based on Large Ray Packets for Real-time Whitted Ray Tracing, Overbeck et al., 2008, +// extended with sorted traversal and reduced stack traffic. +void BVH::Intersect256Rays( Ray* packet ) const +{ + // convenience macro +#define CALC_TMIN_TMAX_WITH_SLABTEST_ON_RAY( r ) const bvhvec3 rD = packet[r].rD, t1 = o1 * rD, t2 = o2 * rD; \ + const float tmin = tinybvh_max( tinybvh_max( tinybvh_min( t1.x, t2.x ), tinybvh_min( t1.y, t2.y ) ), tinybvh_min( t1.z, t2.z ) ); \ + const float tmax = tinybvh_min( tinybvh_min( tinybvh_max( t1.x, t2.x ), tinybvh_max( t1.y, t2.y ) ), tinybvh_max( t1.z, t2.z ) ); + // Corner rays are: 0, 51, 204 and 255 + // Construct the bounding planes, with normals pointing outwards + const bvhvec3 O = packet[0].O; // same for all rays in this case + const bvhvec3 p0 = packet[0].O + packet[0].D; // top-left + const bvhvec3 p1 = packet[51].O + packet[51].D; // top-right + const bvhvec3 p2 = packet[204].O + packet[204].D; // bottom-left + const bvhvec3 p3 = packet[255].O + packet[255].D; // bottom-right + const bvhvec3 plane0 = tinybvh_normalize( tinybvh_cross( p0 - O, p0 - p2 ) ); // left plane + const bvhvec3 plane1 = tinybvh_normalize( tinybvh_cross( p3 - O, p3 - p1 ) ); // right plane + const bvhvec3 plane2 = tinybvh_normalize( tinybvh_cross( p1 - O, p1 - p0 ) ); // top plane + const bvhvec3 plane3 = tinybvh_normalize( tinybvh_cross( p2 - O, p2 - p3 ) ); // bottom plane + const int32_t sign0x = plane0.x < 0 ? 4 : 0, sign0y = plane0.y < 0 ? 5 : 1, sign0z = plane0.z < 0 ? 6 : 2; + const int32_t sign1x = plane1.x < 0 ? 4 : 0, sign1y = plane1.y < 0 ? 5 : 1, sign1z = plane1.z < 0 ? 6 : 2; + const int32_t sign2x = plane2.x < 0 ? 4 : 0, sign2y = plane2.y < 0 ? 5 : 1, sign2z = plane2.z < 0 ? 6 : 2; + const int32_t sign3x = plane3.x < 0 ? 4 : 0, sign3y = plane3.y < 0 ? 5 : 1, sign3z = plane3.z < 0 ? 6 : 2; + const float d0 = tinybvh_dot( O, plane0 ), d1 = tinybvh_dot( O, plane1 ); + const float d2 = tinybvh_dot( O, plane2 ), d3 = tinybvh_dot( O, plane3 ); + // Traverse the tree with the packet + int32_t first = 0, last = 255; // first and last active ray in the packet + const BVHNode* node = &bvhNode[0]; + ALIGNED( 64 ) uint32_t stack[64], stackPtr = 0; + while (1) + { + if (node->isLeaf()) + { + // handle leaf node + for (uint32_t j = 0; j < node->triCount; j++) + { + const uint32_t idx = primIdx[node->leftFirst + j], vid = idx * 3; + const bvhvec3 e1 = verts[vid + 1] - verts[vid], e2 = verts[vid + 2] - verts[vid]; + const bvhvec3 s = O - bvhvec3( verts[vid] ); + for (int32_t i = first; i <= last; i++) + { + Ray& ray = packet[i]; + const bvhvec3 h = tinybvh_cross( ray.D, e2 ); + const float a = tinybvh_dot( e1, h ); + if (fabs( a ) < 0.0000001f) continue; // ray parallel to triangle + const float f = 1 / a, u = f * tinybvh_dot( s, h ); + const bvhvec3 q = tinybvh_cross( s, e1 ); + const float v = f * tinybvh_dot( ray.D, q ); + if (u < 0 || v < 0 || u + v > 1) continue; + const float t = f * tinybvh_dot( e2, q ); + if (t <= 0 || t >= ray.hit.t) continue; + ray.hit.t = t, ray.hit.u = u, ray.hit.v = v; + #if INST_IDX_BITS == 32 + ray.hit.prim = idx, ray.hit.inst = ray.instIdx; + #else + ray.hit.prim = idx + ray.instIdx; + #endif + } + } + if (stackPtr == 0) break; else // pop + last = stack[--stackPtr], node = bvhNode + stack[--stackPtr], + first = last >> 8, last &= 255; + } + else + { + // fetch pointers to child nodes + const BVHNode* left = bvhNode + node->leftFirst; + const BVHNode* right = bvhNode + node->leftFirst + 1; + bool visitLeft = true, visitRight = true; + int32_t leftFirst = first, leftLast = last, rightFirst = first, rightLast = last; + float distLeft, distRight; + { + // see if we want to intersect the left child + const bvhvec3 o1( left->aabbMin.x - O.x, left->aabbMin.y - O.y, left->aabbMin.z - O.z ); + const bvhvec3 o2( left->aabbMax.x - O.x, left->aabbMax.y - O.y, left->aabbMax.z - O.z ); + // 1. Early-in test: if first ray hits the node, the packet visits the node + bool earlyHit; + { + CALC_TMIN_TMAX_WITH_SLABTEST_ON_RAY( first ); + earlyHit = (tmax >= tmin && tmin < packet[first].hit.t && tmax >= 0); + distLeft = tmin; + } + if (!earlyHit) // 2. Early-out test: if the node aabb is outside the four planes, we skip the node + { + float* minmax = (float*)left; + bvhvec3 c0( minmax[sign0x], minmax[sign0y], minmax[sign0z] ); + bvhvec3 c1( minmax[sign1x], minmax[sign1y], minmax[sign1z] ); + bvhvec3 c2( minmax[sign2x], minmax[sign2y], minmax[sign2z] ); + bvhvec3 c3( minmax[sign3x], minmax[sign3y], minmax[sign3z] ); + if (tinybvh_dot( c0, plane0 ) > d0 || tinybvh_dot( c1, plane1 ) > d1 || + tinybvh_dot( c2, plane2 ) > d2 || tinybvh_dot( c3, plane3 ) > d3) + visitLeft = false; + else // 3. Last resort: update first and last, stay in node if first > last + { + for (; leftFirst <= leftLast; leftFirst++) + { + CALC_TMIN_TMAX_WITH_SLABTEST_ON_RAY( leftFirst ); + if (tmax >= tmin && tmin < packet[leftFirst].hit.t && tmax >= 0) { distLeft = tmin; break; } + } + for (; leftLast >= leftFirst; leftLast--) + { + CALC_TMIN_TMAX_WITH_SLABTEST_ON_RAY( leftLast ); + if (tmax >= tmin && tmin < packet[leftLast].hit.t && tmax >= 0) break; + } + visitLeft = leftLast >= leftFirst; + } + } + } + { + // see if we want to intersect the right child + const bvhvec3 o1( right->aabbMin.x - O.x, right->aabbMin.y - O.y, right->aabbMin.z - O.z ); + const bvhvec3 o2( right->aabbMax.x - O.x, right->aabbMax.y - O.y, right->aabbMax.z - O.z ); + // 1. Early-in test: if first ray hits the node, the packet visits the node + bool earlyHit; + { + CALC_TMIN_TMAX_WITH_SLABTEST_ON_RAY( first ); + earlyHit = (tmax >= tmin && tmin < packet[first].hit.t && tmax >= 0); + distRight = tmin; + } + if (!earlyHit) // 2. Early-out test: if the node aabb is outside the four planes, we skip the node + { + float* minmax = (float*)right; + bvhvec3 c0( minmax[sign0x], minmax[sign0y], minmax[sign0z] ); + bvhvec3 c1( minmax[sign1x], minmax[sign1y], minmax[sign1z] ); + bvhvec3 c2( minmax[sign2x], minmax[sign2y], minmax[sign2z] ); + bvhvec3 c3( minmax[sign3x], minmax[sign3y], minmax[sign3z] ); + if (tinybvh_dot( c0, plane0 ) > d0 || tinybvh_dot( c1, plane1 ) > d1 || + tinybvh_dot( c2, plane2 ) > d2 || tinybvh_dot( c3, plane3 ) > d3) + visitRight = false; + else // 3. Last resort: update first and last, stay in node if first > last + { + for (; rightFirst <= rightLast; rightFirst++) + { + CALC_TMIN_TMAX_WITH_SLABTEST_ON_RAY( rightFirst ); + if (tmax >= tmin && tmin < packet[rightFirst].hit.t && tmax >= 0) { distRight = tmin; break; } + } + for (; rightLast >= first; rightLast--) + { + CALC_TMIN_TMAX_WITH_SLABTEST_ON_RAY( rightLast ); + if (tmax >= tmin && tmin < packet[rightLast].hit.t && tmax >= 0) break; + } + visitRight = rightLast >= rightFirst; + } + } + } + // process intersection result + if (visitLeft && visitRight) + { + if (distLeft < distRight) // push right, continue with left + { + stack[stackPtr++] = node->leftFirst + 1; + stack[stackPtr++] = (rightFirst << 8) + rightLast; + node = left, first = leftFirst, last = leftLast; + } + else // push left, continue with right + { + stack[stackPtr++] = node->leftFirst; + stack[stackPtr++] = (leftFirst << 8) + leftLast; + node = right, first = rightFirst, last = rightLast; + } + } + else if (visitLeft) // continue with left + node = left, first = leftFirst, last = leftLast; + else if (visitRight) // continue with right + node = right, first = rightFirst, last = rightLast; + else if (stackPtr == 0) break; else // pop + last = stack[--stackPtr], node = bvhNode + stack[--stackPtr], + first = last >> 8, last &= 255; + } + } +} + +int32_t BVH::NodeCount() const +{ + // Determine the number of nodes in the tree. Typically the result should + // be usedNodes - 1 (second node is always unused), but some builders may + // have unused nodes besides node 1. TODO: Support more layouts. + uint32_t retVal = 0, nodeIdx = 0, stack[64], stackPtr = 0; + while (1) + { + const BVHNode& n = bvhNode[nodeIdx]; + retVal++; + if (n.isLeaf()) { if (stackPtr == 0) break; else nodeIdx = stack[--stackPtr]; } + else nodeIdx = n.leftFirst, stack[stackPtr++] = n.leftFirst + 1; + } + return retVal; +} + +int32_t BVH::LeafCount() const +{ + // Determine the number of nodes in the tree. Typically the result should + // be usedNodes - 1 (second node is always unused), but some builders may + // have unused nodes besides node 1. TODO: Support more layouts. + uint32_t retVal = 0, nodeIdx = 0, stack[64], stackPtr = 0; + while (1) + { + const BVHNode& n = bvhNode[nodeIdx]; + if (n.isLeaf()) { retVal++; if (stackPtr == 0) break; else nodeIdx = stack[--stackPtr]; } + else nodeIdx = n.leftFirst, stack[stackPtr++] = n.leftFirst + 1; + } + return retVal; +} + +// Compact: Reduce the size of a BVH by removing any unused nodes. +// This is useful after an SBVH build or multi-threaded build, but also after +// calling MergeLeafs. Some operations, such as Optimize, *require* a +// compacted tree to work correctly. +void BVH::Compact() +{ + BVH_FATAL_ERROR_IF( bvhNode == 0, "BVH::Compact(), bvhNode == 0." ); + if (bvhNode[0].isLeaf()) return; // nothing to compact. + BVHNode* tmp = (BVHNode*)AlignedAlloc( sizeof( BVHNode ) * allocatedNodes /* do *not* trim */ ); + uint32_t* idx = (uint32_t*)AlignedAlloc( sizeof( uint32_t ) * idxCount ); + memcpy( tmp, bvhNode, 2 * sizeof( BVHNode ) ); + newNodePtr = 2; + uint32_t newIdxPtr = 0; + uint32_t nodeIdx = 0, stack[128], stackPtr = 0; + while (1) + { + BVHNode& node = tmp[nodeIdx]; + if (node.isLeaf()) + { + const uint32_t leafStart = newIdxPtr; + for (uint32_t i = 0; i < node.triCount; i++) idx[newIdxPtr++] = primIdx[node.leftFirst + i]; + node.leftFirst = leafStart; + if (!stackPtr) break; + nodeIdx = stack[--stackPtr]; + } + else + { + const BVHNode& left = bvhNode[node.leftFirst]; + const BVHNode& right = bvhNode[node.leftFirst + 1]; + tmp[newNodePtr] = left, tmp[newNodePtr + 1] = right; + const uint32_t todo1 = newNodePtr, todo2 = newNodePtr + 1; + node.leftFirst = newNodePtr, newNodePtr += 2; + nodeIdx = todo1; + stack[stackPtr++] = todo2; + } + } + usedNodes = newNodePtr; + AlignedFree( bvhNode ); + AlignedFree( primIdx ); + bvhNode = tmp; + primIdx = idx; +} + +// VoxelSet implementation +// ---------------------------------------------------------------------------- + +VoxelSet::VoxelSet() +{ + grid = (uint32_t*)AlignedAlloc( gridSize * sizeof( uint32_t ) ); + memset( grid, 0, gridSize * sizeof( uint32_t ) ); + brick = (uint32_t*)AlignedAlloc( brickSize * brickCount * sizeof( uint32_t ) ); + memset( brick, 0, brickSize * brickCount * sizeof( uint32_t ) ); + topGrid = (uint32_t*)AlignedAlloc( topGridSize / 8 ); + freeBrickPtr = 1; // first available brick; we'll skip 0 + aabbMin = bvhvec3( 0 ), aabbMax = bvhvec3( 1 ); // a voxel object is always (1,1,1) in object space. +} + +void VoxelSet::Set( const uint32_t x, const uint32_t y, const uint32_t z, const uint32_t v ) +{ + // note: not thread-safe. + const uint32_t bx = x / brickDim, by = y / brickDim, bz = z / brickDim; + const uint32_t gridIdx = bx + by * gridDim + bz * gridDim * gridDim; + uint32_t brickIdx = grid[gridIdx]; + if (!brickIdx) + { + if (freeBrickPtr == brickCount) // we ran out; reallocate + { + uint32_t newBrickCount = brickCount + (brickCount >> 2); + uint32_t* newBrickPool = (uint32_t*)AlignedAlloc( newBrickCount * brickSize * sizeof( uint32_t ) ); + memcpy( newBrickPool, brick, brickCount * brickSize * sizeof( uint32_t ) ); + memset( newBrickPool + brickCount * brickSize, 0, (newBrickCount - brickCount) * brickSize * sizeof( uint32_t ) ); + AlignedFree( brick ); + brick = newBrickPool, brickCount = newBrickCount; + } + brickIdx = grid[gridIdx] = freeBrickPtr++; + } + const uint32_t voxelIdx = (x & (brickDim - 1)) + (y & (brickDim - 1)) * brickDim + (z & (brickDim - 1)) * brickDim * brickDim; + brick[brickIdx * brickSize + voxelIdx] = v; +} + +void VoxelSet::UpdateTopGrid() +{ + memset( topGrid, 0, topGridSize / 8 ); + for (int x = 0; x < topGridDim; x++) for (int y = 0; y < topGridDim; y++) for (int z = 0; z < topGridDim; z++) + { + uint32_t* gridBase = grid + x * groupDim + y * groupDim * gridDim + z * groupDim * gridDim * gridDim; + bool hasContent = false; + for (int u = 0; u < groupDim; u++) for (int v = 0; v < groupDim; v++) for (int w = 0; w < groupDim; w++) + if (gridBase[u + v * gridDim + w * gridDim * gridDim]) + { + hasContent = true; + goto break3; + } + break3: + if (!hasContent) continue; + uint32_t topIdx = x + y * topGridDim + z * topGridDim * topGridDim; + topGrid[topIdx >> 5] |= 1 << (topIdx & 31); + } +} + +bool VoxelSet::Setup3DDDA( const Ray& ray, const bvhvec3& Dsign, DDAState& state, const bvhint3& step, bvhvec3& tdelta, float& t ) const +{ + // if ray is not inside the object aabb: advance until it is + if (!(ray.O.x >= 0 && ray.O.x <= 1 && ray.O.y >= 0 && ray.O.y <= 1 && ray.O.z >= 0 && ray.O.z <= 1)) + { + float tx1 = -ray.O.x * ray.rD.x, tx2 = (1 - ray.O.x) * ray.rD.x; + float tmin = tinybvh_min( tx1, tx2 ), tmax = tinybvh_max( tx1, tx2 ); + float ty1 = -ray.O.y * ray.rD.y, ty2 = (1 - ray.O.y) * ray.rD.y; + tmin = tinybvh_max( tmin, tinybvh_min( ty1, ty2 ) ); + tmax = tinybvh_min( tmax, tinybvh_max( ty1, ty2 ) ); + float tz1 = -ray.O.z * ray.rD.z, tz2 = (1 - ray.O.z) * ray.rD.z; + tmin = tinybvh_max( tmin, tinybvh_min( tz1, tz2 ) ); + tmax = tinybvh_min( tmax, tinybvh_max( tz1, tz2 ) ); + if (tmax < tmin || tmin > ray.hit.t || tmax < 0) return false; else t = tmin; + } + // setup amanatides & woo - assume object size is 1x1x1, from (0,0,0) to (1,1,1) + static const float cellSize = 1.0f / topGridDim; + const bvhvec3 posInGrid = (ray.O + ray.D * (t + 0.0000025f)) * (float)topGridDim; + const bvhvec3 gridPlanes = (bvhvec3( ceilf( posInGrid.x ), ceilf( posInGrid.y ), ceilf( posInGrid.z ) ) - Dsign) * cellSize; + const bvhint3 P( + tinybvh_clamp( (int)posInGrid.x, 0, topGridDim - 1 ), + tinybvh_clamp( (int)posInGrid.y, 0, topGridDim - 1 ), + tinybvh_clamp( (int)posInGrid.z, 0, topGridDim - 1 ) + ); + state.X = P.x, state.Y = P.y, state.Z = P.z; + state.tmax = (gridPlanes - ray.O) * ray.rD; + tdelta = bvhvec3( (float)step.x, (float)step.y, (float)step.z ) * cellSize * ray.rD; + // proceed with traversal + return true; +} + +bvhvec3 VoxelSet::GetNormal( const Ray& ray ) const +{ + const bvhvec3 I1 = (ray.O + ray.hit.t * ray.D) * (float)objectDim; // our object is (1,1,1) in object space, so this scales each voxel to (1,1,1) + const bvhvec3 fG( I1.x - floorf( I1.x ), I1.y - floorf( I1.y ), I1.z - floorf( I1.z ) ); + const bvhvec3 d = tinybvh_min( fG, 1.0f - fG ); + const float mind = tinybvh_min( tinybvh_min( d.x, d.y ), d.z ); + if (mind == d.x) return bvhvec3( ray.D.x > 0 ? -1.0f : 1.0f, 0, 0 ); + else if (mind == d.y) return bvhvec3( 0, ray.D.y > 0 ? -1.0f : 1.0f, 0 ); + else return bvhvec3( 0, 0, ray.D.z > 0 ? -1.0f : 1.0f ); +} + +int32_t VoxelSet::Intersect( Ray& ray ) const +{ + // setup Amanatides & Woo grid traversal + ALIGNED( 64 ) DDAState l1_, l2_; + const uint32_t xsign = *(uint32_t*)&ray.D.x >> 31; + const uint32_t ysign = *(uint32_t*)&ray.D.y >> 31; + const uint32_t zsign = *(uint32_t*)&ray.D.z >> 31; + const bvhvec3 Dsign = bvhvec3( (float)xsign, (float)ysign, (float)zsign ); + const bvhint3 step( 1 - (int)xsign * 2, 1 - (int)ysign * 2, 1 - (int)zsign * 2 ); + bvhvec3 tdelta; + float t = 0; + if (!Setup3DDDA( ray, Dsign, l1_, step, tdelta, t )) return 0; + const bvhvec3 l2tdelta = tdelta * (1.0f / groupDim); + const bvhvec3 l3tdelta = l2tdelta * (1.0f / brickDim); + uint32_t* gridBase = 0; + int32_t steps = 0; + // start stepping: + while (1) + { + const uint32_t tidx = l1_.X + l1_.Y * topGridDim + l1_.Z * topGridDim * topGridDim; + const uint32_t cell = topGrid[tidx >> 5] & (1 << (tidx & 31)); + if (cell) + { + // setup midlevel traversal + const bvhvec3 posInGrid = (ray.O + (t + 0.0000025f) * ray.D) * (float)gridDim; + const bvhvec3 gridPlanes = (bvhvec3( ceilf( posInGrid.x ), ceilf( posInGrid.y ), ceilf( posInGrid.z ) ) - Dsign) * (1.0f / gridDim); + l2_.X = tinybvh_clamp( (int)posInGrid.x, l1_.X * groupDim, l1_.X * groupDim + (groupDim - 1) ); + l2_.Y = tinybvh_clamp( (int)posInGrid.y, l1_.Y * groupDim, l1_.Y * groupDim + (groupDim - 1) ); + l2_.Z = tinybvh_clamp( (int)posInGrid.z, l1_.Z * groupDim, l1_.Z * groupDim + (groupDim - 1) ); + l2_.tmax = (gridPlanes - ray.O) * ray.rD; + gridBase = grid + ((l2_.X + l2_.Y * gridDim + l2_.Z * gridDim * gridDim) & superMask); + l2_.X &= groupDim - 1, l2_.Y &= groupDim - 1, l2_.Z &= groupDim - 1; + // step through midlevel cells + while (1) + { + const uint32_t brickCell = gridBase[l2_.X + l2_.Y * gridDim + l2_.Z * gridDim * gridDim]; + if (brickCell) + { + // setup 3DDDA for brick traversal + uint32_t* brickData = brick + brickCell * brickSize; + const bvhvec3 posInBrick = (ray.O + (t + 0.0000025f) * ray.D) * (float)objectDim; + uint32_t X = tinybvh_clamp( (int)posInBrick.x - (l2_.X + l1_.X * groupDim) * brickDim, 0, brickDim - 1 ); + uint32_t Y = tinybvh_clamp( (int)posInBrick.y - (l2_.Y + l1_.Y * groupDim) * brickDim, 0, brickDim - 1 ); + uint32_t Z = tinybvh_clamp( (int)posInBrick.z - (l2_.Z + l1_.Z * groupDim) * brickDim, 0, brickDim - 1 ); + const bvhvec3 brickPlanes = (bvhvec3( ceilf( posInBrick.x ), ceilf( posInBrick.y ), ceilf( posInBrick.z ) ) - Dsign) * (1.0f / objectDim); + bvhvec3 tmax = (brickPlanes - ray.O) * ray.rD; + // step through brick + while (1) + { + steps++; + const uint32_t v = brickData[X + Y * brickDim + Z * brickDim * brickDim]; + if (v) + { + ray.hit.t = t; + #if INST_IDX_BITS == 32 + ray.hit.prim = v; + ray.hit.inst = ray.instIdx; // store in dedicated field + #elif INST_IDX_BITS == 8 + ray.hit.prim = v + (ray.instIdx << 24); // store in alpha + #else + ray.hit.prim = v; + ray.hit.u = *(float*)&ray.instIdx; // store in u; hack + #endif + return steps; + } + if (tmax.x < tmax.y) + { + if (tmax.x < tmax.z) + { + if ((X += step.x) >= brickDim) break; + t = tmax.x, tmax.x += l3tdelta.x; + } + else + { + if ((Z += step.z) >= brickDim) break; + t = tmax.z, tmax.z += l3tdelta.z; + } + } + else + { + if (tmax.y < tmax.z) + { + if ((Y += step.y) >= brickDim) break; + t = tmax.y, tmax.y += l3tdelta.y; + } + else + { + if ((Z += step.z) >= brickDim) break; + t = tmax.z, tmax.z += l3tdelta.z; + } + } + } + } + if (l2_.tmax.x < l2_.tmax.y) + { + if (l2_.tmax.x < l2_.tmax.z) + { + if ((l2_.X += step.x) >= groupDim) break; + t = l2_.tmax.x, l2_.tmax.x += l2tdelta.x; + } + else + { + if ((l2_.Z += step.z) >= groupDim) break; + t = l2_.tmax.z, l2_.tmax.z += l2tdelta.z; + } + } + else + { + if (l2_.tmax.y < l2_.tmax.z) + { + if ((l2_.Y += step.y) >= groupDim) break; + t = l2_.tmax.y, l2_.tmax.y += l2tdelta.y; + } + else + { + if ((l2_.Z += step.z) >= groupDim) break; + t = l2_.tmax.z, l2_.tmax.z += l2tdelta.z; + } + } + } + } + if (l1_.tmax.x < l1_.tmax.y) + { + if (l1_.tmax.x < l1_.tmax.z) + { + if ((l1_.X += step.x) >= topGridDim) break; + t = l1_.tmax.x, l1_.tmax.x += tdelta.x; + } + else + { + if ((l1_.Z += step.z) >= topGridDim) break; + t = l1_.tmax.z, l1_.tmax.z += tdelta.z; + } + } + else + { + if (l1_.tmax.y < l1_.tmax.z) + { + if ((l1_.Y += step.y) >= topGridDim) break; + t = l1_.tmax.y, l1_.tmax.y += tdelta.y; + } + else + { + if ((l1_.Z += step.z) >= topGridDim) break; + t = l1_.tmax.z, l1_.tmax.z += tdelta.z; + } + } + } + return 0; +} + +bool VoxelSet::IsOccluded( const Ray& ray ) const +{ + // setup Amanatides & Woo grid traversal + ALIGNED( 64 ) DDAState l1_, l2_; + const uint32_t xsign = *(uint32_t*)&ray.D.x >> 31; + const uint32_t ysign = *(uint32_t*)&ray.D.y >> 31; + const uint32_t zsign = *(uint32_t*)&ray.D.z >> 31; + const bvhvec3 Dsign = bvhvec3( (float)xsign, (float)ysign, (float)zsign ); + const bvhint3 step( 1 - (int)xsign * 2, 1 - (int)ysign * 2, 1 - (int)zsign * 2 ); + bvhvec3 tdelta; + float t = 0; + if (!Setup3DDDA( ray, Dsign, l1_, step, tdelta, t )) return false; + const bvhvec3 l2tdelta = tdelta * (1.0f / groupDim); + const bvhvec3 l3tdelta = l2tdelta * (1.0f / brickDim); + uint32_t* gridBase = 0; + // start stepping: + while (t < ray.hit.t) + { + const uint32_t tidx = l1_.X + l1_.Y * topGridDim + l1_.Z * topGridDim * topGridDim; + const uint32_t cell = topGrid[tidx >> 5] & (1 << (tidx & 31)); + if (cell) + { + // setup midlevel traversal + const bvhvec3 posInGrid = (ray.O + (t + 0.0000025f) * ray.D) * (float)gridDim; + const bvhvec3 gridPlanes = (bvhvec3( ceilf( posInGrid.x ), ceilf( posInGrid.y ), ceilf( posInGrid.z ) ) - Dsign) * (1.0f / gridDim); + l2_.X = tinybvh_clamp( (int)posInGrid.x, l1_.X * groupDim, l1_.X * groupDim + (groupDim - 1) ); + l2_.Y = tinybvh_clamp( (int)posInGrid.y, l1_.Y * groupDim, l1_.Y * groupDim + (groupDim - 1) ); + l2_.Z = tinybvh_clamp( (int)posInGrid.z, l1_.Z * groupDim, l1_.Z * groupDim + (groupDim - 1) ); + l2_.tmax = (gridPlanes - ray.O) * ray.rD; + gridBase = grid + ((l2_.X + l2_.Y * gridDim + l2_.Z * gridDim * gridDim) & superMask); + l2_.X &= groupDim - 1, l2_.Y &= groupDim - 1, l2_.Z &= groupDim - 1; + // step through midlevel cells + while (1) + { + const uint32_t brickCell = gridBase[l2_.X + l2_.Y * gridDim + l2_.Z * gridDim * gridDim]; + if (brickCell) + { + // setup 3DDDA for brick traversal + uint32_t* brickData = brick + brickCell * brickSize; + const bvhvec3 posInBrick = (ray.O + (t + 0.0000025f) * ray.D) * (float)objectDim; + uint32_t X = tinybvh_clamp( (int)posInBrick.x - (l2_.X + l1_.X * groupDim) * brickDim, 0u, brickDim - 1 ); + uint32_t Y = tinybvh_clamp( (int)posInBrick.y - (l2_.Y + l1_.Y * groupDim) * brickDim, 0u, brickDim - 1 ); + uint32_t Z = tinybvh_clamp( (int)posInBrick.z - (l2_.Z + l1_.Z * groupDim) * brickDim, 0u, brickDim - 1 ); + const bvhvec3 brickPlanes = (bvhvec3( ceilf( posInBrick.x ), ceilf( posInBrick.y ), ceilf( posInBrick.z ) ) - Dsign) * (1.0f / objectDim); + bvhvec3 tmax = (brickPlanes - ray.O) * ray.rD; + // step through brick + while (1) + { + const uint32_t v = brickData[X + Y * brickDim + Z * brickDim * brickDim]; + if (v) return t < ray.hit.t; + if (tmax.x < tmax.y) + { + if (tmax.x < tmax.z) + { + if ((X += step.x) >= brickDim) break; + t = tmax.x, tmax.x += l3tdelta.x; + } + else + { + if ((Z += step.z) >= brickDim) break; + t = tmax.z, tmax.z += l3tdelta.z; + } + } + else + { + if (tmax.y < tmax.z) + { + if ((Y += step.y) >= brickDim) break; + t = tmax.y, tmax.y += l3tdelta.y; + } + else + { + if ((Z += step.z) >= brickDim) break; + t = tmax.z, tmax.z += l3tdelta.z; + } + } + } + } + if (l2_.tmax.x < l2_.tmax.y) + { + if (l2_.tmax.x < l2_.tmax.z) + { + if ((l2_.X += step.x) >= groupDim) break; + t = l2_.tmax.x, l2_.tmax.x += l2tdelta.x; + } + else + { + if ((l2_.Z += step.z) >= groupDim) break; + t = l2_.tmax.z, l2_.tmax.z += l2tdelta.z; + } + } + else + { + if (l2_.tmax.y < l2_.tmax.z) + { + if ((l2_.Y += step.y) >= groupDim) break; + t = l2_.tmax.y, l2_.tmax.y += l2tdelta.y; + } + else + { + if ((l2_.Z += step.z) >= groupDim) break; + t = l2_.tmax.z, l2_.tmax.z += l2tdelta.z; + } + } + } + } + if (l1_.tmax.x < l1_.tmax.y) + { + if (l1_.tmax.x < l1_.tmax.z) + { + if ((l1_.X += step.x) >= topGridDim) break; + t = l1_.tmax.x, l1_.tmax.x += tdelta.x; + } + else + { + if ((l1_.Z += step.z) >= topGridDim) break; + t = l1_.tmax.z, l1_.tmax.z += tdelta.z; + } + } + else + { + if (l1_.tmax.y < l1_.tmax.z) + { + if ((l1_.Y += step.y) >= topGridDim) break; + t = l1_.tmax.y, l1_.tmax.y += tdelta.y; + } + else + { + if ((l1_.Z += step.z) >= topGridDim) break; + t = l1_.tmax.z, l1_.tmax.z += tdelta.z; + } + } + } + // we shouldn't get here + return false; +} + +// BVH_Verbose implementation +// ---------------------------------------------------------------------------- + +void BVH_Verbose::ConvertFrom( const BVH& original, bool /* unused here */ ) +{ + // allocate space + uint32_t spaceNeeded = original.triCount * (refittable ? 2 : 3); + if (allocatedNodes < spaceNeeded) + { + AlignedFree( bvhNode ); + bvhNode = (BVHNode*)AlignedAlloc( sizeof( BVHNode ) * spaceNeeded ); + allocatedNodes = spaceNeeded; + } + memset( bvhNode, 0, sizeof( BVHNode ) * spaceNeeded ); + CopyBasePropertiesFrom( original ); + this->verts = original.verts; + this->fragment = original.fragment; + this->primIdx = original.primIdx; + bvhNode[0].parent = 0xffffffff; // root sentinel + // convert + uint32_t nodeIdx = 0, parent = 0xffffffff, stack[128], stackPtr = 0; + while (1) + { + const BVH::BVHNode& orig = original.bvhNode[nodeIdx]; + bvhNode[nodeIdx].aabbMin = orig.aabbMin, bvhNode[nodeIdx].aabbMax = orig.aabbMax; + bvhNode[nodeIdx].triCount = orig.triCount, bvhNode[nodeIdx].parent = parent; + if (orig.isLeaf()) + { + bvhNode[nodeIdx].firstTri = orig.leftFirst; + if (stackPtr == 0) break; + nodeIdx = stack[--stackPtr]; + parent = stack[--stackPtr]; + } + else + { + bvhNode[nodeIdx].left = orig.leftFirst; + bvhNode[nodeIdx].right = orig.leftFirst + 1; + stack[stackPtr++] = nodeIdx; + stack[stackPtr++] = orig.leftFirst + 1; + parent = nodeIdx; + nodeIdx = orig.leftFirst; + } + } + usedNodes = original.usedNodes; +} + +int32_t BVH_Verbose::NodeCount() const +{ + // Determine the number of nodes in the tree. Typically the result should + // be usedNodes - 1 (second node is always unused), but some builders may + // have unused nodes besides node 1. TODO: Support more layouts. + uint32_t retVal = 0, nodeIdx = 0, stack[64], stackPtr = 0; + while (1) + { + const BVHNode& n = bvhNode[nodeIdx]; + retVal++; + if (n.isLeaf()) { if (stackPtr == 0) break; else nodeIdx = stack[--stackPtr]; } + else nodeIdx = n.left, stack[stackPtr++] = n.right; + } + return retVal; +} + +float BVH_Verbose::SAHCost( const uint32_t nodeIdx ) const +{ + // Determine the SAH cost of the tree. This provides an indication + // of the quality of the BVH: Lower is better. + const BVHNode& n = bvhNode[nodeIdx]; + const float SAn = SA( n.aabbMin, n.aabbMax ); + if (n.isLeaf()) return c_int * SAn * n.triCount; + float cost = c_trav * SAn + SAHCost( n.left ) + SAHCost( n.right ); + return nodeIdx == 0 ? (cost / SAn) : cost; +} + +void BVH_Verbose::Refit( const uint32_t nodeIdx, bool skipLeafs ) +{ + BVH_FATAL_ERROR_IF( !refittable && !skipLeafs, "BVH_Verbose::Refit( .. ), refitting an SBVH." ); + BVH_FATAL_ERROR_IF( bvhNode == 0, "BVH_Verbose::Refit( .. ), bvhNode == 0." ); + BVH_FATAL_ERROR_IF( bvh_over_indices && !skipLeafs, "BVH_Verbose::Refit( .. ), bvh used indexed tris." ); + BVHNode& node = bvhNode[nodeIdx]; + if (node.isLeaf()) // leaf: adjust to current triangle vertex positions + { + if (skipLeafs) return; + bvhvec3 bmin( BVH_FAR ), bmax( -BVH_FAR ); + for (uint32_t first = node.firstTri, j = 0; j < node.triCount; j++) + { + const uint32_t vertIdx = primIdx[first + j] * 3; + const bvhvec3 v0 = verts[vertIdx]; + const bvhvec3 v1 = verts[vertIdx + 1]; + const bvhvec3 v2 = verts[vertIdx + 2]; + bmin = tinybvh_min( bmin, v0 ), bmax = tinybvh_max( bmax, v0 ); + bmin = tinybvh_min( bmin, v1 ), bmax = tinybvh_max( bmax, v1 ); + bmin = tinybvh_min( bmin, v2 ), bmax = tinybvh_max( bmax, v2 ); + } + node.aabbMin = bmin, node.aabbMax = bmax; + } + else + { + Refit( node.left, skipLeafs ); + Refit( node.right, skipLeafs ); + node.aabbMin = tinybvh_min( bvhNode[node.left].aabbMin, bvhNode[node.right].aabbMin ); + node.aabbMax = tinybvh_max( bvhNode[node.left].aabbMax, bvhNode[node.right].aabbMax ); + } + if (nodeIdx == 0) aabbMin = node.aabbMin, aabbMax = node.aabbMax; +} + +void BVH_Verbose::CheckFit( const uint32_t nodeIdx, bool skipLeafs ) +{ + BVHNode& node = bvhNode[nodeIdx]; + bvhvec3 bmin( BVH_FAR ), bmax( -BVH_FAR ); + if (node.isLeaf()) // leaf: adjust to current triangle vertex positions + { + if (skipLeafs) return; + for (uint32_t first = node.firstTri, j = 0; j < node.triCount; j++) + { + const uint32_t vertIdx = primIdx[first + j] * 3; + const bvhvec3 v0 = verts[vertIdx]; + const bvhvec3 v1 = verts[vertIdx + 1]; + const bvhvec3 v2 = verts[vertIdx + 2]; + bmin = tinybvh_min( bmin, v0 ), bmax = tinybvh_max( bmax, v0 ); + bmin = tinybvh_min( bmin, v1 ), bmax = tinybvh_max( bmax, v1 ); + bmin = tinybvh_min( bmin, v2 ), bmax = tinybvh_max( bmax, v2 ); + } + } + else + { + CheckFit( node.left, skipLeafs ); + CheckFit( node.right, skipLeafs ); + bmin = tinybvh_min( bvhNode[node.left].aabbMin, bvhNode[node.right].aabbMin ); + bmax = tinybvh_max( bvhNode[node.left].aabbMax, bvhNode[node.right].aabbMax ); + } +} + +void BVH_Verbose::Compact() +{ + BVH_FATAL_ERROR_IF( bvhNode == 0, "BVH_Verbose::Compact(), bvhNode == 0." ); + if (bvhNode[0].isLeaf()) return; // nothing to compact. + BVHNode* tmp = (BVHNode*)AlignedAlloc( sizeof( BVHNode ) * usedNodes ); + memcpy( tmp, bvhNode, 2 * sizeof( BVHNode ) ); + uint32_t newNodePtr = 2, nodeIdx = 0, stack[64], stackPtr = 0; + while (1) + { + BVHNode& node = tmp[nodeIdx]; + const BVHNode& left = bvhNode[node.left]; + const BVHNode& right = bvhNode[node.right]; + tmp[newNodePtr] = left, tmp[newNodePtr + 1] = right; + const uint32_t todo1 = newNodePtr, todo2 = newNodePtr + 1; + node.left = newNodePtr++, node.right = newNodePtr++; + if (!left.isLeaf()) stack[stackPtr++] = todo1; + if (!right.isLeaf()) stack[stackPtr++] = todo2; + if (!stackPtr) break; + nodeIdx = stack[--stackPtr]; + } + usedNodes = newNodePtr; + AlignedFree( bvhNode ); + bvhNode = tmp; +} + +void BVH_Verbose::SortIndices() +{ + // create a new primIdx array which has the primitive indices sorted by depth-first traversal order. + uint32_t nodeIdx = 0, stack[256], stackPtr = 0, * tmp = new uint32_t[triCount], nextIdx = 0; + while (1) + { + BVHNode& node = bvhNode[nodeIdx]; + if (node.isLeaf()) + { + uint32_t tmpFirst = nextIdx; + for (unsigned i = 0; i < node.triCount; i++) tmp[nextIdx++] = primIdx[node.firstTri + i]; + node.firstTri = tmpFirst; + if (stackPtr == 0) break; else nodeIdx = stack[--stackPtr]; + continue; + } + nodeIdx = node.left; + stack[stackPtr++] = node.right; + } + memcpy( primIdx, tmp, triCount * 4 ); + delete[] tmp; +} + +void BVH_Verbose::Optimize( const uint32_t iterations, const bool extreme, bool stochastic ) +{ + // allocate array for sorting; size is upper-bound. + SortItem* sortList = (SortItem*)AlignedAlloc( usedNodes * sizeof( SortItem ) ); + // optimize by reinserting subtrees with a high cost - Section 3.4 of the paper. + for (uint32_t i = 0; i < iterations; i++) + { + // calculate combined cost for all nodes + uint32_t interiorNodes = 0; + for (uint32_t j = 2; j < usedNodes; j++) + { + const BVHNode& node = bvhNode[j]; + if (node.isLeaf()) continue; + if (node.parent == 0) continue; + if (bvhNode[node.parent].parent == 0) continue; + const float A = node.SA(), AL = bvhNode[node.left].SA(), AR = bvhNode[node.right].SA(); + float Mmin = A / tinybvh_min( 1e-10f, tinybvh_min( AL, AR ) ); + float Msum = A / tinybvh_min( 1e-10f, 0.5f * (AL + AR) ); + float Mcomb = A * Msum * Mmin; + sortList[interiorNodes].idx = j, sortList[interiorNodes++].cost = Mcomb; + } + // last couple of iterations we will process more nodes. + const float portion = stochastic ? 0.5f : (extreme ? (0.01f + (0.6f * (float)i) / (float)iterations) : 0.01f); + const int limit = (uint32_t)(portion * (float)interiorNodes); + const int step = tinybvh_max( 1, (int)(portion / 0.02f) ); + // sort list - partial quick sort. + struct Task { uint32_t first, last; } stack[4096]; + int pivot, first = 0, last = (int)interiorNodes - 1, stackPtr = 0; + while (1) + { + if (first >= last) + { + if (stackPtr == 0) break; else first = stack[--stackPtr].first, last = stack[stackPtr].last; + continue; + } + pivot = first; + SortItem t, e = sortList[first]; + for (int j = first + 1; j <= last; j++) if (sortList[j].cost > e.cost) + t = sortList[j], sortList[j] = sortList[++pivot], sortList[pivot] = t; + t = sortList[pivot], sortList[pivot] = sortList[first], sortList[first] = t; + if (pivot < limit) stack[stackPtr].first = pivot + 1, stack[stackPtr++].last = last; + last = pivot - 1; + } + // reinsert selected nodes + BVHNode bckp[5]; + int start = 0; + if (stochastic) + { + float r = (float)rand() / RAND_MAX; + r = tinybvh_max( 0.0f, (r * 1.2f) - 0.3f ); // 0 .. 0.9f + start = (int)((float)limit * r); + } + bool finishingTouch = false; + for (int j = start; j < limit; j += stochastic ? ((rand() & 63) + 1) : step) + { + // prepare change + const uint32_t Nid = sortList[j].idx; + BVHNode& N = bvhNode[Nid]; + if (N.parent == 0) continue; + const uint32_t Pid = N.parent; + BVHNode& P = bvhNode[Pid]; + if (P.parent == 0) continue; + const uint32_t X1 = P.parent, X2 = (P.left == Nid ? P.right : P.left); + // compute SAH before change + float sahBefore = SAHCostUp( Nid ); + // execute change + bckp[0] = bvhNode[X1]; + if (bvhNode[X1].left == Pid) bvhNode[X1].left = X2; + else /* verbose[X1].right == Pid */ bvhNode[X1].right = X2; + const uint32_t p2 = bvhNode[X2].parent; + bvhNode[X2].parent = X1; + const uint32_t Lid = N.left, Rid = N.right; + RefitUp( X2 ); + // ReinsertNode( L, Nid ); ReinsertNode( R, Pid ); + const uint32_t Xbest1 = FindBestNewPosition( Lid ), XA = bvhNode[Xbest1].parent; + sahBefore += SAHCostUp( Xbest1 ); + bckp[1] = bvhNode[Nid]; + N.left = Xbest1, N.right = Lid, N.parent = XA; + bckp[2] = bvhNode[XA]; + if (bvhNode[XA].left == Xbest1) bvhNode[XA].left = Nid; else bvhNode[XA].right = Nid; + const uint32_t p3 = bvhNode[Xbest1].parent, p4 = bvhNode[Lid].parent; + bvhNode[Xbest1].parent = Nid, bvhNode[Lid].parent = Nid; + RefitUp( Nid ); + const uint32_t Xbest2 = FindBestNewPosition( Rid ), XB = bvhNode[Xbest2].parent; + sahBefore += SAHCostUp( Xbest2 ); + bckp[3] = bvhNode[Pid]; + P.left = Xbest2, P.right = Rid, P.parent = XB; + bckp[4] = bvhNode[XB]; + if (bvhNode[XB].left == Xbest2) bvhNode[XB].left = Pid; else bvhNode[XB].right = Pid; + const uint32_t p1 = bvhNode[Xbest2].parent, p0 = bvhNode[Rid].parent; + bvhNode[Xbest2].parent = Pid, bvhNode[Rid].parent = Pid; + RefitUp( Pid ); + // compute SAH after change + float sahAfter = SAHCostUp( X1 ) + SAHCostUp( Nid ) + SAHCostUp( Pid ); + if (finishingTouch && (sahBefore / sahAfter > 1.01f)) break; + if (sahAfter < sahBefore) continue; + // undo change, mind the order. + bvhNode[Rid].parent = p0, bvhNode[Xbest2].parent = p1, bvhNode[XB] = bckp[4]; + bvhNode[Pid] = bckp[3], bvhNode[Lid].parent = p4, bvhNode[Xbest1].parent = p3; + bvhNode[XA] = bckp[2], bvhNode[Nid] = bckp[1], bvhNode[X2].parent = p2, bvhNode[X1] = bckp[0]; + RefitUp( XB ); + RefitUp( XA ); + RefitUp( Nid ); + } + Refit( 0, true ); + } + AlignedFree( sortList ); +} + +// Single-primitive leafs: Prepare the BVH for optimization. While it is not strictly +// necessary to have a single primitive per leaf, it will yield a slightly better +// optimized BVH. The leafs of the optimized BVH should be collapsed ('MergeLeafs') +// to obtain the final tree. +void BVH_Verbose::SplitLeafs( const uint32_t maxPrims ) +{ + uint32_t nodeIdx = 0, stack[64], stackPtr = 0; + while (1) + { + BVHNode& node = bvhNode[nodeIdx]; + if (!node.isLeaf()) nodeIdx = node.left, stack[stackPtr++] = node.right; else + { + // split this leaf + if (node.triCount > maxPrims) + { + const uint32_t newIdx1 = usedNodes++, newIdx2 = usedNodes++; + BVHNode& new1 = bvhNode[newIdx1], & new2 = bvhNode[newIdx2]; + new1.firstTri = node.firstTri, new1.triCount = node.triCount / 2; + new1.parent = new2.parent = nodeIdx, new1.left = new1.right = 0; + new2.firstTri = node.firstTri + new1.triCount; + new2.triCount = node.triCount - new1.triCount, new2.left = new2.right = 0; + node.left = newIdx1, node.right = newIdx2, node.triCount = 0; + new1.aabbMin = new2.aabbMin = bvhvec3( BVH_FAR ), new1.aabbMax = new2.aabbMax = bvhvec3( -BVH_FAR ); + for (uint32_t fi, i = 0; i < new1.triCount; i++) + fi = primIdx[new1.firstTri + i], + new1.aabbMin = tinybvh_min( new1.aabbMin, fragment[fi].bmin ), + new1.aabbMax = tinybvh_max( new1.aabbMax, fragment[fi].bmax ); + for (uint32_t fi, i = 0; i < new2.triCount; i++) + fi = primIdx[new2.firstTri + i], + new2.aabbMin = tinybvh_min( new2.aabbMin, fragment[fi].bmin ), + new2.aabbMax = tinybvh_max( new2.aabbMax, fragment[fi].bmax ); + // recurse + if (new1.triCount > 1) stack[stackPtr++] = newIdx1; + if (new2.triCount > 1) stack[stackPtr++] = newIdx2; + } + if (stackPtr == 0) break; else nodeIdx = stack[--stackPtr]; + } + } +} + +// MergeLeafs: After optimizing a BVH, single-primitive leafs should be merged whenever +// SAH indicates this is an improvement. +void BVH_Verbose::MergeLeafs() +{ + // allocate some working space + uint32_t* subtreeTriCount = (uint32_t*)AlignedAlloc( usedNodes * 4 ); + uint32_t* newIdx = (uint32_t*)AlignedAlloc( idxCount * 4 ); + memset( subtreeTriCount, 0, usedNodes * 4 ); + CountSubtreeTris( 0, subtreeTriCount ); + uint32_t stack[64], stackPtr = 0, nodeIdx = 0, newIdxPtr = 0; + while (1) + { + BVHNode& node = bvhNode[nodeIdx]; + if (node.isLeaf()) + { + uint32_t start = newIdxPtr; + MergeSubtree( nodeIdx, newIdx, newIdxPtr ); + node.firstTri = start; + // pop new task + if (stackPtr == 0) break; + nodeIdx = stack[--stackPtr]; + } + else + { + const uint32_t leftCount = subtreeTriCount[node.left]; + const uint32_t rightCount = subtreeTriCount[node.right]; + const uint32_t mergedCount = leftCount + rightCount; + // cost of unsplit + float Cunsplit = SA( node.aabbMin, node.aabbMax ) * mergedCount * c_int; + // cost of leaving things as they are + BVHNode& left = bvhNode[node.left]; + BVHNode& right = bvhNode[node.right]; + float Ckeepsplit = c_trav + c_int * (left.SA() * leftCount + right.SA() * rightCount); + if (Cunsplit <= Ckeepsplit) + { + // collapse the subtree + uint32_t start = newIdxPtr; + MergeSubtree( nodeIdx, newIdx, newIdxPtr ); + node.firstTri = start, node.triCount = mergedCount; + node.left = node.right = 0; + // pop new task + if (stackPtr == 0) break; + nodeIdx = stack[--stackPtr]; + } + else /* recurse */ nodeIdx = node.left, stack[stackPtr++] = node.right; + } + } + // cleanup + AlignedFree( subtreeTriCount ); + AlignedFree( primIdx ); + primIdx = newIdx, may_have_holes = true; // all over the place, in fact +} + +// BVH_GPU implementation +// ---------------------------------------------------------------------------- + +BVH_GPU::~BVH_GPU() +{ + if (!ownBVH) bvh = BVH(); // clear out pointers we don't own. + AlignedFree( bvhNode ); +} + +void BVH_GPU::Build( const bvhvec4* vertices, const uint32_t primCount ) +{ + Build( bvhvec4slice( vertices, primCount * 3, sizeof( bvhvec4 ) ) ); +} + +void BVH_GPU::Build( const bvhvec4slice& vertices ) +{ + bvh.context = context; + bvh.BuildDefault( vertices ); + ConvertFrom( bvh, false ); +} + +void BVH_GPU::Build( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ) +{ + // build the BVH with a continuous array of bvhvec4 vertices, indexed by 'indices'. + Build( bvhvec4slice{ vertices, prims * 3, sizeof( bvhvec4 ) }, indices, prims ); +} + +void BVH_GPU::Build( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ) +{ + // build the BVH from vertices stored in a slice, indexed by 'indices'. + bvh.context = context; + bvh.BuildDefault( vertices, indices, prims ); + ConvertFrom( bvh, false ); +} + +void BVH_GPU::Build( BLASInstance* instances, const uint32_t instCount, BVHBase** blasses, const uint32_t blasCount ) +{ + // build a TLAS based on the array of BLASInstance records. + bvh.context = context; + bvh.Build( instances, instCount, blasses, blasCount ); + ConvertFrom( bvh, false ); +} + +void BVH_GPU::BuildHQ( const bvhvec4* vertices, const uint32_t primCount ) +{ + BuildHQ( bvhvec4slice( vertices, primCount * 3, sizeof( bvhvec4 ) ) ); +} + +void BVH_GPU::BuildHQ( const bvhvec4slice& vertices ) +{ + bvh.BuildHQ( vertices ); + ConvertFrom( bvh, false ); +} + +void BVH_GPU::BuildHQ( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ) +{ + BuildHQ( bvhvec4slice{ vertices, prims * 3, sizeof( bvhvec4 ) }, indices, prims ); +} + +void BVH_GPU::BuildHQ( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ) +{ + bvh.context = context; + bvh.BuildHQ( vertices, indices, prims ); + ConvertFrom( bvh, false ); +} + +void BVH_GPU::Optimize( const uint32_t iterations, bool extreme ) +{ + bvh.Optimize( iterations, extreme ); + ConvertFrom( bvh, false ); +} + +void BVH_GPU::ConvertFrom( const BVH& original, bool compact ) +{ + // get a copy of the original bvh + if (&original != &bvh) ownBVH = false; // bvh isn't ours; don't delete in destructor. + bvh = original; + // allocate space + const uint32_t spaceNeeded = compact ? original.usedNodes : original.allocatedNodes; + if (allocatedNodes < spaceNeeded) + { + AlignedFree( bvhNode ); + bvhNode = (BVHNode*)AlignedAlloc( sizeof( BVHNode ) * spaceNeeded ); + allocatedNodes = spaceNeeded; + } + memset( bvhNode, 0, sizeof( BVHNode ) * spaceNeeded ); + CopyBasePropertiesFrom( original ); + // recursively convert nodes + uint32_t newNodePtr = 0, nodeIdx = 0, stack[128], stackPtr = 0; + while (1) + { + const BVH::BVHNode& orig = original.bvhNode[nodeIdx]; + const uint32_t idx = newNodePtr++; + if (orig.isLeaf()) + { + this->bvhNode[idx].triCount = orig.triCount; + this->bvhNode[idx].firstTri = orig.leftFirst; + if (!stackPtr) break; + nodeIdx = stack[--stackPtr]; + uint32_t newNodeParent = stack[--stackPtr]; + this->bvhNode[newNodeParent].right = newNodePtr; + } + else + { + const BVH::BVHNode& left = original.bvhNode[orig.leftFirst]; + const BVH::BVHNode& right = original.bvhNode[orig.leftFirst + 1]; + this->bvhNode[idx].lmin = left.aabbMin, this->bvhNode[idx].rmin = right.aabbMin; + this->bvhNode[idx].lmax = left.aabbMax, this->bvhNode[idx].rmax = right.aabbMax; + this->bvhNode[idx].left = newNodePtr; // right will be filled when popped + stack[stackPtr++] = idx; + stack[stackPtr++] = orig.leftFirst + 1; + nodeIdx = orig.leftFirst; + } + } + usedNodes = newNodePtr; +} + +int32_t BVH_GPU::Intersect( Ray& ray ) const +{ + VALIDATE_RAY( ray ); + BVHNode* node = &bvhNode[0], * stack[64]; + const bvhvec4slice& verts = bvh.verts; + const uint32_t* primIdx = bvh.primIdx; + uint32_t stackPtr = 0; + float cost = 0; + while (1) + { + cost += c_trav; + if (node->isLeaf()) + { + if (indexedEnabled && bvh.vertIdx != 0) for (uint32_t i = 0; i < node->triCount; i++, cost += c_int) + { + const uint32_t pi = primIdx[node->firstTri + i]; + const uint32_t i0 = bvh.vertIdx[pi * 3], i1 = bvh.vertIdx[pi * 3 + 1], i2 = bvh.vertIdx[pi * 3 + 2]; + IntersectTri( ray, pi, verts, i0, i1, i2 ); + } + else for (uint32_t i = 0; i < node->triCount; i++, cost += c_int) + { + const uint32_t pi = primIdx[node->firstTri + i]; + IntersectTri( ray, pi, verts, pi * 3, pi * 3 + 1, pi * 3 + 2 ); + } + if (stackPtr == 0) break; else node = stack[--stackPtr]; + continue; + } + const bvhvec3 lmin = node->lmin - ray.O, lmax = node->lmax - ray.O; + const bvhvec3 rmin = node->rmin - ray.O, rmax = node->rmax - ray.O; + float dist1 = BVH_FAR, dist2 = BVH_FAR; + const bvhvec3 t1a = lmin * ray.rD, t2a = lmax * ray.rD; + const bvhvec3 t1b = rmin * ray.rD, t2b = rmax * ray.rD; + const float tmina = tinybvh_max( tinybvh_max( tinybvh_min( t1a.x, t2a.x ), tinybvh_min( t1a.y, t2a.y ) ), tinybvh_min( t1a.z, t2a.z ) ); + const float tmaxa = tinybvh_min( tinybvh_min( tinybvh_max( t1a.x, t2a.x ), tinybvh_max( t1a.y, t2a.y ) ), tinybvh_max( t1a.z, t2a.z ) ); + const float tminb = tinybvh_max( tinybvh_max( tinybvh_min( t1b.x, t2b.x ), tinybvh_min( t1b.y, t2b.y ) ), tinybvh_min( t1b.z, t2b.z ) ); + const float tmaxb = tinybvh_min( tinybvh_min( tinybvh_max( t1b.x, t2b.x ), tinybvh_max( t1b.y, t2b.y ) ), tinybvh_max( t1b.z, t2b.z ) ); + if (tmaxa >= tmina && tmina < ray.hit.t && tmaxa >= 0) dist1 = tmina; + if (tmaxb >= tminb && tminb < ray.hit.t && tmaxb >= 0) dist2 = tminb; + uint32_t lidx = node->left, ridx = node->right; + if (dist1 > dist2) + { + float t = dist1; dist1 = dist2; dist2 = t; + uint32_t i = lidx; lidx = ridx; ridx = i; + } + if (dist1 == BVH_FAR) + { + if (stackPtr == 0) break; else node = stack[--stackPtr]; + } + else + { + node = bvhNode + lidx; + if (dist2 != BVH_FAR) stack[stackPtr++] = bvhNode + ridx; + } + } + return (int32_t)cost; // cast to not break interface. +} + +// BVH_SoA implementation +// ---------------------------------------------------------------------------- + +BVH_SoA::~BVH_SoA() +{ + if (!ownBVH) bvh = BVH(); // clear out pointers we don't own. + AlignedFree( bvhNode ); +} + +void BVH_SoA::Build( const bvhvec4* vertices, const uint32_t primCount ) +{ + Build( bvhvec4slice( vertices, primCount * 3, sizeof( bvhvec4 ) ) ); +} + +void BVH_SoA::Build( const bvhvec4slice& vertices ) +{ + bvh.context = context; // properly propagate context to fix issue #66. + bvh.BuildDefault( vertices ); + ConvertFrom( bvh, false ); +} + +void BVH_SoA::Build( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ) +{ + // build the BVH with a continuous array of bvhvec4 vertices, indexed by 'indices'. + Build( bvhvec4slice{ vertices, prims * 3, sizeof( bvhvec4 ) }, indices, prims ); +} + +void BVH_SoA::Build( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ) +{ + // build the BVH from vertices stored in a slice, indexed by 'indices'. + bvh.context = context; + bvh.BuildDefault( vertices, indices, prims ); + ConvertFrom( bvh, false ); +} + +void BVH_SoA::BuildHQ( const bvhvec4* vertices, const uint32_t primCount ) +{ + BuildHQ( bvhvec4slice( vertices, primCount * 3, sizeof( bvhvec4 ) ) ); +} + +void BVH_SoA::BuildHQ( const bvhvec4slice& vertices ) +{ + bvh.context = context; // properly propagate context to fix issue #66. + bvh.BuildHQ( vertices ); + ConvertFrom( bvh, false ); +} + +void BVH_SoA::BuildHQ( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ) +{ + BuildHQ( bvhvec4slice{ vertices, prims * 3, sizeof( bvhvec4 ) }, indices, prims ); +} + +void BVH_SoA::BuildHQ( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ) +{ + bvh.context = context; + bvh.BuildHQ( vertices, indices, prims ); + ConvertFrom( bvh, false ); +} + +void BVH_SoA::Optimize( const uint32_t iterations, bool extreme ) +{ + bvh.Optimize( iterations, extreme ); + ConvertFrom( bvh, false ); +} + +void BVH_SoA::Save( const char* fileName ) +{ + bvh.Save( fileName ); +} + +bool BVH_SoA::Load( const char* fileName, const bvhvec4* vertices, const uint32_t primCount ) +{ + return Load( fileName, bvhvec4slice{ vertices, primCount * 3, sizeof( bvhvec4 ) } ); +} + +bool BVH_SoA::Load( const char* fileName, const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ) +{ + return Load( fileName, bvhvec4slice{ vertices, primCount * 3, sizeof( bvhvec4 ) }, indices, primCount ); +} + +bool BVH_SoA::Load( const char* fileName, const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ) +{ + if (!bvh.Load( fileName, vertices, indices, primCount )) return false; + ConvertFrom( bvh, false ); + return true; +} + +void BVH_SoA::ConvertFrom( const BVH& original, bool compact ) +{ + // get a copy of the original bvh + if (&original != &bvh) ownBVH = false; // bvh isn't ours; don't delete in destructor. + bvh = original; + // allocate space + const uint32_t spaceNeeded = compact ? bvh.usedNodes : bvh.allocatedNodes; + if (allocatedNodes < spaceNeeded) + { + AlignedFree( bvhNode ); + bvhNode = (BVHNode*)AlignedAlloc( sizeof( BVHNode ) * spaceNeeded ); + allocatedNodes = spaceNeeded; + } + memset( bvhNode, 0, sizeof( BVHNode ) * spaceNeeded ); + CopyBasePropertiesFrom( bvh ); + // recursively convert nodes + uint32_t newAlt2Node = 0, nodeIdx = 0, stack[128], stackPtr = 0; + while (1) + { + const BVH::BVHNode& node = bvh.bvhNode[nodeIdx]; + const uint32_t idx = newAlt2Node++; + if (node.isLeaf()) + { + bvhNode[idx].triCount = node.triCount; + bvhNode[idx].firstTri = node.leftFirst; + if (!stackPtr) break; + nodeIdx = stack[--stackPtr]; + uint32_t newNodeParent = stack[--stackPtr]; + bvhNode[newNodeParent].right = newAlt2Node; + } + else + { + const BVH::BVHNode& left = bvh.bvhNode[node.leftFirst]; + const BVH::BVHNode& right = bvh.bvhNode[node.leftFirst + 1]; + // This BVH layout requires BVH_USEAVX/BVH_USENEON for traversal, but at least we + // can convert to it without SSE/AVX/NEON support. + bvhNode[idx].xxxx = SIMD_SETRVEC( left.aabbMin.x, left.aabbMax.x, right.aabbMin.x, right.aabbMax.x ); + bvhNode[idx].yyyy = SIMD_SETRVEC( left.aabbMin.y, left.aabbMax.y, right.aabbMin.y, right.aabbMax.y ); + bvhNode[idx].zzzz = SIMD_SETRVEC( left.aabbMin.z, left.aabbMax.z, right.aabbMin.z, right.aabbMax.z ); + bvhNode[idx].left = newAlt2Node; // right will be filled when popped + stack[stackPtr++] = idx; + stack[stackPtr++] = node.leftFirst + 1; + nodeIdx = node.leftFirst; + } + } + usedNodes = newAlt2Node; +} + +// BVH_SoA::Intersect can be found in the BVH_USEAVX section later in this file. + +// Generic (templated) MBVH implementation +// ---------------------------------------------------------------------------- + +template MBVH::~MBVH() +{ + if (!ownBVH) bvh = BVH(); // clear out pointers we don't own. + AlignedFree( mbvhNode ); +} + +template void MBVH::Build( const bvhvec4* vertices, const uint32_t primCount ) +{ + Build( bvhvec4slice( vertices, primCount * 3, sizeof( bvhvec4 ) ) ); +} + +template void MBVH::Build( const bvhvec4slice& vertices ) +{ + bvh.context = context; // properly propagate context to fix issue #66. + bvh.BuildDefault( vertices ); + ConvertFrom( bvh, false ); +} + +template void MBVH::Build( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ) +{ + // build the BVH with a continuous array of bvhvec4 vertices, indexed by 'indices'. + Build( bvhvec4slice{ vertices, prims * 3, sizeof( bvhvec4 ) }, indices, prims ); +} + +template void MBVH::Build( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ) +{ + // build the BVH from vertices stored in a slice, indexed by 'indices'. + bvh.context = context; + bvh.BuildDefault( vertices, indices, prims ); + ConvertFrom( bvh, true ); +} + +template void MBVH::BuildHQ( const bvhvec4* vertices, const uint32_t primCount ) +{ + BuildHQ( bvhvec4slice( vertices, primCount * 3, sizeof( bvhvec4 ) ) ); +} + +template void MBVH::BuildHQ( const bvhvec4slice& vertices ) +{ + bvh.context = context; + bvh.BuildHQ( vertices ); + ConvertFrom( bvh, true ); +} + +template void MBVH::BuildHQ( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ) +{ + Build( bvhvec4slice{ vertices, prims * 3, sizeof( bvhvec4 ) }, indices, prims ); +} + +template void MBVH::BuildHQ( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ) +{ + bvh.context = context; + bvh.BuildHQ( vertices, indices, prims ); + ConvertFrom( bvh, true ); +} + +template void MBVH::Optimize( const uint32_t iterations, bool extreme ) +{ + bvh.Optimize( iterations, extreme ); + ConvertFrom( bvh, true ); +} + +template uint32_t MBVH::LeafCount( const uint32_t nodeIdx ) const +{ + MBVHNode& node = mbvhNode[nodeIdx]; + if (node.isLeaf()) return 1; + uint32_t count = 0; + for (uint32_t i = 0; i < node.childCount; i++) count += LeafCount( node.child[i] ); + return count; +} + +template void MBVH::Refit( const uint32_t nodeIdx ) +{ + MBVHNode& node = mbvhNode[nodeIdx]; + if (node.isLeaf()) + { + bvhvec3 bmin( BVH_FAR ), bmax( -BVH_FAR ); + if (bvh.vertIdx) for (uint32_t first = node.firstTri, j = 0; j < node.triCount; j++) + { + const uint32_t vidx = bvh.primIdx[first + j] * 3; + const uint32_t i0 = bvh.vertIdx[vidx], i1 = bvh.vertIdx[vidx + 1], i2 = bvh.vertIdx[vidx + 2]; + const bvhvec3 v0 = bvh.verts[i0], v1 = bvh.verts[i1], v2 = bvh.verts[i2]; + bmin = tinybvh_min( bmin, tinybvh_min( tinybvh_min( v0, v1 ), v2 ) ); + bmax = tinybvh_max( bmax, tinybvh_max( tinybvh_max( v0, v1 ), v2 ) ); + } + else for (uint32_t first = node.firstTri, j = 0; j < node.triCount; j++) + { + const uint32_t vidx = bvh.primIdx[first + j] * 3; + const bvhvec3 v0 = bvh.verts[vidx], v1 = bvh.verts[vidx + 1], v2 = bvh.verts[vidx + 2]; + bmin = tinybvh_min( bmin, tinybvh_min( tinybvh_min( v0, v1 ), v2 ) ); + bmax = tinybvh_max( bmax, tinybvh_max( tinybvh_max( v0, v1 ), v2 ) ); + } + node.aabbMin = bmin, node.aabbMax = bmax; + } + else + { + for (unsigned i = 0; i < node.childCount; i++) Refit( node.child[i] ); + MBVHNode& firstChild = mbvhNode[node.child[0]]; + bvhvec3 bmin = firstChild.aabbMin, bmax = firstChild.aabbMax; + for (unsigned i = 1; i < node.childCount; i++) + { + MBVHNode& child = mbvhNode[node.child[i]]; + bmin = tinybvh_min( bmin, child.aabbMin ); + bmax = tinybvh_max( bmax, child.aabbMax ); + } + } + if (nodeIdx == 0) aabbMin = node.aabbMin, aabbMax = node.aabbMax; +} + +template float MBVH::SAHCost( const uint32_t nodeIdx ) const +{ + // Determine the SAH cost of the tree. This provides an indication + // of the quality of the BVH: Lower is better. + const MBVHNode& n = mbvhNode[nodeIdx]; + const float sa = BVH::SA( n.aabbMin, n.aabbMax ); + if (n.isLeaf()) return c_int * sa * n.triCount; + float cost = c_trav * sa; + for (unsigned i = 0; i < M; i++) if (n.child[i] != 0) cost += SAHCost( n.child[i] ); + return nodeIdx == 0 ? (cost / sa) : cost; +} + +template void MBVH::ConvertFrom( const BVH& original, bool compact ) +{ + // get a copy of the original bvh + if (&original != &bvh) ownBVH = false; // bvh isn't ours; don't delete in destructor. + bvh = original; + // allocate space + uint32_t spaceNeeded = compact ? original.usedNodes : original.allocatedNodes; + constexpr bool M8 = M == 8; + if (M8) spaceNeeded += original.usedNodes >> 1; // cwbvh / SplitLeafs + if (allocatedNodes < spaceNeeded) + { + AlignedFree( mbvhNode ); + mbvhNode = (MBVHNode*)AlignedAlloc( spaceNeeded * sizeof( MBVHNode ) ); + allocatedNodes = spaceNeeded; + } + memset( mbvhNode, 0, sizeof( MBVHNode ) * spaceNeeded ); + CopyBasePropertiesFrom( original ); + // create an mbvh node for each bvh2 node + for (uint32_t i = 0; i < original.usedNodes; i++) if (i != 1) + { + BVH::BVHNode& orig = original.bvhNode[i]; + MBVHNode& node = this->mbvhNode[i]; + node.aabbMin = orig.aabbMin, node.aabbMax = orig.aabbMax; + if (orig.isLeaf()) node.triCount = orig.triCount, node.firstTri = orig.leftFirst; + else node.child[0] = orig.leftFirst, node.child[1] = orig.leftFirst + 1, node.childCount = 2; + } + // collapse + uint32_t stack[128], stackPtr = 0, nodeIdx = 0; // i.e., root node + while (1) + { + MBVHNode& node = this->mbvhNode[nodeIdx]; + while (node.childCount < M) + { + int32_t bestChild = -1; + float bestChildSA = 0; + for (uint32_t i = 0; i < node.childCount; i++) + { + // see if we can adopt child i + const MBVHNode& child = this->mbvhNode[node.child[i]]; + if (!child.isLeaf() && node.childCount - 1 + child.childCount <= M) + { + const float childSA = SA( child.aabbMin, child.aabbMax ); + if (childSA > bestChildSA) bestChild = i, bestChildSA = childSA; + } + } + if (bestChild == -1) break; // could not adopt + const MBVHNode& child = this->mbvhNode[node.child[bestChild]]; + node.child[bestChild] = child.child[0]; + for (uint32_t i = 1; i < child.childCount; i++) + node.child[node.childCount++] = child.child[i]; + } + // we're done with the node; proceed with the children. + for (uint32_t i = 0; i < node.childCount; i++) + { + const uint32_t childIdx = node.child[i]; + const MBVHNode& child = this->mbvhNode[childIdx]; + if (!child.isLeaf()) stack[stackPtr++] = childIdx; + } + if (stackPtr == 0) break; + nodeIdx = stack[--stackPtr]; + } + // special case where root is leaf: add extra level - cwbvh needs this. + MBVHNode& root = this->mbvhNode[0]; + if (root.isLeaf()) + { + mbvhNode[1] = root; + root.childCount = 1; + root.child[0] = 1; + root.triCount = 0; + } + // finalize + usedNodes = original.usedNodes; + this->may_have_holes = true; +} + +// BVH4_GPU implementation +// ---------------------------------------------------------------------------- + +BVH4_GPU::~BVH4_GPU() +{ + if (!ownBVH4) bvh4 = MBVH<4>(); // clear out pointers we don't own. + AlignedFree( bvh4Data ); +} + +void BVH4_GPU::Build( const bvhvec4* vertices, const uint32_t primCount ) +{ + Build( bvhvec4slice( vertices, primCount * 3, sizeof( bvhvec4 ) ) ); +} + +void BVH4_GPU::Build( const bvhvec4slice& vertices ) +{ + bvh4.context = context; + bvh4.Build( vertices ); + ConvertFrom( bvh4, true ); +} + +void BVH4_GPU::Build( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ) +{ + // build the BVH with a continuous array of bvhvec4 vertices, indexed by 'indices'. + Build( bvhvec4slice{ vertices, prims * 3, sizeof( bvhvec4 ) }, indices, prims ); +} + +void BVH4_GPU::Build( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ) +{ + // build the BVH from vertices stored in a slice, indexed by 'indices'. + bvh4.context = context; + bvh4.Build( vertices, indices, prims ); + ConvertFrom( bvh4, true ); +} + +void BVH4_GPU::BuildHQ( const bvhvec4* vertices, const uint32_t primCount ) +{ + BuildHQ( bvhvec4slice( vertices, primCount * 3, sizeof( bvhvec4 ) ) ); +} + +void BVH4_GPU::BuildHQ( const bvhvec4slice& vertices ) +{ + bvh4.context = context; + bvh4.BuildHQ( vertices ); + ConvertFrom( bvh4, true ); +} + +void BVH4_GPU::BuildHQ( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ) +{ + Build( bvhvec4slice{ vertices, prims * 3, sizeof( bvhvec4 ) }, indices, prims ); +} + +void BVH4_GPU::BuildHQ( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ) +{ + bvh4.context = context; + bvh4.BuildHQ( vertices, indices, prims ); + ConvertFrom( bvh4, true ); +} + +void BVH4_GPU::Optimize( const uint32_t iterations, bool extreme ) +{ + bvh4.Optimize( iterations, extreme ); + ConvertFrom( bvh4, true ); +} + +void BVH4_GPU::ConvertFrom( const MBVH<4>& original, bool compact ) +{ + // get a copy of the original bvh4 + if (&original != &bvh4) ownBVH4 = false; // bvh isn't ours; don't delete in destructor. + bvh4 = original; + // Convert a 4-wide BVH to a format suitable for GPU traversal. Layout: + // offs 0: aabbMin (12 bytes), 4x quantized child xmin (4 bytes) + // offs 16: aabbMax (12 bytes), 4x quantized child xmax (4 bytes) + // offs 32: 4x child ymin, then ymax, zmax, zmax (total 16 bytes) + // offs 48: 4x child node info: leaf if MSB set. + // Leaf: 15 bits for tri count, 16 for offset + // Interior: 32 bits for position of child node. + // Triangle data ('by value') immediately follows each leaf node. + uint32_t blocksNeeded = compact ? (bvh4.usedNodes * 4) : (bvh4.allocatedNodes * 4); // here, 'block' is 16 bytes. + blocksNeeded += 6 * bvh4.triCount; // this layout stores tris in the same buffer. + if (allocatedBlocks < blocksNeeded) + { + AlignedFree( bvh4Data ); + bvh4Data = (bvhvec4*)AlignedAlloc( blocksNeeded * 16 ); + allocatedBlocks = blocksNeeded; + } + memset( bvh4Data, 0, 16 * blocksNeeded ); + CopyBasePropertiesFrom( bvh4 ); + // start conversion + uint32_t nodeIdx = 0, newAlt4Ptr = 0, stack[128], stackPtr = 0, retValPos = 0; + while (1) + { + const MBVH<4>::MBVHNode& orig = bvh4.mbvhNode[nodeIdx]; + // convert BVH4 node - must be an interior node. + assert( !orig.isLeaf() ); + bvhvec4* nodeBase = bvh4Data + newAlt4Ptr; + uint32_t baseAlt4Ptr = newAlt4Ptr; + newAlt4Ptr += 4; + nodeBase[0] = bvhvec4( orig.aabbMin, 0 ); + nodeBase[1] = bvhvec4( (orig.aabbMax - orig.aabbMin) * (1.0f / 255.0f), 0 ); + MBVH<4>::MBVHNode* childNode[4] = { + &bvh4.mbvhNode[orig.child[0]], &bvh4.mbvhNode[orig.child[1]], + &bvh4.mbvhNode[orig.child[2]], &bvh4.mbvhNode[orig.child[3]] + }; + // start with leaf child node conversion + uint32_t childInfo[4] = { 0, 0, 0, 0 }; // will store in final fields later + for (int32_t i = 0; i < 4; i++) if (childNode[i]->isLeaf()) + { + childInfo[i] = newAlt4Ptr - baseAlt4Ptr; + childInfo[i] |= childNode[i]->triCount << 16; + childInfo[i] |= 0x80000000; + for (uint32_t j = 0; j < childNode[i]->triCount; j++) + { + uint32_t t = bvh4.bvh.primIdx[childNode[i]->firstTri + j]; + uint32_t ti0, ti1, ti2; + if (bvh4.bvh.vertIdx) + ti0 = bvh4.bvh.vertIdx[t * 3], + ti1 = bvh4.bvh.vertIdx[t * 3 + 1], + ti2 = bvh4.bvh.vertIdx[t * 3 + 2]; + else + ti0 = t * 3, ti1 = t * 3 + 1, ti2 = t * 3 + 2; + #ifdef BVH4_GPU_COMPRESSED_TRIS + PrecomputeTriangle( verts, ti0, ti1, ti2, (float*)&bvh4Alt[newAlt4Ptr] ); + bvh4Alt[newAlt4Ptr + 3] = bvhvec4( 0, 0, 0, *(float*)&t ); + newAlt4Ptr += 4; + #else + bvhvec4 v0 = bvh4.bvh.verts[ti0]; + bvh4Data[newAlt4Ptr + 1] = bvh4.bvh.verts[ti1] - v0; + bvh4Data[newAlt4Ptr + 2] = bvh4.bvh.verts[ti2] - v0; + v0.w = *(float*)&t; // as_float + bvh4Data[newAlt4Ptr + 0] = v0; + newAlt4Ptr += 3; + #endif + } + } + // process interior nodes + for (int32_t i = 0; i < 4; i++) if (!childNode[i]->isLeaf()) + { + // childInfo[i] = node.child[i] == 0 ? 0 : GPUFormatBVH4( node.child[i] ); + if (orig.child[i] == 0) childInfo[i] = 0; else + { + stack[stackPtr++] = (uint32_t)(((float*)&nodeBase[3] + i) - (float*)bvh4Data); + stack[stackPtr++] = orig.child[i]; + } + } + // store child node bounds, quantized + const bvhvec3 extent = orig.aabbMax - orig.aabbMin; + bvhvec3 scale; + scale.x = extent.x > 1e-10f ? (254.999f / extent.x) : 0; + scale.y = extent.y > 1e-10f ? (254.999f / extent.y) : 0; + scale.z = extent.z > 1e-10f ? (254.999f / extent.z) : 0; + uint8_t* slot0 = (uint8_t*)&nodeBase[0] + 12; // 4 chars + uint8_t* slot1 = (uint8_t*)&nodeBase[1] + 12; // 4 chars + uint8_t* slot2 = (uint8_t*)&nodeBase[2]; // 16 chars + if (orig.child[0]) + { + const bvhvec3 relBMin = childNode[0]->aabbMin - orig.aabbMin, relBMax = childNode[0]->aabbMax - orig.aabbMin; + slot0[0] = (uint8_t)floorf( relBMin.x * scale.x ), slot1[0] = (uint8_t)ceilf( relBMax.x * scale.x ); + slot2[0] = (uint8_t)floorf( relBMin.y * scale.y ), slot2[4] = (uint8_t)ceilf( relBMax.y * scale.y ); + slot2[8] = (uint8_t)floorf( relBMin.z * scale.z ), slot2[12] = (uint8_t)ceilf( relBMax.z * scale.z ); + } + if (orig.child[1]) + { + const bvhvec3 relBMin = childNode[1]->aabbMin - orig.aabbMin, relBMax = childNode[1]->aabbMax - orig.aabbMin; + slot0[1] = (uint8_t)floorf( relBMin.x * scale.x ), slot1[1] = (uint8_t)ceilf( relBMax.x * scale.x ); + slot2[1] = (uint8_t)floorf( relBMin.y * scale.y ), slot2[5] = (uint8_t)ceilf( relBMax.y * scale.y ); + slot2[9] = (uint8_t)floorf( relBMin.z * scale.z ), slot2[13] = (uint8_t)ceilf( relBMax.z * scale.z ); + } + if (orig.child[2]) + { + const bvhvec3 relBMin = childNode[2]->aabbMin - orig.aabbMin, relBMax = childNode[2]->aabbMax - orig.aabbMin; + slot0[2] = (uint8_t)floorf( relBMin.x * scale.x ), slot1[2] = (uint8_t)ceilf( relBMax.x * scale.x ); + slot2[2] = (uint8_t)floorf( relBMin.y * scale.y ), slot2[6] = (uint8_t)ceilf( relBMax.y * scale.y ); + slot2[10] = (uint8_t)floorf( relBMin.z * scale.z ), slot2[14] = (uint8_t)ceilf( relBMax.z * scale.z ); + } + if (orig.child[3]) + { + const bvhvec3 relBMin = childNode[3]->aabbMin - orig.aabbMin, relBMax = childNode[3]->aabbMax - orig.aabbMin; + slot0[3] = (uint8_t)floorf( relBMin.x * scale.x ), slot1[3] = (uint8_t)ceilf( relBMax.x * scale.x ); + slot2[3] = (uint8_t)floorf( relBMin.y * scale.y ), slot2[7] = (uint8_t)ceilf( relBMax.y * scale.y ); + slot2[11] = (uint8_t)floorf( relBMin.z * scale.z ), slot2[15] = (uint8_t)ceilf( relBMax.z * scale.z ); + } + // finalize node + nodeBase[3] = bvhvec4( + *(float*)&childInfo[0], *(float*)&childInfo[1], + *(float*)&childInfo[2], *(float*)&childInfo[3] + ); + // pop new work from the stack + if (retValPos > 0) ((uint32_t*)bvh4Data)[retValPos] = baseAlt4Ptr; + if (stackPtr == 0) break; + nodeIdx = stack[--stackPtr]; + retValPos = stack[--stackPtr]; + } + usedBlocks = newAlt4Ptr; +} + +// IntersectAlt4Nodes. For testing the converted data only; not efficient. +// This code replicates how traversal on GPU happens. +#define SWAP(A,B,C,D) tmp=A,A=B,B=tmp,tmp2=C,C=D,D=tmp2; +struct uchar4 { uint8_t x, y, z, w; }; +static uchar4 as_uchar4( const float v ) { union { float t; uchar4 t4; }; t = v; return t4; } +static uint32_t as_uint( const float v ) { return *(uint32_t*)&v; } +int32_t BVH4_GPU::Intersect( Ray& ray ) const +{ + // traverse a blas + VALIDATE_RAY( ray ); + uint32_t offset = 0, stack[128], stackPtr = 0, tmp2 /* for SWAP macro */; + float cost = 0; + while (1) + { + cost += c_trav; + // fetch the node + const bvhvec4 data0 = bvh4Data[offset + 0], data1 = bvh4Data[offset + 1]; + const bvhvec4 data2 = bvh4Data[offset + 2], data3 = bvh4Data[offset + 3]; + // extract aabb + const bvhvec3 bmin = data0, extent = data1; // pre-scaled by 1/255 + // reconstruct conservative child aabbs + const uchar4 d0 = as_uchar4( data0.w ), d1 = as_uchar4( data1.w ), d2 = as_uchar4( data2.x ); + const uchar4 d3 = as_uchar4( data2.y ), d4 = as_uchar4( data2.z ), d5 = as_uchar4( data2.w ); + const bvhvec3 c0min = bmin + extent * bvhvec3( d0.x, d2.x, d4.x ), c0max = bmin + extent * bvhvec3( d1.x, d3.x, d5.x ); + const bvhvec3 c1min = bmin + extent * bvhvec3( d0.y, d2.y, d4.y ), c1max = bmin + extent * bvhvec3( d1.y, d3.y, d5.y ); + const bvhvec3 c2min = bmin + extent * bvhvec3( d0.z, d2.z, d4.z ), c2max = bmin + extent * bvhvec3( d1.z, d3.z, d5.z ); + const bvhvec3 c3min = bmin + extent * bvhvec3( d0.w, d2.w, d4.w ), c3max = bmin + extent * bvhvec3( d1.w, d3.w, d5.w ); + // intersect child aabbs + const bvhvec3 t1a = (c0min - ray.O) * ray.rD, t2a = (c0max - ray.O) * ray.rD; + const bvhvec3 t1b = (c1min - ray.O) * ray.rD, t2b = (c1max - ray.O) * ray.rD; + const bvhvec3 t1c = (c2min - ray.O) * ray.rD, t2c = (c2max - ray.O) * ray.rD; + const bvhvec3 t1d = (c3min - ray.O) * ray.rD, t2d = (c3max - ray.O) * ray.rD; + const bvhvec3 minta = tinybvh_min( t1a, t2a ), maxta = tinybvh_max( t1a, t2a ); + const bvhvec3 mintb = tinybvh_min( t1b, t2b ), maxtb = tinybvh_max( t1b, t2b ); + const bvhvec3 mintc = tinybvh_min( t1c, t2c ), maxtc = tinybvh_max( t1c, t2c ); + const bvhvec3 mintd = tinybvh_min( t1d, t2d ), maxtd = tinybvh_max( t1d, t2d ); + const float tmina = tinybvh_max( tinybvh_max( tinybvh_max( minta.x, minta.y ), minta.z ), 0.0f ); + const float tminb = tinybvh_max( tinybvh_max( tinybvh_max( mintb.x, mintb.y ), mintb.z ), 0.0f ); + const float tminc = tinybvh_max( tinybvh_max( tinybvh_max( mintc.x, mintc.y ), mintc.z ), 0.0f ); + const float tmind = tinybvh_max( tinybvh_max( tinybvh_max( mintd.x, mintd.y ), mintd.z ), 0.0f ); + const float tmaxa = tinybvh_min( tinybvh_min( tinybvh_min( maxta.x, maxta.y ), maxta.z ), ray.hit.t ); + const float tmaxb = tinybvh_min( tinybvh_min( tinybvh_min( maxtb.x, maxtb.y ), maxtb.z ), ray.hit.t ); + const float tmaxc = tinybvh_min( tinybvh_min( tinybvh_min( maxtc.x, maxtc.y ), maxtc.z ), ray.hit.t ); + const float tmaxd = tinybvh_min( tinybvh_min( tinybvh_min( maxtd.x, maxtd.y ), maxtd.z ), ray.hit.t ); + float dist0 = tmina > tmaxa ? BVH_FAR : tmina, dist1 = tminb > tmaxb ? BVH_FAR : tminb; + float dist2 = tminc > tmaxc ? BVH_FAR : tminc, dist3 = tmind > tmaxd ? BVH_FAR : tmind, tmp; + // get child node info fields + uint32_t c0info = as_uint( data3.x ), c1info = as_uint( data3.y ); + uint32_t c2info = as_uint( data3.z ), c3info = as_uint( data3.w ); + if (dist0 < dist2) SWAP( dist0, dist2, c0info, c2info ); + if (dist1 < dist3) SWAP( dist1, dist3, c1info, c3info ); + if (dist0 < dist1) SWAP( dist0, dist1, c0info, c1info ); + if (dist2 < dist3) SWAP( dist2, dist3, c2info, c3info ); + if (dist1 < dist2) SWAP( dist1, dist2, c1info, c2info ); + // process results, starting with farthest child, so nearest ends on top of stack + uint32_t nextNode = 0; + uint32_t leaf[4] = { 0, 0, 0, 0 }, leafs = 0; + if (dist0 < BVH_FAR) + { + if (c0info & 0x80000000) leaf[leafs++] = c0info; else if (c0info) stack[stackPtr++] = c0info; + } + if (dist1 < BVH_FAR) + { + if (c1info & 0x80000000) leaf[leafs++] = c1info; else if (c1info) stack[stackPtr++] = c1info; + } + if (dist2 < BVH_FAR) + { + if (c2info & 0x80000000) leaf[leafs++] = c2info; else if (c2info) stack[stackPtr++] = c2info; + } + if (dist3 < BVH_FAR) + { + if (c3info & 0x80000000) leaf[leafs++] = c3info; else if (c3info) stack[stackPtr++] = c3info; + } + // process encountered leafs, if any + for (uint32_t i = 0; i < leafs; i++) + { + const uint32_t N = (leaf[i] >> 16) & 0x7fff; + uint32_t triStart = offset + (leaf[i] & 0xffff); + for (uint32_t j = 0; j < N; j++, triStart += 3) + { + cost += c_int; + const bvhvec3 e2 = bvhvec3( bvh4Data[triStart + 2] ); + const bvhvec3 e1 = bvhvec3( bvh4Data[triStart + 1] ); + const bvhvec3 v0 = bvh4Data[triStart + 0]; + MOLLER_TRUMBORE_TEST( ray.hit.t, continue ); + ray.hit.t = t, ray.hit.u = u, ray.hit.v = v; + ray.hit.prim = as_uint( bvh4Data[triStart + 0].w ); + } + } + // continue with nearest node or first node on the stack + if (nextNode) offset = nextNode; else + { + if (!stackPtr) break; + offset = stack[--stackPtr]; + } + } + return (int32_t)cost; // cast to not break interface. +} + +// BVH4_CPU implementation +// ---------------------------------------------------------------------------- + +BVH4_CPU::~BVH4_CPU() +{ + if (!ownBVH4) bvh4 = MBVH<4>(); // clear out pointers we don't own. + AlignedFree( bvh4Data ); +} + +void BVH4_CPU::Build( const bvhvec4* vertices, const uint32_t primCount ) +{ + Build( bvhvec4slice( vertices, primCount * 3, sizeof( bvhvec4 ) ) ); +} + +void BVH4_CPU::Build( const bvhvec4slice& vertices ) +{ + bvh4.bvh.context = bvh4.context = context; + bvh4.bvh.BuildDefault( vertices ); + ConvertFrom( bvh4 ); +} + +void BVH4_CPU::Build( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ) +{ + // build the BVH with a continuous array of bvhvec4 vertices, indexed by 'indices'. + Build( bvhvec4slice{ vertices, prims * 3, sizeof( bvhvec4 ) }, indices, prims ); +} + +void BVH4_CPU::Build( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ) +{ + // build the BVH from vertices stored in a slice, indexed by 'indices'. + bvh4.bvh.context = bvh4.context = context; + bvh4.bvh.BuildDefault( vertices, indices, prims ); + ConvertFrom( bvh4 ); +} + +void BVH4_CPU::BuildHQ( const bvhvec4* vertices, const uint32_t primCount ) +{ + BuildHQ( bvhvec4slice( vertices, primCount * 3, sizeof( bvhvec4 ) ) ); +} + +void BVH4_CPU::BuildHQ( const bvhvec4slice& vertices ) +{ + bvh4.bvh.context = bvh4.context = context; + bvh4.bvh.BuildHQ( vertices ); + ConvertFrom( bvh4 ); +} + +void BVH4_CPU::BuildHQ( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ) +{ + Build( bvhvec4slice{ vertices, prims * 3, sizeof( bvhvec4 ) }, indices, prims ); +} + +void BVH4_CPU::BuildHQ( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ) +{ + bvh4.bvh.context = bvh4.context = context; + bvh4.bvh.BuildHQ( vertices, indices, prims ); + ConvertFrom( bvh4 ); +} + +void BVH4_CPU::Save( const char* fileName ) +{ + std::fstream s{ fileName, s.binary | s.out }; + uint32_t header = TINY_BVH_VERSION_SUB + (TINY_BVH_VERSION_MINOR << 8) + (TINY_BVH_VERSION_MAJOR << 16) + (layout << 24); + s.write( (char*)&header, sizeof( uint32_t ) ); + s.write( (char*)&triCount, sizeof( uint32_t ) ); + s.write( (char*)this, sizeof( BVH4_CPU ) ); + s.write( (char*)bvh4Data, usedBlocks * 64 ); +} + +bool BVH4_CPU::Load( const char* fileName, const uint32_t expectedTris ) +{ + // open file and check contents + std::fstream s{ fileName, s.binary | s.in }; + if (!s) return false; + BVHContext tmp = context; + uint32_t header, fileTriCount; + s.read( (char*)&header, sizeof( uint32_t ) ); + if (((header >> 8) & 255) != TINY_BVH_VERSION_MINOR || + ((header >> 16) & 255) != TINY_BVH_VERSION_MAJOR || + (header & 255) != TINY_BVH_VERSION_SUB || (header >> 24) != layout) return false; + s.read( (char*)&fileTriCount, sizeof( uint32_t ) ); + if (fileTriCount != expectedTris) return false; + // all checks passed; safe to overwrite *this + s.read( (char*)this, sizeof( BVH4_CPU ) ); + context = tmp; // can't load context; function pointers will differ. + bvh4Data = (CacheLine*)AlignedAlloc( usedBlocks * 64 ); + allocatedBlocks = usedBlocks; + s.read( (char*)bvh4Data, usedBlocks * 64 ); + bvh4 = MBVH<4>(); + return true; +} + +void BVH4_CPU::Optimize( const uint32_t iterations, bool extreme ) +{ + bvh4.Optimize( iterations, extreme ); + ConvertFrom( bvh4 ); +} + +void BVH4_CPU::Refit() +{ + bvh4.Refit(); + ConvertFrom( bvh4 ); +} + +float BVH4_CPU::SAHCost( const uint32_t nodeIdx ) const +{ + return bvh4.SAHCost( nodeIdx ); +} + +#define SORT(a,b) { if (dist[a] < dist[b]) { float h = dist[a]; dist[a] = dist[b], dist[b] = h; } } + +void BVH4_CPU::ConvertFrom( MBVH<4>& original ) +{ + // Note: identical to BVH8_CPU version, just with fewer lanes. + // get a copy of the input bvh4 + if (&original != &bvh4) ownBVH4 = false; // bvh isn't ours; don't delete in destructor. + bvh4 = original; + // prepare input bvh4 + uint32_t firstIdx = 0; + bvh4.bvh.CombineLeafs( 4, firstIdx, 0 ); + bvh4.bvh.SplitLeafs( 4 ); + bvh4.ConvertFrom( bvh4.bvh, true ); + // allocate if needed + uint32_t nodesNeeded = bvh4.usedNodes, leafsNeeded = bvh4.LeafCount(); + uint32_t blocksNeeded = nodesNeeded * (sizeof( BVHNode ) / 64); // here, block = cacheline. + blocksNeeded += leafsNeeded * (sizeof( BVHTri4Leaf ) / 64); + if (allocatedBlocks < blocksNeeded) + { + AlignedFree( bvh4Data ); + void* (*allocator)(size_t, void*) = malloc64; + #if defined BVH8_ALIGN_4K + allocator = malloc4k; + #elif defined BVH8_ALIGN_32K + allocator = malloc32k; + #endif + bvh4Data = (CacheLine*)allocator( blocksNeeded * 64, 0 ); + allocatedBlocks = blocksNeeded; + } + CopyBasePropertiesFrom( bvh4 ); + // start conversion + uint32_t newBlockPtr = 0, nodeIdx = 0, stack[256], stackPtr = 0; + while (1) + { + const MBVH<4>::MBVHNode& orig = bvh4.mbvhNode[nodeIdx]; + BVHNode* newNode = (BVHNode*)(bvh4Data + newBlockPtr); + newBlockPtr += sizeof( BVHNode ) / 64; + memset( newNode, 0, sizeof( BVHNode ) ); + // calculate the permutation offsets for the node + for (uint32_t q = 0; q < 8; q++) + { + const bvhvec3 D( q & 1 ? 1.0f : -1.0f, q & 2 ? 1.0f : -1.0f, q & 4 ? 1.0f : -1.0f ); + union { float dist[4]; uint32_t idist[4]; }; + for (int i = 0; i < 4; i++) if (orig.child[i] == 0) + dist[i] = 1e30f, idist[i] = (idist[i] & 0xfffffffc) + i; + else + { + const MBVH<4>::MBVHNode& c = bvh4.mbvhNode[orig.child[i]]; + const bvhvec3 p( q & 1 ? c.aabbMin.x : c.aabbMax.x, q & 2 ? c.aabbMin.y : c.aabbMax.y, q & 4 ? c.aabbMin.z : c.aabbMax.z ); + dist[i] = tinybvh_dot( D, p ), idist[i] = (idist[i] & 0xfffffff8) + i; + } + // apply sorting network - https://bertdobbelaere.github.io/sorting_networks.html#N4L5D3 + SORT( 0, 2 ); SORT( 1, 3 ); SORT( 0, 1 ); SORT( 2, 3 ); SORT( 1, 2 ); + for (int i = 0; i < 4; i++) ((uint32_t*)&newNode->perm4)[i] += (idist[i] & 3) << (q * 2); + } + // fill remaining fields + int32_t cidx = 0; + for (int32_t i = 0; i < 4; i++) if (orig.child[i]) + { + const MBVH<4>::MBVHNode& child = bvh4.mbvhNode[orig.child[i]]; + ((float*)&newNode->xmin4)[cidx] = child.aabbMin.x, ((float*)&newNode->xmax4)[cidx] = child.aabbMax.x; + ((float*)&newNode->ymin4)[cidx] = child.aabbMin.y, ((float*)&newNode->ymax4)[cidx] = child.aabbMax.y; + ((float*)&newNode->zmin4)[cidx] = child.aabbMin.z, ((float*)&newNode->zmax4)[cidx] = child.aabbMax.z; + if (child.isLeaf()) + { + // emit leaf node: group of up to 4 triangles in AoS format. + ((uint32_t*)&newNode->child4)[cidx] = newBlockPtr + LEAF_BIT; + BVHTri4Leaf* leaf = (BVHTri4Leaf*)(bvh4Data + newBlockPtr); + newBlockPtr += sizeof( BVHTri4Leaf ) / 64; + for (uint32_t i0, i1, i2, l = 0; l < 4; l++) + { + uint32_t primIdx = bvh4.bvh.primIdx[child.firstTri + tinybvh_min( l, child.triCount - 1u )]; + GET_PRIM_INDICES_I0_I1_I2( bvh4.bvh, primIdx ); + const bvhvec4 v0 = bvh4.bvh.verts[i0], e1 = bvh4.bvh.verts[i1] - v0, e2 = bvh4.bvh.verts[i2] - v0; + leaf->SetData( v0, e1, e2, primIdx, l ); + } + } + else + { + uint32_t* slot = (uint32_t*)&newNode->child4 + cidx; + stack[stackPtr++] = (uint32_t)(slot - (uint32_t*)bvh4Data); + stack[stackPtr++] = orig.child[i]; + } + cidx++; + } + for (; cidx < 4; cidx++) + ((float*)&newNode->xmin4)[cidx] = 1e30f, ((float*)&newNode->xmax4)[cidx] = 1.00001e30f, + ((float*)&newNode->ymin4)[cidx] = 1e30f, ((float*)&newNode->ymax4)[cidx] = 1.00001e30f, + ((float*)&newNode->zmin4)[cidx] = 1e30f, ((float*)&newNode->zmax4)[cidx] = 1.00001e30f, + ((uint32_t*)&newNode->child4)[cidx] |= EMPTY_BIT; + // pop next task + if (!stackPtr) break; + nodeIdx = stack[--stackPtr]; + const uint32_t offset = stack[--stackPtr]; + ((uint32_t*)bvh4Data)[offset] = newBlockPtr; + } + usedBlocks = newBlockPtr; +} + +// BVH8_CPU implementation +// ---------------------------------------------------------------------------- + +BVH8_CPU::~BVH8_CPU() +{ + if (!ownBVH8) bvh8 = MBVH<8>(); // clear out pointers we don't own. + AlignedFree( bvh8Data ); +} + +void BVH8_CPU::Build( const bvhvec4* vertices, const uint32_t primCount ) +{ + Build( bvhvec4slice( vertices, primCount * 3, sizeof( bvhvec4 ) ) ); +} + +void BVH8_CPU::Build( const bvhvec4slice& vertices ) +{ + bvh8.bvh.context = bvh8.context = context; + bvh8.bvh.BuildDefault( vertices ); + bvh8.bvh.Compact(); + ConvertFrom( bvh8 ); +} + +void BVH8_CPU::Build( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ) +{ + // build the BVH with a continuous array of bvhvec4 vertices, indexed by 'indices'. + Build( bvhvec4slice{ vertices, prims * 3, sizeof( bvhvec4 ) }, indices, prims ); +} + +void BVH8_CPU::Build( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ) +{ + // build the BVH from vertices stored in a slice, indexed by 'indices'. + bvh8.bvh.context = bvh8.context = context; + bvh8.bvh.BuildDefault( vertices, indices, prims ); + bvh8.bvh.Compact(); + ConvertFrom( bvh8 ); +} + +void BVH8_CPU::BuildHQ( const bvhvec4* vertices, const uint32_t primCount ) +{ + BuildHQ( bvhvec4slice( vertices, primCount * 3, sizeof( bvhvec4 ) ) ); +} + +void BVH8_CPU::BuildHQ( const bvhvec4slice& vertices ) +{ + bvh8.bvh.context = bvh8.context = context; + bvh8.bvh.BuildHQ( vertices ); + ConvertFrom( bvh8 ); +} + +void BVH8_CPU::BuildHQ( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ) +{ + Build( bvhvec4slice{ vertices, prims * 3, sizeof( bvhvec4 ) }, indices, prims ); +} + +void BVH8_CPU::BuildHQ( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ) +{ + bvh8.bvh.context = bvh8.context = context; + bvh8.bvh.BuildHQ( vertices, indices, prims ); + ConvertFrom( bvh8 ); +} + +void BVH8_CPU::Save( const char* fileName ) +{ + std::fstream s{ fileName, s.binary | s.out }; + uint32_t header = TINY_BVH_VERSION_SUB + (TINY_BVH_VERSION_MINOR << 8) + (TINY_BVH_VERSION_MAJOR << 16) + (layout << 24); + s.write( (char*)&header, sizeof( uint32_t ) ); + s.write( (char*)&triCount, sizeof( uint32_t ) ); + s.write( (char*)this, sizeof( BVH8_CPU ) ); + s.write( (char*)bvh8Data, usedBlocks * 64 ); +} + +bool BVH8_CPU::Load( const char* fileName, const uint32_t expectedTris ) +{ + // open file and check contents + std::fstream s{ fileName, s.binary | s.in }; + if (!s) return false; + BVHContext tmp = context; + uint32_t header, fileTriCount; + s.read( (char*)&header, sizeof( uint32_t ) ); + if (((header >> 8) & 255) != TINY_BVH_VERSION_MINOR || + ((header >> 16) & 255) != TINY_BVH_VERSION_MAJOR || + (header & 255) != TINY_BVH_VERSION_SUB || (header >> 24) != layout) return false; + s.read( (char*)&fileTriCount, sizeof( uint32_t ) ); + if (fileTriCount != expectedTris) return false; + // all checks passed; safe to overwrite *this + s.read( (char*)this, sizeof( BVH8_CPU ) ); + context = tmp; // can't load context; function pointers will differ. + bvh8Data = (CacheLine*)AlignedAlloc( usedBlocks * 64 ); + allocatedBlocks = usedBlocks; + s.read( (char*)bvh8Data, usedBlocks * 64 ); + bvh8 = MBVH<8>(); + return true; +} + +void BVH8_CPU::Optimize( const uint32_t iterations, bool extreme ) +{ + bvh8.Optimize( iterations, extreme ); + ConvertFrom( bvh8 ); +} + +void BVH8_CPU::Refit() +{ + bvh8.Refit(); + ConvertFrom( bvh8 ); +} + +float BVH8_CPU::SAHCost( const uint32_t nodeIdx ) const +{ + return bvh8.SAHCost( nodeIdx ); +} + +void BVH8_CPU::ConvertFrom( MBVH<8>& original ) +{ + // get a copy of the input bvh8 + if (&original != &bvh8) ownBVH8 = false; // bvh isn't ours; don't delete in destructor. + bvh8 = original; + // prepare input bvh8 + uint32_t firstIdx = 0; + bvh8.bvh.CombineLeafs( 4, firstIdx, 0 ); + bvh8.bvh.SplitLeafs( 4 ); + bvh8.ConvertFrom( bvh8.bvh, true ); + // allocate if needed + uint32_t nodesNeeded = bvh8.usedNodes, leafsNeeded = bvh8.LeafCount(); + uint32_t blocksNeeded = nodesNeeded * (sizeof( BVHNode ) / 64); // here, block = cacheline. + blocksNeeded += leafsNeeded * (sizeof( BVHTri4Leaf ) / 64); + if (allocatedBlocks < blocksNeeded) + { + AlignedFree( bvh8Data ); + void* (*allocator)(size_t, void*) = malloc64; + #if defined BVH8_ALIGN_4K + allocator = malloc4k; + #elif defined BVH8_ALIGN_32K + allocator = malloc32k; + #endif + bvh8Data = (CacheLine*)allocator( blocksNeeded * 64, 0 ); + allocatedBlocks = blocksNeeded; + } + CopyBasePropertiesFrom( bvh8 ); + // start conversion + uint32_t newBlockPtr = 0, nodeIdx = 0, stack[256], stackPtr = 0; + while (1) + { + const MBVH<8>::MBVHNode& orig = bvh8.mbvhNode[nodeIdx]; + BVHNode* newNode = (BVHNode*)(bvh8Data + newBlockPtr); + newBlockPtr += sizeof( BVHNode ) / 64; + memset( newNode, 0, sizeof( BVHNode ) ); + // calculate the permutation offsets for the node + for (uint32_t q = 0; q < 8; q++) + { + const bvhvec3 D( q & 1 ? 1.0f : -1.0f, q & 2 ? 1.0f : -1.0f, q & 4 ? 1.0f : -1.0f ); + union { float dist[8]; uint32_t idist[8]; }; + for (int i = 0; i < 8; i++) if (orig.child[i] == 0) + dist[i] = 1e30f, idist[i] = (idist[i] & 0xfffffff8) + i; + else + { + const MBVH<8>::MBVHNode& c = bvh8.mbvhNode[orig.child[i]]; + const bvhvec3 p( q & 1 ? c.aabbMin.x : c.aabbMax.x, q & 2 ? c.aabbMin.y : c.aabbMax.y, q & 4 ? c.aabbMin.z : c.aabbMax.z ); + dist[i] = tinybvh_dot( D, p ), idist[i] = (idist[i] & 0xfffffff8) + i; + } + // apply sorting network - https://bertdobbelaere.github.io/sorting_networks.html#N8L19D6 + SORT( 0, 2 ); SORT( 1, 3 ); SORT( 4, 6 ); SORT( 5, 7 ); SORT( 0, 4 ); + SORT( 1, 5 ); SORT( 2, 6 ); SORT( 3, 7 ); SORT( 0, 1 ); SORT( 2, 3 ); + SORT( 4, 5 ); SORT( 6, 7 ); SORT( 2, 4 ); SORT( 3, 5 ); SORT( 1, 4 ); + SORT( 3, 6 ); SORT( 1, 2 ); SORT( 3, 4 ); SORT( 5, 6 ); + for (int i = 0; i < 8; i++) ((uint32_t*)&newNode->perm8)[i] += (idist[i] & 7) << (q * 3); + } + // fill remaining fields + int32_t cidx = 0; + for (int32_t i = 0; i < 8; i++) if (orig.child[i]) + { + const MBVH<8>::MBVHNode& child = bvh8.mbvhNode[orig.child[i]]; + ((float*)&newNode->xmin8)[cidx] = child.aabbMin.x, ((float*)&newNode->xmax8)[cidx] = child.aabbMax.x; + ((float*)&newNode->ymin8)[cidx] = child.aabbMin.y, ((float*)&newNode->ymax8)[cidx] = child.aabbMax.y; + ((float*)&newNode->zmin8)[cidx] = child.aabbMin.z, ((float*)&newNode->zmax8)[cidx] = child.aabbMax.z; + if (child.isLeaf()) + { + // emit leaf node: group of up to 4 triangles in AoS format. + ((uint32_t*)&newNode->child8)[cidx] = newBlockPtr + LEAF_BIT; + BVHTri4Leaf* leaf = (BVHTri4Leaf*)(bvh8Data + newBlockPtr); + newBlockPtr += sizeof( BVHTri4Leaf ) / 64; + for (uint32_t i0, i1, i2, l = 0; l < 4; l++) + { + uint32_t primIdx = bvh8.bvh.primIdx[child.firstTri + tinybvh_min( l, child.triCount - 1u )]; + GET_PRIM_INDICES_I0_I1_I2( bvh8.bvh, primIdx ); + const bvhvec4 v0 = bvh8.bvh.verts[i0], e1 = bvh8.bvh.verts[i1] - v0, e2 = bvh8.bvh.verts[i2] - v0; + leaf->SetData( v0, e1, e2, primIdx, l ); + } + } + else + { + uint32_t* slot = (uint32_t*)&newNode->child8 + cidx; + stack[stackPtr++] = (uint32_t)(slot - (uint32_t*)bvh8Data); + stack[stackPtr++] = orig.child[i]; + } + cidx++; + } + for (; cidx < 8; cidx++) + { + ((float*)&newNode->xmin8)[cidx] = 1e30f, ((float*)&newNode->xmax8)[cidx] = 1.00001e30f; + ((float*)&newNode->ymin8)[cidx] = 1e30f, ((float*)&newNode->ymax8)[cidx] = 1.00001e30f; + ((float*)&newNode->zmin8)[cidx] = 1e30f, ((float*)&newNode->zmax8)[cidx] = 1.00001e30f; + ((uint32_t*)&newNode->child8)[cidx] |= EMPTY_BIT; + } + // pop next task + if (!stackPtr) break; + nodeIdx = stack[--stackPtr]; + const uint32_t offset = stack[--stackPtr]; + ((uint32_t*)bvh8Data)[offset] = newBlockPtr; + } + usedBlocks = newBlockPtr; +} + +// BVH8_CWBVH implementation +// ---------------------------------------------------------------------------- + +BVH8_CWBVH::~BVH8_CWBVH() +{ + if (!ownBVH8) bvh8 = MBVH<8>(); // clear out pointers we don't own. + AlignedFree( bvh8Data ); + AlignedFree( bvh8Tris ); +} + +void BVH8_CWBVH::Optimize( const uint32_t iterations, bool extreme ) +{ + bvh8.Optimize( iterations, extreme ); + ConvertFrom( bvh8, true ); +} + +float BVH8_CWBVH::SAHCost( const uint32_t nodeIdx ) const +{ + return bvh8.SAHCost( nodeIdx ); +} + +void BVH8_CWBVH::Save( const char* fileName ) +{ + std::fstream s{ fileName, s.binary | s.out }; + uint32_t header = TINY_BVH_VERSION_SUB + (TINY_BVH_VERSION_MINOR << 8) + (TINY_BVH_VERSION_MAJOR << 16) + (layout << 24); + s.write( (char*)&header, sizeof( uint32_t ) ); + s.write( (char*)&triCount, sizeof( uint32_t ) ); + s.write( (char*)this, sizeof( BVH8_CWBVH ) ); + s.write( (char*)bvh8Data, usedBlocks * 16 ); + s.write( (char*)bvh8Tris, bvh8.idxCount * 4 * 16 ); +} + +bool BVH8_CWBVH::Load( const char* fileName, const uint32_t expectedTris ) +{ + // open file and check contents + std::fstream s{ fileName, s.binary | s.in }; + if (!s) return false; + BVHContext tmp = context; + uint32_t header, fileTriCount; + s.read( (char*)&header, sizeof( uint32_t ) ); + if (((header >> 8) & 255) != TINY_BVH_VERSION_MINOR || + ((header >> 16) & 255) != TINY_BVH_VERSION_MAJOR || + (header & 255) != TINY_BVH_VERSION_SUB || (header >> 24) != layout) return false; + s.read( (char*)&fileTriCount, sizeof( uint32_t ) ); + if (fileTriCount != expectedTris) return false; + // all checks passed; safe to overwrite *this + s.read( (char*)this, sizeof( BVH8_CWBVH ) ); + context = tmp; // can't load context; function pointers will differ. + bvh8Data = (bvhvec4*)AlignedAlloc( usedBlocks * 16 ); + bvh8Tris = (bvhvec4*)AlignedAlloc( bvh8.idxCount * 4 * 16 ); + allocatedBlocks = usedBlocks; + s.read( (char*)bvh8Data, usedBlocks * 16 ); + s.read( (char*)bvh8Tris, bvh8.idxCount * 4 * 16 ); + bvh8 = MBVH<8>(); + return true; +} + +void BVH8_CWBVH::Build( const bvhvec4* vertices, const uint32_t primCount ) +{ + Build( bvhvec4slice( vertices, primCount * 3, sizeof( bvhvec4 ) ) ); +} + +void BVH8_CWBVH::Build( const bvhvec4slice& vertices ) +{ + bvh8.bvh.context = bvh8.context = context; + bvh8.bvh.BuildDefault( vertices ); + bvh8.bvh.Compact(); + bvh8.bvh.SplitLeafs( 3 ); + bvh8.ConvertFrom( bvh8.bvh, false ); + ConvertFrom( bvh8, true ); +} + +void BVH8_CWBVH::Build( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ) +{ + // build the BVH with a continuous array of bvhvec4 vertices, indexed by 'indices'. + Build( bvhvec4slice{ vertices, prims * 3, sizeof( bvhvec4 ) }, indices, prims ); +} + +void BVH8_CWBVH::Build( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ) +{ + // build the BVH from vertices stored in a slice, indexed by 'indices'. + bvh8.bvh.context = bvh8.context = context; + bvh8.bvh.BuildDefault( vertices, indices, prims ); + bvh8.bvh.Compact(); + bvh8.bvh.SplitLeafs( 3 ); + bvh8.ConvertFrom( bvh8.bvh, true ); + ConvertFrom( bvh8, true ); +} + +void BVH8_CWBVH::BuildHQ( const bvhvec4* vertices, const uint32_t primCount ) +{ + BuildHQ( bvhvec4slice( vertices, primCount * 3, sizeof( bvhvec4 ) ) ); +} + +void BVH8_CWBVH::BuildHQ( const bvhvec4slice& vertices ) +{ + bvh8.bvh.context = bvh8.context = context; + bvh8.bvh.BuildHQ( vertices ); + bvh8.bvh.SplitLeafs( 3 ); + bvh8.ConvertFrom( bvh8.bvh, true ); + ConvertFrom( bvh8, true ); +} + +void BVH8_CWBVH::BuildHQ( const bvhvec4* vertices, const uint32_t* indices, const uint32_t prims ) +{ + Build( bvhvec4slice{ vertices, prims * 3, sizeof( bvhvec4 ) }, indices, prims ); +} + +void BVH8_CWBVH::BuildHQ( const bvhvec4slice& vertices, const uint32_t* indices, uint32_t prims ) +{ + bvh8.bvh.context = bvh8.context = context; + bvh8.bvh.BuildHQ( vertices, indices, prims ); + bvh8.bvh.SplitLeafs( 3 ); + bvh8.ConvertFrom( bvh8.bvh, true ); + ConvertFrom( bvh8, true ); +} + +// Convert a BVH8 to the format specified in: "Efficient Incoherent Ray Traversal on GPUs Through +// Compressed Wide BVHs", Ylitie et al. 2017. Adapted from code by "AlanWBFT". +void BVH8_CWBVH::ConvertFrom( MBVH<8>& original, bool ) +{ + // get a copy of the original bvh8 + if (&original != &bvh8) ownBVH8 = false; // bvh isn't ours; don't delete in destructor. + bvh8 = original; + BVH_FATAL_ERROR_IF( bvh8.mbvhNode[0].isLeaf(), "BVH8_CWBVH::ConvertFrom( .. ), converting a single-node bvh." ); + // allocate memory + uint32_t spaceNeeded = bvh8.triCount * 5; // CWBVH nodes use 80 bytes each. + if (spaceNeeded > allocatedBlocks) + { + bvh8Data = (bvhvec4*)AlignedAlloc( spaceNeeded * 16 ); + bvh8Tris = (bvhvec4*)AlignedAlloc( bvh8.idxCount * 4 * 16 ); + allocatedBlocks = spaceNeeded; + } + memset( bvh8Data, 0, spaceNeeded * 16 ); + memset( bvh8Tris, 0, bvh8.idxCount * 3 * 16 ); + CopyBasePropertiesFrom( bvh8 ); + MBVH<8>::MBVHNode* stackNodePtr[256]; + uint32_t stackNodeAddr[256], stackPtr = 1, nodeDataPtr = 5, triDataPtr = 0; + stackNodePtr[0] = &bvh8.mbvhNode[0], stackNodeAddr[0] = 0; + // start conversion + while (stackPtr > 0) + { + MBVH<8>::MBVHNode* orig = stackNodePtr[--stackPtr]; + const int32_t currentNodeAddr = stackNodeAddr[stackPtr]; + bvhvec3 nodeLo = orig->aabbMin, nodeHi = orig->aabbMax; + // greedy child node ordering + const bvhvec3 nodeCentroid = (nodeLo + nodeHi) * 0.5f; + float cost[8][8]; + int32_t assignment[8]; + bool isSlotEmpty[8]; + for (int32_t s = 0; s < 8; s++) + { + isSlotEmpty[s] = true, assignment[s] = -1; + bvhvec3 ds( + (((s >> 2) & 1) == 1) ? -1.0f : 1.0f, + (((s >> 1) & 1) == 1) ? -1.0f : 1.0f, + (((s >> 0) & 1) == 1) ? -1.0f : 1.0f + ); + for (int32_t i = 0; i < 8; i++) if (orig->child[i] == 0) cost[s][i] = BVH_FAR; else + { + MBVH<8>::MBVHNode* const child = &bvh8.mbvhNode[orig->child[i]]; + bvhvec3 childCentroid = (child->aabbMin + child->aabbMax) * 0.5f; + cost[s][i] = tinybvh_dot( childCentroid - nodeCentroid, ds ); + } + } + while (1) + { + float minCost = BVH_FAR; + int32_t minEntryx = -1, minEntryy = -1; + for (int32_t s = 0; s < 8; s++) for (int32_t i = 0; i < 8; i++) + if (assignment[i] == -1 && isSlotEmpty[s] && cost[s][i] < minCost) + minCost = cost[s][i], minEntryx = s, minEntryy = i; + if (minEntryx == -1 && minEntryy == -1) break; + isSlotEmpty[minEntryx] = false, assignment[minEntryy] = minEntryx; + } + for (int32_t i = 0; i < 8; i++) if (assignment[i] == -1) for (int32_t s = 0; s < 8; s++) if (isSlotEmpty[s]) + { + isSlotEmpty[s] = false, assignment[i] = s; + break; + } + const MBVH<8>::MBVHNode oldNode = *orig; + for (int32_t i = 0; i < 8; i++) orig->child[assignment[i]] = oldNode.child[i]; + // calculate quantization parameters for each axis + const int32_t ex = (int32_t)((int8_t)ceilf( log2f( (nodeHi.x - nodeLo.x) / 255.0f ) )); + const int32_t ey = (int32_t)((int8_t)ceilf( log2f( (nodeHi.y - nodeLo.y) / 255.0f ) )); + const int32_t ez = (int32_t)((int8_t)ceilf( log2f( (nodeHi.z - nodeLo.z) / 255.0f ) )); + // encode output + int32_t internalChildCount = 0, leafChildTriCount = 0, childBaseIndex = 0, triangleBaseIndex = 0; + uint8_t imask = 0; + for (int32_t i = 0; i < 8; i++) + { + if (orig->child[i] == 0) continue; + MBVH<8>::MBVHNode* const child = &bvh8.mbvhNode[orig->child[i]]; + const int32_t qlox = (int32_t)floorf( (child->aabbMin.x - nodeLo.x) / powf( 2, (float)ex ) ); + const int32_t qloy = (int32_t)floorf( (child->aabbMin.y - nodeLo.y) / powf( 2, (float)ey ) ); + const int32_t qloz = (int32_t)floorf( (child->aabbMin.z - nodeLo.z) / powf( 2, (float)ez ) ); + const int32_t qhix = (int32_t)ceilf( (child->aabbMax.x - nodeLo.x) / powf( 2, (float)ex ) ); + const int32_t qhiy = (int32_t)ceilf( (child->aabbMax.y - nodeLo.y) / powf( 2, (float)ey ) ); + const int32_t qhiz = (int32_t)ceilf( (child->aabbMax.z - nodeLo.z) / powf( 2, (float)ez ) ); + uint8_t* const baseAddr = (uint8_t*)&bvh8Data[currentNodeAddr + 2]; + baseAddr[i + 0] = (uint8_t)qlox, baseAddr[i + 24] = (uint8_t)qhix; + baseAddr[i + 8] = (uint8_t)qloy, baseAddr[i + 32] = (uint8_t)qhiy; + baseAddr[i + 16] = (uint8_t)qloz, baseAddr[i + 40] = (uint8_t)qhiz; + if (!child->isLeaf()) + { + // interior node, set params and push onto stack + const int32_t childNodeAddr = nodeDataPtr; + if (internalChildCount++ == 0) childBaseIndex = childNodeAddr / 5; + nodeDataPtr += 5, imask |= 1 << i; + // set the meta field - This calculation assumes children are stored contiguously. + uint8_t* const childMetaField = ((uint8_t*)&bvh8Data[currentNodeAddr + 1]) + 8; + childMetaField[i] = (1 << 5) | (24 + (uint8_t)i); // I don't see how this accounts for empty children? + stackNodePtr[stackPtr] = child, stackNodeAddr[stackPtr++] = childNodeAddr; // counted in float4s + internalChildCount++; + continue; + } + // leaf node + const uint32_t tcount = child->triCount; // will not exceed 3. + if (leafChildTriCount == 0) triangleBaseIndex = triDataPtr; + int32_t unaryEncodedTriCount = tcount == 1 ? 0b001 : tcount == 2 ? 0b011 : 0b111; + // set the meta field - This calculation assumes children are stored contiguously. + uint8_t* const childMetaField = ((uint8_t*)&bvh8Data[currentNodeAddr + 1]) + 8; + childMetaField[i] = (uint8_t)((unaryEncodedTriCount << 5) | leafChildTriCount); + leafChildTriCount += tcount; + for (uint32_t j = 0; j < tcount; j++) + { + int32_t triIdx = bvh8.bvh.primIdx[child->firstTri + j]; + uint32_t ti0, ti1, ti2; + if (bvh8.bvh.vertIdx) + ti0 = bvh8.bvh.vertIdx[triIdx * 3], + ti1 = bvh8.bvh.vertIdx[triIdx * 3 + 1], + ti2 = bvh8.bvh.vertIdx[triIdx * 3 + 2]; + else + ti0 = triIdx * 3, ti1 = triIdx * 3 + 1, ti2 = triIdx * 3 + 2; + #ifdef CWBVH_COMPRESSED_TRIS + PrecomputeTriangle( verts, ti0, ti1, ti2, (float*)&bvh8Tris[triDataPtr] ); + bvh8Tris[triDataPtr + 3] = bvhvec4( 0, 0, 0, *(float*)&triIdx ); + triDataPtr += 4; + #else + bvhvec4 t = bvh8.bvh.verts[ti0]; + bvh8Tris[triDataPtr + 0] = bvh8.bvh.verts[ti2] - t; + bvh8Tris[triDataPtr + 1] = bvh8.bvh.verts[ti1] - t; + t.w = *(float*)&triIdx; + bvh8Tris[triDataPtr + 2] = t, triDataPtr += 3; + #endif + } + } + uint8_t exyzAndimask[4] = { *(uint8_t*)&ex, *(uint8_t*)&ey, *(uint8_t*)&ez, imask }; + bvh8Data[currentNodeAddr + 0] = bvhvec4( nodeLo, *(float*)&exyzAndimask ); + bvh8Data[currentNodeAddr + 1].x = *(float*)&childBaseIndex; + bvh8Data[currentNodeAddr + 1].y = *(float*)&triangleBaseIndex; + } + usedBlocks = nodeDataPtr; +} + +// ============================================================================ +// +// I M P L E M E N T A T I O N - A V X / S S E C O D E +// +// ============================================================================ + +#ifdef BVH_USESSE + +inline __m128 fastrcp4( const __m128 a ) +{ + __m128 res = _mm_rcp_ps( a ); + __m128 muls = _mm_mul_ps( a, _mm_mul_ps( res, res ) ); + return _mm_sub_ps( _mm_add_ps( res, res ), muls ); +} + +static uint32_t __popc( uint32_t x ) +{ +#if defined _MSC_VER && !defined __clang__ + return __popcnt( x ); +#elif defined __GNUC__ || defined __clang__ + return __builtin_popcount( x ); +#endif +} + +static const unsigned __A = 0x03020100, __B = 0x07060504, __C = 0x0B0A0908, __D = 0x0F0E0D0C; +ALIGNED( 64 ) static __m128i idxLUT4_[16] = { + _mm_set_epi32( 0, 0, 0, 0 ), // 0000 + _mm_set_epi32( 0, 0, 0, __A ), // 0001 + _mm_set_epi32( 0, 0, 0, __B ), // 0010 + _mm_set_epi32( 0, 0, __B, __A ), // 0011 + _mm_set_epi32( 0, 0, 0, __C ), // 0100 + _mm_set_epi32( 0, 0, __C, __A ), // 0101 + _mm_set_epi32( 0, 0, __C, __B ), // 0110 + _mm_set_epi32( 0, __C, __B, __A ), // 0111 + _mm_set_epi32( 0, 0, 0, __D ), // 1000 + _mm_set_epi32( 0, 0, __D, __A ), // 1001 + _mm_set_epi32( 0, 0, __D, __B ), // 1010 + _mm_set_epi32( 0, __D, __B, __A ), // 1011 + _mm_set_epi32( 0, 0, __D, __C ), // 1100 + _mm_set_epi32( 0, __D, __C, __A ), // 1101 + _mm_set_epi32( 0, __D, __C, __B ), // 1110 + _mm_set_epi32( __D, __C, __B, __A ) // 1111 +}; + +int32_t BVH4_CPU::Intersect( Ray& ray ) const +{ + VALIDATE_RAY( ray ); + const bool posX = ray.D.x >= 0, posY = ray.D.y >= 0, posZ = ray.D.z >= 0; + if (!posX) goto negx; + if (posY) { if (posZ) return Intersect( ray ); else return Intersect( ray ); } + if (posZ) return Intersect( ray ); else return Intersect( ray ); +negx: + if (posY) { if (posZ) return Intersect( ray ); else return Intersect( ray ); } + if (posZ) return Intersect( ray ); else return Intersect( ray ); +} + +template int32_t BVH4_CPU::Intersect( Ray& ray ) const +{ + ALIGNED( 64 ) int32_t nodeStack[256]; + ALIGNED( 64 ) float distStack[256]; + const __m128 zero4 = _mm_setzero_ps(); + __m128 t4 = _mm_set1_ps( ray.hit.t ); + ALIGNED( 64 ) int32_t stackPtr = 0, nodeIdx = 0; + union ALIGNED( 32 ) { __m256i c8s; uint32_t cs[8]; }; + constexpr int signShift = (posX ? 2 : 0) + (posY ? 4 : 0) + (posZ ? 8 : 0); + const __m128 rx4 = _mm_set1_ps( ray.O.x * ray.rD.x ), rdx4 = _mm_set1_ps( ray.rD.x ); + const __m128 ry4 = _mm_set1_ps( ray.O.y * ray.rD.y ), rdy4 = _mm_set1_ps( ray.rD.y ); + const __m128 rz4 = _mm_set1_ps( ray.O.z * ray.rD.z ), rdz4 = _mm_set1_ps( ray.rD.z ); + const __m128 ox4 = _mm_set1_ps( ray.O.x ), oy4 = _mm_set1_ps( ray.O.y ), oz4 = _mm_set1_ps( ray.O.z ); + const __m128 dx4 = _mm_set1_ps( ray.D.x ), dy4 = _mm_set1_ps( ray.D.y ), dz4 = _mm_set1_ps( ray.D.z ); + const __m128 one4 = _mm_set1_ps( 1 ), inf4 = _mm_set1_ps( 1e34f ); +#ifndef __AVX__ + const __m128i shftmsk4 = _mm_set1_epi32( 3 ), mul4 = _mm_set1_epi32( 0x04040404 ), add4 = _mm_set1_epi32( 0x03020100 ); +#endif +#ifdef _DEBUG + // sorry, not even this can be tolerated in this function. Only in debug. + uint32_t steps = 0; +#endif + while (1) + { + #ifdef _DEBUG + steps++; + #endif + while (!(nodeIdx & LEAF_BIT)) + { + const BVHNode* n = (BVHNode*)(bvh4Data + nodeIdx); + const __m128 tx1 = _mm_sub_ps( _mm_mul_ps( posX ? n->xmin4 : n->xmax4, rdx4 ), rx4 ); + const __m128 ty1 = _mm_sub_ps( _mm_mul_ps( posY ? n->ymin4 : n->ymax4, rdy4 ), ry4 ); + const __m128 tz1 = _mm_sub_ps( _mm_mul_ps( posZ ? n->zmin4 : n->zmax4, rdz4 ), rz4 ); + const __m128 tx2 = _mm_sub_ps( _mm_mul_ps( posX ? n->xmax4 : n->xmin4, rdx4 ), rx4 ); + const __m128 ty2 = _mm_sub_ps( _mm_mul_ps( posY ? n->ymax4 : n->ymin4, rdy4 ), ry4 ); + const __m128 tz2 = _mm_sub_ps( _mm_mul_ps( posZ ? n->zmax4 : n->zmin4, rdz4 ), rz4 ); + __m128 tmin = _mm_max_ps( _mm_max_ps( _mm_max_ps( zero4, tx1 ), ty1 ), tz1 ); + const __m128 tmax = _mm_min_ps( _mm_min_ps( _mm_min_ps( tx2, t4 ), ty2 ), tz2 ); + const __m128 mask4 = _mm_cmple_ps( tmin, tmax ); + const uint32_t mask = _mm_movemask_ps( mask4 ); + const uint32_t validNodes = __popc( mask ); + if (validNodes == 1) + { + const uint32_t lane = __bfind( mask ); + nodeIdx = ((uint32_t*)&n->child4)[lane]; + } + else if (validNodes) + { + #ifdef __AVX__ + // avx1 path + const __m128i index = _mm_srli_epi32( n->perm4, signShift ); + const uint32_t m = _mm_movemask_ps( _mm_permutevar_ps( mask4, index ) ); + tmin = _mm_permutevar_ps( tmin, index ); + const __m128i c4 = _mm_castps_si128( _mm_permutevar_ps( _mm_castsi128_ps( n->child4 ), index ) ); + #else + // sse4.2 path, 3 extra ops to emulate _mm_permutevar_ps via _mm_shuffle_epi8 + const __m128i raw4 = _mm_and_si128( _mm_srli_epi32( n->perm4, signShift ), shftmsk4 ); + const __m128i shfl16 = _mm_add_epi32( _mm_mullo_epi32( raw4, mul4 ), add4 ); + const uint32_t m = _mm_movemask_ps( _mm_castsi128_ps( _mm_shuffle_epi8( _mm_castps_si128( mask4 ), shfl16 ) ) ); + tmin = _mm_castsi128_ps( _mm_shuffle_epi8( _mm_castps_si128( tmin ), shfl16 ) ); + const __m128i c4 = _mm_shuffle_epi8( n->child4, shfl16 ); + #endif + const __m128i cpi = idxLUT4_[m]; + const __m128 dist4 = _mm_castsi128_ps( _mm_shuffle_epi8( _mm_castps_si128( tmin ), cpi ) ); + const __m128i child4 = _mm_shuffle_epi8( c4, cpi ); + _mm_storeu_si128( (__m128i*)(nodeStack + stackPtr), child4 ); + _mm_storeu_ps( (float*)(distStack + stackPtr), dist4 ); + stackPtr += validNodes - 1; + nodeIdx = nodeStack[stackPtr]; + } + else + { + if (!stackPtr) goto the_end; + nodeIdx = nodeStack[--stackPtr]; + } + } + // Moeller-Trumbore ray/triangle intersection algorithm for four triangles + uint32_t n; + memcpy( &n, &nodeIdx, 4 ); + const BVHTri4Leaf* leaf = (BVHTri4Leaf*)(bvh4Data + (n & 0x1fffffff)); + const __m128 hx4 = _mm_sub_ps( _mm_mul_ps( dy4, leaf->e2z4 ), _mm_mul_ps( dz4, leaf->e2y4 ) ); + const __m128 hy4 = _mm_sub_ps( _mm_mul_ps( dz4, leaf->e2x4 ), _mm_mul_ps( dx4, leaf->e2z4 ) ); + const __m128 hz4 = _mm_sub_ps( _mm_mul_ps( dx4, leaf->e2y4 ), _mm_mul_ps( dy4, leaf->e2x4 ) ); + const __m128 sx4 = _mm_sub_ps( ox4, leaf->v0x4 ), sy4 = _mm_sub_ps( oy4, leaf->v0y4 ), sz4 = _mm_sub_ps( oz4, leaf->v0z4 ); + const __m128 det4 = _mm_add_ps( _mm_mul_ps( leaf->e1z4, hz4 ), _mm_add_ps( _mm_mul_ps( leaf->e1x4, hx4 ), _mm_mul_ps( leaf->e1y4, hy4 ) ) ); + const __m128 qz4 = _mm_sub_ps( _mm_mul_ps( sx4, leaf->e1y4 ), _mm_mul_ps( sy4, leaf->e1x4 ) ); + const __m128 qx4 = _mm_sub_ps( _mm_mul_ps( sy4, leaf->e1z4 ), _mm_mul_ps( sz4, leaf->e1y4 ) ); + const __m128 qy4 = _mm_sub_ps( _mm_mul_ps( sz4, leaf->e1x4 ), _mm_mul_ps( sx4, leaf->e1z4 ) ); + const __m128 inv_det4 = fastrcp4( det4 ); + const __m128 u4 = _mm_mul_ps( _mm_add_ps( _mm_mul_ps( sz4, hz4 ), _mm_add_ps( _mm_mul_ps( sx4, hx4 ), _mm_mul_ps( sy4, hy4 ) ) ), inv_det4 ); + const __m128 v4 = _mm_mul_ps( _mm_add_ps( _mm_mul_ps( dz4, qz4 ), _mm_add_ps( _mm_mul_ps( dx4, qx4 ), _mm_mul_ps( dy4, qy4 ) ) ), inv_det4 ); + const __m128 ta4 = _mm_mul_ps( _mm_add_ps( _mm_mul_ps( leaf->e2z4, qz4 ), _mm_add_ps( _mm_mul_ps( leaf->e2x4, qx4 ), _mm_mul_ps( leaf->e2y4, qy4 ) ) ), inv_det4 ); + const __m128 mask1 = _mm_and_ps( _mm_cmpge_ps( u4, zero4 ), _mm_cmpge_ps( v4, zero4 ) ); + const __m128 mask2 = _mm_cmple_ps( _mm_add_ps( u4, v4 ), one4 ); + const __m128 mask3 = _mm_and_ps( _mm_cmplt_ps( ta4, t4 ), _mm_cmpgt_ps( ta4, zero4 ) ); + __m128 combined = _mm_and_ps( _mm_and_ps( mask1, mask2 ), mask3 ); + uint32_t imask = _mm_movemask_ps( combined ); + // evaluate opacity map, if present (SSE version). + if (opmap) if (imask) + { + const __m128 fN4 = _mm_set1_ps( (float)opmapN ); + const __m128i row4 = _mm_cvttps_epi32( _mm_mul_ps( _mm_add_ps( u4, v4 ), fN4 ) ); + const __m128i dia4 = _mm_cvttps_epi32( _mm_mul_ps( _mm_sub_ps( one4, u4 ), fN4 ) ); + const __m128i v0 = _mm_mullo_epi32( row4, row4 ); + const __m128i v1 = _mm_cvttps_epi32( _mm_mul_ps( v4, fN4 ) ); + const __m128i v2 = _mm_sub_epi32( dia4, _mm_sub_epi32( _mm_set1_epi32( opmapN - 1 ), row4 ) ); + union { uint32_t idx[4]; __m128i idx4; }; + union { uint32_t omask[4]; __m128 omask4; }; + idx4 = _mm_add_epi32( _mm_add_epi32( v0, v1 ), v2 ); + // proceed with scalar code for gather operation - TODO: better approach? + omask[0] = omask[1] = omask[2] = omask[3] = 0; + for (int i = 0; i < 4; i++) if (imask & (1 << i)) + { + uint32_t* om = opmap + leaf->primIdx[i] * ((opmapN * opmapN + 31) >> 5); + if (om[idx[i] >> 5] & (1 << (idx[i] & 31))) omask[i] = 0xffffffff; + } + // combine + combined = _mm_and_ps( combined, omask4 ); + imask = _mm_movemask_ps( combined ); + } + if (imask) + { + const __m128 dist4 = _mm_blendv_ps( inf4, ta4, combined ); + // compute broadcasted horizontal minimum of dist4 + const __m128 a = _mm_min_ps( dist4, _mm_shuffle_ps( dist4, dist4, _MM_SHUFFLE( 2, 1, 0, 3 ) ) ); + const __m128 c = _mm_min_ps( a, _mm_shuffle_ps( a, a, _MM_SHUFFLE( 1, 0, 3, 2 ) ) ); + const uint32_t lane = __bfind( _mm_movemask_ps( _mm_cmpeq_ps( c, dist4 ) ) ); + // update hit record + const __m128 _d4 = dist4; + const float t = ((float*)&_d4)[lane]; + const __m128 _u4 = u4, _v4 = v4; + ray.hit.t = t, ray.hit.u = ((float*)&_u4)[lane], ray.hit.v = ((float*)&_v4)[lane]; + #if INST_IDX_BITS == 32 + ray.hit.prim = leaf->primIdx[lane], ray.hit.inst = ray.instIdx; + #else + ray.hit.prim = leaf->primIdx[lane] + ray.instIdx; + #endif + t4 = _mm_set1_ps( t ); + // compress stack + uint32_t outStackPtr = 0; + for (int32_t i = 0; i < stackPtr; i += 4) + { + __m128i node4 = _mm_load_si128( (__m128i*)(nodeStack + i) ); + __m128 d4 = _mm_load_ps( (float*)(distStack + i) ); + const uint32_t mask = _mm_movemask_ps( _mm_cmple_ps( d4, t4 ) ); + const __m128i shfl16 = idxLUT4_[mask]; + const __m128i dst4 = _mm_shuffle_epi8( _mm_castps_si128( d4 ), shfl16 ); + node4 = _mm_shuffle_epi8( node4, shfl16 ); + _mm_storeu_si128( (__m128i*)(distStack + outStackPtr), dst4 ); + _mm_storeu_si128( (__m128i*)(nodeStack + outStackPtr), node4 ); + const int32_t numItems = tinybvh_min( 4, stackPtr - i ), validMask = (1 << numItems) - 1; + outStackPtr += __popc( mask & validMask ); + } + stackPtr = outStackPtr; + } + if (!stackPtr) break; + nodeIdx = nodeStack[--stackPtr]; + } +the_end: +#ifdef _DEBUG + return steps; +#else + return 0; +#endif +} + +bool BVH4_CPU::IsOccluded( const Ray& ray ) const +{ + VALIDATE_RAY( ray ); + const bool posX = ray.D.x >= 0, posY = ray.D.y >= 0, posZ = ray.D.z >= 0; + if (!posX) goto negx; + if (posY) { if (posZ) return IsOccluded( ray ); else return IsOccluded( ray ); } + if (posZ) return IsOccluded( ray ); else return IsOccluded( ray ); +negx: + if (posY) { if (posZ) return IsOccluded( ray ); else return IsOccluded( ray ); } + if (posZ) return IsOccluded( ray ); else return IsOccluded( ray ); +} + +template bool BVH4_CPU::IsOccluded( const Ray& ray ) const +{ + ALIGNED( 64 ) uint32_t nodeStack[256]; + ALIGNED( 64 ) int32_t stackPtr = 0, nodeIdx = 0; + const __m128 t4 = _mm_set1_ps( ray.hit.t ); + const __m128 rx4 = _mm_set1_ps( ray.O.x * ray.rD.x ), rdx4 = _mm_set1_ps( ray.rD.x ); + const __m128 ry4 = _mm_set1_ps( ray.O.y * ray.rD.y ), rdy4 = _mm_set1_ps( ray.rD.y ); + const __m128 rz4 = _mm_set1_ps( ray.O.z * ray.rD.z ), rdz4 = _mm_set1_ps( ray.rD.z ); + const __m128 ox4 = _mm_set1_ps( ray.O.x ), oy4 = _mm_set1_ps( ray.O.y ), oz4 = _mm_set1_ps( ray.O.z ); + const __m128 dx4 = _mm_set1_ps( ray.D.x ), dy4 = _mm_set1_ps( ray.D.y ), dz4 = _mm_set1_ps( ray.D.z ); + const __m128 one4 = _mm_set1_ps( 1.0f ), zero4 = _mm_setzero_ps(); + while (1) + { + while (!(nodeIdx & LEAF_BIT)) + { + const BVHNode* n = (BVHNode*)(bvh4Data + nodeIdx); + const __m128 tx1 = _mm_sub_ps( _mm_mul_ps( posX ? n->xmin4 : n->xmax4, rdx4 ), rx4 ); + const __m128 ty1 = _mm_sub_ps( _mm_mul_ps( posY ? n->ymin4 : n->ymax4, rdy4 ), ry4 ); + const __m128 tz1 = _mm_sub_ps( _mm_mul_ps( posZ ? n->zmin4 : n->zmax4, rdz4 ), rz4 ); + const __m128 tx2 = _mm_sub_ps( _mm_mul_ps( posX ? n->xmax4 : n->xmin4, rdx4 ), rx4 ); + const __m128 ty2 = _mm_sub_ps( _mm_mul_ps( posY ? n->ymax4 : n->ymin4, rdy4 ), ry4 ); + const __m128 tz2 = _mm_sub_ps( _mm_mul_ps( posZ ? n->zmax4 : n->zmin4, rdz4 ), rz4 ); + const __m128 tmin = _mm_max_ps( _mm_max_ps( _mm_max_ps( _mm_setzero_ps(), tx1 ), ty1 ), tz1 ); + const __m128 tmax = _mm_min_ps( _mm_min_ps( _mm_min_ps( tx2, t4 ), ty2 ), tz2 ); + const __m128 mask4 = _mm_cmple_ps( tmin, tmax ); + const uint32_t mask = _mm_movemask_ps( mask4 ); + const uint32_t validNodes = __popc( mask ); + if (validNodes == 1) + { + const uint32_t lane = __bfind( mask ); + nodeIdx = ((uint32_t*)&n->child4)[lane]; + } + else if (validNodes) + { + const __m128i cpi = idxLUT4_[mask]; + const __m128i child4 = _mm_shuffle_epi8( n->child4, cpi ); + _mm_storeu_si128( (__m128i*)(nodeStack + stackPtr), child4 ); + stackPtr += validNodes - 1; + nodeIdx = nodeStack[stackPtr]; + } + else + { + if (!stackPtr) return false; + nodeIdx = nodeStack[--stackPtr]; + } + } + uint32_t n; + memcpy( &n, &nodeIdx, 4 ); + // Moeller-Trumbore ray/triangle intersection algorithm for four triangles + const BVHTri4Leaf* leaf = (BVHTri4Leaf*)(bvh4Data + (n & 0x1fffffff)); + const __m128 hx4 = _mm_sub_ps( _mm_mul_ps( dy4, leaf->e2z4 ), _mm_mul_ps( dz4, leaf->e2y4 ) ); + const __m128 hy4 = _mm_sub_ps( _mm_mul_ps( dz4, leaf->e2x4 ), _mm_mul_ps( dx4, leaf->e2z4 ) ); + const __m128 hz4 = _mm_sub_ps( _mm_mul_ps( dx4, leaf->e2y4 ), _mm_mul_ps( dy4, leaf->e2x4 ) ); + const __m128 sx4 = _mm_sub_ps( ox4, leaf->v0x4 ), sy4 = _mm_sub_ps( oy4, leaf->v0y4 ), sz4 = _mm_sub_ps( oz4, leaf->v0z4 ); + const __m128 det4 = _mm_add_ps( _mm_mul_ps( leaf->e1z4, hz4 ), _mm_add_ps( _mm_mul_ps( leaf->e1x4, hx4 ), _mm_mul_ps( leaf->e1y4, hy4 ) ) ); + const __m128 qz4 = _mm_sub_ps( _mm_mul_ps( sx4, leaf->e1y4 ), _mm_mul_ps( sy4, leaf->e1x4 ) ); + const __m128 qx4 = _mm_sub_ps( _mm_mul_ps( sy4, leaf->e1z4 ), _mm_mul_ps( sz4, leaf->e1y4 ) ); + const __m128 qy4 = _mm_sub_ps( _mm_mul_ps( sz4, leaf->e1x4 ), _mm_mul_ps( sx4, leaf->e1z4 ) ); + const __m128 inv_det4 = fastrcp4( det4 ); + const __m128 u4 = _mm_mul_ps( _mm_add_ps( _mm_mul_ps( sz4, hz4 ), _mm_add_ps( _mm_mul_ps( sx4, hx4 ), _mm_mul_ps( sy4, hy4 ) ) ), inv_det4 ); + const __m128 v4 = _mm_mul_ps( _mm_add_ps( _mm_mul_ps( dz4, qz4 ), _mm_add_ps( _mm_mul_ps( dx4, qx4 ), _mm_mul_ps( dy4, qy4 ) ) ), inv_det4 ); + const __m128 ta4 = _mm_mul_ps( _mm_add_ps( _mm_mul_ps( leaf->e2z4, qz4 ), _mm_add_ps( _mm_mul_ps( leaf->e2x4, qx4 ), _mm_mul_ps( leaf->e2y4, qy4 ) ) ), inv_det4 ); + const __m128 mask1 = _mm_and_ps( _mm_cmpge_ps( u4, zero4 ), _mm_cmpge_ps( v4, zero4 ) ); + const __m128 mask2 = _mm_cmple_ps( _mm_add_ps( u4, v4 ), one4 ); + const __m128 mask3 = _mm_and_ps( _mm_cmplt_ps( ta4, t4 ), _mm_cmpgt_ps( ta4, zero4 ) ); + __m128 combined = _mm_and_ps( _mm_and_ps( mask1, mask2 ), mask3 ); + // evaluate opacity map, if present (SSE version). + if (_mm_movemask_ps( combined )) + { + if (!opmap) return true; + // evaluate opacity map, SSE version. + const __m128 fN4 = _mm_set1_ps( (float)opmapN ); + const __m128i row4 = _mm_cvttps_epi32( _mm_mul_ps( _mm_add_ps( u4, v4 ), fN4 ) ); + const __m128i dia4 = _mm_cvttps_epi32( _mm_mul_ps( _mm_sub_ps( one4, u4 ), fN4 ) ); + const __m128i v0 = _mm_mullo_epi32( row4, row4 ); + const __m128i v1 = _mm_cvttps_epi32( _mm_mul_ps( v4, fN4 ) ); + const __m128i v2 = _mm_sub_epi32( dia4, _mm_sub_epi32( _mm_set1_epi32( opmapN - 1 ), row4 ) ); + union { uint32_t idx[4]; __m128i idx4; }; + idx4 = _mm_add_epi32( _mm_add_epi32( v0, v1 ), v2 ); + // proceed with scalar code for gather operation - TODO: better approach? + const uint32_t imask = _mm_movemask_ps( combined ); + for (int i = 0; i < 4; i++) if (imask & (1 << i)) + { + uint32_t* om = opmap + leaf->primIdx[i] * ((opmapN * opmapN + 31) >> 5); + if (om[idx[i] >> 5] & (1 << (idx[i] & 31))) return true; + } + } + // we continue. + if (!stackPtr) return false; + nodeIdx = nodeStack[--stackPtr]; + } +} + +#endif // BVH_USESSE + +#ifdef BVH_USEAVX + +// Ultra-fast single-threaded AVX binned-SAH-builder. +// This code produces BVHs nearly identical to reference, but much faster. +// On a 12th gen laptop i7 CPU, Sponza Crytek (~260k tris) is processed in 51ms. +// The code relies on the availability of AVX instructions. AVX2 is not needed. +#if defined _MSC_VER && !defined __clang__ +#define LANE(a,b) a.m128_f32[b] +#define LANE8(a,b) a.m256_f32[b] +// Not using clang/g++ method under MSCC; compiler may benefit from .m128_i32. +#define ILANE(a,b) a.m128i_i32[b] +#else +#define LANE(a,b) a[b] +#define LANE8(a,b) a[b] +// Below method reduces to a single instruction. +#define ILANE(a,b) _mm_cvtsi128_si32(_mm_castps_si128( _mm_shuffle_ps(_mm_castsi128_ps( a ), _mm_castsi128_ps( a ), b))) +#endif +inline __m256 fastrcp8( const __m256 a ) +{ + __m256 res = _mm256_rcp_ps( a ); + __m256 muls = _mm256_mul_ps( a, _mm256_mul_ps( res, res ) ); + return _mm256_sub_ps( _mm256_add_ps( res, res ), muls ); +} +inline float halfArea( const __m128 a /* a contains extent of aabb */ ) +{ + return LANE( a, 0 ) * LANE( a, 1 ) + LANE( a, 1 ) * LANE( a, 2 ) + LANE( a, 2 ) * LANE( a, 3 ); +} +inline float halfArea( const __m256& a /* a contains aabb itself, with min.xyz negated */ ) +{ +#ifndef _MSC_VER + // g++ doesn't seem to like the faster construct + float* c = (float*)&a; + float ex = c[4] + c[0], ey = c[5] + c[1], ez = c[6] + c[2]; + return ex * ey + ey * ez + ez * ex; +#else + const __m128 q = _mm256_castps256_ps128( _mm256_add_ps( _mm256_permute2f128_ps( a, a, 5 ), a ) ); + const __m128 v = _mm_mul_ps( q, _mm_shuffle_ps( q, q, 9 ) ); + return LANE( v, 0 ) + LANE( v, 1 ) + LANE( v, 2 ); +#endif +} +#define PROCESS_PLANE( a, pos, ANLR, lN, rN, lb, rb ) if (lN * rN != 0) { \ + ANLR = halfArea( lb ) * (float)lN + halfArea( rb ) * (float)rN; if (ANLR < splitCost) \ + splitCost = ANLR, bestAxis = a, bestPos = pos, bestLBox = lb, bestRBox = rb; } +#if defined _MSC_VER +#pragma warning ( push ) +#pragma warning( disable:4701 ) // "potentially uninitialized local variable 'bestLBox' used" +#pragma warning (disable:4324) // "lambda structure was padded due to alignment specifier" +#elif defined __GNUC__ && !defined __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif +void BVH::BuildAVX( const bvhvec4* vertices, const uint32_t primCount ) +{ + // build the BVH with a continuous array of bvhvec4 vertices: + // in this case, the stride for the slice is 16 bytes. + BuildAVX( bvhvec4slice{ vertices, primCount * 3, sizeof( bvhvec4 ) } ); +} +void BVH::BuildAVX( const bvhvec4slice& vertices ) +{ + PrepareAVXBuild( vertices, 0, 0 ); + BuildAVXSubtree( 0u, 0u ); +} +void BVH::BuildAVX( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ) +{ + // build the BVH with an indexed array of bvhvec4 vertices. + bvhvec4slice slice( vertices, primCount * 3, sizeof( bvhvec4 ) ); + BuildAVX( slice, indices, primCount ); +} +void BVH::BuildAVX( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ) +{ + PrepareAVXBuild( vertices, indices, primCount ); + BuildAVXSubtree( 0u, 0u ); +} +void BVH::PrepareAVXBuild( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t prims ) +{ + BVH_FATAL_ERROR_IF( vertices.count == 0, "BVH::PrepareAVXBuild( .. ), primCount == 0." ); + BVH_FATAL_ERROR_IF( vertices.stride & 15, "BVH::PrepareAVXBuild( .. ), stride must be multiple of 16." ); + // some constants + static const __m128 min4 = _mm_set1_ps( BVH_FAR ), max4 = _mm_set1_ps( -BVH_FAR ); + // reset node pool + uint32_t primCount = prims > 0 ? prims : vertices.count / 3; + const uint32_t spaceNeeded = primCount * 2; + if (allocatedNodes < spaceNeeded) + { + AlignedFree( bvhNode ); + AlignedFree( primIdx ); + AlignedFree( fragment ); + primIdx = (uint32_t*)AlignedAlloc( primCount * sizeof( uint32_t ) ); + bvhNode = (BVHNode*)AlignedAlloc( spaceNeeded * sizeof( BVHNode ) ); + allocatedNodes = spaceNeeded; + memset( &bvhNode[1], 0, 32 ); // avoid crash in refit. + fragment = (Fragment*)AlignedAlloc( primCount * sizeof( Fragment ) ); + } + else BVH_FATAL_ERROR_IF( !rebuildable, "BVH::BuildAVX( .. ), bvh not rebuildable." ); + verts = vertices; // note: we're not copying this data; don't delete. + vertIdx = (uint32_t*)indices; + triCount = idxCount = primCount; + newNodePtr = 2; + struct FragSSE { __m128 bmin4, bmax4; }; + FragSSE* frag4 = (FragSSE*)fragment; + const __m128* verts4 = (__m128*)verts.data; // that's why it must be 16-byte aligned. + // assign all triangles to the root node + BVHNode& root = bvhNode[0]; + root.leftFirst = 0, root.triCount = triCount; + // initialize fragments and update root bounds + __m128 rootMin = min4, rootMax = max4; + uint32_t stride4 = verts.stride / 16; + if (indices) + { + BVH_FATAL_ERROR_IF( vertices.count == 0, "BVH::PrepareAVXBuild( .. ), empty vertex slice." ); + BVH_FATAL_ERROR_IF( prims == 0, "BVH::PrepareAVXBuild( .. ), prims == 0." ); + // build the BVH over indexed triangles + for (uint32_t i = 0; i < triCount; i++) + { + const uint32_t i0 = indices[i * 3], i1 = indices[i * 3 + 1], i2 = indices[i * 3 + 2]; + const __m128 v0 = verts4[i0 * stride4], v1 = verts4[i1 * stride4], v2 = verts4[i2 * stride4]; + const __m128 t1 = _mm_min_ps( _mm_min_ps( v0, v1 ), v2 ); + const __m128 t2 = _mm_max_ps( _mm_max_ps( v0, v1 ), v2 ); + frag4[i].bmin4 = t1, frag4[i].bmax4 = t2, rootMin = _mm_min_ps( rootMin, t1 ), rootMax = _mm_max_ps( rootMax, t2 ); + primIdx[i] = i; + } + } + else + { + BVH_FATAL_ERROR_IF( vertices.count == 0, "BVH::PrepareAVXBuild( .. ), empty vertex slice." ); + BVH_FATAL_ERROR_IF( prims != 0, "BVH::PrepareAVXBuild( .. ), indices == 0." ); + // build the BVH over a list of vertices: three per triangle + for (uint32_t i = 0; i < triCount; i++) + { + const __m128 v0 = verts4[(i * 3) * stride4], v1 = verts4[(i * 3 + 1) * stride4], v2 = verts4[(i * 3 + 2) * stride4]; + const __m128 t1 = _mm_min_ps( _mm_min_ps( v0, v1 ), v2 ); + const __m128 t2 = _mm_max_ps( _mm_max_ps( v0, v1 ), v2 ); + frag4[i].bmin4 = t1, frag4[i].bmax4 = t2, rootMin = _mm_min_ps( rootMin, t1 ), rootMax = _mm_max_ps( rootMax, t2 ); + primIdx[i] = i; + } + } + root.aabbMin = *(bvhvec3*)&rootMin, root.aabbMax = *(bvhvec3*)&rootMax; + bvh_over_indices = indices != nullptr; +} + +void BVH::BuildAVXBinTask( const uint32_t first, const uint32_t last, __m256* binbox, __m256* orig, + uint32_t* count, const __m128& nmin4, const __m128& rpd4 ) +{ + struct FragSSE { __m128 bmin4, bmax4; }; + FragSSE* frag4 = (FragSSE*)fragment; + __m256* frag8 = (__m256*)fragment; + uint32_t fi = primIdx[first]; + memset( count, 0, 3 * AVXBINS * 4 ); + memcpy( binbox, orig, 3 * AVXBINS * 32 ); + __m256 r0, r1, r2, f = _mm256_xor_ps( _mm256_and_ps( frag8[fi], mask6 ), signFlip8 ); + const __m128 fmin = _mm_and_ps( frag4[fi].bmin4, mask3 ), fmax = _mm_and_ps( frag4[fi].bmax4, mask3 ); + const __m128i bi4 = _mm_cvtps_epi32( _mm_sub_ps( _mm_mul_ps( _mm_sub_ps( _mm_add_ps( fmax, fmin ), nmin4 ), rpd4 ), half4 ) ); + union { __m128i bc4; uint32_t bc[4]; }; + bc4 = _mm_max_epi32( _mm_min_epi32( bi4, maxbin4 ), _mm_setzero_si128() ); // clamp needed after all + uint32_t i0 = bc[0], i1 = bc[1], i2 = bc[2], * ti = primIdx + first + 1; + for (uint32_t i = first; i < last - 1; i++) + { + uint32_t fid = *ti++; + #if defined __GNUC__ || _MSC_VER < 1920 + if (fid > triCount) fid = triCount - 1; // never happens but g++ *and* vs2017 need this to not crash... + #endif + const __m256 b0 = binbox[i0], b1 = binbox[AVXBINS + i1], b2 = binbox[2 * AVXBINS + i2]; + const __m128 frmin = _mm_and_ps( frag4[fid].bmin4, mask3 ), frmax = _mm_and_ps( frag4[fid].bmax4, mask3 ); + r0 = _mm256_max_ps( b0, f ), r1 = _mm256_max_ps( b1, f ), r2 = _mm256_max_ps( b2, f ); + const __m128i b4 = _mm_cvtps_epi32( _mm_sub_ps( _mm_mul_ps( _mm_sub_ps( _mm_add_ps( frmax, frmin ), nmin4 ), rpd4 ), half4 ) ); + bc4 = _mm_max_epi32( _mm_min_epi32( b4, maxbin4 ), _mm_setzero_si128() ); // clamp needed after all + f = _mm256_xor_ps( _mm256_and_ps( frag8[fid], mask6 ), signFlip8 ); + count[i0]++, count[AVXBINS + i1]++, count[AVXBINS * 2 + i2]++; + binbox[i0] = r0, i0 = bc[0]; + binbox[AVXBINS + i1] = r1, i1 = bc[1]; + binbox[2 * AVXBINS + i2] = r2, i2 = bc[2]; + } + // final business for final fragment + const __m256 b0 = binbox[i0], b1 = binbox[AVXBINS + i1], b2 = binbox[2 * AVXBINS + i2]; + count[i0]++, count[AVXBINS + i1]++, count[AVXBINS * 2 + i2]++; + r0 = _mm256_max_ps( b0, f ), r1 = _mm256_max_ps( b1, f ), r2 = _mm256_max_ps( b2, f ); + binbox[i0] = r0, binbox[AVXBINS + i1] = r1, binbox[2 * AVXBINS + i2] = r2; +} + +void BuildAVXSubtree_( uint32_t n, uint32_t d, BVH* bvh ) { bvh->BuildAVXSubtree( n, d ); } +void BVH::BuildAVXSubtree( uint32_t nodeIdx, uint32_t depth ) +{ + // aligned data + constexpr uint32_t slices = 8; + ALIGNED( 64 ) __m256 slicebinbox[slices][3 * AVXBINS]; + ALIGNED( 64 ) uint32_t slicecount[slices][3 * AVXBINS]; + ALIGNED( 64 ) __m256 binboxOrig[3 * AVXBINS]; // 768 bytes + ALIGNED( 64 ) __m256 bestLBox, bestRBox; // 64 bytes + __m256* binbox = slicebinbox[0]; + uint32_t* count = slicecount[0]; + for (uint32_t i = 0; i < 3 * AVXBINS; i++) binboxOrig[i] = max8; // binbox initialization template + if (depth == 0) + { + // avoid threaded building for small meshes: not efficient; build multiple in parallel instead. + #ifdef NO_THREADED_BUILDS + threadedBuild = false; + #else + if (triCount < MT_BUILD_THRESHOLD) threadedBuild = false; else + { + atomicNewNodePtr = new std::atomic( newNodePtr ); + } + #endif + } + // subdivide recursively + ALIGNED( 64 ) uint32_t task[256], taskCount = 0; + BVHNode& root = bvhNode[0]; + const bvhvec3 minDim = (root.aabbMax - root.aabbMin) * 1e-7f; + while (1) + { + while (1) + { + BVHNode& node = bvhNode[nodeIdx]; + __m128* node4 = (__m128*) & bvhNode[nodeIdx]; + // find optimal object split + const __m128 d4 = _mm_blendv_ps( min1, _mm_sub_ps( node4[1], node4[0] ), mask3 ); + const __m128 nmin4 = _mm_mul_ps( _mm_and_ps( node4[0], mask3 ), two4 ); + const __m128 rpd4 = _mm_and_ps( _mm_div_ps( binmul3, d4 ), _mm_cmpneq_ps( d4, _mm_setzero_ps() ) ); + // implementation of Section 4.1 of "Parallel Spatial Splits in Bounding Volume Hierarchies": + // main loop operates on two fragments to minimize dependencies and maximize ILP. + if (0) // depth < 5 && threadedBuild && node.triCount > 10000) + { + // DISABLED for now until a good jobsystem arrives. + #if 0 + // run binning in parallel slices + const uint32_t sliceSize = node.triCount / slices; + for (int slice = 0; slice < (int)slices; slice++) + { + // calculate task start and end + const uint32_t first = node.leftFirst + sliceSize * slice; + const uint32_t last = slice == (slices - 1) ? (node.leftFirst + node.triCount) : (first + sliceSize); + __m256* sbb = slicebinbox[slice], * bo = binboxOrig; + uint32_t* sc = slicecount[slice]; + // BVH* thisBVH = this; // avoid warnings / complexities of capturing this + // binningJobs->Execute( [=]() { thisBVH->BuildAVXBinTask( first, last, sbb, bo, sc, nmin4, rpd4 ); } ); + } + // binningJobs->Wait(); + // combine results from threads + for (int a = 0; a < 3; a++) for (int i = 0; i < AVXBINS; i++) + for (int ai = a * AVXBINS + i, slice = 1; slice < (int)slices; slice++) count[ai] += slicecount[slice][ai], + binbox[ai] = _mm256_max_ps( binbox[ai], slicebinbox[slice][ai] ); + #endif + } + else + BuildAVXBinTask( node.leftFirst, node.leftFirst + node.triCount, binbox, binboxOrig, count, nmin4, rpd4 ); + // calculate per-split totals + float splitCost = BVH_FAR, rSAV = 1.0f / node.SurfaceArea(); + uint32_t bestAxis = 0, bestPos = 0; + const __m256* bb = binbox; + for (int32_t a = 0; a < 3; a++, bb += AVXBINS) if ((node.aabbMax[a] - node.aabbMin[a]) > minDim[a]) + { + // hardcoded bin processing for AVXBINS == 8 + assert( AVXBINS == 8 ); + const uint32_t* cnt = count + a * AVXBINS; + const uint32_t lN0 = cnt[0], rN0 = cnt[7]; + const __m256 lb0 = bb[0], rb0 = bb[7]; + const uint32_t lN1 = lN0 + cnt[1], rN1 = rN0 + cnt[6], lN2 = lN1 + cnt[2]; + const uint32_t rN2 = rN1 + cnt[5], lN3 = lN2 + cnt[3], rN3 = rN2 + cnt[4]; + const __m256 lb1 = _mm256_max_ps( lb0, bb[1] ), rb1 = _mm256_max_ps( rb0, bb[6] ); + const __m256 lb2 = _mm256_max_ps( lb1, bb[2] ), rb2 = _mm256_max_ps( rb1, bb[5] ); + const __m256 lb3 = _mm256_max_ps( lb2, bb[3] ), rb3 = _mm256_max_ps( rb2, bb[4] ); + const uint32_t lN4 = lN3 + cnt[4], rN4 = rN3 + cnt[3], lN5 = lN4 + cnt[5]; + const uint32_t rN5 = rN4 + cnt[2], lN6 = lN5 + cnt[6], rN6 = rN5 + cnt[1]; + const __m256 lb4 = _mm256_max_ps( lb3, bb[4] ), rb4 = _mm256_max_ps( rb3, bb[3] ); + const __m256 lb5 = _mm256_max_ps( lb4, bb[5] ), rb5 = _mm256_max_ps( rb4, bb[2] ); + const __m256 lb6 = _mm256_max_ps( lb5, bb[6] ), rb6 = _mm256_max_ps( rb5, bb[1] ); + float ANLR3 = BVH_FAR; PROCESS_PLANE( a, 3, ANLR3, lN3, rN3, lb3, rb3 ); // most likely split + float ANLR2 = BVH_FAR; PROCESS_PLANE( a, 2, ANLR2, lN2, rN4, lb2, rb4 ); + float ANLR4 = BVH_FAR; PROCESS_PLANE( a, 4, ANLR4, lN4, rN2, lb4, rb2 ); + float ANLR5 = BVH_FAR; PROCESS_PLANE( a, 5, ANLR5, lN5, rN1, lb5, rb1 ); + float ANLR1 = BVH_FAR; PROCESS_PLANE( a, 1, ANLR1, lN1, rN5, lb1, rb5 ); + float ANLR0 = BVH_FAR; PROCESS_PLANE( a, 0, ANLR0, lN0, rN6, lb0, rb6 ); + float ANLR6 = BVH_FAR; PROCESS_PLANE( a, 6, ANLR6, lN6, rN0, lb6, rb0 ); // least likely split + } + splitCost = c_trav + c_int * rSAV * splitCost; + float noSplitCost = (float)node.triCount * c_int; + if (splitCost >= noSplitCost) break; // not splitting is better. + // in-place partition + const float rpd = (*(bvhvec3*)&rpd4)[bestAxis], nmin = (*(bvhvec3*)&nmin4)[bestAxis]; + uint32_t i = node.leftFirst, j = node.leftFirst + node.triCount, t, fr = primIdx[i]; + for (uint32_t k = 0; k < node.triCount; k++) + { + const uint32_t bi = (uint32_t)((fragment[fr].bmax[bestAxis] + fragment[fr].bmin[bestAxis] - nmin) * rpd); + if (bi <= bestPos) fr = primIdx[++i]; else t = fr, fr = primIdx[i] = primIdx[--j], primIdx[j] = t; + } + // create child nodes and recurse + uint32_t n; + if (threadedBuild) n = atomicNewNodePtr->fetch_add( 2 ); else n = newNodePtr, newNodePtr += 2; + const uint32_t leftCount = i - node.leftFirst, rightCount = node.triCount - leftCount; + if (leftCount == 0 || rightCount == 0 || taskCount == BVH_NUM_ELEMS( task )) break; // should not happen. + *(__m256*)& bvhNode[n] = _mm256_xor_ps( bestLBox, signFlip8 ); + bvhNode[n].leftFirst = node.leftFirst, bvhNode[n].triCount = leftCount; + node.leftFirst = n, node.triCount = 0; + *(__m256*)& bvhNode[n + 1] = _mm256_xor_ps( bestRBox, signFlip8 ); + bvhNode[n + 1].leftFirst = i, bvhNode[n + 1].triCount = rightCount; + if (leftCount + rightCount > 2000 && depth < 5 && threadedBuild) + { + std::thread t1( &BuildAVXSubtree_, n, depth + 1, this ); + std::thread t2( &BuildAVXSubtree_, n + 1, depth + 1, this ); + t1.join(); + t2.join(); // TODO: join is only needed in the 'all done' section below. + break; + } + task[taskCount++] = n + 1, nodeIdx = n; + } + // fetch subdivision task from stack + if (taskCount == 0) break; else nodeIdx = task[--taskCount]; + } + // all done. + if (depth == 0) + { + // tree has been built. + aabbMin = bvhNode[0].aabbMin, aabbMax = bvhNode[0].aabbMax; + refittable = true; // not using spatial splits: can refit this BVH + may_have_holes = false; // there are no holes in the list of nodes. + if (threadedBuild) + { + newNodePtr = atomicNewNodePtr->load(); + delete atomicNewNodePtr; + atomicNewNodePtr = 0; + } + usedNodes = newNodePtr; + } +} + +#if defined _MSC_VER +#pragma warning ( pop ) // restore 4701 +#elif defined __GNUC__ && !defined __clang__ +#pragma GCC diagnostic pop // restore -Wmaybe-uninitialized +#endif + +// Intersect a BVH with a ray packet, basic SSE-optimized version. +// Note: This yields +10% on 10th gen Intel CPUs, but a small loss on +// more recent hardware. This function needs a full conversion to work +// with groups of 8 rays at a time - TODO. +void BVH::Intersect256RaysSSE( Ray* packet ) const +{ + // Corner rays are: 0, 51, 204 and 255 + // Construct the bounding planes, with normals pointing outwards + bvhvec3 O = packet[0].O; // same for all rays in this case + __m128 O4 = *(__m128*) & packet[0].O; + __m128 mask4 = _mm_cmpeq_ps( _mm_setzero_ps(), _mm_set_ps( 1, 0, 0, 0 ) ); + bvhvec3 p0 = packet[0].O + packet[0].D; // top-left + bvhvec3 p1 = packet[51].O + packet[51].D; // top-right + bvhvec3 p2 = packet[204].O + packet[204].D; // bottom-left + bvhvec3 p3 = packet[255].O + packet[255].D; // bottom-right + bvhvec3 plane0 = tinybvh_normalize( tinybvh_cross( p0 - O, p0 - p2 ) ); // left plane + bvhvec3 plane1 = tinybvh_normalize( tinybvh_cross( p3 - O, p3 - p1 ) ); // right plane + bvhvec3 plane2 = tinybvh_normalize( tinybvh_cross( p1 - O, p1 - p0 ) ); // top plane + bvhvec3 plane3 = tinybvh_normalize( tinybvh_cross( p2 - O, p2 - p3 ) ); // bottom plane + int32_t sign0x = plane0.x < 0 ? 4 : 0, sign0y = plane0.y < 0 ? 5 : 1, sign0z = plane0.z < 0 ? 6 : 2; + int32_t sign1x = plane1.x < 0 ? 4 : 0, sign1y = plane1.y < 0 ? 5 : 1, sign1z = plane1.z < 0 ? 6 : 2; + int32_t sign2x = plane2.x < 0 ? 4 : 0, sign2y = plane2.y < 0 ? 5 : 1, sign2z = plane2.z < 0 ? 6 : 2; + int32_t sign3x = plane3.x < 0 ? 4 : 0, sign3y = plane3.y < 0 ? 5 : 1, sign3z = plane3.z < 0 ? 6 : 2; + float t0 = tinybvh_dot( O, plane0 ), t1 = tinybvh_dot( O, plane1 ); + float t2 = tinybvh_dot( O, plane2 ), t3 = tinybvh_dot( O, plane3 ); + // Traverse the tree with the packet + int32_t first = 0, last = 255; // first and last active ray in the packet + BVHNode* node = &bvhNode[0]; + ALIGNED( 64 ) uint32_t stack[64], stackPtr = 0; + while (1) + { + if (node->isLeaf()) + { + // handle leaf node + for (uint32_t j = 0; j < node->triCount; j++) + { + const uint32_t idx = primIdx[node->leftFirst + j], vid = idx * 3; + const bvhvec3 e1 = verts[vid + 1] - verts[vid], e2 = verts[vid + 2] - verts[vid]; + const bvhvec3 s = O - bvhvec3( verts[vid] ); + for (int32_t i = first; i <= last; i++) + { + Ray& ray = packet[i]; + const bvhvec3 h = tinybvh_cross( ray.D, e2 ); + const float a = tinybvh_dot( e1, h ); + if (fabs( a ) < 0.0000001f) continue; // ray parallel to triangle + const float f = 1 / a, u = f * tinybvh_dot( s, h ); + const bvhvec3 q = tinybvh_cross( s, e1 ); + const float v = f * tinybvh_dot( ray.D, q ); + if (u < 0 || v < 0 || u + v > 1) continue; + const float t = f * tinybvh_dot( e2, q ); + if (t <= 0 || t >= ray.hit.t) continue; + ray.hit.t = t, ray.hit.u = u, ray.hit.v = v, ray.hit.prim = idx; + } + } + if (stackPtr == 0) break; else // pop + last = stack[--stackPtr], node = bvhNode + stack[--stackPtr], + first = last >> 8, last &= 255; + } + else + { + // fetch pointers to child nodes + BVHNode* left = bvhNode + node->leftFirst; + BVHNode* right = bvhNode + node->leftFirst + 1; + bool visitLeft = true, visitRight = true; + int32_t leftFirst = first, leftLast = last, rightFirst = first, rightLast = last; + float distLeft, distRight; + { + // see if we want to intersect the left child + const __m128 minO4 = _mm_sub_ps( *(__m128*) & left->aabbMin, O4 ); + const __m128 maxO4 = _mm_sub_ps( *(__m128*) & left->aabbMax, O4 ); + // 1. Early-in test: if first ray hits the node, the packet visits the node + bool earlyHit; + { + const __m128 rD4 = *(__m128*) & packet[first].rD; + const __m128 st1 = _mm_mul_ps( _mm_and_ps( minO4, mask4 ), rD4 ); + const __m128 st2 = _mm_mul_ps( _mm_and_ps( maxO4, mask4 ), rD4 ); + const __m128 vmax4 = _mm_max_ps( st1, st2 ), vmin4 = _mm_min_ps( st1, st2 ); + const float tmax = tinybvh_min( LANE( vmax4, 0 ), tinybvh_min( LANE( vmax4, 1 ), LANE( vmax4, 2 ) ) ); + const float tmin = tinybvh_max( LANE( vmin4, 0 ), tinybvh_max( LANE( vmin4, 1 ), LANE( vmin4, 2 ) ) ); + earlyHit = (tmax >= tmin && tmin < packet[first].hit.t && tmax >= 0); + distLeft = tmin; + } + // 2. Early-out test: if the node aabb is outside the four planes, we skip the node + if (!earlyHit) + { + float* minmax = (float*)left; + bvhvec3 c0( minmax[sign0x], minmax[sign0y], minmax[sign0z] ); + bvhvec3 c1( minmax[sign1x], minmax[sign1y], minmax[sign1z] ); + bvhvec3 c2( minmax[sign2x], minmax[sign2y], minmax[sign2z] ); + bvhvec3 c3( minmax[sign3x], minmax[sign3y], minmax[sign3z] ); + if (tinybvh_dot( c0, plane0 ) > t0 || tinybvh_dot( c1, plane1 ) > t1 || + tinybvh_dot( c2, plane2 ) > t2 || tinybvh_dot( c3, plane3 ) > t3) + visitLeft = false; + else + { + // 3. Last resort: update first and last, stay in node if first > last + for (; leftFirst <= leftLast; leftFirst++) + { + const __m128 rD4 = *(__m128*) & packet[leftFirst].rD; + const __m128 st1 = _mm_mul_ps( _mm_and_ps( minO4, mask4 ), rD4 ); + const __m128 st2 = _mm_mul_ps( _mm_and_ps( maxO4, mask4 ), rD4 ); + const __m128 vmax4 = _mm_max_ps( st1, st2 ), vmin4 = _mm_min_ps( st1, st2 ); + const float tmax = tinybvh_min( LANE( vmax4, 0 ), tinybvh_min( LANE( vmax4, 1 ), LANE( vmax4, 2 ) ) ); + const float tmin = tinybvh_max( LANE( vmin4, 0 ), tinybvh_max( LANE( vmin4, 1 ), LANE( vmin4, 2 ) ) ); + if (tmax >= tmin && tmin < packet[leftFirst].hit.t && tmax >= 0) { distLeft = tmin; break; } + } + for (; leftLast >= leftFirst; leftLast--) + { + const __m128 rD4 = *(__m128*) & packet[leftLast].rD; + const __m128 st1 = _mm_mul_ps( _mm_and_ps( minO4, mask4 ), rD4 ); + const __m128 st2 = _mm_mul_ps( _mm_and_ps( maxO4, mask4 ), rD4 ); + const __m128 vmax4 = _mm_max_ps( st1, st2 ), vmin4 = _mm_min_ps( st1, st2 ); + const float tmax = tinybvh_min( LANE( vmax4, 0 ), tinybvh_min( LANE( vmax4, 1 ), LANE( vmax4, 2 ) ) ); + const float tmin = tinybvh_max( LANE( vmin4, 0 ), tinybvh_max( LANE( vmin4, 1 ), LANE( vmin4, 2 ) ) ); + if (tmax >= tmin && tmin < packet[leftLast].hit.t && tmax >= 0) break; + } + visitLeft = leftLast >= leftFirst; + } + } + } + { + // see if we want to intersect the right child + const __m128 minO4 = _mm_sub_ps( *(__m128*) & right->aabbMin, O4 ); + const __m128 maxO4 = _mm_sub_ps( *(__m128*) & right->aabbMax, O4 ); + // 1. Early-in test: if first ray hits the node, the packet visits the node + bool earlyHit; + { + const __m128 rD4 = *(__m128*) & packet[first].rD; + const __m128 st1 = _mm_mul_ps( minO4, rD4 ), st2 = _mm_mul_ps( maxO4, rD4 ); + const __m128 vmax4 = _mm_max_ps( st1, st2 ), vmin4 = _mm_min_ps( st1, st2 ); + const float tmax = tinybvh_min( LANE( vmax4, 0 ), tinybvh_min( LANE( vmax4, 1 ), LANE( vmax4, 2 ) ) ); + const float tmin = tinybvh_max( LANE( vmin4, 0 ), tinybvh_max( LANE( vmin4, 1 ), LANE( vmin4, 2 ) ) ); + earlyHit = (tmax >= tmin && tmin < packet[first].hit.t && tmax >= 0); + distRight = tmin; + } + // 2. Early-out test: if the node aabb is outside the four planes, we skip the node + if (!earlyHit) + { + float* minmax = (float*)right; + bvhvec3 c0( minmax[sign0x], minmax[sign0y], minmax[sign0z] ); + bvhvec3 c1( minmax[sign1x], minmax[sign1y], minmax[sign1z] ); + bvhvec3 c2( minmax[sign2x], minmax[sign2y], minmax[sign2z] ); + bvhvec3 c3( minmax[sign3x], minmax[sign3y], minmax[sign3z] ); + if (tinybvh_dot( c0, plane0 ) > t0 || tinybvh_dot( c1, plane1 ) > t1 || + tinybvh_dot( c2, plane2 ) > t2 || tinybvh_dot( c3, plane3 ) > t3) + visitRight = false; + else + { + // 3. Last resort: update first and last, stay in node if first > last + for (; rightFirst <= rightLast; rightFirst++) + { + const __m128 rD4 = *(__m128*) & packet[rightFirst].rD; + const __m128 st1 = _mm_mul_ps( _mm_and_ps( minO4, mask4 ), rD4 ); + const __m128 st2 = _mm_mul_ps( _mm_and_ps( maxO4, mask4 ), rD4 ); + const __m128 vmax4 = _mm_max_ps( st1, st2 ), vmin4 = _mm_min_ps( st1, st2 ); + const float tmax1 = tinybvh_min( LANE( vmax4, 0 ), tinybvh_min( LANE( vmax4, 1 ), LANE( vmax4, 2 ) ) ); + const float tmin1 = tinybvh_max( LANE( vmin4, 0 ), tinybvh_max( LANE( vmin4, 1 ), LANE( vmin4, 2 ) ) ); + if (tmax1 >= tmin1 && tmin1 < packet[rightFirst].hit.t && tmax1 >= 0) { distRight = tmin1; break; } + } + for (; rightLast >= first; rightLast--) + { + const __m128 rD4 = *(__m128*) & packet[rightLast].rD; + const __m128 st1 = _mm_mul_ps( _mm_and_ps( minO4, mask4 ), rD4 ); + const __m128 st2 = _mm_mul_ps( _mm_and_ps( maxO4, mask4 ), rD4 ); + const __m128 vmax4 = _mm_max_ps( st1, st2 ), vmin4 = _mm_min_ps( st1, st2 ); + const float tmax1 = tinybvh_min( LANE( vmax4, 0 ), tinybvh_min( LANE( vmax4, 1 ), LANE( vmax4, 2 ) ) ); + const float tmin1 = tinybvh_max( LANE( vmin4, 0 ), tinybvh_max( LANE( vmin4, 1 ), LANE( vmin4, 2 ) ) ); + if (tmax1 >= tmin1 && tmin1 < packet[rightLast].hit.t && tmax1 >= 0) break; + } + visitRight = rightLast >= rightFirst; + } + } + } + // process intersection result + if (visitLeft && visitRight) + { + if (distLeft < distRight) + { + // push right, continue with left + stack[stackPtr++] = node->leftFirst + 1; + stack[stackPtr++] = (rightFirst << 8) + rightLast; + node = left, first = leftFirst, last = leftLast; + } + else + { + // push left, continue with right + stack[stackPtr++] = node->leftFirst; + stack[stackPtr++] = (leftFirst << 8) + leftLast; + node = right, first = rightFirst, last = rightLast; + } + } + else if (visitLeft) // continue with left + node = left, first = leftFirst, last = leftLast; + else if (visitRight) // continue with right + node = right, first = rightFirst, last = rightLast; + else if (stackPtr == 0) break; else // pop + last = stack[--stackPtr], node = bvhNode + stack[--stackPtr], + first = last >> 8, last &= 255; + } + } +} + +// Traverse the 'structure of arrays' BVH layout. +int32_t BVH_SoA::Intersect( Ray& ray ) const +{ + VALIDATE_RAY( ray ); + BVHNode* node = &bvhNode[0], * stack[64]; + const bvhvec4slice& verts = bvh.verts; + const uint32_t* primIdx = bvh.primIdx; + uint32_t stackPtr = 0; + float cost = 0; + const __m128 Ox4 = _mm_set1_ps( ray.O.x ), rDx4 = _mm_set1_ps( ray.rD.x ); + const __m128 Oy4 = _mm_set1_ps( ray.O.y ), rDy4 = _mm_set1_ps( ray.rD.y ); + const __m128 Oz4 = _mm_set1_ps( ray.O.z ), rDz4 = _mm_set1_ps( ray.rD.z ); + while (1) + { + cost += c_trav; + if (node->isLeaf()) + { + if (indexedEnabled && bvh.vertIdx != 0) for (uint32_t i = 0; i < node->triCount; i++, cost += c_int) + { + const uint32_t pi = primIdx[node->firstTri + i]; + const uint32_t i0 = bvh.vertIdx[pi * 3], i1 = bvh.vertIdx[pi * 3 + 1], i2 = bvh.vertIdx[pi * 3 + 2]; + IntersectTri( ray, pi, verts, i0, i1, i2 ); + } + else for (uint32_t i = 0; i < node->triCount; i++, cost += c_int) + { + const uint32_t pi = primIdx[node->firstTri + i]; + IntersectTri( ray, pi, verts, pi * 3, pi * 3 + 1, pi * 3 + 2 ); + } + if (stackPtr == 0) break; else node = stack[--stackPtr]; + continue; + } + __m128 x4 = _mm_mul_ps( _mm_sub_ps( node->xxxx, Ox4 ), rDx4 ); + __m128 y4 = _mm_mul_ps( _mm_sub_ps( node->yyyy, Oy4 ), rDy4 ); + __m128 z4 = _mm_mul_ps( _mm_sub_ps( node->zzzz, Oz4 ), rDz4 ); + // transpose + __m128 t0 = _mm_unpacklo_ps( x4, y4 ), t2 = _mm_unpacklo_ps( z4, z4 ); + __m128 t1 = _mm_unpackhi_ps( x4, y4 ), t3 = _mm_unpackhi_ps( z4, z4 ); + const __m128 xyzw1a = _mm_shuffle_ps( t0, t2, _MM_SHUFFLE( 1, 0, 1, 0 ) ); + const __m128 xyzw2a = _mm_shuffle_ps( t0, t2, _MM_SHUFFLE( 3, 2, 3, 2 ) ); + const __m128 xyzw1b = _mm_shuffle_ps( t1, t3, _MM_SHUFFLE( 1, 0, 1, 0 ) ); + const __m128 xyzw2b = _mm_shuffle_ps( t1, t3, _MM_SHUFFLE( 3, 2, 3, 2 ) ); + // process + const __m128 tmina4 = _mm_min_ps( xyzw1a, xyzw2a ), tmaxa4 = _mm_max_ps( xyzw1a, xyzw2a ); + const __m128 tminb4 = _mm_min_ps( xyzw1b, xyzw2b ), tmaxb4 = _mm_max_ps( xyzw1b, xyzw2b ); + // transpose back + t0 = _mm_unpacklo_ps( tmina4, tmaxa4 ), t2 = _mm_unpacklo_ps( tminb4, tmaxb4 ); + t1 = _mm_unpackhi_ps( tmina4, tmaxa4 ), t3 = _mm_unpackhi_ps( tminb4, tmaxb4 ); + x4 = _mm_shuffle_ps( t0, t2, _MM_SHUFFLE( 1, 0, 1, 0 ) ); + y4 = _mm_shuffle_ps( t0, t2, _MM_SHUFFLE( 3, 2, 3, 2 ) ); + z4 = _mm_shuffle_ps( t1, t3, _MM_SHUFFLE( 1, 0, 1, 0 ) ); + uint32_t lidx = node->left, ridx = node->right; + const __m128 min4 = _mm_max_ps( _mm_max_ps( _mm_max_ps( x4, y4 ), z4 ), _mm_setzero_ps() ); + const __m128 max4 = _mm_min_ps( _mm_min_ps( _mm_min_ps( x4, y4 ), z4 ), _mm_set1_ps( ray.hit.t ) ); + const float tmina_0 = LANE( min4, 0 ), tmaxa_1 = LANE( max4, 1 ); + const float tminb_2 = LANE( min4, 2 ), tmaxb_3 = LANE( max4, 3 ); + float dist1 = tmaxa_1 >= tmina_0 ? tmina_0 : BVH_FAR; + float dist2 = tmaxb_3 >= tminb_2 ? tminb_2 : BVH_FAR; + if (dist1 > dist2) + { + const float t = dist1; dist1 = dist2; dist2 = t; + const uint32_t i = lidx; lidx = ridx; ridx = i; + } + if (dist1 == BVH_FAR) + { + if (stackPtr == 0) break; else node = stack[--stackPtr]; + } + else + { + node = bvhNode + lidx; + if (dist2 != BVH_FAR) stack[stackPtr++] = bvhNode + ridx; + } + } + return (int32_t)cost; +} + +// Find occlusions in the second alternative BVH layout (ALT_SOA). +bool BVH_SoA::IsOccluded( const Ray& ray ) const +{ + BVHNode* node = &bvhNode[0], * stack[64]; + const bvhvec4slice& verts = bvh.verts; + const uint32_t* primIdx = bvh.primIdx; + uint32_t stackPtr = 0; + const __m128 Ox4 = _mm_set1_ps( ray.O.x ), rDx4 = _mm_set1_ps( ray.rD.x ); + const __m128 Oy4 = _mm_set1_ps( ray.O.y ), rDy4 = _mm_set1_ps( ray.rD.y ); + const __m128 Oz4 = _mm_set1_ps( ray.O.z ), rDz4 = _mm_set1_ps( ray.rD.z ); + while (1) + { + if (node->isLeaf()) + { + if (indexedEnabled && bvh.vertIdx != 0) for (uint32_t i = 0; i < node->triCount; i++) + { + const uint32_t pi = primIdx[node->firstTri + i], vi0 = pi * 3; + const uint32_t i0 = bvh.vertIdx[vi0], i1 = bvh.vertIdx[vi0 + 1], i2 = bvh.vertIdx[vi0 + 2]; + if (TriOccludes( ray, verts, pi, i0, i1, i2 )) return true; + } + else for (uint32_t i = 0; i < node->triCount; i++) + { + const uint32_t pi = primIdx[node->firstTri + i], vi0 = pi * 3; + if (TriOccludes( ray, verts, pi, vi0, vi0 + 1, vi0 + 2 )) return true; + } + if (stackPtr == 0) break; else node = stack[--stackPtr]; + continue; + } + __m128 x4 = _mm_mul_ps( _mm_sub_ps( node->xxxx, Ox4 ), rDx4 ); + __m128 y4 = _mm_mul_ps( _mm_sub_ps( node->yyyy, Oy4 ), rDy4 ); + __m128 z4 = _mm_mul_ps( _mm_sub_ps( node->zzzz, Oz4 ), rDz4 ); + // transpose + __m128 t0 = _mm_unpacklo_ps( x4, y4 ), t2 = _mm_unpacklo_ps( z4, z4 ); + __m128 t1 = _mm_unpackhi_ps( x4, y4 ), t3 = _mm_unpackhi_ps( z4, z4 ); + __m128 xyzw1a = _mm_shuffle_ps( t0, t2, _MM_SHUFFLE( 1, 0, 1, 0 ) ); + __m128 xyzw2a = _mm_shuffle_ps( t0, t2, _MM_SHUFFLE( 3, 2, 3, 2 ) ); + __m128 xyzw1b = _mm_shuffle_ps( t1, t3, _MM_SHUFFLE( 1, 0, 1, 0 ) ); + __m128 xyzw2b = _mm_shuffle_ps( t1, t3, _MM_SHUFFLE( 3, 2, 3, 2 ) ); + // process + __m128 tmina4 = _mm_min_ps( xyzw1a, xyzw2a ), tmaxa4 = _mm_max_ps( xyzw1a, xyzw2a ); + __m128 tminb4 = _mm_min_ps( xyzw1b, xyzw2b ), tmaxb4 = _mm_max_ps( xyzw1b, xyzw2b ); + // transpose back + t0 = _mm_unpacklo_ps( tmina4, tmaxa4 ), t2 = _mm_unpacklo_ps( tminb4, tmaxb4 ); + t1 = _mm_unpackhi_ps( tmina4, tmaxa4 ), t3 = _mm_unpackhi_ps( tminb4, tmaxb4 ); + x4 = _mm_shuffle_ps( t0, t2, _MM_SHUFFLE( 1, 0, 1, 0 ) ); + y4 = _mm_shuffle_ps( t0, t2, _MM_SHUFFLE( 3, 2, 3, 2 ) ); + z4 = _mm_shuffle_ps( t1, t3, _MM_SHUFFLE( 1, 0, 1, 0 ) ); + uint32_t lidx = node->left, ridx = node->right; + const __m128 min4 = _mm_max_ps( _mm_max_ps( _mm_max_ps( x4, y4 ), z4 ), _mm_setzero_ps() ); + const __m128 max4 = _mm_min_ps( _mm_min_ps( _mm_min_ps( x4, y4 ), z4 ), _mm_set1_ps( ray.hit.t ) ); + const float tmina_0 = LANE( min4, 0 ), tmaxa_1 = LANE( max4, 1 ); + const float tminb_2 = LANE( min4, 2 ), tmaxb_3 = LANE( max4, 3 ); + float dist1 = tmaxa_1 >= tmina_0 ? tmina_0 : BVH_FAR; + float dist2 = tmaxb_3 >= tminb_2 ? tminb_2 : BVH_FAR; + if (dist1 > dist2) + { + float t = dist1; dist1 = dist2; dist2 = t; + uint32_t i = lidx; lidx = ridx; ridx = i; + } + if (dist1 == BVH_FAR) + { + if (stackPtr == 0) break; else node = stack[--stackPtr]; + } + else + { + node = bvhNode + lidx; + if (dist2 != BVH_FAR) stack[stackPtr++] = bvhNode + ridx; + } + } + return false; +} + +// Intersect_CWBVH: +// Intersect a compressed 8-wide BVH with a ray. For debugging only, not efficient. +// Not technically limited to BVH_USEAVX, but __lzcnt and __popcnt will require +// exotic compiler flags (in combination with __builtin_ia32_lzcnt_u32), so... Since +// this is just here to test data before it goes to the GPU: MSVC-only for now. +#define STACK_POP() { ngroup = traversalStack[--stackPtr]; } +#define STACK_PUSH() { traversalStack[stackPtr++] = ngroup; } +inline uint32_t extract_byte( const uint32_t i, const uint32_t n ) { return (i >> (n * 8)) & 0xFF; } +inline uint32_t sign_extend_s8x4( const uint32_t i ) +{ + // asm("prmt.b32 %0, %1, 0x0, 0x0000BA98;" : "=r"(v) : "r"(i)); // BA98: 1011`1010`1001`1000 + // with the given parameters, prmt will extend the sign to all bits in a byte. + uint32_t b0 = (i & 0b10000000000000000000000000000000) ? 0xff000000 : 0; + uint32_t b1 = (i & 0b00000000100000000000000000000000) ? 0x00ff0000 : 0; + uint32_t b2 = (i & 0b00000000000000001000000000000000) ? 0x0000ff00 : 0; + uint32_t b3 = (i & 0b00000000000000000000000010000000) ? 0x000000ff : 0; + return b0 + b1 + b2 + b3; // probably can do better than this. +} +int32_t BVH8_CWBVH::Intersect( Ray& ray ) const +{ + bvhuint2 traversalStack[128]; + uint32_t hitAddr = 0, stackPtr = 0; + bvhvec2 triangleuv( 0, 0 ); + const bvhvec4* blasNodes = bvh8Data, * blasTris = bvh8Tris; + float tmin = 0, tmax = ray.hit.t; + const uint32_t octinv = (7 - ((ray.D.x < 0 ? 4 : 0) | (ray.D.y < 0 ? 2 : 0) | (ray.D.z < 0 ? 1 : 0))) * 0x1010101; + bvhuint2 ngroup = bvhuint2( 0, 0b10000000000000000000000000000000 ), tgroup = bvhuint2( 0 ); + do + { + if (ngroup.y > 0x00FFFFFF) + { + const uint32_t hits = ngroup.y, imask = ngroup.y; + const uint32_t child_bit_index = __bfind( hits ), child_node_base_index = ngroup.x; + ngroup.y &= ~(1 << child_bit_index); + if (ngroup.y > 0x00FFFFFF) { STACK_PUSH( /* nodeGroup */ ); } + { + const uint32_t slot_index = (child_bit_index - 24) ^ (octinv & 255); + const uint32_t relative_index = __popc( imask & ~(0xFFFFFFFF << slot_index) ); + const uint32_t child_node_index = child_node_base_index + relative_index; + const bvhvec4 n0 = blasNodes[child_node_index * 5 + 0], n1 = blasNodes[child_node_index * 5 + 1]; + const bvhvec4 n2 = blasNodes[child_node_index * 5 + 2], n3 = blasNodes[child_node_index * 5 + 3]; + const bvhvec4 n4 = blasNodes[child_node_index * 5 + 4], p = n0; + bvhint3 e; + e.x = (int32_t) * ((int8_t*)&n0.w + 0), e.y = (int32_t) * ((int8_t*)&n0.w + 1), e.z = (int32_t) * ((int8_t*)&n0.w + 2); + ngroup.x = as_uint( n1.x ), tgroup.x = as_uint( n1.y ), tgroup.y = 0; + uint32_t hitmask = 0; + const uint32_t vx = (e.x + 127) << 23u; const float adjusted_idirx = *(float*)&vx * ray.rD.x; + const uint32_t vy = (e.y + 127) << 23u; const float adjusted_idiry = *(float*)&vy * ray.rD.y; + const uint32_t vz = (e.z + 127) << 23u; const float adjusted_idirz = *(float*)&vz * ray.rD.z; + const float origx = -(ray.O.x - p.x) * ray.rD.x; + const float origy = -(ray.O.y - p.y) * ray.rD.y; + const float origz = -(ray.O.z - p.z) * ray.rD.z; + { // First 4 + const uint32_t meta4 = *(uint32_t*)&n1.z, is_inner4 = (meta4 & (meta4 << 1)) & 0x10101010; + const uint32_t inner_mask4 = sign_extend_s8x4( is_inner4 << 3 ); + const uint32_t bit_index4 = (meta4 ^ (octinv & inner_mask4)) & 0x1F1F1F1F; + const uint32_t child_bits4 = (meta4 >> 5) & 0x07070707; + uint32_t swizzledLox = (ray.rD.x < 0) ? *(uint32_t*)&n3.z : *(uint32_t*)&n2.x, swizzledHix = (ray.rD.x < 0) ? *(uint32_t*)&n2.x : *(uint32_t*)&n3.z; + uint32_t swizzledLoy = (ray.rD.y < 0) ? *(uint32_t*)&n4.x : *(uint32_t*)&n2.z, swizzledHiy = (ray.rD.y < 0) ? *(uint32_t*)&n2.z : *(uint32_t*)&n4.x; + uint32_t swizzledLoz = (ray.rD.z < 0) ? *(uint32_t*)&n4.z : *(uint32_t*)&n3.x, swizzledHiz = (ray.rD.z < 0) ? *(uint32_t*)&n3.x : *(uint32_t*)&n4.z; + float tminx[4], tminy[4], tminz[4], tmaxx[4], tmaxy[4], tmaxz[4]; + tminx[0] = ((swizzledLox >> 0) & 0xFF) * adjusted_idirx + origx, tminx[1] = ((swizzledLox >> 8) & 0xFF) * adjusted_idirx + origx, tminx[2] = ((swizzledLox >> 16) & 0xFF) * adjusted_idirx + origx; + tminx[3] = ((swizzledLox >> 24) & 0xFF) * adjusted_idirx + origx, tminy[0] = ((swizzledLoy >> 0) & 0xFF) * adjusted_idiry + origy, tminy[1] = ((swizzledLoy >> 8) & 0xFF) * adjusted_idiry + origy; + tminy[2] = ((swizzledLoy >> 16) & 0xFF) * adjusted_idiry + origy, tminy[3] = ((swizzledLoy >> 24) & 0xFF) * adjusted_idiry + origy, tminz[0] = ((swizzledLoz >> 0) & 0xFF) * adjusted_idirz + origz; + tminz[1] = ((swizzledLoz >> 8) & 0xFF) * adjusted_idirz + origz, tminz[2] = ((swizzledLoz >> 16) & 0xFF) * adjusted_idirz + origz, tminz[3] = ((swizzledLoz >> 24) & 0xFF) * adjusted_idirz + origz; + tmaxx[0] = ((swizzledHix >> 0) & 0xFF) * adjusted_idirx + origx, tmaxx[1] = ((swizzledHix >> 8) & 0xFF) * adjusted_idirx + origx, tmaxx[2] = ((swizzledHix >> 16) & 0xFF) * adjusted_idirx + origx; + tmaxx[3] = ((swizzledHix >> 24) & 0xFF) * adjusted_idirx + origx, tmaxy[0] = ((swizzledHiy >> 0) & 0xFF) * adjusted_idiry + origy, tmaxy[1] = ((swizzledHiy >> 8) & 0xFF) * adjusted_idiry + origy; + tmaxy[2] = ((swizzledHiy >> 16) & 0xFF) * adjusted_idiry + origy, tmaxy[3] = ((swizzledHiy >> 24) & 0xFF) * adjusted_idiry + origy, tmaxz[0] = ((swizzledHiz >> 0) & 0xFF) * adjusted_idirz + origz; + tmaxz[1] = ((swizzledHiz >> 8) & 0xFF) * adjusted_idirz + origz, tmaxz[2] = ((swizzledHiz >> 16) & 0xFF) * adjusted_idirz + origz, tmaxz[3] = ((swizzledHiz >> 24) & 0xFF) * adjusted_idirz + origz; + for (int32_t i = 0; i < 4; i++) + { + // Use VMIN, VMAX to compute the slabs + const float cmin = tinybvh_max( tinybvh_max( tinybvh_max( tminx[i], tminy[i] ), tminz[i] ), tmin ); + const float cmax = tinybvh_min( tinybvh_min( tinybvh_min( tmaxx[i], tmaxy[i] ), tmaxz[i] ), tmax ); + if (cmin <= cmax) hitmask |= extract_byte( child_bits4, i ) << extract_byte( bit_index4, i ); + } + } + { // Second 4 + const uint32_t meta4 = *(uint32_t*)&n1.w, is_inner4 = (meta4 & (meta4 << 1)) & 0x10101010; + const uint32_t inner_mask4 = sign_extend_s8x4( is_inner4 << 3 ); + const uint32_t bit_index4 = (meta4 ^ (octinv & inner_mask4)) & 0x1F1F1F1F; + const uint32_t child_bits4 = (meta4 >> 5) & 0x07070707; + uint32_t swizzledLox = (ray.rD.x < 0) ? *(uint32_t*)&n3.w : *(uint32_t*)&n2.y, swizzledHix = (ray.rD.x < 0) ? *(uint32_t*)&n2.y : *(uint32_t*)&n3.w; + uint32_t swizzledLoy = (ray.rD.y < 0) ? *(uint32_t*)&n4.y : *(uint32_t*)&n2.w, swizzledHiy = (ray.rD.y < 0) ? *(uint32_t*)&n2.w : *(uint32_t*)&n4.y; + uint32_t swizzledLoz = (ray.rD.z < 0) ? *(uint32_t*)&n4.w : *(uint32_t*)&n3.y, swizzledHiz = (ray.rD.z < 0) ? *(uint32_t*)&n3.y : *(uint32_t*)&n4.w; + float tminx[4], tminy[4], tminz[4], tmaxx[4], tmaxy[4], tmaxz[4]; + tminx[0] = ((swizzledLox >> 0) & 0xFF) * adjusted_idirx + origx, tminx[1] = ((swizzledLox >> 8) & 0xFF) * adjusted_idirx + origx, tminx[2] = ((swizzledLox >> 16) & 0xFF) * adjusted_idirx + origx; + tminx[3] = ((swizzledLox >> 24) & 0xFF) * adjusted_idirx + origx, tminy[0] = ((swizzledLoy >> 0) & 0xFF) * adjusted_idiry + origy, tminy[1] = ((swizzledLoy >> 8) & 0xFF) * adjusted_idiry + origy; + tminy[2] = ((swizzledLoy >> 16) & 0xFF) * adjusted_idiry + origy, tminy[3] = ((swizzledLoy >> 24) & 0xFF) * adjusted_idiry + origy, tminz[0] = ((swizzledLoz >> 0) & 0xFF) * adjusted_idirz + origz; + tminz[1] = ((swizzledLoz >> 8) & 0xFF) * adjusted_idirz + origz, tminz[2] = ((swizzledLoz >> 16) & 0xFF) * adjusted_idirz + origz, tminz[3] = ((swizzledLoz >> 24) & 0xFF) * adjusted_idirz + origz; + tmaxx[0] = ((swizzledHix >> 0) & 0xFF) * adjusted_idirx + origx, tmaxx[1] = ((swizzledHix >> 8) & 0xFF) * adjusted_idirx + origx, tmaxx[2] = ((swizzledHix >> 16) & 0xFF) * adjusted_idirx + origx; + tmaxx[3] = ((swizzledHix >> 24) & 0xFF) * adjusted_idirx + origx, tmaxy[0] = ((swizzledHiy >> 0) & 0xFF) * adjusted_idiry + origy, tmaxy[1] = ((swizzledHiy >> 8) & 0xFF) * adjusted_idiry + origy; + tmaxy[2] = ((swizzledHiy >> 16) & 0xFF) * adjusted_idiry + origy, tmaxy[3] = ((swizzledHiy >> 24) & 0xFF) * adjusted_idiry + origy, tmaxz[0] = ((swizzledHiz >> 0) & 0xFF) * adjusted_idirz + origz; + tmaxz[1] = ((swizzledHiz >> 8) & 0xFF) * adjusted_idirz + origz, tmaxz[2] = ((swizzledHiz >> 16) & 0xFF) * adjusted_idirz + origz, tmaxz[3] = ((swizzledHiz >> 24) & 0xFF) * adjusted_idirz + origz; + for (int32_t i = 0; i < 4; i++) + { + const float cmin = tinybvh_max( tinybvh_max( tinybvh_max( tminx[i], tminy[i] ), tminz[i] ), tmin ); + const float cmax = tinybvh_min( tinybvh_min( tinybvh_min( tmaxx[i], tmaxy[i] ), tmaxz[i] ), tmax ); + if (cmin <= cmax) hitmask |= extract_byte( child_bits4, i ) << extract_byte( bit_index4, i ); + } + } + ngroup.y = (hitmask & 0xFF000000) | (as_uint( n0.w ) >> 24), tgroup.y = hitmask & 0x00FFFFFF; + } + } + else tgroup = ngroup, ngroup = bvhuint2( 0 ); + while (tgroup.y != 0) + { + uint32_t triangleIndex = __bfind( tgroup.y ); + tgroup.y -= 1 << triangleIndex; + int32_t triAddr = tgroup.x + triangleIndex * 3; + const bvhvec3 e2 = bvhvec3( blasTris[triAddr + 0] ), e1 = bvhvec3( blasTris[triAddr + 1] ); + const bvhvec3 v0 = blasTris[triAddr + 2]; + MOLLER_TRUMBORE_TEST( tmax, continue ); + triangleuv = bvhvec2( u, v ), tmax = t; + hitAddr = as_uint( blasTris[triAddr + 2].w ); + } + if (ngroup.y > 0x00FFFFFF) continue; + if (stackPtr > 0) { STACK_POP( /* nodeGroup */ ); } + else + { + ray.hit.t = tmax; + if (tmax < BVH_FAR) ray.hit.u = triangleuv.x, ray.hit.v = triangleuv.y, ray.hit.prim = hitAddr; + break; + } + } while (true); + return 0; +} + +#ifdef BVH_USEAVX2 + +#define TO256(x) _mm256_cvtepu8_epi32( _mm_cvtsi64_si128( x ) ) +ALIGNED( 64 ) static const __m256i idxLUT256[256] = { + TO256( 506097522914230528 ), TO256( 1976943448883713 ), TO256( 1976943448883712 ), TO256( 7722435347202 ), TO256( 1976943448883456 ), TO256( 7722435347201 ), TO256( + 7722435347200 ), TO256( 30165763075 ), TO256( 1976943448817920 ), TO256( 7722435346945 ), TO256( 7722435346944 ), TO256( 30165763074 ), TO256( 7722435346688 ), TO256( + 30165763073 ), TO256( 30165763072 ), TO256( 117835012 ), TO256( 1976943432040704 ), TO256( 7722435281409 ), TO256( 7722435281408 ), TO256( 30165762818 ), TO256( + 7722435281152 ), TO256( 30165762817 ), TO256( 30165762816 ), TO256( 117835011 ), TO256( 7722435215616 ), TO256( 30165762561 ), TO256( 30165762560 ), TO256( 117835010 ), TO256( + 30165762304 ), TO256( 117835009 ), TO256( 117835008 ), TO256( 460293 ), TO256( 1976939137073408 ), TO256( 7722418504193 ), TO256( 7722418504192 ), TO256( 30165697282 ), TO256( + 7722418503936 ), TO256( 30165697281 ), TO256( 30165697280 ), TO256( 117834755 ), TO256( 7722418438400 ), TO256( 30165697025 ), TO256( 30165697024 ), TO256( 117834754 ), TO256( + 30165696768 ), TO256( 117834753 ), TO256( 117834752 ), TO256( 460292 ), TO256( 7722401661184 ), TO256( 30165631489 ), TO256( 30165631488 ), TO256( 117834498 ), TO256( 30165631232 ), TO256( + 117834497 ), TO256( 117834496 ), TO256( 460291 ), TO256( 30165565696 ), TO256( 117834241 ), TO256( 117834240 ), TO256( 460290 ), TO256( 117833984 ), TO256( 460289 ), TO256( 460288 ), TO256( 1798 ), TO256( + 1975839625445632 ), TO256( 7718123536897 ), TO256( 7718123536896 ), TO256( 30148920066 ), TO256( 7718123536640 ), TO256( 30148920065 ), TO256( 30148920064 ), TO256( + 117769219 ), TO256( 7718123471104 ), TO256( 30148919809 ), TO256( 30148919808 ), TO256( 117769218 ), TO256( 30148919552 ), TO256( 117769217 ), TO256( 117769216 ), TO256( 460036 ), TO256( + 7718106693888 ), TO256( 30148854273 ), TO256( 30148854272 ), TO256( 117768962 ), TO256( 30148854016 ), TO256( 117768961 ), TO256( 117768960 ), TO256( 460035 ), TO256( 30148788480 ), TO256( + 117768705 ), TO256( 117768704 ), TO256( 460034 ), TO256( 117768448 ), TO256( 460033 ), TO256( 460032 ), TO256( 1797 ), TO256( 7713811726592 ), TO256( 30132077057 ), TO256( 30132077056 ), TO256( + 117703426 ), TO256( 30132076800 ), TO256( 117703425 ), TO256( 117703424 ), TO256( 459779 ), TO256( 30132011264 ), TO256( 117703169 ), TO256( 117703168 ), TO256( 459778 ), TO256( 117702912 ), TO256( + 459777 ), TO256( 459776 ), TO256( 1796 ), TO256( 30115234048 ), TO256( 117637633 ), TO256( 117637632 ), TO256( 459522 ), TO256( 117637376 ), TO256( 459521 ), TO256( 459520 ), TO256( 1795 ), TO256( 117571840 ), TO256( + 459265 ), TO256( 459264 ), TO256( 1794 ), TO256( 459008 ), TO256( 1793 ), TO256( 1792 ), TO256( 7 ), TO256( 1694364648734976 ), TO256( 6618611909121 ), TO256( 6618611909120 ), TO256( 25853952770 ), TO256( + 6618611908864 ), TO256( 25853952769 ), TO256( 25853952768 ), TO256( 100992003 ), TO256( 6618611843328 ), TO256( 25853952513 ), TO256( 25853952512 ), TO256( 100992002 ), TO256( + 25853952256 ), TO256( 100992001 ), TO256( 100992000 ), TO256( 394500 ), TO256( 6618595066112 ), TO256( 25853886977 ), TO256( 25853886976 ), TO256( 100991746 ), TO256( 25853886720 ), TO256( + 100991745 ), TO256( 100991744 ), TO256( 394499 ), TO256( 25853821184 ), TO256( 100991489 ), TO256( 100991488 ), TO256( 394498 ), TO256( 100991232 ), TO256( 394497 ), TO256( 394496 ), TO256( 1541 ), TO256( + 6614300098816 ), TO256( 25837109761 ), TO256( 25837109760 ), TO256( 100926210 ), TO256( 25837109504 ), TO256( 100926209 ), TO256( 100926208 ), TO256( 394243 ), TO256( 25837043968 ), TO256( + 100925953 ), TO256( 100925952 ), TO256( 394242 ), TO256( 100925696 ), TO256( 394241 ), TO256( 394240 ), TO256( 1540 ), TO256( 25820266752 ), TO256( 100860417 ), TO256( 100860416 ), TO256( 393986 ), TO256( + 100860160 ), TO256( 393985 ), TO256( 393984 ), TO256( 1539 ), TO256( 100794624 ), TO256( 393729 ), TO256( 393728 ), TO256( 1538 ), TO256( 393472 ), TO256( 1537 ), TO256( 1536 ), TO256( 6 ), TO256( 5514788471040 ), TO256( + 21542142465 ), TO256( 21542142464 ), TO256( 84148994 ), TO256( 21542142208 ), TO256( 84148993 ), TO256( 84148992 ), TO256( 328707 ), TO256( 21542076672 ), TO256( 84148737 ), TO256( + 84148736 ), TO256( 328706 ), TO256( 84148480 ), TO256( 328705 ), TO256( 328704 ), TO256( 1284 ), TO256( 21525299456 ), TO256( 84083201 ), TO256( 84083200 ), TO256( 328450 ), TO256( 84082944 ), TO256( 328449 ), TO256( + 328448 ), TO256( 1283 ), TO256( 84017408 ), TO256( 328193 ), TO256( 328192 ), TO256( 1282 ), TO256( 327936 ), TO256( 1281 ), TO256( 1280 ), TO256( 5 ), TO256( 17230332160 ), TO256( 67305985 ), TO256( 67305984 ), TO256( 262914 ), TO256( + 67305728 ), TO256( 262913 ), TO256( 262912 ), TO256( 1027 ), TO256( 67240192 ), TO256( 262657 ), TO256( 262656 ), TO256( 1026 ), TO256( 262400 ), TO256( 1025 ), TO256( 1024 ), TO256( 4 ), TO256( 50462976 ), TO256( 197121 ), TO256( + 197120 ), TO256( 770 ), TO256( 196864 ), TO256( 769 ), TO256( 768 ), TO256( 3 ), TO256( 131328 ), TO256( 513 ), TO256( 512 ), TO256( 2 ), TO256( 256 ), TO256( 1 ), TO256( 0 ), TO256( 0 ) +}; + +int32_t BVH8_CPU::Intersect( Ray& ray ) const +{ + VALIDATE_RAY( ray ); + const bool posX = ray.D.x >= 0, posY = ray.D.y >= 0, posZ = ray.D.z >= 0; + if (!posX) goto negx; + if (posY) { if (posZ) return Intersect( ray ); else return Intersect( ray ); } + if (posZ) return Intersect( ray ); else return Intersect( ray ); +negx: + if (posY) { if (posZ) return Intersect( ray ); else return Intersect( ray ); } + if (posZ) return Intersect( ray ); else return Intersect( ray ); +} + +float min8( const __m256 x ) +{ + const __m128 hiQuad = _mm256_extractf128_ps( x, 1 ), loQuad = _mm256_castps256_ps128( x ); + const __m128 minQuad = _mm_min_ps( loQuad, hiQuad ), loDual = minQuad; + const __m128 hiDual = _mm_movehl_ps( minQuad, minQuad ), minDual = _mm_min_ps( loDual, hiDual ); + const __m128 lo = minDual, hi = _mm_shuffle_ps( minDual, minDual, 1 ); + const __m128 res = _mm_min_ss( lo, hi ); + return _mm_cvtss_f32( res ); +} + +template int32_t BVH8_CPU::Intersect( Ray& ray ) const +{ + ALIGNED( 64 ) int32_t nodeStack[256]; + ALIGNED( 64 ) float distStack[256]; + const __m256 zero8 = _mm256_setzero_ps(); + __m256 t8 = _mm256_set1_ps( ray.hit.t ); + ALIGNED( 64 ) int32_t stackPtr = 0, nodeIdx = 0; + union ALIGNED( 32 ) { __m256i c8s; uint32_t cs[8]; }; + constexpr int signShift = (posX ? 3 : 0) + (posY ? 6 : 0) + (posZ ? 12 : 0); + const __m256 rx8 = _mm256_set1_ps( ray.O.x * ray.rD.x ), rdx8 = _mm256_set1_ps( ray.rD.x ); + const __m256 ry8 = _mm256_set1_ps( ray.O.y * ray.rD.y ), rdy8 = _mm256_set1_ps( ray.rD.y ); + const __m256 rz8 = _mm256_set1_ps( ray.O.z * ray.rD.z ), rdz8 = _mm256_set1_ps( ray.rD.z ); + const __m128 ox4 = _mm_set1_ps( ray.O.x ), oy4 = _mm_set1_ps( ray.O.y ), oz4 = _mm_set1_ps( ray.O.z ); + const __m128 dx4 = _mm_set1_ps( ray.D.x ), dy4 = _mm_set1_ps( ray.D.y ), dz4 = _mm_set1_ps( ray.D.z ); + const __m128 one4 = _mm_set1_ps( 1 ), inf4 = _mm_set1_ps( 1e34f ); +#ifdef _DEBUG + // sorry, not even this can be tolerated in this function. Only in debug. + uint32_t steps = 0; +#endif + while (1) + { + #ifdef _DEBUG + steps++; + #endif + while (!(nodeIdx & LEAF_BIT)) + { + const BVHNode* n = (BVHNode*)(bvh8Data + nodeIdx); + const __m256 tx1 = _mm256_fmsub_ps( posX ? n->xmin8 : n->xmax8, rdx8, rx8 ); + const __m256 ty1 = _mm256_fmsub_ps( posY ? n->ymin8 : n->ymax8, rdy8, ry8 ); + const __m256 tz1 = _mm256_fmsub_ps( posZ ? n->zmin8 : n->zmax8, rdz8, rz8 ); + const __m256 tx2 = _mm256_fmsub_ps( posX ? n->xmax8 : n->xmin8, rdx8, rx8 ); + const __m256 ty2 = _mm256_fmsub_ps( posY ? n->ymax8 : n->ymin8, rdy8, ry8 ); + const __m256 tz2 = _mm256_fmsub_ps( posZ ? n->zmax8 : n->zmin8, rdz8, rz8 ); + __m256 tmin = _mm256_max_ps( _mm256_max_ps( _mm256_max_ps( zero8, tx1 ), ty1 ), tz1 ); + __m256 tmax = _mm256_min_ps( _mm256_min_ps( _mm256_min_ps( tx2, t8 ), ty2 ), tz2 ); + const __m256 mask8 = _mm256_cmp_ps( tmin, tmax, _CMP_LE_OQ ); + const uint32_t mask = _mm256_movemask_ps( mask8 ); + const uint32_t validNodes = __popc( mask ); + if (validNodes == 1) + { + const uint32_t lane = __bfind( mask ); + nodeIdx = ((uint32_t*)&n->child8)[lane]; + } + else if (validNodes > 0) + { + const __m256i index = _mm256_srli_epi32( n->perm8, signShift ); + const uint32_t m = _mm256_movemask_ps( _mm256_permutevar8x32_ps( mask8, index ) ); + tmin = _mm256_permutevar8x32_ps( tmin, index ); + const __m256i cpi = idxLUT256[255 - m]; + const __m256i c8 = _mm256_permutevar8x32_epi32( n->child8, index ); + const __m256 dist8 = _mm256_permutevar8x32_ps( tmin, cpi ); + const __m256i child8 = _mm256_permutevar8x32_epi32( c8, cpi ); + _mm256_storeu_si256( (__m256i*)(nodeStack + stackPtr), child8 ); + _mm256_storeu_ps( (float*)(distStack + stackPtr), dist8 ); + stackPtr += validNodes - 1; + nodeIdx = nodeStack[stackPtr]; + } + else + { + if (!stackPtr) goto the_end; + nodeIdx = nodeStack[--stackPtr]; + } + } + // Moeller-Trumbore ray/triangle intersection algorithm for four triangles + uint32_t n; + memcpy( &n, &nodeIdx, 4 ); + const BVHTri4Leaf* leaf = (BVHTri4Leaf*)(bvh8Data + (n & 0x1fffffff)); + const __m128 hx4 = _mm_fmsub_ps( dy4, leaf->e2z4, _mm_mul_ps( dz4, leaf->e2y4 ) ); + const __m128 hy4 = _mm_fmsub_ps( dz4, leaf->e2x4, _mm_mul_ps( dx4, leaf->e2z4 ) ); + const __m128 hz4 = _mm_fmsub_ps( dx4, leaf->e2y4, _mm_mul_ps( dy4, leaf->e2x4 ) ); + const __m128 sx4 = _mm_sub_ps( ox4, leaf->v0x4 ), sy4 = _mm_sub_ps( oy4, leaf->v0y4 ); + const __m128 sz4 = _mm_sub_ps( oz4, leaf->v0z4 ); + const __m128 det4 = _mm_fmadd_ps( leaf->e1z4, hz4, _mm_fmadd_ps( leaf->e1x4, hx4, _mm_mul_ps( leaf->e1y4, hy4 ) ) ); + const __m128 qz4 = _mm_fmsub_ps( sx4, leaf->e1y4, _mm_mul_ps( sy4, leaf->e1x4 ) ); + const __m128 qx4 = _mm_fmsub_ps( sy4, leaf->e1z4, _mm_mul_ps( sz4, leaf->e1y4 ) ); + const __m128 qy4 = _mm_fmsub_ps( sz4, leaf->e1x4, _mm_mul_ps( sx4, leaf->e1z4 ) ); + const __m128 inv_det4 = fastrcp4( det4 ); + const __m128 u4 = _mm_mul_ps( _mm_fmadd_ps( sz4, hz4, _mm_fmadd_ps( sx4, hx4, _mm_mul_ps( sy4, hy4 ) ) ), inv_det4 ); + const __m128 v4 = _mm_mul_ps( _mm_fmadd_ps( dz4, qz4, _mm_fmadd_ps( dx4, qx4, _mm_mul_ps( dy4, qy4 ) ) ), inv_det4 ); + const __m128 ta4 = _mm_mul_ps( _mm_fmadd_ps( leaf->e2z4, qz4, _mm_fmadd_ps( leaf->e2x4, qx4, _mm_mul_ps( leaf->e2y4, qy4 ) ) ), inv_det4 ); + const __m128 mask1 = _mm_cmpge_ps( u4, _mm_setzero_ps() ), mask2 = _mm_cmpge_ps( v4, _mm_setzero_ps() ); + const __m128 mask3 = _mm_cmple_ps( _mm_add_ps( u4, v4 ), one4 ); + const __m128 mask4 = _mm_cmpgt_ps( ta4, _mm_setzero_ps() ); + const __m128 mask5 = _mm_cmplt_ps( ta4, _mm256_extractf128_ps( t8, 0 ) ); + __m128 combined = _mm_and_ps( _mm_and_ps( _mm_and_ps( mask1, mask2 ), _mm_and_ps( mask3, mask4 ) ), mask5 ); + uint32_t imask = _mm_movemask_ps( combined ); + // evaluate opacity map, if present (SSE version). + if (opmap) if (imask) + { + const __m128 fN4 = _mm_set1_ps( (float)opmapN ); + const __m128i row4 = _mm_cvttps_epi32( _mm_mul_ps( _mm_add_ps( u4, v4 ), fN4 ) ); + const __m128i dia4 = _mm_cvttps_epi32( _mm_mul_ps( _mm_sub_ps( one4, u4 ), fN4 ) ); + const __m128i v0 = _mm_mullo_epi32( row4, row4 ); + const __m128i v1 = _mm_cvttps_epi32( _mm_mul_ps( v4, fN4 ) ); + const __m128i v2 = _mm_sub_epi32( dia4, _mm_sub_epi32( _mm_set1_epi32( opmapN - 1 ), row4 ) ); + union { uint32_t idx[4]; __m128i idx4; }; + union { uint32_t omask[4]; __m128 omask4; }; + idx4 = _mm_add_epi32( _mm_add_epi32( v0, v1 ), v2 ); + // proceed with scalar code for gather operation - TODO: better approach? + omask[0] = omask[1] = omask[2] = omask[3] = 0; + for (int i = 0; i < 4; i++) if (imask & (1 << i)) + { + uint32_t* om = opmap + leaf->primIdx[i] * ((opmapN * opmapN + 31) >> 5); + if (om[idx[i] >> 5] & (1 << (idx[i] & 31))) omask[i] = 0xffffffff; + } + // combine + combined = _mm_and_ps( combined, omask4 ); + imask = _mm_movemask_ps( combined ); + } + if (imask) + { + // compute broadcasted horizontal minimum of dist4 + const __m128 dist4 = _mm_blendv_ps( inf4, ta4, combined ); + const __m128 a = _mm_min_ps( dist4, _mm_shuffle_ps( dist4, dist4, _MM_SHUFFLE( 2, 1, 0, 3 ) ) ); + const __m128 c = _mm_min_ps( a, _mm_shuffle_ps( a, a, _MM_SHUFFLE( 1, 0, 3, 2 ) ) ); + const uint32_t lane = __bfind( _mm_movemask_ps( _mm_cmpeq_ps( c, dist4 ) ) ); + // update hit record + const __m128 _d4 = dist4; + const float t = ((float*)&_d4)[lane]; + const __m128 _u4 = u4, _v4 = v4; + ray.hit.t = t, ray.hit.u = ((float*)&_u4)[lane], ray.hit.v = ((float*)&_v4)[lane]; + #if INST_IDX_BITS == 32 + ray.hit.prim = leaf->primIdx[lane], ray.hit.inst = ray.instIdx; + #else + ray.hit.prim = leaf->primIdx[lane] + ray.instIdx; + #endif + t8 = _mm256_set1_ps( t ); + // compress stack + uint32_t outStackPtr = 0; + for (int32_t i = 0; i < stackPtr; i += 8) + { + __m256i node8 = _mm256_load_si256( (__m256i*)(nodeStack + i) ); + __m256 dist8 = _mm256_load_ps( (float*)(distStack + i) ); + const uint32_t mask = _mm256_movemask_ps( _mm256_cmp_ps( dist8, t8, _CMP_LE_OQ ) ); + const __m256i cpi = idxLUT256[255 - mask]; + dist8 = _mm256_permutevar8x32_ps( dist8, cpi ), node8 = _mm256_permutevar8x32_epi32( node8, cpi ); + _mm256_storeu_ps( (float*)(distStack + outStackPtr), dist8 ); + _mm256_storeu_si256( (__m256i*)(nodeStack + outStackPtr), node8 ); + const int32_t numItems = tinybvh_min( 8, stackPtr - i ), validMask = (1 << numItems) - 1; + outStackPtr += __popc( mask & validMask ); + } + stackPtr = outStackPtr; + } + if (!stackPtr) break; + nodeIdx = nodeStack[--stackPtr]; + } +the_end: +#ifdef _DEBUG + return steps; +#else + return 0; +#endif +} + +bool BVH8_CPU::IsOccluded( const Ray& ray ) const +{ + VALIDATE_RAY( ray ); + const bool posX = ray.D.x >= 0, posY = ray.D.y >= 0, posZ = ray.D.z >= 0; + if (!posX) goto negx; + if (posY) { if (posZ) return IsOccluded( ray ); else return IsOccluded( ray ); } + if (posZ) return IsOccluded( ray ); else return IsOccluded( ray ); +negx: + if (posY) { if (posZ) return IsOccluded( ray ); else return IsOccluded( ray ); } + if (posZ) return IsOccluded( ray ); else return IsOccluded( ray ); +} + +template bool BVH8_CPU::IsOccluded( const Ray& ray ) const +{ + ALIGNED( 64 ) uint32_t nodeStack[256]; + ALIGNED( 64 ) int32_t stackPtr = 0, nodeIdx = 0; + const __m256 t8 = _mm256_set1_ps( ray.hit.t ); + const __m256 rx8 = _mm256_set1_ps( ray.O.x * ray.rD.x ), rdx8 = _mm256_set1_ps( ray.rD.x ); + const __m256 ry8 = _mm256_set1_ps( ray.O.y * ray.rD.y ), rdy8 = _mm256_set1_ps( ray.rD.y ); + const __m256 rz8 = _mm256_set1_ps( ray.O.z * ray.rD.z ), rdz8 = _mm256_set1_ps( ray.rD.z ); + const __m128 ox4 = _mm_set1_ps( ray.O.x ), oy4 = _mm_set1_ps( ray.O.y ), oz4 = _mm_set1_ps( ray.O.z ); + const __m128 dx4 = _mm_set1_ps( ray.D.x ), dy4 = _mm_set1_ps( ray.D.y ), dz4 = _mm_set1_ps( ray.D.z ); + const __m128 t4 = _mm_set1_ps( ray.hit.t ); + const __m128 one4 = _mm_set1_ps( 1.0f ), zero4 = _mm_setzero_ps(); + while (1) + { + while (!(nodeIdx & LEAF_BIT)) + { + const BVHNode* n = (BVHNode*)(bvh8Data + nodeIdx); + const __m256i c8 = n->child8; + const __m256 tx1 = _mm256_fmsub_ps( posX ? n->xmin8 : n->xmax8, rdx8, rx8 ); + const __m256 ty1 = _mm256_fmsub_ps( posY ? n->ymin8 : n->ymax8, rdy8, ry8 ); + const __m256 tz1 = _mm256_fmsub_ps( posZ ? n->zmin8 : n->zmax8, rdz8, rz8 ); + const __m256 tx2 = _mm256_fmsub_ps( posX ? n->xmax8 : n->xmin8, rdx8, rx8 ); + const __m256 ty2 = _mm256_fmsub_ps( posY ? n->ymax8 : n->ymin8, rdy8, ry8 ); + const __m256 tz2 = _mm256_fmsub_ps( posZ ? n->zmax8 : n->zmin8, rdz8, rz8 ); + const __m256 tmin = _mm256_max_ps( _mm256_max_ps( _mm256_max_ps( _mm256_setzero_ps(), tx1 ), ty1 ), tz1 ); + const __m256 tmax = _mm256_min_ps( _mm256_min_ps( _mm256_min_ps( tx2, t8 ), ty2 ), tz2 ); + const __m256 mask8 = _mm256_cmp_ps( tmin, tmax, _CMP_LE_OQ ); + const uint32_t mask = _mm256_movemask_ps( mask8 ); // _mm256_or_ps( _mm256_castsi256_ps( c8 ), mask8 ) ); + const uint32_t validNodes = __popc( mask ); + if (validNodes == 1) + { + const uint32_t lane = __bfind( mask ); + nodeIdx = ((uint32_t*)&n->child8)[lane]; + } + else if (validNodes > 0) + { + const __m256i cpi = idxLUT256[255 - mask]; + const __m256i child8 = _mm256_permutevar8x32_epi32( c8, cpi ); + _mm256_storeu_si256( (__m256i*)(nodeStack + stackPtr), child8 ); + stackPtr += validNodes - 1; + nodeIdx = nodeStack[stackPtr]; + } + else + { + if (!stackPtr) return false; + nodeIdx = nodeStack[--stackPtr]; + } + } + uint32_t n; + memcpy( &n, &nodeIdx, 4 ); + // Moeller-Trumbore ray/triangle intersection algorithm for four triangles + const BVHTri4Leaf* leaf = (BVHTri4Leaf*)(bvh8Data + (n & 0x1fffffff)); + const __m128 hx4 = _mm_fmsub_ps( dy4, leaf->e2z4, _mm_mul_ps( dz4, leaf->e2y4 ) ); + const __m128 hy4 = _mm_fmsub_ps( dz4, leaf->e2x4, _mm_mul_ps( dx4, leaf->e2z4 ) ); + const __m128 hz4 = _mm_fmsub_ps( dx4, leaf->e2y4, _mm_mul_ps( dy4, leaf->e2x4 ) ); + const __m128 sx4 = _mm_sub_ps( ox4, leaf->v0x4 ); + const __m128 sy4 = _mm_sub_ps( oy4, leaf->v0y4 ); + const __m128 sz4 = _mm_sub_ps( oz4, leaf->v0z4 ); + const __m128 det4 = _mm_fmadd_ps( leaf->e1z4, hz4, _mm_fmadd_ps( leaf->e1x4, hx4, _mm_mul_ps( leaf->e1y4, hy4 ) ) ); + const __m128 qz4 = _mm_fmsub_ps( sx4, leaf->e1y4, _mm_mul_ps( sy4, leaf->e1x4 ) ); + const __m128 qx4 = _mm_fmsub_ps( sy4, leaf->e1z4, _mm_mul_ps( sz4, leaf->e1y4 ) ); + const __m128 qy4 = _mm_fmsub_ps( sz4, leaf->e1x4, _mm_mul_ps( sx4, leaf->e1z4 ) ); + const __m128 inv_det4 = fastrcp4( det4 ); + const __m128 u4 = _mm_mul_ps( _mm_fmadd_ps( sz4, hz4, _mm_fmadd_ps( sx4, hx4, _mm_mul_ps( sy4, hy4 ) ) ), inv_det4 ); + const __m128 v4 = _mm_mul_ps( _mm_fmadd_ps( dz4, qz4, _mm_fmadd_ps( dx4, qx4, _mm_mul_ps( dy4, qy4 ) ) ), inv_det4 ); + const __m128 ta4 = _mm_mul_ps( _mm_fmadd_ps( leaf->e2z4, qz4, _mm_fmadd_ps( leaf->e2x4, qx4, _mm_mul_ps( leaf->e2y4, qy4 ) ) ), inv_det4 ); + const __m128 mask1 = _mm_cmpge_ps( u4, zero4 ); + const __m128 mask2 = _mm_cmpge_ps( v4, zero4 ); + const __m128 mask3 = _mm_cmple_ps( _mm_add_ps( u4, v4 ), one4 ); + const __m128 mask4 = _mm_cmplt_ps( ta4, t4 ); + const __m128 mask5 = _mm_cmpgt_ps( ta4, zero4 ); + __m128 combined = _mm_and_ps( _mm_and_ps( _mm_and_ps( mask1, mask2 ), _mm_and_ps( mask3, mask4 ) ), mask5 ); + if (_mm_movemask_ps( combined )) + { + if (!opmap) return true; + // evaluate opacity map, SSE version. + const __m128 fN4 = _mm_set1_ps( (float)opmapN ); + const __m128i row4 = _mm_cvttps_epi32( _mm_mul_ps( _mm_add_ps( u4, v4 ), fN4 ) ); + const __m128i dia4 = _mm_cvttps_epi32( _mm_mul_ps( _mm_sub_ps( one4, u4 ), fN4 ) ); + const __m128i v0 = _mm_mullo_epi32( row4, row4 ); + const __m128i v1 = _mm_cvttps_epi32( _mm_mul_ps( v4, fN4 ) ); + const __m128i v2 = _mm_sub_epi32( dia4, _mm_sub_epi32( _mm_set1_epi32( opmapN - 1 ), row4 ) ); + union { uint32_t idx[4]; __m128i idx4; }; + idx4 = _mm_add_epi32( _mm_add_epi32( v0, v1 ), v2 ); + // proceed with scalar code for gather operation - TODO: better approach? + const uint32_t imask = _mm_movemask_ps( combined ); + for (int i = 0; i < 4; i++) if (imask & (1 << i)) + { + uint32_t* om = opmap + leaf->primIdx[i] * ((opmapN * opmapN + 31) >> 5); + if (om[idx[i] >> 5] & (1 << (idx[i] & 31))) return true; + } + } + // continue + if (!stackPtr) return false; + nodeIdx = nodeStack[--stackPtr]; + } +} + +#endif // BVH_USEAVX2 + +#endif // BVH_USEAVX + +// ============================================================================ +// +// I M P L E M E N T A T I O N - A R M / N E O N C O D E +// +// ============================================================================ + +#ifdef BVH_USENEON + +#define ILANE(a,b) vgetq_lane_s32(a, b) + +inline float halfArea( const float32x4_t a /* a contains extent of aabb */ ) +{ + ALIGNED( 64 ) float v[4]; + vst1q_f32( v, a ); + return v[0] * v[1] + v[1] * v[2] + v[2] * v[3]; +} +inline float halfArea( const float32x4x2_t& a /* a contains aabb itself, with min.xyz negated */ ) +{ + ALIGNED( 64 ) float c[8]; + vst1q_f32( c, a.val[0] ); + vst1q_f32( c + 4, a.val[1] ); + + float ex = c[4] + c[0], ey = c[5] + c[1], ez = c[6] + c[2]; + return ex * ey + ey * ez + ez * ex; +} + +#define PROCESS_PLANE( a, pos, ANLR, lN, rN, lb, rb ) if (lN * rN != 0) { \ + ANLR = halfArea( lb ) * (float)lN + halfArea( rb ) * (float)rN; \ + const float C = c_trav + c_int * rSAV * ANLR; if (C < splitCost) \ + splitCost = C, bestAxis = a, bestPos = pos, bestLBox = lb, bestRBox = rb; } + +void BVH::BuildNEON( const bvhvec4* vertices, const uint32_t primCount ) +{ + // build the BVH with a continuous array of bvhvec4 vertices: + // in this case, the stride for the slice is 16 bytes. + BuildNEON( bvhvec4slice{ vertices, primCount * 3, sizeof( bvhvec4 ) } ); +} +void BVH::BuildNEON( const bvhvec4slice& vertices ) +{ + PrepareNEONBuild( vertices, 0, 0 ); + BuildNEON(); +} +void BVH::BuildNEON( const bvhvec4* vertices, const uint32_t* indices, const uint32_t primCount ) +{ + // build the BVH with an indexed array of bvhvec4 vertices. + BuildNEON( bvhvec4slice{ vertices, primCount * 3, sizeof( bvhvec4 ) }, indices, primCount ); +} +void BVH::BuildNEON( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t primCount ) +{ + PrepareNEONBuild( vertices, indices, primCount ); + BuildNEON(); +} +void BVH::PrepareNEONBuild( const bvhvec4slice& vertices, const uint32_t* indices, const uint32_t prims ) +{ + BVH_FATAL_ERROR_IF( vertices.count == 0, "BVH::PrepareNEONBuild( .. ), primCount == 0." ); + BVH_FATAL_ERROR_IF( vertices.stride & 15, "BVH::PrepareNEONBuild( .. ), stride must be multiple of 16." ); + // some constants + static const float32x4_t min4 = vdupq_n_f32( BVH_FAR ), max4 = vdupq_n_f32( -BVH_FAR ); + // reset node pool + uint32_t primCount = prims > 0 ? prims : vertices.count / 3; + const uint32_t spaceNeeded = primCount * 2; + if (allocatedNodes < spaceNeeded) + { + AlignedFree( bvhNode ); + AlignedFree( primIdx ); + AlignedFree( fragment ); + primIdx = (uint32_t*)AlignedAlloc( primCount * sizeof( uint32_t ) ); + bvhNode = (BVHNode*)AlignedAlloc( spaceNeeded * sizeof( BVHNode ) ); + allocatedNodes = spaceNeeded; + memset( &bvhNode[1], 0, 32 ); // avoid crash in refit. + fragment = (Fragment*)AlignedAlloc( primCount * sizeof( Fragment ) ); + } + else BVH_FATAL_ERROR_IF( !rebuildable, "BVH::BuildAVX( .. ), bvh not rebuildable." ); + verts = vertices; // note: we're not copying this data; don't delete. + vertIdx = (uint32_t*)indices; + triCount = idxCount = primCount; + newNodePtr = 2; + struct FragSSE { float32x4_t bmin4, bmax4; }; + FragSSE* frag4 = (FragSSE*)fragment; + const float32x4_t* verts4 = (float32x4_t*)verts.data; // that's why it must be 16-byte aligned. + // assign all triangles to the root node + BVHNode& root = bvhNode[0]; + root.leftFirst = 0, root.triCount = triCount; + // initialize fragments and update root bounds + float32x4_t rootMin = min4, rootMax = max4; + if (indices) + { + BVH_FATAL_ERROR_IF( vertices.count == 0, "BVH::PrepareAVXBuild( .. ), empty vertex slice." ); + BVH_FATAL_ERROR_IF( prims == 0, "BVH::PrepareAVXBuild( .. ), prims == 0." ); + // build the BVH over indexed triangles + for (uint32_t i = 0; i < triCount; i++) + { + const uint32_t i0 = indices[i * 3], i1 = indices[i * 3 + 1], i2 = indices[i * 3 + 2]; + const float32x4_t v0 = verts4[i0], v1 = verts4[i1], v2 = verts4[i2]; + const float32x4_t t1 = vminq_f32( vminq_f32( v0, v1 ), v2 ); + const float32x4_t t2 = vmaxq_f32( vmaxq_f32( v0, v1 ), v2 ); + frag4[i].bmin4 = t1, frag4[i].bmax4 = t2, rootMin = vminq_f32( rootMin, t1 ), rootMax = vmaxq_f32( rootMax, t2 ); + primIdx[i] = i; + } + } + else + { + BVH_FATAL_ERROR_IF( vertices.count == 0, "BVH::PrepareAVXBuild( .. ), empty vertex slice." ); + BVH_FATAL_ERROR_IF( prims != 0, "BVH::PrepareAVXBuild( .. ), indices == 0." ); + // build the BVH over a list of vertices: three per triangle + for (uint32_t i = 0; i < triCount; i++) + { + const float32x4_t v0 = verts4[i * 3], v1 = verts4[i * 3 + 1], v2 = verts4[i * 3 + 2]; + const float32x4_t t1 = vminq_f32( vminq_f32( v0, v1 ), v2 ); + const float32x4_t t2 = vmaxq_f32( vmaxq_f32( v0, v1 ), v2 ); + frag4[i].bmin4 = t1, frag4[i].bmax4 = t2, rootMin = vminq_f32( rootMin, t1 ), rootMax = vmaxq_f32( rootMax, t2 ); + primIdx[i] = i; + } + } + root.aabbMin = *(bvhvec3*)&rootMin, root.aabbMax = *(bvhvec3*)&rootMax; + bvh_over_indices = indices != nullptr; +} + +inline float32x4x2_t _mm256_set1_ps( float v ) +{ + float32x4_t v4 = vdupq_n_f32( v ); + return float32x4x2_t{ v4, v4 }; +} + +inline float32x4x2_t _mm256_and_ps( float32x4x2_t v0, float32x4x2_t v1 ) +{ + float32x4_t r0 = vreinterpretq_f32_s32( vandq_s32( vreinterpretq_s32_f32( v0.val[0] ), vreinterpretq_s32_f32( v1.val[0] ) ) ); + float32x4_t r1 = vreinterpretq_f32_s32( vandq_s32( vreinterpretq_s32_f32( v0.val[1] ), vreinterpretq_s32_f32( v1.val[1] ) ) ); + return float32x4x2_t{ r0, r1 }; +} + +inline float32x4x2_t _mm256_max_ps( float32x4x2_t v0, float32x4x2_t v1 ) +{ + float32x4_t r0 = vmaxq_f32( v0.val[0], v1.val[0] ); + float32x4_t r1 = vmaxq_f32( v0.val[1], v1.val[1] ); + return float32x4x2_t{ r0, r1 }; +} + +inline float32x4x2_t _mm256_xor_ps( float32x4x2_t v0, float32x4x2_t v1 ) +{ + float32x4_t r0 = vreinterpretq_f32_s32( veorq_s32( vreinterpretq_s32_f32( v0.val[0] ), vreinterpretq_s32_f32( v1.val[0] ) ) ); + float32x4_t r1 = vreinterpretq_f32_s32( veorq_s32( vreinterpretq_s32_f32( v0.val[1] ), vreinterpretq_s32_f32( v1.val[1] ) ) ); + return float32x4x2_t{ r0, r1 }; +} + +void BVH::BuildNEON() +{ +#if 1 + // NEON code needs an overhaul. + Build(); +#else + // aligned data + ALIGNED( 64 ) float32x4x2_t binbox[3 * AVXBINS]; // 768 bytes + ALIGNED( 64 ) float32x4x2_t binboxOrig[3 * AVXBINS]; // 768 bytes + ALIGNED( 64 ) uint32_t count[3][AVXBINS]{}; // 96 bytes + ALIGNED( 64 ) float32x4x2_t bestLBox, bestRBox; // 64 bytes + // some constants + static const float32x4_t half4 = vdupq_n_f32( 0.5f ); + static const float32x4_t two4 = vdupq_n_f32( 2.0f ), min1 = vdupq_n_f32( -1 ); + static const int32x4_t maxbin4 = vdupq_n_s32( 7 ); + static const float32x4_t mask3 = vreinterpretq_f32_u32( vceqq_s32( SIMD_SETRVECS( 0, 0, 0, 1 ), vdupq_n_s32( 0 ) ) ); + static const float32x4_t binmul3 = vdupq_n_f32( AVXBINS * 0.49999f ); + static const float32x4x2_t max8 = _mm256_set1_ps( -BVH_FAR ), mask6 = { mask3, mask3 }; + static const float32x4_t signFlip4 = SIMD_SETRVEC( -0.0f, -0.0f, -0.0f, 0.0f ); + static const float32x4x2_t signFlip8 = { signFlip4, vdupq_n_f32( 0 ) }; + for (uint32_t i = 0; i < 3 * AVXBINS; i++) binboxOrig[i] = max8; // binbox initialization template + struct FragSSE { float32x4_t bmin4, bmax4; }; + FragSSE* frag4 = (FragSSE*)fragment; + float32x4x2_t* frag8 = (float32x4x2_t*)fragment; + // subdivide recursively + ALIGNED( 64 ) uint32_t task[128], taskCount = 0, nodeIdx = 0; + BVHNode& root = bvhNode[0]; + const bvhvec3 minDim = (root.aabbMax - root.aabbMin) * 1e-7f; + while (1) + { + while (1) + { + BVHNode& node = bvhNode[nodeIdx]; + float32x4_t* node4 = (float32x4_t*)&bvhNode[nodeIdx]; + // find optimal object split + const float32x4_t d4 = vbslq_f32( vshrq_n_u32( vreinterpretq_u32_f32( mask3 ), 31 ), vsubq_f32( node4[1], node4[0] ), min1 ); + const float32x4_t nmin4 = vmulq_f32( vreinterpretq_f32_s32( vandq_s32( vreinterpretq_s32_f32( node4[0] ), vreinterpretq_s32_f32( mask3 ) ) ), two4 ); + const float32x4_t rpd4 = vreinterpretq_f32_s32( vandq_s32( vreinterpretq_s32_f32( vdivq_f32( binmul3, d4 ) ), vmvnq_s32( vreinterpretq_s32_u32( vceqq_f32( d4, vdupq_n_f32( 0 ) ) ) ) ) ); + // implementation of Section 4.1 of "Parallel Spatial Splits in Bounding Volume Hierarchies": + // main loop operates on two fragments to minimize dependencies and maximize ILP. + uint32_t fi = primIdx[node.leftFirst]; + memset( count, 0, sizeof( count ) ); + float32x4x2_t r0, r1, r2, f = _mm256_xor_ps( _mm256_and_ps( frag8[fi], mask6 ), signFlip8 ); + const float32x4_t fmin = vreinterpretq_f32_u32( vandq_u32( vreinterpretq_u32_f32( frag4[fi].bmin4 ), vreinterpretq_u32_f32( mask3 ) ) ); + const float32x4_t fmax = vreinterpretq_f32_u32( vandq_u32( vreinterpretq_u32_f32( frag4[fi].bmax4 ), vreinterpretq_u32_f32( mask3 ) ) ); + const int32x4_t bi4 = vcvtq_s32_f32( vrndnq_f32( vsubq_f32( vmulq_f32( vsubq_f32( vaddq_f32( frag4[fi].bmax4, frag4[fi].bmin4 ), nmin4 ), rpd4 ), half4 ) ) ); + const int32x4_t b4c = vmaxq_s32( vminq_s32( bi4, maxbin4 ), vdupq_n_s32( 0 ) ); // clamp needed after all + memcpy( binbox, binboxOrig, sizeof( binbox ) ); + uint32_t i0 = ILANE( b4c, 0 ), i1 = ILANE( b4c, 1 ), i2 = ILANE( b4c, 2 ), * ti = primIdx + node.leftFirst + 1; + for (uint32_t i = 0; i < node.triCount - 1; i++) + { + uint32_t fid = *ti++; + // #if defined __GNUC__ || _MSC_VER < 1920 + // if (fid > triCount) fid = triCount - 1; // never happens but g++ *and* vs2017 need this to not crash... + // #endif + const float32x4x2_t b0 = binbox[i0], b1 = binbox[AVXBINS + i1], b2 = binbox[2 * AVXBINS + i2]; + const float32x4_t frmin = vreinterpretq_f32_u32( vandq_u32( vreinterpretq_u32_f32( frag4[fid].bmin4 ), vreinterpretq_u32_f32( mask3 ) ) ); + const float32x4_t frmax = vreinterpretq_f32_u32( vandq_u32( vreinterpretq_u32_f32( frag4[fid].bmax4 ), vreinterpretq_u32_f32( mask3 ) ) ); + r0 = _mm256_max_ps( b0, f ), r1 = _mm256_max_ps( b1, f ), r2 = _mm256_max_ps( b2, f ); + const int32x4_t b4 = vcvtq_s32_f32( vrndnq_f32( (vsubq_f32( vmulq_f32( vsubq_f32( vaddq_f32( frmax, frmin ), nmin4 ), rpd4 ), half4 )) ) ); + const int32x4_t bc4 = vmaxq_s32( vminq_s32( b4, maxbin4 ), vdupq_n_s32( 0 ) ); // clamp needed after all + f = _mm256_xor_ps( _mm256_and_ps( frag8[fid], mask6 ), signFlip8 ), count[0][i0]++, count[1][i1]++, count[2][i2]++; + binbox[i0] = r0, i0 = ILANE( bc4, 0 ); + binbox[AVXBINS + i1] = r1, i1 = ILANE( bc4, 1 ); + binbox[2 * AVXBINS + i2] = r2, i2 = ILANE( bc4, 2 ); + } + // final business for final fragment + const float32x4x2_t b0 = binbox[i0], b1 = binbox[AVXBINS + i1], b2 = binbox[2 * AVXBINS + i2]; + count[0][i0]++, count[1][i1]++, count[2][i2]++; + r0 = _mm256_max_ps( b0, f ), r1 = _mm256_max_ps( b1, f ), r2 = _mm256_max_ps( b2, f ); + binbox[i0] = r0, binbox[AVXBINS + i1] = r1, binbox[2 * AVXBINS + i2] = r2; + // calculate per-split totals + float splitCost = BVH_FAR, rSAV = 1.0f / node.SurfaceArea(); + uint32_t bestAxis = 0, bestPos = 0, n = newNodePtr, j = node.leftFirst + node.triCount, src = node.leftFirst; + const float32x4x2_t* bb = binbox; + for (int32_t a = 0; a < 3; a++, bb += AVXBINS) if ((node.aabbMax[a] - node.aabbMin[a]) > minDim[a]) + { + // hardcoded bin processing for AVXBINS == 8 + assert( AVXBINS == 8 ); + const uint32_t lN0 = count[a][0], rN0 = count[a][7]; + const float32x4x2_t lb0 = bb[0], rb0 = bb[7]; + const uint32_t lN1 = lN0 + count[a][1], rN1 = rN0 + count[a][6], lN2 = lN1 + count[a][2]; + const uint32_t rN2 = rN1 + count[a][5], lN3 = lN2 + count[a][3], rN3 = rN2 + count[a][4]; + const float32x4x2_t lb1 = _mm256_max_ps( lb0, bb[1] ), rb1 = _mm256_max_ps( rb0, bb[6] ); + const float32x4x2_t lb2 = _mm256_max_ps( lb1, bb[2] ), rb2 = _mm256_max_ps( rb1, bb[5] ); + const float32x4x2_t lb3 = _mm256_max_ps( lb2, bb[3] ), rb3 = _mm256_max_ps( rb2, bb[4] ); + const uint32_t lN4 = lN3 + count[a][4], rN4 = rN3 + count[a][3], lN5 = lN4 + count[a][5]; + const uint32_t rN5 = rN4 + count[a][2], lN6 = lN5 + count[a][6], rN6 = rN5 + count[a][1]; + const float32x4x2_t lb4 = _mm256_max_ps( lb3, bb[4] ), rb4 = _mm256_max_ps( rb3, bb[3] ); + const float32x4x2_t lb5 = _mm256_max_ps( lb4, bb[5] ), rb5 = _mm256_max_ps( rb4, bb[2] ); + const float32x4x2_t lb6 = _mm256_max_ps( lb5, bb[6] ), rb6 = _mm256_max_ps( rb5, bb[1] ); + float ANLR3 = BVH_FAR; PROCESS_PLANE( a, 3, ANLR3, lN3, rN3, lb3, rb3 ); // most likely split + float ANLR2 = BVH_FAR; PROCESS_PLANE( a, 2, ANLR2, lN2, rN4, lb2, rb4 ); + float ANLR4 = BVH_FAR; PROCESS_PLANE( a, 4, ANLR4, lN4, rN2, lb4, rb2 ); + float ANLR5 = BVH_FAR; PROCESS_PLANE( a, 5, ANLR5, lN5, rN1, lb5, rb1 ); + float ANLR1 = BVH_FAR; PROCESS_PLANE( a, 1, ANLR1, lN1, rN5, lb1, rb5 ); + float ANLR0 = BVH_FAR; PROCESS_PLANE( a, 0, ANLR0, lN0, rN6, lb0, rb6 ); + float ANLR6 = BVH_FAR; PROCESS_PLANE( a, 6, ANLR6, lN6, rN0, lb6, rb0 ); // least likely split + } + float noSplitCost = (float)node.triCount * c_int; + if (splitCost >= noSplitCost) break; // not splitting is better. + // in-place partition + const float rpd = (*(bvhvec3*)&rpd4)[bestAxis], nmin = (*(bvhvec3*)&nmin4)[bestAxis]; + uint32_t t, fr = primIdx[src]; + for (uint32_t i = 0; i < node.triCount; i++) + { + const uint32_t bi = (uint32_t)((fragment[fr].bmax[bestAxis] + fragment[fr].bmin[bestAxis] - nmin) * rpd); + if (bi <= bestPos) fr = primIdx[++src]; else t = fr, fr = primIdx[src] = primIdx[--j], primIdx[j] = t; + } + // create child nodes and recurse + const uint32_t leftCount = src - node.leftFirst, rightCount = node.triCount - leftCount; + if (leftCount == 0 || rightCount == 0 || taskCount == BVH_NUM_ELEMS( task )) break; // should not happen. + *(float32x4x2_t*)&bvhNode[n] = _mm256_xor_ps( bestLBox, signFlip8 ); + bvhNode[n].leftFirst = node.leftFirst, bvhNode[n].triCount = leftCount; + node.leftFirst = n++, node.triCount = 0, newNodePtr += 2; + *(float32x4x2_t*)&bvhNode[n] = _mm256_xor_ps( bestRBox, signFlip8 ); + bvhNode[n].leftFirst = j, bvhNode[n].triCount = rightCount; + task[taskCount++] = n, nodeIdx = n - 1; + } + // fetch subdivision task from stack + if (taskCount == 0) break; else nodeIdx = task[--taskCount]; + } + // all done. + aabbMin = bvhNode[0].aabbMin, aabbMax = bvhNode[0].aabbMax; + refittable = true; // not using spatial splits: can refit this BVH + may_have_holes = false; // the AVX builder produces a continuous list of nodes + usedNodes = newNodePtr; +#endif +} + +// Traverse the second alternative BVH layout (ALT_SOA). +int32_t BVH_SoA::Intersect( Ray& ray ) const +{ + VALIDATE_RAY( ray ); + BVHNode* node = &bvhNode[0], * stack[64]; + const bvhvec4slice& verts = bvh.verts; + const uint32_t* primIdx = bvh.primIdx; + uint32_t stackPtr = 0; + float cost = 0; + const float32x4_t Ox4 = vdupq_n_f32( ray.O.x ), rDx4 = vdupq_n_f32( ray.rD.x ); + const float32x4_t Oy4 = vdupq_n_f32( ray.O.y ), rDy4 = vdupq_n_f32( ray.rD.y ); + const float32x4_t Oz4 = vdupq_n_f32( ray.O.z ), rDz4 = vdupq_n_f32( ray.rD.z ); + // const float32x4_t inf4 = vdupq_n_f32( BVH_FAR ); + while (1) + { + cost += c_trav; + if (node->isLeaf()) + { + for (uint32_t i = 0; i < node->triCount; i++, cost += c_int) + { + const uint32_t tidx = primIdx[node->firstTri + i], vertIdx = tidx * 3; + const bvhvec3 v0 = verts[vertIdx]; + const bvhvec3 e1 = bvhvec3( verts[vertIdx + 1] ) - v0; + const bvhvec3 e2 = bvhvec3( verts[vertIdx + 2] ) - v0; + MOLLER_TRUMBORE_TEST( ray.hit.t, continue ); + ray.hit.t = t, ray.hit.u = u, ray.hit.v = v, ray.hit.prim = tidx; + } + if (stackPtr == 0) break; else node = stack[--stackPtr]; + continue; + } + float32x4_t x4 = vmulq_f32( vsubq_f32( node->xxxx, Ox4 ), rDx4 ); + float32x4_t y4 = vmulq_f32( vsubq_f32( node->yyyy, Oy4 ), rDy4 ); + float32x4_t z4 = vmulq_f32( vsubq_f32( node->zzzz, Oz4 ), rDz4 ); + // transpose + float32x4_t t0 = vzip1q_f32( x4, y4 ), t2 = vzip1q_f32( z4, z4 ); + float32x4_t t1 = vzip2q_f32( x4, y4 ), t3 = vzip2q_f32( z4, z4 ); + float32x4_t xyzw1a = vcombine_f32( vget_low_f32( t0 ), vget_low_f32( t2 ) ); + float32x4_t xyzw2a = vcombine_f32( vget_high_f32( t0 ), vget_high_f32( t2 ) ); + float32x4_t xyzw1b = vcombine_f32( vget_low_f32( t1 ), vget_low_f32( t3 ) ); + float32x4_t xyzw2b = vcombine_f32( vget_high_f32( t1 ), vget_high_f32( t3 ) ); + // process + float32x4_t tmina4 = vminq_f32( xyzw1a, xyzw2a ), tmaxa4 = vmaxq_f32( xyzw1a, xyzw2a ); + float32x4_t tminb4 = vminq_f32( xyzw1b, xyzw2b ), tmaxb4 = vmaxq_f32( xyzw1b, xyzw2b ); + // transpose back + t0 = vzip1q_f32( tmina4, tmaxa4 ), t2 = vzip1q_f32( tminb4, tmaxb4 ); + t1 = vzip2q_f32( tmina4, tmaxa4 ), t3 = vzip2q_f32( tminb4, tmaxb4 ); + x4 = vcombine_f32( vget_low_f32( t0 ), vget_low_f32( t2 ) ); + y4 = vcombine_f32( vget_high_f32( t0 ), vget_high_f32( t2 ) ); + z4 = vcombine_f32( vget_low_f32( t1 ), vget_low_f32( t3 ) ); + uint32_t lidx = node->left, ridx = node->right; + const float32x4_t min4 = vmaxq_f32( vmaxq_f32( vmaxq_f32( x4, y4 ), z4 ), vdupq_n_f32( 0 ) ); + const float32x4_t max4 = vminq_f32( vminq_f32( vminq_f32( x4, y4 ), z4 ), vdupq_n_f32( ray.hit.t ) ); + const float tmina_0 = vgetq_lane_f32( min4, 0 ), tmaxa_1 = vgetq_lane_f32( max4, 1 ); + const float tminb_2 = vgetq_lane_f32( min4, 2 ), tmaxb_3 = vgetq_lane_f32( max4, 3 ); + float dist1 = tmaxa_1 >= tmina_0 ? tmina_0 : BVH_FAR; + float dist2 = tmaxb_3 >= tminb_2 ? tminb_2 : BVH_FAR; + if (dist1 > dist2) + { + float t = dist1; dist1 = dist2; dist2 = t; + uint32_t i = lidx; lidx = ridx; ridx = i; + } + if (dist1 == BVH_FAR) + { + if (stackPtr == 0) break; else node = stack[--stackPtr]; + } + else + { + node = bvhNode + lidx; + if (dist2 != BVH_FAR) stack[stackPtr++] = bvhNode + ridx; + } + } + return (int32_t)cost; +} + +bool BVH_SoA::IsOccluded( const Ray& ray ) const +{ + BVHNode* node = &bvhNode[0], * stack[64]; + const bvhvec4slice& verts = bvh.verts; + const uint32_t* primIdx = bvh.primIdx; + uint32_t stackPtr = 0; + const float32x4_t Ox4 = vdupq_n_f32( ray.O.x ), rDx4 = vdupq_n_f32( ray.rD.x ); + const float32x4_t Oy4 = vdupq_n_f32( ray.O.y ), rDy4 = vdupq_n_f32( ray.rD.y ); + const float32x4_t Oz4 = vdupq_n_f32( ray.O.z ), rDz4 = vdupq_n_f32( ray.rD.z ); + while (1) + { + if (node->isLeaf()) + { + for (uint32_t i = 0; i < node->triCount; i++) + { + const uint32_t tidx = primIdx[node->firstTri + i], vertIdx = tidx * 3; + const bvhvec3 v0 = verts[vertIdx]; + const bvhvec3 e1 = bvhvec3( verts[vertIdx + 1] ) - v0; + const bvhvec3 e2 = bvhvec3( verts[vertIdx + 2] ) - v0; + MOLLER_TRUMBORE_TEST( ray.hit.t, continue ); + return true; + } + if (stackPtr == 0) break; else node = stack[--stackPtr]; + continue; + } + float32x4_t x4 = vmulq_f32( vsubq_f32( node->xxxx, Ox4 ), rDx4 ); + float32x4_t y4 = vmulq_f32( vsubq_f32( node->yyyy, Oy4 ), rDy4 ); + float32x4_t z4 = vmulq_f32( vsubq_f32( node->zzzz, Oz4 ), rDz4 ); + // transpose + float32x4_t t0 = vzip1q_f32( x4, y4 ), t2 = vzip1q_f32( z4, z4 ); + float32x4_t t1 = vzip2q_f32( x4, y4 ), t3 = vzip2q_f32( z4, z4 ); + float32x4_t xyzw1a = vcombine_f32( vget_low_f32( t0 ), vget_low_f32( t2 ) ); + float32x4_t xyzw2a = vcombine_f32( vget_high_f32( t0 ), vget_high_f32( t2 ) ); + float32x4_t xyzw1b = vcombine_f32( vget_low_f32( t1 ), vget_low_f32( t3 ) ); + float32x4_t xyzw2b = vcombine_f32( vget_high_f32( t1 ), vget_high_f32( t3 ) ); + // process + float32x4_t tmina4 = vminq_f32( xyzw1a, xyzw2a ), tmaxa4 = vmaxq_f32( xyzw1a, xyzw2a ); + float32x4_t tminb4 = vminq_f32( xyzw1b, xyzw2b ), tmaxb4 = vmaxq_f32( xyzw1b, xyzw2b ); + // transpose back + t0 = vzip1q_f32( tmina4, tmaxa4 ), t2 = vzip1q_f32( tminb4, tmaxb4 ); + t1 = vzip2q_f32( tmina4, tmaxa4 ), t3 = vzip2q_f32( tminb4, tmaxb4 ); + x4 = vcombine_f32( vget_low_f32( t0 ), vget_low_f32( t2 ) ); + y4 = vcombine_f32( vget_high_f32( t0 ), vget_high_f32( t2 ) ); + z4 = vcombine_f32( vget_low_f32( t1 ), vget_low_f32( t3 ) ); + uint32_t lidx = node->left, ridx = node->right; + const float32x4_t min4 = vmaxq_f32( vmaxq_f32( vmaxq_f32( x4, y4 ), z4 ), vdupq_n_f32( 0 ) ); + const float32x4_t max4 = vminq_f32( vminq_f32( vminq_f32( x4, y4 ), z4 ), vdupq_n_f32( ray.hit.t ) ); + const float tmina_0 = vgetq_lane_f32( min4, 0 ), tmaxa_1 = vgetq_lane_f32( max4, 1 ); + const float tminb_2 = vgetq_lane_f32( min4, 2 ), tmaxb_3 = vgetq_lane_f32( max4, 3 ); + float dist1 = tmaxa_1 >= tmina_0 ? tmina_0 : BVH_FAR; + float dist2 = tmaxb_3 >= tminb_2 ? tminb_2 : BVH_FAR; + if (dist1 > dist2) + { + float t = dist1; dist1 = dist2; dist2 = t; + uint32_t i = lidx; lidx = ridx; ridx = i; + } + if (dist1 == BVH_FAR) + { + if (stackPtr == 0) break; else node = stack[--stackPtr]; + } + else + { + node = bvhNode + lidx; + if (dist2 != BVH_FAR) stack[stackPtr++] = bvhNode + ridx; + } + } + return false; +} + +#endif // BVH_USENEON + +// ============================================================================ +// +// D O U B L E P R E C I S I O N S U P P O R T +// +// ============================================================================ + +#ifdef DOUBLE_PRECISION_SUPPORT + +// Destructor +BVH_Double::~BVH_Double() +{ + AlignedFree( fragment ); + AlignedFree( bvhNode ); + AlignedFree( primIdx ); +} + +void BVH_Double::Build( void (*customGetAABB)(const uint64_t, bvhdbl3&, bvhdbl3&), const uint64_t primCount ) +{ + BVH_FATAL_ERROR_IF( primCount == 0, "BVH_Double::Build( void (*customGetAABB)( .. ), instCount ), instCount == 0." ); + triCount = idxCount = primCount; + const uint64_t spaceNeeded = primCount * 2; // upper limit + if (allocatedNodes < spaceNeeded) + { + AlignedFree( bvhNode ); + AlignedFree( primIdx ); + AlignedFree( fragment ); + bvhNode = (BVHNode*)AlignedAlloc( spaceNeeded * sizeof( BVHNode ) ); + allocatedNodes = spaceNeeded; + primIdx = (uint64_t*)AlignedAlloc( primCount * sizeof( uint64_t ) ); + fragment = (Fragment*)AlignedAlloc( primCount * sizeof( Fragment ) ); + } + // copy relevant data from instance array + BVHNode& root = bvhNode[0]; + root.leftFirst = 0, root.triCount = primCount, root.aabbMin = bvhvec3( BVH_FAR ), root.aabbMax = bvhvec3( -BVH_FAR ); + for (uint32_t i = 0; i < primCount; i++) + { + customGetAABB( i, fragment[i].bmin, fragment[i].bmax ); + root.aabbMin = tinybvh_min( root.aabbMin, fragment[i].bmin ), fragment[i].primIdx = i; + root.aabbMax = tinybvh_max( root.aabbMax, fragment[i].bmax ), primIdx[i] = i; + } + // start build + newNodePtr = 1; + Build(); +} + +void BVH_Double::Build( BLASInstanceEx* bvhs, const uint64_t instCount, BVH_Double** blasses, const uint64_t bCount ) +{ + BVH_FATAL_ERROR_IF( instCount == 0, "BVH_Double::Build( BLASInstanceEx*, instCount ), instCount == 0." ); + triCount = idxCount = instCount; + const uint64_t spaceNeeded = instCount * 2; // upper limit + if (allocatedNodes < spaceNeeded) + { + AlignedFree( bvhNode ); + AlignedFree( primIdx ); + AlignedFree( fragment ); + bvhNode = (BVHNode*)AlignedAlloc( spaceNeeded * sizeof( BVHNode ) ); + allocatedNodes = spaceNeeded; + primIdx = (uint64_t*)AlignedAlloc( instCount * sizeof( uint64_t ) ); + fragment = (Fragment*)AlignedAlloc( instCount * sizeof( Fragment ) ); + } + instList = (BLASInstanceEx*)bvhs; + blasList = blasses; + blasCount = bCount; + // copy relevant data from instance array + BVHNode& root = bvhNode[0]; + root.leftFirst = 0, root.triCount = instCount, root.aabbMin = bvhdbl3( BVH_DBL_FAR ), root.aabbMax = bvhdbl3( -BVH_DBL_FAR ); + for (uint64_t i = 0; i < instCount; i++) + { + if (blasList) // if a null pointer is passed, we'll assume the BLASInstances have been updated elsewhere. + { + uint64_t blasIdx = instList[i].blasIdx; + BVH_Double* blas = blasList[blasIdx]; + instList[i].Update( blas ); + } + fragment[i].bmin = instList[i].aabbMin, fragment[i].primIdx = i, fragment[i].bmax = instList[i].aabbMax; + root.aabbMin = tinybvh_min( root.aabbMin, instList[i].aabbMin ); + root.aabbMax = tinybvh_max( root.aabbMax, instList[i].aabbMax ), primIdx[i] = i; + } + // start build + newNodePtr = 1; + Build(); +} + +void BVH_Double::Build( const bvhdbl3* vertices, const uint64_t primCount ) +{ + PrepareBuild( vertices, primCount ); + Build(); +} + +void BVH_Double::PrepareBuild( const bvhdbl3* vertices, const uint64_t primCount ) +{ + BVH_FATAL_ERROR_IF( primCount == 0, "BVH_Double::PrepareBuild( .. ), primCount == 0." ); + const uint64_t spaceNeeded = primCount * 2; // upper limit + // allocate memory on first build + if (allocatedNodes < spaceNeeded) + { + AlignedFree( bvhNode ); + AlignedFree( primIdx ); + AlignedFree( fragment ); + bvhNode = (BVHNode*)AlignedAlloc( spaceNeeded * sizeof( BVHNode ) ); + allocatedNodes = spaceNeeded; + primIdx = (uint64_t*)AlignedAlloc( primCount * sizeof( uint64_t ) ); + fragment = (Fragment*)AlignedAlloc( primCount * sizeof( Fragment ) ); + } + verts = (bvhdbl3*)vertices; // note: we're not copying this data; don't delete. + idxCount = triCount = primCount; + // prepare fragments + BVHNode& root = bvhNode[0]; + root.leftFirst = 0, root.triCount = triCount, root.aabbMin = bvhdbl3( BVH_DBL_FAR ), root.aabbMax = bvhdbl3( -BVH_DBL_FAR ); + for (uint32_t i = 0; i < triCount; i++) + { + const bvhdbl3 v0 = verts[i * 3], v1 = verts[i * 3 + 1], v2 = verts[i * 3 + 2]; + fragment[i].bmin = tinybvh_min( tinybvh_min( v0, v1 ), v2 ); + fragment[i].bmax = tinybvh_max( tinybvh_max( v0, v1 ), v2 ); + root.aabbMin = tinybvh_min( root.aabbMin, fragment[i].bmin ); + root.aabbMax = tinybvh_max( root.aabbMax, fragment[i].bmax ), primIdx[i] = i; + } + // reset node pool + newNodePtr = 1; + // all set; actual build happens in BVH_Double::Build. +} + +void BuildDouble_( uint64_t nodeIdx, uint32_t depth, BVH_Double* bvh ) +{ + bvh->Build( nodeIdx, depth ); +} +void BVH_Double::Build( uint64_t nodeIdx, uint32_t depth ) +{ + // initialize atomic counter on first call + if (depth == 0) atomicNewNodePtr = new std::atomic( newNodePtr ); + // avoid threaded building for small meshes: not efficient; build multiple in parallel instead. +#ifdef NO_THREADED_BUILDS + depth = 999; +#else + if (triCount < MT_BUILD_THRESHOLD) depth = 999; +#endif + // subdivide root node recursively + BVHNode& root = bvhNode[0]; + uint64_t task[256], taskCount = 0; + bvhdbl3 minDim = (root.aabbMax - root.aabbMin) * 1e-20; + bvhdbl3 bestLMin( 0 ), bestLMax( 0 ), bestRMin( 0 ), bestRMax( 0 ); + while (1) + { + while (1) + { + BVHNode& node = bvhNode[nodeIdx]; + // find optimal object split + bvhdbl3 binMin[3][BVHBINS], binMax[3][BVHBINS]; + for (uint32_t a = 0; a < 3; a++) for (uint32_t i = 0; i < BVHBINS; i++) + binMin[a][i] = bvhdbl3( BVH_DBL_FAR ), binMax[a][i] = bvhdbl3( -BVH_DBL_FAR ); + uint32_t count[3][BVHBINS]; + memset( count, 0, BVHBINS * 3 * sizeof( uint32_t ) ); + const bvhdbl3 rpd3 = bvhdbl3( bvhdbl3( BVHBINS ) / (node.aabbMax - node.aabbMin) ), nmin3 = node.aabbMin; + for (uint32_t i = 0; i < node.triCount; i++) // process all tris for x,y and z at once + { + const uint64_t fi = primIdx[node.leftFirst + i]; + const bvhdbl3 fbi = ((fragment[fi].bmin + fragment[fi].bmax) * 0.5 - nmin3) * rpd3; + bvhint3 bi( (int32_t)fbi.x, (int32_t)fbi.y, (int32_t)fbi.z ); + bi.x = tinybvh_clamp( bi.x, 0, BVHBINS - 1 ); + bi.y = tinybvh_clamp( bi.y, 0, BVHBINS - 1 ); + bi.z = tinybvh_clamp( bi.z, 0, BVHBINS - 1 ); + binMin[0][bi.x] = tinybvh_min( binMin[0][bi.x], fragment[fi].bmin ); + binMax[0][bi.x] = tinybvh_max( binMax[0][bi.x], fragment[fi].bmax ), count[0][bi.x]++; + binMin[1][bi.y] = tinybvh_min( binMin[1][bi.y], fragment[fi].bmin ); + binMax[1][bi.y] = tinybvh_max( binMax[1][bi.y], fragment[fi].bmax ), count[1][bi.y]++; + binMin[2][bi.z] = tinybvh_min( binMin[2][bi.z], fragment[fi].bmin ); + binMax[2][bi.z] = tinybvh_max( binMax[2][bi.z], fragment[fi].bmax ), count[2][bi.z]++; + } + // calculate per-split totals + double splitCost = BVH_DBL_FAR, rSAV = 1.0 / node.SurfaceArea(); + uint32_t bestAxis = 0, bestPos = 0; + for (int32_t a = 0; a < 3; a++) if ((node.aabbMax[a] - node.aabbMin[a]) > minDim[a]) + { + bvhdbl3 lBMin[BVHBINS - 1], rBMin[BVHBINS - 1], l1( BVH_DBL_FAR ), l2( -BVH_DBL_FAR ); + bvhdbl3 lBMax[BVHBINS - 1], rBMax[BVHBINS - 1], r1( BVH_DBL_FAR ), r2( -BVH_DBL_FAR ); + double ANL[BVHBINS - 1], ANR[BVHBINS - 1]; + for (uint32_t lN = 0, rN = 0, i = 0; i < BVHBINS - 1; i++) + { + lBMin[i] = l1 = tinybvh_min( l1, binMin[a][i] ); + rBMin[BVHBINS - 2 - i] = r1 = tinybvh_min( r1, binMin[a][BVHBINS - 1 - i] ); + lBMax[i] = l2 = tinybvh_max( l2, binMax[a][i] ); + rBMax[BVHBINS - 2 - i] = r2 = tinybvh_max( r2, binMax[a][BVHBINS - 1 - i] ); + lN += count[a][i], rN += count[a][BVHBINS - 1 - i]; + ANL[i] = lN == 0 ? BVH_DBL_FAR : (tinybvh_half_area( l2 - l1 ) * (double)lN); + ANR[BVHBINS - 2 - i] = rN == 0 ? BVH_DBL_FAR : (tinybvh_half_area( r2 - r1 ) * (double)rN); + } + // evaluate bin totals to find best position for object split + for (uint32_t i = 0; i < BVHBINS - 1; i++) + { + const double C = c_trav + rSAV * c_int * (ANL[i] + ANR[i]); + if (C < splitCost) + { + splitCost = C, bestAxis = a, bestPos = i; + bestLMin = lBMin[i], bestRMin = rBMin[i], bestLMax = lBMax[i], bestRMax = rBMax[i]; + } + } + } + double noSplitCost = (double)node.triCount * c_int; + if (splitCost >= noSplitCost) break; // not splitting is better. + // in-place partition + uint64_t j = node.leftFirst + node.triCount, src = node.leftFirst; + const double rpd = rpd3[bestAxis], nmin = nmin3[bestAxis]; + for (uint64_t i = 0; i < node.triCount; i++) + { + const uint64_t fi = primIdx[src]; + int32_t bi = (uint32_t)(((fragment[fi].bmin[bestAxis] + fragment[fi].bmax[bestAxis]) * 0.5 - nmin) * rpd); + bi = tinybvh_clamp( bi, 0, BVHBINS - 1 ); + if ((uint32_t)bi <= bestPos) src++; else tinybvh_swap( primIdx[src], primIdx[--j] ); + } + // create child nodes + uint64_t leftCount = src - node.leftFirst, rightCount = node.triCount - leftCount; + if (leftCount == 0 || rightCount == 0 || taskCount == BVH_NUM_ELEMS( task )) break; // should not happen. + const uint64_t n = atomicNewNodePtr->fetch_add( 2 ); + bvhNode[n].aabbMin = bestLMin, bvhNode[n].aabbMax = bestLMax; + bvhNode[n].leftFirst = node.leftFirst, bvhNode[n].triCount = leftCount; + bvhNode[n + 1].aabbMin = bestRMin, bvhNode[n + 1].aabbMax = bestRMax; + bvhNode[n + 1].leftFirst = j, bvhNode[n + 1].triCount = rightCount; + node.leftFirst = n, node.triCount = 0; + if (depth < 5) + { + std::thread t1( &BuildDouble_, n, depth + 1, this ); + std::thread t2( &BuildDouble_, n + 1, depth + 1, this ); + t1.join(); + t2.join(); + break; + } + // recurse + task[taskCount++] = n + 1, nodeIdx = n; + } + // fetch subdivision task from stack + if (taskCount == 0) break; else nodeIdx = task[--taskCount]; + } + if (depth == 0 || triCount < MT_BUILD_THRESHOLD) + { + // all done. + aabbMin = bvhNode[0].aabbMin, aabbMax = bvhNode[0].aabbMax; + refittable = true; // not using spatial splits: can refit this BVH + may_have_holes = false; // the reference builder produces a continuous list of nodes + bvh_over_aabbs = (verts == 0); // bvh over aabbs is suitable as TLAS + usedNodes = newNodePtr = atomicNewNodePtr->load(); + delete atomicNewNodePtr; + } +} + +double BVH_Double::BVHNode::SurfaceArea() const +{ + const bvhdbl3 e = aabbMax - aabbMin; + return e.x * e.y + e.y * e.z + e.z * e.x; +} + +double BVH_Double::SAHCost( const uint64_t nodeIdx ) const +{ + // Determine the SAH cost of a double-precision tree. + const BVHNode& n = bvhNode[nodeIdx]; + if (n.isLeaf()) return c_int * n.SurfaceArea() * n.triCount; + double cost = c_trav * n.SurfaceArea() + SAHCost( n.leftFirst ) + SAHCost( n.leftFirst + 1 ); + return nodeIdx == 0 ? (cost / n.SurfaceArea()) : cost; +} + +// Traverse the default BVH layout, double-precision. +int32_t BVH_Double::Intersect( RayEx& ray ) const +{ + if (instList) return IntersectTLAS( ray ); + BVHNode* node = &bvhNode[0], * stack[64]; + uint32_t stackPtr = 0; + float cost = 0; + while (1) + { + cost += c_trav; + if (node->isLeaf()) + { + if (customEnabled && customIntersect != 0) + { + for (uint32_t i = 0; i < node->triCount; i++, cost += c_int) + if ((*customIntersect)(ray, primIdx[node->leftFirst + i])) + ray.hit.inst = ray.instIdx; + } + else for (uint32_t i = 0; i < node->triCount; i++, cost += c_int) + { + const uint64_t idx = primIdx[node->leftFirst + i]; + const uint64_t vertIdx = idx * 3; + const bvhdbl3 e1 = verts[vertIdx + 1] - verts[vertIdx]; + const bvhdbl3 e2 = verts[vertIdx + 2] - verts[vertIdx]; + const bvhdbl3 h = tinybvh_cross( ray.D, e2 ); + const double a = tinybvh_dot( e1, h ); + if (fabs( a ) < 0.0000001) continue; // ray parallel to triangle + const double f = 1 / a; + const bvhdbl3 s = ray.O - bvhdbl3( verts[vertIdx] ); + const double u = f * tinybvh_dot( s, h ); + const bvhdbl3 q = tinybvh_cross( s, e1 ); + const double v = f * tinybvh_dot( ray.D, q ); + if (u < 0 || v < 0 || u + v > 1) continue; + const double t = f * tinybvh_dot( e2, q ); + if (t > 0 && t < ray.hit.t) + { + // register a hit: ray is shortened to t + ray.hit.t = t, ray.hit.u = u, ray.hit.v = v; + ray.hit.prim = idx; + ray.hit.inst = ray.instIdx; + } + } + if (stackPtr == 0) break; else node = stack[--stackPtr]; + continue; + } + BVHNode* child1 = &bvhNode[node->leftFirst]; + BVHNode* child2 = &bvhNode[node->leftFirst + 1]; + double dist1 = child1->Intersect( ray ), dist2 = child2->Intersect( ray ); + if (dist1 > dist2) { tinybvh_swap( dist1, dist2 ); tinybvh_swap( child1, child2 ); } + if (dist1 == BVH_DBL_FAR /* missed both child nodes */) + { + if (stackPtr == 0) break; else node = stack[--stackPtr]; + } + else /* hit at least one node */ + { + node = child1; /* continue with the nearest */ + if (dist2 != BVH_DBL_FAR) stack[stackPtr++] = child2; /* push far child */ + } + } + return (int32_t)cost; +} + +// Traverse a double-precision TLAS. +int32_t BVH_Double::IntersectTLAS( RayEx& ray ) const +{ + BVHNode* node = &bvhNode[0], * stack[64]; + uint32_t stackPtr = 0; + float cost = 0; + while (1) + { + cost += c_trav; + if (node->isLeaf()) + { + RayEx tmp; + for (uint32_t i = 0; i < node->triCount; i++) + { + // BLAS traversal + const uint64_t instIdx = primIdx[node->leftFirst + i]; + BLASInstanceEx& inst = instList[instIdx]; + if (!(inst.mask & ray.mask)) continue; + BVH_Double* blas = blasList[inst.blasIdx]; + // 1. Transform ray with the inverse of the instance transform + tmp.O = tinybvh_transform_point( ray.O, inst.invTransform ); + tmp.D = tinybvh_transform_vector( ray.D, inst.invTransform ); + tmp.rD = bvhdbl3( 1.0 / tmp.D.x, 1.0 / tmp.D.y, 1.0 / tmp.D.z ); + tmp.hit = ray.hit; + // 2. Traverse BLAS with the transformed ray + tmp.instIdx = instIdx; + cost += blas->Intersect( tmp ); + // 3. Restore ray + ray.hit = tmp.hit; + } + if (stackPtr == 0) break; else node = stack[--stackPtr]; + continue; + } + BVHNode* child1 = &bvhNode[node->leftFirst]; + BVHNode* child2 = &bvhNode[node->leftFirst + 1]; + double dist1 = child1->Intersect( ray ), dist2 = child2->Intersect( ray ); + if (dist1 > dist2) { tinybvh_swap( dist1, dist2 ); tinybvh_swap( child1, child2 ); } + if (dist1 == BVH_DBL_FAR /* missed both child nodes */) + { + if (stackPtr == 0) break; else node = stack[--stackPtr]; + } + else /* hit at least one node */ + { + node = child1; /* continue with the nearest */ + if (dist2 != BVH_DBL_FAR) stack[stackPtr++] = child2; /* push far child */ + } + } + return (int32_t)cost; +} + +bool BVH_Double::IsOccluded( const RayEx& ray ) const +{ + if (instList) return IsOccludedTLAS( ray ); + BVHNode* node = &bvhNode[0], * stack[64]; + uint32_t stackPtr = 0; + while (1) + { + if (node->isLeaf()) + { + if (customEnabled && customIntersect != 0) for (uint32_t i = 0; i < node->triCount; i++) + (*customIsOccluded)(ray, primIdx[node->leftFirst + i]); + else for (uint32_t i = 0; i < node->triCount; i++) + { + const uint64_t idx = primIdx[node->leftFirst + i]; + const uint64_t vertIdx = idx * 3; + const bvhdbl3 e1 = verts[vertIdx + 1] - verts[vertIdx]; + const bvhdbl3 e2 = verts[vertIdx + 2] - verts[vertIdx]; + const bvhdbl3 h = tinybvh_cross( ray.D, e2 ); + const double a = tinybvh_dot( e1, h ); + if (fabs( a ) < 0.0000001) continue; // ray parallel to triangle + const double f = 1 / a; + const bvhdbl3 s = ray.O - bvhdbl3( verts[vertIdx] ); + const double u = f * tinybvh_dot( s, h ); + const bvhdbl3 q = tinybvh_cross( s, e1 ); + const double v = f * tinybvh_dot( ray.D, q ); + if (u < 0 || v < 0 || u + v > 1) continue; + const double t = f * tinybvh_dot( e2, q ); + if (t > 0 && t < ray.hit.t) return true; + } + if (stackPtr == 0) break; else node = stack[--stackPtr]; + continue; + } + BVHNode* child1 = &bvhNode[node->leftFirst]; + BVHNode* child2 = &bvhNode[node->leftFirst + 1]; + double dist1 = child1->Intersect( ray ), dist2 = child2->Intersect( ray ); + if (dist1 > dist2) { tinybvh_swap( dist1, dist2 ); tinybvh_swap( child1, child2 ); } + if (dist1 == BVH_DBL_FAR /* missed both child nodes */) + { + if (stackPtr == 0) break; else node = stack[--stackPtr]; + } + else /* hit at least one node */ + { + node = child1; /* continue with the nearest */ + if (dist2 != BVH_DBL_FAR) stack[stackPtr++] = child2; /* push far child */ + } + } + return false; +} + +bool BVH_Double::IsOccludedTLAS( const RayEx& ray ) const +{ + BVHNode* node = &bvhNode[0], * stack[64]; + uint32_t stackPtr = 0; + RayEx tmp; + while (1) + { + if (node->isLeaf()) + { + for (uint32_t i = 0; i < node->triCount; i++) + { + // BLAS traversal + BLASInstanceEx& inst = instList[primIdx[node->leftFirst + i]]; + if (!(inst.mask & ray.mask)) continue; + BVH_Double* blas = blasList[inst.blasIdx]; + // 1. Transform ray with the inverse of the instance transform + tmp.O = tinybvh_transform_point( ray.O, inst.invTransform ); + tmp.D = tinybvh_transform_vector( ray.D, inst.invTransform ); + tmp.rD.x = tmp.D.x > 1e-24 ? (1.0 / tmp.D.x) : (tmp.D.x < -1e-24 ? (1.0 / tmp.D.x) : BVH_DBL_FAR); + tmp.rD.y = tmp.D.y > 1e-24 ? (1.0 / tmp.D.y) : (tmp.D.y < -1e-24 ? (1.0 / tmp.D.y) : BVH_DBL_FAR); + tmp.rD.z = tmp.D.z > 1e-24 ? (1.0 / tmp.D.z) : (tmp.D.z < -1e-24 ? (1.0 / tmp.D.z) : BVH_DBL_FAR); + // 2. Traverse BLAS with the transformed ray + if (blas->IsOccluded( tmp )) return true; + } + if (stackPtr == 0) break; else node = stack[--stackPtr]; + continue; + } + BVHNode* child1 = &bvhNode[node->leftFirst]; + BVHNode* child2 = &bvhNode[node->leftFirst + 1]; + double dist1 = child1->Intersect( ray ), dist2 = child2->Intersect( ray ); + if (dist1 > dist2) { tinybvh_swap( dist1, dist2 ); tinybvh_swap( child1, child2 ); } + if (dist1 == BVH_DBL_FAR /* missed both child nodes */) + { + if (stackPtr == 0) break; else node = stack[--stackPtr]; + } + else /* hit at least one node */ + { + node = child1; /* continue with the nearest */ + if (dist2 != BVH_DBL_FAR) stack[stackPtr++] = child2; /* push far child */ + } + } + return false; +} + +// BVHNode::Intersect, double precision +double BVH_Double::BVHNode::Intersect( const RayEx& ray ) const +{ + // double-precision "slab test" ray/AABB intersection + double tx1 = (aabbMin.x - ray.O.x) * ray.rD.x, tx2 = (aabbMax.x - ray.O.x) * ray.rD.x; + double tmin = tinybvh_min( tx1, tx2 ), tmax = tinybvh_max( tx1, tx2 ); + double ty1 = (aabbMin.y - ray.O.y) * ray.rD.y, ty2 = (aabbMax.y - ray.O.y) * ray.rD.y; + tmin = tinybvh_max( tmin, tinybvh_min( ty1, ty2 ) ); + tmax = tinybvh_min( tmax, tinybvh_max( ty1, ty2 ) ); + double tz1 = (aabbMin.z - ray.O.z) * ray.rD.z, tz2 = (aabbMax.z - ray.O.z) * ray.rD.z; + tmin = tinybvh_max( tmin, tinybvh_min( tz1, tz2 ) ); + tmax = tinybvh_min( tmax, tinybvh_max( tz1, tz2 ) ); + if (tmax >= tmin && tmin < ray.hit.t && tmax >= 0) return tmin; else return BVH_DBL_FAR; +} + +#endif + +// ============================================================================ +// +// H E L P E R S +// +// ============================================================================ + +// Update +void BLASInstance::Update( BVHBase* blas ) +{ + InvertTransform(); // TODO: done unconditionally; for a big TLAS this may be wasteful. Detect changes automatically? + // transform the eight corners of the root node aabb using the + // instance transform and calculate the worldspace aabb over those. + aabbMin = bvhvec3( BVH_FAR ), aabbMax = bvhvec3( -BVH_FAR ); + bvhvec3 bmin = blas->aabbMin, bmax = blas->aabbMax; + for (int32_t j = 0; j < 8; j++) + { + const bvhvec3 p( j & 1 ? bmax.x : bmin.x, j & 2 ? bmax.y : bmin.y, j & 4 ? bmax.z : bmin.z ); + const bvhvec3 t = tinybvh_transform_point( p, transform ); + aabbMin = tinybvh_min( aabbMin, t ), aabbMax = tinybvh_max( aabbMax, t ); + } +} + +// InvertTransform - calculate the inverse of the matrix stored in 'transform' +void BLASInstance::InvertTransform() +{ + // math from MESA, via http://stackoverflow.com/questions/1148309/inverting-a-4x4-matrix + const float* T = (const float*)&this->transform; + float* iT = (float*)&this->invTransform; + iT[0] = T[5] * T[10] * T[15] - T[5] * T[11] * T[14] - T[9] * T[6] * T[15] + T[9] * T[7] * T[14] + T[13] * T[6] * T[11] - T[13] * T[7] * T[10]; + iT[1] = -T[1] * T[10] * T[15] + T[1] * T[11] * T[14] + T[9] * T[2] * T[15] - T[9] * T[3] * T[14] - T[13] * T[2] * T[11] + T[13] * T[3] * T[10]; + iT[2] = T[1] * T[6] * T[15] - T[1] * T[7] * T[14] - T[5] * T[2] * T[15] + T[5] * T[3] * T[14] + T[13] * T[2] * T[7] - T[13] * T[3] * T[6]; + iT[3] = -T[1] * T[6] * T[11] + T[1] * T[7] * T[10] + T[5] * T[2] * T[11] - T[5] * T[3] * T[10] - T[9] * T[2] * T[7] + T[9] * T[3] * T[6]; + iT[4] = -T[4] * T[10] * T[15] + T[4] * T[11] * T[14] + T[8] * T[6] * T[15] - T[8] * T[7] * T[14] - T[12] * T[6] * T[11] + T[12] * T[7] * T[10]; + iT[5] = T[0] * T[10] * T[15] - T[0] * T[11] * T[14] - T[8] * T[2] * T[15] + T[8] * T[3] * T[14] + T[12] * T[2] * T[11] - T[12] * T[3] * T[10]; + iT[6] = -T[0] * T[6] * T[15] + T[0] * T[7] * T[14] + T[4] * T[2] * T[15] - T[4] * T[3] * T[14] - T[12] * T[2] * T[7] + T[12] * T[3] * T[6]; + iT[7] = T[0] * T[6] * T[11] - T[0] * T[7] * T[10] - T[4] * T[2] * T[11] + T[4] * T[3] * T[10] + T[8] * T[2] * T[7] - T[8] * T[3] * T[6]; + iT[8] = T[4] * T[9] * T[15] - T[4] * T[11] * T[13] - T[8] * T[5] * T[15] + T[8] * T[7] * T[13] + T[12] * T[5] * T[11] - T[12] * T[7] * T[9]; + iT[9] = -T[0] * T[9] * T[15] + T[0] * T[11] * T[13] + T[8] * T[1] * T[15] - T[8] * T[3] * T[13] - T[12] * T[1] * T[11] + T[12] * T[3] * T[9]; + iT[10] = T[0] * T[5] * T[15] - T[0] * T[7] * T[13] - T[4] * T[1] * T[15] + T[4] * T[3] * T[13] + T[12] * T[1] * T[7] - T[12] * T[3] * T[5]; + iT[11] = -T[0] * T[5] * T[11] + T[0] * T[7] * T[9] + T[4] * T[1] * T[11] - T[4] * T[3] * T[9] - T[8] * T[1] * T[7] + T[8] * T[3] * T[5]; + iT[12] = -T[4] * T[9] * T[14] + T[4] * T[10] * T[13] + T[8] * T[5] * T[14] - T[8] * T[6] * T[13] - T[12] * T[5] * T[10] + T[12] * T[6] * T[9]; + iT[13] = T[0] * T[9] * T[14] - T[0] * T[10] * T[13] - T[8] * T[1] * T[14] + T[8] * T[2] * T[13] + T[12] * T[1] * T[10] - T[12] * T[2] * T[9]; + iT[14] = -T[0] * T[5] * T[14] + T[0] * T[6] * T[13] + T[4] * T[1] * T[14] - T[4] * T[2] * T[13] - T[12] * T[1] * T[6] + T[12] * T[2] * T[5]; + iT[15] = T[0] * T[5] * T[10] - T[0] * T[6] * T[9] - T[4] * T[1] * T[10] + T[4] * T[2] * T[9] + T[8] * T[1] * T[6] - T[8] * T[2] * T[5]; + const float det = T[0] * iT[0] + T[1] * iT[4] + T[2] * iT[8] + T[3] * iT[12]; + if (det == 0) return; // actually, invert failed. That's bad. + const float invdet = 1.0f / det; + for (int i = 0; i < 16; i++) iT[i] *= invdet; +} + +#ifdef DOUBLE_PRECISION_SUPPORT + +// Update +void BLASInstanceEx::Update( BVH_Double* blas ) +{ + InvertTransform(); // TODO: done unconditionally; for a big TLAS this may be wasteful. Detect changes automatically? + // transform the eight corners of the root node aabb using the + // instance transform and calculate the worldspace aabb over those. + aabbMin = bvhdbl3( BVH_FAR ), aabbMax = bvhdbl3( -BVH_FAR ); + bvhdbl3 bmin = blas->aabbMin, bmax = blas->aabbMax; + for (int32_t j = 0; j < 8; j++) + { + const bvhdbl3 p( j & 1 ? bmax.x : bmin.x, j & 2 ? bmax.y : bmin.y, j & 4 ? bmax.z : bmin.z ); + const bvhdbl3 t = tinybvh_transform_point( p, transform ); + aabbMin = tinybvh_min( aabbMin, t ), aabbMax = tinybvh_max( aabbMax, t ); + } +} + +// InvertTransform - calculate the inverse of the matrix stored in 'transform' +void BLASInstanceEx::InvertTransform() +{ + // math from MESA, via http://stackoverflow.com/questions/1148309/inverting-a-4x4-matrix + const double* T = this->transform; + invTransform[0] = T[5] * T[10] * T[15] - T[5] * T[11] * T[14] - T[9] * T[6] * T[15] + T[9] * T[7] * T[14] + T[13] * T[6] * T[11] - T[13] * T[7] * T[10]; + invTransform[1] = -T[1] * T[10] * T[15] + T[1] * T[11] * T[14] + T[9] * T[2] * T[15] - T[9] * T[3] * T[14] - T[13] * T[2] * T[11] + T[13] * T[3] * T[10]; + invTransform[2] = T[1] * T[6] * T[15] - T[1] * T[7] * T[14] - T[5] * T[2] * T[15] + T[5] * T[3] * T[14] + T[13] * T[2] * T[7] - T[13] * T[3] * T[6]; + invTransform[3] = -T[1] * T[6] * T[11] + T[1] * T[7] * T[10] + T[5] * T[2] * T[11] - T[5] * T[3] * T[10] - T[9] * T[2] * T[7] + T[9] * T[3] * T[6]; + invTransform[4] = -T[4] * T[10] * T[15] + T[4] * T[11] * T[14] + T[8] * T[6] * T[15] - T[8] * T[7] * T[14] - T[12] * T[6] * T[11] + T[12] * T[7] * T[10]; + invTransform[5] = T[0] * T[10] * T[15] - T[0] * T[11] * T[14] - T[8] * T[2] * T[15] + T[8] * T[3] * T[14] + T[12] * T[2] * T[11] - T[12] * T[3] * T[10]; + invTransform[6] = -T[0] * T[6] * T[15] + T[0] * T[7] * T[14] + T[4] * T[2] * T[15] - T[4] * T[3] * T[14] - T[12] * T[2] * T[7] + T[12] * T[3] * T[6]; + invTransform[7] = T[0] * T[6] * T[11] - T[0] * T[7] * T[10] - T[4] * T[2] * T[11] + T[4] * T[3] * T[10] + T[8] * T[2] * T[7] - T[8] * T[3] * T[6]; + invTransform[8] = T[4] * T[9] * T[15] - T[4] * T[11] * T[13] - T[8] * T[5] * T[15] + T[8] * T[7] * T[13] + T[12] * T[5] * T[11] - T[12] * T[7] * T[9]; + invTransform[9] = -T[0] * T[9] * T[15] + T[0] * T[11] * T[13] + T[8] * T[1] * T[15] - T[8] * T[3] * T[13] - T[12] * T[1] * T[11] + T[12] * T[3] * T[9]; + invTransform[10] = T[0] * T[5] * T[15] - T[0] * T[7] * T[13] - T[4] * T[1] * T[15] + T[4] * T[3] * T[13] + T[12] * T[1] * T[7] - T[12] * T[3] * T[5]; + invTransform[11] = -T[0] * T[5] * T[11] + T[0] * T[7] * T[9] + T[4] * T[1] * T[11] - T[4] * T[3] * T[9] - T[8] * T[1] * T[7] + T[8] * T[3] * T[5]; + invTransform[12] = -T[4] * T[9] * T[14] + T[4] * T[10] * T[13] + T[8] * T[5] * T[14] - T[8] * T[6] * T[13] - T[12] * T[5] * T[10] + T[12] * T[6] * T[9]; + invTransform[13] = T[0] * T[9] * T[14] - T[0] * T[10] * T[13] - T[8] * T[1] * T[14] + T[8] * T[2] * T[13] + T[12] * T[1] * T[10] - T[12] * T[2] * T[9]; + invTransform[14] = -T[0] * T[5] * T[14] + T[0] * T[6] * T[13] + T[4] * T[1] * T[14] - T[4] * T[2] * T[13] - T[12] * T[1] * T[6] + T[12] * T[2] * T[5]; + invTransform[15] = T[0] * T[5] * T[10] - T[0] * T[6] * T[9] - T[4] * T[1] * T[10] + T[4] * T[2] * T[9] + T[8] * T[1] * T[6] - T[8] * T[2] * T[5]; + const double det = T[0] * invTransform[0] + T[1] * invTransform[4] + T[2] * invTransform[8] + T[3] * invTransform[12]; + if (det == 0) return; // actually, invert failed. That's bad. + const double invdet = 1. / det; + for (int i = 0; i < 16; i++) invTransform[i] *= invdet; +} + +#endif + +// SA +float BVHBase::SA( const bvhvec3& aabbMin, const bvhvec3& aabbMax ) +{ + bvhvec3 e = aabbMax - aabbMin; // extent of the node + return e.x * e.y + e.y * e.z + e.z * e.x; +} + +// IntersectTri +void BVHBase::IntersectTri( Ray& ray, const uint32_t triIdx, const bvhvec4slice& verts, const uint32_t i0, const uint32_t i1, const uint32_t i2 ) const +{ +#ifdef WATERTIGHT_TRITEST + // Woop et al.'s Watertight intersection algorithm. + // PART 1 - Precalculations + uint32_t kz = tinybvh_maxdim( ray.D ), kx = (1 << kz) & 3, ky = (1 << kx) & 3; + if (ray.D[kz] < 0) std::swap( kx, ky ); + const float Sz = ray.rD[kz], Sx = ray.D[kx] * Sz, Sy = ray.D[ky] * Sz; + // PART 2 - Intersection + const bvhvec3 C = bvhvec3( verts[i0] ) - ray.O; + const bvhvec3 A = bvhvec3( verts[i1] ) - ray.O; + const bvhvec3 B = bvhvec3( verts[i2] ) - ray.O; + const float Ax = A[kx] - Sx * A[kz], Ay = A[ky] - Sy * A[kz]; + const float Bx = B[kx] - Sx * B[kz], By = B[ky] - Sy * B[kz]; + const float Cx = C[kx] - Sx * C[kz], Cy = C[ky] - Sy * C[kz]; + const float U = Cx * By - Cy * Bx, V = Ax * Cy - Ay * Cx, W = Bx * Ay - By * Ax; + if ((U < 0 || V < 0 || W < 0) && (U > 0 || V > 0 || W > 0)) return; + const float det = U + V + W; + if (det == 0) return; + const float Az = Sz * A[kz], Bz = Sz * B[kz], Cz = Sz * C[kz]; + const float T = U * Az + V * Bz + W * Cz; + const float invDet = 1.0f / det, t = T * invDet; + if (t >= ray.hit.t || t < 0) return; + const float u = U * invDet, v = V * invDet; +#else + // Moeller-Trumbore ray/triangle intersection algorithm. + const bvhvec4 v0_ = verts[i0]; + const bvhvec3 v0 = v0_, e1 = verts[i1] - v0_, e2 = verts[i2] - v0_; + MOLLER_TRUMBORE_TEST( ray.hit.t, return ); +#endif + // evaluate opacity map, if present. + if (opmap) + { + const float fN = (float)opmapN; + const int row = int( (u + v) * fN ), diag = int( (1 - u) * fN ); + const int idx = (row * row) + int( v * fN ) + (diag - (opmapN - 1 - row)); + uint32_t* om = opmap + triIdx * ((opmapN * opmapN + 31) >> 5); + if (!(om[idx >> 5] & (1 << (idx & 31)))) return; + } + // register a hit: ray is shortened to t. + ray.hit.t = t, ray.hit.u = u, ray.hit.v = v; +#if INST_IDX_BITS == 32 + ray.hit.prim = triIdx, ray.hit.inst = ray.instIdx; +#else + ray.hit.prim = triIdx + ray.instIdx; +#endif +} + +// TriOccludes +bool BVHBase::TriOccludes( const Ray& ray, const bvhvec4slice& verts, const uint32_t triIdx, const uint32_t i0, const uint32_t i1, const uint32_t i2 ) const +{ +#ifdef WATERTIGHT_TRITEST + // Woop et al.'s Watertight intersection algorithm. + // PART 1 - Precalculations + uint32_t kz = tinybvh_maxdim( ray.D ), kx = (1 << kz) & 3, ky = (1 << kx) & 3; + if (ray.D[kz] < 0) std::swap( kx, ky ); + const float Sz = ray.rD[kz], Sx = ray.D[kx] * Sz, Sy = ray.D[ky] * Sz; + // PART 2 - Intersection + const bvhvec3 A = bvhvec3( verts[i0] ) - ray.O; + const bvhvec3 B = bvhvec3( verts[i1] ) - ray.O; + const bvhvec3 C = bvhvec3( verts[i2] ) - ray.O; + const float Ax = A[kx] - Sx * A[kz], Ay = A[ky] - Sy * A[kz]; + const float Bx = B[kx] - Sx * B[kz], By = B[ky] - Sy * B[kz]; + const float Cx = C[kx] - Sx * C[kz], Cy = C[ky] - Sy * C[kz]; + const float U = Cx * By - Cy * Bx, V = Ax * Cy - Ay * Cx, W = Bx * Ay - By * Ax; + if ((U < 0 || V < 0 || W < 0) && (U > 0 || V > 0 || W > 0)) return false; + const float det = U + V + W; + if (det == 0) return false; + const float Az = Sz * A[kz], Bz = Sz * B[kz], Cz = Sz * C[kz]; + const float T = U * Az + V * Bz + W * Cz; + const float invDet = 1.0f / det, t = T * invDet; + if (t < 0 || t > ray.hit.t) return false; +#else + // Moeller-Trumbore ray/triangle intersection algorithm + const bvhvec4 v0_ = verts[i0]; + const bvhvec3 v0 = v0_, e1 = verts[i1] - v0_, e2 = verts[i2] - v0_; + MOLLER_TRUMBORE_TEST( ray.hit.t, return false ); +#endif + // evaluate opacity map, if present. + if (opmap) + { + const float fN = (float)opmapN; + const int row = int( (u + v) * fN ), diag = int( (1 - u) * fN ); + const int idx = (row * row) + int( v * fN ) + (diag - (opmapN - 1 - row)); + uint32_t* om = opmap + triIdx * ((opmapN * opmapN + 31) >> 5); + if (!(om[idx >> 5] & (1 << (idx & 31)))) return false; + } + // occluded. + return true; +} + +// PrecomputeTriangle (helper), transforms a triangle to the format used in: +// Fast Ray-Triangle Intersections by Coordinate Transformation. Baldwin & Weber, 2016. +void BVHBase::PrecomputeTriangle( const bvhvec4slice& vert, const uint32_t ti0, const uint32_t ti1, const uint32_t ti2, float* T ) +{ + bvhvec3 v0 = vert[ti0], v1 = vert[ti1], v2 = vert[ti2]; + bvhvec3 e1 = v1 - v0, e2 = v2 - v0, N = tinybvh_cross( e1, e2 ); + float x1, x2, n = tinybvh_dot( v0, N ), rN; + if (fabs( N[0] ) > fabs( N[1] ) && fabs( N[0] ) > fabs( N[2] )) + { + x1 = v1.y * v0.z - v1.z * v0.y, x2 = v2.y * v0.z - v2.z * v0.y, rN = 1.0f / N.x; + T[0] = 0, T[1] = e2.z * rN, T[2] = -e2.y * rN, T[3] = x2 * rN; + T[4] = 0, T[5] = -e1.z * rN, T[6] = e1.y * rN, T[7] = -x1 * rN; + T[8] = 1, T[9] = N.y * rN, T[10] = N.z * rN, T[11] = -n * rN; + } + else if (fabs( N.y ) > fabs( N.z )) + { + x1 = v1.z * v0.x - v1.x * v0.z, x2 = v2.z * v0.x - v2.x * v0.z, rN = 1.0f / N.y; + T[0] = -e2.z * rN, T[1] = 0, T[2] = e2.x * rN, T[3] = x2 * rN; + T[4] = e1.z * rN, T[5] = 0, T[6] = -e1.x * rN, T[7] = -x1 * rN; + T[8] = N.x * rN, T[9] = 1, T[10] = N.z * rN, T[11] = -n * rN; + } + else if (fabs( N.z ) > 0) + { + x1 = v1.x * v0.y - v1.y * v0.x, x2 = v2.x * v0.y - v2.y * v0.x, rN = 1.0f / N.z; + T[0] = e2.y * rN, T[1] = -e2.x * rN, T[2] = 0, T[3] = x2 * rN; + T[4] = -e1.y * rN, T[5] = e1.x * rN, T[6] = 0, T[7] = -x1 * rN; + T[8] = N.x * rN, T[9] = N.y * rN, T[10] = 1, T[11] = -n * rN; + } + else memset( T, 0, 12 * 4 ); +} + +bool BVH::BVHNode::Intersect( const bvhvec3& bmin, const bvhvec3& bmax ) const +{ + return bmin.x < aabbMax.x && bmax.x > aabbMin.x && + bmin.y < aabbMax.y && bmax.y > aabbMin.y && + bmin.z < aabbMax.z && bmax.z > aabbMin.z; +} + +// Faster ClipFrag, which clips against only two planes if a tri wasn't clipped before. +bool BVH::ClipFrag( const Fragment& orig, Fragment& newFrag, bvhvec3 bmin, bvhvec3 bmax, bvhvec3 minDim, const uint32_t axis ) const +{ + // find intersection of bmin/bmax and orig bmin/bmax + bmin = tinybvh_max( bmin, orig.bmin ), bmax = tinybvh_min( bmax, orig.bmax ); + const bvhvec3 extent = bmax - bmin; + uint32_t Nin = 3, vidx = orig.primIdx * 3; + if (orig.clipped) + { + // generic case: Sutherland-Hodgeman against six bounding planes + bvhvec3 vin[16], vout[16]; + if (vertIdx) + vin[0] = verts[vertIdx[vidx]], vin[1] = verts[vertIdx[vidx + 1]], vin[2] = verts[vertIdx[vidx + 2]]; + else + vin[0] = verts[vidx], vin[1] = verts[vidx + 1], vin[2] = verts[vidx + 2]; + for (uint32_t a = 0; a < 3; a++) + { + const float eps = minDim[a]; + if (extent[a] > eps) + { + uint32_t Nout = 0; + const float l = bmin[a], r = bmax[a]; + for (uint32_t v = 0; v < Nin; v++) + { + bvhvec3 v0 = vin[v], v1 = vin[(v + 1) % Nin]; + const bool v0in = v0[a] >= l - eps, v1in = v1[a] >= l - eps; + if (!(v0in || v1in)) continue; else if (v0in ^ v1in) + { + bvhvec3 C = v0 + (l - v0[a]) / (v1[a] - v0[a]) * (v1 - v0); + C[a] = l /* accurate */, vout[Nout++] = C; + } + if (v1in) vout[Nout++] = v1; + } + Nin = 0; + for (uint32_t v = 0; v < Nout; v++) + { + bvhvec3 v0 = vout[v], v1 = vout[(v + 1) % Nout]; + const bool v0in = v0[a] <= r + eps, v1in = v1[a] <= r + eps; + if (!(v0in || v1in)) continue; else if (v0in ^ v1in) + { + bvhvec3 C = v0 + (r - v0[a]) / (v1[a] - v0[a]) * (v1 - v0); + C[a] = r /* accurate */, vin[Nin++] = C; + } + if (v1in) vin[Nin++] = v1; + } + } + } + bvhvec3 mn( BVH_FAR ), mx( -BVH_FAR ); + for (uint32_t i = 0; i < Nin; i++) mn = tinybvh_min( mn, vin[i] ), mx = tinybvh_max( mx, vin[i] ); + newFrag.primIdx = orig.primIdx; + newFrag.bmin = tinybvh_max( mn, bmin ), newFrag.bmax = tinybvh_min( mx, bmax ); + newFrag.clipped = 1; + return Nin > 0; + } + else + { + // special case: if this fragment has not been clipped before, only clip against planes on split axis. + bool hasVerts = false; + bvhvec3 mn( BVH_FAR ), mx( -BVH_FAR ), vout[4], C; + if (extent[axis] > minDim[axis]) + { + const float l = bmin[axis], r = bmax[axis]; + uint32_t Nout = 0; + { + bvhvec3 v0, v1, v2; + if (vertIdx) + v0 = verts[vertIdx[vidx]], v1 = verts[vertIdx[vidx + 1]], v2 = verts[vertIdx[vidx + 2]]; + else + v0 = verts[vidx + 0], v1 = verts[vidx + 1], v2 = verts[vidx + 2]; + bool v0in = v0[axis] >= l, v1in = v1[axis] >= l, v2in = v2[axis] >= l; + if (v0in || v1in) + { + if (v0in ^ v1in) + { + const float f = tinybvh_clamp( (l - v0[axis]) / (v1[axis] - v0[axis]), 0.0f, 1.0f ); + C = v0 + f * (v1 - v0), C[axis] = l /* accurate */, vout[Nout++] = C; + } + if (v1in) vout[Nout++] = v1; + } + if (v1in || v2in) + { + if (v1in ^ v2in) + { + const float f = tinybvh_clamp( (l - v1[axis]) / (v2[axis] - v1[axis]), 0.0f, 1.0f ); + C = v1 + f * (v2 - v1), C[axis] = l /* accurate */, vout[Nout++] = C; + } + if (v2in) vout[Nout++] = v2; + } + if (v2in || v0in) + { + if (v2in ^ v0in) + { + const float f = tinybvh_clamp( (l - v2[axis]) / (v0[axis] - v2[axis]), 0.0f, 1.0f ); + C = v2 + f * (v0 - v2), C[axis] = l /* accurate */, vout[Nout++] = C; + } + if (v0in) vout[Nout++] = v0; + } + } + for (uint32_t v = 0; v < Nout; v++) + { + bvhvec3 v0 = vout[v], v1 = vout[(v + 1) % Nout]; + const bool v0in = v0[axis] <= r, v1in = v1[axis] <= r; + if (!(v0in || v1in)) continue; else if (v0in ^ v1in) + { + const float f = tinybvh_clamp( (r - v0[axis]) / (v1[axis] - v0[axis]), 0.0f, 1.0f ); + C = v0 + f * (v1 - v0), C[axis] = r /* accurate */, hasVerts = true; + mn = tinybvh_min( mn, C ), mx = tinybvh_max( mx, C ); + } + if (v1in) hasVerts = true, mn = tinybvh_min( mn, v1 ), mx = tinybvh_max( mx, v1 ); + } + } + newFrag.bmin = tinybvh_max( mn, bmin ), newFrag.bmax = tinybvh_min( mx, bmax ); + newFrag.primIdx = orig.primIdx, newFrag.clipped = 1; + return hasVerts; + } +} + +// SplitFrag: cut a fragment in two new fragments. +void BVH::SplitFrag( const Fragment& orig, Fragment& left, Fragment& right, const bvhvec3& minDim, const uint32_t splitAxis, const float splitPos, bool& leftOK, bool& rightOK ) const +{ + // method: we will split the fragment against the main split axis into two new fragments. + // In case the original fragment was clipped before, we first clip to the AABB of 'orig'. + bvhvec3 vin[16], vout[16], vleft[16], vright[16]; // occasionally exceeds 9, but never 12 + uint32_t vidx = orig.primIdx * 3, Nin = 3, Nout = 0, Nleft = 0, Nright = 0; + if (!vertIdx) vin[0] = verts[vidx], vin[1] = verts[vidx + 1], vin[2] = verts[vidx + 2]; + else vin[0] = verts[vertIdx[vidx]], vin[1] = verts[vertIdx[vidx + 1]], vin[2] = verts[vertIdx[vidx + 2]]; + const bvhvec3 extent = orig.bmax - orig.bmin; + if (orig.clipped) for (int a = 0; a < 3; a++) if (extent[a] > minDim[a]) + { + float l = orig.bmin[a], r = orig.bmax[a]; + Nout = 0; + for (uint32_t v = 0; v < Nin; v++) + { + bvhvec3 v0 = vin[v], v1 = vin[(v + 1) % Nin]; + const bool v0in = v0[a] >= l, v1in = v1[a] >= l; + if (!(v0in || v1in)) continue; else if (v0in ^ v1in) + { + const float f = tinybvh_clamp( (l - v0[a]) / (v1[a] - v0[a]), 0.0f, 1.0f ); + bvhvec3 C = v0 + f * (v1 - v0); + C[a] = l /* accurate */, vout[Nout++] = C; + } + if (v1in) vout[Nout++] = v1; + } + Nin = 0; + for (uint32_t v = 0; v < Nout; v++) + { + bvhvec3 v0 = vout[v], v1 = vout[(v + 1) % Nout]; + const bool v0in = v0[a] <= r, v1in = v1[a] <= r; + if (!(v0in || v1in)) continue; else if (v0in ^ v1in) + { + const float f = tinybvh_clamp( (r - v0[a]) / (v1[a] - v0[a]), 0.0f, 1.0f ); + bvhvec3 C = v0 + f * (v1 - v0); + C[a] = r /* accurate */, vin[Nin++] = C; + } + if (v1in) vin[Nin++] = v1; + } + } + for (uint32_t v = 0; v < Nin; v++) + { + bvhvec3 v0 = vin[v], v1 = vin[(v + 1) % Nin]; + bool v0left = v0[splitAxis] < splitPos, v1left = v1[splitAxis] < splitPos; + if (v0left && v1left) vleft[Nleft++] = v1; else if (!v0left && !v1left) vright[Nright++] = v1; else + { + const float f = tinybvh_clamp( (splitPos - v0[splitAxis]) / (v1[splitAxis] - v0[splitAxis]), 0.0f, 1.0f ); + bvhvec3 C = v0 + f * (v1 - v0); + C[splitAxis] = splitPos; + if (v0left) vleft[Nleft++] = vright[Nright++] = C, vright[Nright++] = v1; + else vright[Nright++] = vleft[Nleft++] = C, vleft[Nleft++] = v1; + } + } + // calculate left and right fragments + left.bmin = right.bmin = bvhvec3( BVH_FAR ), left.bmax = right.bmax = bvhvec3( -BVH_FAR ); + for (uint32_t i = 0; i < Nleft; i++) + left.bmin = tinybvh_min( left.bmin, vleft[i] ), + left.bmax = tinybvh_max( left.bmax, vleft[i] ); + for (uint32_t i = 0; i < Nright; i++) + right.bmin = tinybvh_min( right.bmin, vright[i] ), + right.bmax = tinybvh_max( right.bmax, vright[i] ); + left.clipped = right.clipped = 1, left.primIdx = right.primIdx = orig.primIdx; + leftOK = Nleft > 0, rightOK = Nright > 0; +} + +// RefitUp: Update bounding boxes of ancestors of the specified node. +void BVH_Verbose::RefitUp( uint32_t nodeIdx ) +{ + while (1) + { + BVHNode& node = bvhNode[nodeIdx]; + if (!node.isLeaf()) + { + const BVHNode& left = bvhNode[node.left]; + const BVHNode& right = bvhNode[node.right]; + node.aabbMin = tinybvh_min( left.aabbMin, right.aabbMin ); + node.aabbMax = tinybvh_max( left.aabbMax, right.aabbMax ); + } + if (nodeIdx == 0) break; else nodeIdx = node.parent; + } +} + +// SAHCostUp: Calculate the SAH cost of a node and its ancestry +float BVH_Verbose::SAHCostUp( uint32_t nodeIdx ) const +{ + float sum = 0; + while (nodeIdx != 0xffffffff) + { + BVHNode& node = bvhNode[nodeIdx]; + sum += BVH::SA( node.aabbMin, node.aabbMax ); + nodeIdx = node.parent; + } + return sum; +} + +// FindBestNewPosition +// Part of "Fast Insertion-Based Optimization of Bounding Volume Hierarchies" +// K.I.S.S. version with brute-force array search. +uint32_t BVH_Verbose::FindBestNewPosition( const uint32_t Lid ) const +{ + struct Task { float ci; uint32_t node; }; + ALIGNED( 64 ) Task task[512]; + float Cbest = BVH_FAR; + int tasks = 1 /* doesn't exceed 70 for Crytek Sponza */, Xbest = 0; + const BVHNode& L = bvhNode[Lid]; + // reinsert L into BVH + task[0].node = 0, task[0].ci = 0; + while (tasks > 0) + { + // 'pop' task with smallest Ci + uint32_t bestTask = 0; + float minCi = task[0].ci; // tnx Brian + for (int j = 1; j < tasks; j++) if (task[j].ci < minCi) minCi = task[j].ci, bestTask = j; + const uint32_t Xid = task[bestTask].node; + const float CiLX = task[bestTask].ci; + if (--tasks > 0) task[bestTask] = task[tasks]; + // execute task + const BVHNode& X = bvhNode[Xid]; + if (CiLX + L.SA() >= Cbest) break; + const float CdLX = SA( tinybvh_min( L.aabbMin, X.aabbMin ), tinybvh_max( L.aabbMax, X.aabbMax ) ); + const float CLX = CiLX + CdLX; + if (CLX < Cbest && Xid != 0) Cbest = CLX, Xbest = Xid; + const float Ci = CLX - X.SA(); + if (Ci + L.SA() >= Cbest || X.isLeaf()) continue; + task[tasks].node = X.left, task[tasks++].ci = Ci; + task[tasks].node = X.right, task[tasks++].ci = Ci; + } + return Xbest; +} + +// Determine for each node in the tree the number of primitives +// stored in that subtree. Helper function for MergeLeafs. +uint32_t BVH_Verbose::CountSubtreeTris( const uint32_t nodeIdx, uint32_t* counters ) +{ + BVHNode& node = bvhNode[nodeIdx]; + uint32_t result = node.triCount; + if (!result) result = CountSubtreeTris( node.left, counters ) + CountSubtreeTris( node.right, counters ); + counters[nodeIdx] = result; + return result; +} + +// Write the triangle indices stored in a subtree to a continuous +// slice in the 'newIdx' array. Helper function for MergeLeafs. +void BVH_Verbose::MergeSubtree( const uint32_t nodeIdx, uint32_t* newIdx, uint32_t& newIdxPtr ) +{ + BVHNode& node = bvhNode[nodeIdx]; + if (node.isLeaf()) + { + memcpy( newIdx + newIdxPtr, primIdx + node.firstTri, node.triCount * 4 ); + newIdxPtr += node.triCount; + return; + } + MergeSubtree( node.left, newIdx, newIdxPtr ); + MergeSubtree( node.right, newIdx, newIdxPtr ); +} + +} // namespace tinybvh + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + +#endif // TINYBVH_IMPLEMENTATION diff --git a/Libraries/tinybvh/README.md b/Libraries/tinybvh/README.md new file mode 100644 index 000000000..09f986c54 --- /dev/null +++ b/Libraries/tinybvh/README.md @@ -0,0 +1,10 @@ +Vendored dependency: `tiny_bvh` + +- File: `Include/tiny_bvh.h` +- Upstream project: https://github.com/jbikker/tinybvh +- Imported from the winding-number integration source snapshot +- License: MIT (license header retained in vendored file) + +Notes: +- This is vendored for boolean/winding integration in lib3mf. +- Future work may switch this dependency to package-manager resolution (e.g. vcpkg). diff --git a/README.md b/README.md index c0b164bcf..905c0d25c 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Allthough the different language bindings are kept as similar as possible, the usage of lib3mf still depends your programming language. You are best-off starting with one of the examples distributed in the [SDK](https://github.com/3MFConsortium/lib3mf/releases) or with this [minimal example in C++](SDK/Examples/CppDynamic/Source/ExtractInfo.cpp). +For language-specific binding usage and API details, see the documentation at https://lib3mf.readthedocs.io. ## Contributing lib3mf is an open source project and supported by the [3MF Consortium](https://3mf.io/). diff --git a/SDK/CPackExamples/CDynamic/CMakeLists.txt b/SDK/CPackExamples/CDynamic/CMakeLists.txt new file mode 100644 index 000000000..a99a8d116 --- /dev/null +++ b/SDK/CPackExamples/CDynamic/CMakeLists.txt @@ -0,0 +1,38 @@ +cmake_minimum_required(VERSION 3.5) + +project(Example_CDynamic CXX) + +# Determine the platform and set lib3mf_DIR accordingly +if(WIN32) + set(lib3mf_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../lib3mf-$ENV{LIB3MF_VERSION}-Windows/lib/cmake/lib3mf") + find_package(lib3mf REQUIRED COMPONENTS CDynamic) +elseif(APPLE) + set(lib3mf_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../lib3mf-$ENV{LIB3MF_VERSION}-Darwin/lib/cmake/lib3mf") + find_package(lib3mf REQUIRED COMPONENTS CDynamic) +else() + find_package(lib3mf QUIET COMPONENTS CDynamic) + if(NOT lib3mf_FOUND) + set(lib3mf_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../lib3mf-$ENV{LIB3MF_VERSION}-Linux/lib/cmake/lib3mf") + find_package(lib3mf REQUIRED COMPONENTS CDynamic) + endif() +endif() + +set(CMAKE_CXX_STANDARD 11) + +add_executable(Example_CDynamic "${CMAKE_CURRENT_SOURCE_DIR}/Source/Version.cpp") +target_link_libraries(Example_CDynamic lib3mf::lib3mf ${CMAKE_DL_LIBS}) + +# lib3mf_dynamic.cc provides the C dynamic loader symbols required by this example. +if(DEFINED LIB3MF_CDYNAMIC_ADDITIONAL_SOURCE) + target_sources(Example_CDynamic PRIVATE "${LIB3MF_CDYNAMIC_ADDITIONAL_SOURCE}") +elseif(DEFINED lib3mf_INCLUDE_DIRS) + target_sources(Example_CDynamic PRIVATE "${lib3mf_INCLUDE_DIRS}/lib3mf_dynamic.cc") +endif() + +if(${MSVC}) + if(${CMAKE_VERSION} VERSION_LESS 3.6.3) + message("Note: You need to manually select a StartUp-project in Visual Studio.") + else() + set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Example_CDynamic) + endif() +endif() diff --git a/SDK/CPackExamples/CDynamic/GenerateMake.sh b/SDK/CPackExamples/CDynamic/GenerateMake.sh new file mode 100755 index 000000000..ae23a11b7 --- /dev/null +++ b/SDK/CPackExamples/CDynamic/GenerateMake.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +basepath="$(cd "$(dirname "$0")" && pwd)" +builddir="$basepath/build" +mkdir -p "$builddir" +cd "$builddir" +cmake .. -G "Unix Makefiles" "$@" + diff --git a/SDK/CPackExamples/CDynamic/GenerateVS2022.bat b/SDK/CPackExamples/CDynamic/GenerateVS2022.bat new file mode 100644 index 000000000..c107ee5f0 --- /dev/null +++ b/SDK/CPackExamples/CDynamic/GenerateVS2022.bat @@ -0,0 +1,11 @@ +@echo off +set startingDir=%CD% + +set basepath=%~dp0 +set builddir=%basepath%\build +if not exist %builddir% (mkdir %builddir%) +cd %builddir% +cmake -G "Visual Studio 17 2022" .. %* + +cd %startingDir% + diff --git a/SDK/CPackExamples/CDynamic/Source/Version.c b/SDK/CPackExamples/CDynamic/Source/Version.c new file mode 100644 index 000000000..57280a7dc --- /dev/null +++ b/SDK/CPackExamples/CDynamic/Source/Version.c @@ -0,0 +1,48 @@ +#include +#include "lib3mf_dynamic.h" + +#ifndef _WIN32 +#define printf_s printf +#endif + +#ifndef LIB3MF_LIBRARY_LOCATION +#ifdef _WIN32 +#define LIB3MF_LIBRARY_LOCATION "lib3mf.dll" +#elif defined(__APPLE__) +#define LIB3MF_LIBRARY_LOCATION "./lib3mf.2.dylib" +#else +#define LIB3MF_LIBRARY_LOCATION "./lib3mf.so.2" +#endif +#endif + +static int fail(const char *message, Lib3MFResult code) { + printf_s("%s (%d)\n", message, (int) code); + return (int) code; +} + +int main() { + sLib3MFDynamicWrapperTable wrapperTable; + Lib3MFResult result; + Lib3MF_uint32 major, minor, micro; + + result = InitLib3MFWrapperTable(&wrapperTable); + if (result != LIB3MF_SUCCESS) { + return fail("Failed to initialize wrapper table", result); + } + + result = LoadLib3MFWrapperTable(&wrapperTable, LIB3MF_LIBRARY_LOCATION); + if (result != LIB3MF_SUCCESS) { + return fail("Failed to load lib3mf library", result); + } + + result = wrapperTable.m_GetLibraryVersion(&major, &minor, µ); + if (result != LIB3MF_SUCCESS) { + ReleaseLib3MFWrapperTable(&wrapperTable); + return fail("Failed to query version", result); + } + + printf_s("Lib3MF.Version = %u.%u.%u\n", major, minor, micro); + ReleaseLib3MFWrapperTable(&wrapperTable); + return 0; +} + diff --git a/SDK/CPackExamples/CDynamic/Source/Version.cpp b/SDK/CPackExamples/CDynamic/Source/Version.cpp new file mode 100644 index 000000000..0111cbb0a --- /dev/null +++ b/SDK/CPackExamples/CDynamic/Source/Version.cpp @@ -0,0 +1,41 @@ +#include +#include "lib3mf_dynamic.h" + +#ifndef _WIN32 +#define printf_s printf +#endif + +#ifndef LIB3MF_LIBRARY_LOCATION +#error "LIB3MF_LIBRARY_LOCATION is expected from lib3mf CDynamic package config" +#endif + +static int fail(const char *message, Lib3MFResult code) { + printf_s("%s (%d)\n", message, (int) code); + return (int) code; +} + +int main() { + sLib3MFDynamicWrapperTable wrapperTable; + Lib3MFResult result; + Lib3MF_uint32 major, minor, micro; + + result = InitLib3MFWrapperTable(&wrapperTable); + if (result != LIB3MF_SUCCESS) { + return fail("Failed to initialize wrapper table", result); + } + + result = LoadLib3MFWrapperTable(&wrapperTable, LIB3MF_LIBRARY_LOCATION); + if (result != LIB3MF_SUCCESS) { + return fail("Failed to load lib3mf library", result); + } + + result = wrapperTable.m_GetLibraryVersion(&major, &minor, µ); + if (result != LIB3MF_SUCCESS) { + ReleaseLib3MFWrapperTable(&wrapperTable); + return fail("Failed to query version", result); + } + + printf_s("Lib3MF.Version = %u.%u.%u\n", major, minor, micro); + ReleaseLib3MFWrapperTable(&wrapperTable); + return 0; +} diff --git a/SDK/CPackExamples/Cpp/GenerateVS2022.bat b/SDK/CPackExamples/Cpp/GenerateVS2022.bat new file mode 100644 index 000000000..1706555ea --- /dev/null +++ b/SDK/CPackExamples/Cpp/GenerateVS2022.bat @@ -0,0 +1,10 @@ +@echo off +set startingDir=%CD% + +set basepath=%~dp0 +set builddir=%basepath%\build +if not exist %builddir% (mkdir %builddir%) +cd %builddir% +cmake -G "Visual Studio 17 2022" .. %* + +cd %startingDir% \ No newline at end of file diff --git a/SDK/CPackExamples/Cpp/Source/ExtractInfo.cpp b/SDK/CPackExamples/Cpp/Source/ExtractInfo.cpp index 661cd30f2..8dec165ab 100644 --- a/SDK/CPackExamples/Cpp/Source/ExtractInfo.cpp +++ b/SDK/CPackExamples/Cpp/Source/ExtractInfo.cpp @@ -32,6 +32,8 @@ ExtractInfo.cpp : 3MF Read Example #include #include #include +#include +#include #include "lib3mf_implicit.hpp" @@ -180,7 +182,7 @@ void ShowComponentsObjectInformation(PComponentsObject componentsObject) } -void ExtractInfoExample(std::string sFileName) { +void ExtractInfoExample(const std::string& sFileName, bool strictMode) { PWrapper wrapper = CWrapper::loadLibrary(); std::cout << "------------------------------------------------------------------" << std::endl; @@ -193,8 +195,9 @@ void ExtractInfoExample(std::string sFileName) { // Import Model from 3MF File { PReader reader = model->QueryReader("3mf"); - // And deactivate the strict mode (default is "false", anyway. This just demonstrates where/how to use it). - reader->SetStrictModeActive(false); + reader->SetStrictModeActive(strictMode); + if (strictMode) + std::cout << "Strict reader mode enabled" << std::endl; reader->ReadFromFile(sFileName); for (Lib3MF_uint32 iWarning = 0; iWarning < reader->GetWarningCount(); iWarning++) { @@ -251,15 +254,48 @@ void ExtractInfoExample(std::string sFileName) { int main(int argc, char** argv) { - // Parse Arguments - if (argc != 2) { - std::cout << "Usage: " << std::endl; - std::cout << "ExtractInfo.exe model.3mf" << std::endl; - return 0; - } - - try { - ExtractInfoExample(argv[1]); + bool strictMode = false; + if(const char* envStrict = std::getenv("LIB3MF_STRICT_READER")) + { + std::string value(envStrict); + value.erase( + std::remove_if(value.begin(), value.end(), + [](unsigned char c) { return std::isspace(c); }), + value.end()); + std::transform(value.begin(), value.end(), value.begin(), + [](unsigned char c) + { return static_cast(std::tolower(c)); }); + if(!value.empty() && value != "0" && value != "false" && value != "off") + strictMode = true; + } + + int fileArgIndex = -1; + for(int i = 1; i < argc; ++i) + { + std::string arg = argv[i]; + if(arg == "--strict") + { + strictMode = true; + continue; + } + if(!arg.empty() && arg[0] == '-') + { + std::cout << "Unknown option: " << arg << std::endl; + return 1; + } + fileArgIndex = i; + break; + } + + if(fileArgIndex < 0 || fileArgIndex != argc - 1) + { + std::cout << "Usage: " << std::endl; + std::cout << "ExtractInfo.exe [--strict] model.3mf" << std::endl; + return 0; + } + + try { + ExtractInfoExample(argv[fileArgIndex], strictMode); } catch (ELib3MFException &e) { std::cout << e.what() << std::endl; diff --git a/SDK/CPackExamples/CppDynamic/GenerateVS2022.bat b/SDK/CPackExamples/CppDynamic/GenerateVS2022.bat new file mode 100644 index 000000000..dbc8e54c1 --- /dev/null +++ b/SDK/CPackExamples/CppDynamic/GenerateVS2022.bat @@ -0,0 +1,10 @@ +@echo off +set startingDir=%CD% + +set basepath=%~dp0 +set builddir=%basepath%\build +if not exist %builddir% (mkdir %builddir%) +cd %builddir% +cmake -G "Visual Studio 17 2022" .. %* + +cd %startingDir% diff --git a/SDK/CPackExamples/CppDynamic/Source/ExtractInfo.cpp b/SDK/CPackExamples/CppDynamic/Source/ExtractInfo.cpp index 0a96b29f4..7959ea1f9 100644 --- a/SDK/CPackExamples/CppDynamic/Source/ExtractInfo.cpp +++ b/SDK/CPackExamples/CppDynamic/Source/ExtractInfo.cpp @@ -32,9 +32,15 @@ ExtractInfo.cpp : 3MF Read Example #include #include #include +#include +#include #include "lib3mf_dynamic.hpp" +#ifndef LIB3MF_LIBRARY_LOCATION +#error "LIB3MF_LIBRARY_LOCATION is expected from lib3mf CppDynamic package config" +#endif + using namespace Lib3MF; @@ -180,12 +186,11 @@ void ShowComponentsObjectInformation(PComponentsObject componentsObject) } -void ExtractInfoExample(std::string sFileName) { +void ExtractInfoExample(const std::string& sFileName, bool strictMode) { std::cout << "------------------------------------------------------------------" << std::endl; std::cout << "3MF Read example" << std::endl; - - std::string libpath = ("."); // TODO: put the location of the Lib3MF-library file here. - auto wrapper = Lib3MF::CWrapper::loadLibrary(LIB3MF_LIBRARY_LOCATION); // TODO: add correct suffix of the library + + auto wrapper = Lib3MF::CWrapper::loadLibrary(LIB3MF_LIBRARY_LOCATION); printVersion(wrapper); std::cout << "------------------------------------------------------------------" << std::endl; @@ -195,8 +200,9 @@ void ExtractInfoExample(std::string sFileName) { // Import Model from 3MF File { PReader reader = model->QueryReader("3mf"); - // And deactivate the strict mode (default is "false", anyway. This just demonstrates where/how to use it). - reader->SetStrictModeActive(false); + reader->SetStrictModeActive(strictMode); + if (strictMode) + std::cout << "Strict reader mode enabled" << std::endl; reader->ReadFromFile(sFileName); for (Lib3MF_uint32 iWarning = 0; iWarning < reader->GetWarningCount(); iWarning++) { @@ -253,15 +259,38 @@ void ExtractInfoExample(std::string sFileName) { int main(int argc, char** argv) { - // Parse Arguments - if (argc != 2) { + bool strictMode = false; + if (const char* envStrict = std::getenv("LIB3MF_STRICT_READER")) { + std::string value(envStrict); + value.erase(std::remove_if(value.begin(), value.end(), [](unsigned char c) { return std::isspace(c); }), value.end()); + std::transform(value.begin(), value.end(), value.begin(), [](unsigned char c) { return static_cast(std::tolower(c)); }); + if (!value.empty() && value != "0" && value != "false" && value != "off") + strictMode = true; + } + + int fileArgIndex = -1; + for (int i = 1; i < argc; ++i) { + std::string arg = argv[i]; + if (arg == "--strict") { + strictMode = true; + continue; + } + if (!arg.empty() && arg[0] == '-') { + std::cout << "Unknown option: " << arg << std::endl; + return 1; + } + fileArgIndex = i; + break; + } + + if (fileArgIndex < 0 || fileArgIndex != argc - 1) { std::cout << "Usage: " << std::endl; - std::cout << "ExtractInfo.exe model.3mf" << std::endl; + std::cout << "ExtractInfo.exe [--strict] model.3mf" << std::endl; return 0; } - + try { - ExtractInfoExample(argv[1]); + ExtractInfoExample(argv[fileArgIndex], strictMode); } catch (ELib3MFException &e) { std::cout << e.what() << std::endl; diff --git a/SDK/Examples/CDynamic/CMakeLists.txt b/SDK/Examples/CDynamic/CMakeLists.txt index 042ce7d63..9eff0bd47 100644 --- a/SDK/Examples/CDynamic/CMakeLists.txt +++ b/SDK/Examples/CDynamic/CMakeLists.txt @@ -53,7 +53,7 @@ endif() set(CMAKE_CURRENT_BINDING_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../Bindings/CDynamic) SET_SOURCE_FILES_PROPERTIES("${CMAKE_CURRENT_BINDING_DIR}/lib3mf_dynamic.cc" PROPERTIES LANGUAGE C) add_executable(Lib3MFExample_CDynamic - "${CMAKE_CURRENT_SOURCE_DIR}/source/Lib3MF_example.c" + "${CMAKE_CURRENT_SOURCE_DIR}/Source/Lib3MF_example.c" "${CMAKE_CURRENT_BINDING_DIR}/lib3mf_dynamic.cc" ) diff --git a/SDK/Examples/CDynamic/Source/Lib3MF_example.c b/SDK/Examples/CDynamic/Source/Lib3MF_example.c index 0df185779..60cf42cfa 100644 --- a/SDK/Examples/CDynamic/Source/Lib3MF_example.c +++ b/SDK/Examples/CDynamic/Source/Lib3MF_example.c @@ -37,6 +37,19 @@ Interface version: 2.2.0 #include #include "lib3mf_dynamic.h" +#ifndef _WIN32 +#define printf_s printf +#endif + +#ifndef LSUFFIXOUT +#ifdef _WIN32 +#define LSUFFIXOUT ".dll" +#elif defined(__APPLE__) +#define LSUFFIXOUT ".2.dylib" +#else +#define LSUFFIXOUT ".so.2" +#endif +#endif void releaseWrapper(sLib3MFDynamicWrapperTable* pWrapperTable) { Lib3MFResult eResult = ReleaseLib3MFWrapperTable(pWrapperTable); @@ -47,8 +60,11 @@ void releaseWrapper(sLib3MFDynamicWrapperTable* pWrapperTable) { int main() { - // TODO: put the path and ending of the Lib3MF library file here: - const char* libpath = "lib3mf.dll"; +#ifdef _WIN32 + const char* libpath = "lib3mf" LSUFFIXOUT; +#else + const char* libpath = "./lib3mf" LSUFFIXOUT; +#endif sLib3MFDynamicWrapperTable sWrapperTable; Lib3MFResult eResult = LIB3MF_SUCCESS; @@ -100,7 +116,7 @@ int main() return eResult; } if (bHasInfo && (nBufferRequired > 0)) { - theString = malloc(sizeof(Lib3MF_uint8)*(nBufferRequired)); + theString = malloc(sizeof(Lib3MF_uint8) * (nBufferRequired + 1)); theString[nBufferRequired] = 0; eResult = sWrapperTable.m_GetBuildInformation(&bHasInfo, nBufferRequired, &nBufferRequired, theString); if (LIB3MF_SUCCESS != eResult) { @@ -124,4 +140,3 @@ int main() return 0; } - diff --git a/SDK/Examples/Cpp/CMakeLists.txt b/SDK/Examples/Cpp/CMakeLists.txt index b2d79be75..e8311bd17 100644 --- a/SDK/Examples/Cpp/CMakeLists.txt +++ b/SDK/Examples/Cpp/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required (VERSION 3.5) set(CMAKE_CXX_STANDARD 17) diff --git a/SDK/Examples/Cpp/GenerateVS2022.bat b/SDK/Examples/Cpp/GenerateVS2022.bat new file mode 100644 index 000000000..dbc8e54c1 --- /dev/null +++ b/SDK/Examples/Cpp/GenerateVS2022.bat @@ -0,0 +1,10 @@ +@echo off +set startingDir=%CD% + +set basepath=%~dp0 +set builddir=%basepath%\build +if not exist %builddir% (mkdir %builddir%) +cd %builddir% +cmake -G "Visual Studio 17 2022" .. %* + +cd %startingDir% diff --git a/SDK/Examples/Cpp/Source/ExtractInfo.cpp b/SDK/Examples/Cpp/Source/ExtractInfo.cpp index 661cd30f2..f9fe017a7 100644 --- a/SDK/Examples/Cpp/Source/ExtractInfo.cpp +++ b/SDK/Examples/Cpp/Source/ExtractInfo.cpp @@ -32,6 +32,8 @@ ExtractInfo.cpp : 3MF Read Example #include #include #include +#include +#include #include "lib3mf_implicit.hpp" @@ -180,7 +182,7 @@ void ShowComponentsObjectInformation(PComponentsObject componentsObject) } -void ExtractInfoExample(std::string sFileName) { +void ExtractInfoExample(const std::string& sFileName, bool strictMode) { PWrapper wrapper = CWrapper::loadLibrary(); std::cout << "------------------------------------------------------------------" << std::endl; @@ -193,8 +195,9 @@ void ExtractInfoExample(std::string sFileName) { // Import Model from 3MF File { PReader reader = model->QueryReader("3mf"); - // And deactivate the strict mode (default is "false", anyway. This just demonstrates where/how to use it). - reader->SetStrictModeActive(false); + reader->SetStrictModeActive(strictMode); + if (strictMode) + std::cout << "Strict reader mode enabled" << std::endl; reader->ReadFromFile(sFileName); for (Lib3MF_uint32 iWarning = 0; iWarning < reader->GetWarningCount(); iWarning++) { @@ -251,15 +254,38 @@ void ExtractInfoExample(std::string sFileName) { int main(int argc, char** argv) { - // Parse Arguments - if (argc != 2) { + bool strictMode = false; + if (const char* envStrict = std::getenv("LIB3MF_STRICT_READER")) { + std::string value(envStrict); + value.erase(std::remove_if(value.begin(), value.end(), [](unsigned char c) { return std::isspace(c); }), value.end()); + std::transform(value.begin(), value.end(), value.begin(), [](unsigned char c) { return static_cast(std::tolower(c)); }); + if (!value.empty() && value != "0" && value != "false" && value != "off") + strictMode = true; + } + + int fileArgIndex = -1; + for (int i = 1; i < argc; ++i) { + std::string arg = argv[i]; + if (arg == "--strict") { + strictMode = true; + continue; + } + if (!arg.empty() && arg[0] == '-') { + std::cout << "Unknown option: " << arg << std::endl; + return 1; + } + fileArgIndex = i; + break; + } + + if (fileArgIndex < 0 || fileArgIndex != argc - 1) { std::cout << "Usage: " << std::endl; - std::cout << "ExtractInfo.exe model.3mf" << std::endl; + std::cout << "ExtractInfo.exe [--strict] model.3mf" << std::endl; return 0; } - + try { - ExtractInfoExample(argv[1]); + ExtractInfoExample(argv[fileArgIndex], strictMode); } catch (ELib3MFException &e) { std::cout << e.what() << std::endl; diff --git a/SDK/Examples/CppDynamic/GenerateVS2022.bat b/SDK/Examples/CppDynamic/GenerateVS2022.bat new file mode 100644 index 000000000..1706555ea --- /dev/null +++ b/SDK/Examples/CppDynamic/GenerateVS2022.bat @@ -0,0 +1,10 @@ +@echo off +set startingDir=%CD% + +set basepath=%~dp0 +set builddir=%basepath%\build +if not exist %builddir% (mkdir %builddir%) +cd %builddir% +cmake -G "Visual Studio 17 2022" .. %* + +cd %startingDir% \ No newline at end of file diff --git a/SDK/Examples/CppDynamic/Source/ExtractInfo.cpp b/SDK/Examples/CppDynamic/Source/ExtractInfo.cpp index d869d311a..c730769f2 100644 --- a/SDK/Examples/CppDynamic/Source/ExtractInfo.cpp +++ b/SDK/Examples/CppDynamic/Source/ExtractInfo.cpp @@ -32,6 +32,8 @@ ExtractInfo.cpp : 3MF Read Example #include #include #include +#include +#include #include "lib3mf_dynamic.hpp" @@ -180,7 +182,7 @@ void ShowComponentsObjectInformation(PComponentsObject componentsObject) } -void ExtractInfoExample(std::string sFileName) { +void ExtractInfoExample(const std::string& sFileName, bool strictMode) { std::cout << "------------------------------------------------------------------" << std::endl; std::cout << "3MF Read example" << std::endl; @@ -195,8 +197,9 @@ void ExtractInfoExample(std::string sFileName) { // Import Model from 3MF File { PReader reader = model->QueryReader("3mf"); - // And deactivate the strict mode (default is "false", anyway. This just demonstrates where/how to use it). - reader->SetStrictModeActive(false); + reader->SetStrictModeActive(strictMode); + if (strictMode) + std::cout << "Strict reader mode enabled" << std::endl; reader->ReadFromFile(sFileName); for (Lib3MF_uint32 iWarning = 0; iWarning < reader->GetWarningCount(); iWarning++) { @@ -253,15 +256,38 @@ void ExtractInfoExample(std::string sFileName) { int main(int argc, char** argv) { - // Parse Arguments - if (argc != 2) { + bool strictMode = false; + if (const char* envStrict = std::getenv("LIB3MF_STRICT_READER")) { + std::string value(envStrict); + value.erase(std::remove_if(value.begin(), value.end(), [](unsigned char c) { return std::isspace(c); }), value.end()); + std::transform(value.begin(), value.end(), value.begin(), [](unsigned char c) { return static_cast(std::tolower(c)); }); + if (!value.empty() && value != "0" && value != "false" && value != "off") + strictMode = true; + } + + int fileArgIndex = -1; + for (int i = 1; i < argc; ++i) { + std::string arg = argv[i]; + if (arg == "--strict") { + strictMode = true; + continue; + } + if (!arg.empty() && arg[0] == '-') { + std::cout << "Unknown option: " << arg << std::endl; + return 1; + } + fileArgIndex = i; + break; + } + + if (fileArgIndex < 0 || fileArgIndex != argc - 1) { std::cout << "Usage: " << std::endl; - std::cout << "ExtractInfo.exe model.3mf" << std::endl; + std::cout << "ExtractInfo.exe [--strict] model.3mf" << std::endl; return 0; } - + try { - ExtractInfoExample(argv[1]); + ExtractInfoExample(argv[fileArgIndex], strictMode); } catch (ELib3MFException &e) { std::cout << e.what() << std::endl; diff --git a/SDK/Examples/Python/assign_materials_and_carry_slicer_metadata.py b/SDK/Examples/Python/assign_materials_and_carry_slicer_metadata.py new file mode 100644 index 000000000..57c4243fc --- /dev/null +++ b/SDK/Examples/Python/assign_materials_and_carry_slicer_metadata.py @@ -0,0 +1,292 @@ +#!/usr/bin/env python3 + +"""Example helper for assigning object materials and carrying slicer metadata. + +This script handles the standard 3MF part of the workflow: +- read an input 3MF +- assign one base material per mesh object +- optionally collapse all mesh objects into one ComponentsObject build item +- optionally copy `/Metadata/...` attachments from a slicer-produced template 3MF +- optionally inject a raw `project_settings.config` attachment +- optionally transplant slicer-specific package entries from a template 3MF after writing + +Important: +- Material assignment is standard 3MF and supported by lib3mf. +- Bambu/Orca "extruder" semantics are slicer-specific and not modeled by lib3mf. + For those, this script either copies attachment bytes or transplants package entries + from a known-good slicer-generated template. + +This variant assumes the PyPI package is installed: + import lib3mf + from lib3mf import get_wrapper +""" + +from __future__ import annotations + +import argparse +import io +import zipfile + +import lib3mf +from lib3mf import get_wrapper + + +DEFAULT_RELATIONSHIP = "http://schemas.3mf.io/package/2015/relationships/metadata/attachment" + + +def parse_hex_color(text: str) -> lib3mf.Color: + value = text.strip() + if value.startswith("#"): + value = value[1:] + if len(value) != 6: + raise ValueError(f"Color must be RRGGBB, got: {text}") + + color = lib3mf.Color() + color.Red = int(value[0:2], 16) + color.Green = int(value[2:4], 16) + color.Blue = int(value[4:6], 16) + color.Alpha = 255 + return color + + +def identity_transform(wrapper): + return wrapper.GetIdentityTransform() + + +def iter_objects(model): + it = model.GetObjects() + while it.MoveNext(): + yield it.GetCurrentObject() + + +def iter_mesh_objects(model): + for obj in iter_objects(model): + if obj.IsMeshObject(): + yield obj + + +def iter_build_items(model): + it = model.GetBuildItems() + while it.MoveNext(): + yield it.GetCurrent() + + +def assign_materials(model: Lib3MF.Model, mesh_objects, material_specs): + if not material_specs: + return None + + base_materials = model.AddBaseMaterialGroup() + property_ids = [] + + for idx, spec in enumerate(material_specs, start=1): + if "=" in spec: + name, color_text = spec.split("=", 1) + elif ":" in spec: + name, color_text = spec.split(":", 1) + else: + name = f"Material {idx}" + color_text = spec + property_id = base_materials.AddMaterial(name.strip(), parse_hex_color(color_text.strip())) + property_ids.append(property_id) + + mesh_objects = list(mesh_objects) + if len(mesh_objects) > len(property_ids): + raise ValueError( + f"Need at least {len(mesh_objects)} material specs, got {len(property_ids)}." + ) + + resource_id = base_materials.GetResourceID() + for mesh_object, property_id in zip(mesh_objects, property_ids): + mesh_object.SetObjectLevelProperty(resource_id, property_id) + + return base_materials + + +def collapse_meshes_to_components(model, wrapper, mesh_objects): + mesh_objects = list(mesh_objects) + if not mesh_objects: + raise ValueError("No mesh objects found to collapse.") + + components = model.AddComponentsObject() + components.SetName("Combined Part") + transform = identity_transform(wrapper) + + for mesh_object in mesh_objects: + components.AddComponent(mesh_object, transform) + + existing_build_items = list(iter_build_items(model)) + for build_item in existing_build_items: + model.RemoveBuildItem(build_item) + + model.AddBuildItem(components, transform) + return components + + +def copy_metadata_attachments_from_template(wrapper, target_model, template_3mf: str): + template_model = wrapper.CreateModel() + template_reader = template_model.QueryReader("3mf") + template_reader.ReadFromFile(template_3mf) + + copied = [] + for index in range(template_model.GetAttachmentCount()): + attachment = template_model.GetAttachment(index) + path = attachment.GetPath() + if not path.startswith("/Metadata/"): + continue + + target_attachment = target_model.AddAttachment(path, attachment.GetRelationShipType()) + target_attachment.ReadFromBuffer(attachment.WriteToBuffer()) + copied.append(path) + + return copied + + +def add_project_settings_attachment(model, config_path: str, uri: str, relationship_type: str): + attachment = model.AddAttachment(uri, relationship_type) + attachment.ReadFromFile(config_path) + return attachment + + +def normalize_zip_name(name: str) -> str: + return name[1:] if name.startswith("/") else name + + +def should_copy_zip_entry(entry_name: str, prefixes): + normalized = normalize_zip_name(entry_name) + return any(normalized.startswith(normalize_zip_name(prefix)) for prefix in prefixes) + + +def transplant_package_entries(template_3mf: str, output_3mf: str, prefixes): + if not prefixes: + return [] + + copied = [] + with zipfile.ZipFile(output_3mf, "r") as output_zip: + existing_entries = { + info.filename: output_zip.read(info.filename) + for info in output_zip.infolist() + } + + with zipfile.ZipFile(template_3mf, "r") as template_zip: + for info in template_zip.infolist(): + if should_copy_zip_entry(info.filename, prefixes): + existing_entries[info.filename] = template_zip.read(info.filename) + copied.append(info.filename) + + buffer = io.BytesIO() + with zipfile.ZipFile(buffer, "w", compression=zipfile.ZIP_DEFLATED) as merged_zip: + for filename in sorted(existing_entries.keys()): + merged_zip.writestr(filename, existing_entries[filename]) + + with open(output_3mf, "wb") as handle: + handle.write(buffer.getvalue()) + + return copied + + +def main() -> int: + parser = argparse.ArgumentParser(description="Assign object materials and carry slicer-specific package metadata.") + parser.add_argument("input_3mf", help="Input 3MF file, e.g. from OpenSCAD") + parser.add_argument("output_3mf", help="Output 3MF file") + parser.add_argument( + "--material", + action="append", + default=[], + help="Material spec in the form Name=#RRGGBB or Name:RRGGBB. Repeat once per mesh object.", + ) + parser.add_argument( + "--collapse-to-components", + action="store_true", + help="Replace current build items with a single ComponentsObject referencing all mesh objects.", + ) + parser.add_argument( + "--copy-metadata-from", + help="Copy every attachment under /Metadata/ from a slicer-produced template 3MF.", + ) + parser.add_argument( + "--project-settings-config", + help="Attach a raw project_settings.config file into the package.", + ) + parser.add_argument( + "--project-settings-uri", + default="/Metadata/project_settings.config", + help="Package URI for the injected config attachment.", + ) + parser.add_argument( + "--project-settings-relationship", + default=DEFAULT_RELATIONSHIP, + help="Relationship type for the injected config attachment.", + ) + parser.add_argument( + "--transplant-from-template", + help="After writing the output 3MF, copy selected raw package entries from this slicer-authored template.", + ) + parser.add_argument( + "--transplant-prefix", + action="append", + default=[], + help="Package prefix to copy from the template zip, e.g. /Metadata/ or /3D/Objects/. Repeat as needed.", + ) + args = parser.parse_args() + + wrapper = get_wrapper() + model = wrapper.CreateModel() + reader = model.QueryReader("3mf") + reader.SetStrictModeActive(False) + reader.ReadFromFile(args.input_3mf) + + mesh_objects = list(iter_mesh_objects(model)) + if not mesh_objects: + raise RuntimeError("Input model does not contain any mesh objects.") + + assign_materials(model, mesh_objects, args.material) + + if args.collapse_to_components: + collapse_meshes_to_components(model, wrapper, mesh_objects) + + copied_paths = [] + if args.copy_metadata_from: + copied_paths = copy_metadata_attachments_from_template(wrapper, model, args.copy_metadata_from) + + if args.project_settings_config: + add_project_settings_attachment( + model, + args.project_settings_config, + args.project_settings_uri, + args.project_settings_relationship, + ) + + model_metadata = model.GetMetaDataGroup() + + writer = model.QueryWriter("3mf") + writer.WriteToFile(args.output_3mf) + + transplanted_entries = [] + if args.transplant_from_template and args.transplant_prefix: + transplanted_entries = transplant_package_entries( + args.transplant_from_template, + args.output_3mf, + args.transplant_prefix, + ) + + print(f"Read {len(mesh_objects)} mesh object(s) from {args.input_3mf}") + if args.material: + print(f"Assigned {min(len(args.material), len(mesh_objects))} material mapping(s)") + if args.collapse_to_components: + print("Collapsed mesh build items into one ComponentsObject build item") + if copied_paths: + print("Copied metadata attachments:") + for path in copied_paths: + print(f" {path}") + if args.project_settings_config: + print(f"Attached raw project settings file as {args.project_settings_uri}") + if transplanted_entries: + print("Transplanted package entries from template:") + for path in transplanted_entries: + print(f" {path}") + print(f"Wrote {args.output_3mf}") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/SDK/GenerateSDK.py b/SDK/GenerateSDK.py new file mode 100644 index 000000000..873be812a --- /dev/null +++ b/SDK/GenerateSDK.py @@ -0,0 +1,183 @@ +#!/usr/bin/env python3 +import os +import sys +import shutil +import subprocess +from pathlib import Path +from zipfile import ZipFile, ZIP_DEFLATED + +import urllib.request + + +def failed(msg: str, code: int = 1) -> None: + print(msg, file=sys.stderr) + raise SystemExit(code) + + +def run_git(args: list[str]) -> str: + try: + out = subprocess.check_output(["git", *args], stderr=subprocess.STDOUT) + return out.decode("utf-8", errors="replace").strip() + except subprocess.CalledProcessError as e: + failed(f"git failed: {' '.join(args)}\n{e.output.decode('utf-8', errors='replace')}") + + +def ensure_dir(p: Path, err_msg: str) -> None: + try: + p.mkdir(parents=True, exist_ok=True) + except Exception as e: + failed(f"{err_msg}: {e}") + + +def copy_tree(src: Path, dst: Path) -> None: + if not src.exists(): + failed(f"Missing path: {src}") + if src.is_dir(): + # Python 3.8+: dirs_exist_ok + shutil.copytree(src, dst, dirs_exist_ok=True) + else: + ensure_dir(dst.parent, f"Error creating folder {dst.parent}") + shutil.copy2(src, dst) + + +def download_file(url: str, out_path: Path, timeout_sec: int = 90) -> None: + ensure_dir(out_path.parent, f"Error creating folder {out_path.parent}") + req = urllib.request.Request(url, headers={"User-Agent": "lib3mf-sdk-packager/1.0"}) + try: + with urllib.request.urlopen(req, timeout=timeout_sec) as r, open(out_path, "wb") as f: + shutil.copyfileobj(r, f) + except Exception as e: + failed(f"Error downloading {url} -> {out_path}: {e}") + + +def obtain_library_cmd(location: str, platform: str, ext: str, subdir: str, artifacts_dir: Path) -> None: + out_path = artifacts_dir / subdir / f"lib3mf.{ext}" + if location == "remote": + buildserver = os.environ.get("BUILDSERVER", "") + if not buildserver: + failed("BUILDSERVER env var is not set (required for LOCATION=remote).") + + url = f"{buildserver}/artifact/artifacts/lib3mf_{platform}.{ext}" + print(f"curl -s --retry 5 -m90 {url} -o {out_path}") + # emulate: --retry 5, -m 90 + last_err = None + for _ in range(5): + try: + download_file(url, out_path, timeout_sec=90) + last_err = None + break + except SystemExit as e: + last_err = e + if last_err is not None: + raise last_err + + fs = out_path.stat().st_size if out_path.exists() else 0 + if fs < 1000: + failed(f"Error obtaining latest lib3mf.{ext}. File size too small.") + else: + src = Path(location) / f"lib3mf_{platform}.{ext}" + if not src.exists(): + failed(f"Error obtaining latest lib3mf.{ext}: missing {src}") + ensure_dir(out_path.parent, f"Error creating {subdir}-folder") + try: + shutil.copy2(src, out_path) + except Exception as e: + failed(f"Error obtaining latest lib3mf.{ext}: {e}") + + +def write_version_txt(artifacts_dir: Path) -> None: + version_txt = artifacts_dir / "version.txt" + print(f"VERSIONTXT = {version_txt}") + + build_number = os.environ.get("BUILD_NUMBER", "") + git_branch_env = os.environ.get("GIT_BRANCH", "") + + # bash logic: if [ -n "${GIT_BRANCH#*/}" ] then use it else use git branch + # Equivalent: if splitting by "/" yields something non-empty after the first "/" + git_branch_trimmed = "" + if "/" in git_branch_env: + git_branch_trimmed = git_branch_env.split("/", 1)[1] + else: + git_branch_trimmed = "" + + if git_branch_trimmed: + git_branch = git_branch_trimmed + else: + git_branch = run_git(["rev-parse", "--abbrev-ref", "HEAD"]) + + git_rev = run_git(["rev-parse", "HEAD"]) + + try: + with open(version_txt, "w", encoding="utf-8") as f: + f.write("[Lib3MF_SDK]\n") + f.write(f"BuildNumber = {build_number}\n") + f.write(f"GITBranch = {git_branch}\n") + f.write(f"GITRevision = {git_rev}\n") + except Exception as e: + failed(f"Error writing {version_txt}: {e}") + + +def zip_dir_contents(src_dir: Path, zip_path: Path) -> None: + # Matches: zip -r OUTFILE SDKARTIFACTS/* + try: + if zip_path.exists(): + zip_path.unlink() + with ZipFile(zip_path, "w", compression=ZIP_DEFLATED) as z: + for p in sorted(src_dir.rglob("*")): + if p.is_file(): + z.write(p, p.relative_to(src_dir)) + except Exception as e: + failed(f"Error zipping SDK: {e}") + + +def main(argv: list[str]) -> int: + sdk_artifacts = Path("lib3mf_sdk") + location = argv[1] if len(argv) > 1 and argv[1] else "remote" + outfile = Path(argv[2]) if len(argv) > 2 and argv[2] else Path("lib3mf_sdk.zip") + + print(f"Clean artifacts-folder {sdk_artifacts}") + if sdk_artifacts.exists(): + shutil.rmtree(sdk_artifacts) + ensure_dir(sdk_artifacts, "Error creating artifacts-folder") + + print("Copy License, Readme, Examples and Bindings") + + # cat ../LICENSE > License.txt & cat Credits.txt >> License.txt + license_src = Path("../LICENSE") + credits_src = Path("Credits.txt") + license_dst = sdk_artifacts / "License.txt" + + if not license_src.exists(): + failed(f"Missing {license_src}") + if not credits_src.exists(): + failed(f"Missing {credits_src}") + + try: + license_dst.write_bytes(license_src.read_bytes() + credits_src.read_bytes()) + except Exception as e: + failed(f"Error creating {license_dst}: {e}") + + copy_tree(Path("Readme.md"), sdk_artifacts / "Readme.md") + copy_tree(Path("Examples"), sdk_artifacts / "Examples") + copy_tree(Path("../Autogenerated/Bindings"), sdk_artifacts / "Bindings") + + print("Obtain binaries") + ensure_dir(sdk_artifacts / "Bin", "Error creating Bin-folder") + ensure_dir(sdk_artifacts / "Lib", "Error creating Lib-folder") + + obtain_library_cmd(location, "linux64", "so", "Bin", sdk_artifacts) + obtain_library_cmd(location, "win64", "dll", "Bin", sdk_artifacts) + obtain_library_cmd(location, "darwin", "dylib", "Bin", sdk_artifacts) + obtain_library_cmd(location, "win64", "lib", "Lib", sdk_artifacts) + + print("Generate version.txt") + write_version_txt(sdk_artifacts) + + print("Zip SDK artifacts") + zip_dir_contents(sdk_artifacts, outfile) + + return 0 + + +if __name__ == "__main__": + raise SystemExit(main(sys.argv)) \ No newline at end of file diff --git a/SDK/GenerateSDK.sh b/SDK/GenerateSDK.sh deleted file mode 100644 index 1d3772477..000000000 --- a/SDK/GenerateSDK.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -export SDKARTIFACTS=lib3mf_sdk - -if [ -n "$1" ]; then - export LOCATION="$1" -else - export LOCATION="remote" -fi - -if [ -n "$2" ]; then - export OUTFILE=$2 -else - export OUTFILE="lib3mf_sdk.zip" -fi - -function failed { - echo "$1" 1>&2 - exit 1; -} - -echo Clean artifacts-folder $SDKARTIFACTS -rm -rf $SDKARTIFACTS -mkdir $SDKARTIFACTS - -echo Copy License, Readme, Examples and Bindings -cat ../LICENSE > $SDKARTIFACTS/License.txt & cat Credits.txt >> $SDKARTIFACTS/License.txt -cp -r Readme.md $SDKARTIFACTS -cp -r Examples $SDKARTIFACTS/Examples -cp -r ../Autogenerated/Bindings $SDKARTIFACTS - -# download from readthedocs or build locally using sphinx -# cp ../Lib3MF-1.pdf $SDKARTIFACTS/Doc/. - -echo Obtain binaries -mkdir -p $SDKARTIFACTS/Bin || failed "Error creating Bin-folder" -mkdir -p $SDKARTIFACTS/Lib || failed "Error creating Lib-folder" - -function obtainlibrarycmd { - if [ "$LOCATION" == "remote" ]; then - echo curl -s --retry 5 -m90 ${BUILDSERVER}/artifact/artifacts/lib3mf_$1.$2 -o $SDKARTIFACTS/$3/lib3mf.$2 || failed "Error obtaining latest lib3mf.$2" - curl -s --retry 5 -m90 ${BUILDSERVER}/artifact/artifacts/lib3mf_$1.$2 -o $SDKARTIFACTS/$3/lib3mf.$2 || failed "Error obtaining latest lib3mf.$2" - FS=`stat --printf="%s" $SDKARTIFACTS/$3/lib3mf.$2` - if [ "$FS" -lt "1000" ]; then - failed "Error obtaining latest lib3mf.$2. File size too small." - fi - else - cp $LOCATION/lib3mf_$1.$2 $SDKARTIFACTS/$3/lib3mf.$2 || failed "Error obtaining latest lib3mf.$2" - fi -} - -obtainlibrarycmd "linux64" "so" "Bin" -obtainlibrarycmd "win64" "dll" "Bin" -obtainlibrarycmd "darwin" "dylib" "Bin" -obtainlibrarycmd "win64" "lib" "Lib" - -echo Generate version.txt -VERSIONTXT="$SDKARTIFACTS/version.txt" -echo VERSIONTXT = $VERSIONTXT -echo "[Lib3MF_SDK]" > $VERSIONTXT -echo "BuildNumber = "$BUILD_NUMBER >> $VERSIONTXT -if [ -n "${GIT_BRANCH#*/}" ]; then - echo "GITBranch = ${GIT_BRANCH#*/}" >> $VERSIONTXT -else - echo "GITBranch = "`git rev-parse --abbrev-ref HEAD` >> $VERSIONTXT -fi -echo "GITRevision = "`git rev-parse HEAD` >> $VERSIONTXT - -echo Zip SDK artifacts -zip -r $OUTFILE $SDKARTIFACTS/* || failed "Error zipping SDK" diff --git a/SDK/GenerateSDK_github.py b/SDK/GenerateSDK_github.py new file mode 100644 index 000000000..aa4bfef22 --- /dev/null +++ b/SDK/GenerateSDK_github.py @@ -0,0 +1,158 @@ +#!/usr/bin/env python3 +import sys +import shutil +import subprocess +from pathlib import Path +from zipfile import ZipFile, ZIP_DEFLATED + + +def failed(msg: str, code: int = 1) -> None: + print(msg, file=sys.stderr) + raise SystemExit(code) + + +def ensure_dir(p: Path, err_msg: str) -> None: + try: + p.mkdir(parents=True, exist_ok=True) + except Exception as e: + failed(f"{err_msg}: {e}") + + +def run_git(args: list[str]) -> str: + try: + out = subprocess.check_output(["git", *args], stderr=subprocess.STDOUT) + return out.decode("utf-8", errors="replace").strip() + except subprocess.CalledProcessError as e: + failed(f"git failed: {' '.join(args)}\n{e.output.decode('utf-8', errors='replace')}") + + +def copy_file(src: Path, dst: Path, err_msg: str) -> None: + if not src.exists(): + failed(f"{err_msg}: missing {src}") + ensure_dir(dst.parent, f"Error creating folder {dst.parent}") + try: + shutil.copy2(src, dst) + except Exception as e: + failed(f"{err_msg}: {e}") + + +def copy_tree(src: Path, dst: Path) -> None: + if not src.exists(): + failed(f"Missing path: {src}") + if src.is_dir(): + shutil.copytree(src, dst, dirs_exist_ok=True) + else: + ensure_dir(dst.parent, f"Error creating folder {dst.parent}") + shutil.copy2(src, dst) + + +def find_macos_dylib(location: Path) -> Path: + candidate = location / "lib3mf.dylib" + if candidate.exists(): + if candidate.is_file(): + return candidate + if candidate.is_dir(): + libs = sorted(candidate.glob("lib3mf*.dylib")) + for lib in libs: + if lib.is_file(): + return lib + for lib in sorted(location.glob("lib3mf*.dylib")): + if lib.is_file(): + return lib + for lib in sorted(location.rglob("lib3mf*.dylib")): + if lib.is_file(): + return lib + failed("Unable to find a macOS lib3mf*.dylib binary in the build artifacts.") + + +def zip_dir_contents(src_dir: Path, zip_path: Path) -> None: + # Matches: cd $SDKARTIFACT && zip -r ../$OUTFILE ./* + try: + zip_path.parent.mkdir(parents=True, exist_ok=True) + if zip_path.exists(): + zip_path.unlink() + + with ZipFile(zip_path, "w", compression=ZIP_DEFLATED) as z: + for p in sorted(src_dir.rglob("*")): + if p.is_file(): + z.write(p, p.relative_to(src_dir)) + except Exception as e: + failed(f"Error zipping SDK: {e}") + + +def main() -> int: + sdk_artifact = Path("build/lib3mf_sdk") + sdk_source = Path("SDK") + location = Path("build") + outfile = Path("lib3mf_sdk.zip") + + print(f"Clean artifacts-folder {sdk_artifact}") + if sdk_artifact.exists(): + shutil.rmtree(sdk_artifact) + ensure_dir(sdk_artifact, "Error creating artifacts-folder") + + print("Copy License, Readme, Examples and Bindings") + license_src = Path("LICENSE") + credits_src = sdk_source / "Credits.txt" + license_dst = sdk_artifact / "License.txt" + + if not license_src.exists(): + failed(f"Missing {license_src}") + if not credits_src.exists(): + failed(f"Missing {credits_src}") + + try: + license_dst.write_bytes(license_src.read_bytes() + credits_src.read_bytes()) + except Exception as e: + failed(f"Error creating {license_dst}: {e}") + + copy_tree(sdk_source / "Readme.md", sdk_artifact / "Readme.md") + copy_tree(sdk_source / "Examples", sdk_artifact / "Examples") + copy_tree(Path("Autogenerated/Bindings"), sdk_artifact / "Bindings") + + ensure_dir(sdk_artifact / "Bin", "Error creating Bin-folder") + ensure_dir(sdk_artifact / "Lib", "Error creating Lib-folder") + + print("Copy binaries") + copy_file(location / "lib3mf.dll" / "lib3mf.dll", + sdk_artifact / "Bin" / "lib3mf.dll", + "Error copying binary") + + copy_file(location / "lib3mf.so" / "lib3mf.so.2", + sdk_artifact / "Bin" / "lib3mf.so", + "Error copying binary") + + mac_lib = find_macos_dylib(location) + copy_file(mac_lib, sdk_artifact / "Bin" / "lib3mf.dylib", "Error copying binary") + + copy_file(location / "lib3mf.lib" / "lib3mf.lib", + sdk_artifact / "Lib" / "lib3mf.lib", + "Error copying binary") + + print("Generate version.txt") + version_txt = sdk_artifact / "version.txt" + print(f"VERSIONTXT = {version_txt}") + + git_head = run_git(["rev-parse", "HEAD"]) + git_branch = run_git(["rev-parse", "--abbrev-ref", "HEAD"]) + + try: + with open(version_txt, "w", encoding="utf-8") as f: + f.write("[lib3mf_sdk]\n") + # keeping bash semantics exactly (it wrote HEAD hash as BuildNumber) + f.write(f"BuildNumber = {git_head}\n") + f.write(f"GITBranch = {git_branch}\n") + f.write(f"GITRevision = {git_head}\n") + except Exception as e: + failed(f"Error writing {version_txt}: {e}") + + print("Zip SDK artifacts") + # bash zips to build/lib3mf_sdk.zip (because it cd's into SDKARTIFACT) + zip_path = sdk_artifact.parent / outfile + zip_dir_contents(sdk_artifact, zip_path) + + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/SDK/GenerateSDK_github.sh b/SDK/GenerateSDK_github.sh deleted file mode 100644 index 79d0543fa..000000000 --- a/SDK/GenerateSDK_github.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -export SDKARTIFACT=build/lib3mf_sdk -export SDKSOURCE=SDK - -export LOCATION="build" - -export OUTFILE="lib3mf_sdk.zip" - -function failed { - echo "$1" 1>&2 - exit 1; -} - -echo Clean artifacts-folder $SDKARTIFACT -rm -rf $SDKARTIFACT -mkdir $SDKARTIFACT - -echo Copy License, Readme, Examples and Bindings -cat LICENSE > $SDKARTIFACT/License.txt & cat $SDKSOURCE/Credits.txt >> $SDKARTIFACT/License.txt -cp $SDKSOURCE/Readme.md $SDKARTIFACT -cp -r $SDKSOURCE/Examples $SDKARTIFACT/Examples -cp -r Autogenerated/Bindings $SDKARTIFACT - -# download from readthedocs or build locally using sphinx -# cp ../Lib3MF-1.pdf $SDKARTIFACT/Doc/. - -mkdir -p $SDKARTIFACT/Bin || failed "Error creating Bin-folder" -mkdir -p $SDKARTIFACT/Lib || failed "Error creating Lib-folder" - -echo Copy binaries -cp $LOCATION/lib3mf.dll/lib3mf.dll $SDKARTIFACT/Bin/ || failed "Error copying binary" -cp $LOCATION/lib3mf.so/lib3mf.so.2 $SDKARTIFACT/Bin/lib3mf.so || failed "Error copying binary" -cp $LOCATION/lib3mf.dylib/lib3mf.$LIB3MF_VERSION.0.dylib $SDKARTIFACT/Bin/lib3mf.dylib || failed "Error copying binary" -cp $LOCATION/lib3mf.lib/lib3mf.lib $SDKARTIFACT/Lib/ || failed "Error copying binary" - -echo Generate version.txt -VERSIONTXT="$SDKARTIFACT/version.txt" -echo VERSIONTXT = $VERSIONTXT -echo "[lib3mf_sdk]" > $VERSIONTXT -echo "BuildNumber = "`git rev-parse HEAD` >> $VERSIONTXT -echo "GITBranch = "`git rev-parse --abbrev-ref HEAD` >> $VERSIONTXT -echo "GITRevision = "`git rev-parse HEAD` >> $VERSIONTXT - -echo Zip SDK artifacts -cd $SDKARTIFACT -zip -r ../$OUTFILE ./* || failed "Error zipping SDK" \ No newline at end of file diff --git a/Source/API/lib3mf.cpp b/Source/API/lib3mf.cpp index 4b309cab2..2fe6e022b 100644 --- a/Source/API/lib3mf.cpp +++ b/Source/API/lib3mf.cpp @@ -102,6 +102,30 @@ void CWrapper::GetSpecificationVersion (const std::string & sSpecificationURL, b nMicro = NMR_SPECVERSION_SECURECONTENT_MICRO; bIsSupported = true; } + else if (!sSpecificationURL.compare(std::string(XML_3MF_NAMESPACE_TRIANGLESETS))) { + nMajor = NMR_SPECVERSION_TRIANGLESETS_MAJOR; + nMinor = NMR_SPECVERSION_TRIANGLESETS_MINOR; + nMicro = NMR_SPECVERSION_TRIANGLESETS_MICRO; + bIsSupported = true; + } + else if (!sSpecificationURL.compare(std::string(XML_3MF_NAMESPACE_VOLUMETRICSPEC))) { + nMajor = NMR_SPECVERSION_VOLUMETRIC_MAJOR; + nMinor = NMR_SPECVERSION_VOLUMETRIC_MINOR; + nMicro = NMR_SPECVERSION_VOLUMETRIC_MICRO; + bIsSupported = true; + } + else if (!sSpecificationURL.compare(std::string(XML_3MF_NAMESPACE_IMPLICITSPEC))) { + nMajor = NMR_SPECVERSION_IMPLICIT_MAJOR; + nMinor = NMR_SPECVERSION_IMPLICIT_MINOR; + nMicro = NMR_SPECVERSION_IMPLICIT_MICRO; + bIsSupported = true; + } + else if (!sSpecificationURL.compare(std::string(XML_3MF_NAMESPACE_BOOLEANSPEC))) { + nMajor = NMR_SPECVERSION_BOOLEAN_MAJOR; + nMinor = NMR_SPECVERSION_BOOLEAN_MINOR; + nMicro = NMR_SPECVERSION_BOOLEAN_MICRO; + bIsSupported = true; + } else { bIsSupported = false; } @@ -257,4 +281,3 @@ sLib3MFTransform CWrapper::GetTranslationTransform(const Lib3MF_single fVectorX, return Transform; } - diff --git a/Source/API/lib3mf_beamlatticenode.cpp b/Source/API/lib3mf_beamlatticenode.cpp new file mode 100644 index 000000000..70bc415b8 --- /dev/null +++ b/Source/API/lib3mf_beamlatticenode.cpp @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is a stub class definition of CBeamLatticeNode + +*/ + +#include "lib3mf_beamlatticenode.hpp" +#include "lib3mf_interfaceexception.hpp" +#include "lib3mf_implicitport.hpp" + +// Include custom headers here. + + +using namespace Lib3MF::Impl; + +/************************************************************************************************************************* + Class definition of CBeamLatticeNode +**************************************************************************************************************************/ + +CBeamLatticeNode::CBeamLatticeNode(NMR::PModelImplicitNode pImplicitNode) + : CImplicitNode{pImplicitNode} +{ + m_pImplicitNode = pImplicitNode; +} + +IImplicitPort * CBeamLatticeNode::GetInputBeamLattice() +{ + return FindInputOrThrow("beamlattice"); +} + +IImplicitPort * CBeamLatticeNode::GetInputPos() +{ + return FindInputOrThrow("pos"); +} + +IImplicitPort * CBeamLatticeNode::GetOutputDistance() +{ + return FindOutputOrThrow("distance"); +} + +void CBeamLatticeNode::SetAccurateRange(const Lib3MF_double dAccurateRange) +{ + m_pImplicitNode->setAccurateRange(dAccurateRange); +} + +Lib3MF_double CBeamLatticeNode::GetAccurateRange() +{ + return m_pImplicitNode->getAccurateRange(); +} + diff --git a/Source/API/lib3mf_booleanobject.cpp b/Source/API/lib3mf_booleanobject.cpp new file mode 100644 index 000000000..6b2b32a04 --- /dev/null +++ b/Source/API/lib3mf_booleanobject.cpp @@ -0,0 +1,200 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is a stub class definition of CBooleanObject + +*/ + +#include "lib3mf_booleanobject.hpp" +#include "lib3mf_interfaceexception.hpp" + +// Include custom headers here. +#include "lib3mf_meshobject.hpp" +#include "Model/Classes/NMR_ModelBooleanObject.h" +#include "Model/Classes/NMR_ModelComponentsObject.h" +#include "Model/Classes/NMR_ModelMeshObject.h" +#include "Model/Classes/NMR_Model.h" +#include "lib3mf_utils.hpp" + +using namespace Lib3MF::Impl; + +/************************************************************************************************************************* + Class definition of CBooleanObject +**************************************************************************************************************************/ + +CBooleanObject::CBooleanObject(NMR::PModelResource pResource) + : CResource(pResource), CObject(pResource) +{ +} + +NMR::PModelBooleanObject CBooleanObject::booleanObject() +{ + auto pBooleanObject = std::dynamic_pointer_cast(resource()); + if (!pBooleanObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDOBJECT); + return pBooleanObject; +} + +bool CBooleanObject::IsBooleanObject() +{ + return true; +} + +bool CBooleanObject::IsMeshObject() +{ + return false; +} + +bool CBooleanObject::IsComponentsObject() +{ + return false; +} + +bool CBooleanObject::IsLevelSetObject() +{ + return false; +} + +void CBooleanObject::SetBaseObject(IObject* pBaseObject, const Lib3MF::sTransform Transform) +{ + if (!pBaseObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + + auto pBaseResource = booleanObject()->getModel()->findResource( + booleanObject()->getModel()->currentPath(), + pBaseObject->GetResourceID()); + auto pBaseModelObject = std::dynamic_pointer_cast(pBaseResource); + if (!pBaseModelObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDOBJECT); + if (dynamic_cast(pBaseModelObject.get()) != nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT); + + booleanObject()->setBaseObject(pBaseModelObject.get(), Lib3MF::TransformToMatrix(Transform)); +} + +IObject * CBooleanObject::GetBaseObject() +{ + auto pBaseObject = booleanObject()->getBaseObject(); + if (!pBaseObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDOBJECT); + + auto pResource = booleanObject()->getModel()->findResource(pBaseObject->getPackageResourceID()); + return CObject::fnCreateObjectFromModelResource(pResource, true); +} + +void CBooleanObject::SetBaseTransform(const Lib3MF::sTransform Transform) +{ + booleanObject()->setBaseTransform(Lib3MF::TransformToMatrix(Transform)); +} + +Lib3MF::sTransform CBooleanObject::GetBaseTransform() +{ + return Lib3MF::MatrixToTransform(booleanObject()->getBaseTransform()); +} + +void CBooleanObject::SetOperation(const Lib3MF::eBooleanOperation eOperation) +{ + booleanObject()->setOperation((NMR::eModelBooleanOperation)eOperation); +} + +Lib3MF::eBooleanOperation CBooleanObject::GetOperation() +{ + return (Lib3MF::eBooleanOperation)booleanObject()->getOperation(); +} + +void CBooleanObject::SetCSGModeEnabled(const bool bCSGModeEnabled) +{ + booleanObject()->setCSGModeEnabled(bCSGModeEnabled); +} + +bool CBooleanObject::GetCSGModeEnabled() +{ + return booleanObject()->getCSGModeEnabled(); +} + +void CBooleanObject::SetExtractionGridResolution(const Lib3MF_uint32 nGridResolution) +{ + booleanObject()->setExtractionGridResolution(nGridResolution); +} + +Lib3MF_uint32 CBooleanObject::GetExtractionGridResolution() +{ + return booleanObject()->getExtractionGridResolution(); +} + +Lib3MF_uint32 CBooleanObject::GetOperandCount() +{ + return booleanObject()->getOperandCount(); +} + +void CBooleanObject::AddOperand(IMeshObject* pOperandObject, const Lib3MF::sTransform Transform) +{ + if (!pOperandObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + + auto pOperandResource = booleanObject()->getModel()->findResource( + booleanObject()->getModel()->currentPath(), + pOperandObject->GetResourceID()); + auto pMeshObject = std::dynamic_pointer_cast(pOperandResource); + if (!pMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDMESHOBJECT); + + booleanObject()->addOperand(pMeshObject.get(), Lib3MF::TransformToMatrix(Transform)); +} + +Lib3MF::sTransform CBooleanObject::GetOperand(const Lib3MF_uint32 nIndex, IMeshObject*& pOperandObject) +{ + auto operand = booleanObject()->getOperand(nIndex); + auto pMeshObject = dynamic_cast(operand->getObject()); + if (!pMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDMESHOBJECT); + + auto pResource = booleanObject()->getModel()->findResource(pMeshObject->getPackageResourceID()); + std::unique_ptr pObject(CObject::fnCreateObjectFromModelResource(pResource, true)); + auto pMeshObjectInterface = dynamic_cast(pObject.get()); + if (!pMeshObjectInterface) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDMESHOBJECT); + + pOperandObject = pMeshObjectInterface; + pObject.release(); + return Lib3MF::MatrixToTransform(operand->getTransform()); +} + +IMeshObject * CBooleanObject::MergeToMeshObject() +{ + auto pBooleanObject = booleanObject(); + auto pModel = pBooleanObject->getModel(); + if (!pModel) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDOBJECT); + + NMR::PMesh pMesh = std::make_shared(); + pBooleanObject->mergeToMesh(pMesh.get(), NMR::fnMATRIX3_identity()); + + NMR::PModelMeshObject pMeshObject = std::make_shared(pModel->generateResourceID(), pModel, pMesh); + pModel->addResource(pMeshObject); + + return new CMeshObject(pMeshObject); +} diff --git a/Source/API/lib3mf_booleanobjectiterator.cpp b/Source/API/lib3mf_booleanobjectiterator.cpp new file mode 100644 index 000000000..83b01648c --- /dev/null +++ b/Source/API/lib3mf_booleanobjectiterator.cpp @@ -0,0 +1,46 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is a stub class definition of CBooleanObjectIterator + +*/ + +#include "lib3mf_booleanobjectiterator.hpp" +#include "lib3mf_interfaceexception.hpp" + +// Include custom headers here. +#include "lib3mf_booleanobject.hpp" + +using namespace Lib3MF::Impl; + +/************************************************************************************************************************* + Class definition of CBooleanObjectIterator +**************************************************************************************************************************/ + +IBooleanObject * CBooleanObjectIterator::GetCurrentBooleanObject() +{ + return new CBooleanObject(GetCurrentResource()); +} diff --git a/Source/API/lib3mf_componentsobject.cpp b/Source/API/lib3mf_componentsobject.cpp index 2c6530e05..db05dfe7f 100644 --- a/Source/API/lib3mf_componentsobject.cpp +++ b/Source/API/lib3mf_componentsobject.cpp @@ -131,3 +131,7 @@ bool CComponentsObject::IsLevelSetObject() return false; } +bool CComponentsObject::IsBooleanObject() +{ + return false; +} diff --git a/Source/API/lib3mf_functiongradientnode.cpp b/Source/API/lib3mf_functiongradientnode.cpp new file mode 100644 index 000000000..c09b53b7f --- /dev/null +++ b/Source/API/lib3mf_functiongradientnode.cpp @@ -0,0 +1,99 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is a stub class definition of CFunctionGradientNode + +*/ + +#include "lib3mf_functiongradientnode.hpp" +#include "lib3mf_interfaceexception.hpp" +#include "lib3mf_implicitport.hpp" + +// Include custom headers here. + + +using namespace Lib3MF::Impl; + +/************************************************************************************************************************* + Class definition of CFunctionGradientNode +**************************************************************************************************************************/ + +CFunctionGradientNode::CFunctionGradientNode(NMR::PModelImplicitNode pImplicitNode) + : CImplicitNode{pImplicitNode} +{ + m_pImplicitNode = pImplicitNode; +} + +IImplicitPort * CFunctionGradientNode::GetInputFunctionID() +{ + return FindInputOrThrow("functionID"); +} + +IImplicitPort * CFunctionGradientNode::GetInputPos() +{ + return FindInputOrThrow("pos"); +} + +IImplicitPort * CFunctionGradientNode::GetInputStep() +{ + return FindInputOrThrow("step"); +} + +void CFunctionGradientNode::SetScalarOutputName(const std::string & sScalarOutputName) +{ + m_pImplicitNode->setScalarOutputName(sScalarOutputName); +} + +std::string CFunctionGradientNode::GetScalarOutputName() +{ + return m_pImplicitNode->getScalarOutputName(); +} + +void CFunctionGradientNode::SetVectorInputName(const std::string & sVectorInputName) +{ + m_pImplicitNode->setVectorInputName(sVectorInputName); +} + +std::string CFunctionGradientNode::GetVectorInputName() +{ + return m_pImplicitNode->getVectorInputName(); +} + +IImplicitPort * CFunctionGradientNode::GetOutputNormalizedGradient() +{ + return FindOutputOrThrow("normalizedgradient"); +} + +IImplicitPort * CFunctionGradientNode::GetOutputGradient() +{ + return FindOutputOrThrow("gradient"); +} + +IImplicitPort * CFunctionGradientNode::GetOutputMagnitude() +{ + return FindOutputOrThrow("magnitude"); +} + diff --git a/Source/API/lib3mf_implicitfunction.cpp b/Source/API/lib3mf_implicitfunction.cpp index e371b82a1..dd86dcf29 100644 --- a/Source/API/lib3mf_implicitfunction.cpp +++ b/Source/API/lib3mf_implicitfunction.cpp @@ -81,6 +81,9 @@ Abstract: This is a stub class definition of CImplicitFunction #include "lib3mf_tannode.hpp" #include "lib3mf_transposenode.hpp" #include "lib3mf_unsignedmeshnode.hpp" +#include "lib3mf_beamlatticenode.hpp" +#include "lib3mf_functiongradientnode.hpp" +#include "lib3mf_normalizedistancenode.hpp" #include "lib3mf_vectorfromscalarnode.hpp" // Include custom headers here. @@ -661,6 +664,39 @@ IUnsignedMeshNode * CImplicitFunction::AddUnsignedMeshNode(const std::string & s return new CUnsignedMeshNode(newNode); } +IBeamLatticeNode* CImplicitFunction::AddBeamLatticeNode(const std::string& sIdentifier, + const std::string& sDisplayName, + const std::string& sTag) +{ + auto newNode = + function()->addNode(Lib3MF::eImplicitNodeType::BeamLattice, + Lib3MF::eImplicitNodeConfiguration::Default, + sIdentifier, sDisplayName, sTag); + return new CBeamLatticeNode(newNode); +} + +IFunctionGradientNode* CImplicitFunction::AddFunctionGradientNode(const std::string& sIdentifier, + const std::string& sDisplayName, + const std::string& sTag) +{ + auto newNode = + function()->addNode(Lib3MF::eImplicitNodeType::FunctionGradient, + Lib3MF::eImplicitNodeConfiguration::Default, + sIdentifier, sDisplayName, sTag); + return new CFunctionGradientNode(newNode); +} + +INormalizeDistanceNode* CImplicitFunction::AddNormalizeDistanceNode(const std::string& sIdentifier, + const std::string& sDisplayName, + const std::string& sTag) +{ + auto newNode = + function()->addNode(Lib3MF::eImplicitNodeType::NormalizeDistance, + Lib3MF::eImplicitNodeConfiguration::Default, + sIdentifier, sDisplayName, sTag); + return new CNormalizeDistanceNode(newNode); +} + IFunctionCallNode* CImplicitFunction::AddFunctionCallNode( const std::string& sIdentifier, const std::string& sDisplayName, const std::string& sTag) diff --git a/Source/API/lib3mf_implicitnode.cpp b/Source/API/lib3mf_implicitnode.cpp index aa96490c5..59daa6570 100644 --- a/Source/API/lib3mf_implicitnode.cpp +++ b/Source/API/lib3mf_implicitnode.cpp @@ -83,7 +83,9 @@ IImplicitPort* Lib3MF::Impl::CImplicitNode::FindInputOrThrow( auto pPort = FindInput(sIdentifier); if (!pPort) { - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + std::string errorMsg = "Input port '" + sIdentifier + "' not found on node '" + + m_pImplicitNode->getIdentifier() + "'"; + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM, errorMsg); } return pPort; } @@ -94,7 +96,9 @@ IImplicitPort* Lib3MF::Impl::CImplicitNode::FindOutputOrThrow( auto pPort = FindOutput(sIdentifier); if (!pPort) { - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + std::string errorMsg = "Output port '" + sIdentifier + "' not found on node '" + + m_pImplicitNode->getIdentifier() + "'"; + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM, errorMsg); } return pPort; } diff --git a/Source/API/lib3mf_levelset.cpp b/Source/API/lib3mf_levelset.cpp index f73d39f5c..21d4fd227 100644 --- a/Source/API/lib3mf_levelset.cpp +++ b/Source/API/lib3mf_levelset.cpp @@ -267,6 +267,11 @@ bool CLevelSet::IsLevelSetObject() return true; } +bool CLevelSet::IsBooleanObject() +{ + return false; +} + IVolumeData * CLevelSet::GetVolumeData() { NMR::PModelVolumeData pVolumeData = levelSetObject()->getVolumeData(); @@ -275,4 +280,4 @@ IVolumeData * CLevelSet::GetVolumeData() return nullptr; } return new CVolumeData(pVolumeData); -} \ No newline at end of file +} diff --git a/Source/API/lib3mf_meshobject.cpp b/Source/API/lib3mf_meshobject.cpp index d8d71d977..c2192bdf0 100644 --- a/Source/API/lib3mf_meshobject.cpp +++ b/Source/API/lib3mf_meshobject.cpp @@ -388,6 +388,11 @@ bool CMeshObject::IsLevelSetObject() return false; } +bool CMeshObject::IsBooleanObject() +{ + return false; +} + bool CMeshObject::IsValid() { return meshObject()->isValid(); @@ -465,4 +470,3 @@ ITriangleSet* CMeshObject::GetTriangleSet(const Lib3MF_uint32 nIndex) return new CTriangleSet(pTriangleSet, pMeshObject); } - diff --git a/Source/API/lib3mf_model.cpp b/Source/API/lib3mf_model.cpp index 8bffb590f..0959baefe 100644 --- a/Source/API/lib3mf_model.cpp +++ b/Source/API/lib3mf_model.cpp @@ -42,6 +42,8 @@ Abstract: This is a stub class definition of CModel #include "lib3mf_resourceiterator.hpp" #include "lib3mf_componentsobject.hpp" #include "lib3mf_componentsobjectiterator.hpp" +#include "lib3mf_booleanobject.hpp" +#include "lib3mf_booleanobjectiterator.hpp" #include "lib3mf_basematerialgroup.hpp" #include "lib3mf_metadatagroup.hpp" #include "lib3mf_attachment.hpp" @@ -82,6 +84,7 @@ Abstract: This is a stub class definition of CModel #include "Model/Classes/NMR_ModelFunctionFromImage3D.h" #include "Model/Classes/NMR_ModelVolumeData.h" #include "Model/Classes/NMR_ModelLevelSetObject.h" +#include "Model/Classes/NMR_ModelBooleanObject.h" #include "Common/NMR_SecureContentTypes.h" #include "lib3mf_utils.hpp" @@ -140,6 +143,9 @@ IResource* CModel::createIResourceFromModelResource(NMR::PModelResource pResourc if (auto p = std::dynamic_pointer_cast(pResource)) { return new CComponentsObject(p); } + if (auto p = std::dynamic_pointer_cast(pResource)) { + return new CBooleanObject(p); + } if (auto p = std::dynamic_pointer_cast(pResource)) { return new CCompositeMaterials(p); @@ -314,6 +320,16 @@ IComponentsObject * CModel::GetComponentsObjectByID(const Lib3MF_uint32 nUniqueR throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT); } +IBooleanObject * CModel::GetBooleanObjectByID(const Lib3MF_uint32 nUniqueResourceID) +{ + NMR::PModelResource pObjectResource = model().findResource(nUniqueResourceID); + if (auto pBooleanObject = std::dynamic_pointer_cast(pObjectResource)) { + return new CBooleanObject(pBooleanObject); + } + else + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDOBJECT); +} + IColorGroup * CModel::GetColorGroupByID(const Lib3MF_uint32 nUniqueResourceID) { NMR::PModelResource pResource = model().findResource(nUniqueResourceID); @@ -452,6 +468,19 @@ IComponentsObjectIterator * CModel::GetComponentsObjects() return pResult.release(); } +IBooleanObjectIterator * CModel::GetBooleanObjects() +{ + auto pResult = std::unique_ptr(new CBooleanObjectIterator()); + Lib3MF_uint32 nObjectsCount = model().getObjectCount(); + + for (Lib3MF_uint32 nIdx = 0; nIdx < nObjectsCount; nIdx++) { + auto resource = model().getObjectResource(nIdx); + if (dynamic_cast(resource.get())) + pResult->addResource(resource); + } + return pResult.release(); +} + ITexture2DIterator * CModel::GetTexture2Ds() { auto pResult = std::unique_ptr(new CTexture2DIterator()); @@ -611,6 +640,15 @@ IComponentsObject * CModel::AddComponentsObject () return new CComponentsObject(pNewResource); } +IBooleanObject * CModel::AddBooleanObject() +{ + NMR::ModelResourceID NewResourceID = model().generateResourceID(); + NMR::PModelBooleanObject pNewResource = std::make_shared(NewResourceID, &model()); + + model().addResource(pNewResource); + return new CBooleanObject(pNewResource); +} + ISliceStack * CModel::AddSliceStack(const Lib3MF_double dZBottom) { NMR::ModelResourceID NewResourceID = model().generateResourceID(); diff --git a/Source/API/lib3mf_nodeiterator.cpp b/Source/API/lib3mf_nodeiterator.cpp index 52b994214..18f7ce57f 100644 --- a/Source/API/lib3mf_nodeiterator.cpp +++ b/Source/API/lib3mf_nodeiterator.cpp @@ -83,6 +83,9 @@ Abstract: This is a stub class definition of CNodeIterator #include "lib3mf_unsignedmeshnode.hpp" #include "lib3mf_vectorfromscalarnode.hpp" #include "lib3mf_modnode.hpp" +#include "lib3mf_beamlatticenode.hpp" +#include "lib3mf_functiongradientnode.hpp" +#include "lib3mf_normalizedistancenode.hpp" using namespace Lib3MF::Impl; @@ -98,7 +101,7 @@ IImplicitNode * CNodeIterator::GetCurrent() auto pNode = implicitNodeFromModelImplicitNode(pModelNode); if (!pNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); - return pNode; + return pNode; } // enum class eImplicitNodeType : Lib3MF_int32 { @@ -263,6 +266,12 @@ IImplicitNode* Lib3MF::Impl::CNodeIterator::implicitNodeFromModelImplicitNode( return new CResourceIdNode(pNode); case eImplicitNodeType::Mod: return new CModNode(pNode); + case eImplicitNodeType::BeamLattice: + return new CBeamLatticeNode(pNode); + case eImplicitNodeType::FunctionGradient: + return new CFunctionGradientNode(pNode); + case eImplicitNodeType::NormalizeDistance: + return new CNormalizeDistanceNode(pNode); default: throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); diff --git a/Source/API/lib3mf_normalizedistancenode.cpp b/Source/API/lib3mf_normalizedistancenode.cpp new file mode 100644 index 000000000..dd84f081a --- /dev/null +++ b/Source/API/lib3mf_normalizedistancenode.cpp @@ -0,0 +1,89 @@ +/*++ + +Copyright (C) 2024 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is a stub class definition of CNormalizeDistanceNode + +*/ + +#include "lib3mf_normalizedistancenode.hpp" +#include "lib3mf_interfaceexception.hpp" +#include "lib3mf_implicitport.hpp" + +// Include custom headers here. + + +using namespace Lib3MF::Impl; + +/************************************************************************************************************************* + Class definition of CNormalizeDistanceNode +**************************************************************************************************************************/ + +CNormalizeDistanceNode::CNormalizeDistanceNode(NMR::PModelImplicitNode pImplicitNode) + : CImplicitNode{pImplicitNode} +{ + m_pImplicitNode = pImplicitNode; +} + +IImplicitPort * CNormalizeDistanceNode::GetInputFunctionID() +{ + return FindInputOrThrow("functionID"); +} + +IImplicitPort * CNormalizeDistanceNode::GetInputPos() +{ + return FindInputOrThrow("pos"); +} + +IImplicitPort * CNormalizeDistanceNode::GetInputStep() +{ + return FindInputOrThrow("step"); +} + +void CNormalizeDistanceNode::SetScalarOutputName(const std::string & sScalarOutputName) +{ + m_pImplicitNode->setScalarOutputName(sScalarOutputName); +} + +std::string CNormalizeDistanceNode::GetScalarOutputName() +{ + return m_pImplicitNode->getScalarOutputName(); +} + +void CNormalizeDistanceNode::SetVectorInputName(const std::string & sVectorInputName) +{ + m_pImplicitNode->setVectorInputName(sVectorInputName); +} + +std::string CNormalizeDistanceNode::GetVectorInputName() +{ + return m_pImplicitNode->getVectorInputName(); +} + +IImplicitPort * CNormalizeDistanceNode::GetOutputResult() +{ + return FindOutputOrThrow("result"); +} + diff --git a/Source/API/lib3mf_object.cpp b/Source/API/lib3mf_object.cpp index 12ef901c5..996efccc0 100644 --- a/Source/API/lib3mf_object.cpp +++ b/Source/API/lib3mf_object.cpp @@ -33,6 +33,7 @@ Abstract: This is a stub class definition of CObject #include "lib3mf_meshobject.hpp" #include "lib3mf_levelset.hpp" +#include "lib3mf_booleanobject.hpp" #include "lib3mf_componentsobject.hpp" #include "lib3mf_metadatagroup.hpp" #include "lib3mf_slicestack.hpp" @@ -41,6 +42,7 @@ Abstract: This is a stub class definition of CObject // Include custom headers here. #include "Model/Classes/NMR_ModelMeshObject.h" #include "Model/Classes/NMR_ModelLevelSetObject.h" +#include "Model/Classes/NMR_ModelBooleanObject.h" #include "Model/Classes/NMR_ModelComponentsObject.h" using namespace Lib3MF::Impl; @@ -72,6 +74,11 @@ IObject* CObject::fnCreateObjectFromModelResource(NMR::PModelResource pResource, return new CLevelSet(pResource); } + NMR::CModelBooleanObject * pBooleanObject = dynamic_cast (pResource.get()); + if (pBooleanObject) { + return new CBooleanObject(pResource); + } + NMR::CModelComponentsObject * pComponentsResource = dynamic_cast (pResource.get()); if (pComponentsResource) { return new CComponentsObject(pResource); @@ -137,6 +144,12 @@ bool CObject::IsLevelSetObject() throw ELib3MFInterfaceException(LIB3MF_ERROR_SHOULDNOTBECALLED); } +bool CObject::IsBooleanObject() +{ + // overwritten by child class + throw ELib3MFInterfaceException(LIB3MF_ERROR_SHOULDNOTBECALLED); +} + IMeshObject * CObject::AsMeshObject() { @@ -267,4 +280,3 @@ Lib3MF::sBox CObject::GetOutbox() return s; } - diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 27973c844..ba48cbee5 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -12,7 +12,10 @@ if (USE_INCLUDED_ZLIB) file(GLOB ZLIB_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "Libraries/zlib/Source/*.c") endif() -file (GLOB CPPBASE64_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "Libraries/cpp-base64/Source/*.cpp") +set(CPPBASE64_FILES "") +if (USE_INCLUDED_CPPBASE64) + file (GLOB CPPBASE64_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "Libraries/cpp-base64/Source/*.cpp") +endif() # sources set(SRCS_PLATFORM diff --git a/Source/Common/Boolean/NMR_BooleanDistanceField.cpp b/Source/Common/Boolean/NMR_BooleanDistanceField.cpp new file mode 100644 index 000000000..51504dfae --- /dev/null +++ b/Source/Common/Boolean/NMR_BooleanDistanceField.cpp @@ -0,0 +1,486 @@ +/*++ + +Copyright (C) 2026 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +Signed-distance field generation for winding-number based boolean CSG. + +--*/ + +#include "Common/Boolean/NMR_BooleanDistanceField.h" + +#include "Common/NMR_Exception.h" +#include "Common/Winding/NMR_WindingNumber.h" +#include "tiny_bvh.h" +#include "nanoflann.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NMR::Boolean { + + namespace { + sBooleanVec3d operator+(const sBooleanVec3d & a, const sBooleanVec3d & b) { return { a.x + b.x, a.y + b.y, a.z + b.z }; } + sBooleanVec3d operator-(const sBooleanVec3d & a, const sBooleanVec3d & b) { return { a.x - b.x, a.y - b.y, a.z - b.z }; } + sBooleanVec3d operator*(const sBooleanVec3d & a, const double s) { return { a.x * s, a.y * s, a.z * s }; } + double dot(const sBooleanVec3d & a, const sBooleanVec3d & b) { return a.x * b.x + a.y * b.y + a.z * b.z; } + + double combineField(double a, double b, eModelBooleanOperation operation) + { + switch (operation) { + case eModelBooleanOperation::Union: + return std::min(a, b); + case eModelBooleanOperation::Intersection: + return std::max(a, b); + case eModelBooleanOperation::Difference: + return std::max(a, -b); + default: + return std::min(a, b); + } + } + + struct sDistanceMesh { + struct sCentroidAdaptor { + const std::vector> * pCentroids = nullptr; + size_t kdtree_get_point_count() const { return pCentroids ? pCentroids->size() : 0; } + double kdtree_get_pt(size_t idx, size_t dim) const { return (*pCentroids)[idx][dim]; } + template bool kdtree_get_bbox(BBOX &) const { return false; } + }; + + using CentroidKDTree = nanoflann::KDTreeSingleIndexAdaptor< + nanoflann::L2_Simple_Adaptor, + sCentroidAdaptor, 3, size_t>; + + std::vector> vertices; + std::vector> triangles; + std::vector> centroids; + std::vector triVertsPacked; + sCentroidAdaptor centroidAdaptor; + std::unique_ptr pCentroidKDTree; + std::unique_ptr pBVH; + + sDistanceMesh() = default; + sDistanceMesh(const sDistanceMesh &) = delete; + sDistanceMesh & operator=(const sDistanceMesh &) = delete; + + sDistanceMesh(sDistanceMesh && other) noexcept + : vertices(std::move(other.vertices)), + triangles(std::move(other.triangles)), + centroids(std::move(other.centroids)), + triVertsPacked(std::move(other.triVertsPacked)), + pBVH(std::move(other.pBVH)) + { + rebuildCentroidKDTree(); + } + + sDistanceMesh & operator=(sDistanceMesh && other) noexcept + { + if (this != &other) { + vertices = std::move(other.vertices); + triangles = std::move(other.triangles); + centroids = std::move(other.centroids); + triVertsPacked = std::move(other.triVertsPacked); + pBVH = std::move(other.pBVH); + rebuildCentroidKDTree(); + } + return *this; + } + + private: + void rebuildCentroidKDTree() + { + centroidAdaptor.pCentroids = nullptr; + pCentroidKDTree.reset(); + if (!centroids.empty()) { + centroidAdaptor.pCentroids = ¢roids; + pCentroidKDTree = std::make_unique(3, centroidAdaptor, nanoflann::KDTreeSingleIndexAdaptorParams(12)); + pCentroidKDTree->buildIndex(); + } + } + }; + + struct sWindingMesh { + std::vector vertices; + std::vector triangles; + std::unique_ptr winding; + }; + + sWindingMesh makeWindingMesh(_In_ CMesh * pMesh) + { + if (!pMesh) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + if (pMesh->getNodeCount() < 3 || pMesh->getFaceCount() < 1) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + + sWindingMesh result; + result.vertices.resize(pMesh->getNodeCount()); + result.triangles.resize(pMesh->getFaceCount()); + + for (nfUint32 nNodeIdx = 0; nNodeIdx < pMesh->getNodeCount(); ++nNodeIdx) { + const auto * pNode = pMesh->getNode(nNodeIdx); + result.vertices[nNodeIdx] = { + static_cast(pNode->m_position.m_fields[0]), + static_cast(pNode->m_position.m_fields[1]), + static_cast(pNode->m_position.m_fields[2]) + }; + } + + for (nfUint32 nFaceIdx = 0; nFaceIdx < pMesh->getFaceCount(); ++nFaceIdx) { + const auto * pFace = pMesh->getFace(nFaceIdx); + result.triangles[nFaceIdx] = { + static_cast(pFace->m_nodeindices[0]), + static_cast(pFace->m_nodeindices[1]), + static_cast(pFace->m_nodeindices[2]) + }; + } + + tg::windingNumber::Settings settings; + settings.taylorOrder = 2; + settings.accuracy = 2.0; + result.winding = std::make_unique(result.vertices, result.triangles, settings); + return result; + } + + sDistanceMesh makeDistanceMesh(_In_ CMesh * pMesh) + { + if (!pMesh) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + sDistanceMesh result; + result.vertices.resize(pMesh->getNodeCount()); + for (nfUint32 nNodeIdx = 0; nNodeIdx < pMesh->getNodeCount(); ++nNodeIdx) { + const auto * pNode = pMesh->getNode(nNodeIdx); + result.vertices[nNodeIdx] = { + static_cast(pNode->m_position.m_fields[0]), + static_cast(pNode->m_position.m_fields[1]), + static_cast(pNode->m_position.m_fields[2]) + }; + } + + result.triangles.resize(pMesh->getFaceCount()); + result.centroids.resize(pMesh->getFaceCount()); + result.triVertsPacked.reserve(static_cast(pMesh->getFaceCount()) * 3ULL); + for (nfUint32 nFaceIdx = 0; nFaceIdx < pMesh->getFaceCount(); ++nFaceIdx) { + const auto * pFace = pMesh->getFace(nFaceIdx); + const auto i0 = static_cast(pFace->m_nodeindices[0]); + const auto i1 = static_cast(pFace->m_nodeindices[1]); + const auto i2 = static_cast(pFace->m_nodeindices[2]); + result.triangles[nFaceIdx] = { i0, i1, i2 }; + + const auto & v0 = result.vertices[i0]; + const auto & v1 = result.vertices[i1]; + const auto & v2 = result.vertices[i2]; + result.centroids[nFaceIdx] = { + (v0[0] + v1[0] + v2[0]) / 3.0, + (v0[1] + v1[1] + v2[1]) / 3.0, + (v0[2] + v1[2] + v2[2]) / 3.0 + }; + result.triVertsPacked.emplace_back(v0[0], v0[1], v0[2]); + result.triVertsPacked.emplace_back(v1[0], v1[1], v1[2]); + result.triVertsPacked.emplace_back(v2[0], v2[1], v2[2]); + } + + if (!result.centroids.empty()) { + result.centroidAdaptor.pCentroids = &result.centroids; + result.pCentroidKDTree = std::make_unique(3, result.centroidAdaptor, nanoflann::KDTreeSingleIndexAdaptorParams(12)); + result.pCentroidKDTree->buildIndex(); + } + + if (!result.triangles.empty()) { + result.pBVH = std::make_unique(); + result.pBVH->Build(result.triVertsPacked.data(), static_cast(result.triangles.size())); + } + + return result; + } + + double pointTriangleDistanceSquared(const sBooleanVec3d & p, const sBooleanVec3d & a, const sBooleanVec3d & b, const sBooleanVec3d & c) + { + const sBooleanVec3d ab = b - a; + const sBooleanVec3d ac = c - a; + const sBooleanVec3d ap = p - a; + + const double d1 = dot(ab, ap); + const double d2 = dot(ac, ap); + if (d1 <= 0.0 && d2 <= 0.0) + return dot(ap, ap); + + const sBooleanVec3d bp = p - b; + const double d3 = dot(ab, bp); + const double d4 = dot(ac, bp); + if (d3 >= 0.0 && d4 <= d3) + return dot(bp, bp); + + const double vc = d1 * d4 - d3 * d2; + if (vc <= 0.0 && d1 >= 0.0 && d3 <= 0.0) { + const double v = d1 / (d1 - d3); + const sBooleanVec3d proj = a + ab * v; + const sBooleanVec3d diff = p - proj; + return dot(diff, diff); + } + + const sBooleanVec3d cp = p - c; + const double d5 = dot(ab, cp); + const double d6 = dot(ac, cp); + if (d6 >= 0.0 && d5 <= d6) + return dot(cp, cp); + + const double vb = d5 * d2 - d1 * d6; + if (vb <= 0.0 && d2 >= 0.0 && d6 <= 0.0) { + const double w = d2 / (d2 - d6); + const sBooleanVec3d proj = a + ac * w; + const sBooleanVec3d diff = p - proj; + return dot(diff, diff); + } + + const double va = d3 * d6 - d5 * d4; + if (va <= 0.0 && (d4 - d3) >= 0.0 && (d5 - d6) >= 0.0) { + const sBooleanVec3d bc = c - b; + const double w = (d4 - d3) / ((d4 - d3) + (d5 - d6)); + const sBooleanVec3d proj = b + bc * w; + const sBooleanVec3d diff = p - proj; + return dot(diff, diff); + } + + const double denom = 1.0 / (va + vb + vc); + const double v = vb * denom; + const double w = vc * denom; + const sBooleanVec3d proj = a + ab * v + ac * w; + const sBooleanVec3d diff = p - proj; + return dot(diff, diff); + } + + double pointAABBDistanceSquared(const sBooleanVec3d & p, const tinybvh::bvhdbl3 & bmin, const tinybvh::bvhdbl3 & bmax) + { + const double dx = (p.x < bmin.x) ? (bmin.x - p.x) : ((p.x > bmax.x) ? (p.x - bmax.x) : 0.0); + const double dy = (p.y < bmin.y) ? (bmin.y - p.y) : ((p.y > bmax.y) ? (p.y - bmax.y) : 0.0); + const double dz = (p.z < bmin.z) ? (bmin.z - p.z) : ((p.z > bmax.z) ? (p.z - bmax.z) : 0.0); + return dx * dx + dy * dy + dz * dz; + } + + double unsignedDistanceToMesh(const sDistanceMesh & mesh, const sBooleanVec3d & p) + { + if (mesh.triangles.empty() || !mesh.pBVH || mesh.pBVH->usedNodes == 0 || mesh.pBVH->bvhNode == nullptr) + return std::numeric_limits::infinity(); + + double minDist2 = std::numeric_limits::infinity(); + + if (mesh.pCentroidKDTree) { + constexpr size_t kSeeds = 4; + const size_t k = std::min(kSeeds, mesh.triangles.size()); + std::array seedIndices{}; + std::array seedDists{}; + nanoflann::KNNResultSet resultSet(k); + resultSet.init(seedIndices.data(), seedDists.data()); + const double query[3] = { p.x, p.y, p.z }; + mesh.pCentroidKDTree->findNeighbors(resultSet, query, nanoflann::SearchParameters(16)); + + for (size_t i = 0; i < k; ++i) { + const auto triId = seedIndices[i]; + const auto & tri = mesh.triangles[triId]; + const auto & av = mesh.vertices[tri[0]]; + const auto & bv = mesh.vertices[tri[1]]; + const auto & cv = mesh.vertices[tri[2]]; + const sBooleanVec3d a{ av[0], av[1], av[2] }; + const sBooleanVec3d b{ bv[0], bv[1], bv[2] }; + const sBooleanVec3d c{ cv[0], cv[1], cv[2] }; + minDist2 = std::min(minDist2, pointTriangleDistanceSquared(p, a, b, c)); + } + } + + std::vector> stack; + stack.reserve(256); + + uint64_t nodeIdx = 0; + double nodeDist2 = pointAABBDistanceSquared(p, mesh.pBVH->bvhNode[0].aabbMin, mesh.pBVH->bvhNode[0].aabbMax); + + while (true) { + if (nodeDist2 < minDist2) { + const auto & node = mesh.pBVH->bvhNode[nodeIdx]; + if (node.isLeaf()) { + for (uint64_t triOffset = 0; triOffset < node.triCount; ++triOffset) { + const auto triId = mesh.pBVH->primIdx[node.leftFirst + triOffset]; + const auto & tri = mesh.triangles[triId]; + const auto & av = mesh.vertices[tri[0]]; + const auto & bv = mesh.vertices[tri[1]]; + const auto & cv = mesh.vertices[tri[2]]; + const sBooleanVec3d a{ av[0], av[1], av[2] }; + const sBooleanVec3d b{ bv[0], bv[1], bv[2] }; + const sBooleanVec3d c{ cv[0], cv[1], cv[2] }; + minDist2 = std::min(minDist2, pointTriangleDistanceSquared(p, a, b, c)); + } + } + else { + const uint64_t leftIdx = node.leftFirst; + const uint64_t rightIdx = node.leftFirst + 1; + + const auto & leftNode = mesh.pBVH->bvhNode[leftIdx]; + const auto & rightNode = mesh.pBVH->bvhNode[rightIdx]; + + const double leftDist2 = pointAABBDistanceSquared(p, leftNode.aabbMin, leftNode.aabbMax); + const double rightDist2 = pointAABBDistanceSquared(p, rightNode.aabbMin, rightNode.aabbMax); + const uint64_t nearIdx = (leftDist2 <= rightDist2) ? leftIdx : rightIdx; + const uint64_t farIdx = (leftDist2 <= rightDist2) ? rightIdx : leftIdx; + const double nearDist2 = (leftDist2 <= rightDist2) ? leftDist2 : rightDist2; + const double farDist2 = (leftDist2 <= rightDist2) ? rightDist2 : leftDist2; + + if (farDist2 < minDist2) + stack.emplace_back(farIdx, farDist2); + + if (nearDist2 < minDist2) { + nodeIdx = nearIdx; + nodeDist2 = nearDist2; + continue; + } + } + } + + if (stack.empty()) + break; + nodeIdx = stack.back().first; + nodeDist2 = stack.back().second; + stack.pop_back(); + } + + return std::sqrt(std::max(minDist2, 0.0)); + } + + double signedDistanceField( + _In_ const tg::windingNumber & winding, + _In_ const sDistanceMesh & distanceMesh, + _In_ const sBooleanVec3d & point) + { + const auto w = winding.query({ point.x, point.y, point.z }); + const double sign = (std::abs(w) >= 0.5) ? -1.0 : 1.0; + return sign * unsignedDistanceToMesh(distanceMesh, point); + } + + void computeBounds(_In_ const std::vector & meshes, _Out_ sBooleanVec3d & minCorner, _Out_ sBooleanVec3d & maxCorner) + { + minCorner = { 1e300, 1e300, 1e300 }; + maxCorner = { -1e300, -1e300, -1e300 }; + bool hasAnyNode = false; + + for (auto * pMesh : meshes) { + if (!pMesh) + continue; + + for (nfUint32 nNodeIdx = 0; nNodeIdx < pMesh->getNodeCount(); ++nNodeIdx) { + const auto * pNode = pMesh->getNode(nNodeIdx); + hasAnyNode = true; + minCorner.x = std::min(minCorner.x, static_cast(pNode->m_position.m_fields[0])); + minCorner.y = std::min(minCorner.y, static_cast(pNode->m_position.m_fields[1])); + minCorner.z = std::min(minCorner.z, static_cast(pNode->m_position.m_fields[2])); + maxCorner.x = std::max(maxCorner.x, static_cast(pNode->m_position.m_fields[0])); + maxCorner.y = std::max(maxCorner.y, static_cast(pNode->m_position.m_fields[1])); + maxCorner.z = std::max(maxCorner.z, static_cast(pNode->m_position.m_fields[2])); + } + } + + if (!hasAnyNode) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + + const sBooleanVec3d size = maxCorner - minCorner; + const double padding = std::max({ size.x, size.y, size.z, 1e-3 }) * 0.05; + minCorner.x -= padding; minCorner.y -= padding; minCorner.z -= padding; + maxCorner.x += padding; maxCorner.y += padding; maxCorner.z += padding; + } + } + + sBooleanFieldData buildCSGField( + _In_ CMesh * pBaseMesh, + _In_ const std::vector & operandMeshes, + _In_ eModelBooleanOperation operation, + _In_ nfUint32 nGridResolution) + { + if (!pBaseMesh || operandMeshes.empty()) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + auto baseWinding = makeWindingMesh(pBaseMesh); + auto baseDistance = makeDistanceMesh(pBaseMesh); + std::vector operandWindings; + std::vector operandDistances; + operandWindings.reserve(operandMeshes.size()); + operandDistances.reserve(operandMeshes.size()); + for (const auto & operandMesh : operandMeshes) { + operandWindings.push_back(makeWindingMesh(operandMesh.get())); + operandDistances.push_back(makeDistanceMesh(operandMesh.get())); + } + + std::vector allMeshes; + allMeshes.reserve(operandMeshes.size() + 1); + allMeshes.push_back(pBaseMesh); + for (const auto & operandMesh : operandMeshes) + allMeshes.push_back(operandMesh.get()); + + sBooleanFieldData fieldData; + computeBounds(allMeshes, fieldData.minCorner, fieldData.maxCorner); + if (nGridResolution < 2 || nGridResolution > static_cast(std::numeric_limits::max())) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + fieldData.resolution = static_cast(nGridResolution); + fieldData.values.resize(static_cast(fieldData.resolution) * fieldData.resolution * fieldData.resolution); + + const auto idx = [resolution = fieldData.resolution](int x, int y, int z) -> size_t { + return static_cast(z) * resolution * resolution + + static_cast(y) * resolution + + static_cast(x); + }; + + const sBooleanVec3d step = { + (fieldData.maxCorner.x - fieldData.minCorner.x) / static_cast(fieldData.resolution - 1), + (fieldData.maxCorner.y - fieldData.minCorner.y) / static_cast(fieldData.resolution - 1), + (fieldData.maxCorner.z - fieldData.minCorner.z) / static_cast(fieldData.resolution - 1) + }; + + for (int z = 0; z < fieldData.resolution; ++z) { + for (int y = 0; y < fieldData.resolution; ++y) { + for (int x = 0; x < fieldData.resolution; ++x) { + const sBooleanVec3d p = { + fieldData.minCorner.x + x * step.x, + fieldData.minCorner.y + y * step.y, + fieldData.minCorner.z + z * step.z + }; + + double csgField = signedDistanceField(*baseWinding.winding, baseDistance, p); + for (size_t opIdx = 0; opIdx < operandWindings.size(); ++opIdx) { + const double operandField = signedDistanceField(*operandWindings[opIdx].winding, operandDistances[opIdx], p); + csgField = combineField(csgField, operandField, operation); + } + fieldData.values[idx(x, y, z)] = csgField; + } + } + } + + return fieldData; + } + +} diff --git a/Source/Common/Boolean/NMR_BooleanEngine.cpp b/Source/Common/Boolean/NMR_BooleanEngine.cpp new file mode 100644 index 000000000..2b76b2208 --- /dev/null +++ b/Source/Common/Boolean/NMR_BooleanEngine.cpp @@ -0,0 +1,62 @@ +/*++ + +Copyright (C) 2026 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +Winding-number based boolean field construction and CSG composition. + +--*/ + +#include "Common/Boolean/NMR_BooleanEngine.h" + +#include "Common/Boolean/NMR_BooleanDistanceField.h" +#include "Common/Boolean/NMR_BooleanSurfacePostProcess.h" +#include "Common/Boolean/NMR_MarchingCubes.h" +#include "Common/NMR_Exception.h" + +namespace NMR { + + void CBooleanEngine::evaluate( + _In_ CMesh * pBaseMesh, + _In_ const std::vector & operandMeshes, + _In_ eModelBooleanOperation operation, + _In_ CMesh * pResultMesh, + _In_ nfUint32 nGridResolution) + { + if (!pResultMesh) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + const auto fieldData = Boolean::buildCSGField(pBaseMesh, operandMeshes, operation, nGridResolution); + Boolean::extractIsoSurfaceMarchingCubes( + pResultMesh, + fieldData.values, + fieldData.resolution, + { fieldData.minCorner.x, fieldData.minCorner.y, fieldData.minCorner.z }, + { fieldData.maxCorner.x, fieldData.maxCorner.y, fieldData.maxCorner.z }); + Boolean::smoothAndProjectExtractedSurface(pResultMesh, fieldData); + } + +} diff --git a/Source/Common/Boolean/NMR_BooleanSurfacePostProcess.cpp b/Source/Common/Boolean/NMR_BooleanSurfacePostProcess.cpp new file mode 100644 index 000000000..329a34f51 --- /dev/null +++ b/Source/Common/Boolean/NMR_BooleanSurfacePostProcess.cpp @@ -0,0 +1,207 @@ +/*++ + +Copyright (C) 2026 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +Mesh post-processing helpers for extracted boolean surfaces. + +--*/ + +#include "Common/Boolean/NMR_BooleanSurfacePostProcess.h" + +#include +#include +#include +#include + +namespace NMR::Boolean { + + namespace { + sBooleanVec3d operator+(const sBooleanVec3d & a, const sBooleanVec3d & b) { return { a.x + b.x, a.y + b.y, a.z + b.z }; } + sBooleanVec3d operator-(const sBooleanVec3d & a, const sBooleanVec3d & b) { return { a.x - b.x, a.y - b.y, a.z - b.z }; } + sBooleanVec3d operator*(const sBooleanVec3d & a, const double s) { return { a.x * s, a.y * s, a.z * s }; } + + double sampleFieldTrilinear(_In_ const sBooleanFieldData & fieldData, _In_ const sBooleanVec3d & p) + { + const int resolution = fieldData.resolution; + const auto idx = [resolution](int x, int y, int z) -> size_t { + return static_cast(z) * resolution * resolution + + static_cast(y) * resolution + + static_cast(x); + }; + + const auto sampleCoord = [resolution](double t) -> std::pair { + const double scaled = std::clamp(t * static_cast(resolution - 1), 0.0, static_cast(resolution - 1)); + const int i0 = std::clamp(static_cast(std::floor(scaled)), 0, resolution - 2); + const double frac = scaled - static_cast(i0); + return { i0, frac }; + }; + + const double dx = std::max(fieldData.maxCorner.x - fieldData.minCorner.x, 1e-9); + const double dy = std::max(fieldData.maxCorner.y - fieldData.minCorner.y, 1e-9); + const double dz = std::max(fieldData.maxCorner.z - fieldData.minCorner.z, 1e-9); + const auto [ix, tx] = sampleCoord((p.x - fieldData.minCorner.x) / dx); + const auto [iy, ty] = sampleCoord((p.y - fieldData.minCorner.y) / dy); + const auto [iz, tz] = sampleCoord((p.z - fieldData.minCorner.z) / dz); + + const double c000 = fieldData.values[idx(ix, iy, iz)]; + const double c100 = fieldData.values[idx(ix + 1, iy, iz)]; + const double c010 = fieldData.values[idx(ix, iy + 1, iz)]; + const double c110 = fieldData.values[idx(ix + 1, iy + 1, iz)]; + const double c001 = fieldData.values[idx(ix, iy, iz + 1)]; + const double c101 = fieldData.values[idx(ix + 1, iy, iz + 1)]; + const double c011 = fieldData.values[idx(ix, iy + 1, iz + 1)]; + const double c111 = fieldData.values[idx(ix + 1, iy + 1, iz + 1)]; + + const double c00 = c000 * (1.0 - tx) + c100 * tx; + const double c10 = c010 * (1.0 - tx) + c110 * tx; + const double c01 = c001 * (1.0 - tx) + c101 * tx; + const double c11 = c011 * (1.0 - tx) + c111 * tx; + const double c0 = c00 * (1.0 - ty) + c10 * ty; + const double c1 = c01 * (1.0 - ty) + c11 * ty; + return c0 * (1.0 - tz) + c1 * tz; + } + } + + void smoothAndProjectExtractedSurface( + _In_ CMesh * pMesh, + _In_ const sBooleanFieldData & fieldData) + { + if (!pMesh) + return; + + const int resolution = fieldData.resolution; + if (resolution < 3 || fieldData.values.empty()) + return; + + const nfUint32 nNodeCount = pMesh->getNodeCount(); + if (nNodeCount < 3) + return; + + std::vector> neighbors(static_cast(nNodeCount)); + const nfUint32 nFaceCount = pMesh->getFaceCount(); + for (nfUint32 f = 0; f < nFaceCount; ++f) { + const auto * pFace = pMesh->getFace(f); + const nfUint32 a = static_cast(pFace->m_nodeindices[0]); + const nfUint32 b = static_cast(pFace->m_nodeindices[1]); + const nfUint32 c = static_cast(pFace->m_nodeindices[2]); + if (a == b || b == c || c == a) + continue; + neighbors[a].push_back(b); neighbors[a].push_back(c); + neighbors[b].push_back(a); neighbors[b].push_back(c); + neighbors[c].push_back(a); neighbors[c].push_back(b); + } + + for (auto & nn : neighbors) { + std::sort(nn.begin(), nn.end()); + nn.erase(std::unique(nn.begin(), nn.end()), nn.end()); + } + + std::vector positions(static_cast(nNodeCount)); + for (nfUint32 i = 0; i < nNodeCount; ++i) { + const auto * pNode = pMesh->getNode(i); + positions[i] = { + static_cast(pNode->m_position.m_fields[0]), + static_cast(pNode->m_position.m_fields[1]), + static_cast(pNode->m_position.m_fields[2]) + }; + } + + auto laplacianStep = [&](double weight) { + std::vector updated = positions; + for (nfUint32 i = 0; i < nNodeCount; ++i) { + const auto & nn = neighbors[i]; + if (nn.empty()) + continue; + sBooleanVec3d avg{ 0.0, 0.0, 0.0 }; + for (const auto n : nn) + avg = avg + positions[n]; + const double invCount = 1.0 / static_cast(nn.size()); + avg = avg * invCount; + const sBooleanVec3d lap = avg - positions[i]; + updated[i] = positions[i] + lap * weight; + } + positions.swap(updated); + }; + + constexpr int smoothingIterations = 3; + constexpr double lambda = 0.33; + constexpr double mu = -0.34; + for (int iter = 0; iter < smoothingIterations; ++iter) { + laplacianStep(lambda); + laplacianStep(mu); + } + + const sBooleanVec3d cellStep = { + (fieldData.maxCorner.x - fieldData.minCorner.x) / static_cast(resolution - 1), + (fieldData.maxCorner.y - fieldData.minCorner.y) / static_cast(resolution - 1), + (fieldData.maxCorner.z - fieldData.minCorner.z) / static_cast(resolution - 1) + }; + const sBooleanVec3d gradEps = { + std::max(0.5 * cellStep.x, 1e-6), + std::max(0.5 * cellStep.y, 1e-6), + std::max(0.5 * cellStep.z, 1e-6) + }; + + constexpr int projectionIterations = 2; + for (int iter = 0; iter < projectionIterations; ++iter) { + for (nfUint32 i = 0; i < nNodeCount; ++i) { + sBooleanVec3d p = positions[i]; + const double f = sampleFieldTrilinear(fieldData, p); + if (std::abs(f) < 1e-5) + continue; + + const sBooleanVec3d pxp{ p.x + gradEps.x, p.y, p.z }; + const sBooleanVec3d pxm{ p.x - gradEps.x, p.y, p.z }; + const sBooleanVec3d pyp{ p.x, p.y + gradEps.y, p.z }; + const sBooleanVec3d pym{ p.x, p.y - gradEps.y, p.z }; + const sBooleanVec3d pzp{ p.x, p.y, p.z + gradEps.z }; + const sBooleanVec3d pzm{ p.x, p.y, p.z - gradEps.z }; + + const sBooleanVec3d grad{ + (sampleFieldTrilinear(fieldData, pxp) - sampleFieldTrilinear(fieldData, pxm)) / (2.0 * gradEps.x), + (sampleFieldTrilinear(fieldData, pyp) - sampleFieldTrilinear(fieldData, pym)) / (2.0 * gradEps.y), + (sampleFieldTrilinear(fieldData, pzp) - sampleFieldTrilinear(fieldData, pzm)) / (2.0 * gradEps.z) + }; + + const double gradNorm2 = grad.x * grad.x + grad.y * grad.y + grad.z * grad.z; + if (gradNorm2 < 1e-12) + continue; + + const double stepScale = std::clamp(f / gradNorm2, -2.0, 2.0); + positions[i] = p - grad * stepScale; + } + } + + for (nfUint32 i = 0; i < nNodeCount; ++i) { + auto * pNode = pMesh->getNode(i); + pNode->m_position.m_fields[0] = static_cast(positions[i].x); + pNode->m_position.m_fields[1] = static_cast(positions[i].y); + pNode->m_position.m_fields[2] = static_cast(positions[i].z); + } + } + +} diff --git a/Source/Common/Boolean/NMR_MarchingCubes.cpp b/Source/Common/Boolean/NMR_MarchingCubes.cpp new file mode 100644 index 000000000..a1140f522 --- /dev/null +++ b/Source/Common/Boolean/NMR_MarchingCubes.cpp @@ -0,0 +1,221 @@ +/*++ + +Copyright (C) 2026 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +Marching-cubes iso-surface extraction for scalar fields. + +--*/ + +#include "Common/Boolean/NMR_MarchingCubes.h" + +#include "Common/NMR_Exception.h" + +#include + +namespace NMR::Boolean { + + namespace { + std::array interpolateIso0(const std::array & p0, const std::array & p1, double v0, double v1) + { + const double t = (v0 == v1) ? 0.5 : (v0 / (v0 - v1)); + return { + p0[0] + (p1[0] - p0[0]) * t, + p0[1] + (p1[1] - p0[1]) * t, + p0[2] + (p1[2] - p0[2]) * t + }; + } + + static const int kMcEdgeTable[256] = { + 0x0, 0x109, 0x203, 0x30a, 0x406, 0x50f, 0x605, 0x70c, 0x80c, 0x905, 0xa0f, 0xb06, 0xc0a, 0xd03, 0xe09, 0xf00, + 0x190, 0x99, 0x393, 0x29a, 0x596, 0x49f, 0x795, 0x69c, 0x99c, 0x895, 0xb9f, 0xa96, 0xd9a, 0xc93, 0xf99, 0xe90, + 0x230, 0x339, 0x33, 0x13a, 0x636, 0x73f, 0x435, 0x53c, 0xa3c, 0xb35, 0x83f, 0x936, 0xe3a, 0xf33, 0xc39, 0xd30, + 0x3a0, 0x2a9, 0x1a3, 0xaa, 0x7a6, 0x6af, 0x5a5, 0x4ac, 0xbac, 0xaa5, 0x9af, 0x8a6, 0xfaa, 0xea3, 0xda9, 0xca0, + 0x460, 0x569, 0x663, 0x76a, 0x66, 0x16f, 0x265, 0x36c, 0xc6c, 0xd65, 0xe6f, 0xf66, 0x86a, 0x963, 0xa69, 0xb60, + 0x5f0, 0x4f9, 0x7f3, 0x6fa, 0x1f6, 0xff, 0x3f5, 0x2fc, 0xdfc, 0xcf5, 0xfff, 0xef6, 0x9fa, 0x8f3, 0xbf9, 0xaf0, + 0x650, 0x759, 0x453, 0x55a, 0x256, 0x35f, 0x55, 0x15c, 0xe5c, 0xf55, 0xc5f, 0xd56, 0xa5a, 0xb53, 0x859, 0x950, + 0x7c0, 0x6c9, 0x5c3, 0x4ca, 0x3c6, 0x2cf, 0x1c5, 0xcc, 0xfcc, 0xec5, 0xdcf, 0xcc6, 0xbca, 0xac3, 0x9c9, 0x8c0, + 0x8c0, 0x9c9, 0xac3, 0xbca, 0xcc6, 0xdcf, 0xec5, 0xfcc, 0xcc, 0x1c5, 0x2cf, 0x3c6, 0x4ca, 0x5c3, 0x6c9, 0x7c0, + 0x950, 0x859, 0xb53, 0xa5a, 0xd56, 0xc5f, 0xf55, 0xe5c, 0x15c, 0x55, 0x35f, 0x256, 0x55a, 0x453, 0x759, 0x650, + 0xaf0, 0xbf9, 0x8f3, 0x9fa, 0xef6, 0xfff, 0xcf5, 0xdfc, 0x2fc, 0x3f5, 0xff, 0x1f6, 0x6fa, 0x7f3, 0x4f9, 0x5f0, + 0xb60, 0xa69, 0x963, 0x86a, 0xf66, 0xe6f, 0xd65, 0xc6c, 0x36c, 0x265, 0x16f, 0x66, 0x76a, 0x663, 0x569, 0x460, + 0xca0, 0xda9, 0xea3, 0xfaa, 0x8a6, 0x9af, 0xaa5, 0xbac, 0x4ac, 0x5a5, 0x6af, 0x7a6, 0xaa, 0x1a3, 0x2a9, 0x3a0, + 0xd30, 0xc39, 0xf33, 0xe3a, 0x936, 0x83f, 0xb35, 0xa3c, 0x53c, 0x435, 0x73f, 0x636, 0x13a, 0x33, 0x339, 0x230, + 0xe90, 0xf99, 0xc93, 0xd9a, 0xa96, 0xb9f, 0x895, 0x99c, 0x69c, 0x795, 0x49f, 0x596, 0x29a, 0x393, 0x99, 0x190, + 0xf00, 0xe09, 0xd03, 0xc0a, 0xb06, 0xa0f, 0x905, 0x80c, 0x70c, 0x605, 0x50f, 0x406, 0x30a, 0x203, 0x109, 0x0 + }; + +#include "NMR_MarchingCubesTriTable.inc" + } + + void extractIsoSurfaceMarchingCubes( + _In_ CMesh * pResultMesh, + _In_ const std::vector & fieldValues, + _In_ int resolution, + _In_ const std::array & minCorner, + _In_ const std::array & maxCorner) + { + if (!pResultMesh || resolution < 2) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + const int nx = resolution - 1; + const int ny = resolution - 1; + const int nz = resolution - 1; + const int vnx = resolution; + const int vny = resolution; + const int vnz = resolution; + + const std::array delta = { + (maxCorner[0] - minCorner[0]) / static_cast(resolution - 1), + (maxCorner[1] - minCorner[1]) / static_cast(resolution - 1), + (maxCorner[2] - minCorner[2]) / static_cast(resolution - 1) + }; + + auto valueIndex = [vnx, vny](int x, int y, int z) -> size_t { + return static_cast(x) + + static_cast(vnx) * (static_cast(y) + static_cast(vny) * static_cast(z)); + }; + + const int cornerOffset[8][3] = { + {0, 0, 0}, {1, 0, 0}, {1, 1, 0}, {0, 1, 0}, + {0, 0, 1}, {1, 0, 1}, {1, 1, 1}, {0, 1, 1} + }; + const int edgeToCorners[12][2] = { + {0, 1}, {1, 2}, {2, 3}, {3, 0}, + {4, 5}, {5, 6}, {6, 7}, {7, 4}, + {0, 4}, {1, 5}, {2, 6}, {3, 7} + }; + + const size_t xEdgeCount = static_cast(nx) * static_cast(vny) * static_cast(vnz); + const size_t yEdgeCount = static_cast(vnx) * static_cast(ny) * static_cast(vnz); + const size_t zEdgeCount = static_cast(vnx) * static_cast(vny) * static_cast(nz); + std::vector xEdge(xEdgeCount, -1); + std::vector yEdge(yEdgeCount, -1); + std::vector zEdge(zEdgeCount, -1); + std::vector meshNodes; + + auto xEdgeIndex = [nx, vny](int ex, int ey, int ez) -> size_t { + return static_cast(ex) + + static_cast(nx) * (static_cast(ey) + static_cast(vny) * static_cast(ez)); + }; + auto yEdgeIndex = [vnx, ny](int ex, int ey, int ez) -> size_t { + return static_cast(ex) + + static_cast(vnx) * (static_cast(ey) + static_cast(ny) * static_cast(ez)); + }; + auto zEdgeIndex = [vnx, vny](int ex, int ey, int ez) -> size_t { + return static_cast(ex) + + static_cast(vnx) * (static_cast(ey) + static_cast(vny) * static_cast(ez)); + }; + + auto cornerValue = [&](int cx, int cy, int cz, int corner) -> double { + const int gx = cx + cornerOffset[corner][0]; + const int gy = cy + cornerOffset[corner][1]; + const int gz = cz + cornerOffset[corner][2]; + return fieldValues[valueIndex(gx, gy, gz)]; + }; + + auto cornerPosition = [&](int cx, int cy, int cz, int corner) -> std::array { + const int gx = cx + cornerOffset[corner][0]; + const int gy = cy + cornerOffset[corner][1]; + const int gz = cz + cornerOffset[corner][2]; + return { + minCorner[0] + static_cast(gx) * delta[0], + minCorner[1] + static_cast(gy) * delta[1], + minCorner[2] + static_cast(gz) * delta[2] + }; + }; + + auto edgeVertex = [&](int cx, int cy, int cz, int edge) -> int { + int * pSlot = nullptr; + switch (edge) { + case 0: pSlot = &xEdge[xEdgeIndex(cx, cy, cz)]; break; + case 2: pSlot = &xEdge[xEdgeIndex(cx, cy + 1, cz)]; break; + case 4: pSlot = &xEdge[xEdgeIndex(cx, cy, cz + 1)]; break; + case 6: pSlot = &xEdge[xEdgeIndex(cx, cy + 1, cz + 1)]; break; + case 3: pSlot = &yEdge[yEdgeIndex(cx, cy, cz)]; break; + case 1: pSlot = &yEdge[yEdgeIndex(cx + 1, cy, cz)]; break; + case 7: pSlot = &yEdge[yEdgeIndex(cx, cy, cz + 1)]; break; + case 5: pSlot = &yEdge[yEdgeIndex(cx + 1, cy, cz + 1)]; break; + case 8: pSlot = &zEdge[zEdgeIndex(cx, cy, cz)]; break; + case 9: pSlot = &zEdge[zEdgeIndex(cx + 1, cy, cz)]; break; + case 11: pSlot = &zEdge[zEdgeIndex(cx, cy + 1, cz)]; break; + case 10: pSlot = &zEdge[zEdgeIndex(cx + 1, cy + 1, cz)]; break; + default: break; + } + + if (pSlot && *pSlot >= 0) + return *pSlot; + + const int c0 = edgeToCorners[edge][0]; + const int c1 = edgeToCorners[edge][1]; + const auto p0 = cornerPosition(cx, cy, cz, c0); + const auto p1 = cornerPosition(cx, cy, cz, c1); + const double v0 = cornerValue(cx, cy, cz, c0); + const double v1 = cornerValue(cx, cy, cz, c1); + const auto p = interpolateIso0(p0, p1, v0, v1); + + auto * pNode = pResultMesh->addNode(static_cast(p[0]), static_cast(p[1]), static_cast(p[2])); + const int nNodeIdx = static_cast(meshNodes.size()); + meshNodes.push_back(pNode); + if (pSlot) + *pSlot = nNodeIdx; + return nNodeIdx; + }; + + for (int cz = 0; cz < nz; ++cz) { + for (int cy = 0; cy < ny; ++cy) { + for (int cx = 0; cx < nx; ++cx) { + int cubeIndex = 0; + for (int corner = 0; corner < 8; ++corner) { + if (cornerValue(cx, cy, cz, corner) >= 0.0) + cubeIndex |= (1 << corner); + } + + const int edgeMask = kMcEdgeTable[cubeIndex]; + if (edgeMask == 0) + continue; + + int edgeNodes[12] = { 0 }; + for (int edge = 0; edge < 12; ++edge) { + if (edgeMask & (1 << edge)) + edgeNodes[edge] = edgeVertex(cx, cy, cz, edge); + } + + const int * pTriangles = kMcTriTable[cubeIndex]; + for (int t = 0; pTriangles[t] != -1; t += 3) { + const int ia = edgeNodes[pTriangles[t]]; + const int ib = edgeNodes[pTriangles[t + 1]]; + const int ic = edgeNodes[pTriangles[t + 2]]; + if (ia == ib || ib == ic || ic == ia) + continue; + pResultMesh->addFace(meshNodes[ia], meshNodes[ib], meshNodes[ic]); + } + } + } + } + } + +} diff --git a/Source/Common/Boolean/NMR_MarchingCubesTriTable.inc b/Source/Common/Boolean/NMR_MarchingCubesTriTable.inc new file mode 100644 index 000000000..0ab1f3058 --- /dev/null +++ b/Source/Common/Boolean/NMR_MarchingCubesTriTable.inc @@ -0,0 +1,292 @@ +/*++ + +Copyright (C) 2026 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +Marching-cubes triangle table used by boolean surface extraction. + +--*/ + +// clang-format off +static const int kMcTriTable[256][16] = { +{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{0,8,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{0,1,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{1,8,3,9,8,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{0,8,3,1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{9,2,10,0,2,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{2,8,3,2,10,8,10,9,8,-1,-1,-1,-1,-1,-1,-1}, +{3,11,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{0,11,2,8,11,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{1,9,0,2,3,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{1,11,2,1,9,11,9,8,11,-1,-1,-1,-1,-1,-1,-1}, +{3,10,1,11,10,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{0,10,1,0,8,10,8,11,10,-1,-1,-1,-1,-1,-1,-1}, +{3,9,0,3,11,9,11,10,9,-1,-1,-1,-1,-1,-1,-1}, +{9,8,10,10,8,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{4,7,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{4,3,0,7,3,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{0,1,9,8,4,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{4,1,9,4,7,1,7,3,1,-1,-1,-1,-1,-1,-1,-1}, +{1,2,10,8,4,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{3,4,7,3,0,4,1,2,10,-1,-1,-1,-1,-1,-1,-1}, +{9,2,10,9,0,2,8,4,7,-1,-1,-1,-1,-1,-1,-1}, +{2,10,9,2,9,7,2,7,3,7,9,4,-1,-1,-1,-1}, +{8,4,7,3,11,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{11,4,7,11,2,4,2,0,4,-1,-1,-1,-1,-1,-1,-1}, +{9,0,1,8,4,7,2,3,11,-1,-1,-1,-1,-1,-1,-1}, +{4,7,11,9,4,11,9,11,2,9,2,1,-1,-1,-1,-1}, +{3,10,1,3,11,10,7,8,4,-1,-1,-1,-1,-1,-1,-1}, +{1,11,10,1,4,11,1,0,4,7,11,4,-1,-1,-1,-1}, +{4,7,8,9,0,11,9,11,10,11,0,3,-1,-1,-1,-1}, +{4,7,11,4,11,9,9,11,10,-1,-1,-1,-1,-1,-1,-1}, +{9,5,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{9,5,4,0,8,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{0,5,4,1,5,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{8,5,4,8,3,5,3,1,5,-1,-1,-1,-1,-1,-1,-1}, +{1,2,10,9,5,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{3,0,8,1,2,10,4,9,5,-1,-1,-1,-1,-1,-1,-1}, +{5,2,10,5,4,2,4,0,2,-1,-1,-1,-1,-1,-1,-1}, +{2,10,5,3,2,5,3,5,4,3,4,8,-1,-1,-1,-1}, +{9,5,4,2,3,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{0,11,2,0,8,11,4,9,5,-1,-1,-1,-1,-1,-1,-1}, +{0,5,4,0,1,5,2,3,11,-1,-1,-1,-1,-1,-1,-1}, +{2,1,5,2,5,8,2,8,11,4,8,5,-1,-1,-1,-1}, +{10,3,11,10,1,3,9,5,4,-1,-1,-1,-1,-1,-1,-1}, +{4,9,5,0,8,1,8,10,1,8,11,10,-1,-1,-1,-1}, +{5,4,0,5,0,11,5,11,10,11,0,3,-1,-1,-1,-1}, +{5,4,8,5,8,10,10,8,11,-1,-1,-1,-1,-1,-1,-1}, +{9,7,8,5,7,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{9,3,0,9,5,3,5,7,3,-1,-1,-1,-1,-1,-1,-1}, +{0,7,8,0,1,7,1,5,7,-1,-1,-1,-1,-1,-1,-1}, +{1,5,3,3,5,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{9,7,8,9,5,7,10,1,2,-1,-1,-1,-1,-1,-1,-1}, +{10,1,2,9,5,0,5,3,0,5,7,3,-1,-1,-1,-1}, +{8,0,2,8,2,5,8,5,7,10,5,2,-1,-1,-1,-1}, +{2,10,5,2,5,3,3,5,7,-1,-1,-1,-1,-1,-1,-1}, +{7,9,5,7,8,9,3,11,2,-1,-1,-1,-1,-1,-1,-1}, +{9,5,7,9,7,2,9,2,0,2,7,11,-1,-1,-1,-1}, +{2,3,11,0,1,8,1,7,8,1,5,7,-1,-1,-1,-1}, +{11,2,1,11,1,7,7,1,5,-1,-1,-1,-1,-1,-1,-1}, +{9,5,8,8,5,7,10,1,3,10,3,11,-1,-1,-1,-1}, +{5,7,0,5,0,9,7,11,0,1,0,10,11,10,0,-1}, +{11,10,0,11,0,3,10,5,0,8,0,7,5,7,0,-1}, +{11,10,5,7,11,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{10,6,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{0,8,3,5,10,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{9,0,1,5,10,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{1,8,3,1,9,8,5,10,6,-1,-1,-1,-1,-1,-1,-1}, +{1,6,5,2,6,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{1,6,5,1,2,6,3,0,8,-1,-1,-1,-1,-1,-1,-1}, +{9,6,5,9,0,6,0,2,6,-1,-1,-1,-1,-1,-1,-1}, +{5,9,8,5,8,2,5,2,6,3,2,8,-1,-1,-1,-1}, +{2,3,11,10,6,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{11,0,8,11,2,0,10,6,5,-1,-1,-1,-1,-1,-1,-1}, +{0,1,9,2,3,11,5,10,6,-1,-1,-1,-1,-1,-1,-1}, +{5,10,6,1,9,2,9,11,2,9,8,11,-1,-1,-1,-1}, +{6,3,11,6,5,3,5,1,3,-1,-1,-1,-1,-1,-1,-1}, +{0,8,11,0,11,5,0,5,1,5,11,6,-1,-1,-1,-1}, +{3,11,6,0,3,6,0,6,5,0,5,9,-1,-1,-1,-1}, +{6,5,9,6,9,11,11,9,8,-1,-1,-1,-1,-1,-1,-1}, +{5,10,6,4,7,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{4,3,0,4,7,3,6,5,10,-1,-1,-1,-1,-1,-1,-1}, +{1,9,0,5,10,6,8,4,7,-1,-1,-1,-1,-1,-1,-1}, +{10,6,5,1,9,7,1,7,3,7,9,4,-1,-1,-1,-1}, +{6,1,2,6,5,1,4,7,8,-1,-1,-1,-1,-1,-1,-1}, +{1,2,5,5,2,6,3,0,4,3,4,7,-1,-1,-1,-1}, +{8,4,7,9,0,5,0,6,5,0,2,6,-1,-1,-1,-1}, +{7,3,9,7,9,4,3,2,9,5,9,6,2,6,9,-1}, +{3,11,2,7,8,4,10,6,5,-1,-1,-1,-1,-1,-1,-1}, +{5,10,6,4,7,2,4,2,0,2,7,11,-1,-1,-1,-1}, +{0,1,9,4,7,8,2,3,11,5,10,6,-1,-1,-1,-1}, +{9,2,1,9,11,2,9,4,11,7,11,4,5,10,6,-1}, +{8,4,7,3,11,5,3,5,1,5,11,6,-1,-1,-1,-1}, +{5,1,11,5,11,6,1,0,11,7,11,4,0,4,11,-1}, +{0,5,9,0,6,5,0,3,6,11,6,3,8,4,7,-1}, +{6,5,9,6,9,11,4,7,9,7,11,9,-1,-1,-1,-1}, +{10,4,9,6,4,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{4,10,6,4,9,10,0,8,3,-1,-1,-1,-1,-1,-1,-1}, +{10,0,1,10,6,0,6,4,0,-1,-1,-1,-1,-1,-1,-1}, +{8,3,1,8,1,6,8,6,4,6,1,10,-1,-1,-1,-1}, +{1,4,9,1,2,4,2,6,4,-1,-1,-1,-1,-1,-1,-1}, +{3,0,8,1,2,9,2,4,9,2,6,4,-1,-1,-1,-1}, +{0,2,4,4,2,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{8,3,2,8,2,4,4,2,6,-1,-1,-1,-1,-1,-1,-1}, +{10,4,9,10,6,4,11,2,3,-1,-1,-1,-1,-1,-1,-1}, +{0,8,2,2,8,11,4,9,10,4,10,6,-1,-1,-1,-1}, +{3,11,2,0,1,6,0,6,4,6,1,10,-1,-1,-1,-1}, +{6,4,1,6,1,10,4,8,1,2,1,11,8,11,1,-1}, +{9,6,4,9,3,6,9,1,3,11,6,3,-1,-1,-1,-1}, +{8,11,1,8,1,0,11,6,1,9,1,4,6,4,1,-1}, +{3,11,6,3,6,0,0,6,4,-1,-1,-1,-1,-1,-1,-1}, +{6,4,8,11,6,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{7,10,6,7,8,10,8,9,10,-1,-1,-1,-1,-1,-1,-1}, +{0,7,3,0,10,7,0,9,10,6,7,10,-1,-1,-1,-1}, +{10,6,7,1,10,7,1,7,8,1,8,0,-1,-1,-1,-1}, +{10,6,7,10,7,1,1,7,3,-1,-1,-1,-1,-1,-1,-1}, +{1,2,6,1,6,8,1,8,9,8,6,7,-1,-1,-1,-1}, +{2,6,9,2,9,1,6,7,9,0,9,3,7,3,9,-1}, +{7,8,0,7,0,6,6,0,2,-1,-1,-1,-1,-1,-1,-1}, +{7,3,2,6,7,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{2,3,11,10,6,8,10,8,9,8,6,7,-1,-1,-1,-1}, +{2,0,7,2,7,11,0,9,7,6,7,10,9,10,7,-1}, +{1,8,0,1,7,8,1,10,7,6,7,10,2,3,11,-1}, +{11,2,1,11,1,7,10,6,1,6,7,1,-1,-1,-1,-1}, +{8,9,6,8,6,7,9,1,6,11,6,3,1,3,6,-1}, +{0,9,1,11,6,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{7,8,0,7,0,6,3,11,0,11,6,0,-1,-1,-1,-1}, +{7,11,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{7,6,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{3,0,8,11,7,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{0,1,9,11,7,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{8,1,9,8,3,1,11,7,6,-1,-1,-1,-1,-1,-1,-1}, +{10,1,2,6,11,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{1,2,10,3,0,8,6,11,7,-1,-1,-1,-1,-1,-1,-1}, +{2,9,0,2,10,9,6,11,7,-1,-1,-1,-1,-1,-1,-1}, +{6,11,7,2,10,3,10,8,3,10,9,8,-1,-1,-1,-1}, +{7,2,3,6,2,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{7,0,8,7,6,0,6,2,0,-1,-1,-1,-1,-1,-1,-1}, +{2,7,6,2,3,7,0,1,9,-1,-1,-1,-1,-1,-1,-1}, +{1,6,2,1,8,6,1,9,8,8,7,6,-1,-1,-1,-1}, +{10,7,6,10,1,7,1,3,7,-1,-1,-1,-1,-1,-1,-1}, +{10,7,6,1,7,10,1,8,7,1,0,8,-1,-1,-1,-1}, +{0,3,7,0,7,10,0,10,9,6,10,7,-1,-1,-1,-1}, +{7,6,10,7,10,8,8,10,9,-1,-1,-1,-1,-1,-1,-1}, +{6,8,4,11,8,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{3,6,11,3,0,6,0,4,6,-1,-1,-1,-1,-1,-1,-1}, +{8,6,11,8,4,6,9,0,1,-1,-1,-1,-1,-1,-1,-1}, +{9,4,6,9,6,3,9,3,1,11,3,6,-1,-1,-1,-1}, +{6,8,4,6,11,8,2,10,1,-1,-1,-1,-1,-1,-1,-1}, +{1,2,10,3,0,11,0,6,11,0,4,6,-1,-1,-1,-1}, +{4,11,8,4,6,11,0,2,9,2,10,9,-1,-1,-1,-1}, +{10,9,3,10,3,2,9,4,3,11,3,6,4,6,3,-1}, +{8,2,3,8,4,2,4,6,2,-1,-1,-1,-1,-1,-1,-1}, +{0,4,2,4,6,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{1,9,0,2,3,4,2,4,6,4,3,8,-1,-1,-1,-1}, +{1,9,4,1,4,2,2,4,6,-1,-1,-1,-1,-1,-1,-1}, +{8,1,3,8,6,1,8,4,6,6,10,1,-1,-1,-1,-1}, +{10,1,0,10,0,6,6,0,4,-1,-1,-1,-1,-1,-1,-1}, +{4,6,3,4,3,8,6,10,3,0,3,9,10,9,3,-1}, +{10,9,4,6,10,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{4,9,5,7,6,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{0,8,3,4,9,5,11,7,6,-1,-1,-1,-1,-1,-1,-1}, +{5,0,1,5,4,0,7,6,11,-1,-1,-1,-1,-1,-1,-1}, +{11,7,6,8,3,4,3,5,4,3,1,5,-1,-1,-1,-1}, +{9,5,4,10,1,2,7,6,11,-1,-1,-1,-1,-1,-1,-1}, +{6,11,7,1,2,10,0,8,3,4,9,5,-1,-1,-1,-1}, +{7,6,11,5,4,10,4,2,10,4,0,2,-1,-1,-1,-1}, +{3,4,8,3,5,4,3,2,5,10,5,2,11,7,6,-1}, +{7,2,3,7,6,2,5,4,9,-1,-1,-1,-1,-1,-1,-1}, +{9,5,4,0,8,6,0,6,2,6,8,7,-1,-1,-1,-1}, +{3,6,2,3,7,6,1,5,0,5,4,0,-1,-1,-1,-1}, +{6,2,8,6,8,7,2,1,8,4,8,5,1,5,8,-1}, +{9,5,4,10,1,6,1,7,6,1,3,7,-1,-1,-1,-1}, +{1,6,10,1,7,6,1,0,7,8,7,0,9,5,4,-1}, +{4,0,10,4,10,5,0,3,10,6,10,7,3,7,10,-1}, +{7,6,10,7,10,8,5,4,10,4,8,10,-1,-1,-1,-1}, +{6,9,5,6,11,9,11,8,9,-1,-1,-1,-1,-1,-1,-1}, +{3,6,11,0,6,3,0,5,6,0,9,5,-1,-1,-1,-1}, +{0,11,8,0,5,11,0,1,5,5,6,11,-1,-1,-1,-1}, +{6,11,3,6,3,5,5,3,1,-1,-1,-1,-1,-1,-1,-1}, +{1,2,10,9,5,11,9,11,8,11,5,6,-1,-1,-1,-1}, +{0,11,3,0,6,11,0,9,6,5,6,9,1,2,10,-1}, +{11,8,5,11,5,6,8,0,5,10,5,2,0,2,5,-1}, +{6,11,3,6,3,5,2,10,3,10,5,3,-1,-1,-1,-1}, +{5,8,9,5,2,8,5,6,2,3,8,2,-1,-1,-1,-1}, +{9,5,6,9,6,0,0,6,2,-1,-1,-1,-1,-1,-1,-1}, +{1,5,8,1,8,0,5,6,8,3,8,2,6,2,8,-1}, +{1,5,6,2,1,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{1,3,6,1,6,10,3,8,6,5,6,9,8,9,6,-1}, +{10,1,0,10,0,6,9,5,0,5,6,0,-1,-1,-1,-1}, +{0,3,8,5,6,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{10,5,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{11,5,10,7,5,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{11,5,10,11,7,5,8,3,0,-1,-1,-1,-1,-1,-1,-1}, +{5,11,7,5,10,11,1,9,0,-1,-1,-1,-1,-1,-1,-1}, +{10,7,5,10,11,7,9,8,1,8,3,1,-1,-1,-1,-1}, +{11,1,2,11,7,1,7,5,1,-1,-1,-1,-1,-1,-1,-1}, +{0,8,3,1,2,7,1,7,5,7,2,11,-1,-1,-1,-1}, +{9,7,5,9,2,7,9,0,2,2,11,7,-1,-1,-1,-1}, +{7,5,2,7,2,11,5,9,2,3,2,8,9,8,2,-1}, +{2,5,10,2,3,5,3,7,5,-1,-1,-1,-1,-1,-1,-1}, +{8,2,0,8,5,2,8,7,5,10,2,5,-1,-1,-1,-1}, +{9,0,1,5,10,3,5,3,7,3,10,2,-1,-1,-1,-1}, +{9,8,2,9,2,1,8,7,2,10,2,5,7,5,2,-1}, +{1,3,5,3,7,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{0,8,7,0,7,1,1,7,5,-1,-1,-1,-1,-1,-1,-1}, +{9,0,3,9,3,5,5,3,7,-1,-1,-1,-1,-1,-1,-1}, +{9,8,7,5,9,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{5,8,4,5,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1}, +{5,0,4,5,11,0,5,10,11,11,3,0,-1,-1,-1,-1}, +{0,1,9,8,4,10,8,10,11,10,4,5,-1,-1,-1,-1}, +{10,11,4,10,4,5,11,3,4,9,4,1,3,1,4,-1}, +{2,5,1,2,8,5,2,11,8,4,5,8,-1,-1,-1,-1}, +{0,4,11,0,11,3,4,5,11,2,11,1,5,1,11,-1}, +{0,2,5,0,5,9,2,11,5,4,5,8,11,8,5,-1}, +{9,4,5,2,11,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{2,5,10,3,5,2,3,4,5,3,8,4,-1,-1,-1,-1}, +{5,10,2,5,2,4,4,2,0,-1,-1,-1,-1,-1,-1,-1}, +{3,10,2,3,5,10,3,8,5,4,5,8,0,1,9,-1}, +{5,10,2,5,2,4,1,9,2,9,4,2,-1,-1,-1,-1}, +{8,4,5,8,5,3,3,5,1,-1,-1,-1,-1,-1,-1,-1}, +{0,4,5,1,0,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{8,4,5,8,5,3,9,0,5,0,3,5,-1,-1,-1,-1}, +{9,4,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{4,11,7,4,9,11,9,10,11,-1,-1,-1,-1,-1,-1,-1}, +{0,8,3,4,9,7,9,11,7,9,10,11,-1,-1,-1,-1}, +{1,10,11,1,11,4,1,4,0,7,4,11,-1,-1,-1,-1}, +{3,1,4,3,4,8,1,10,4,7,4,11,10,11,4,-1}, +{4,11,7,9,11,4,9,2,11,9,1,2,-1,-1,-1,-1}, +{9,7,4,9,11,7,9,1,11,2,11,1,0,8,3,-1}, +{11,7,4,11,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1}, +{11,7,4,11,4,2,8,3,4,3,2,4,-1,-1,-1,-1}, +{2,9,10,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1}, +{9,10,7,9,7,4,10,2,7,8,7,0,2,0,7,-1}, +{3,7,10,3,10,2,7,4,10,1,10,0,4,0,10,-1}, +{1,10,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1}, +{4,9,1,4,1,7,0,8,1,8,7,1,-1,-1,-1,-1}, +{4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{4,8,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{9,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{3,0,9,3,9,11,11,9,10,-1,-1,-1,-1,-1,-1,-1}, +{0,1,10,0,10,8,8,10,11,-1,-1,-1,-1,-1,-1,-1}, +{3,1,10,11,3,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{1,2,11,1,11,9,9,11,8,-1,-1,-1,-1,-1,-1,-1}, +{3,0,9,3,9,11,1,2,9,2,11,9,-1,-1,-1,-1}, +{0,2,11,8,0,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{3,2,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{2,3,8,2,8,10,10,8,9,-1,-1,-1,-1,-1,-1,-1}, +{9,10,2,0,9,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{2,3,8,2,8,10,0,1,8,1,10,8,-1,-1,-1,-1}, +{1,10,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, +{0,3,8,-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} +}; +// clang-format on diff --git a/Source/Common/NMR_Exception.cpp b/Source/Common/NMR_Exception.cpp index 706f8bb83..d34614c35 100644 --- a/Source/Common/NMR_Exception.cpp +++ b/Source/Common/NMR_Exception.cpp @@ -369,6 +369,7 @@ namespace NMR { case NMR_ERROR_INVALIDOBJECTLEVELPID: return "A MeshObject with triangle-properties has an invalid object-level property."; case NMR_ERROR_BUILDITEMOBJECT_MUSTNOTBE_OTHER: return "Build-item must not reference object of type OTHER."; case NMR_ERROR_OBJECTLEVELPID_ON_COMPONENTSOBJECT: return "A components object must not have an object-level PID."; + case NMR_ERROR_OBJECTLEVELPID_ON_BOOLEANOBJECT: return "A boolean object must not have an object-level PID."; case NMR_ERROR_BEAMLATTICENODESTOOCLOSE: return "Nodes used for a beam are closer then the specified minimal length."; case NMR_ERROR_BEAMLATTICE_INVALID_REPRESENTATIONRESOURCE: return "The resource defined as representationmesh is invalid."; case NMR_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE: return "Beamlattice is defined on wrong object type."; @@ -560,7 +561,7 @@ namespace NMR { } } - CNMRException::CNMRException(_In_ nfError errorcode) : m_errorcode(errorcode), std::exception() + CNMRException::CNMRException(_In_ nfError errorcode) : std::exception(), m_errorcode(errorcode) { m_message = errorCodeToMessage(errorcode); } diff --git a/Source/Common/Winding/NMR_WindingNumber.cpp b/Source/Common/Winding/NMR_WindingNumber.cpp new file mode 100644 index 000000000..483f94fc5 --- /dev/null +++ b/Source/Common/Winding/NMR_WindingNumber.cpp @@ -0,0 +1,1352 @@ +/*++ + +Copyright (C) 2026 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +Internal generalized winding number helper used by boolean processing. +Copyright remains with 3MF Consortium; this file is licensed under +the BSD terms above for inclusion in lib3mf. + +--*/ + +#include "Common/Winding/NMR_WindingNumber.h" + +#include +#include +#include +#include +#include +#include + +#if defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86) + #define TG_X86 1 +#else + #define TG_X86 0 +#endif + +#if TG_X86 && (defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER)) + #include +#endif + +#if defined(TGWN_DISABLE_AVX2) + #define TG_HAS_AVX2 0 +#elif TG_X86 && (defined(__GNUC__) || defined(__clang__)) + #define TG_HAS_AVX2 1 +#elif TG_X86 && defined(_MSC_VER) && defined(__AVX2__) + #define TG_HAS_AVX2 1 +#else + #define TG_HAS_AVX2 0 +#endif + +#define TINYBVH_IMPLEMENTATION +#include "tiny_bvh.h" +#include "nanoflann.hpp" + +namespace tg { + // Implementation details: + // - Builds a BVH over triangles (mesh) or points (point cloud). + // - Stores Taylor expansion moments per BVH node. + // - Evaluates using approximation for far nodes and exact contributions for leaves. + struct windingNumber::Impl { + using Point = windingNumber::Point; + using Triangle = std::array; + + struct vec3 { + double x, y, z; + + vec3() : x(0), y(0), z(0) { + } + + vec3(double X, double Y, double Z) : x(X), y(Y), z(Z) { + } + + vec3 operator+(const vec3 &o) const { return {x + o.x, y + o.y, z + o.z}; } + vec3 operator-(const vec3 &o) const { return {x - o.x, y - o.y, z - o.z}; } + vec3 operator*(double s) const { return {x * s, y * s, z * s}; } + }; + + struct aabb { + vec3 mn, mx; + }; + + // Per-node aggregates for Taylor expansion about averageP. + // N = area-weighted normal sum (mesh) or dipole sum (points). + // Nij/Nijk terms match the "Fast Winding Numbers for Soups and Clouds" expansion. + struct nodeAgg { + bool isLeaf = false; + uint64_t left = 0, right = 0; + uint64_t firstPrim = 0, primCount = 0; + + vec3 averageP{}, N{}; + double maxPDist2 = 0.0; + + vec3 NijDiag{}; + double Nxy_Nyx = 0, Nyz_Nzy = 0, Nzx_Nxz = 0; + + vec3 NijkDiag{}; + double sumPermuteNxyz = 0; + double twoNxxy_Nyxx = 0, twoNxxz_Nzxx = 0; + double twoNyyz_Nzyy = 0, twoNyyx_Nxyy = 0; + double twoNzzx_Nxzz = 0, twoNzzy_Nyzz = 0; + }; + + // Temporary build data used while constructing aggregates bottom-up. + struct buildData { + aabb box{}; + vec3 averageP{}, areaP{}, N{}; + double area = 0, maxPDist2 = 0; + + vec3 NijDiag{}; + double Nxy = 0, Nyx = 0, Nyz = 0, Nzy = 0, Nzx = 0, Nxz = 0; + + vec3 NijkDiag{}; + double sumPermuteNxyz = 0; + double twoNxxy_Nyxx = 0, twoNxxz_Nzxx = 0; + double twoNyyz_Nzyy = 0, twoNyyx_Nxyy = 0; + double twoNzzx_Nxzz = 0, twoNzzy_Nyzz = 0; + }; + + // KD-tree adaptor for nanoflann (point cloud normal/area estimation). + struct PointCloudAdaptor { + const std::vector *pts; + + PointCloudAdaptor(const std::vector &p) : pts(&p) { + } + + size_t kdtree_get_point_count() const { return pts->size(); } + double kdtree_get_pt(size_t idx, size_t dim) const { return (*pts)[idx][dim]; } + + template + bool kdtree_get_bbox(BBOX &) const { return false; } + }; + + using KDTree = nanoflann::KDTreeSingleIndexAdaptor< + nanoflann::L2_Simple_Adaptor, + PointCloudAdaptor, 3, size_t>; + + enum class Mode { Mesh, PointCloud }; + + Mode mode = Mode::Mesh; + + Settings settings; + + // Mesh data (triangle soup). + std::vector vertices; + std::vector triangles; + std::vector triVecArea, triCentroid; + std::vector triBounds; + + // Point cloud data (oriented points). + std::vector cloudPoints; + std::vector cloudNormals; // Unit normals. + std::vector cloudAreas; // Area per point. + std::vector cloudDipoles; // Area-weighted normal (A * n). + std::vector cloudBounds; // Degenerate AABB per point. + + // BVH (shared for mesh and point cloud modes). + tinybvh::BVH_Double bvh; + std::vector triVertsPacked; // For mesh mode + std::vector nodes; + + static constexpr double pi() { return 3.141592653589793238462643383279502884; } + static constexpr int kPacketSize = 4; + + static vec3 toVec3(const Point &v) { return {v[0], v[1], v[2]}; } + static double dot(const vec3 &a, const vec3 &b) { return a.x * b.x + a.y * b.y + a.z * b.z; } + + static vec3 cross(const vec3 &a, const vec3 &b) { + return {a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x}; + } + + static double norm(const vec3 &a) { return std::sqrt(dot(a, a)); } + + static aabb triAabb(const vec3 &a, const vec3 &b, const vec3 &c) { + return { + {std::min({a.x, b.x, c.x}), std::min({a.y, b.y, c.y}), std::min({a.z, b.z, c.z})}, + {std::max({a.x, b.x, c.x}), std::max({a.y, b.y, c.y}), std::max({a.z, b.z, c.z})} + }; + } + + static vec3 aabbCenter(const aabb &bb) { return (bb.mn + bb.mx) * 0.5; } + + static aabb aabbUnion(const aabb &a, const aabb &b) { + return { + {std::min(a.mn.x, b.mn.x), std::min(a.mn.y, b.mn.y), std::min(a.mn.z, b.mn.z)}, + {std::max(a.mx.x, b.mx.x), std::max(a.mx.y, b.mx.y), std::max(a.mx.z, b.mx.z)} + }; + } + + static double maxPDist2FromBox(const aabb &bb, const vec3 &p) { + double dx = std::max(std::abs(p.x - bb.mn.x), std::abs(bb.mx.x - p.x)); + double dy = std::max(std::abs(p.y - bb.mn.y), std::abs(bb.mx.y - p.y)); + double dz = std::max(std::abs(p.z - bb.mn.z), std::abs(bb.mx.z - p.z)); + return dx * dx + dy * dy + dz * dz; + } + + uint64_t primIndex(uint64_t i) const { return bvh.primIdx[i]; } + + + // Estimate per-point normals using PCA on k nearest neighbors. + void estimateNormals(int k) { + size_t N = cloudPoints.size(); + cloudNormals.resize(N); + + PointCloudAdaptor adaptor(cloudPoints); + KDTree kdtree(3, adaptor, nanoflann::KDTreeSingleIndexAdaptorParams(10)); + kdtree.buildIndex(); + + // Compute centroid for orientation + vec3 centroid{}; + for (const auto &p: cloudPoints) { + centroid = centroid + toVec3(p); + } + centroid = centroid * (1.0 / N); + + std::vector indices(k + 1); + std::vector dists(k + 1); + + for (size_t i = 0; i < N; ++i) { + size_t found = kdtree.knnSearch(cloudPoints[i].data(), k + 1, indices.data(), dists.data()); + + // Compute local centroid of neighbors + vec3 localCentroid{}; + size_t count = 0; + for (size_t j = 0; j < found; ++j) { + localCentroid = localCentroid + toVec3(cloudPoints[indices[j]]); + ++count; + } + if (count > 0) localCentroid = localCentroid * (1.0 / count); + + // Build covariance matrix + double cov[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + for (size_t j = 0; j < found; ++j) { + vec3 d = toVec3(cloudPoints[indices[j]]) - localCentroid; + cov[0][0] += d.x * d.x; + cov[0][1] += d.x * d.y; + cov[0][2] += d.x * d.z; + cov[1][0] += d.y * d.x; + cov[1][1] += d.y * d.y; + cov[1][2] += d.y * d.z; + cov[2][0] += d.z * d.x; + cov[2][1] += d.z * d.y; + cov[2][2] += d.z * d.z; + } + + // Find smallest eigenvector using power iteration on inverse + // (or just use the cross product of two largest eigenvectors) + // Simplified: use iterative method to find normal + vec3 normal = computeSmallestEigenvector(cov); + + // Orient normal to point away from global centroid + vec3 toPoint = toVec3(cloudPoints[i]) - centroid; + if (dot(normal, toPoint) < 0) { + normal = normal * -1.0; + } + + cloudNormals[i] = normal; + } + } + + // Compute smallest eigenvector of 3x3 symmetric matrix using Jacobi iteration. + static vec3 computeSmallestEigenvector(double cov[3][3]) { + // Copy matrix + double a[3][3]; + double v[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; // Eigenvectors + + for (int i = 0; i < 3; ++i) + for (int j = 0; j < 3; ++j) + a[i][j] = cov[i][j]; + + // Jacobi iteration + for (int iter = 0; iter < 50; ++iter) { + // Find largest off-diagonal element + int p = 0, q = 1; + double maxVal = std::abs(a[0][1]); + if (std::abs(a[0][2]) > maxVal) { + maxVal = std::abs(a[0][2]); + p = 0; + q = 2; + } + if (std::abs(a[1][2]) > maxVal) { + maxVal = std::abs(a[1][2]); + p = 1; + q = 2; + } + + if (maxVal < 1e-15) break; + + // Compute rotation + double theta = 0.5 * std::atan2(2.0 * a[p][q], a[q][q] - a[p][p]); + double c = std::cos(theta), s = std::sin(theta); + + // Apply rotation to a + double app = a[p][p], aqq = a[q][q], apq = a[p][q]; + a[p][p] = c * c * app - 2 * c * s * apq + s * s * aqq; + a[q][q] = s * s * app + 2 * c * s * apq + c * c * aqq; + a[p][q] = a[q][p] = 0; + + for (int i = 0; i < 3; ++i) { + if (i != p && i != q) { + double aip = a[i][p], aiq = a[i][q]; + a[i][p] = a[p][i] = c * aip - s * aiq; + a[i][q] = a[q][i] = s * aip + c * aiq; + } + } + + // Apply rotation to eigenvectors + for (int i = 0; i < 3; ++i) { + double vip = v[i][p], viq = v[i][q]; + v[i][p] = c * vip - s * viq; + v[i][q] = s * vip + c * viq; + } + } + + // Find index of smallest eigenvalue + int minIdx = 0; + if (a[1][1] < a[minIdx][minIdx]) minIdx = 1; + if (a[2][2] < a[minIdx][minIdx]) minIdx = 2; + + vec3 normal{v[0][minIdx], v[1][minIdx], v[2][minIdx]}; + double len = norm(normal); + if (len > 0) normal = normal * (1.0 / len); + return normal; + } + + // Build mesh precomputes + BVH + per-node aggregates. + void build() { + size_t T = triangles.size(); + triVecArea.resize(T); + triCentroid.resize(T); + triBounds.resize(T); + triVertsPacked.clear(); + triVertsPacked.reserve(T * 3); + + for (size_t t = 0; t < T; ++t) { + const auto &idx = triangles[t]; + vec3 a = toVec3(vertices[idx[0]]); + vec3 b = toVec3(vertices[idx[1]]); + vec3 c = toVec3(vertices[idx[2]]); + triVecArea[t] = cross(b - a, c - a) * 0.5; + triCentroid[t] = (a + b + c) * (1.0 / 3.0); + triBounds[t] = triAabb(a, b, c); + triVertsPacked.emplace_back(a.x, a.y, a.z); + triVertsPacked.emplace_back(b.x, b.y, b.z); + triVertsPacked.emplace_back(c.x, c.y, c.z); + } + + bvh.Build(triVertsPacked.data(), (uint64_t) T); + buildAggregates(); + } + + // Estimate per-point areas using k-nearest neighbors. + void estimateAreas(int k) { + size_t N = cloudPoints.size(); + cloudAreas.resize(N); + + PointCloudAdaptor adaptor(cloudPoints); + KDTree kdtree(3, adaptor, nanoflann::KDTreeSingleIndexAdaptorParams(10)); + kdtree.buildIndex(); + + std::vector indices(k + 1); + std::vector dists(k + 1); + + for (size_t i = 0; i < N; ++i) { + // Query k+1 neighbors (includes self) + size_t found = kdtree.knnSearch(cloudPoints[i].data(), k + 1, indices.data(), dists.data()); + + // Average distance to neighbors (excluding self at index 0) + double avgDist = 0; + size_t count = 0; + for (size_t j = 1; j < found; ++j) { + avgDist += std::sqrt(dists[j]); + ++count; + } + if (count > 0) avgDist /= count; + + // Area ~ π * r² where r is average neighbor distance + // This gives area of a disk with radius = avgDist + cloudAreas[i] = pi() * avgDist * avgDist; + } + } + + // Build point cloud BVH + aggregates (dipole model). + void buildPointCloud() { + size_t N = cloudPoints.size(); + cloudNormals.resize(N); + cloudDipoles.resize(N); + cloudBounds.resize(N); + triVertsPacked.clear(); + triVertsPacked.reserve(N * 3); + + // Compute dipoles and create degenerate triangles for BVH + for (size_t i = 0; i < N; ++i) { + vec3 p = toVec3(cloudPoints[i]); + + // Dipole = area * normal + cloudDipoles[i] = cloudNormals[i] * cloudAreas[i]; + + // Degenerate AABB (point) + cloudBounds[i] = {p, p}; + + // Create a tiny degenerate triangle for BVH building + // All three vertices are the same point + triVertsPacked.emplace_back(p.x, p.y, p.z); + triVertsPacked.emplace_back(p.x, p.y, p.z); + triVertsPacked.emplace_back(p.x, p.y, p.z); + } + + bvh.Build(triVertsPacked.data(), (uint64_t) N); + buildAggregatesPointCloud(); + } + + // Build aggregates for point cloud mode (dipole moments). + void buildAggregatesPointCloud() { + uint64_t nodeCount = bvh.usedNodes; + nodes.assign(nodeCount, nodeAgg{}); + std::vector bd(nodeCount); + + for (uint64_t i = 0; i < nodeCount; ++i) { + const auto &n = bvh.bvhNode[i]; + auto &nd = nodes[i]; + nd.isLeaf = n.triCount > 0; + if (nd.isLeaf) { + nd.firstPrim = n.leftFirst; + nd.primCount = n.triCount; + } else { + nd.left = n.leftFirst; + nd.right = n.leftFirst + 1; + } + } + + int order = std::clamp(settings.taylorOrder, 0, 2); + + for (uint64_t i = nodeCount; i-- > 0;) { + auto &nd = nodes[i]; + auto &out = bd[i]; + + if (nd.isLeaf) { + bool hasBox = false; + vec3 areaP{}, Nsum{}; + double area = 0; + + for (uint64_t t = 0; t < nd.primCount; ++t) { + uint64_t ptId = primIndex(nd.firstPrim + t); + vec3 p = toVec3(cloudPoints[ptId]); + vec3 dipole = cloudDipoles[ptId]; + double ptArea = cloudAreas[ptId]; + + if (!hasBox) { + out.box = {p, p}; + hasBox = true; + } else { + out.box.mn.x = std::min(out.box.mn.x, p.x); + out.box.mn.y = std::min(out.box.mn.y, p.y); + out.box.mn.z = std::min(out.box.mn.z, p.z); + out.box.mx.x = std::max(out.box.mx.x, p.x); + out.box.mx.y = std::max(out.box.mx.y, p.y); + out.box.mx.z = std::max(out.box.mx.z, p.z); + } + + areaP = areaP + p * ptArea; + area += ptArea; + Nsum = Nsum + dipole; + } + + out.areaP = areaP; + out.area = area; + out.N = Nsum; + out.averageP = area > 0 ? areaP * (1 / area) : aabbCenter(out.box); + out.maxPDist2 = maxPDist2FromBox(out.box, out.averageP); + + // For points, Nijk terms about the point itself are zero + // We only need to apply the shift + for (uint64_t t = 0; t < nd.primCount; ++t) { + uint64_t ptId = primIndex(nd.firstPrim + t); + buildData child{}; + child.averageP = toVec3(cloudPoints[ptId]); + child.N = cloudDipoles[ptId]; + // Nij, Nijk are all zero for a single point about its own center + applyShift(out, child, child.averageP - out.averageP, order); + } + } else { + const auto &L = bd[nd.left]; + const auto &R = bd[nd.right]; + out.box = aabbUnion(L.box, R.box); + out.areaP = L.areaP + R.areaP; + out.area = L.area + R.area; + out.N = L.N + R.N; + out.averageP = out.area > 0 ? out.areaP * (1 / out.area) : aabbCenter(out.box); + out.maxPDist2 = maxPDist2FromBox(out.box, out.averageP); + + if (order >= 1) out.NijDiag = L.NijDiag + R.NijDiag; + if (order >= 2) { + out.NijkDiag = L.NijkDiag + R.NijkDiag; + out.sumPermuteNxyz = L.sumPermuteNxyz + R.sumPermuteNxyz; + out.twoNxxy_Nyxx = L.twoNxxy_Nyxx + R.twoNxxy_Nyxx; + out.twoNxxz_Nzxx = L.twoNxxz_Nzxx + R.twoNxxz_Nzxx; + out.twoNyyz_Nzyy = L.twoNyyz_Nzyy + R.twoNyyz_Nzyy; + out.twoNyyx_Nxyy = L.twoNyyx_Nxyy + R.twoNyyx_Nxyy; + out.twoNzzx_Nxzz = L.twoNzzx_Nxzz + R.twoNzzx_Nxzz; + out.twoNzzy_Nyzz = L.twoNzzy_Nyzz + R.twoNzzy_Nyzz; + } + applyShift(out, L, L.averageP - out.averageP, order); + applyShift(out, R, R.averageP - out.averageP, order); + } + + nd.averageP = out.averageP; + nd.N = out.N; + nd.maxPDist2 = out.maxPDist2; + nd.NijDiag = out.NijDiag; + nd.Nxy_Nyx = out.Nxy + out.Nyx; + nd.Nyz_Nzy = out.Nyz + out.Nzy; + nd.Nzx_Nxz = out.Nzx + out.Nxz; + nd.NijkDiag = out.NijkDiag; + nd.sumPermuteNxyz = out.sumPermuteNxyz; + nd.twoNxxy_Nyxx = out.twoNxxy_Nyxx; + nd.twoNxxz_Nzxx = out.twoNxxz_Nzxx; + nd.twoNyyz_Nzyy = out.twoNyyz_Nzyy; + nd.twoNyyx_Nxyy = out.twoNyyx_Nxyy; + nd.twoNzzx_Nxzz = out.twoNzzx_Nxzz; + nd.twoNzzy_Nyzz = out.twoNzzy_Nyzz; + } + } + + // Dipole contribution for a single oriented point. + static double dipole(const vec3 &dipoleVec, const vec3 &ptPos, const vec3 &queryPos) { + vec3 r = ptPos - queryPos; + double r2 = dot(r, r); + if (r2 == 0) return 0; + double r3 = r2 * std::sqrt(r2); + return dot(dipoleVec, r) / r3; + } + + // Exact solid angle for a triangle at query point p. + static double solidAngle(const vec3 &a, const vec3 &b, const vec3 &c, const vec3 &p) { + vec3 qa = a - p, qb = b - p, qc = c - p; + double al = norm(qa), bl = norm(qb), cl = norm(qc); + if (al == 0 || bl == 0 || cl == 0) return 0; + vec3 qan = qa * (1 / al), qbn = qb * (1 / bl), qcn = qc * (1 / cl); + double num = dot(qan, cross(qbn - qan, qcn - qan)); + if (num == 0) return 0; + double den = 1 + dot(qan, qbn) + dot(qan, qcn) + dot(qbn, qcn); + return 2 * std::atan2(num, den); + } + + // Compute second-order triangle integrals for Taylor terms (order 2). + void computeNijkTerms(const vec3 &a, const vec3 &b, const vec3 &c, + const vec3 &P, const vec3 &N, buildData &out) { + double area = norm(N); + if (area == 0) return; + vec3 n = N * (1 / area); + + vec3 vals[3] = {a, b, c}; + int ox[3] = {0, 1, 2}, oy[3] = {0, 1, 2}, oz[3] = {0, 1, 2}; + + auto sort3 = [&](int *o, auto get) { + if (get(vals[0]) > get(vals[1])) std::swap(o[0], o[1]); + if (get(vals[o[0]]) > get(vals[2])) std::swap(o[0], o[2]); + if (get(vals[o[1]]) > get(vals[o[2]])) std::swap(o[1], o[2]); + }; + sort3(ox, [](const vec3 &v) { return v.x; }); + sort3(oy, [](const vec3 &v) { return v.y; }); + sort3(oz, [](const vec3 &v) { return v.z; }); + + double dx = vals[ox[2]].x - vals[ox[0]].x; + double dy = vals[oy[2]].y - vals[oy[0]].y; + double dz = vals[oz[2]].z - vals[oz[0]].z; + + auto getComp = [](const vec3 &v, int i) { return i == 0 ? v.x : (i == 1 ? v.y : v.z); }; + + auto integrate = [&](const vec3 &aa, const vec3 &bb, const vec3 &cc, + double *ii, double *ij, double *ik, int i) { + vec3 oab = bb - aa, oac = cc - aa, ocb = bb - cc; + double oac_i = getComp(oac, i), oab_i = getComp(oab, i); + if (oac_i == 0) return; + double t = oab_i / oac_i; + int j = (i + 1) % 3, k = (i + 2) % 3; + double jdiff = t * getComp(oac, j) - getComp(oab, j); + double kdiff = t * getComp(oac, k) - getComp(oab, k); + + vec3 ca{jdiff * getComp(oab, k) - kdiff * getComp(oab, j), kdiff * oab_i, jdiff * oab_i}; + vec3 cc_{ + jdiff * getComp(ocb, k) - kdiff * getComp(ocb, j), kdiff * getComp(ocb, i), jdiff * getComp(ocb, i) + }; + double sa = norm(ca), sc = norm(cc_); + double Pai = getComp(aa, i) - getComp(P, i), Pci = getComp(cc, i) - getComp(P, i); + double ocb_i = getComp(ocb, i); + + *ii = sa * (0.5 * Pai * Pai + (2.0 / 3) * Pai * oab_i + 0.25 * oab_i * oab_i) + + sc * (0.5 * Pci * Pci + (2.0 / 3) * Pci * ocb_i + 0.25 * ocb_i * ocb_i); + + for (int jk: {j, k}) { + double *out_ptr = (jk == j) ? ij : ik; + double diff = (jk == j) ? jdiff : kdiff; + if (!out_ptr) continue; + double bmid = getComp(bb, jk) + 0.5 * diff; + double Paj = getComp(aa, jk) - getComp(P, jk), Pcj = getComp(cc, jk) - getComp(P, jk); + *out_ptr = sa * (0.5 * Pai * Paj + (1.0 / 3) * Pai * (bmid - getComp(aa, jk)) + (1.0 / 3) * Paj * + oab_i + 0.25 * oab_i * (bmid - getComp(aa, jk))) + + sc * (0.5 * Pci * Pcj + (1.0 / 3) * Pci * (bmid - getComp(cc, jk)) + (1.0 / 3) * Pcj * + ocb_i + 0.25 * ocb_i * (bmid - getComp(cc, jk))); + } + }; + + double ixx = 0, ixy = 0, iyy = 0, iyz = 0, izz = 0, izx = 0; + if (dx > 0) + integrate(vals[ox[0]], vals[ox[1]], vals[ox[2]], &ixx, + (dx >= dy && dy > 0) ? &ixy : nullptr, (dx >= dz && dz > 0) ? &izx : nullptr, 0); + if (dy > 0) + integrate(vals[oy[0]], vals[oy[1]], vals[oy[2]], &iyy, + (dy >= dz && dz > 0) ? &iyz : nullptr, (dx < dy && dx > 0) ? &ixy : nullptr, 1); + if (dz > 0) + integrate(vals[oz[0]], vals[oz[1]], vals[oz[2]], &izz, + (dx < dz && dx > 0) ? &izx : nullptr, (dy < dz && dy > 0) ? &iyz : nullptr, 2); + + out.NijkDiag.x += ixx * n.x; + out.NijkDiag.y += iyy * n.y; + out.NijkDiag.z += izz * n.z; + out.sumPermuteNxyz += 2 * (n.x * iyz + n.y * izx + n.z * ixy); + out.twoNxxy_Nyxx += 2 * n.x * ixy + n.y * ixx; + out.twoNxxz_Nzxx += 2 * n.x * izx + n.z * ixx; + out.twoNyyz_Nzyy += 2 * n.y * iyz + n.z * iyy; + out.twoNyyx_Nxyy += 2 * n.y * ixy + n.x * iyy; + out.twoNzzx_Nxzz += 2 * n.z * izx + n.x * izz; + out.twoNzzy_Nyzz += 2 * n.z * iyz + n.y * izz; + } + + // Shift child moments to parent's expansion center. + void applyShift(buildData &parent, const buildData &child, const vec3 &d, int order) { + const vec3 &N = child.N; + parent.NijDiag.x += N.x * d.x; + parent.NijDiag.y += N.y * d.y; + parent.NijDiag.z += N.z * d.z; + + double Nxy = child.Nxy + N.x * d.y, Nyx = child.Nyx + N.y * d.x; + double Nyz = child.Nyz + N.y * d.z, Nzy = child.Nzy + N.z * d.y; + double Nzx = child.Nzx + N.z * d.x, Nxz = child.Nxz + N.x * d.z; + parent.Nxy += Nxy; + parent.Nyx += Nyx; + parent.Nyz += Nyz; + parent.Nzy += Nzy; + parent.Nzx += Nzx; + parent.Nxz += Nxz; + + if (order < 2) return; + + parent.NijkDiag.x += 2 * d.x * child.NijDiag.x + d.x * d.x * N.x; + parent.NijkDiag.y += 2 * d.y * child.NijDiag.y + d.y * d.y * N.y; + parent.NijkDiag.z += 2 * d.z * child.NijDiag.z + d.z * d.z * N.z; + parent.sumPermuteNxyz += d.x * (Nyz + Nzy) + d.y * (Nzx + Nxz) + d.z * (Nxy + Nyx); + parent.twoNxxy_Nyxx += 2 * (d.y * child.NijDiag.x + d.x * child.Nxy + N.x * d.x * d.y) + 2 * child.Nyx * d.x + + N.y * d.x * d.x; + parent.twoNxxz_Nzxx += 2 * (d.z * child.NijDiag.x + d.x * child.Nxz + N.x * d.x * d.z) + 2 * child.Nzx * d.x + + N.z * d.x * d.x; + parent.twoNyyz_Nzyy += 2 * (d.z * child.NijDiag.y + d.y * child.Nyz + N.y * d.y * d.z) + 2 * child.Nzy * d.y + + N.z * d.y * d.y; + parent.twoNyyx_Nxyy += 2 * (d.x * child.NijDiag.y + d.y * child.Nyx + N.y * d.y * d.x) + 2 * child.Nxy * d.y + + N.x * d.y * d.y; + parent.twoNzzx_Nxzz += 2 * (d.x * child.NijDiag.z + d.z * child.Nzx + N.z * d.z * d.x) + 2 * child.Nxz * d.z + + N.x * d.z * d.z; + parent.twoNzzy_Nyzz += 2 * (d.y * child.NijDiag.z + d.z * child.Nzy + N.z * d.z * d.y) + 2 * child.Nyz * d.z + + N.y * d.z * d.z; + } + + // Build aggregates for mesh mode. + void buildAggregates() { + uint64_t nodeCount = bvh.usedNodes; + nodes.assign(nodeCount, nodeAgg{}); + std::vector bd(nodeCount); + + for (uint64_t i = 0; i < nodeCount; ++i) { + const auto &n = bvh.bvhNode[i]; + auto &nd = nodes[i]; + nd.isLeaf = n.triCount > 0; + if (nd.isLeaf) { + nd.firstPrim = n.leftFirst; + nd.primCount = n.triCount; + } else { + nd.left = n.leftFirst; + nd.right = n.leftFirst + 1; + } + } + + int order = std::clamp(settings.taylorOrder, 0, 2); + + for (uint64_t i = nodeCount; i-- > 0;) { + auto &nd = nodes[i]; + auto &out = bd[i]; + + if (nd.isLeaf) { + bool hasBox = false; + vec3 areaP{}, Nsum{}; + double area = 0; + + for (uint64_t t = 0; t < nd.primCount; ++t) { + uint64_t triId = primIndex(nd.firstPrim + t); + if (!hasBox) { + out.box = triBounds[triId]; + hasBox = true; + } else out.box = aabbUnion(out.box, triBounds[triId]); + vec3 N = triVecArea[triId]; + double ta = norm(N); + areaP = areaP + triCentroid[triId] * ta; + area += ta; + Nsum = Nsum + N; + } + + out.areaP = areaP; + out.area = area; + out.N = Nsum; + out.averageP = area > 0 ? areaP * (1 / area) : aabbCenter(out.box); + out.maxPDist2 = maxPDist2FromBox(out.box, out.averageP); + + for (uint64_t t = 0; t < nd.primCount; ++t) { + uint64_t triId = primIndex(nd.firstPrim + t); + buildData child{}; + child.averageP = triCentroid[triId]; + child.N = triVecArea[triId]; + + if (order >= 2) { + const auto &idx = triangles[triId]; + computeNijkTerms(toVec3(vertices[idx[0]]), toVec3(vertices[idx[1]]), + toVec3(vertices[idx[2]]), child.averageP, child.N, child); + out.NijkDiag = out.NijkDiag + child.NijkDiag; + out.sumPermuteNxyz += child.sumPermuteNxyz; + out.twoNxxy_Nyxx += child.twoNxxy_Nyxx; + out.twoNxxz_Nzxx += child.twoNxxz_Nzxx; + out.twoNyyz_Nzyy += child.twoNyyz_Nzyy; + out.twoNyyx_Nxyy += child.twoNyyx_Nxyy; + out.twoNzzx_Nxzz += child.twoNzzx_Nxzz; + out.twoNzzy_Nyzz += child.twoNzzy_Nyzz; + } + applyShift(out, child, child.averageP - out.averageP, order); + } + } else { + const auto &L = bd[nd.left]; + const auto &R = bd[nd.right]; + out.box = aabbUnion(L.box, R.box); + out.areaP = L.areaP + R.areaP; + out.area = L.area + R.area; + out.N = L.N + R.N; + out.averageP = out.area > 0 ? out.areaP * (1 / out.area) : aabbCenter(out.box); + out.maxPDist2 = maxPDist2FromBox(out.box, out.averageP); + + if (order >= 1) out.NijDiag = L.NijDiag + R.NijDiag; + if (order >= 2) { + out.NijkDiag = L.NijkDiag + R.NijkDiag; + out.sumPermuteNxyz = L.sumPermuteNxyz + R.sumPermuteNxyz; + out.twoNxxy_Nyxx = L.twoNxxy_Nyxx + R.twoNxxy_Nyxx; + out.twoNxxz_Nzxx = L.twoNxxz_Nzxx + R.twoNxxz_Nzxx; + out.twoNyyz_Nzyy = L.twoNyyz_Nzyy + R.twoNyyz_Nzyy; + out.twoNyyx_Nxyy = L.twoNyyx_Nxyy + R.twoNyyx_Nxyy; + out.twoNzzx_Nxzz = L.twoNzzx_Nxzz + R.twoNzzx_Nxzz; + out.twoNzzy_Nyzz = L.twoNzzy_Nyzz + R.twoNzzy_Nyzz; + } + applyShift(out, L, L.averageP - out.averageP, order); + applyShift(out, R, R.averageP - out.averageP, order); + } + + nd.averageP = out.averageP; + nd.N = out.N; + nd.maxPDist2 = out.maxPDist2; + nd.NijDiag = out.NijDiag; + nd.Nxy_Nyx = out.Nxy + out.Nyx; + nd.Nyz_Nzy = out.Nyz + out.Nzy; + nd.Nzx_Nxz = out.Nzx + out.Nxz; + nd.NijkDiag = out.NijkDiag; + nd.sumPermuteNxyz = out.sumPermuteNxyz; + nd.twoNxxy_Nyxx = out.twoNxxy_Nyxx; + nd.twoNxxz_Nzxx = out.twoNxxz_Nzxx; + nd.twoNyyz_Nzyy = out.twoNyyz_Nzyy; + nd.twoNyyx_Nxyy = out.twoNyyx_Nxyy; + nd.twoNzzx_Nxzz = out.twoNzzx_Nxzz; + nd.twoNzzy_Nyzz = out.twoNzzy_Nyzz; + } + } + + static std::vector &getStack() { + thread_local std::vector stack; + stack.clear(); + stack.reserve(128); + return stack; + } + +#if TG_HAS_AVX2 && (defined(__GNUC__) || defined(__clang__)) + #define TG_AVX2_TARGET __attribute__((target("avx2"))) +#elif TG_HAS_AVX2 && defined(_MSC_VER) + #define TG_AVX2_TARGET +#else + #define TG_AVX2_TARGET +#endif + +#if TG_HAS_AVX2 + struct alignas(32) Packet { + double x[kPacketSize]; + double y[kPacketSize]; + double z[kPacketSize]; + }; + + struct PacketItem { + uint64_t node; + uint8_t mask; + }; + + static std::vector &getPacketStack() { + thread_local std::vector stack; + stack.clear(); + stack.reserve(128); + return stack; + } + + TG_AVX2_TARGET static inline __m256d avxDot3(__m256d ax, __m256d ay, __m256d az, + __m256d bx, __m256d by, __m256d bz) { + return _mm256_add_pd(_mm256_add_pd(_mm256_mul_pd(ax, bx), _mm256_mul_pd(ay, by)), + _mm256_mul_pd(az, bz)); + } + + TG_AVX2_TARGET static inline void avxCross3(__m256d ax, __m256d ay, __m256d az, + __m256d bx, __m256d by, __m256d bz, + __m256d &cx, __m256d &cy, __m256d &cz) { + cx = _mm256_sub_pd(_mm256_mul_pd(ay, bz), _mm256_mul_pd(az, by)); + cy = _mm256_sub_pd(_mm256_mul_pd(az, bx), _mm256_mul_pd(ax, bz)); + cz = _mm256_sub_pd(_mm256_mul_pd(ax, by), _mm256_mul_pd(ay, bx)); + } + + TG_AVX2_TARGET void approxPacketFull(const nodeAgg &nd, const Packet &p, double *out) const { + __m256d px = _mm256_load_pd(p.x); + __m256d py = _mm256_load_pd(p.y); + __m256d pz = _mm256_load_pd(p.z); + __m256d cx = _mm256_set1_pd(nd.averageP.x); + __m256d cy = _mm256_set1_pd(nd.averageP.y); + __m256d cz = _mm256_set1_pd(nd.averageP.z); + + __m256d qx = _mm256_sub_pd(px, cx); + __m256d qy = _mm256_sub_pd(py, cy); + __m256d qz = _mm256_sub_pd(pz, cz); + + __m256d ql2 = avxDot3(qx, qy, qz, qx, qy, qz); + __m256d ql_m2 = _mm256_div_pd(_mm256_set1_pd(1.0), ql2); + __m256d ql_m1 = _mm256_sqrt_pd(ql_m2); + + __m256d qnx = _mm256_mul_pd(qx, ql_m1); + __m256d qny = _mm256_mul_pd(qy, ql_m1); + __m256d qnz = _mm256_mul_pd(qz, ql_m1); + + __m256d Nx = _mm256_set1_pd(nd.N.x); + __m256d Ny = _mm256_set1_pd(nd.N.y); + __m256d Nz = _mm256_set1_pd(nd.N.z); + __m256d omega = _mm256_mul_pd(_mm256_set1_pd(-1.0), + _mm256_mul_pd(ql_m2, avxDot3(qnx, qny, qnz, Nx, Ny, Nz))); + + int order = std::clamp(settings.taylorOrder, 0, 2); + if (order >= 1) { + __m256d q2x = _mm256_mul_pd(qnx, qnx); + __m256d q2y = _mm256_mul_pd(qny, qny); + __m256d q2z = _mm256_mul_pd(qnz, qnz); + __m256d ql_m3 = _mm256_mul_pd(ql_m2, ql_m1); + + __m256d Nijx = _mm256_set1_pd(nd.NijDiag.x); + __m256d Nijy = _mm256_set1_pd(nd.NijDiag.y); + __m256d Nijz = _mm256_set1_pd(nd.NijDiag.z); + __m256d dq2Nij = _mm256_add_pd(_mm256_add_pd(_mm256_mul_pd(q2x, Nijx), _mm256_mul_pd(q2y, Nijy)), + _mm256_mul_pd(q2z, Nijz)); + __m256d cross = _mm256_add_pd( + _mm256_add_pd(_mm256_mul_pd(_mm256_mul_pd(qnx, qny), _mm256_set1_pd(nd.Nxy_Nyx)), + _mm256_mul_pd(_mm256_mul_pd(qny, qnz), _mm256_set1_pd(nd.Nyz_Nzy))), + _mm256_mul_pd(_mm256_mul_pd(qnz, qnx), _mm256_set1_pd(nd.Nzx_Nxz))); + + __m256d NijSum = _mm256_set1_pd(nd.NijDiag.x + nd.NijDiag.y + nd.NijDiag.z); + __m256d term1 = _mm256_mul_pd(ql_m3, + _mm256_sub_pd(NijSum, _mm256_mul_pd(_mm256_set1_pd(3.0), + _mm256_add_pd(dq2Nij, cross)))); + omega = _mm256_add_pd(omega, term1); + + if (order >= 2) { + __m256d q3x = _mm256_mul_pd(q2x, qnx); + __m256d q3y = _mm256_mul_pd(q2y, qny); + __m256d q3z = _mm256_mul_pd(q2z, qnz); + __m256d ql_m4 = _mm256_mul_pd(ql_m2, ql_m2); + + __m256d t0x = _mm256_set1_pd(nd.twoNyyx_Nxyy + nd.twoNzzx_Nxzz); + __m256d t0y = _mm256_set1_pd(nd.twoNzzy_Nyzz + nd.twoNxxy_Nyxx); + __m256d t0z = _mm256_set1_pd(nd.twoNxxz_Nzxx + nd.twoNyyz_Nzyy); + + __m256d t1x = _mm256_add_pd(_mm256_mul_pd(qny, _mm256_set1_pd(nd.twoNxxy_Nyxx)), + _mm256_mul_pd(qnz, _mm256_set1_pd(nd.twoNxxz_Nzxx))); + __m256d t1y = _mm256_add_pd(_mm256_mul_pd(qnz, _mm256_set1_pd(nd.twoNyyz_Nzyy)), + _mm256_mul_pd(qnx, _mm256_set1_pd(nd.twoNyyx_Nxyy))); + __m256d t1z = _mm256_add_pd(_mm256_mul_pd(qnx, _mm256_set1_pd(nd.twoNzzx_Nxzz)), + _mm256_mul_pd(qny, _mm256_set1_pd(nd.twoNzzy_Nyzz))); + + __m256d tnX = _mm256_set1_pd(3.0 * nd.NijkDiag.x); + __m256d tnY = _mm256_set1_pd(3.0 * nd.NijkDiag.y); + __m256d tnZ = _mm256_set1_pd(3.0 * nd.NijkDiag.z); + __m256d s0x = _mm256_add_pd(tnX, t0x); + __m256d s0y = _mm256_add_pd(tnY, t0y); + __m256d s0z = _mm256_add_pd(tnZ, t0z); + + __m256d dot_q_s0 = avxDot3(qnx, qny, qnz, s0x, s0y, s0z); + __m256d dot_q3_nijk = _mm256_add_pd(_mm256_add_pd(_mm256_mul_pd(q3x, _mm256_set1_pd(nd.NijkDiag.x)), + _mm256_mul_pd(q3y, _mm256_set1_pd(nd.NijkDiag.y))), + _mm256_mul_pd(q3z, _mm256_set1_pd(nd.NijkDiag.z))); + __m256d dot_q2_t1 = _mm256_add_pd(_mm256_add_pd(_mm256_mul_pd(q2x, t1x), _mm256_mul_pd(q2y, t1y)), + _mm256_mul_pd(q2z, t1z)); + __m256d qxyz = _mm256_mul_pd(_mm256_mul_pd(qnx, qny), qnz); + + __m256d term2 = _mm256_mul_pd(ql_m4, + _mm256_sub_pd(_mm256_mul_pd(_mm256_set1_pd(1.5), dot_q_s0), + _mm256_mul_pd(_mm256_set1_pd(7.5), + _mm256_add_pd(_mm256_add_pd(dot_q3_nijk, + _mm256_mul_pd(qxyz, _mm256_set1_pd(nd.sumPermuteNxyz))), + dot_q2_t1)))); + omega = _mm256_add_pd(omega, term2); + } + } + + _mm256_store_pd(out, omega); + } + + TG_AVX2_TARGET void solidAnglePacketFull(const vec3 &a, const vec3 &b, const vec3 &c, const Packet &p, double *out) const { + __m256d ax = _mm256_set1_pd(a.x), ay = _mm256_set1_pd(a.y), az = _mm256_set1_pd(a.z); + __m256d bx = _mm256_set1_pd(b.x), by = _mm256_set1_pd(b.y), bz = _mm256_set1_pd(b.z); + __m256d cx = _mm256_set1_pd(c.x), cy = _mm256_set1_pd(c.y), cz = _mm256_set1_pd(c.z); + __m256d px = _mm256_load_pd(p.x); + __m256d py = _mm256_load_pd(p.y); + __m256d pz = _mm256_load_pd(p.z); + + __m256d Ax = _mm256_sub_pd(ax, px), Ay = _mm256_sub_pd(ay, py), Az = _mm256_sub_pd(az, pz); + __m256d Bx = _mm256_sub_pd(bx, px), By = _mm256_sub_pd(by, py), Bz = _mm256_sub_pd(bz, pz); + __m256d Cx = _mm256_sub_pd(cx, px), Cy = _mm256_sub_pd(cy, py), Cz = _mm256_sub_pd(cz, pz); + + __m256d aN = _mm256_sqrt_pd(avxDot3(Ax, Ay, Az, Ax, Ay, Az)); + __m256d bN = _mm256_sqrt_pd(avxDot3(Bx, By, Bz, Bx, By, Bz)); + __m256d cN = _mm256_sqrt_pd(avxDot3(Cx, Cy, Cz, Cx, Cy, Cz)); + + __m256d invA = _mm256_div_pd(_mm256_set1_pd(1.0), aN); + __m256d invB = _mm256_div_pd(_mm256_set1_pd(1.0), bN); + __m256d invC = _mm256_div_pd(_mm256_set1_pd(1.0), cN); + + __m256d Anx = _mm256_mul_pd(Ax, invA), Any = _mm256_mul_pd(Ay, invA), Anz = _mm256_mul_pd(Az, invA); + __m256d Bnx = _mm256_mul_pd(Bx, invB), Bny = _mm256_mul_pd(By, invB), Bnz = _mm256_mul_pd(Bz, invB); + __m256d Cnx = _mm256_mul_pd(Cx, invC), Cny = _mm256_mul_pd(Cy, invC), Cnz = _mm256_mul_pd(Cz, invC); + + __m256d crossX, crossY, crossZ; + avxCross3(Bnx, Bny, Bnz, Cnx, Cny, Cnz, crossX, crossY, crossZ); + __m256d num = avxDot3(Anx, Any, Anz, crossX, crossY, crossZ); + + __m256d cosAB = avxDot3(Anx, Any, Anz, Bnx, Bny, Bnz); + __m256d cosBC = avxDot3(Bnx, Bny, Bnz, Cnx, Cny, Cnz); + __m256d cosCA = avxDot3(Cnx, Cny, Cnz, Anx, Any, Anz); + __m256d denom = _mm256_add_pd(_mm256_add_pd(_mm256_add_pd(_mm256_set1_pd(1.0), cosAB), cosBC), cosCA); + + alignas(32) double numArr[kPacketSize]; + alignas(32) double denomArr[kPacketSize]; + _mm256_store_pd(numArr, num); + _mm256_store_pd(denomArr, denom); + for (int i = 0; i < kPacketSize; ++i) { + out[i] += 2.0 * std::atan2(numArr[i], denomArr[i]); + } + } + + TG_AVX2_TARGET void dipolePacketFull(const vec3 &dipoleVec, const vec3 &ptPos, const Packet &p, double *out) const { + __m256d px = _mm256_load_pd(p.x); + __m256d py = _mm256_load_pd(p.y); + __m256d pz = _mm256_load_pd(p.z); + __m256d ox = _mm256_set1_pd(ptPos.x); + __m256d oy = _mm256_set1_pd(ptPos.y); + __m256d oz = _mm256_set1_pd(ptPos.z); + + __m256d rx = _mm256_sub_pd(ox, px); + __m256d ry = _mm256_sub_pd(oy, py); + __m256d rz = _mm256_sub_pd(oz, pz); + __m256d r2 = avxDot3(rx, ry, rz, rx, ry, rz); + __m256d r = _mm256_sqrt_pd(r2); + __m256d r3 = _mm256_mul_pd(r2, r); + + __m256d dx = _mm256_set1_pd(dipoleVec.x); + __m256d dy = _mm256_set1_pd(dipoleVec.y); + __m256d dz = _mm256_set1_pd(dipoleVec.z); + __m256d dotd = avxDot3(dx, dy, dz, rx, ry, rz); + __m256d contrib = _mm256_div_pd(dotd, r3); + + alignas(32) double vals[kPacketSize]; + _mm256_store_pd(vals, contrib); + for (int i = 0; i < kPacketSize; ++i) { + out[i] += vals[i]; + } + } +#endif + + // Evaluate Taylor approximation of a node at point p. + // Approximation uses expansion in q = (p - averageP) with terms up to taylorOrder. + double approx(const nodeAgg &nd, const vec3 &p) const { + vec3 qraw = p - nd.averageP; + double ql2 = dot(qraw, qraw); + if (ql2 == 0) return 0; + + double ql_m2 = 1 / ql2, ql_m1 = std::sqrt(ql_m2); + vec3 q = qraw * ql_m1; + double omega = -ql_m2 * (q.x * nd.N.x + q.y * nd.N.y + q.z * nd.N.z); + + int order = std::clamp(settings.taylorOrder, 0, 2); + if (order >= 1) { + vec3 q2{q.x * q.x, q.y * q.y, q.z * q.z}; + double ql_m3 = ql_m2 * ql_m1; + double dq2Nij = q2.x * nd.NijDiag.x + q2.y * nd.NijDiag.y + q2.z * nd.NijDiag.z; + double cross = q.x * q.y * nd.Nxy_Nyx + q.y * q.z * nd.Nyz_Nzy + q.z * q.x * nd.Nzx_Nxz; + omega += ql_m3 * ((nd.NijDiag.x + nd.NijDiag.y + nd.NijDiag.z) - 3 * (dq2Nij + cross)); + + if (order >= 2) { + vec3 q3{q2.x * q.x, q2.y * q.y, q2.z * q.z}; + double ql_m4 = ql_m2 * ql_m2; + vec3 t0{ + nd.twoNyyx_Nxyy + nd.twoNzzx_Nxzz, nd.twoNzzy_Nyzz + nd.twoNxxy_Nyxx, + nd.twoNxxz_Nzxx + nd.twoNyyz_Nzyy + }; + vec3 t1{ + q.y * nd.twoNxxy_Nyxx + q.z * nd.twoNxxz_Nzxx, q.z * nd.twoNyyz_Nzyy + q.x * nd.twoNyyx_Nxyy, + q.x * nd.twoNzzx_Nxzz + q.y * nd.twoNzzy_Nyzz + }; + vec3 tn{3 * nd.NijkDiag.x, 3 * nd.NijkDiag.y, 3 * nd.NijkDiag.z}; + vec3 s0{tn.x + t0.x, tn.y + t0.y, tn.z + t0.z}; + omega += ql_m4 * (1.5 * (q.x * s0.x + q.y * s0.y + q.z * s0.z) + - 7.5 * (q3.x * nd.NijkDiag.x + q3.y * nd.NijkDiag.y + q3.z * nd.NijkDiag.z + + q.x * q.y * q.z * nd.sumPermuteNxyz + q2.x * t1.x + q2.y * t1.y + q2.z + * t1.z)); + } + } + return omega; + } + + // Query winding number at a single point. + // Traversal: approximate nodes if (distance^2 > maxPDist2 * accuracy^2), + // otherwise descend to leaves and accumulate exact contributions. + double queryOne(const Point &pt) const { + vec3 p = toVec3(pt); + double sum = 0; + double acc2 = settings.accuracy * settings.accuracy; + + auto &stack = getStack(); + stack.push_back(0); + + while (!stack.empty()) { + uint64_t ni = stack.back(); + stack.pop_back(); + const auto &nd = nodes[ni]; + + vec3 q = p - nd.averageP; + if (dot(q, q) > nd.maxPDist2 * acc2) { + sum += approx(nd, p); + continue; + } + + if (!nd.isLeaf) { + stack.push_back(nd.right); + stack.push_back(nd.left); + continue; + } + + if (mode == Mode::Mesh) { + for (uint64_t t = 0; t < nd.primCount; ++t) { + uint64_t triId = primIndex(nd.firstPrim + t); + const auto &idx = triangles[triId]; + sum += solidAngle(toVec3(vertices[idx[0]]), toVec3(vertices[idx[1]]), + toVec3(vertices[idx[2]]), p); + } + } else { + // Point cloud mode - use dipole + for (uint64_t t = 0; t < nd.primCount; ++t) { + uint64_t ptId = primIndex(nd.firstPrim + t); + sum += dipole(cloudDipoles[ptId], toVec3(cloudPoints[ptId]), p); + } + } + } + return sum / (4 * pi()); + } + + // Query many points in parallel. + std::vector queryMany(const std::vector &points) const { + std::vector out(points.size()); + if (points.empty()) return out; + + unsigned int tc = settings.threads; + if (tc == 0) tc = std::thread::hardware_concurrency(); + tc = std::max(1u, std::min(tc, (unsigned int) points.size())); + + std::atomic next{0}; + const size_t chunk = 2048; + + auto worker = [&]() { + while (true) { + size_t start = next.fetch_add(chunk, std::memory_order_relaxed); + if (start >= points.size()) break; + size_t end = std::min(points.size(), start + chunk); +#if TG_HAS_AVX2 + bool useAvx2 = false; + #if defined(__GNUC__) || defined(__clang__) + useAvx2 = __builtin_cpu_supports("avx2"); + #elif defined(_MSC_VER) + int info[4] = {0}; + __cpuidex(info, 0, 0); + if (info[0] >= 7) { + __cpuidex(info, 7, 0); + useAvx2 = (info[1] & (1 << 5)) != 0; + } + #endif + + if (useAvx2) { + size_t i = start; + for (; i + kPacketSize <= end; i += kPacketSize) { + Packet pack{}; + for (int k = 0; k < kPacketSize; ++k) { + pack.x[k] = points[i + k][0]; + pack.y[k] = points[i + k][1]; + pack.z[k] = points[i + k][2]; + } + + alignas(32) double sums[kPacketSize] = {0, 0, 0, 0}; + double acc2 = settings.accuracy * settings.accuracy; + auto &stack = getPacketStack(); + stack.push_back({0, 0x0F}); + + while (!stack.empty()) { + PacketItem item = stack.back(); + stack.pop_back(); + const auto &nd = nodes[item.node]; + uint8_t mask = item.mask; + + if (!nd.isLeaf) { + uint8_t approxMask = 0; + uint8_t descendMask = 0; + for (int lane = 0; lane < kPacketSize; ++lane) { + if (!((mask >> lane) & 1)) continue; + vec3 p = {pack.x[lane], pack.y[lane], pack.z[lane]}; + vec3 q = p - nd.averageP; + if (dot(q, q) > nd.maxPDist2 * acc2) approxMask |= (1u << lane); + else descendMask |= (1u << lane); + } + + if (approxMask) { + if (approxMask == 0x0F) { + alignas(32) double vals[kPacketSize]; + approxPacketFull(nd, pack, vals); + for (int lane = 0; lane < kPacketSize; ++lane) sums[lane] += vals[lane]; + } else { + for (int lane = 0; lane < kPacketSize; ++lane) { + if (!((approxMask >> lane) & 1)) continue; + vec3 p = {pack.x[lane], pack.y[lane], pack.z[lane]}; + sums[lane] += approx(nd, p); + } + } + } + + if (descendMask) { + stack.push_back({nd.left, descendMask}); + stack.push_back({nd.right, descendMask}); + } + continue; + } + + if (mode == Mode::Mesh) { + for (uint64_t t = 0; t < nd.primCount; ++t) { + uint64_t triId = primIndex(nd.firstPrim + t); + const auto &idx = triangles[triId]; + vec3 a = toVec3(vertices[idx[0]]); + vec3 b = toVec3(vertices[idx[1]]); + vec3 c = toVec3(vertices[idx[2]]); + + if (mask == 0x0F) { + solidAnglePacketFull(a, b, c, pack, sums); + } else { + for (int lane = 0; lane < kPacketSize; ++lane) { + if (!((mask >> lane) & 1)) continue; + vec3 p = {pack.x[lane], pack.y[lane], pack.z[lane]}; + sums[lane] += solidAngle(a, b, c, p); + } + } + } + } else { + for (uint64_t t = 0; t < nd.primCount; ++t) { + uint64_t ptId = primIndex(nd.firstPrim + t); + vec3 dip = cloudDipoles[ptId]; + vec3 pos = toVec3(cloudPoints[ptId]); + + if (mask == 0x0F) { + dipolePacketFull(dip, pos, pack, sums); + } else { + for (int lane = 0; lane < kPacketSize; ++lane) { + if (!((mask >> lane) & 1)) continue; + vec3 p = {pack.x[lane], pack.y[lane], pack.z[lane]}; + sums[lane] += dipole(dip, pos, p); + } + } + } + } + } + + for (int lane = 0; lane < kPacketSize; ++lane) { + out[i + lane] = sums[lane] / (4 * pi()); + } + } + for (; i < end; ++i) { + out[i] = queryOne(points[i]); + } + } else { + for (size_t i = start; i < end; ++i) { + out[i] = queryOne(points[i]); + } + } +#else + for (size_t i = start; i < end; ++i) { + out[i] = queryOne(points[i]); + } +#endif + } + }; + + std::vector threads; + threads.reserve(tc); + for (unsigned int i = 0; i < tc; ++i) threads.emplace_back(worker); + for (auto &t: threads) t.join(); + + return out; + } + }; + + // Public API + windingNumber::windingNumber(const std::vector &vertices, + const std::vector &triangles, + Settings s) + : impl_(std::make_unique()) { + if (vertices.empty() || triangles.empty()) { + throw std::runtime_error("Mesh cannot be empty"); + } + for (const auto &tri: triangles) { + if (tri[0] >= vertices.size() || tri[1] >= vertices.size() || tri[2] >= vertices.size()) { + throw std::runtime_error("Triangle index out of range"); + } + } + impl_->settings = s; + impl_->mode = Impl::Mode::Mesh; + impl_->vertices = vertices; + impl_->triangles = triangles; + impl_->build(); + } + + windingNumber::windingNumber(const std::vector &points, Settings s) + : impl_(std::make_unique()) { + if (points.empty()) { + throw std::runtime_error("Point cloud cannot be empty"); + } + + impl_->settings = s; + impl_->mode = Impl::Mode::PointCloud; + impl_->cloudPoints = points; + + // Estimate normals using PCA + impl_->estimateNormals(s.kNeighbors); + + // Estimate areas using k-NN + impl_->estimateAreas(s.kNeighbors); + impl_->buildPointCloud(); + } + + windingNumber::windingNumber(const std::vector &points, + const std::vector &normals, + Settings s) + : impl_(std::make_unique()) { + if (points.size() != normals.size()) { + throw std::runtime_error("Points and normals must have same size"); + } + if (points.empty()) { + throw std::runtime_error("Point cloud cannot be empty"); + } + + impl_->settings = s; + impl_->mode = Impl::Mode::PointCloud; + + // Copy points + impl_->cloudPoints = points; + + // Normalize and store normals + impl_->cloudNormals.resize(points.size()); + for (size_t i = 0; i < points.size(); ++i) { + Impl::vec3 n = Impl::toVec3(normals[i]); + double len = Impl::norm(n); + if (len > 0) n = n * (1.0 / len); + impl_->cloudNormals[i] = n; + } + + // Estimate areas using k-NN + impl_->estimateAreas(s.kNeighbors); + impl_->buildPointCloud(); + } + + windingNumber::windingNumber(const std::vector &points, + const std::vector &normals, + const std::vector &areas, + Settings s) + : impl_(std::make_unique()) { + if (points.size() != normals.size() || points.size() != areas.size()) { + throw std::runtime_error("Points, normals, and areas must have same size"); + } + if (points.empty()) { + throw std::runtime_error("Point cloud cannot be empty"); + } + + impl_->settings = s; + impl_->mode = Impl::Mode::PointCloud; + + // Copy points and areas + impl_->cloudPoints = points; + impl_->cloudAreas = areas; + + // Normalize and store normals + impl_->cloudNormals.resize(points.size()); + for (size_t i = 0; i < points.size(); ++i) { + Impl::vec3 n = Impl::toVec3(normals[i]); + double len = Impl::norm(n); + if (len > 0) n = n * (1.0 / len); + impl_->cloudNormals[i] = n; + } + + impl_->buildPointCloud(); + } + + windingNumber::~windingNumber() = default; + + windingNumber::windingNumber(windingNumber &&) noexcept = default; + + windingNumber &windingNumber::operator=(windingNumber &&) noexcept = default; + + double windingNumber::query(const Point &p) const { + return impl_->queryOne(p); + } + + std::vector windingNumber::query(const std::vector &points) const { + return impl_->queryMany(points); + } +} // namespace tg diff --git a/Source/Model/Classes/NMR_ImplicitNodeTypes.cpp b/Source/Model/Classes/NMR_ImplicitNodeTypes.cpp index 6d2599f50..de6fe8e86 100644 --- a/Source/Model/Classes/NMR_ImplicitNodeTypes.cpp +++ b/Source/Model/Classes/NMR_ImplicitNodeTypes.cpp @@ -363,6 +363,37 @@ namespace NMR {"mesh", eImplicitPortType::ResourceID}}, Out{{"distance", eImplicitPortType::Scalar}}}, }}}, + {eImplicitNodeType::BeamLattice, + {"beamlattice", + { + InputOutputRule{ + Lib3MF::eImplicitNodeConfiguration::Default, + In{{"pos", eImplicitPortType::Vector}, + {"beamlattice", eImplicitPortType::ResourceID}}, + Out{{"distance", eImplicitPortType::Scalar}}}, + }}}, + {eImplicitNodeType::FunctionGradient, + {"functiongradient", + { + InputOutputRule{ + Lib3MF::eImplicitNodeConfiguration::Default, + In{{"functionID", eImplicitPortType::ResourceID}, + {"pos", eImplicitPortType::Vector}, + {"step", eImplicitPortType::Scalar}}, + Out{{"normalizedgradient", eImplicitPortType::Vector}, + {"gradient", eImplicitPortType::Vector}, + {"magnitude", eImplicitPortType::Scalar}}}, + }}}, + {eImplicitNodeType::NormalizeDistance, + {"normalizedistance", + { + InputOutputRule{ + Lib3MF::eImplicitNodeConfiguration::Default, + In{{"functionID", eImplicitPortType::ResourceID}, + {"pos", eImplicitPortType::Vector}, + {"step", eImplicitPortType::Scalar}}, + Out{{"result", eImplicitPortType::Scalar}}}, + }}}, {eImplicitNodeType::FunctionCall, {"functioncall", {InputOutputRule{ diff --git a/Source/Model/Classes/NMR_Model.cpp b/Source/Model/Classes/NMR_Model.cpp index 65b5d45f0..09b385a76 100644 --- a/Source/Model/Classes/NMR_Model.cpp +++ b/Source/Model/Classes/NMR_Model.cpp @@ -34,6 +34,7 @@ A model is an in memory representation of the 3MF file. #include "Model/Classes/NMR_Model.h" #include "Model/Classes/NMR_ModelObject.h" #include "Model/Classes/NMR_ModelMeshObject.h" +#include "Model/Classes/NMR_ModelBooleanObject.h" #include "Model/Classes/NMR_ModelConstants.h" #include "Model/Classes/NMR_ModelTypes.h" #include "Model/Classes/NMR_ModelAttachment.h" @@ -403,8 +404,6 @@ namespace NMR { // Retrieve a unique Resource ID ModelResourceID CModel::generateResourceID() { - ModelResourceID highestID = 0; - if(m_ResourceMap.empty()) { return 1; @@ -1516,6 +1515,13 @@ namespace NMR { if (m_FunctionLookup.size() > 0) return true; } + + if (sExtension == XML_3MF_NAMESPACE_BOOLEANSPEC) { + for (size_t i = 0; i < m_ObjectLookup.size(); i++) { + if (dynamic_cast(m_ObjectLookup[i].get()) != nullptr) + return true; + } + } return false; } @@ -1818,4 +1824,3 @@ namespace NMR { throw CNMRException(NMR_ERROR_RESOURCENOTFOUND); } } // namespace NMR - diff --git a/Source/Model/Classes/NMR_ModelBooleanObject.cpp b/Source/Model/Classes/NMR_ModelBooleanObject.cpp new file mode 100644 index 000000000..a890f437b --- /dev/null +++ b/Source/Model/Classes/NMR_ModelBooleanObject.cpp @@ -0,0 +1,369 @@ +/*++ + +Copyright (C) 2026 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +Minimal in-memory representation of a boolean object. + +--*/ + +#include "Model/Classes/NMR_ModelBooleanObject.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Model/Classes/NMR_ModelMeshObject.h" +#include "Model/Classes/NMR_ModelComponentsObject.h" +#include "Model/Classes/NMR_ModelLevelSetObject.h" +#include "Common/Boolean/NMR_BooleanEngine.h" +#include "Common/NMR_Exception.h" +#include + +namespace NMR { + + namespace { + nfBool referencesObjectRecursive(_In_ CModelObject * pCandidate, _In_ CModelObject * pTarget, _Inout_ std::unordered_set & visited) + { + if (pCandidate == nullptr || pTarget == nullptr) + return false; + if (pCandidate == pTarget) + return true; + if (!visited.insert(pCandidate).second) + return false; + + auto pBooleanCandidate = dynamic_cast(pCandidate); + if (pBooleanCandidate == nullptr) + return false; + + if (referencesObjectRecursive(pBooleanCandidate->getBaseObject(), pTarget, visited)) + return true; + + for (nfUint32 nOperandIndex = 0; nOperandIndex < pBooleanCandidate->getOperandCount(); ++nOperandIndex) { + auto pOperand = pBooleanCandidate->getOperand(nOperandIndex); + if (pOperand && referencesObjectRecursive(pOperand->getObject(), pTarget, visited)) + return true; + } + + return false; + } + + nfBool createsBooleanReferenceCycle(_In_ CModelObject * pProposedBase, _In_ CModelBooleanObject * pBooleanObject) + { + std::unordered_set visited; + return referencesObjectRecursive(pProposedBase, pBooleanObject, visited); + } + + nfBool isBeamLatticeMeshObject(_In_ CModelObject * pObject) + { + auto pMeshObject = dynamic_cast(pObject); + if (pMeshObject == nullptr) + return false; + + auto pMesh = pMeshObject->getMesh(); + return (pMesh != nullptr) && (pMesh->getBeamCount() > 0); + } + + } + + CModelBooleanObject::CModelBooleanObject(_In_ const ModelResourceID sID, _In_ CModel * pModel) + : CModelObject(sID, pModel), + m_eOperation(eModelBooleanOperation::Union), + m_bCSGModeEnabled(false), + m_nExtractionGridResolution(160) + { + } + + CModelBooleanObject::~CModelBooleanObject() = default; + + void CModelBooleanObject::setBaseObject(_In_ CModelObject * pObject, _In_ const NMATRIX3 & mTransform) + { + if (pObject == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + if (dynamic_cast(pObject) != nullptr) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + if (pObject->getObjectType() != MODELOBJECTTYPE_MODEL) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + if (isBeamLatticeMeshObject(pObject)) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + if (createsBooleanReferenceCycle(pObject, this)) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + + m_pBaseObject = std::make_shared(pObject, mTransform); + } + + CModelObject * CModelBooleanObject::getBaseObject() const + { + return m_pBaseObject ? m_pBaseObject->getObject() : nullptr; + } + + void CModelBooleanObject::setBaseTransform(_In_ const NMATRIX3 & mTransform) + { + if (!m_pBaseObject) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + + m_pBaseObject->setTransform(mTransform); + } + + NMATRIX3 CModelBooleanObject::getBaseTransform() const + { + return m_pBaseObject ? m_pBaseObject->getTransform() : fnMATRIX3_identity(); + } + + void CModelBooleanObject::setOperation(_In_ eModelBooleanOperation eOperation) + { + m_eOperation = eOperation; + } + + eModelBooleanOperation CModelBooleanObject::getOperation() const + { + return m_eOperation; + } + + std::string CModelBooleanObject::getOperationString() const + { + switch (m_eOperation) { + case eModelBooleanOperation::Union: + return XML_3MF_VALUE_BOOLEAN_OPERATION_UNION; + case eModelBooleanOperation::Difference: + return XML_3MF_VALUE_BOOLEAN_OPERATION_DIFFERENCE; + case eModelBooleanOperation::Intersection: + return XML_3MF_VALUE_BOOLEAN_OPERATION_INTERSECTION; + } + + return XML_3MF_VALUE_BOOLEAN_OPERATION_UNION; + } + + nfBool CModelBooleanObject::setOperationString(_In_ const std::string & sOperation, _In_ nfBool bRaiseException) + { + if (sOperation == XML_3MF_VALUE_BOOLEAN_OPERATION_UNION) { + m_eOperation = eModelBooleanOperation::Union; + return true; + } + if (sOperation == XML_3MF_VALUE_BOOLEAN_OPERATION_DIFFERENCE) { + m_eOperation = eModelBooleanOperation::Difference; + return true; + } + if (sOperation == XML_3MF_VALUE_BOOLEAN_OPERATION_INTERSECTION) { + m_eOperation = eModelBooleanOperation::Intersection; + return true; + } + + if (bRaiseException) + throw CNMRException(NMR_ERROR_NAMESPACE_INVALID_ATTRIBUTE); + + return false; + } + + void CModelBooleanObject::setCSGModeEnabled(_In_ nfBool bEnabled) + { + m_bCSGModeEnabled = bEnabled; + } + + nfBool CModelBooleanObject::getCSGModeEnabled() const + { + return m_bCSGModeEnabled; + } + + void CModelBooleanObject::setExtractionGridResolution(_In_ nfUint32 nGridResolution) + { + if (nGridResolution < 2) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + m_nExtractionGridResolution = nGridResolution; + } + + nfUint32 CModelBooleanObject::getExtractionGridResolution() const + { + return m_nExtractionGridResolution; + } + + void CModelBooleanObject::addOperand(_In_ CModelObject * pObject, _In_ const NMATRIX3 & mTransform) + { + if (pObject == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + if (dynamic_cast(pObject) == nullptr) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + if (pObject->getObjectType() != MODELOBJECTTYPE_MODEL) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + if (isBeamLatticeMeshObject(pObject)) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + + m_Operands.push_back(std::make_shared(pObject, mTransform)); + } + + nfUint32 CModelBooleanObject::getOperandCount() const + { + return (nfUint32)m_Operands.size(); + } + + PModelComponent CModelBooleanObject::getOperand(_In_ nfUint32 nIdx) const + { + if (nIdx >= m_Operands.size()) + throw CNMRException(NMR_ERROR_INVALIDINDEX); + + return m_Operands[nIdx]; + } + + void CModelBooleanObject::mergeToMesh(_In_ CMesh * pMesh, _In_ const NMATRIX3 mMatrix) + { + if (pMesh == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + if (!m_pBaseObject) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + if (!m_bCSGModeEnabled && m_eOperation != eModelBooleanOperation::Union) + throw CNMRException(NMR_ERROR_NOTIMPLEMENTED); + + PMesh pWorkingMesh = std::make_shared(); + m_pBaseObject->mergeToMesh(pWorkingMesh.get(), mMatrix); + std::vector operandMeshes; + operandMeshes.reserve(m_Operands.size()); + + for (const auto & operand : m_Operands) { + if (!operand) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + auto pOperandMesh = std::make_shared(); + operand->mergeToMesh(pOperandMesh.get(), mMatrix); + operandMeshes.push_back(pOperandMesh); + } + + if (m_bCSGModeEnabled) { + PMesh pCsgMesh = std::make_shared(); + CBooleanEngine::evaluate(pWorkingMesh.get(), operandMeshes, m_eOperation, pCsgMesh.get(), m_nExtractionGridResolution); + pMesh->mergeMesh(pCsgMesh.get(), fnMATRIX3_identity()); + return; + } + + // Temporary realization path: flatten referenced meshes with transforms. + // This is exact for union; difference and intersection require the CSG path. + for (const auto & operandMesh : operandMeshes) + pWorkingMesh->mergeMesh(operandMesh.get(), fnMATRIX3_identity()); + + pMesh->mergeMesh(pWorkingMesh.get(), fnMATRIX3_identity()); + } + + nfBool CModelBooleanObject::isValid() + { + if (!m_pBaseObject || m_Operands.empty()) + return false; + + auto pBase = m_pBaseObject->getObject(); + if (!pBase) + return false; + + if (dynamic_cast(pBase) != nullptr) + return false; + if (pBase->getObjectType() != MODELOBJECTTYPE_MODEL) + return false; + if (isBeamLatticeMeshObject(pBase)) + return false; + + for (const auto & operand : m_Operands) { + if (dynamic_cast(operand->getObject()) == nullptr) + return false; + if (operand->getObject()->getObjectType() != MODELOBJECTTYPE_MODEL) + return false; + if (isBeamLatticeMeshObject(operand->getObject())) + return false; + } + + return true; + } + + void CModelBooleanObject::calculateComponentDepthLevel(nfUint32 nLevel) + { + CModelObject::calculateComponentDepthLevel(nLevel); + + if (m_pBaseObject && m_pBaseObject->getObject()) + m_pBaseObject->getObject()->calculateComponentDepthLevel(nLevel + 1); + + for (const auto & operand : m_Operands) { + if (operand && operand->getObject()) + operand->getObject()->calculateComponentDepthLevel(nLevel + 1); + } + } + + nfBool CModelBooleanObject::hasSlices(nfBool bRecursive) + { + if (!bRecursive) + return (this->getSliceStack().get() != nullptr); + + if (this->getSliceStack().get() != nullptr) + return true; + + if (m_pBaseObject && m_pBaseObject->getObject()->hasSlices(true)) + return true; + + for (const auto & operand : m_Operands) { + if (operand->getObject()->hasSlices(true)) + return true; + } + + return false; + } + + nfBool CModelBooleanObject::isValidForSlices(const NMATRIX3& totalParentMatrix) + { + if (this->getSliceStack().get() && !fnMATRIX3_isplanar(totalParentMatrix)) + return false; + + if (m_pBaseObject) { + auto baseMatrix = fnMATRIX3_multiply(totalParentMatrix, m_pBaseObject->getTransform()); + if (!m_pBaseObject->getObject()->isValidForSlices(baseMatrix)) + return false; + } + + for (const auto & operand : m_Operands) { + auto operandMatrix = fnMATRIX3_multiply(totalParentMatrix, operand->getTransform()); + if (!operand->getObject()->isValidForSlices(operandMatrix)) + return false; + } + + return true; + } + + void CModelBooleanObject::extendOutbox(_Out_ NOUTBOX3& vOutBox, _In_ const NMATRIX3 mAccumulatedMatrix) + { + if (m_pBaseObject) { + m_pBaseObject->getObject()->extendOutbox(vOutBox, fnMATRIX3_multiply(mAccumulatedMatrix, m_pBaseObject->getTransform())); + } + + for (const auto & operand : m_Operands) { + operand->getObject()->extendOutbox(vOutBox, fnMATRIX3_multiply(mAccumulatedMatrix, operand->getTransform())); + } + } + + ResourceDependencies CModelBooleanObject::getDependencies() + { + ResourceDependencies dependencies; + + if (m_pBaseObject && m_pBaseObject->getObject()) + dependencies.push_back(m_pBaseObject->getObject()->getPackageResourceID()); + + for (const auto & operand : m_Operands) { + if (operand->getObject()) + dependencies.push_back(operand->getObject()->getPackageResourceID()); + } + + return dependencies; + } +} diff --git a/Source/Model/Classes/NMR_ModelImplicitFunction.cpp b/Source/Model/Classes/NMR_ModelImplicitFunction.cpp index 448ccb208..dd5f96841 100644 --- a/Source/Model/Classes/NMR_ModelImplicitFunction.cpp +++ b/Source/Model/Classes/NMR_ModelImplicitFunction.cpp @@ -360,7 +360,6 @@ namespace NMR if (sourceNode) { auto const& sourceNodeIdentifier = sourceNode->getIdentifier(); - auto const& sourcePortIdentifier = sourcePort->getIdentifier(); graph::Identifier const sourceIndex = identifierToIndex[sourceNodeIdentifier]; graph::Identifier const targetIndex = identifierToIndex[node->getIdentifier()]; if (sourceIndex >= graph.getSize()) diff --git a/Source/Model/Classes/NMR_ModelImplicitNode.cpp b/Source/Model/Classes/NMR_ModelImplicitNode.cpp index 1735a79e0..626f4b7d4 100644 --- a/Source/Model/Classes/NMR_ModelImplicitNode.cpp +++ b/Source/Model/Classes/NMR_ModelImplicitNode.cpp @@ -155,13 +155,15 @@ namespace NMR void NMR::CModelImplicitNode::setConstant(double value) { if (m_type != Lib3MF::eImplicitNodeType::Constant) - throw CNMRException(NMR_ERROR_INVALIDPARAM); + throw CNMRException(NMR_ERROR_INVALIDPARAM, + "setConstant can only be called on Constant nodes"); m_constant = value; } double CModelImplicitNode::getConstant() const { if (m_type != Lib3MF::eImplicitNodeType::Constant) - throw CNMRException(NMR_ERROR_INVALIDPARAM); + throw CNMRException(NMR_ERROR_INVALIDPARAM, + "getConstant can only be called on Constant nodes"); return m_constant; } @@ -169,48 +171,56 @@ namespace NMR void NMR::CModelImplicitNode::setVector(const Lib3MF::sVector & value) { if (m_type != Lib3MF::eImplicitNodeType::ConstVec) - throw CNMRException(NMR_ERROR_INVALIDPARAM); + throw CNMRException(NMR_ERROR_INVALIDPARAM, + "setVector can only be called on ConstVec nodes"); m_vector = std::unique_ptr(new Lib3MF::sVector(value)); } Lib3MF::sVector CModelImplicitNode::getVector() const { if (m_type != Lib3MF::eImplicitNodeType::ConstVec) - throw CNMRException(NMR_ERROR_INVALIDPARAM); + throw CNMRException(NMR_ERROR_INVALIDPARAM, + "getVector can only be called on ConstVec nodes"); if (!m_vector) - throw CNMRException(NMR_ERROR_INVALIDPARAM); + throw CNMRException(NMR_ERROR_INVALIDPARAM, + "getVector: vector value not initialized"); return *m_vector; } void CModelImplicitNode::setMatrix(const Lib3MF::sMatrix4x4 & value) { if (m_type != Lib3MF::eImplicitNodeType::ConstMat) - throw CNMRException(NMR_ERROR_INVALIDPARAM); + throw CNMRException(NMR_ERROR_INVALIDPARAM, + "setMatrix can only be called on ConstMat nodes"); m_matrix = std::unique_ptr(new Lib3MF::sMatrix4x4(value)); } Lib3MF::sMatrix4x4 CModelImplicitNode::getMatrix() const { if (m_type != Lib3MF::eImplicitNodeType::ConstMat) - throw CNMRException(NMR_ERROR_INVALIDPARAM); + throw CNMRException(NMR_ERROR_INVALIDPARAM, + "getMatrix can only be called on ConstMat nodes"); if (!m_matrix) - throw CNMRException(NMR_ERROR_INVALIDPARAM); + throw CNMRException(NMR_ERROR_INVALIDPARAM, + "getMatrix: matrix value not initialized"); return *m_matrix; } void CModelImplicitNode::setModelResourceID(ModelResourceID resourceID) { if (m_type != Lib3MF::eImplicitNodeType::ConstResourceID) - throw CNMRException(NMR_ERROR_INVALIDPARAM); + throw CNMRException(NMR_ERROR_INVALIDPARAM, + "setModelResourceID can only be called on ConstResourceID nodes"); m_modelResourceID = resourceID; } ModelResourceID CModelImplicitNode::getModelResourceID() const { if (m_type != Lib3MF::eImplicitNodeType::ConstResourceID) - throw CNMRException(NMR_ERROR_INVALIDPARAM); + throw CNMRException(NMR_ERROR_INVALIDPARAM, + "getModelResourceID can only be called on ConstResourceID nodes"); return m_modelResourceID; } @@ -232,6 +242,58 @@ namespace NMR return model->findResource(model->currentPath(), m_modelResourceID); } + void CModelImplicitNode::setAccurateRange(double accurateRange) + { + if (m_type != Lib3MF::eImplicitNodeType::BeamLattice) + throw CNMRException(NMR_ERROR_INVALIDPARAM, + "setAccurateRange can only be called on BeamLattice nodes"); + m_accurateRange = std::max(0.0, accurateRange); // Clamp to >= 0.0 per schema + } + + double CModelImplicitNode::getAccurateRange() const + { + if (m_type != Lib3MF::eImplicitNodeType::BeamLattice) + throw CNMRException(NMR_ERROR_INVALIDPARAM, + "getAccurateRange can only be called on BeamLattice nodes"); + return m_accurateRange; + } + + void CModelImplicitNode::setScalarOutputName(const std::string& name) + { + if (m_type != Lib3MF::eImplicitNodeType::FunctionGradient && + m_type != Lib3MF::eImplicitNodeType::NormalizeDistance) + throw CNMRException(NMR_ERROR_INVALIDPARAM, + "setScalarOutputName can only be called on FunctionGradient or NormalizeDistance nodes"); + m_scalarOutputName = name; + } + + std::string CModelImplicitNode::getScalarOutputName() const + { + if (m_type != Lib3MF::eImplicitNodeType::FunctionGradient && + m_type != Lib3MF::eImplicitNodeType::NormalizeDistance) + throw CNMRException(NMR_ERROR_INVALIDPARAM, + "getScalarOutputName can only be called on FunctionGradient or NormalizeDistance nodes"); + return m_scalarOutputName; + } + + void CModelImplicitNode::setVectorInputName(const std::string& name) + { + if (m_type != Lib3MF::eImplicitNodeType::FunctionGradient && + m_type != Lib3MF::eImplicitNodeType::NormalizeDistance) + throw CNMRException(NMR_ERROR_INVALIDPARAM, + "setVectorInputName can only be called on FunctionGradient or NormalizeDistance nodes"); + m_vectorInputName = name; + } + + std::string CModelImplicitNode::getVectorInputName() const + { + if (m_type != Lib3MF::eImplicitNodeType::FunctionGradient && + m_type != Lib3MF::eImplicitNodeType::NormalizeDistance) + throw CNMRException(NMR_ERROR_INVALIDPARAM, + "getVectorInputName can only be called on FunctionGradient or NormalizeDistance nodes"); + return m_vectorInputName; + } + bool CModelImplicitNode::arePortsValid() const { return m_parent->getNodeTypes().arePortsValidForNode(*this); diff --git a/Source/Model/Classes/NMR_ModelLevelSetObject.cpp b/Source/Model/Classes/NMR_ModelLevelSetObject.cpp index 59eb36387..48593725c 100644 --- a/Source/Model/Classes/NMR_ModelLevelSetObject.cpp +++ b/Source/Model/Classes/NMR_ModelLevelSetObject.cpp @@ -189,6 +189,7 @@ namespace NMR if (m_pVolumeData) { + dependencies.push_back(m_pVolumeData->getPackageResourceID()); // concatenate dependencies auto volumeDataDependencies = m_pVolumeData->getDependencies(); dependencies.insert(dependencies.end(), volumeDataDependencies.begin(), volumeDataDependencies.end()); diff --git a/Source/Model/Reader/BeamLattice1702/NMR_ModelReaderNode_BeamLattice1702_Ball.cpp b/Source/Model/Reader/BeamLattice1702/NMR_ModelReaderNode_BeamLattice1702_Ball.cpp index 0d8d4b578..abb926f07 100644 --- a/Source/Model/Reader/BeamLattice1702/NMR_ModelReaderNode_BeamLattice1702_Ball.cpp +++ b/Source/Model/Reader/BeamLattice1702/NMR_ModelReaderNode_BeamLattice1702_Ball.cpp @@ -47,7 +47,10 @@ namespace NMR { return eModelBeamLatticeBallMode::MODELBEAMLATTICEBALLMODE_MIXED; if (strcmp(ballModeStr, XML_3MF_BEAMLATTICE_BALLMODE_ALL) == 0) return eModelBeamLatticeBallMode::MODELBEAMLATTICEBALLMODE_ALL; - return eModelBeamLatticeBallMode::MODELBEAMLATTICEBALLMODE_NONE; + if (strcmp(ballModeStr, XML_3MF_BEAMLATTICE_BALLMODE_NONE) == 0) + return eModelBeamLatticeBallMode::MODELBEAMLATTICEBALLMODE_NONE; + // Invalid ballmode value + throw CNMRException(NMR_ERROR_BEAMLATTICEINVALIDATTRIBUTE); } CModelReaderNode_BeamLattice1702_Ball::CModelReaderNode_BeamLattice1702_Ball(_In_ CModel* pModel, _In_ PModelWarnings pWarnings) diff --git a/Source/Model/Reader/BeamLattice1702/NMR_ModelReaderNode_BeamLattice1702_Balls.cpp b/Source/Model/Reader/BeamLattice1702/NMR_ModelReaderNode_BeamLattice1702_Balls.cpp index 9aeb5b447..093d14f3a 100644 --- a/Source/Model/Reader/BeamLattice1702/NMR_ModelReaderNode_BeamLattice1702_Balls.cpp +++ b/Source/Model/Reader/BeamLattice1702/NMR_ModelReaderNode_BeamLattice1702_Balls.cpp @@ -76,7 +76,7 @@ namespace NMR { __NMRASSERT(pXMLReader); __NMRASSERT(pNameSpace); - if (strcmp(pNameSpace, XML_3MF_NAMESPACE_BEAMLATTICESPEC) == 0) { + if ((strcmp(pNameSpace, XML_3MF_NAMESPACE_BEAMLATTICESPEC) == 0) || (strcmp(pNameSpace, XML_3MF_NAMESPACE_BEAMLATTICEBALLSSPEC) == 0)) { if (strcmp(pChildName, XML_3MF_ELEMENT_BALL) == 0) { // Parse XML PModelReaderNode_BeamLattice1702_Ball pXMLNode = std::make_shared(m_pModel, m_pWarnings); diff --git a/Source/Model/Reader/BeamLattice1702/NMR_ModelReaderNode_BeamLattice1702_BeamLattice.cpp b/Source/Model/Reader/BeamLattice1702/NMR_ModelReaderNode_BeamLattice1702_BeamLattice.cpp index 37c2ce3c0..4c0a0dc8d 100644 --- a/Source/Model/Reader/BeamLattice1702/NMR_ModelReaderNode_BeamLattice1702_BeamLattice.cpp +++ b/Source/Model/Reader/BeamLattice1702/NMR_ModelReaderNode_BeamLattice1702_BeamLattice.cpp @@ -93,7 +93,7 @@ namespace NMR { void CModelReaderNode_BeamLattice1702_BeamLattice::validateBallOptions(_In_ PModelWarnings pWarnings) { if (m_pMesh->getBeamLatticeBallMode() != eModelBeamLatticeBallMode::MODELBEAMLATTICEBALLMODE_NONE) { - if (m_pMesh->getDefaultBallRadius() <= 0 && m_pMesh->getDefaultBallRadius() >= XML_3MF_MAXIMUMCOORDINATEVALUE) { + if (m_pMesh->getDefaultBallRadius() <= 0 || m_pMesh->getDefaultBallRadius() >= XML_3MF_MAXIMUMCOORDINATEVALUE) { pWarnings->addException(CNMRException(NMR_ERROR_BEAMLATTICEINVALIDATTRIBUTE), mrwInvalidOptionalValue); } } @@ -161,8 +161,27 @@ namespace NMR { void CModelReaderNode_BeamLattice1702_BeamLattice::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) { - + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + __NMRASSERT(pNameSpace); + // Accept namespaced ball attributes (balls extension namespace) + if (strcmp(pNameSpace, XML_3MF_NAMESPACE_BEAMLATTICEBALLSSPEC) == 0) { + if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_BEAMLATTICE_BALLMODE) == 0) { + m_pMesh->setBeamLatticeBallMode(stringToBallMode(pAttributeValue)); + } + else if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_BEAMLATTICE_BALLRADIUS) == 0) { + nfDouble dValue = fnStringToDouble(pAttributeValue); + if (std::isnan(dValue) || (dValue <= 0) || (dValue > XML_3MF_MAXIMUMCOORDINATEVALUE)) + throw CNMRException(NMR_ERROR_BEAMLATTICEINVALIDATTRIBUTE); + m_dDefaultBallRadius = dValue; + m_pMesh->setDefaultBallRadius(dValue); + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ATTRIBUTE), mrwInvalidOptionalValue); + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ATTRIBUTE), mrwInvalidOptionalValue); } void CModelReaderNode_BeamLattice1702_BeamLattice::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) @@ -171,7 +190,7 @@ namespace NMR { __NMRASSERT(pXMLReader); __NMRASSERT(pNameSpace); - if (strcmp(pNameSpace, XML_3MF_NAMESPACE_BEAMLATTICESPEC) == 0) { + if ((strcmp(pNameSpace, XML_3MF_NAMESPACE_BEAMLATTICESPEC) == 0) || (strcmp(pNameSpace, XML_3MF_NAMESPACE_BEAMLATTICEBALLSSPEC) == 0)) { if (strcmp(pChildName, XML_3MF_ELEMENT_BEAMS) == 0) { PModelReaderNode pXMLNode = std::make_shared(m_pModel, m_pMesh, m_dDefaultRadius, m_eDefaultCapMode, m_pWarnings); diff --git a/Source/Model/Reader/Boolean2307/NMR_ModelReaderNode_Boolean2307_Boolean.cpp b/Source/Model/Reader/Boolean2307/NMR_ModelReaderNode_Boolean2307_Boolean.cpp new file mode 100644 index 000000000..242ddd3d8 --- /dev/null +++ b/Source/Model/Reader/Boolean2307/NMR_ModelReaderNode_Boolean2307_Boolean.cpp @@ -0,0 +1,92 @@ +/*++ +--*/ +#include "Model/Reader/Boolean2307/NMR_ModelReaderNode_Boolean2307_Boolean.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" +#include "Common/Math/NMR_Matrix.h" + +namespace NMR { + CModelReaderNode_Boolean2307_Boolean::CModelReaderNode_Boolean2307_Boolean(_In_ CModel * pModel, _In_ PModelWarnings pWarnings) + : CModelReaderNode(pWarnings), m_pModel(pModel), m_nObjectID(0), m_bHasObjectID(false), m_bHasTransform(false), m_bHasPath(false), m_mTransform(fnMATRIX3_identity()) + { + } + + void CModelReaderNode_Boolean2307_Boolean::parseXML(_In_ CXmlReader * pXMLReader) + { + parseName(pXMLReader); + parseAttributes(pXMLReader); + if (m_bHasPath && !pXMLReader->NamespaceRegistered(XML_3MF_NAMESPACE_PRODUCTIONSPEC)) + throw CNMRException(NMR_ERROR_PRODUCTIONEXTENSION_REQUIRED); + parseContent(pXMLReader); + } + + void CModelReaderNode_Boolean2307_Boolean::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_BOOLEAN_OBJECTID) == 0) { + if (m_bHasObjectID) + throw CNMRException(NMR_ERROR_DUPLICATECOMPONENTOBJECTID); + m_nObjectID = fnStringToUint32(pAttributeValue); + m_bHasObjectID = true; + } + else if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_BOOLEAN_TRANSFORM) == 0) { + if (m_bHasTransform) + throw CNMRException(NMR_ERROR_DUPLICATETRANSFORM); + m_mTransform = fnMATRIX3_fromString(pAttributeValue); + m_bHasTransform = true; + } + else if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_BOOLEAN_PATH) == 0) { + if (m_bHasPath) + throw CNMRException(NMR_ERROR_DUPLICATEPATH); + m_sPath = pAttributeValue; + if (!fnStartsWithPathDelimiter(m_sPath)) + m_pWarnings->addException(CNMRException(NMR_ERROR_PATH_NOT_ABSOLUTE), mrwInvalidOptionalValue); + m_bHasPath = true; + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ATTRIBUTE), mrwInvalidOptionalValue); + } + + void CModelReaderNode_Boolean2307_Boolean::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + if (strcmp(pNameSpace, XML_3MF_NAMESPACE_PRODUCTIONSPEC) == 0) { + if (strcmp(pAttributeName, XML_3MF_PRODUCTION_PATH) == 0) { + if (m_bHasPath) + throw CNMRException(NMR_ERROR_DUPLICATEPATH); + m_sPath = pAttributeValue; + if (!fnStartsWithPathDelimiter(m_sPath)) + m_pWarnings->addException(CNMRException(NMR_ERROR_PATH_NOT_ABSOLUTE), mrwInvalidOptionalValue); + m_bHasPath = true; + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ATTRIBUTE), mrwInvalidOptionalValue); + } + } + + CModelObject * CModelReaderNode_Boolean2307_Boolean::getObject() + { + if (!m_bHasObjectID) + throw CNMRException(NMR_ERROR_MISSINGMODELOBJECTID); + + PPackageResourceID pRID; + if (m_bHasPath) { + if (m_pModel->currentPath() != m_pModel->rootPath()) + throw CNMRException(NMR_ERROR_REFERENCESTOODEEP); + pRID = m_pModel->findPackageResourceID(m_sPath, m_nObjectID); + } + else { + pRID = m_pModel->findPackageResourceID(m_pModel->currentPath(), m_nObjectID); + } + + if (pRID.get()) + return m_pModel->findObject(pRID->getUniqueID()); + + return nullptr; + } + + NMATRIX3 CModelReaderNode_Boolean2307_Boolean::getTransform() const + { + return m_mTransform; + } +} diff --git a/Source/Model/Reader/Boolean2307/NMR_ModelReaderNode_Boolean2307_BooleanShape.cpp b/Source/Model/Reader/Boolean2307/NMR_ModelReaderNode_Boolean2307_BooleanShape.cpp new file mode 100644 index 000000000..5a5e7bef5 --- /dev/null +++ b/Source/Model/Reader/Boolean2307/NMR_ModelReaderNode_Boolean2307_BooleanShape.cpp @@ -0,0 +1,112 @@ +/*++ +--*/ +#include "Model/Reader/Boolean2307/NMR_ModelReaderNode_Boolean2307_BooleanShape.h" + +#include "Model/Reader/Boolean2307/NMR_ModelReaderNode_Boolean2307_Boolean.h" +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" +#include "Common/Math/NMR_Matrix.h" + +namespace NMR { + CModelReaderNode_Boolean2307_BooleanShape::CModelReaderNode_Boolean2307_BooleanShape(_In_ CModel * pModel, _In_ PModelBooleanObject pBooleanObject, _In_ PModelWarnings pWarnings) + : CModelReaderNode(pWarnings), m_pModel(pModel), m_pBooleanObject(pBooleanObject), m_nObjectID(0), m_bHasObjectID(false), m_bHasTransform(false), m_bHasPath(false), m_mTransform(fnMATRIX3_identity()) + { + } + + void CModelReaderNode_Boolean2307_BooleanShape::parseXML(_In_ CXmlReader * pXMLReader) + { + parseName(pXMLReader); + parseAttributes(pXMLReader); + if (m_bHasPath && !pXMLReader->NamespaceRegistered(XML_3MF_NAMESPACE_PRODUCTIONSPEC)) + throw CNMRException(NMR_ERROR_PRODUCTIONEXTENSION_REQUIRED); + parseContent(pXMLReader); + + if (!m_bHasObjectID) + throw CNMRException(NMR_ERROR_MISSINGMODELOBJECTID); + + PPackageResourceID pRID; + if (m_bHasPath) { + if (m_pModel->currentPath() != m_pModel->rootPath()) + throw CNMRException(NMR_ERROR_REFERENCESTOODEEP); + pRID = m_pModel->findPackageResourceID(m_sPath, m_nObjectID); + } + else { + pRID = m_pModel->findPackageResourceID(m_pModel->currentPath(), m_nObjectID); + } + + auto pObject = pRID ? m_pModel->findObject(pRID->getUniqueID()) : nullptr; + if (!pObject) + throw CNMRException(NMR_ERROR_COULDNOTFINDCOMPONENTOBJECT); + + m_pBooleanObject->setBaseObject(pObject, m_mTransform); + if (m_pBooleanObject->getOperandCount() == 0) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + } + + void CModelReaderNode_Boolean2307_BooleanShape::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_BOOLEAN_OBJECTID) == 0) { + if (m_bHasObjectID) + throw CNMRException(NMR_ERROR_DUPLICATECOMPONENTOBJECTID); + m_nObjectID = fnStringToUint32(pAttributeValue); + m_bHasObjectID = true; + } + else if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_BOOLEAN_TRANSFORM) == 0) { + if (m_bHasTransform) + throw CNMRException(NMR_ERROR_DUPLICATETRANSFORM); + m_mTransform = fnMATRIX3_fromString(pAttributeValue); + m_bHasTransform = true; + } + else if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_BOOLEAN_PATH) == 0) { + if (m_bHasPath) + throw CNMRException(NMR_ERROR_DUPLICATEPATH); + m_sPath = pAttributeValue; + if (!fnStartsWithPathDelimiter(m_sPath)) + m_pWarnings->addException(CNMRException(NMR_ERROR_PATH_NOT_ABSOLUTE), mrwInvalidOptionalValue); + m_bHasPath = true; + } + else if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_BOOLEAN_OPERATION) == 0) { + if (!m_pBooleanObject->setOperationString(pAttributeValue, false)) + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ATTRIBUTE), mrwInvalidOptionalValue); + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ATTRIBUTE), mrwInvalidOptionalValue); + } + + void CModelReaderNode_Boolean2307_BooleanShape::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + if (strcmp(pNameSpace, XML_3MF_NAMESPACE_PRODUCTIONSPEC) == 0) { + if (strcmp(pAttributeName, XML_3MF_PRODUCTION_PATH) == 0) { + if (m_bHasPath) + throw CNMRException(NMR_ERROR_DUPLICATEPATH); + m_sPath = pAttributeValue; + if (!fnStartsWithPathDelimiter(m_sPath)) + m_pWarnings->addException(CNMRException(NMR_ERROR_PATH_NOT_ABSOLUTE), mrwInvalidOptionalValue); + m_bHasPath = true; + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ATTRIBUTE), mrwInvalidOptionalValue); + } + } + + void CModelReaderNode_Boolean2307_BooleanShape::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + if (strcmp(pNameSpace, XML_3MF_NAMESPACE_BOOLEANSPEC) == 0) { + if (strcmp(pChildName, XML_3MF_ELEMENT_BOOLEAN) == 0) { + auto pXMLNode = std::make_shared(m_pModel, m_pWarnings); + pXMLNode->parseXML(pXMLReader); + auto pObject = pXMLNode->getObject(); + if (!pObject) + throw CNMRException(NMR_ERROR_COULDNOTFINDCOMPONENTOBJECT); + m_pBooleanObject->addOperand(pObject, pXMLNode->getTransform()); + } + else { + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ELEMENT), mrwInvalidOptionalValue); + } + } + else { + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ELEMENT), mrwInvalidOptionalValue); + } + } +} diff --git a/Source/Model/Reader/NMR_ModelReaderNode_ModelBase.cpp b/Source/Model/Reader/NMR_ModelReaderNode_ModelBase.cpp index 3fa8cf31e..014731bec 100644 --- a/Source/Model/Reader/NMR_ModelReaderNode_ModelBase.cpp +++ b/Source/Model/Reader/NMR_ModelReaderNode_ModelBase.cpp @@ -85,9 +85,11 @@ namespace NMR { strcmp(sExtensionURI.c_str(), XML_3MF_NAMESPACE_PRODUCTIONSPEC) != 0 && strcmp(sExtensionURI.c_str(), XML_3MF_NAMESPACE_SLICESPEC) != 0 && strcmp(sExtensionURI.c_str(), XML_3MF_NAMESPACE_BEAMLATTICESPEC) != 0 && + strcmp(sExtensionURI.c_str(), XML_3MF_NAMESPACE_BEAMLATTICEBALLSSPEC) != 0 && strcmp(sExtensionURI.c_str(), XML_3MF_NAMESPACE_SECURECONTENTSPEC) != 0 && strcmp(sExtensionURI.c_str(), XML_3MF_NAMESPACE_VOLUMETRICSPEC) != 0 && - strcmp(sExtensionURI.c_str(), XML_3MF_NAMESPACE_IMPLICITSPEC) != 0 + strcmp(sExtensionURI.c_str(), XML_3MF_NAMESPACE_IMPLICITSPEC) != 0 && + strcmp(sExtensionURI.c_str(), XML_3MF_NAMESPACE_BOOLEANSPEC) != 0 ) { m_pWarnings->addWarning(NMR_ERROR_REQUIREDEXTENSIONNOTSUPPORTED, mrwInvalidMandatoryValue); diff --git a/Source/Model/Reader/Volumetric2201/NMR_ModelReaderNode_Implicit_Node.cpp b/Source/Model/Reader/Volumetric2201/NMR_ModelReaderNode_Implicit_Node.cpp index 36d072f29..9be55c852 100644 --- a/Source/Model/Reader/Volumetric2201/NMR_ModelReaderNode_Implicit_Node.cpp +++ b/Source/Model/Reader/Volumetric2201/NMR_ModelReaderNode_Implicit_Node.cpp @@ -147,6 +147,25 @@ namespace NMR m_pImplicitNode->setModelResourceID(std::stoi(pAttributeValue)); } } + else if (m_pImplicitNode->getNodeType() == Lib3MF::eImplicitNodeType::BeamLattice) + { + if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_IMPLICIT_NODE_ACCURATERANGE) == 0) + { + m_pImplicitNode->setAccurateRange(strtod(pAttributeValue, nullptr)); + } + } + else if (m_pImplicitNode->getNodeType() == Lib3MF::eImplicitNodeType::FunctionGradient || + m_pImplicitNode->getNodeType() == Lib3MF::eImplicitNodeType::NormalizeDistance) + { + if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_IMPLICIT_NODE_SCALAROUTPUT) == 0) + { + m_pImplicitNode->setScalarOutputName(pAttributeValue); + } + else if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_IMPLICIT_NODE_VECTORINPUT) == 0) + { + m_pImplicitNode->setVectorInputName(pAttributeValue); + } + } } void NMR::CModelReaderNode_Implicit_Node::OnNSChildElement(_In_z_ const nfChar * pChildName, diff --git a/Source/Model/Reader/v100/NMR_ModelReaderNode100_Object.cpp b/Source/Model/Reader/v100/NMR_ModelReaderNode100_Object.cpp index 2fca11dfa..43852174d 100644 --- a/Source/Model/Reader/v100/NMR_ModelReaderNode100_Object.cpp +++ b/Source/Model/Reader/v100/NMR_ModelReaderNode100_Object.cpp @@ -36,10 +36,12 @@ Stream. #include "Model/Reader/v100/NMR_ModelReaderNode100_Mesh.h" #include "Model/Reader/v100/NMR_ModelReaderNode100_MetaDataGroup.h" #include "Model/Reader/v100/NMR_ModelReaderNode100_Components.h" +#include "Model/Reader/Boolean2307/NMR_ModelReaderNode_Boolean2307_BooleanShape.h" #include "Model/Reader/Volumetric2201/NMR_ModelReaderNode_LevelSet.h" #include "Model/Classes/NMR_ModelConstants.h" #include "Model/Classes/NMR_ModelMeshObject.h" +#include "Model/Classes/NMR_ModelBooleanObject.h" #include "Model/Classes/NMR_ModelAttachment.h" #include "Common/NMR_StringUtils.h" @@ -344,6 +346,32 @@ namespace NMR { mrwInvalidOptionalValue); } } + if (strcmp(pNameSpace, XML_3MF_NAMESPACE_BOOLEANSPEC) == 0) + { + if (strcmp(pChildName, XML_3MF_ELEMENT_BOOLEANSHAPE) == 0) + { + if (m_pObject.get()) + throw CNMRException(NMR_ERROR_AMBIGUOUSOBJECTDEFINITON); + + auto booleanObject = std::make_shared(m_nID, m_pModel); + m_pObject = booleanObject; + if (m_bHasType) { + if (!m_pObject->setObjectTypeString(m_sType, false)) + m_pWarnings->addWarning(NMR_ERROR_INVALIDMODELOBJECTTYPE, mrwInvalidOptionalValue); + } + + auto pXMLNode = std::make_shared(m_pModel, booleanObject, m_pWarnings); + pXMLNode->parseXML(pXMLReader); + m_pModel->addResource(m_pObject); + + if (m_bHasDefaultPropertyIndex || m_bHasDefaultPropertyID) + m_pWarnings->addException(CNMRException(NMR_ERROR_OBJECTLEVELPID_ON_BOOLEANOBJECT), mrwInvalidOptionalValue); + } + else + { + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ELEMENT), mrwInvalidOptionalValue); + } + } } // Create the object-level property from m_nObjectLevelPropertyID, if defined diff --git a/Source/Model/Writer/NMR_ModelWriterNode_Implicit.cpp b/Source/Model/Writer/NMR_ModelWriterNode_Implicit.cpp index b718bd400..19dd22119 100644 --- a/Source/Model/Writer/NMR_ModelWriterNode_Implicit.cpp +++ b/Source/Model/Writer/NMR_ModelWriterNode_Implicit.cpp @@ -149,6 +149,22 @@ namespace NMR } } + else if (node.getNodeType() == Lib3MF::eImplicitNodeType::BeamLattice) + { + // Only write accuraterange if non-zero (default is 0.0) + double accurateRange = node.getAccurateRange(); + if (accurateRange != 0.0) + { + writeDoubleAttribute(XML_3MF_ATTRIBUTE_IMPLICIT_NODE_ACCURATERANGE, accurateRange); + } + } + else if (node.getNodeType() == Lib3MF::eImplicitNodeType::FunctionGradient || + node.getNodeType() == Lib3MF::eImplicitNodeType::NormalizeDistance) + { + // These attributes are required per schema + writeStringAttribute(XML_3MF_ATTRIBUTE_IMPLICIT_NODE_SCALAROUTPUT, node.getScalarOutputName()); + writeStringAttribute(XML_3MF_ATTRIBUTE_IMPLICIT_NODE_VECTORINPUT, node.getVectorInputName()); + } bool const isNodeWithoutInputs = node.getNodeType() == Lib3MF::eImplicitNodeType::Constant || node.getNodeType() == Lib3MF::eImplicitNodeType::ConstVec || diff --git a/Source/Model/Writer/v100/NMR_ModelWriterNode100_Mesh.cpp b/Source/Model/Writer/v100/NMR_ModelWriterNode100_Mesh.cpp index 6894fd12e..633cee214 100644 --- a/Source/Model/Writer/v100/NMR_ModelWriterNode100_Mesh.cpp +++ b/Source/Model/Writer/v100/NMR_ModelWriterNode100_Mesh.cpp @@ -51,7 +51,7 @@ This is the class for exporting the 3mf mesh node. namespace NMR { CModelWriterNode100_Mesh::CModelWriterNode100_Mesh(_In_ CModelMeshObject * pModelMeshObject, _In_ CXmlWriter * pXMLWriter, _In_ PProgressMonitor pProgressMonitor, - _In_ PMeshInformation_PropertyIndexMapping pPropertyIndexMapping, _In_ int nPosAfterDecPoint, _In_ nfBool bWriteMaterialExtension, _In_ nfBool bWriteBeamLatticeExtension, _In_ nfBool bWriteVolumetricExtension, _In_ nfBool bWriteTriangleSetExtension) + _In_ PMeshInformation_PropertyIndexMapping pPropertyIndexMapping, _In_ int nPosAfterDecPoint, _In_ nfBool bWriteMaterialExtension, _In_ nfBool bWriteBeamLatticeExtension, _In_ nfBool bWriteBeamLatticeBallsExtension, _In_ nfBool bWriteVolumetricExtension, _In_ nfBool bWriteTriangleSetExtension) :CModelWriterNode_ModelBase(pModelMeshObject->getModel(), pXMLWriter, pProgressMonitor), m_nPosAfterDecPoint(nPosAfterDecPoint), m_nPutDoubleFactor((nfInt64)(pow(10, CModelWriterNode100_Mesh::m_nPosAfterDecPoint))) { __NMRASSERT(pModelMeshObject != nullptr); @@ -60,6 +60,7 @@ namespace NMR { m_bWriteMaterialExtension = bWriteMaterialExtension; m_bWriteBeamLatticeExtension = bWriteBeamLatticeExtension; + m_bWriteBeamLatticeBallsExtension = bWriteBeamLatticeBallsExtension; m_bWriteVolumetricExtension = bWriteVolumetricExtension; m_bWriteTriangleSetExtension = bWriteTriangleSetExtension; @@ -366,7 +367,7 @@ namespace NMR { // write beamlattice: balls // Only if there is at least 1 ball if (bWriteBallsElement) { - writeStartElementWithPrefix(XML_3MF_ELEMENT_BALLS, XML_3MF_NAMESPACEPREFIX_BEAMLATTICE); + writeStartElementWithPrefix(XML_3MF_ELEMENT_BALLS, XML_3MF_NAMESPACEPREFIX_BEAMLATTICEBALLS); for (nBallIndex = 0; nBallIndex < nBallCount; nBallIndex++) { // write beamlattice: ball MESHBALL * pMeshBall = pMesh->getBall(nBallIndex); diff --git a/Source/Model/Writer/v100/NMR_ModelWriterNode100_Model.cpp b/Source/Model/Writer/v100/NMR_ModelWriterNode100_Model.cpp index fc586f66d..01e0bb5dd 100644 --- a/Source/Model/Writer/v100/NMR_ModelWriterNode100_Model.cpp +++ b/Source/Model/Writer/v100/NMR_ModelWriterNode100_Model.cpp @@ -49,6 +49,7 @@ This is the class for exporting the 3mf model stream root node. #include "Model/Classes/NMR_ModelMultiPropertyGroup.h" #include "Model/Classes/NMR_ModelMeshObject.h" #include "Model/Classes/NMR_ModelComponentsObject.h" +#include "Model/Classes/NMR_ModelBooleanObject.h" #include "Model/Classes/NMR_Model.h" #include "Common/NMR_Exception.h" #include "Common/NMR_Exception_Windows.h" @@ -78,6 +79,7 @@ namespace NMR { m_bWriteMaterialExtension = true; m_bWriteProductionExtension = true; m_bWriteBeamLatticeExtension = true; + m_bWriteBeamLatticeBallsExtension = false; m_bWriteSliceExtension = true; m_bWriteSecureContentExtension = true; m_bWriteTriangleSetExtension = true; @@ -85,6 +87,7 @@ namespace NMR { m_bWriteObjects = true; m_bWriteVolumetricExtension = true; m_bWriteImplicitExtension = true; + m_bWriteBooleanExtension = false; m_bWriteCustomNamespaces = true; @@ -131,6 +134,9 @@ namespace NMR { { std::string sLanguage = m_pModel->getLanguage(); + // Detect required extensions before writing namespace declarations + detectRequiredExtensions(); + writeStartElementWithNamespace(XML_3MF_ELEMENT_MODEL, PACKAGE_XMLNS_100); writeStringAttribute(XML_3MF_ATTRIBUTE_MODEL_UNIT, m_pModel->getUnitString()); @@ -158,6 +164,16 @@ namespace NMR { } } + if (m_bWriteBeamLatticeBallsExtension) { + writeConstPrefixedStringAttribute(XML_3MF_ATTRIBUTE_XMLNS, XML_3MF_NAMESPACEPREFIX_BEAMLATTICEBALLS, XML_3MF_NAMESPACE_BEAMLATTICEBALLSSPEC); + + if (m_pModel->RequireExtension(XML_3MF_NAMESPACE_BEAMLATTICEBALLSSPEC)) { + if (sRequiredExtensions.size() > 0) + sRequiredExtensions = sRequiredExtensions + " "; + sRequiredExtensions = sRequiredExtensions + XML_3MF_NAMESPACEPREFIX_BEAMLATTICEBALLS; + } + } + if (m_bWriteSliceExtension) { writeConstPrefixedStringAttribute(XML_3MF_ATTRIBUTE_XMLNS, XML_3MF_NAMESPACEPREFIX_SLICE, XML_3MF_NAMESPACE_SLICESPEC); if (m_pModel->RequireExtension(XML_3MF_NAMESPACE_SLICESPEC)) { @@ -203,6 +219,15 @@ namespace NMR { } } + if (m_bWriteBooleanExtension) { + writeConstPrefixedStringAttribute(XML_3MF_ATTRIBUTE_XMLNS, XML_3MF_NAMESPACEPREFIX_BOOLEAN, XML_3MF_NAMESPACE_BOOLEANSPEC); + if (m_pModel->RequireExtension(XML_3MF_NAMESPACE_BOOLEANSPEC)) { + if (sRequiredExtensions.size() > 0) + sRequiredExtensions = sRequiredExtensions + " "; + sRequiredExtensions = sRequiredExtensions + XML_3MF_NAMESPACEPREFIX_BOOLEAN; + } + } + if (m_bWriteCustomNamespaces) { nfUint32 nNSCount = m_pXMLWriter->GetNamespaceCount(); for (nfUint32 iNSCount = 0; iNSCount < nNSCount; iNSCount++) { @@ -609,11 +634,13 @@ namespace NMR { if(pMeshObject) { + // Beam lattice balls namespace need already determined in detectRequiredExtensions() + CModelWriterNode100_Mesh ModelWriter_Mesh( pMeshObject, m_pXMLWriter, m_pProgressMonitor, m_pPropertyIndexMapping, m_nDecimalPrecision, m_bWriteMaterialExtension, m_bWriteBeamLatticeExtension, - m_bWriteVolumetricExtension, m_bWriteTriangleSetExtension); + m_bWriteBeamLatticeBallsExtension, m_bWriteVolumetricExtension, m_bWriteTriangleSetExtension); ModelWriter_Mesh.writeToXML(); } @@ -635,6 +662,76 @@ namespace NMR { ModelWriter_LevelSet.writeToXML(); } + CModelBooleanObject * pBooleanObject = + dynamic_cast(&object); + if (pBooleanObject) + { + writeBooleanObject(pBooleanObject); + } + + writeFullEndElement(); + } + + void CModelWriterNode100_Model::writeBooleanObject(_In_ CModelBooleanObject * pBooleanObject) + { + __NMRASSERT(pBooleanObject); + + CModelObject * pBaseObject = pBooleanObject->getBaseObject(); + if (!pBaseObject) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + + PPackageResourceID pBaseObjectID = pBaseObject->getPackageResourceID(); + if (!pBaseObjectID) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + + nfUint32 nOperandCount = pBooleanObject->getOperandCount(); + if (nOperandCount == 0) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + + writeStartElementWithPrefix(XML_3MF_ELEMENT_BOOLEANSHAPE, XML_3MF_NAMESPACEPREFIX_BOOLEAN); + writeIntAttribute(XML_3MF_ATTRIBUTE_BOOLEAN_OBJECTID, pBaseObjectID->getModelResourceID()); + writeStringAttribute(XML_3MF_ATTRIBUTE_BOOLEAN_OPERATION, pBooleanObject->getOperationString()); + if (!fnMATRIX3_isIdentity(pBooleanObject->getBaseTransform())) + writeStringAttribute(XML_3MF_ATTRIBUTE_BOOLEAN_TRANSFORM, fnMATRIX3_toString(pBooleanObject->getBaseTransform())); + + if (pBaseObjectID->getPath() != m_pModel->currentPath()) { + if (m_pModel->currentPath() != m_pModel->rootPath()) { + throw CNMRException(NMR_ERROR_REFERENCESTOODEEP); + } + if (!m_bWriteProductionExtension) { + throw CNMRException(NMR_ERROR_PRODUCTIONEXTENSION_REQUIRED); + } + + writePrefixedStringAttribute(XML_3MF_NAMESPACEPREFIX_PRODUCTION, XML_3MF_PRODUCTION_PATH, pBaseObjectID->getPath()); + } + + for (nfUint32 nIndex = 0; nIndex < nOperandCount; nIndex++) { + PModelComponent pOperand = pBooleanObject->getOperand(nIndex); + CModelObject * pOperandObject = pOperand ? pOperand->getObject() : nullptr; + if (!pOperandObject) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + + PPackageResourceID pOperandObjectID = pOperandObject->getPackageResourceID(); + if (!pOperandObjectID) + throw CNMRException(NMR_ERROR_INVALIDOBJECT); + + writeStartElementWithPrefix(XML_3MF_ELEMENT_BOOLEAN, XML_3MF_NAMESPACEPREFIX_BOOLEAN); + writeIntAttribute(XML_3MF_ATTRIBUTE_BOOLEAN_OBJECTID, pOperandObjectID->getModelResourceID()); + if (pOperandObjectID->getPath() != m_pModel->currentPath()) { + if (m_pModel->currentPath() != m_pModel->rootPath()) { + throw CNMRException(NMR_ERROR_REFERENCESTOODEEP); + } + if (!m_bWriteProductionExtension) { + throw CNMRException(NMR_ERROR_PRODUCTIONEXTENSION_REQUIRED); + } + + writePrefixedStringAttribute(XML_3MF_NAMESPACEPREFIX_PRODUCTION, XML_3MF_PRODUCTION_PATH, pOperandObjectID->getPath()); + } + if (pOperand->hasTransform()) + writeStringAttribute(XML_3MF_ATTRIBUTE_BOOLEAN_TRANSFORM, pOperand->getTransformString()); + writeEndElement(); + } + writeFullEndElement(); } @@ -1229,4 +1326,42 @@ namespace NMR { writeFullEndElement(); } + void CModelWriterNode100_Model::detectRequiredExtensions() + { + std::list objectList = m_pModel->getSortedObjectList(); + + for(auto iIterator = objectList.begin(); iIterator != objectList.end(); iIterator++) + { + CModelObject *pObject = *iIterator; + if (!pObject) + { + continue; + } + + if (dynamic_cast(pObject) != nullptr) { + m_bWriteBooleanExtension = true; + } + + // Check if object is a mesh Object with beam lattice + CModelMeshObject *pMeshObject = dynamic_cast(pObject); + if(pMeshObject) + { + CMesh * pMesh = pMeshObject->getMesh(); + if (pMesh) { + nfUint32 nBallCount = pMesh->getBallCount(); + eModelBeamLatticeBallMode eBallMode = pMesh->getBeamLatticeBallMode(); + + if (nBallCount > 0 || eBallMode != eModelBeamLatticeBallMode::MODELBEAMLATTICEBALLMODE_NONE) { + m_bWriteBeamLatticeBallsExtension = true; + } + } + } + + // The old beam-lattice-balls early exit moved here so the same scan can also find boolean objects. + if (m_bWriteBooleanExtension && m_bWriteBeamLatticeBallsExtension) { + break; + } + } + } + } diff --git a/Tests/CPP_Bindings/CMakeLists.txt b/Tests/CPP_Bindings/CMakeLists.txt index ffdceb7a8..927c041e8 100644 --- a/Tests/CPP_Bindings/CMakeLists.txt +++ b/Tests/CPP_Bindings/CMakeLists.txt @@ -11,10 +11,12 @@ set(SRCS_UNITTEST ./Source/BaseMaterialGroup.cpp ./Source/BeamLattice.cpp ./Source/BeamSets.cpp + ./Source/Boolean.cpp ./Source/BuildItems.cpp ./Source/ColorGroup.cpp ./Source/CompositeMaterials.cpp ./Source/EncryptionMethods.cpp + ./Source/ImplicitNodes.test.cpp ./Source/MeshObject.cpp ./Source/MetaData.cpp ./Source/MetaDataGroup.cpp @@ -38,6 +40,7 @@ set(SRCS_UNITTEST ./Source/UnitTest_Utilities.cpp ./Source/v093.cpp ./Source/Volumetric.cpp + ./Source/ZipBuffer.cpp ./Source/Wrapper.cpp ./Source/Writer.cpp ./Source/TriangleSets.cpp @@ -46,6 +49,12 @@ set(SRCS_UNITTEST set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_BINARY_DIR}) add_executable(${TESTNAME} ${SRCS_UNITTEST} ${GTEST_SRC_FILES}) +if (LIB3MF_ENABLE_EXPENSIVE_TESTS) + target_compile_definitions(${TESTNAME} PRIVATE LIB3MF_ENABLE_EXPENSIVE_TESTS=1) +else() + target_compile_definitions(${TESTNAME} PRIVATE LIB3MF_ENABLE_EXPENSIVE_TESTS=0) +endif() + set(STARTUPPROJECT ${TESTNAME}) target_include_directories(${TESTNAME} PRIVATE @@ -55,6 +64,15 @@ target_include_directories(${TESTNAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR_AUTOGENERATED}/Bindings/Cpp ) +if (USE_INCLUDED_ZLIB) + file(GLOB TEST_ZLIB_FILES "${CMAKE_SOURCE_DIR}/Libraries/zlib/Source/*.c") + target_sources(${TESTNAME} PRIVATE ${TEST_ZLIB_FILES}) + target_include_directories(${TESTNAME} PRIVATE ${CMAKE_SOURCE_DIR}/Libraries/zlib/Include) +else() + find_package(ZLIB REQUIRED) + target_link_libraries(${TESTNAME} PRIVATE ZLIB::ZLIB) +endif() + # pthreads Needed for googletest if (LINUX) set(THREADS_PREFER_PTHREAD_FLAG ON) @@ -62,7 +80,14 @@ find_package(Threads REQUIRED) target_link_libraries(${TESTNAME} PRIVATE Threads::Threads) endif() -target_link_libraries(${TESTNAME} PRIVATE ${PROJECT_NAME} ssl crypto) +if (USE_INCLUDED_SSL) + target_include_directories(${TESTNAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../Libraries/libressl/include) + target_link_libraries(${TESTNAME} PRIVATE ${PROJECT_NAME} ssl crypto) +else() + find_package(OpenSSL REQUIRED) + target_include_directories(${TESTNAME} PRIVATE ${OPENSSL_INCLUDE_DIR}) + target_link_libraries(${TESTNAME} PRIVATE ${PROJECT_NAME} ${OPENSSL_LIBRARIES}) +endif() if (WIN32) target_link_libraries(${TESTNAME} PRIVATE ws2_32) @@ -71,7 +96,15 @@ endif() set_target_properties(${TESTNAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/") -add_test(${TESTNAME} ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}) +# Enable fine-grained GoogleTest discovery instead of one monolithic test entry +include(GoogleTest) +gtest_discover_tests( + ${TESTNAME} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DISCOVERY_TIMEOUT 60 + # Avoid re-running discovery on every build unless sources change + PROPERTIES VS_TEST_CATEGORY "CPP_Bindings" +) find_program(VALGRIND "valgrind") if(VALGRIND) diff --git a/Tests/CPP_Bindings/Source/BeamLattice.cpp b/Tests/CPP_Bindings/Source/BeamLattice.cpp index 7ca63dabd..65d50bdb6 100644 --- a/Tests/CPP_Bindings/Source/BeamLattice.cpp +++ b/Tests/CPP_Bindings/Source/BeamLattice.cpp @@ -665,4 +665,36 @@ namespace Lib3MF Read_Attributes_Negative(GetParam()); } + TEST_F(BeamLattice, Read_BallExtension_TestSuite_P_BXX_2021_06) + { + std::string fName("testsuite_P_BXX_2021_06.3mf"); + auto model = wrapper->CreateModel(); + { + auto reader = model->QueryReader("3mf"); + reader->SetStrictModeActive(true); + reader->ReadFromFile(sTestFilesPath + "/" + "BeamLattice" + "/" + fName); + ASSERT_EQ(reader->GetWarningCount(), 0) << "Warnings encountered while reading test suite file."; + } + + Lib3MF_uint64 totalBalls = 0; + Lib3MF_uint64 checkedBallModeMeshes = 0; + auto meshObjects = model->GetMeshObjects(); + while (meshObjects->MoveNext()) { + auto meshObject = meshObjects->GetCurrentMeshObject(); + auto bl = meshObject->BeamLattice(); + if (bl->GetBeamCount() > 0 || bl->GetBallCount() > 0) { + eBeamLatticeBallMode ballMode; double defaultRadius; + bl->GetBallOptions(ballMode, defaultRadius); + if (bl->GetBallCount() > 0) { + checkedBallModeMeshes++; + ASSERT_EQ(ballMode, eBeamLatticeBallMode::All); + ASSERT_NEAR(defaultRadius, 3.0, 1e-7); + } + totalBalls += bl->GetBallCount(); + } + } + ASSERT_EQ(checkedBallModeMeshes, 1u) << "Expected exactly one mesh with ball mode All."; + ASSERT_EQ(totalBalls, 8u) << "Unexpected total ball count."; + } + } diff --git a/Tests/CPP_Bindings/Source/Boolean.cpp b/Tests/CPP_Bindings/Source/Boolean.cpp new file mode 100644 index 000000000..a5aadd420 --- /dev/null +++ b/Tests/CPP_Bindings/Source/Boolean.cpp @@ -0,0 +1,539 @@ +/*++ +--*/ + +#include "UnitTest_Utilities.h" +#include "lib3mf_implicit.hpp" + +namespace { + +Lib3MF::PMeshObject addBoxMesh(const Lib3MF::PModel & model) +{ + std::vector vertices; + std::vector triangles; + fnCreateBox(vertices, triangles); + + auto mesh = model->AddMeshObject(); + mesh->SetGeometry(vertices, triangles); + return mesh; +} + +void addSingleBeam(const Lib3MF::PMeshObject & mesh) +{ + Lib3MF::sBeam beam; + beam.m_Indices[0] = 0; + beam.m_Indices[1] = 1; + beam.m_Radii[0] = 0.5; + beam.m_Radii[1] = 0.5; + mesh->BeamLattice()->AddBeam(beam); +} + +Lib3MF::sTransform translatedIdentity(Lib3MF::PWrapper wrapper, float x, float y, float z) +{ + auto transform = wrapper->GetIdentityTransform(); + transform.m_Fields[3][0] = x; + transform.m_Fields[3][1] = y; + transform.m_Fields[3][2] = z; + return transform; +} + +} + +class BooleanRead : public Lib3MFTest { +}; + +TEST_F(BooleanRead, ReadAndIterateBooleanObjects) +{ + auto model = wrapper->CreateModel(); + auto reader = model->QueryReader("3mf"); + reader->ReadFromFile(sTestFilesPath + "/" + "Boolean" + "/" + "booleans_operations.3mf"); + + auto booleanObjects = model->GetBooleanObjects(); + ASSERT_EQ(booleanObjects->Count(), 2); + ASSERT_TRUE(booleanObjects->MoveNext()); + + auto booleanObjectA = booleanObjects->GetCurrentBooleanObject(); + ASSERT_TRUE(booleanObjectA->IsBooleanObject()); + ASSERT_EQ(booleanObjectA->GetOperation(), Lib3MF::eBooleanOperation::Intersection); + ASSERT_EQ(booleanObjectA->GetBaseObject()->GetModelResourceID(), 4u); + ASSERT_EQ(booleanObjectA->GetOperandCount(), 1u); + Lib3MF::PMeshObject operandA; + auto transformA = booleanObjectA->GetOperand(0, operandA); + (void)transformA; + ASSERT_EQ(operandA->GetModelResourceID(), 5u); + + ASSERT_TRUE(booleanObjects->MoveNext()); + auto booleanObjectB = booleanObjects->GetCurrentBooleanObject(); + ASSERT_TRUE(booleanObjectB->IsBooleanObject()); + ASSERT_EQ(booleanObjectB->GetOperation(), Lib3MF::eBooleanOperation::Difference); + ASSERT_EQ(booleanObjectB->GetBaseObject()->GetModelResourceID(), 6u); + ASSERT_EQ(booleanObjectB->GetOperandCount(), 3u); + Lib3MF::PMeshObject operandB; + booleanObjectB->GetOperand(0, operandB); + ASSERT_EQ(operandB->GetModelResourceID(), 3u); + + auto resourceByID = model->GetBooleanObjectByID(booleanObjectB->GetResourceID()); + ASSERT_EQ(resourceByID->GetOperandCount(), 3u); +} + +TEST_F(BooleanRead, ReadWriteReadBooleanObjects) +{ + auto model = wrapper->CreateModel(); + auto reader = model->QueryReader("3mf"); + reader->ReadFromFile(sTestFilesPath + "/" + "Boolean" + "/" + "booleans_operations.3mf"); + + std::vector buffer; + auto writer = model->QueryWriter("3mf"); + writer->WriteToBuffer(buffer); + + auto roundTripModel = wrapper->CreateModel(); + auto roundTripReader = roundTripModel->QueryReader("3mf"); + roundTripReader->ReadFromBuffer(buffer); + + auto booleanObjects = roundTripModel->GetBooleanObjects(); + ASSERT_EQ(booleanObjects->Count(), 2); + ASSERT_TRUE(booleanObjects->MoveNext()); + + auto booleanObjectA = booleanObjects->GetCurrentBooleanObject(); + ASSERT_EQ(booleanObjectA->GetOperation(), Lib3MF::eBooleanOperation::Intersection); + ASSERT_EQ(booleanObjectA->GetBaseObject()->GetModelResourceID(), 4u); + ASSERT_EQ(booleanObjectA->GetOperandCount(), 1u); + + ASSERT_TRUE(booleanObjects->MoveNext()); + auto booleanObjectB = booleanObjects->GetCurrentBooleanObject(); + ASSERT_EQ(booleanObjectB->GetOperation(), Lib3MF::eBooleanOperation::Difference); + ASSERT_EQ(booleanObjectB->GetBaseObject()->GetModelResourceID(), 6u); + ASSERT_EQ(booleanObjectB->GetOperandCount(), 3u); +} + +TEST_F(BooleanRead, CreateAndRoundTripBooleanObject) +{ + auto model = wrapper->CreateModel(); + auto baseMesh = addBoxMesh(model); + auto operandMesh = addBoxMesh(model); + auto booleanObject = model->AddBooleanObject(); + + auto baseTransform = translatedIdentity(wrapper, 1.0f, 2.0f, 3.0f); + auto operandTransform = translatedIdentity(wrapper, -4.0f, 5.0f, -6.0f); + + booleanObject->SetBaseObject(baseMesh.get(), baseTransform); + booleanObject->SetOperation(Lib3MF::eBooleanOperation::Difference); + booleanObject->AddOperand(operandMesh.get(), operandTransform); + model->AddBuildItem(booleanObject.get(), wrapper->GetIdentityTransform()); + + ASSERT_TRUE(booleanObject->IsBooleanObject()); + ASSERT_EQ(booleanObject->GetBaseObject()->GetResourceID(), baseMesh->GetResourceID()); + ASSERT_EQ(booleanObject->GetOperation(), Lib3MF::eBooleanOperation::Difference); + ASSERT_EQ(booleanObject->GetOperandCount(), 1u); + Lib3MF::helper::CompareTransforms(booleanObject->GetBaseTransform(), baseTransform); + + Lib3MF::PMeshObject readOperand; + auto roundTripOperandTransform = booleanObject->GetOperand(0, readOperand); + ASSERT_EQ(readOperand->GetResourceID(), operandMesh->GetResourceID()); + Lib3MF::helper::CompareTransforms(roundTripOperandTransform, operandTransform); + + std::vector buffer; + model->QueryWriter("3mf")->WriteToBuffer(buffer); + + auto roundTripModel = wrapper->CreateModel(); + auto reader = roundTripModel->QueryReader("3mf"); + reader->ReadFromBuffer(buffer); + CheckReaderWarnings(reader, 0); + + auto booleanObjects = roundTripModel->GetBooleanObjects(); + ASSERT_EQ(booleanObjects->Count(), 1); + ASSERT_TRUE(booleanObjects->MoveNext()); + auto roundTripBoolean = booleanObjects->GetCurrentBooleanObject(); + ASSERT_EQ(roundTripBoolean->GetOperation(), Lib3MF::eBooleanOperation::Difference); + ASSERT_EQ(roundTripBoolean->GetBaseObject()->GetModelResourceID(), baseMesh->GetModelResourceID()); + ASSERT_EQ(roundTripBoolean->GetOperandCount(), 1u); + Lib3MF::helper::CompareTransforms(roundTripBoolean->GetBaseTransform(), baseTransform); + + Lib3MF::PMeshObject roundTripOperand; + auto roundTripTransform = roundTripBoolean->GetOperand(0, roundTripOperand); + ASSERT_EQ(roundTripOperand->GetModelResourceID(), operandMesh->GetModelResourceID()); + Lib3MF::helper::CompareTransforms(roundTripTransform, operandTransform); +} + +TEST_F(BooleanRead, ApiRejectsInvalidStateAndAccess) +{ + auto model = wrapper->CreateModel(); + auto baseMesh = addBoxMesh(model); + auto operandMesh = addBoxMesh(model); + auto supportMesh = addBoxMesh(model); + auto booleanObject = model->AddBooleanObject(); + auto componentsObject = model->AddComponentsObject(); + supportMesh->SetType(Lib3MF::eObjectType::Support); + + ASSERT_SPECIFIC_THROW(booleanObject->GetBaseObject(), Lib3MF::ELib3MFException); + ASSERT_SPECIFIC_THROW(booleanObject->SetBaseTransform(wrapper->GetIdentityTransform()), Lib3MF::ELib3MFException); + ASSERT_SPECIFIC_THROW(booleanObject->SetBaseObject(nullptr, wrapper->GetIdentityTransform()), Lib3MF::ELib3MFException); + ASSERT_SPECIFIC_THROW(booleanObject->SetBaseObject(componentsObject.get(), wrapper->GetIdentityTransform()), Lib3MF::ELib3MFException); + ASSERT_SPECIFIC_THROW(booleanObject->SetBaseObject(supportMesh.get(), wrapper->GetIdentityTransform()), Lib3MF::ELib3MFException); + + booleanObject->SetBaseObject(baseMesh.get(), wrapper->GetIdentityTransform()); + booleanObject->AddOperand(operandMesh.get(), wrapper->GetIdentityTransform()); + + ASSERT_SPECIFIC_THROW(booleanObject->AddOperand(nullptr, wrapper->GetIdentityTransform()), Lib3MF::ELib3MFException); + ASSERT_SPECIFIC_THROW(booleanObject->AddOperand(supportMesh.get(), wrapper->GetIdentityTransform()), Lib3MF::ELib3MFException); + ASSERT_SPECIFIC_THROW({ + Lib3MF::PMeshObject invalidOperand; + booleanObject->GetOperand(1, invalidOperand); + }, Lib3MF::ELib3MFException); + ASSERT_SPECIFIC_THROW(model->GetBooleanObjectByID(baseMesh->GetResourceID()), Lib3MF::ELib3MFException); +} + +TEST_F(BooleanRead, ApiRejectsBeamLatticeMeshes) +{ + auto model = wrapper->CreateModel(); + auto regularMesh = addBoxMesh(model); + auto beamMesh = addBoxMesh(model); + auto booleanObject = model->AddBooleanObject(); + addSingleBeam(beamMesh); + + ASSERT_SPECIFIC_THROW(booleanObject->SetBaseObject(beamMesh.get(), wrapper->GetIdentityTransform()), Lib3MF::ELib3MFException); + + booleanObject->SetBaseObject(regularMesh.get(), wrapper->GetIdentityTransform()); + ASSERT_SPECIFIC_THROW(booleanObject->AddOperand(beamMesh.get(), wrapper->GetIdentityTransform()), Lib3MF::ELib3MFException); +} + +TEST_F(BooleanRead, ApiAcceptsLevelSetAsBaseObject) +{ + auto model = wrapper->CreateModel(); + auto levelSet = model->AddLevelSet(); + auto operandMesh = addBoxMesh(model); + auto booleanObject = model->AddBooleanObject(); + + booleanObject->SetBaseObject(levelSet.get(), wrapper->GetIdentityTransform()); + booleanObject->AddOperand(operandMesh.get(), wrapper->GetIdentityTransform()); + + ASSERT_EQ(booleanObject->GetBaseObject()->GetResourceID(), levelSet->GetResourceID()); +} + +TEST_F(BooleanRead, ApiRejectsBooleanBaseReferenceCycles) +{ + auto model = wrapper->CreateModel(); + auto mesh = addBoxMesh(model); + auto booleanA = model->AddBooleanObject(); + auto booleanB = model->AddBooleanObject(); + + booleanA->SetBaseObject(booleanB.get(), wrapper->GetIdentityTransform()); + ASSERT_SPECIFIC_THROW(booleanB->SetBaseObject(booleanA.get(), wrapper->GetIdentityTransform()), Lib3MF::ELib3MFException); + + // Keep both objects otherwise structurally valid to ensure failure is from cycle rejection. + booleanA->AddOperand(mesh.get(), wrapper->GetIdentityTransform()); + booleanB->AddOperand(mesh.get(), wrapper->GetIdentityTransform()); +} + +TEST_F(BooleanRead, ApiControlsCSGModeAndExtractionResolution) +{ + auto model = wrapper->CreateModel(); + auto baseMesh = addBoxMesh(model); + auto operandMesh = addBoxMesh(model); + auto booleanObject = model->AddBooleanObject(); + + booleanObject->SetBaseObject(baseMesh.get(), wrapper->GetIdentityTransform()); + booleanObject->SetOperation(Lib3MF::eBooleanOperation::Difference); + booleanObject->AddOperand(operandMesh.get(), wrapper->GetIdentityTransform()); + + ASSERT_FALSE(booleanObject->GetCSGModeEnabled()); + booleanObject->SetCSGModeEnabled(true); + ASSERT_TRUE(booleanObject->GetCSGModeEnabled()); + + booleanObject->SetExtractionGridResolution(144); + ASSERT_EQ(booleanObject->GetExtractionGridResolution(), 144u); + ASSERT_SPECIFIC_THROW(booleanObject->SetExtractionGridResolution(0), Lib3MF::ELib3MFException); +} + +TEST_F(BooleanRead, CreateAndRoundTripBooleanObjectWithExternalReferences) +{ + auto model = wrapper->CreateModel(); + auto baseMesh = addBoxMesh(model); + auto operandMesh = addBoxMesh(model); + auto booleanObject = model->AddBooleanObject(); + auto basePart = model->FindOrCreatePackagePart("/3D/boolean_base.model"); + auto operandPart = model->FindOrCreatePackagePart("/3D/boolean_operand.model"); + + booleanObject->SetBaseObject(baseMesh.get(), wrapper->GetIdentityTransform()); + booleanObject->SetOperation(Lib3MF::eBooleanOperation::Union); + booleanObject->AddOperand(operandMesh.get(), wrapper->GetTranslationTransform(2.0, 0.0, 0.0)); + baseMesh->SetPackagePart(basePart.get()); + operandMesh->SetPackagePart(operandPart.get()); + model->AddBuildItem(booleanObject.get(), wrapper->GetIdentityTransform()); + + std::vector buffer; + model->QueryWriter("3mf")->WriteToBuffer(buffer); + + auto roundTripModel = wrapper->CreateModel(); + auto reader = roundTripModel->QueryReader("3mf"); + reader->ReadFromBuffer(buffer); + CheckReaderWarnings(reader, 0); + + auto booleanObjects = roundTripModel->GetBooleanObjects(); + ASSERT_EQ(booleanObjects->Count(), 1); + ASSERT_TRUE(booleanObjects->MoveNext()); + + auto roundTripBoolean = booleanObjects->GetCurrentBooleanObject(); + ASSERT_EQ(roundTripBoolean->GetBaseObject()->PackagePart()->GetPath(), "/3D/boolean_base.model"); + ASSERT_EQ(roundTripBoolean->GetOperandCount(), 1u); + + Lib3MF::PMeshObject operand; + roundTripBoolean->GetOperand(0, operand); + ASSERT_EQ(operand->PackagePart()->GetPath(), "/3D/boolean_operand.model"); +} + +TEST_F(BooleanRead, WriterRejectsIncompleteBooleanObjects) +{ + { + auto model = wrapper->CreateModel(); + auto booleanObject = model->AddBooleanObject(); + model->AddBuildItem(booleanObject.get(), wrapper->GetIdentityTransform()); + + std::vector buffer; + ASSERT_SPECIFIC_THROW(model->QueryWriter("3mf")->WriteToBuffer(buffer), Lib3MF::ELib3MFException); + } + + { + auto model = wrapper->CreateModel(); + auto baseMesh = addBoxMesh(model); + auto booleanObject = model->AddBooleanObject(); + booleanObject->SetBaseObject(baseMesh.get(), wrapper->GetIdentityTransform()); + model->AddBuildItem(booleanObject.get(), wrapper->GetIdentityTransform()); + + std::vector buffer; + ASSERT_SPECIFIC_THROW(model->QueryWriter("3mf")->WriteToBuffer(buffer), Lib3MF::ELib3MFException); + } +} + +TEST_F(BooleanRead, WriterRejectsDeepBooleanReferences) +{ + auto model = wrapper->CreateModel(); + auto baseMesh = addBoxMesh(model); + auto operandMesh = addBoxMesh(model); + auto booleanObject = model->AddBooleanObject(); + auto nonRootPart = model->FindOrCreatePackagePart("/3D/nonroot_boolean.model"); + + booleanObject->SetBaseObject(baseMesh.get(), wrapper->GetIdentityTransform()); + booleanObject->SetOperation(Lib3MF::eBooleanOperation::Difference); + booleanObject->AddOperand(operandMesh.get(), wrapper->GetIdentityTransform()); + booleanObject->SetPackagePart(nonRootPart.get()); + model->AddBuildItem(booleanObject.get(), wrapper->GetIdentityTransform()); + + std::vector buffer; + ASSERT_SPECIFIC_THROW(model->QueryWriter("3mf")->WriteToBuffer(buffer), Lib3MF::ELib3MFException); +} + +TEST_F(BooleanRead, InvalidOperationYieldsWarningAndDefaultsToUnion) +{ + auto model = wrapper->CreateModel(); + auto reader = model->QueryReader("3mf"); + reader->ReadFromFile(sTestFilesPath + "/" + "Boolean" + "/" + "invalid_operation_warning.3mf"); + CheckReaderWarnings(reader, 1); + + auto booleanObjects = model->GetBooleanObjects(); + ASSERT_EQ(booleanObjects->Count(), 1); + ASSERT_TRUE(booleanObjects->MoveNext()); + ASSERT_EQ(booleanObjects->GetCurrentBooleanObject()->GetOperation(), Lib3MF::eBooleanOperation::Union); +} + +TEST_F(BooleanRead, MissingBaseObjectIDThrows) +{ + auto model = wrapper->CreateModel(); + auto reader = model->QueryReader("3mf"); + ASSERT_SPECIFIC_THROW(reader->ReadFromFile(sTestFilesPath + "/" + "Boolean" + "/" + "missing_base_objectid.3mf"), Lib3MF::ELib3MFException); +} + +TEST_F(BooleanRead, MissingOperandsThrow) +{ + auto model = wrapper->CreateModel(); + auto reader = model->QueryReader("3mf"); + ASSERT_SPECIFIC_THROW(reader->ReadFromFile(sTestFilesPath + "/" + "Boolean" + "/" + "missing_operands.3mf"), Lib3MF::ELib3MFException); +} + +TEST_F(BooleanRead, MissingPathTargetThrows) +{ + auto model = wrapper->CreateModel(); + auto reader = model->QueryReader("3mf"); + ASSERT_SPECIFIC_THROW(reader->ReadFromFile(sTestFilesPath + "/" + "Boolean" + "/" + "missing_path_target.3mf"), Lib3MF::ELib3MFException); +} + +TEST_F(BooleanRead, PathWithoutProductionExtensionThrows) +{ + auto model = wrapper->CreateModel(); + auto reader = model->QueryReader("3mf"); + ASSERT_SPECIFIC_THROW(reader->ReadFromFile(sTestFilesPath + "/" + "Boolean" + "/" + "path_without_production_extension.3mf"), Lib3MF::ELib3MFException); +} + +TEST_F(BooleanRead, ComponentsBaseObjectThrows) +{ + auto model = wrapper->CreateModel(); + auto reader = model->QueryReader("3mf"); + ASSERT_SPECIFIC_THROW(reader->ReadFromFile(sTestFilesPath + "/" + "Boolean" + "/" + "components_base_object.3mf"), Lib3MF::ELib3MFException); +} + +TEST_F(BooleanRead, NonMeshOperandThrows) +{ + auto model = wrapper->CreateModel(); + auto reader = model->QueryReader("3mf"); + ASSERT_SPECIFIC_THROW(reader->ReadFromFile(sTestFilesPath + "/" + "Boolean" + "/" + "components_operand_object.3mf"), Lib3MF::ELib3MFException); +} + +TEST_F(BooleanRead, UnknownBooleanAttributeYieldsWarning) +{ + auto model = wrapper->CreateModel(); + auto reader = model->QueryReader("3mf"); + reader->ReadFromFile(sTestFilesPath + "/" + "Boolean" + "/" + "unknown_attribute_warning.3mf"); + CheckReaderWarnings(reader, 1); + + auto booleanObjects = model->GetBooleanObjects(); + ASSERT_EQ(booleanObjects->Count(), 1); + ASSERT_TRUE(booleanObjects->MoveNext()); + ASSERT_EQ(booleanObjects->GetCurrentBooleanObject()->GetOperandCount(), 1u); +} + +TEST_F(BooleanRead, STLWriterMaterializesUnionBooleanObject) +{ + auto model = wrapper->CreateModel(); + auto baseMesh = addBoxMesh(model); + auto operandMesh = addBoxMesh(model); + auto booleanObject = model->AddBooleanObject(); + + booleanObject->SetBaseObject(baseMesh.get(), wrapper->GetIdentityTransform()); + booleanObject->SetOperation(Lib3MF::eBooleanOperation::Union); + booleanObject->AddOperand(operandMesh.get(), wrapper->GetTranslationTransform(1.0, 0.0, 0.0)); + model->AddBuildItem(booleanObject.get(), wrapper->GetIdentityTransform()); + + std::vector buffer; + model->QueryWriter("stl")->WriteToBuffer(buffer); + ASSERT_FALSE(buffer.empty()); +} + +TEST_F(BooleanRead, MergeToMeshObjectMaterializesUnionBooleanObject) +{ + auto model = wrapper->CreateModel(); + auto baseMesh = addBoxMesh(model); + auto operandMesh = addBoxMesh(model); + auto booleanObject = model->AddBooleanObject(); + + booleanObject->SetBaseObject(baseMesh.get(), wrapper->GetIdentityTransform()); + booleanObject->SetOperation(Lib3MF::eBooleanOperation::Union); + booleanObject->AddOperand(operandMesh.get(), wrapper->GetTranslationTransform(1.0, 0.0, 0.0)); + + auto mergedMesh = booleanObject->MergeToMeshObject(); + ASSERT_TRUE(mergedMesh->IsMeshObject()); + ASSERT_NE(mergedMesh->GetResourceID(), booleanObject->GetResourceID()); + ASSERT_GT(mergedMesh->GetVertexCount(), 0u); + ASSERT_GT(mergedMesh->GetTriangleCount(), 0u); + ASSERT_EQ(model->GetMeshObjects()->Count(), 3u); +} + +TEST_F(BooleanRead, STLWriterRejectsNonUnionBooleanWithoutCSG) +{ + auto testOperation = [&](Lib3MF::eBooleanOperation operation) { + auto model = wrapper->CreateModel(); + auto baseMesh = addBoxMesh(model); + auto operandMesh = addBoxMesh(model); + auto booleanObject = model->AddBooleanObject(); + + booleanObject->SetBaseObject(baseMesh.get(), wrapper->GetIdentityTransform()); + booleanObject->SetOperation(operation); + booleanObject->AddOperand(operandMesh.get(), wrapper->GetTranslationTransform(2.0, 0.0, 0.0)); + model->AddBuildItem(booleanObject.get(), wrapper->GetIdentityTransform()); + + std::vector buffer; + ASSERT_SPECIFIC_THROW(model->QueryWriter("stl")->WriteToBuffer(buffer), Lib3MF::ELib3MFException); + }; + + testOperation(Lib3MF::eBooleanOperation::Difference); + testOperation(Lib3MF::eBooleanOperation::Intersection); +} + +TEST_F(BooleanRead, ObjectTypeIntrospectionIsConsistent) +{ + auto model = wrapper->CreateModel(); + auto mesh = addBoxMesh(model); + auto components = model->AddComponentsObject(); + auto booleanObject = model->AddBooleanObject(); + auto levelSet = model->AddLevelSet(); + + booleanObject->SetBaseObject(mesh.get(), wrapper->GetIdentityTransform()); + booleanObject->AddOperand(mesh.get(), wrapper->GetIdentityTransform()); + + ASSERT_TRUE(booleanObject->IsBooleanObject()); + ASSERT_FALSE(booleanObject->IsMeshObject()); + ASSERT_FALSE(booleanObject->IsComponentsObject()); + ASSERT_FALSE(booleanObject->IsLevelSetObject()); + + ASSERT_TRUE(mesh->IsMeshObject()); + ASSERT_FALSE(mesh->IsBooleanObject()); + + ASSERT_TRUE(components->IsComponentsObject()); + ASSERT_FALSE(components->IsBooleanObject()); + + ASSERT_TRUE(levelSet->IsLevelSetObject()); + ASSERT_FALSE(levelSet->IsBooleanObject()); +} + +TEST_F(BooleanRead, WriteBooleanWithHigherResourceDependencies) +{ + auto model = wrapper->CreateModel(); + auto booleanObject = model->AddBooleanObject(); + auto baseMesh = addBoxMesh(model); + auto operandMesh = addBoxMesh(model); + + booleanObject->SetBaseObject(baseMesh.get(), wrapper->GetIdentityTransform()); + booleanObject->SetOperation(Lib3MF::eBooleanOperation::Union); + booleanObject->AddOperand(operandMesh.get(), wrapper->GetIdentityTransform()); + model->AddBuildItem(booleanObject.get(), wrapper->GetIdentityTransform()); + + std::vector buffer; + model->QueryWriter("3mf")->WriteToBuffer(buffer); + ASSERT_FALSE(buffer.empty()); +} + +TEST_F(BooleanRead, ExperimentalCSGPathMaterializesSurface) +{ +#if !defined(LIB3MF_ENABLE_EXPENSIVE_TESTS) || (LIB3MF_ENABLE_EXPENSIVE_TESTS == 0) + GTEST_SKIP() << "Disabled by default. Reconfigure with -DLIB3MF_ENABLE_EXPENSIVE_TESTS=ON to run this test."; +#endif + + auto model = wrapper->CreateModel(); + auto baseMesh = addBoxMesh(model); + auto operandMesh = addBoxMesh(model); + auto booleanObject = model->AddBooleanObject(); + + booleanObject->SetBaseObject(baseMesh.get(), wrapper->GetIdentityTransform()); + booleanObject->SetOperation(Lib3MF::eBooleanOperation::Difference); + booleanObject->AddOperand(operandMesh.get(), wrapper->GetTranslationTransform(0.25, 0.0, 0.0)); + booleanObject->SetCSGModeEnabled(true); + booleanObject->SetExtractionGridResolution(160); + model->AddBuildItem(booleanObject.get(), wrapper->GetIdentityTransform()); + + std::vector buffer; + model->QueryWriter("stl")->WriteToBuffer(buffer); + ASSERT_FALSE(buffer.empty()); +} + +TEST_F(BooleanRead, ReadBooleanFileAndExtractSTLToDisk) +{ +#if !defined(LIB3MF_ENABLE_EXPENSIVE_TESTS) || (LIB3MF_ENABLE_EXPENSIVE_TESTS == 0) + GTEST_SKIP() << "Disabled by default. Reconfigure with -DLIB3MF_ENABLE_EXPENSIVE_TESTS=ON to run this test."; +#endif + + auto model = wrapper->CreateModel(); + auto reader = model->QueryReader("3mf"); + reader->ReadFromFile(sTestFilesPath + "/" + "Boolean" + "/" + "booleans_operations.3mf"); + auto booleanObjects = model->GetBooleanObjects(); + while (booleanObjects->MoveNext()) { + auto booleanObject = booleanObjects->GetCurrentBooleanObject(); + booleanObject->SetCSGModeEnabled(true); + booleanObject->SetExtractionGridResolution(160); + } + + const std::string outputPath = "boolean_from_file_extracted.stl"; + auto stlWriter = model->QueryWriter("stl"); + stlWriter->WriteToFile(outputPath); + + std::ifstream file(outputPath, std::ios::binary | std::ios::ate); + ASSERT_TRUE(file.good()); + ASSERT_GT(file.tellg(), 0); +} diff --git a/Tests/CPP_Bindings/Source/ImplicitNodes.test.cpp b/Tests/CPP_Bindings/Source/ImplicitNodes.test.cpp new file mode 100644 index 000000000..5c9749edd --- /dev/null +++ b/Tests/CPP_Bindings/Source/ImplicitNodes.test.cpp @@ -0,0 +1,770 @@ +/*++ + +Copyright (C) 2024 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +ImplicitNodes.test.cpp: Defines unit tests for new implicit node types +(BeamLattice, FunctionGradient, NormalizeDistance) + +--*/ + +#include "UnitTest_Utilities.h" +#include "lib3mf_implicit.hpp" + +namespace Lib3MF +{ + class ImplicitNodes : public ::testing::Test + { + protected: + virtual void SetUp() + { + if (!helper::directoryExists(OutFolder)) + { + ASSERT_TRUE(CreateDir(OutFolder.c_str())) + << L"Could not create folder."; + } + model = wrapper->CreateModel(); + loadPyramid(); + writer3MF = model->QueryWriter("3mf"); + } + + virtual void TearDown() + { + model.reset(); + writer3MF.reset(); + } + + void loadPyramid() + { + model = wrapper->CreateModel(); + auto reader = model->QueryReader("3mf"); + reader->ReadFromFile(InFolder + "Pyramid.3mf"); + } + + PModel model; + PWriter writer3MF; + + static std::string InFolder; + static std::string OutFolder; + + static void SetUpTestCase() { wrapper = CWrapper::loadLibrary(); } + static PWrapper wrapper; + + PMeshObject GetMesh() + { + auto meshes = model->GetMeshObjects(); + meshes->MoveNext(); + return meshes->GetCurrentMeshObject(); + } + }; + + PWrapper ImplicitNodes::wrapper; + std::string ImplicitNodes::InFolder(sTestFilesPath + "/Volumetric/"); + std::string ImplicitNodes::OutFolder(sOutFilesPath + "/ImplicitNodes/"); + + // ============================================================================ + // BeamLatticeNode Tests + // ============================================================================ + + TEST_F(ImplicitNodes, BeamLatticeNode_Creation_NodeIsAdded) + { + auto function = model->AddImplicitFunction(); + function->SetDisplayName("beamlattice_test"); + + // Create BeamLatticeNode + auto beamLatticeNode = function->AddBeamLatticeNode( + "bl1", "beam lattice", "group_bl"); + + ASSERT_TRUE(beamLatticeNode); + EXPECT_EQ(beamLatticeNode->GetIdentifier(), "bl1"); + EXPECT_EQ(beamLatticeNode->GetDisplayName(), "beam lattice"); + EXPECT_EQ(beamLatticeNode->GetTag(), "group_bl"); + EXPECT_EQ(beamLatticeNode->GetNodeType(), + Lib3MF::eImplicitNodeType::BeamLattice); + + // Check node count + auto nodes = function->GetNodes(); + EXPECT_EQ(nodes->Count(), 1u); + } + + TEST_F(ImplicitNodes, BeamLatticeNode_Ports_CorrectPortsExist) + { + auto function = model->AddImplicitFunction(); + auto beamLatticeNode = function->AddBeamLatticeNode( + "bl1", "beam lattice", "group_bl"); + + // Check inputs + auto inputPos = beamLatticeNode->GetInputPos(); + ASSERT_TRUE(inputPos); + EXPECT_EQ(inputPos->GetType(), Lib3MF::eImplicitPortType::Vector); + + auto inputBeamLattice = beamLatticeNode->GetInputBeamLattice(); + ASSERT_TRUE(inputBeamLattice); + EXPECT_EQ(inputBeamLattice->GetType(), Lib3MF::eImplicitPortType::ResourceID); + + // Check output + auto outputDistance = beamLatticeNode->GetOutputDistance(); + ASSERT_TRUE(outputDistance); + EXPECT_EQ(outputDistance->GetType(), Lib3MF::eImplicitPortType::Scalar); + } + + TEST_F(ImplicitNodes, BeamLatticeNode_AccurateRange_SetGetCorrectly) + { + auto function = model->AddImplicitFunction(); + auto beamLatticeNode = function->AddBeamLatticeNode( + "bl1", "beam lattice", "group_bl"); + + // Default should be 0.0 + EXPECT_DOUBLE_EQ(beamLatticeNode->GetAccurateRange(), 0.0); + + // Set a positive value + beamLatticeNode->SetAccurateRange(5.5); + EXPECT_DOUBLE_EQ(beamLatticeNode->GetAccurateRange(), 5.5); + + // Set zero (valid) + beamLatticeNode->SetAccurateRange(0.0); + EXPECT_DOUBLE_EQ(beamLatticeNode->GetAccurateRange(), 0.0); + } + + TEST_F(ImplicitNodes, BeamLatticeNode_WriteAndRead_SameContent) + { + // Create function with BeamLatticeNode + auto function = model->AddImplicitFunction(); + function->SetDisplayName("beamlattice_function"); + + auto posInput = function->AddInput("pos", "position", + Lib3MF::eImplicitPortType::Vector); + + // Create a beamlattice resource (we'll use a mesh as placeholder) + auto mesh = GetMesh(); + + auto resourceIdNode = function->AddResourceIdNode( + "beamres", "beam resource", "group_bl"); + resourceIdNode->SetResource(mesh.get()); + + auto beamLatticeNode = function->AddBeamLatticeNode( + "bl1", "beam lattice node", "group_bl"); + beamLatticeNode->SetAccurateRange(3.5); + + // Link inputs + auto blInputPos = beamLatticeNode->GetInputPos(); + function->AddLink(posInput, blInputPos); + + auto resOutput = resourceIdNode->GetOutputValue(); + auto blInputBeamLattice = beamLatticeNode->GetInputBeamLattice(); + function->AddLink(resOutput, blInputBeamLattice); + + // Link output + auto output = function->AddOutput("distance", "distance field", + Lib3MF::eImplicitPortType::Scalar); + function->AddLink(beamLatticeNode->GetOutputDistance(), output); + + // Create LevelSet + auto theMesh = GetMesh(); + auto levelSet = model->AddLevelSet(); + levelSet->SetMesh(theMesh); + levelSet->SetFunction(function.get()); + + // Write to file + writer3MF->WriteToFile(ImplicitNodes::OutFolder + "BeamLatticeNode.3mf"); + + // Read and compare + PModel ioModel = wrapper->CreateModel(); + PReader ioReader = ioModel->QueryReader("3mf"); + ioReader->ReadFromFile(ImplicitNodes::OutFolder + "BeamLatticeNode.3mf"); + auto functionIter = ioModel->GetFunctions(); + ASSERT_EQ(functionIter->Count(), 1u); + ASSERT_TRUE(functionIter->MoveNext()); + + auto readFunction = std::dynamic_pointer_cast( + functionIter->GetCurrentFunction()); + ASSERT_NE(readFunction, nullptr); + + helper::compareFunctions(model, function, ioModel, readFunction); + + // Verify BeamLatticeNode specifically + auto nodes = readFunction->GetNodes(); + bool foundBeamLattice = false; + while (nodes->MoveNext()) + { + auto node = nodes->GetCurrent(); + if (node->GetNodeType() == Lib3MF::eImplicitNodeType::BeamLattice) + { + foundBeamLattice = true; + auto blNode = std::dynamic_pointer_cast(node); + ASSERT_NE(blNode, nullptr); + EXPECT_DOUBLE_EQ(blNode->GetAccurateRange(), 3.5); + } + } + EXPECT_TRUE(foundBeamLattice); + } + + TEST_F(ImplicitNodes, BeamLatticeNode_AccurateRangeZero_NotWrittenToFile) + { + // When accuraterange is 0.0, it should not be written to XML + auto function = model->AddImplicitFunction(); + function->SetDisplayName("bl_zero_test"); + + auto posInput = function->AddInput("pos", "position", + Lib3MF::eImplicitPortType::Vector); + auto mesh = GetMesh(); + auto resourceIdNode = function->AddResourceIdNode( + "beamres", "beam resource", "group_bl"); + resourceIdNode->SetResource(mesh.get()); + + auto beamLatticeNode = function->AddBeamLatticeNode( + "bl1", "beam lattice", "group_bl"); + // Don't set accuraterange (default is 0.0) + + function->AddLink(posInput, beamLatticeNode->GetInputPos()); + function->AddLink(resourceIdNode->GetOutputValue(), + beamLatticeNode->GetInputBeamLattice()); + + auto output = function->AddOutput("distance", "distance", + Lib3MF::eImplicitPortType::Scalar); + function->AddLink(beamLatticeNode->GetOutputDistance(), output); + + auto levelSet = model->AddLevelSet(); + levelSet->SetMesh(GetMesh()); + levelSet->SetFunction(function.get()); + + // Write and read + writer3MF->WriteToFile(ImplicitNodes::OutFolder + "BeamLatticeZero.3mf"); + + PModel ioModel = wrapper->CreateModel(); + PReader ioReader = ioModel->QueryReader("3mf"); + ioReader->ReadFromFile(ImplicitNodes::OutFolder + "BeamLatticeZero.3mf"); + + auto functionIter = ioModel->GetFunctions(); + ASSERT_TRUE(functionIter->MoveNext()); + auto readFunction = std::dynamic_pointer_cast( + functionIter->GetCurrentFunction()); + + auto nodes = readFunction->GetNodes(); + while (nodes->MoveNext()) + { + auto node = nodes->GetCurrent(); + if (node->GetNodeType() == Lib3MF::eImplicitNodeType::BeamLattice) + { + auto blNode = std::dynamic_pointer_cast(node); + ASSERT_NE(blNode, nullptr); + EXPECT_DOUBLE_EQ(blNode->GetAccurateRange(), 0.0); + } + } + } + + // ============================================================================ + // FunctionGradientNode Tests + // ============================================================================ + + TEST_F(ImplicitNodes, FunctionGradientNode_Creation_NodeIsAdded) + { + auto function = model->AddImplicitFunction(); + function->SetDisplayName("functiongradient_test"); + + auto fgNode = function->AddFunctionGradientNode( + "fg1", "function gradient", "group_fg"); + + ASSERT_TRUE(fgNode); + EXPECT_EQ(fgNode->GetIdentifier(), "fg1"); + EXPECT_EQ(fgNode->GetDisplayName(), "function gradient"); + EXPECT_EQ(fgNode->GetTag(), "group_fg"); + EXPECT_EQ(fgNode->GetNodeType(), + Lib3MF::eImplicitNodeType::FunctionGradient); + + auto nodes = function->GetNodes(); + EXPECT_EQ(nodes->Count(), 1u); + } + + TEST_F(ImplicitNodes, FunctionGradientNode_Ports_CorrectPortsExist) + { + auto function = model->AddImplicitFunction(); + auto fgNode = function->AddFunctionGradientNode( + "fg1", "function gradient", "group_fg"); + + // Check inputs + auto inputFunctionID = fgNode->GetInputFunctionID(); + ASSERT_TRUE(inputFunctionID); + EXPECT_EQ(inputFunctionID->GetType(), Lib3MF::eImplicitPortType::ResourceID); + + auto inputPos = fgNode->GetInputPos(); + ASSERT_TRUE(inputPos); + EXPECT_EQ(inputPos->GetType(), Lib3MF::eImplicitPortType::Vector); + + auto inputStep = fgNode->GetInputStep(); + ASSERT_TRUE(inputStep); + EXPECT_EQ(inputStep->GetType(), Lib3MF::eImplicitPortType::Scalar); + + // Check outputs + auto outputNormalizedGradient = fgNode->GetOutputNormalizedGradient(); + ASSERT_TRUE(outputNormalizedGradient); + EXPECT_EQ(outputNormalizedGradient->GetType(), + Lib3MF::eImplicitPortType::Vector); + + auto outputGradient = fgNode->GetOutputGradient(); + ASSERT_TRUE(outputGradient); + EXPECT_EQ(outputGradient->GetType(), Lib3MF::eImplicitPortType::Vector); + + auto outputMagnitude = fgNode->GetOutputMagnitude(); + ASSERT_TRUE(outputMagnitude); + EXPECT_EQ(outputMagnitude->GetType(), Lib3MF::eImplicitPortType::Scalar); + } + + TEST_F(ImplicitNodes, FunctionGradientNode_Attributes_SetGetCorrectly) + { + auto function = model->AddImplicitFunction(); + auto fgNode = function->AddFunctionGradientNode( + "fg1", "function gradient", "group_fg"); + + // Set scalarOutputName + fgNode->SetScalarOutputName("magnitude"); + EXPECT_EQ(fgNode->GetScalarOutputName(), "magnitude"); + + // Set vectorInputName + fgNode->SetVectorInputName("normalizedgradient"); + EXPECT_EQ(fgNode->GetVectorInputName(), "normalizedgradient"); + + // Change values + fgNode->SetScalarOutputName("customScalar"); + fgNode->SetVectorInputName("customVector"); + EXPECT_EQ(fgNode->GetScalarOutputName(), "customScalar"); + EXPECT_EQ(fgNode->GetVectorInputName(), "customVector"); + } + + TEST_F(ImplicitNodes, FunctionGradientNode_WriteAndRead_SameContent) + { + // Create a simple function to reference + auto referencedFunction = model->AddImplicitFunction(); + referencedFunction->SetDisplayName("referenced_function"); + auto refInput = referencedFunction->AddInput("pos", "position", + Lib3MF::eImplicitPortType::Vector); + auto refOutput = referencedFunction->AddOutput("distance", "distance", + Lib3MF::eImplicitPortType::Scalar); + + // Create main function with FunctionGradientNode + auto function = model->AddImplicitFunction(); + function->SetDisplayName("functiongradient_function"); + + auto posInput = function->AddInput("pos", "position", + Lib3MF::eImplicitPortType::Vector); + auto stepInput = function->AddInput("step", "step size", + Lib3MF::eImplicitPortType::Scalar); + + auto funcResNode = function->AddResourceIdNode( + "funcres", "function resource", "group_fg"); + funcResNode->SetResource(referencedFunction.get()); + + auto fgNode = function->AddFunctionGradientNode( + "fg1", "gradient node", "group_fg"); + fgNode->SetScalarOutputName("magnitude"); + fgNode->SetVectorInputName("normalizedgradient"); + + // Link inputs + function->AddLink(funcResNode->GetOutputValue(), + fgNode->GetInputFunctionID()); + function->AddLink(posInput, fgNode->GetInputPos()); + function->AddLink(stepInput, fgNode->GetInputStep()); + + // Link outputs + auto output = function->AddOutput("gradient", "gradient vector", + Lib3MF::eImplicitPortType::Vector); + function->AddLink(fgNode->GetOutputGradient(), output); + + auto levelSet = model->AddLevelSet(); + levelSet->SetMesh(GetMesh()); + levelSet->SetFunction(function.get()); + + // Write to file + writer3MF->WriteToFile(ImplicitNodes::OutFolder + "FunctionGradientNode.3mf"); + + // Read and compare + PModel ioModel = wrapper->CreateModel(); + PReader ioReader = ioModel->QueryReader("3mf"); + ioReader->ReadFromFile(ImplicitNodes::OutFolder + "FunctionGradientNode.3mf"); + + auto functionIter = ioModel->GetFunctions(); + ASSERT_EQ(functionIter->Count(), 2u); + + EXPECT_TRUE(functionIter->MoveNext()); + helper::compareFunctions(model, referencedFunction, ioModel, + functionIter->GetCurrentFunction()); + + EXPECT_TRUE(functionIter->MoveNext()); + auto readFunction = std::dynamic_pointer_cast( + functionIter->GetCurrentFunction()); + ASSERT_NE(readFunction, nullptr); + + helper::compareFunctions(model, function, ioModel, readFunction); + EXPECT_FALSE(functionIter->MoveNext()); + + // Verify FunctionGradientNode specifically + auto nodes = readFunction->GetNodes(); + bool foundFunctionGradient = false; + while (nodes->MoveNext()) + { + auto node = nodes->GetCurrent(); + if (node->GetNodeType() == Lib3MF::eImplicitNodeType::FunctionGradient) + { + foundFunctionGradient = true; + auto fgNode = std::dynamic_pointer_cast(node); + ASSERT_NE(fgNode, nullptr); + EXPECT_EQ(fgNode->GetScalarOutputName(), "magnitude"); + EXPECT_EQ(fgNode->GetVectorInputName(), "normalizedgradient"); + } + } + EXPECT_TRUE(foundFunctionGradient); + } + + TEST_F(ImplicitNodes, FunctionGradientNode_MultipleOutputs_AllAccessible) + { + auto function = model->AddImplicitFunction(); + auto fgNode = function->AddFunctionGradientNode( + "fg1", "function gradient", "group_fg"); + + auto posInput = function->AddInput("pos", "position", + Lib3MF::eImplicitPortType::Vector); + auto stepInput = function->AddInput("step", "step", + Lib3MF::eImplicitPortType::Scalar); + + // Create a dummy function resource + auto refFunc = model->AddImplicitFunction(); + refFunc->SetDisplayName("dummy"); + auto funcResNode = function->AddResourceIdNode("funcres", "func", "g"); + funcResNode->SetResource(refFunc.get()); + + // Link inputs + function->AddLink(funcResNode->GetOutputValue(), + fgNode->GetInputFunctionID()); + function->AddLink(posInput, fgNode->GetInputPos()); + function->AddLink(stepInput, fgNode->GetInputStep()); + + // Use all three outputs + auto outputNormalizedGrad = function->AddOutput( + "normgrad", "normalized gradient", Lib3MF::eImplicitPortType::Vector); + function->AddLink(fgNode->GetOutputNormalizedGradient(), outputNormalizedGrad); + + auto outputGrad = function->AddOutput( + "grad", "gradient", Lib3MF::eImplicitPortType::Vector); + function->AddLink(fgNode->GetOutputGradient(), outputGrad); + + auto outputMag = function->AddOutput( + "mag", "magnitude", Lib3MF::eImplicitPortType::Scalar); + function->AddLink(fgNode->GetOutputMagnitude(), outputMag); + + // Verify outputs exist + auto outputs = function->GetOutputs(); + EXPECT_EQ(outputs->Count(), 3u); + } + + // ============================================================================ + // NormalizeDistanceNode Tests + // ============================================================================ + + TEST_F(ImplicitNodes, NormalizeDistanceNode_Creation_NodeIsAdded) + { + auto function = model->AddImplicitFunction(); + function->SetDisplayName("normalizedistance_test"); + + auto ndNode = function->AddNormalizeDistanceNode( + "nd1", "normalize distance", "group_nd"); + + ASSERT_TRUE(ndNode); + EXPECT_EQ(ndNode->GetIdentifier(), "nd1"); + EXPECT_EQ(ndNode->GetDisplayName(), "normalize distance"); + EXPECT_EQ(ndNode->GetTag(), "group_nd"); + EXPECT_EQ(ndNode->GetNodeType(), + Lib3MF::eImplicitNodeType::NormalizeDistance); + + auto nodes = function->GetNodes(); + EXPECT_EQ(nodes->Count(), 1u); + } + + TEST_F(ImplicitNodes, NormalizeDistanceNode_Ports_CorrectPortsExist) + { + auto function = model->AddImplicitFunction(); + auto ndNode = function->AddNormalizeDistanceNode( + "nd1", "normalize distance", "group_nd"); + + // Check inputs + auto inputFunctionID = ndNode->GetInputFunctionID(); + ASSERT_TRUE(inputFunctionID); + EXPECT_EQ(inputFunctionID->GetType(), Lib3MF::eImplicitPortType::ResourceID); + + auto inputPos = ndNode->GetInputPos(); + ASSERT_TRUE(inputPos); + EXPECT_EQ(inputPos->GetType(), Lib3MF::eImplicitPortType::Vector); + + auto inputStep = ndNode->GetInputStep(); + ASSERT_TRUE(inputStep); + EXPECT_EQ(inputStep->GetType(), Lib3MF::eImplicitPortType::Scalar); + + // Check output + auto outputResult = ndNode->GetOutputResult(); + ASSERT_TRUE(outputResult); + EXPECT_EQ(outputResult->GetType(), Lib3MF::eImplicitPortType::Scalar); + } + + TEST_F(ImplicitNodes, NormalizeDistanceNode_Attributes_SetGetCorrectly) + { + auto function = model->AddImplicitFunction(); + auto ndNode = function->AddNormalizeDistanceNode( + "nd1", "normalize distance", "group_nd"); + + // Set scalarOutputName + ndNode->SetScalarOutputName("result"); + EXPECT_EQ(ndNode->GetScalarOutputName(), "result"); + + // Set vectorInputName + ndNode->SetVectorInputName("gradient"); + EXPECT_EQ(ndNode->GetVectorInputName(), "gradient"); + + // Change values + ndNode->SetScalarOutputName("customOutput"); + ndNode->SetVectorInputName("customInput"); + EXPECT_EQ(ndNode->GetScalarOutputName(), "customOutput"); + EXPECT_EQ(ndNode->GetVectorInputName(), "customInput"); + } + + TEST_F(ImplicitNodes, NormalizeDistanceNode_WriteAndRead_SameContent) + { + // Create a simple function to reference + auto referencedFunction = model->AddImplicitFunction(); + referencedFunction->SetDisplayName("referenced_function"); + auto refInput = referencedFunction->AddInput("pos", "position", + Lib3MF::eImplicitPortType::Vector); + auto refOutput = referencedFunction->AddOutput("distance", "distance", + Lib3MF::eImplicitPortType::Scalar); + + // Create main function with NormalizeDistanceNode + auto function = model->AddImplicitFunction(); + function->SetDisplayName("normalizedistance_function"); + + auto posInput = function->AddInput("pos", "position", + Lib3MF::eImplicitPortType::Vector); + auto stepInput = function->AddInput("step", "step size", + Lib3MF::eImplicitPortType::Scalar); + + auto funcResNode = function->AddResourceIdNode( + "funcres", "function resource", "group_nd"); + funcResNode->SetResource(referencedFunction.get()); + + auto ndNode = function->AddNormalizeDistanceNode( + "nd1", "normalize node", "group_nd"); + ndNode->SetScalarOutputName("result"); + ndNode->SetVectorInputName("gradient"); + + // Link inputs + function->AddLink(funcResNode->GetOutputValue(), + ndNode->GetInputFunctionID()); + function->AddLink(posInput, ndNode->GetInputPos()); + function->AddLink(stepInput, ndNode->GetInputStep()); + + // Link output + auto output = function->AddOutput("normalized", "normalized distance", + Lib3MF::eImplicitPortType::Scalar); + function->AddLink(ndNode->GetOutputResult(), output); + + auto levelSet = model->AddLevelSet(); + levelSet->SetMesh(GetMesh()); + levelSet->SetFunction(function.get()); + + // Write to file + writer3MF->WriteToFile(ImplicitNodes::OutFolder + "NormalizeDistanceNode.3mf"); + + // Read and compare + PModel ioModel = wrapper->CreateModel(); + PReader ioReader = ioModel->QueryReader("3mf"); + ioReader->ReadFromFile(ImplicitNodes::OutFolder + "NormalizeDistanceNode.3mf"); + + auto functionIter = ioModel->GetFunctions(); + ASSERT_EQ(functionIter->Count(), 2u); + + EXPECT_TRUE(functionIter->MoveNext()); + helper::compareFunctions(model, referencedFunction, ioModel, + functionIter->GetCurrentFunction()); + + EXPECT_TRUE(functionIter->MoveNext()); + auto readFunction = std::dynamic_pointer_cast( + functionIter->GetCurrentFunction()); + ASSERT_NE(readFunction, nullptr); + + helper::compareFunctions(model, function, ioModel, readFunction); + EXPECT_FALSE(functionIter->MoveNext()); + + // Verify NormalizeDistanceNode specifically + auto nodes = readFunction->GetNodes(); + bool foundNormalizeDistance = false; + while (nodes->MoveNext()) + { + auto node = nodes->GetCurrent(); + if (node->GetNodeType() == Lib3MF::eImplicitNodeType::NormalizeDistance) + { + foundNormalizeDistance = true; + auto ndNode = std::dynamic_pointer_cast(node); + ASSERT_NE(ndNode, nullptr); + EXPECT_EQ(ndNode->GetScalarOutputName(), "result"); + EXPECT_EQ(ndNode->GetVectorInputName(), "gradient"); + } + } + EXPECT_TRUE(foundNormalizeDistance); + } + + // ============================================================================ + // Combined/Integration Tests + // ============================================================================ + + TEST_F(ImplicitNodes, AllNewNodes_CombinedInFunction_WriteAndRead) + { + // Create a function using all three new node types + auto function = model->AddImplicitFunction(); + function->SetDisplayName("combined_nodes_function"); + + auto posInput = function->AddInput("pos", "position", + Lib3MF::eImplicitPortType::Vector); + + // Create BeamLatticeNode + auto mesh = GetMesh(); + auto beamResNode = function->AddResourceIdNode( + "beamres", "beam resource", "group_combined"); + beamResNode->SetResource(mesh.get()); + + auto blNode = function->AddBeamLatticeNode( + "bl1", "beam lattice", "group_combined"); + blNode->SetAccurateRange(2.5); + function->AddLink(posInput, blNode->GetInputPos()); + function->AddLink(beamResNode->GetOutputValue(), + blNode->GetInputBeamLattice()); + + // Create a reference function for gradient/normalize nodes + auto refFunc = model->AddImplicitFunction(); + refFunc->SetDisplayName("reference_function"); + auto refFuncResNode = function->AddResourceIdNode( + "funcres", "function resource", "group_combined"); + refFuncResNode->SetResource(refFunc.get()); + + auto stepConst = function->AddConstantNode("step", "step value", "group_combined"); + stepConst->SetConstant(0.01); + + // Create FunctionGradientNode + auto fgNode = function->AddFunctionGradientNode( + "fg1", "gradient", "group_combined"); + fgNode->SetScalarOutputName("magnitude"); + fgNode->SetVectorInputName("normalizedgradient"); + function->AddLink(refFuncResNode->GetOutputValue(), + fgNode->GetInputFunctionID()); + function->AddLink(posInput, fgNode->GetInputPos()); + function->AddLink(stepConst->GetOutputValue(), fgNode->GetInputStep()); + + // Create NormalizeDistanceNode + auto ndNode = function->AddNormalizeDistanceNode( + "nd1", "normalize", "group_combined"); + ndNode->SetScalarOutputName("result"); + ndNode->SetVectorInputName("gradient"); + function->AddLink(refFuncResNode->GetOutputValue(), + ndNode->GetInputFunctionID()); + function->AddLink(posInput, ndNode->GetInputPos()); + function->AddLink(stepConst->GetOutputValue(), ndNode->GetInputStep()); + + // Combine outputs + auto addNode = function->AddAdditionNode( + "combine", Lib3MF::eImplicitNodeConfiguration::ScalarToScalar, + "combine results", "group_combined"); + function->AddLink(blNode->GetOutputDistance(), addNode->GetInputA()); + function->AddLink(ndNode->GetOutputResult(), addNode->GetInputB()); + + auto output = function->AddOutput("combined", "combined output", + Lib3MF::eImplicitPortType::Scalar); + function->AddLink(addNode->GetOutputResult(), output); + + auto levelSet = model->AddLevelSet(); + levelSet->SetMesh(GetMesh()); + levelSet->SetFunction(function.get()); + + // Write to file + writer3MF->WriteToFile(ImplicitNodes::OutFolder + "CombinedNewNodes.3mf"); + + // Read and verify + PModel ioModel = wrapper->CreateModel(); + PReader ioReader = ioModel->QueryReader("3mf"); + ioReader->ReadFromFile(ImplicitNodes::OutFolder + "CombinedNewNodes.3mf"); + + auto functionIter = ioModel->GetFunctions(); + ASSERT_EQ(functionIter->Count(), 2u); + + EXPECT_TRUE(functionIter->MoveNext()); + helper::compareFunctions(model, refFunc, ioModel, + functionIter->GetCurrentFunction()); + + EXPECT_TRUE(functionIter->MoveNext()); + auto readFunction = std::dynamic_pointer_cast( + functionIter->GetCurrentFunction()); + ASSERT_NE(readFunction, nullptr); + + helper::compareFunctions(model, function, ioModel, readFunction); + EXPECT_FALSE(functionIter->MoveNext()); + + // Verify all three node types are present + auto nodes = readFunction->GetNodes(); + bool foundBeamLattice = false; + bool foundFunctionGradient = false; + bool foundNormalizeDistance = false; + + while (nodes->MoveNext()) + { + auto node = nodes->GetCurrent(); + auto nodeType = node->GetNodeType(); + + if (nodeType == Lib3MF::eImplicitNodeType::BeamLattice) + { + foundBeamLattice = true; + auto blNode = std::dynamic_pointer_cast(node); + ASSERT_NE(blNode, nullptr); + EXPECT_DOUBLE_EQ(blNode->GetAccurateRange(), 2.5); + } + else if (nodeType == Lib3MF::eImplicitNodeType::FunctionGradient) + { + foundFunctionGradient = true; + auto fgNode = std::dynamic_pointer_cast(node); + ASSERT_NE(fgNode, nullptr); + EXPECT_EQ(fgNode->GetScalarOutputName(), "magnitude"); + EXPECT_EQ(fgNode->GetVectorInputName(), "normalizedgradient"); + } + else if (nodeType == Lib3MF::eImplicitNodeType::NormalizeDistance) + { + foundNormalizeDistance = true; + auto ndNode = std::dynamic_pointer_cast(node); + ASSERT_NE(ndNode, nullptr); + EXPECT_EQ(ndNode->GetScalarOutputName(), "result"); + EXPECT_EQ(ndNode->GetVectorInputName(), "gradient"); + } + } + + EXPECT_TRUE(foundBeamLattice); + EXPECT_TRUE(foundFunctionGradient); + EXPECT_TRUE(foundNormalizeDistance); + } + +} // namespace Lib3MF diff --git a/Tests/CPP_Bindings/Source/UnitTest_EncryptionUtils.cpp b/Tests/CPP_Bindings/Source/UnitTest_EncryptionUtils.cpp index 45a5f7458..a763c2a42 100644 --- a/Tests/CPP_Bindings/Source/UnitTest_EncryptionUtils.cpp +++ b/Tests/CPP_Bindings/Source/UnitTest_EncryptionUtils.cpp @@ -128,9 +128,15 @@ namespace RsaMethods { } void EncryptionCallbacks::cleanup() { +#if OPENSSL_VERSION_NUMBER < 0x10100000L + // OpenSSL < 1.1.0 requires explicit cleanup RAND_cleanup(); EVP_cleanup(); CRYPTO_cleanup_all_ex_data(); +#else + // OpenSSL >= 1.1.0 performs automatic cleanup; these functions are removed + (void)0; +#endif } void EncryptionCallbacks::dataEncryptClientCallback( diff --git a/Tests/CPP_Bindings/Source/Volumetric.cpp b/Tests/CPP_Bindings/Source/Volumetric.cpp index 9c5291ced..2c6ba71a3 100644 --- a/Tests/CPP_Bindings/Source/Volumetric.cpp +++ b/Tests/CPP_Bindings/Source/Volumetric.cpp @@ -32,11 +32,15 @@ Vulometric.cpp: Defines Unittests for the Volumetric extension #include "UnitTest_Utilities.h" #include "lib3mf_implicit.hpp" +#include "ZipBuffer.h" + +#include namespace Lib3MF { namespace helper { + PImplicitFunction createGyroidFunction(CModel& model) { PImplicitFunction gyroidFunction = model.AddImplicitFunction(); @@ -1066,6 +1070,60 @@ namespace Lib3MF EXPECT_EQ(property->GetName(), propertyFromFile->GetName()); } + TEST_F(Volumetric, LevelSet_WritesVolumeDataBeforeLevelSet) + { + model = wrapper->CreateModel(); + auto reader = model->QueryReader("3mf"); + reader->ReadFromFile(InFolder + "Cube.3mf"); + + auto mesh = GetMesh(); + + auto implicitFunction = model->AddImplicitFunction(); + implicitFunction->SetDisplayName("constant levelset"); + + implicitFunction->AddInput( + "pos", "position", Lib3MF::eImplicitPortType::Vector); + + auto constScalarNode = implicitFunction->AddConstantNode( + "constant", "constant", "group_levelset"); + constScalarNode->SetConstant(0.0); + + auto output = implicitFunction->AddOutput( + "shape", "signed distance", Lib3MF::eImplicitPortType::Scalar); + implicitFunction->AddLink(constScalarNode->GetOutputValue(), + output); + + auto levelSetFunction = + std::dynamic_pointer_cast(implicitFunction); + ASSERT_TRUE(levelSetFunction); + + auto volumeData = model->AddVolumeData(); + + auto levelSet = model->AddLevelSet(); + levelSet->SetMesh(mesh); + levelSet->SetFunction(levelSetFunction); + levelSet->SetVolumeData(volumeData); + levelSet->SetChannelName("shape"); + + auto writer = model->QueryWriter("3mf"); + std::vector buffer; + writer->WriteToBuffer(buffer); + + std::string const xml = helper::extractZipEntryFromBuffer(buffer, "3D/3dmodel.model"); + + auto volumeDataPos = xml.find("SetStrictModeActive(true); reader->ReadFromFile(InFolder + "template.3mf"); - auto sourceModelFunctionCount = sourceModel->GetFunctions()->Count(); auto const targetModel = wrapper->CreateModel(); auto targetReader = targetModel->QueryReader("3mf"); targetReader->SetStrictModeActive(true); targetReader->ReadFromFile(InFolder + "Cube.3mf"); - auto previousTargetFunctionCount = targetModel->GetFunctions()->Count(); EXPECT_NO_THROW(targetModel->MergeFromModel(sourceModel.get())); diff --git a/Tests/CPP_Bindings/Source/Volumetric.test.cpp b/Tests/CPP_Bindings/Source/Volumetric.test.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Tests/CPP_Bindings/Source/Wrapper.cpp b/Tests/CPP_Bindings/Source/Wrapper.cpp index 4b2546228..2e27b8278 100644 --- a/Tests/CPP_Bindings/Source/Wrapper.cpp +++ b/Tests/CPP_Bindings/Source/Wrapper.cpp @@ -106,6 +106,30 @@ namespace Lib3MF ASSERT_EQ(nMajor, 1); ASSERT_EQ(nMinor, 0); ASSERT_EQ(nMicro, 2); + + Lib3MFTest::wrapper->GetSpecificationVersion("http://schemas.microsoft.com/3dmanufacturing/trianglesets/2021/07", bIsSupported, nMajor, nMinor, nMicro); + ASSERT_TRUE(bIsSupported); + ASSERT_EQ(nMajor, 1); + ASSERT_EQ(nMinor, 3); + ASSERT_EQ(nMicro, 0); + + Lib3MFTest::wrapper->GetSpecificationVersion("http://schemas.3mf.io/3dmanufacturing/volumetric/2022/01", bIsSupported, nMajor, nMinor, nMicro); + ASSERT_TRUE(bIsSupported); + ASSERT_EQ(nMajor, 0); + ASSERT_EQ(nMinor, 8); + ASSERT_EQ(nMicro, 0); + + Lib3MFTest::wrapper->GetSpecificationVersion("http://schemas.3mf.io/3dmanufacturing/implicit/2023/12", bIsSupported, nMajor, nMinor, nMicro); + ASSERT_TRUE(bIsSupported); + ASSERT_EQ(nMajor, 0); + ASSERT_EQ(nMinor, 8); + ASSERT_EQ(nMicro, 0); + + Lib3MFTest::wrapper->GetSpecificationVersion("http://schemas.3mf.io/3dmanufacturing/booleanoperations/2023/07", bIsSupported, nMajor, nMinor, nMicro); + ASSERT_TRUE(bIsSupported); + ASSERT_EQ(nMajor, 1); + ASSERT_EQ(nMinor, 1); + ASSERT_EQ(nMicro, 1); } TEST(Wrapper, CreateModel) diff --git a/Tests/CPP_Bindings/Source/ZipBuffer.cpp b/Tests/CPP_Bindings/Source/ZipBuffer.cpp new file mode 100644 index 000000000..fa75d8769 --- /dev/null +++ b/Tests/CPP_Bindings/Source/ZipBuffer.cpp @@ -0,0 +1,528 @@ +#include "ZipBuffer.h" + +#include + +#include +#include +#include +#include +#include + +namespace Lib3MF +{ + namespace helper + { + namespace + { + constexpr std::uint32_t kLocalFileHeaderSignature = 0x04034b50u; + constexpr std::uint32_t kCentralDirectorySignature = 0x02014b50u; + constexpr std::uint32_t kEndOfCentralDirectorySignature = + 0x06054b50u; + constexpr std::uint32_t kZip64EndOfCentralDirectorySignature = + 0x06064b50u; + constexpr std::uint32_t + kZip64EndOfCentralDirectoryLocatorSignature = 0x07064b50u; + + std::uint16_t readUInt16(const std::vector& data, + size_t offset) + { + if(offset + 2 > data.size()) + { + throw std::runtime_error( + "ZIP: unexpected end of buffer while reading uint16"); + } + return static_cast( + data[offset] | + (static_cast(data[offset + 1]) << 8U)); + } + + std::uint32_t readUInt32(const std::vector& data, + size_t offset) + { + if(offset + 4 > data.size()) + { + throw std::runtime_error( + "ZIP: unexpected end of buffer while reading uint32"); + } + return static_cast( + data[offset] | + (static_cast(data[offset + 1]) << 8U) | + (static_cast(data[offset + 2]) << 16U) | + (static_cast(data[offset + 3]) << 24U)); + } + + std::uint64_t readUInt64(const std::vector& data, + size_t offset) + { + if(offset + 8 > data.size()) + { + throw std::runtime_error( + "ZIP: unexpected end of buffer while reading uint64"); + } + return static_cast(data[offset]) | + (static_cast(data[offset + 1]) << 8U) | + (static_cast(data[offset + 2]) << 16U) | + (static_cast(data[offset + 3]) << 24U) | + (static_cast(data[offset + 4]) << 32U) | + (static_cast(data[offset + 5]) << 40U) | + (static_cast(data[offset + 6]) << 48U) | + (static_cast(data[offset + 7]) << 56U); + } + + size_t findEndOfCentralDirectory( + const std::vector& data) + { + constexpr size_t kEOCDMinSize = 22; + if(data.size() < kEOCDMinSize) + { + throw std::runtime_error( + "ZIP: buffer too small for end of central directory"); + } + + for(size_t offset = data.size() - kEOCDMinSize;;) + { + if(readUInt32(data, offset) == + kEndOfCentralDirectorySignature) + { + return offset; + } + if(offset == 0) + { + break; + } + --offset; + } + + throw std::runtime_error( + "ZIP: end of central directory not found"); + } + + struct ZipEntryInfo + { + std::uint16_t generalPurposeFlag = 0; + std::uint16_t compressionMethod = 0; + std::uint64_t compressedSize = 0; + std::uint64_t uncompressedSize = 0; + std::uint64_t localHeaderOffset = 0; + std::uint16_t fileNameLength = 0; + std::uint16_t extraFieldLength = 0; + std::uint16_t fileCommentLength = 0; + }; + + ZipEntryInfo readCentralDirectoryEntry( + const std::vector& data, size_t& cursor, + std::string& fileName) + { + if(readUInt32(data, cursor) != kCentralDirectorySignature) + { + throw std::runtime_error( + "ZIP: invalid central directory signature"); + } + + ZipEntryInfo info; + info.generalPurposeFlag = readUInt16(data, cursor + 8); + info.compressionMethod = readUInt16(data, cursor + 10); + auto const compressedSize32 = readUInt32(data, cursor + 20); + auto const uncompressedSize32 = readUInt32(data, cursor + 24); + info.fileNameLength = readUInt16(data, cursor + 28); + info.extraFieldLength = readUInt16(data, cursor + 30); + info.fileCommentLength = readUInt16(data, cursor + 32); + auto const localHeaderOffset32 = readUInt32(data, cursor + 42); + + bool needsZip64Compressed = (compressedSize32 == 0xFFFFFFFFu); + bool needsZip64Uncompressed = + (uncompressedSize32 == 0xFFFFFFFFu); + bool needsZip64Offset = (localHeaderOffset32 == 0xFFFFFFFFu); + + info.compressedSize = compressedSize32; + info.uncompressedSize = uncompressedSize32; + info.localHeaderOffset = localHeaderOffset32; + + size_t const nameOffset = cursor + 46; + size_t const nameEnd = nameOffset + info.fileNameLength; + if(nameEnd > data.size()) + { + throw std::runtime_error( + "ZIP: truncated filename in central directory entry"); + } + + fileName.assign( + reinterpret_cast(&data[nameOffset]), + info.fileNameLength); + + size_t const extraOffset = nameEnd; + size_t const extraEnd = extraOffset + info.extraFieldLength; + if(extraEnd > data.size()) + { + throw std::runtime_error( + "ZIP: extra field exceeds buffer bounds"); + } + + size_t extraCursor = extraOffset; + while(extraCursor + 4 <= extraEnd) + { + auto const headerId = readUInt16(data, extraCursor); + auto const fieldSize = readUInt16(data, extraCursor + 2); + size_t const fieldStart = extraCursor + 4; + size_t const fieldEnd = fieldStart + fieldSize; + if(fieldEnd > extraEnd) + { + throw std::runtime_error("ZIP: malformed extra field"); + } + + if(headerId == 0x0001) + { + size_t fieldCursor = fieldStart; + if(needsZip64Uncompressed) + { + if(fieldCursor + 8 > fieldEnd) + { + throw std::runtime_error( + "ZIP: missing ZIP64 uncompressed size"); + } + info.uncompressedSize = + readUInt64(data, fieldCursor); + fieldCursor += 8; + needsZip64Uncompressed = false; + } + if(needsZip64Compressed) + { + if(fieldCursor + 8 > fieldEnd) + { + throw std::runtime_error( + "ZIP: missing ZIP64 compressed size"); + } + info.compressedSize = readUInt64(data, fieldCursor); + fieldCursor += 8; + needsZip64Compressed = false; + } + if(needsZip64Offset) + { + if(fieldCursor + 8 > fieldEnd) + { + throw std::runtime_error( + "ZIP: missing ZIP64 local header offset"); + } + info.localHeaderOffset = + readUInt64(data, fieldCursor); + fieldCursor += 8; + needsZip64Offset = false; + } + } + + extraCursor = fieldEnd; + } + + if(needsZip64Compressed || needsZip64Uncompressed || + needsZip64Offset) + { + throw std::runtime_error( + "ZIP: ZIP64 extended data missing required values"); + } + + if(extraEnd + info.fileCommentLength > data.size()) + { + throw std::runtime_error( + "ZIP: file comment exceeds buffer bounds"); + } + + cursor = extraEnd + info.fileCommentLength; + if(cursor > data.size()) + { + throw std::runtime_error( + "ZIP: central directory entry exceeds buffer bounds"); + } + + return info; + } + + std::pair + resolveCentralDirectoryZip64(const std::vector& data, + size_t eocdOffset) + { + size_t locatorOffset = std::numeric_limits::max(); + if(eocdOffset >= 20) + { + size_t const candidate = eocdOffset - 20; + if(readUInt32(data, candidate) == + kZip64EndOfCentralDirectoryLocatorSignature) + { + locatorOffset = candidate; + } + } + + if(locatorOffset == std::numeric_limits::max()) + { + size_t const maxScan = + std::min(eocdOffset, static_cast(1024)); + for(size_t back = 4; back <= maxScan; ++back) + { + size_t const offset = eocdOffset - back; + if(readUInt32(data, offset) == + kZip64EndOfCentralDirectoryLocatorSignature) + { + locatorOffset = offset; + break; + } + } + } + + if(locatorOffset == std::numeric_limits::max()) + { + throw std::runtime_error("ZIP: ZIP64 locator not found"); + } + + auto const zip64EocdOffset = + readUInt64(data, locatorOffset + 8); + if(zip64EocdOffset > data.size()) + { + throw std::runtime_error( + "ZIP: ZIP64 EOCD offset outside buffer"); + } + + size_t const zip64EocdPos = + static_cast(zip64EocdOffset); + if(readUInt32(data, zip64EocdPos) != + kZip64EndOfCentralDirectorySignature) + { + throw std::runtime_error( + "ZIP: ZIP64 EOCD signature mismatch"); + } + + auto const centralDirectorySize = + readUInt64(data, zip64EocdPos + 40); + auto const centralDirectoryOffset = + readUInt64(data, zip64EocdPos + 48); + + return {centralDirectorySize, centralDirectoryOffset}; + } + + size_t getLocalDataOffset(const std::vector& data, + const ZipEntryInfo& info) + { + if(info.localHeaderOffset > data.size()) + { + throw std::runtime_error( + "ZIP: local header offset outside buffer"); + } + + size_t const offset = + static_cast(info.localHeaderOffset); + if(offset + 30 > data.size()) + { + throw std::runtime_error( + "ZIP: truncated local file header"); + } + + if(readUInt32(data, offset) != kLocalFileHeaderSignature) + { + throw std::runtime_error( + "ZIP: invalid local file header signature"); + } + + std::uint16_t const fileNameLength = + readUInt16(data, offset + 26); + std::uint16_t const extraFieldLength = + readUInt16(data, offset + 28); + + size_t const dataOffset = + offset + 30 + fileNameLength + extraFieldLength; + if(dataOffset > data.size()) + { + throw std::runtime_error( + "ZIP: local file data exceeds buffer bounds"); + } + + return dataOffset; + } + + std::string decompressDeflate(const Lib3MF_uint8* data, + size_t compressedSize, + size_t uncompressedSize) + { + if(uncompressedSize == 0) + { + return std::string(); + } + + std::string result(uncompressedSize, '\0'); + + z_stream stream; + stream.zalloc = Z_NULL; + stream.zfree = Z_NULL; + stream.opaque = Z_NULL; + stream.next_in = Z_NULL; + stream.avail_in = 0; + stream.next_out = Z_NULL; + stream.avail_out = 0; + + // Use -MAX_WBITS to indicate raw deflate stream (no zlib headers/footers). + int const initResult = inflateInit2(&stream, -MAX_WBITS); + if(initResult != Z_OK) + { + throw std::runtime_error("ZIP: inflateInit2 failed"); + } + + size_t inOffset = 0; + size_t outOffset = 0; + + auto const maxChunk = + static_cast(std::numeric_limits::max()); + + int status = Z_OK; + while(status != Z_STREAM_END) + { + if(stream.avail_in == 0 && inOffset < compressedSize) + { + size_t const remaining = compressedSize - inOffset; + size_t const chunkSize = std::min(remaining, maxChunk); + stream.avail_in = static_cast(chunkSize); + stream.next_in = const_cast( + reinterpret_cast(data + inOffset)); + inOffset += chunkSize; + } + + if(stream.avail_out == 0 && outOffset < uncompressedSize) + { + size_t const remaining = uncompressedSize - outOffset; + size_t const chunkSize = std::min(remaining, maxChunk); + stream.avail_out = static_cast(chunkSize); + stream.next_out = + reinterpret_cast(&result[outOffset]); + outOffset += chunkSize; + } + + status = inflate(&stream, Z_NO_FLUSH); + if(status != Z_OK && status != Z_STREAM_END) + { + inflateEnd(&stream); + throw std::runtime_error("ZIP: inflate failed"); + } + } + + inflateEnd(&stream); + + if(outOffset != uncompressedSize) + { + throw std::runtime_error( + "ZIP: unexpected uncompressed size"); + } + + return result; + } + } // unnamed namespace + + std::string extractZipEntryFromBuffer( + const std::vector& buffer, + const std::string& entryName) + { + auto const eocdOffset = findEndOfCentralDirectory(buffer); + auto const centralDirectorySize32 = + readUInt32(buffer, eocdOffset + 12); + auto const centralDirectoryOffset32 = + readUInt32(buffer, eocdOffset + 16); + + std::uint64_t centralDirectorySize = centralDirectorySize32; + std::uint64_t centralDirectoryOffset = centralDirectoryOffset32; + + if(centralDirectorySize32 == 0xFFFFFFFFu || + centralDirectoryOffset32 == 0xFFFFFFFFu) + { + auto const resolved = + resolveCentralDirectoryZip64(buffer, eocdOffset); + centralDirectorySize = resolved.first; + centralDirectoryOffset = resolved.second; + } + + if(centralDirectoryOffset > buffer.size()) + { + throw std::runtime_error( + "ZIP: central directory offset outside buffer"); + } + + size_t centralDirectoryEnd = buffer.size(); + if(centralDirectorySize != 0) + { + auto const declaredEnd64 = + centralDirectoryOffset + centralDirectorySize; + if(declaredEnd64 < centralDirectoryOffset) + { + throw std::runtime_error( + "ZIP: central directory size overflow"); + } + centralDirectoryEnd = std::min( + centralDirectoryEnd, static_cast(declaredEnd64)); + } + + centralDirectoryEnd = std::min(centralDirectoryEnd, eocdOffset); + + size_t cursor = static_cast(centralDirectoryOffset); + if(cursor > centralDirectoryEnd) + { + throw std::runtime_error( + "ZIP: central directory offset beyond computed end"); + } + + while(cursor < centralDirectoryEnd) + { + std::string currentName; + ZipEntryInfo const entry = + readCentralDirectoryEntry(buffer, cursor, currentName); + if(currentName == entryName) + { + size_t const dataOffset = getLocalDataOffset(buffer, entry); + auto const maxAvailable = buffer.size() - dataOffset; + + if(entry.compressedSize > + static_cast(maxAvailable)) + { + throw std::runtime_error( + "ZIP: entry data exceeds buffer bounds"); + } + + if(entry.compressedSize > + static_cast( + std::numeric_limits::max()) || + entry.uncompressedSize > + static_cast( + std::numeric_limits::max())) + { + throw std::runtime_error( + "ZIP: entry size too large for platform string"); + } + + size_t const compressedSize = + static_cast(entry.compressedSize); + size_t const uncompressedSize = + static_cast(entry.uncompressedSize); + + auto const* dataPtr = &buffer[dataOffset]; + switch(entry.compressionMethod) + { + case 0: + if(uncompressedSize != compressedSize) + { + throw std::runtime_error( + "ZIP: stored entry size mismatch"); + } + { + auto const* start = + reinterpret_cast(dataPtr); + auto const* end = start + uncompressedSize; + return std::string(start, end); + } + case 8: + return decompressDeflate(dataPtr, compressedSize, + uncompressedSize); + default: + throw std::runtime_error( + "ZIP: unsupported compression method"); + } + } + } + + throw std::runtime_error("ZIP: entry not found: " + entryName); + } + + } // namespace helper +} // namespace Lib3MF diff --git a/Tests/CPP_Bindings/Source/ZipBuffer.h b/Tests/CPP_Bindings/Source/ZipBuffer.h new file mode 100644 index 000000000..681480bea --- /dev/null +++ b/Tests/CPP_Bindings/Source/ZipBuffer.h @@ -0,0 +1,16 @@ +#pragma once + +#include +#include + +#include "lib3mf_types.hpp" + +namespace Lib3MF +{ + namespace helper + { + std::string extractZipEntryFromBuffer( + const std::vector& buffer, + const std::string& entryName); + } // namespace helper +} // namespace Lib3MF diff --git a/Tests/SliceVertex.mjs b/Tests/SliceVertex.mjs new file mode 100644 index 000000000..8aab4c384 --- /dev/null +++ b/Tests/SliceVertex.mjs @@ -0,0 +1,97 @@ +import assert from "node:assert/strict"; +import fs from "node:fs"; +import path from "node:path"; +import { pathToFileURL } from "node:url"; + +const repoRoot = path.resolve(import.meta.dirname, ".."); +const modulePath = path.join(repoRoot, "build/wasm/lib3mf.js"); +const inputPaths = process.argv.slice(2); + +if (!inputPaths.length) { + console.error("Usage: node Tests/SliceVertex.mjs [file.3mf ...]"); + process.exit(1); +} + +const { default: createLib3mf } = await import(pathToFileURL(modulePath)); +const lib = await createLib3mf(); + +const safeDelete = (value) => { + try { + value?.delete?.(); + } catch { + // Cleanup must not hide the assertion that caused a test failure. + } +}; + +const toNumber = (value) => typeof value === "bigint" ? Number(value) : Number(value); + +for (const inputPath of inputPaths) { + const absolutePath = path.resolve(inputPath); + const virtualPath = `/slice-vertex-${path.basename(inputPath)}`; + const wrapper = new lib.CWrapper(); + const model = wrapper.CreateModel(); + const reader = model.QueryReader("3mf"); + let iterator; + let stackCount = 0; + let sliceCount = 0; + let sampledVertexCount = 0; + + try { + lib.FS.writeFile(virtualPath, new Uint8Array(fs.readFileSync(absolutePath))); + reader.ReadFromFile(virtualPath); + iterator = model.GetSliceStacks(); + + while (iterator.MoveNext()) { + const stack = iterator.GetCurrentSliceStack(); + try { + stackCount += 1; + const count = toNumber(stack.GetSliceCount()); + for (let sliceIndex = 0; sliceIndex < count; sliceIndex += 1) { + const slice = stack.GetSlice(sliceIndex); + try { + sliceCount += 1; + const vertexCount = toNumber(slice.GetVertexCount()); + if (!vertexCount) continue; + + const sampleIndices = [...new Set([ + 0, + Math.floor(vertexCount / 2), + vertexCount - 1, + ])]; + + for (const vertexIndex of sampleIndices) { + const vertex = slice.GetVertex(vertexIndex); + try { + assert.ok(vertex, `Missing vertex ${vertexIndex} in slice ${sliceIndex}`); + assert.ok(Number.isFinite(vertex.get_Coordinates0()), "Slice vertex X must be finite"); + assert.ok(Number.isFinite(vertex.get_Coordinates1()), "Slice vertex Y must be finite"); + sampledVertexCount += 1; + } finally { + safeDelete(vertex); + } + } + } finally { + safeDelete(slice); + } + } + } finally { + safeDelete(stack); + } + } + + assert.ok(stackCount > 0, `${inputPath} must contain a slice stack`); + assert.ok(sliceCount > 0, `${inputPath} must contain slices`); + assert.ok(sampledVertexCount > 0, `${inputPath} must expose indexed slice vertices`); + console.log(`${path.basename(inputPath)}: ${stackCount} stacks, ${sliceCount} slices, ${sampledVertexCount} indexed vertices sampled`); + } finally { + try { + lib.FS.unlink(virtualPath); + } catch { + // The virtual file may not exist if setup failed. + } + safeDelete(iterator); + safeDelete(reader); + safeDelete(model); + safeDelete(wrapper); + } +} diff --git a/Tests/TestFiles/BeamLattice/testsuite_P_BXX_2021_06.3mf b/Tests/TestFiles/BeamLattice/testsuite_P_BXX_2021_06.3mf new file mode 100644 index 000000000..cd47e8497 Binary files /dev/null and b/Tests/TestFiles/BeamLattice/testsuite_P_BXX_2021_06.3mf differ diff --git a/Tests/TestFiles/Boolean/booleans_operations.3mf b/Tests/TestFiles/Boolean/booleans_operations.3mf new file mode 100644 index 000000000..f5390bc03 Binary files /dev/null and b/Tests/TestFiles/Boolean/booleans_operations.3mf differ diff --git a/Tests/TestFiles/Boolean/components_base_object.3mf b/Tests/TestFiles/Boolean/components_base_object.3mf new file mode 100644 index 000000000..55623b7d7 Binary files /dev/null and b/Tests/TestFiles/Boolean/components_base_object.3mf differ diff --git a/Tests/TestFiles/Boolean/components_operand_object.3mf b/Tests/TestFiles/Boolean/components_operand_object.3mf new file mode 100644 index 000000000..2eb6f37b5 Binary files /dev/null and b/Tests/TestFiles/Boolean/components_operand_object.3mf differ diff --git a/Tests/TestFiles/Boolean/invalid_operation_warning.3mf b/Tests/TestFiles/Boolean/invalid_operation_warning.3mf new file mode 100644 index 000000000..394cf867a Binary files /dev/null and b/Tests/TestFiles/Boolean/invalid_operation_warning.3mf differ diff --git a/Tests/TestFiles/Boolean/missing_base_objectid.3mf b/Tests/TestFiles/Boolean/missing_base_objectid.3mf new file mode 100644 index 000000000..57de5d442 Binary files /dev/null and b/Tests/TestFiles/Boolean/missing_base_objectid.3mf differ diff --git a/Tests/TestFiles/Boolean/missing_operands.3mf b/Tests/TestFiles/Boolean/missing_operands.3mf new file mode 100644 index 000000000..43de9360b Binary files /dev/null and b/Tests/TestFiles/Boolean/missing_operands.3mf differ diff --git a/Tests/TestFiles/Boolean/missing_path_target.3mf b/Tests/TestFiles/Boolean/missing_path_target.3mf new file mode 100644 index 000000000..87cf511ef Binary files /dev/null and b/Tests/TestFiles/Boolean/missing_path_target.3mf differ diff --git a/Tests/TestFiles/Boolean/path_without_production_extension.3mf b/Tests/TestFiles/Boolean/path_without_production_extension.3mf new file mode 100644 index 000000000..e63c376f6 Binary files /dev/null and b/Tests/TestFiles/Boolean/path_without_production_extension.3mf differ diff --git a/Tests/TestFiles/Boolean/unknown_attribute_warning.3mf b/Tests/TestFiles/Boolean/unknown_attribute_warning.3mf new file mode 100644 index 000000000..9fb956efa Binary files /dev/null and b/Tests/TestFiles/Boolean/unknown_attribute_warning.3mf differ diff --git a/cmake/GenerateVS2022_32bit.bat b/cmake/GenerateVS2022_32bit.bat new file mode 100644 index 000000000..a2b6b25c8 --- /dev/null +++ b/cmake/GenerateVS2022_32bit.bat @@ -0,0 +1,10 @@ +@echo off +set startingDir="%CD%" + +set basepath="%~dp0" +set builddir=%basepath%\..\build_32bit +if not exist %builddir% (mkdir %builddir%) +cd %builddir% +cmake -G "Visual Studio 17 2022" -A Win32 .. %* + +cd %startingDir% \ No newline at end of file diff --git a/cmake/lib3mfConfig.cmake b/cmake/lib3mfConfig.cmake index f1305b8f5..9d77e5c8d 100644 --- a/cmake/lib3mfConfig.cmake +++ b/cmake/lib3mfConfig.cmake @@ -21,21 +21,50 @@ foreach(comp ${lib3mf_FIND_COMPONENTS}) endif() endforeach() -# Configure paths based on the selected variant -set(lib3mf_INCLUDE_DIR "${LIB3MF_ROOT_DIR}/include/Bindings/${lib3mf_selected_variant}") +# Configure paths set(lib3mf_LIBRARY_DIR "${LIB3MF_ROOT_DIR}/lib") set(lib3mf_BINARY_DIR "${LIB3MF_ROOT_DIR}/bin") -# Adjust library file name based on platform +# Adjust library file name based on platform (prefer shared, fallback to static) +set(_lib3mf_is_shared TRUE) if(WIN32) - set(lib3mf_LIBRARY "${lib3mf_BINARY_DIR}/lib3mf.dll") - set(lib3mf_LIBRARY_IMPORT "${lib3mf_LIBRARY_DIR}/lib3mf.lib") # For importing symbols + if(EXISTS "${lib3mf_BINARY_DIR}/lib3mf.dll") + set(lib3mf_LIBRARY "${lib3mf_BINARY_DIR}/lib3mf.dll") + set(lib3mf_LIBRARY_IMPORT "${lib3mf_LIBRARY_DIR}/lib3mf.lib") # For importing symbols + elseif(EXISTS "${lib3mf_LIBRARY_DIR}/lib3mf.lib") + set(_lib3mf_is_shared FALSE) + set(lib3mf_LIBRARY "${lib3mf_LIBRARY_DIR}/lib3mf.lib") + endif() elseif(APPLE) - set(lib3mf_LIBRARY "${lib3mf_LIBRARY_DIR}/lib3mf.dylib") + if(EXISTS "${lib3mf_LIBRARY_DIR}/lib3mf.dylib") + set(lib3mf_LIBRARY "${lib3mf_LIBRARY_DIR}/lib3mf.dylib") + elseif(EXISTS "${lib3mf_LIBRARY_DIR}/lib3mf.a") + set(_lib3mf_is_shared FALSE) + set(lib3mf_LIBRARY "${lib3mf_LIBRARY_DIR}/lib3mf.a") + endif() else() # Linux and others - set(lib3mf_LIBRARY "${lib3mf_LIBRARY_DIR}/lib3mf.so") + if(EXISTS "${lib3mf_LIBRARY_DIR}/lib3mf.so") + set(lib3mf_LIBRARY "${lib3mf_LIBRARY_DIR}/lib3mf.so") + elseif(EXISTS "${lib3mf_LIBRARY_DIR}/lib3mf.a") + set(_lib3mf_is_shared FALSE) + set(lib3mf_LIBRARY "${lib3mf_LIBRARY_DIR}/lib3mf.a") + endif() +endif() + +# If the install is static-only, dynamic variants are not practical; fall back with a warning. +if(NOT _lib3mf_is_shared) + if("${lib3mf_selected_variant}" STREQUAL "CDynamic") + message(WARNING "lib3mf: CDynamic requested, but only a static library is available; switching to C.") + set(lib3mf_selected_variant "C") + elseif("${lib3mf_selected_variant}" STREQUAL "CppDynamic") + message(WARNING "lib3mf: CppDynamic requested, but only a static library is available; switching to Cpp.") + set(lib3mf_selected_variant "Cpp") + endif() endif() +# Configure include paths based on the (possibly adjusted) selected variant +set(lib3mf_INCLUDE_DIR "${LIB3MF_ROOT_DIR}/include/Bindings/${lib3mf_selected_variant}") + # Print the chosen variant message("***********************************") message("LIB3MF Chosen Variant : " ${lib3mf_selected_variant}) @@ -63,19 +92,26 @@ if("${lib3mf_selected_variant}" STREQUAL "CppDynamic" OR "${lib3mf_selected_vari ) target_include_directories(lib3mfdynamic INTERFACE "${lib3mf_INCLUDE_DIR}") else() - # Define the imported target for static linking - add_library(lib3mf::lib3mf SHARED IMPORTED) + if(_lib3mf_is_shared) + add_library(lib3mf::lib3mf SHARED IMPORTED) + else() + add_library(lib3mf::lib3mf STATIC IMPORTED) + endif() set_target_properties(lib3mf::lib3mf PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${lib3mf_INCLUDE_DIR}" IMPORTED_LOCATION "${lib3mf_LIBRARY}" ) - if(WIN32) + if(WIN32 AND _lib3mf_is_shared) set_property(TARGET lib3mf::lib3mf PROPERTY IMPORTED_IMPLIB "${lib3mf_LIBRARY_IMPORT}") endif() # Define a custom function to handle library copying function(copy_lib3mf_libraries target) if(TARGET ${target}) + if(NOT _lib3mf_is_shared) + # Static library: nothing to copy at runtime. + return() + endif() if(APPLE) # On macOS, copy .dylib files, preserving symlinks only if they don't already exist in the target directory file(GLOB LIB3MF_FILES "${lib3mf_LIBRARY_DIR}/lib3mf.dylib*") diff --git a/cmake/lib3mfConfig.cmake.in b/cmake/lib3mfConfig.cmake.in index 744c348f6..589422b33 100644 --- a/cmake/lib3mfConfig.cmake.in +++ b/cmake/lib3mfConfig.cmake.in @@ -1,3 +1,135 @@ @PACKAGE_INIT@ -include("${CMAKE_CURRENT_LIST_DIR}/lib3mfTargets.cmake") \ No newline at end of file +include(CMakeFindDependencyMacro) + +if(NOT @USE_INCLUDED_LIBZIP@) + find_dependency(libzip CONFIG) +endif() + +if(NOT @USE_INCLUDED_ZLIB@) + find_dependency(ZLIB) +endif() + +if(NOT @USE_INCLUDED_FASTFLOAT@) + find_dependency(FastFloat CONFIG) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/lib3mfTargets.cmake") + +if(NOT TARGET lib3mf::lib3mf) + set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE) + set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE + "Expected imported target lib3mf::lib3mf was not found in lib3mfTargets.cmake.") + return() +endif() + +get_filename_component(_lib3mf_package_dir "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE) +get_filename_component(LIB3MF_ROOT_DIR "${_lib3mf_package_dir}/../../.." ABSOLUTE) +set(LIB3MF_CDYNAMIC_ADDITIONAL_SOURCE "${LIB3MF_ROOT_DIR}/include/Bindings/CDynamic/lib3mf_dynamic.cc") + +set(_lib3mf_library_location_definition "LIB3MF_LIBRARY_LOCATION=\"$\"") + +if(NOT TARGET lib3mf::Cpp) + add_library(lib3mf::Cpp INTERFACE IMPORTED) + set_target_properties(lib3mf::Cpp PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${LIB3MF_ROOT_DIR}/include/Bindings/Cpp" + ) + target_link_libraries(lib3mf::Cpp INTERFACE lib3mf::lib3mf) +endif() + +if(NOT TARGET lib3mf::C) + add_library(lib3mf::C INTERFACE IMPORTED) + set_target_properties(lib3mf::C PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${LIB3MF_ROOT_DIR}/include/Bindings/C" + ) + target_link_libraries(lib3mf::C INTERFACE lib3mf::lib3mf) +endif() + +if(NOT TARGET lib3mf::CppDynamic) + add_library(lib3mf::CppDynamic INTERFACE IMPORTED) + set_target_properties(lib3mf::CppDynamic PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${LIB3MF_ROOT_DIR}/include/Bindings/CppDynamic" + INTERFACE_COMPILE_DEFINITIONS "${_lib3mf_library_location_definition}" + ) +endif() + +if(NOT TARGET lib3mf::CDynamic) + add_library(lib3mf::CDynamic INTERFACE IMPORTED) + set_target_properties(lib3mf::CDynamic PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${LIB3MF_ROOT_DIR}/include/Bindings/CDynamic" + INTERFACE_COMPILE_DEFINITIONS "${_lib3mf_library_location_definition}" + INTERFACE_SOURCES "${LIB3MF_CDYNAMIC_ADDITIONAL_SOURCE}" + ) +endif() + +set(lib3mf_known_components C CDynamic Cpp CppDynamic) +foreach(_lib3mf_component IN LISTS lib3mf_known_components) + set(lib3mf_${_lib3mf_component}_FOUND TRUE) +endforeach() + +set(_lib3mf_selected_component Cpp) +foreach(_lib3mf_component IN LISTS lib3mf_FIND_COMPONENTS) + if(_lib3mf_component IN_LIST lib3mf_known_components) + set(_lib3mf_selected_component "${_lib3mf_component}") + break() + endif() +endforeach() + +set(lib3mf_BINDING_COMPONENT "${_lib3mf_selected_component}") +set(lib3mf_LIBRARIES "lib3mf::${_lib3mf_selected_component}") +set(lib3mf_INCLUDE_DIRS "${LIB3MF_ROOT_DIR}/include/Bindings/${_lib3mf_selected_component}") + +foreach(_lib3mf_component IN LISTS lib3mf_FIND_COMPONENTS) + if(NOT _lib3mf_component IN_LIST lib3mf_known_components) + set(lib3mf_${_lib3mf_component}_FOUND FALSE) + endif() +endforeach() + +if(TARGET lib3mf::lib3mf) + set_property(TARGET lib3mf::lib3mf APPEND PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${LIB3MF_ROOT_DIR}/include/Bindings/${_lib3mf_selected_component}" + ) + if(_lib3mf_selected_component STREQUAL "CppDynamic" OR _lib3mf_selected_component STREQUAL "CDynamic") + set_property(TARGET lib3mf::lib3mf APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS "${_lib3mf_library_location_definition}" + ) + endif() + if(_lib3mf_selected_component STREQUAL "CDynamic") + set_property(TARGET lib3mf::lib3mf APPEND PROPERTY + INTERFACE_SOURCES "${LIB3MF_CDYNAMIC_ADDITIONAL_SOURCE}" + ) + endif() +endif() + +if(NOT COMMAND copy_lib3mf_libraries) + function(copy_lib3mf_libraries target) + if(NOT TARGET "${target}") + message(WARNING "copy_lib3mf_libraries: target '${target}' not found.") + return() + endif() + + if(NOT TARGET lib3mf::lib3mf) + message(WARNING "copy_lib3mf_libraries: lib3mf::lib3mf not found.") + return() + endif() + + get_target_property(_lib3mf_imported_type lib3mf::lib3mf TYPE) + if(NOT _lib3mf_imported_type STREQUAL "SHARED_LIBRARY") + return() + endif() + + add_custom_command(TARGET "${target}" POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E copy_if_different + "$" + "$" + COMMENT "Copying lib3mf runtime to output directory" + ) + endfunction() +endif() + +check_required_components(lib3mf) + +unset(_lib3mf_component) +unset(_lib3mf_package_dir) +unset(_lib3mf_selected_component) +unset(_lib3mf_library_location_definition) diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 000000000..7ff2d6994 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,129 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, load +from conan.tools.gnu import PkgConfigDeps +from conan.tools.env import VirtualBuildEnv + +import os +import re + + +class Lib3MFConan(ConanFile): + name = "lib3mf" + license = "BSD-2-Clause" + url = "https://github.com/3MFConsortium/lib3mf" + description = "An implementation of the 3D Manufacturing Format file standard" + topics = ("3mf", "additive-manufacturing", "cad", "serialization") + package_type = "library" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_platform_uuid": [True, False], + "with_vendored_zlib": [True, False], + "with_vendored_libzip": [True, False], + "with_vendored_ssl": [True, False], + } + default_options = { + "shared": True, + "fPIC": True, + "use_platform_uuid": False, + "with_vendored_zlib": False, + "with_vendored_libzip": False, + "with_vendored_ssl": False, + } + + exports_sources = ( + "Autogenerated/*", + "AutomaticComponentToolkit/*", + "Include/*", + "Libraries/*", + "Source/*", + "submodules/*", + "cmake/*", + "CMakeLists.txt", + "lib3mf.pc.in", + "LICENSE", + "README.md", + ) + + def set_version(self): + cmakelists = load(self, os.path.join(self.recipe_folder, "CMakeLists.txt")) + major = re.search(r"set\(LIB3MF_VERSION_MAJOR\s+(\d+)\)", cmakelists) + minor = re.search(r"set\(LIB3MF_VERSION_MINOR\s+(\d+)\)", cmakelists) + patch = re.search(r"set\(LIB3MF_VERSION_MICRO\s+(\d+)\)", cmakelists) + prerelease = re.search(r'set\(LIB3MF_VERSION_PRERELEASE\s+"([^"]*)"\)', cmakelists) + if not (major and minor and patch): + raise ConanInvalidConfiguration("Could not parse lib3mf version from CMakeLists.txt") + version = f"{major.group(1)}.{minor.group(1)}.{patch.group(1)}" + if prerelease and prerelease.group(1): + version = f"{version}-{prerelease.group(1)}" + self.version = version + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self) + + def requirements(self): + if not self.options.with_vendored_zlib: + self.requires("zlib/[>=1.3 <2]") + if not self.options.with_vendored_libzip: + self.requires("libzip/[>=1.10 <2]") + if not self.options.with_vendored_ssl: + # Optional direct exposure to enable explicit non-vendored SSL selection from consumer profiles. + self.requires("openssl/[>=1.1 <4]") + + def build_requirements(self): + if not self.options.with_vendored_zlib or not self.options.with_vendored_libzip: + self.tool_requires("pkgconf/[>=2.0 <3]") + + def generate(self): + if not self.options.with_vendored_zlib or not self.options.with_vendored_libzip: + pkg = PkgConfigDeps(self) + pkg.generate() + + buildenv = VirtualBuildEnv(self) + buildenv.generate() + + tc = CMakeToolchain(self) + tc.variables["LIB3MF_BUILD_SHARED"] = bool(self.options.shared) + tc.variables["LIB3MF_TESTS"] = False + tc.variables["USE_INCLUDED_ZLIB"] = bool(self.options.with_vendored_zlib) + tc.variables["USE_INCLUDED_LIBZIP"] = bool(self.options.with_vendored_libzip) + tc.variables["USE_INCLUDED_SSL"] = bool(self.options.with_vendored_ssl) + tc.variables["USE_PLATFORM_UUID"] = bool(self.options.use_platform_uuid) + tc.variables["LIB3MF_BUILD_WASM"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "lib3mf") + self.cpp_info.set_property("cmake_target_name", "lib3mf::lib3mf") + if self.settings.os == "Windows": + self.cpp_info.libs = ["lib3mf"] + else: + self.cpp_info.libs = ["3mf"] + self.cpp_info.includedirs = [os.path.join("include", "Bindings", "Cpp")] + self.cpp_info.builddirs = [os.path.join("lib", "cmake", "lib3mf")] + + # Keep legacy generators working. + self.cpp_info.names["cmake_find_package"] = "lib3mf" + self.cpp_info.names["cmake_find_package_multi"] = "lib3mf" diff --git a/docs/implicit_nodes_extension_plan.md b/docs/implicit_nodes_extension_plan.md new file mode 100644 index 000000000..480cb91c8 --- /dev/null +++ b/docs/implicit_nodes_extension_plan.md @@ -0,0 +1,90 @@ +# Plan: Extend lib3mf for New Implicit Nodes + +## Overview +- Goal: add support for three implicit node types (beamlattice, functiongradient, normalizedistance) in lib3mf while preserving backward compatibility and generated bindings. +- Scope: API surface (AutomaticComponentToolkit), XML parsing/writing, schema updates, documentation, samples, and tests across all supported bindings. +- Deliverable: fully tested additive feature ready for release in lib3mf 2.5.0. + +## Node Semantics and Contracts +### Beamlattice Node +- **Inputs**: `lattice` (ResourceID, required), `pos` (Vector, required). +- **Output**: `distance` (Scalar, unsigned distance to the referenced BeamLattice). +- **Validation**: resource must resolve to a MeshObject with BeamLattice; emit `BEAMLATTICE_INVALID_OBJECTTYPE` or `RESOURCENOTFOUND` otherwise. Ensure both inputs are wired (`INPUTNOTSET`). + +### FunctionGradient Node +- **Inputs**: `function` (ResourceID, required), `pos` (Vector, required). +- **Attributes**: optional `channelname` (string) when the function outputs multiple channels. +- **Output**: `gradient` (Vector). +- **Validation**: referenced function must exist; require `channelname` for multi-channel outputs; record `INVALIDPARAM` when missing or unresolved. + +### NormalizeDistance Node +- **Inputs**: `distance` (Scalar, required), `scale` (Scalar, optional). +- **Output**: `result` (Scalar) computed as `clamp(distance / max(scale, epsilon), -1, 1)`. +- **Validation**: ensure `distance` is wired; treat zero/negative `scale` as invalid in strict mode (`INVALIDPARAM`) and fall back to epsilon otherwise. + +## AutomaticComponentToolkit Updates +- Increment `ImplicitNodeType` enum with: `BeamLattice = 51`, `FunctionGradient = 52`, `NormalizeDistance = 53`. +- Add node classes mirroring existing patterns: + - `BeamLatticeNode` (inputs: lattice, pos; output: distance). + - `FunctionGradientNode` (inputs: function ID, pos; property: channel name; output: gradient). + - `NormalizeDistanceNode` (inputs: distance, scale; output: result). +- Extend `ImplicitFunction` helper methods (`AddBeamLatticeNode`, `AddFunctionGradientNode`, `AddNormalizeDistanceNode`). +- Bump library/component version to 2.5.0 (minor increase for additive API). + +## XML Schema, Parsing, and Writing +- Update `implicit.xsd` to define `i:beamlattice`, `i:functiongradient`, and `i:normalizedistance` elements with proper attributes (e.g., `channelname`). +- Revise namespace version (e.g., `http://schemas.3mf.io/3dmanufacturing/implicit/2025/10`) while accepting older versions for reading. +- Reader changes: + - Map new node names to the added enum values. + - Resolve resource references (BeamLattice -> mesh; FunctionGradient -> function). + - Persist channel names and optional scale links. +- Writer changes: + - Emit new elements with correct namespace. + - Serialize attributes/port wiring consistently with existing nodes. + +## Runtime Evaluation Scaffolding +- Maintain evaluator-agnostic core; round-trip support must not depend on runtime evaluation. +- Optional evaluator guidance: + - Beam lattice distance: integrate with existing beam geometry distance calculators when available. + - Function gradient: finite differences for `FunctionFromImage3D`; leave analytic gradients for future work. + - Normalize distance: simple scalar computation; clamp to avoid infinities. + +## Backward Compatibility and Feature Gating +- Activate new node parsing when implicit namespace version >= new version; treat unsupported nodes as opaque or warn in strict mode if namespace is older. +- Preserve binary compatibility (additive enums/classes) and update semantic version (minor bump to 2.5.0). +- Continue to honor relaxed resource ordering as defined by volumetric extension requirements. + +## Testing Strategy +- **Reader/Writer Unit Tests**: ensure nodes round-trip with and without optional attributes; cover error cases (invalid resources, missing channel name, bad scale). +- **Schema Validation**: validate new sample 3MF files against updated `implicit.xsd`. +- **Bindings Smoke Tests**: create nodes via C++, C#, Python, Go, Node, Pascal bindings; serialize and read back. +- **Negative Tests**: verify error handling for invalid references, incorrect resource types, and missing ports. + +## Documentation and Samples +- Update volumetric/implicit documentation to describe new nodes (port tables, attribute descriptions, usage notes). +- Provide example 3MF files for each node type: + - Beam lattice structural sample. + - Function gradient on `FunctionFromImage3D`. + - Normalize distance pipeline example. +- Add release notes/changelog entry for version 2.5.0. + +## Build and CI +- Regenerate bindings with AutomaticComponentToolkit after XML edits. +- Update CMake or preset files only if new sources are emitted. +- Run existing build presets (`cmake: build` for Windows/Linux) and full CTest suites. +- Ensure new tests are integrated with coverage reporting. + +## Risks and Mitigations +- **Distance Sign Ambiguity**: start with unsigned beamlattice distance; consider future signed variant if spec clarifies. +- **Function Gradient for Multi-Channel Functions**: enforce `channelname` requirement; document behavior. +- **Normalize Distance Stability**: clamp outputs; define behavior for absent/invalid scale. + +## Milestones and Acceptance +1. **Phase 1 – API & XML Round-Trip** + - Deliver schema updates, ACT changes, reader/writer support, unit tests. +2. **Phase 2 – Docs & Samples** + - Publish documentation and sample 3MF files; validate schemas. +3. **Phase 3 – Optional Evaluator Enhancements** + - Provide reference evaluator snippets (optional). + +Success criteria: All phases complete, CI green, documentation published, and consumers informed of new minor version release. diff --git a/docs/third_party_patches.md b/docs/third_party_patches.md new file mode 100644 index 000000000..5dca3fdcc --- /dev/null +++ b/docs/third_party_patches.md @@ -0,0 +1,46 @@ +# Third-Party Local Patches + +This file tracks local edits made to vendored third-party code in this repository. +Goal: keep these patches minimal, auditable, and removable once upstreamed. + +## tinybvh + +### Why patched + +`lib3mf` currently vendors tinybvh in: + +- `Libraries/tinybvh/Include/tiny_bvh.h` + +Two issues required local fixes for CI/toolchain stability: + +1. WASM/Emscripten build failure: + tinybvh selected `_aligned_malloc` in an Emscripten path where it is unavailable. +2. MinGW stability concern in heavy CSG tests: + thread-spawning behavior in tinybvh build path is a likely crash source on some toolchains. + +### Local changes + +1. **WASM allocator fix** (vendor header patch): + file: `Libraries/tinybvh/Include/tiny_bvh.h` + change: treat `__EMSCRIPTEN__` like Linux for aligned allocation macro selection. + +2. **Threaded tinybvh build control** (CMake option): + file: `CMakeLists.txt` + option: `LIB3MF_TINYBVH_THREADED_BUILDS` + behavior: + - defaults `OFF` on `MINGW` and `EMSCRIPTEN` + - defaults `ON` elsewhere + - when `OFF`, `NO_THREADED_BUILDS=1` is passed as a compile definition. + +### Notes + +- These changes are intentionally minimal. +- This is a temporary compatibility patch set; preferred long-term state is to consume upstream tinybvh fixes. + +### Removal criteria + +Remove local patches once all are true: + +1. Upstream tinybvh includes a proper Emscripten allocator path. +2. MinGW CI is stable for boolean CSG tests without `NO_THREADED_BUILDS`. +3. `lib3mf` CI passes on Linux/Windows/MinGW/WASM after removing the local edits. diff --git a/patch_wasm_bindings.py b/patch_wasm_bindings.py new file mode 100644 index 000000000..2864ff189 --- /dev/null +++ b/patch_wasm_bindings.py @@ -0,0 +1,242 @@ +#!/usr/bin/env python3 + +import re +import sys +from pathlib import Path + + +SCRIPT_DIR = Path(__file__).resolve().parent +DEFAULT_BINDING = SCRIPT_DIR / "Autogenerated/Bindings/WASM/lib3mf_bindings.cpp" + + +BOOLEAN_BROKEN = """static emscripten::val wrap_BooleanObject_GetOperand(CBooleanObject &self, const Lib3MF_uint32& Index) { + emscripten::val output = emscripten::val::object(); + PMeshObject OperandObject; + Lib3MF_struct return_value = self.GetOperand(Index, OperandObject); + output.set("return", return_value); + output.set("OperandObject", OperandObject); + return output; +}""" + +BOOLEAN_FIXED = """static emscripten::val wrap_BooleanObject_GetOperand(CBooleanObject &self, const Lib3MF_uint32& Index) { + emscripten::val output = emscripten::val::object(); + PMeshObject OperandObject; + sTransformWrapper return_value; + return_value.value = self.GetOperand(Index, OperandObject); + output.set("return", return_value); + output.set("OperandObject", OperandObject); + return output; +}""" + + +VECTOR_STRUCT_PATCHES = [ + ( + """static emscripten::val wrap_MeshObject_GetVertices(CMeshObject &self) { + emscripten::val output = emscripten::val::object(); + std::vector Vertices; + self.GetVertices(Vertices); + output.set("Vertices", Vertices); + return output; +}""", + """static emscripten::val wrap_MeshObject_GetVertices(CMeshObject &self) { + emscripten::val output = emscripten::val::object(); + std::vector Vertices; + self.GetVertices(Vertices); + std::vector wrapped_Vertices; + wrapped_Vertices.reserve(Vertices.size()); + for (const auto& v : Vertices) wrapped_Vertices.push_back(sPositionWrapper{v}); + output.set("Vertices", wrapped_Vertices); + return output; +}""", + ), + ( + """static emscripten::val wrap_MeshObject_GetTriangleIndices(CMeshObject &self) { + emscripten::val output = emscripten::val::object(); + std::vector Indices; + self.GetTriangleIndices(Indices); + output.set("Indices", Indices); + return output; +}""", + """static emscripten::val wrap_MeshObject_GetTriangleIndices(CMeshObject &self) { + emscripten::val output = emscripten::val::object(); + std::vector Indices; + self.GetTriangleIndices(Indices); + std::vector wrapped_Indices; + wrapped_Indices.reserve(Indices.size()); + for (const auto& v : Indices) wrapped_Indices.push_back(sTriangleWrapper{v}); + output.set("Indices", wrapped_Indices); + return output; +}""", + ), + ( + """static emscripten::val wrap_MeshObject_GetAllTriangleProperties(CMeshObject &self) { + emscripten::val output = emscripten::val::object(); + std::vector PropertiesArray; + self.GetAllTriangleProperties(PropertiesArray); + output.set("PropertiesArray", PropertiesArray); + return output; +}""", + """static emscripten::val wrap_MeshObject_GetAllTriangleProperties(CMeshObject &self) { + emscripten::val output = emscripten::val::object(); + std::vector PropertiesArray; + self.GetAllTriangleProperties(PropertiesArray); + std::vector wrapped_PropertiesArray; + wrapped_PropertiesArray.reserve(PropertiesArray.size()); + for (const auto& v : PropertiesArray) wrapped_PropertiesArray.push_back(sTrianglePropertiesWrapper{v}); + output.set("PropertiesArray", wrapped_PropertiesArray); + return output; +}""", + ), + ( + """static emscripten::val wrap_BeamLattice_GetBeams(CBeamLattice &self) { + emscripten::val output = emscripten::val::object(); + std::vector BeamInfo; + self.GetBeams(BeamInfo); + output.set("BeamInfo", BeamInfo); + return output; +}""", + """static emscripten::val wrap_BeamLattice_GetBeams(CBeamLattice &self) { + emscripten::val output = emscripten::val::object(); + std::vector BeamInfo; + self.GetBeams(BeamInfo); + std::vector wrapped_BeamInfo; + wrapped_BeamInfo.reserve(BeamInfo.size()); + for (const auto& v : BeamInfo) wrapped_BeamInfo.push_back(sBeamWrapper{v}); + output.set("BeamInfo", wrapped_BeamInfo); + return output; +}""", + ), + ( + """static emscripten::val wrap_BeamLattice_GetBalls(CBeamLattice &self) { + emscripten::val output = emscripten::val::object(); + std::vector BallInfo; + self.GetBalls(BallInfo); + output.set("BallInfo", BallInfo); + return output; +}""", + """static emscripten::val wrap_BeamLattice_GetBalls(CBeamLattice &self) { + emscripten::val output = emscripten::val::object(); + std::vector BallInfo; + self.GetBalls(BallInfo); + std::vector wrapped_BallInfo; + wrapped_BallInfo.reserve(BallInfo.size()); + for (const auto& v : BallInfo) wrapped_BallInfo.push_back(sBallWrapper{v}); + output.set("BallInfo", wrapped_BallInfo); + return output; +}""", + ), + ( + """static emscripten::val wrap_CompositeMaterials_GetComposite(CCompositeMaterials &self, const Lib3MF_uint32& PropertyID) { + emscripten::val output = emscripten::val::object(); + std::vector Composite; + self.GetComposite(PropertyID, Composite); + output.set("Composite", Composite); + return output; +}""", + """static emscripten::val wrap_CompositeMaterials_GetComposite(CCompositeMaterials &self, const Lib3MF_uint32& PropertyID) { + emscripten::val output = emscripten::val::object(); + std::vector Composite; + self.GetComposite(PropertyID, Composite); + std::vector wrapped_Composite; + wrapped_Composite.reserve(Composite.size()); + for (const auto& v : Composite) wrapped_Composite.push_back(sCompositeConstituentWrapper{v}); + output.set("Composite", wrapped_Composite); + return output; +}""", + ), + ( + """static emscripten::val wrap_Slice_GetVertices(CSlice &self) { + emscripten::val output = emscripten::val::object(); + std::vector Vertices; + self.GetVertices(Vertices); + output.set("Vertices", Vertices); + return output; +}""", + """static emscripten::val wrap_Slice_GetVertices(CSlice &self) { + emscripten::val output = emscripten::val::object(); + std::vector Vertices; + self.GetVertices(Vertices); + std::vector wrapped_Vertices; + wrapped_Vertices.reserve(Vertices.size()); + for (const auto& v : Vertices) wrapped_Vertices.push_back(sPosition2DWrapper{v}); + output.set("Vertices", wrapped_Vertices); + return output; +}""", + ), +] + + +SLICE_GET_VERTEX_ANCHOR = """static emscripten::val wrap_Slice_GetPolygonIndices(CSlice &self, const Lib3MF_uint64& Index) {""" + +SLICE_GET_VERTEX_WRAPPER = """static sPosition2DWrapper wrap_Slice_GetVertex(CSlice &self, const Lib3MF_uint64& Index) { + std::vector vertices; + self.GetVertices(vertices); + return sPosition2DWrapper{vertices.at(static_cast(Index))}; +} + +static emscripten::val wrap_Slice_GetPolygonIndices(CSlice &self, const Lib3MF_uint64& Index) {""" + +SLICE_GET_VERTEX_BINDING_ANCHOR = """ .function("GetVertexCount", &CSlice::GetVertexCount) + .function("AddPolygon", &CSlice::AddPolygon)""" + +SLICE_GET_VERTEX_BINDING = """ .function("GetVertexCount", &CSlice::GetVertexCount) + .function("GetVertex", &wrap_Slice_GetVertex) + .function("AddPolygon", &CSlice::AddPolygon)""" + + +def apply_literal_patch(contents: str, old: str, new: str, description: str) -> tuple[str, bool]: + if new in contents: + return contents, False + if old not in contents: + raise RuntimeError(f"missing expected pattern for {description}") + return contents.replace(old, new, 1), True + + +def main() -> int: + target = Path(sys.argv[1]) if len(sys.argv) > 1 else DEFAULT_BINDING + contents = target.read_text(encoding="utf-8") + changed = False + + contents, local_changed = apply_literal_patch( + contents, + BOOLEAN_BROKEN, + BOOLEAN_FIXED, + "BooleanObject_GetOperand", + ) + changed = changed or local_changed + + for old, new in VECTOR_STRUCT_PATCHES: + contents, local_changed = apply_literal_patch( + contents, + old, + new, + old.split("{", 1)[0].strip(), + ) + changed = changed or local_changed + + contents, local_changed = apply_literal_patch( + contents, + SLICE_GET_VERTEX_ANCHOR, + SLICE_GET_VERTEX_WRAPPER, + "Slice_GetVertex wrapper", + ) + changed = changed or local_changed + + contents, local_changed = apply_literal_patch( + contents, + SLICE_GET_VERTEX_BINDING_ANCHOR, + SLICE_GET_VERTEX_BINDING, + "Slice.GetVertex binding", + ) + changed = changed or local_changed + + if changed: + target.write_text(contents, encoding="utf-8") + print(f"{target}: patched WASM bindings") + else: + print(f"{target}: already patched") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main())