diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 000000000..f69c0ba34 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1,2 @@ +service_name: travis-pro +repo_token: GZXuNlublKFy7HAewHAZLk5ZwgipTFAOA diff --git a/.gitignore b/.gitignore index d0d5e9631..664708a90 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,13 @@ cmake_uninstall.cmake assimp-config.cmake assimp-config-version.cmake +# MakeFile +Makefile +code/Makefile +test/Makefile +test/headercheck/Makefile +tools/assimp_cmd/Makefile + # Tests test/results diff --git a/.travis.sh b/.travis.sh index fefd5292d..c2852855f 100755 --- a/.travis.sh +++ b/.travis.sh @@ -1,13 +1,13 @@ function generate() { - cmake -G "Unix Makefiles" -DASSIMP_ENABLE_BOOST_WORKAROUND=YES -DASSIMP_NO_EXPORT=$TRAVIS_NO_EXPORT -DBUILD_SHARED_LIBS=$SHARED_BUILD + cmake -G "Unix Makefiles" -DASSIMP_NO_EXPORT=$TRAVIS_NO_EXPORT -DBUILD_SHARED_LIBS=$SHARED_BUILD -DASSIMP_COVERALLS=$ENABLE_COVERALLS } if [ $ANDROID ]; then ant -v -Dmy.dir=${TRAVIS_BUILD_DIR} -f ${TRAVIS_BUILD_DIR}/port/jassimp/build.xml ndk-jni else generate \ - && make \ + && make -j4 \ && sudo make install \ && sudo ldconfig \ && (cd test/unit; ../../bin/unit) \ diff --git a/.travis.yml b/.travis.yml index 05f963291..ee385186a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,38 @@ before_install: - sudo apt-get update -qq +<<<<<<< HEAD - sudo apt-get install cmake env: global: - secure: "lZ7pHQvl5dpZWzBQAaIMf0wqrvtcZ4wiZKeIZjf83TEsflW8+z0uTpIuN30ZV6Glth/Sq1OhLnTP5+N57fZU/1ebA5twHdvP4bS5CIUUg71/CXQZNl36xeaqvxsG/xRrdpKOsPdjAOsQ9KPTQulsX43XDLS7CasMiLvYOpqKcPc=" +======= + - sudo apt-get install cmake python3 + - if [ $LINUX ]; then sudo apt-get install -qq freeglut3-dev libxmu-dev libxi-dev ; fi + - echo -e "#ifndef A_R_H_INC\n#define A_R_H_INC\n#define GitVersion ${TRAVIS_JOB_ID}\n#define GitBranch \"${TRAVIS_BRANCH}\"\n#endif // A_R_H_INC" > revision.h + # install latest LCOV (1.9 was failing) + - cd ${TRAVIS_BUILD_DIR} + - wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz + - tar xf lcov_1.11.orig.tar.gz + - sudo make -C lcov-1.11/ install + - gem install coveralls-lcov + - lcov --version + - g++ --version + +branches: + only: + - master + +env: + global: + - PV=r8e PLATF=linux-x86_64 NDK_HOME=${TRAVIS_BUILD_DIR}/android-ndk-${PV} PATH=${PATH}:${NDK_HOME} + matrix: + - LINUX=1 TRAVIS_NO_EXPORT=YES ENABLE_COVERALLS=ON + - LINUX=1 TRAVIS_NO_EXPORT=NO ENABLE_COVERALLS=OFF + - LINUX=1 SHARED_BUILD=ON ENABLE_COVERALLS=OFF + - LINUX=1 SHARED_BUILD=OFF ENABLE_COVERALLS=OFF + - ANDROID=1 +>>>>>>> master language: cpp @@ -14,8 +42,22 @@ compiler: before_script: cmake . -DASSIMP_ENABLE_BOOST_WORKAROUND=YES +before_script: + - cd ${TRAVIS_BUILD_DIR} + # init coverage to 0 (optional) + - lcov --directory . --zerocounters + script: - make + - export COVERALLS_SERVICE_NAME=travis-ci + - export COVERALLS_REPO_TOKEN=abc12345 + - . ./.travis.sh + +after_success: + - cd ${TRAVIS_BUILD_DIR} + - lcov --directory . --capture --output-file coverage.info + - lcov --remove coverage.info '/usr/*' 'contrib/*' 'test/*' --output-file coverage.info + - lcov --list coverage.info + - coveralls-lcov --source-encoding=ISO-8859-1 --repo-token=${COVERALLS_TOKEN} coverage.info addons: coverity_scan: diff --git a/CHANGES b/CHANGES index 0ff79cbe1..0c734162b 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,22 @@ CHANGELOG ---------------------------------------------------------------------- +3.2.1 (2016-10-01) + +FEATURES: + - Updated glTF exporter to meet 1.0 specification. + +FIXES/HOUSEKEEPING: + - Fixed glTF Validator errors for exported glTF format. + +ISSUES: + - Hard coded sampler setting for + - magFilter + - minFilter + - void* in ExportData for accessor max and min. + + + 3.2.0 (2015-11-03) FEATURES: diff --git a/CMakeLists.txt b/CMakeLists.txt index 77de1ee14..cd6838dc6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,20 +40,20 @@ cmake_minimum_required( VERSION 2.8 ) PROJECT( Assimp ) # All supported options ############################################### -OPTION( BUILD_SHARED_LIBS - "Build package with shared libraries." +OPTION( BUILD_SHARED_LIBS + "Build package with shared libraries." ON ) OPTION( ASSIMP_DOUBLE_PRECISION "Set to ON to enable double precision processing" OFF ) -OPTION( ASSIMP_OPT_BUILD_PACKAGES - "Set to ON to generate CPack configuration files and packaging targets" +OPTION( ASSIMP_OPT_BUILD_PACKAGES + "Set to ON to generate CPack configuration files and packaging targets" OFF ) -OPTION( ASSIMP_ANDROID_JNIIOSYSTEM - "Android JNI IOSystem support is active" +OPTION( ASSIMP_ANDROID_JNIIOSYSTEM + "Android JNI IOSystem support is active" OFF ) OPTION( ASSIMP_NO_EXPORT @@ -76,7 +76,13 @@ OPTION ( ASSIMP_BUILD_TESTS "If the test suite for Assimp is built in addition to the library." ON ) +OPTION ( ASSIMP_COVERALLS + "Eańable this to measure test coverage." + OFF +) + IF(MSVC) + set (CMAKE_PREFIX_PATH "D:\\libs\\devil") OPTION( ASSIMP_INSTALL_PDB "Install MSVC debug files." ON @@ -149,11 +155,6 @@ SET(LIBASSIMP-DEV_COMPONENT "libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_M SET(CPACK_COMPONENTS_ALL assimp-bin ${LIBASSIMP_COMPONENT} ${LIBASSIMP-DEV_COMPONENT} assimp-dev) SET(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names") -# Workaround to be able to deal with compiler bug "Too many sections" with mingw. -IF( CMAKE_COMPILER_IS_MINGW ) - ADD_DEFINITIONS(-DASSIMP_BUILD_NO_IFC_IMPORTER ) -ENDIF() - # Ensure that we do not run into issues like http://www.tcm.phy.cam.ac.uk/sw/inodes64.html on 32 bit linux IF( UNIX ) IF ( CMAKE_SIZEOF_VOID_P EQUAL 4) # only necessary for 32-bit linux @@ -177,6 +178,12 @@ ELSEIF( CMAKE_COMPILER_IS_MINGW ) SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -Wall -Wno-long-long -pedantic -std=c++11" ) ENDIF() +if (ASSIMP_COVERALLS) + include(Coveralls) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") +endif() + INCLUDE (FindPkgConfig) INCLUDE_DIRECTORIES( include ) @@ -320,7 +327,6 @@ ELSE (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) ADD_DEFINITIONS( -DASSIMP_BUILD_NO_C4D_IMPORTER ) ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) - ADD_SUBDIRECTORY( code/ ) IF ( ASSIMP_BUILD_ASSIMP_TOOLS ) IF ( WIN32 ) @@ -336,10 +342,10 @@ IF ( ASSIMP_BUILD_ASSIMP_TOOLS ) # Why here? Maybe user do not want Qt viewer and have no Qt. # Why assimp_qt_viewer/CMakeLists.txt still contain similar check? # Because viewer can be build independently of Assimp. - FIND_PACKAGE(Qt5 QUIET) + FIND_PACKAGE(Qt5Widgets QUIET) FIND_PACKAGE(DevIL QUIET) FIND_PACKAGE(OpenGL QUIET) - IF ( Qt5_FOUND AND IL_FOUND AND OPENGL_FOUND) + IF ( Qt5Widgets_FOUND AND IL_FOUND AND OPENGL_FOUND) ADD_SUBDIRECTORY( tools/assimp_qt_viewer/ ) ELSE() SET ( ASSIMP_QT_VIEWER_DEPENDENCIES "") @@ -356,7 +362,7 @@ IF ( ASSIMP_BUILD_ASSIMP_TOOLS ) ENDIF (NOT OPENGL_FOUND) MESSAGE (WARNING "Build of assimp_qt_viewer is disabled. Unsatisfied dendencies: ${ASSIMP_QT_VIEWER_DEPENDENCIES}") - ENDIF ( Qt5_FOUND AND IL_FOUND AND OPENGL_FOUND) + ENDIF ( Qt5Widgets_FOUND AND IL_FOUND AND OPENGL_FOUND) ENDIF ( ASSIMP_BUILD_ASSIMP_TOOLS ) IF ( ASSIMP_BUILD_SAMPLES) diff --git a/Readme.md b/Readme.md index d91f290fa..977bf4601 100644 --- a/Readme.md +++ b/Readme.md @@ -15,6 +15,9 @@ Coverity src="https://scan.coverity.com/projects/5607/badge.svg"/>
+Code coverage:[![Coverage Status](https://coveralls.io/repos/github/assimp/assimp/badge.svg?branch=master)](https://coveralls.io/github/assimp/assimp?branch=master) +
+Gitter chat: [![Join the chat at https://gitter.im/assimp/assimp](https://badges.gitter.im/assimp/assimp.svg)](https://gitter.im/assimp/assimp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
__[open3mod](https://github.com/acgessler/open3mod) is a powerful 3D model viewer based on Assimp's import and export abilities.__ #### Supported file formats #### diff --git a/appveyor.yml b/appveyor.yml index d732c72e7..12dede7d6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -27,10 +27,12 @@ install: # Make compiler command line tools available - call c:\projects\assimp\scripts\appveyor\compiler_setup.bat -build_script: - - cd c:\projects\assimp - - cmake CMakeLists.txt -G "Visual Studio %Configuration%" - - msbuild /m /p:Configuration=Release /p:Platform="Win32" Assimp.sln +build_script: +- cd c:\projects\assimp +- if "%platform%" equ "x64" (cmake CMakeLists.txt -G "Visual Studio %Configuration% Win64") +- if "%platform%" equ "x86" (cmake CMakeLists.txt -G "Visual Studio %Configuration%") +- if "%platform%" equ "x64" (msbuild /m /p:Configuration=Release /p:Platform="x64" Assimp.sln) +- if "%platform%" equ "x86" (msbuild /m /p:Configuration=Release /p:Platform="Win32" Assimp.sln) after_build: - 7z a assimp.7z c:\projects\assimp\bin\release\* c:\projects\assimp\lib\release\* @@ -38,3 +40,13 @@ after_build: artifacts: - path: assimp.7z name: assimp_lib + +addons: + coverity_scan: + project: + name: "assimp/assimp" + description: "" + notification_email: kim.kulling@googlemail.com + build_command_prepend: cmake -G "Unix Makefiles" -DASSIMP_NO_EXPORT=$TRAVIS_NO_EXPORT -DBUILD_SHARED_LIBS=$SHARED_BUILD + build_command: make< make install + branch_pattern: coverity_scan diff --git a/cmake-modules/Coveralls.cmake b/cmake-modules/Coveralls.cmake new file mode 100644 index 000000000..5343f1583 --- /dev/null +++ b/cmake-modules/Coveralls.cmake @@ -0,0 +1,126 @@ +# +# The MIT License (MIT) +# +# 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. +# +# Copyright (C) 2014 Joakim Söderberg +# + +set(_CMAKE_SCRIPT_PATH ${CMAKE_CURRENT_LIST_DIR}) # must be outside coveralls_setup() to get correct path + +# +# Param _COVERAGE_SRCS A list of source files that coverage should be collected for. +# Param _COVERALLS_UPLOAD Upload the result to coveralls? +# + +function(coveralls_setup _COVERAGE_SRCS _COVERALLS_UPLOAD) + + if (ARGC GREATER 2) + set(_CMAKE_SCRIPT_PATH ${ARGN}) + message(STATUS "Coveralls: Using alternate CMake script dir: ${_CMAKE_SCRIPT_PATH}") + endif() + + if (NOT EXISTS "${_CMAKE_SCRIPT_PATH}/CoverallsClear.cmake") + message(FATAL_ERROR "Coveralls: Missing ${_CMAKE_SCRIPT_PATH}/CoverallsClear.cmake") + endif() + + if (NOT EXISTS "${_CMAKE_SCRIPT_PATH}/CoverallsGenerateGcov.cmake") + message(FATAL_ERROR "Coveralls: Missing ${_CMAKE_SCRIPT_PATH}/CoverallsGenerateGcov.cmake") + endif() + + # When passing a CMake list to an external process, the list + # will be converted from the format "1;2;3" to "1 2 3". + # This means the script we're calling won't see it as a list + # of sources, but rather just one long path. We remedy this + # by replacing ";" with "*" and then reversing that in the script + # that we're calling. + # http://cmake.3232098.n2.nabble.com/Passing-a-CMake-list-quot-as-is-quot-to-a-custom-target-td6505681.html + set(COVERAGE_SRCS_TMP ${_COVERAGE_SRCS}) + set(COVERAGE_SRCS "") + foreach (COVERAGE_SRC ${COVERAGE_SRCS_TMP}) + set(COVERAGE_SRCS "${COVERAGE_SRCS}*${COVERAGE_SRC}") + endforeach() + + #message("Coverage sources: ${COVERAGE_SRCS}") + set(COVERALLS_FILE ${PROJECT_BINARY_DIR}/coveralls.json) + + add_custom_target(coveralls_generate + + # Zero the coverage counters. + COMMAND ${CMAKE_COMMAND} -DPROJECT_BINARY_DIR="${PROJECT_BINARY_DIR}" -P "${_CMAKE_SCRIPT_PATH}/CoverallsClear.cmake" + + # Run regress tests. + COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure + + # Generate Gcov and translate it into coveralls JSON. + # We do this by executing an external CMake script. + # (We don't want this to run at CMake generation time, but after compilation and everything has run). + COMMAND ${CMAKE_COMMAND} + -DCOVERAGE_SRCS="${COVERAGE_SRCS}" # TODO: This is passed like: "a b c", not "a;b;c" + -DCOVERALLS_OUTPUT_FILE="${COVERALLS_FILE}" + -DCOV_PATH="${PROJECT_BINARY_DIR}" + -DPROJECT_ROOT="${PROJECT_SOURCE_DIR}" + -P "${_CMAKE_SCRIPT_PATH}/CoverallsGenerateGcov.cmake" + + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + COMMENT "Generating coveralls output..." + ) + + if (_COVERALLS_UPLOAD) + message("COVERALLS UPLOAD: ON") + + find_program(CURL_EXECUTABLE curl) + + if (NOT CURL_EXECUTABLE) + message(FATAL_ERROR "Coveralls: curl not found! Aborting") + endif() + + add_custom_target(coveralls_upload + # Upload the JSON to coveralls. + COMMAND ${CURL_EXECUTABLE} + -S -F json_file=@${COVERALLS_FILE} + https://coveralls.io/api/v1/jobs + + DEPENDS coveralls_generate + + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + COMMENT "Uploading coveralls output...") + + add_custom_target(coveralls DEPENDS coveralls_upload) + else() + message("COVERALLS UPLOAD: OFF") + add_custom_target(coveralls DEPENDS coveralls_generate) + endif() + +endfunction() + +macro(coveralls_turn_on_coverage) + if(NOT (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) + AND (NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")) + message(FATAL_ERROR "Coveralls: Compiler ${CMAKE_C_COMPILER_ID} is not GNU gcc! Aborting... You can set this on the command line using CC=/usr/bin/gcc CXX=/usr/bin/g++ cmake ..") + endif() + + if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + message(FATAL_ERROR "Coveralls: Code coverage results with an optimised (non-Debug) build may be misleading! Add -DCMAKE_BUILD_TYPE=Debug") + endif() + + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") +endmacro() + diff --git a/cmake-modules/CoverallsClear.cmake b/cmake-modules/CoverallsClear.cmake new file mode 100644 index 000000000..a9ad48763 --- /dev/null +++ b/cmake-modules/CoverallsClear.cmake @@ -0,0 +1,31 @@ +# +# The MIT License (MIT) +# +# 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. +# +# Copyright (C) 2014 Joakim Söderberg +# + +# do not follow symlinks in file(GLOB_RECURSE ...) +cmake_policy(SET CMP0009 NEW) + +file(GLOB_RECURSE GCDA_FILES "${PROJECT_BINARY_DIR}/*.gcda") +if(NOT GCDA_FILES STREQUAL "") + file(REMOVE ${GCDA_FILES}) +endif() \ No newline at end of file diff --git a/cmake-modules/CoverallsGenerateGcov.cmake b/cmake-modules/CoverallsGenerateGcov.cmake new file mode 100644 index 000000000..ba506e3d4 --- /dev/null +++ b/cmake-modules/CoverallsGenerateGcov.cmake @@ -0,0 +1,482 @@ +# +# The MIT License (MIT) +# +# 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. +# +# Copyright (C) 2014 Joakim Söderberg +# +# This is intended to be run by a custom target in a CMake project like this. +# 0. Compile program with coverage support. +# 1. Clear coverage data. (Recursively delete *.gcda in build dir) +# 2. Run the unit tests. +# 3. Run this script specifying which source files the coverage should be performed on. +# +# This script will then use gcov to generate .gcov files in the directory specified +# via the COV_PATH var. This should probably be the same as your cmake build dir. +# +# It then parses the .gcov files to convert them into the Coveralls JSON format: +# https://coveralls.io/docs/api +# +# Example for running as standalone CMake script from the command line: +# (Note it is important the -P is at the end...) +# $ cmake -DCOV_PATH=$(pwd) +# -DCOVERAGE_SRCS="catcierge_rfid.c;catcierge_timer.c" +# -P ../cmake/CoverallsGcovUpload.cmake +# +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + + +# +# Make sure we have the needed arguments. +# +if (NOT COVERALLS_OUTPUT_FILE) + message(FATAL_ERROR "Coveralls: No coveralls output file specified. Please set COVERALLS_OUTPUT_FILE") +endif() + +if (NOT COV_PATH) + message(FATAL_ERROR "Coveralls: Missing coverage directory path where gcov files will be generated. Please set COV_PATH") +endif() + +if (NOT COVERAGE_SRCS) + message(FATAL_ERROR "Coveralls: Missing the list of source files that we should get the coverage data for COVERAGE_SRCS") +endif() + +if (NOT PROJECT_ROOT) + message(FATAL_ERROR "Coveralls: Missing PROJECT_ROOT.") +endif() + +# Since it's not possible to pass a CMake list properly in the +# "1;2;3" format to an external process, we have replaced the +# ";" with "*", so reverse that here so we get it back into the +# CMake list format. +string(REGEX REPLACE "\\*" ";" COVERAGE_SRCS ${COVERAGE_SRCS}) + +if (NOT DEFINED ENV{GCOV}) + find_program(GCOV_EXECUTABLE gcov) +else() + find_program(GCOV_EXECUTABLE $ENV{GCOV}) +endif() + +# convert all paths in COVERAGE_SRCS to absolute paths +set(COVERAGE_SRCS_TMP "") +foreach (COVERAGE_SRC ${COVERAGE_SRCS}) + if (NOT "${COVERAGE_SRC}" MATCHES "^/") + set(COVERAGE_SRC ${PROJECT_ROOT}/${COVERAGE_SRC}) + endif() + list(APPEND COVERAGE_SRCS_TMP ${COVERAGE_SRC}) +endforeach() +set(COVERAGE_SRCS ${COVERAGE_SRCS_TMP}) +unset(COVERAGE_SRCS_TMP) + +if (NOT GCOV_EXECUTABLE) + message(FATAL_ERROR "gcov not found! Aborting...") +endif() + +find_package(Git) + +set(JSON_REPO_TEMPLATE + "{ + \"head\": { + \"id\": \"\@GIT_COMMIT_HASH\@\", + \"author_name\": \"\@GIT_AUTHOR_NAME\@\", + \"author_email\": \"\@GIT_AUTHOR_EMAIL\@\", + \"committer_name\": \"\@GIT_COMMITTER_NAME\@\", + \"committer_email\": \"\@GIT_COMMITTER_EMAIL\@\", + \"message\": \"\@GIT_COMMIT_MESSAGE\@\" + }, + \"branch\": \"@GIT_BRANCH@\", + \"remotes\": [] + }" +) + +# TODO: Fill in git remote data +if (GIT_FOUND) + # Branch. + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_BRANCH + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + macro (git_log_format FORMAT_CHARS VAR_NAME) + execute_process( + COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:%${FORMAT_CHARS} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE ${VAR_NAME} + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + endmacro() + + git_log_format(an GIT_AUTHOR_NAME) + git_log_format(ae GIT_AUTHOR_EMAIL) + git_log_format(cn GIT_COMMITTER_NAME) + git_log_format(ce GIT_COMMITTER_EMAIL) + git_log_format(B GIT_COMMIT_MESSAGE) + git_log_format(H GIT_COMMIT_HASH) + + if(GIT_COMMIT_MESSAGE) + string(REPLACE "\n" "\\n" GIT_COMMIT_MESSAGE ${GIT_COMMIT_MESSAGE}) + endif() + + message("Git exe: ${GIT_EXECUTABLE}") + message("Git branch: ${GIT_BRANCH}") + message("Git author: ${GIT_AUTHOR_NAME}") + message("Git e-mail: ${GIT_AUTHOR_EMAIL}") + message("Git commiter name: ${GIT_COMMITTER_NAME}") + message("Git commiter e-mail: ${GIT_COMMITTER_EMAIL}") + message("Git commit hash: ${GIT_COMMIT_HASH}") + message("Git commit message: ${GIT_COMMIT_MESSAGE}") + + string(CONFIGURE ${JSON_REPO_TEMPLATE} JSON_REPO_DATA) +else() + set(JSON_REPO_DATA "{}") +endif() + +############################# Macros ######################################### + +# +# This macro converts from the full path format gcov outputs: +# +# /path/to/project/root/build/#path#to#project#root#subdir#the_file.c.gcov +# +# to the original source file path the .gcov is for: +# +# /path/to/project/root/subdir/the_file.c +# +macro(get_source_path_from_gcov_filename _SRC_FILENAME _GCOV_FILENAME) + + # /path/to/project/root/build/#path#to#project#root#subdir#the_file.c.gcov + # -> + # #path#to#project#root#subdir#the_file.c.gcov + get_filename_component(_GCOV_FILENAME_WEXT ${_GCOV_FILENAME} NAME) + + # #path#to#project#root#subdir#the_file.c.gcov -> /path/to/project/root/subdir/the_file.c + string(REGEX REPLACE "\\.gcov$" "" SRC_FILENAME_TMP ${_GCOV_FILENAME_WEXT}) + string(REGEX REPLACE "\#" "/" SRC_FILENAME_TMP ${SRC_FILENAME_TMP}) + set(${_SRC_FILENAME} "${SRC_FILENAME_TMP}") +endmacro() + +############################################################################## + +# Get the coverage data. +file(GLOB_RECURSE GCDA_FILES "${COV_PATH}/*.gcda") +message("GCDA files:") + +# Get a list of all the object directories needed by gcov +# (The directories the .gcda files and .o files are found in) +# and run gcov on those. +foreach(GCDA ${GCDA_FILES}) + message("Process: ${GCDA}") + message("------------------------------------------------------------------------------") + get_filename_component(GCDA_DIR ${GCDA} PATH) + + # + # The -p below refers to "Preserve path components", + # This means that the generated gcov filename of a source file will + # keep the original files entire filepath, but / is replaced with #. + # Example: + # + # /path/to/project/root/build/CMakeFiles/the_file.dir/subdir/the_file.c.gcda + # ------------------------------------------------------------------------------ + # File '/path/to/project/root/subdir/the_file.c' + # Lines executed:68.34% of 199 + # /path/to/project/root/subdir/the_file.c:creating '#path#to#project#root#subdir#the_file.c.gcov' + # + # If -p is not specified then the file is named only "the_file.c.gcov" + # + execute_process( + COMMAND ${GCOV_EXECUTABLE} -p -o ${GCDA_DIR} ${GCDA} + WORKING_DIRECTORY ${COV_PATH} + ) +endforeach() + +# TODO: Make these be absolute path +file(GLOB ALL_GCOV_FILES ${COV_PATH}/*.gcov) + +# Get only the filenames to use for filtering. +#set(COVERAGE_SRCS_NAMES "") +#foreach (COVSRC ${COVERAGE_SRCS}) +# get_filename_component(COVSRC_NAME ${COVSRC} NAME) +# message("${COVSRC} -> ${COVSRC_NAME}") +# list(APPEND COVERAGE_SRCS_NAMES "${COVSRC_NAME}") +#endforeach() + +# +# Filter out all but the gcov files we want. +# +# We do this by comparing the list of COVERAGE_SRCS filepaths that the +# user wants the coverage data for with the paths of the generated .gcov files, +# so that we only keep the relevant gcov files. +# +# Example: +# COVERAGE_SRCS = +# /path/to/project/root/subdir/the_file.c +# +# ALL_GCOV_FILES = +# /path/to/project/root/build/#path#to#project#root#subdir#the_file.c.gcov +# /path/to/project/root/build/#path#to#project#root#subdir#other_file.c.gcov +# +# Result should be: +# GCOV_FILES = +# /path/to/project/root/build/#path#to#project#root#subdir#the_file.c.gcov +# +set(GCOV_FILES "") +#message("Look in coverage sources: ${COVERAGE_SRCS}") +message("\nFilter out unwanted GCOV files:") +message("===============================") + +set(COVERAGE_SRCS_REMAINING ${COVERAGE_SRCS}) + +foreach (GCOV_FILE ${ALL_GCOV_FILES}) + + # + # /path/to/project/root/build/#path#to#project#root#subdir#the_file.c.gcov + # -> + # /path/to/project/root/subdir/the_file.c + get_source_path_from_gcov_filename(GCOV_SRC_PATH ${GCOV_FILE}) + file(RELATIVE_PATH GCOV_SRC_REL_PATH "${PROJECT_ROOT}" "${GCOV_SRC_PATH}") + + # Is this in the list of source files? + # TODO: We want to match against relative path filenames from the source file root... + list(FIND COVERAGE_SRCS ${GCOV_SRC_PATH} WAS_FOUND) + + if (NOT WAS_FOUND EQUAL -1) + message("YES: ${GCOV_FILE}") + list(APPEND GCOV_FILES ${GCOV_FILE}) + + # We remove it from the list, so we don't bother searching for it again. + # Also files left in COVERAGE_SRCS_REMAINING after this loop ends should + # have coverage data generated from them (no lines are covered). + list(REMOVE_ITEM COVERAGE_SRCS_REMAINING ${GCOV_SRC_PATH}) + else() + message("NO: ${GCOV_FILE}") + endif() +endforeach() + +# TODO: Enable setting these +set(JSON_SERVICE_NAME "travis-ci") +set(JSON_SERVICE_JOB_ID $ENV{TRAVIS_JOB_ID}) +set(JSON_REPO_TOKEN $ENV{COVERALLS_REPO_TOKEN}) + +set(JSON_TEMPLATE +"{ + \"repo_token\": \"\@JSON_REPO_TOKEN\@\", + \"service_name\": \"\@JSON_SERVICE_NAME\@\", + \"service_job_id\": \"\@JSON_SERVICE_JOB_ID\@\", + \"source_files\": \@JSON_GCOV_FILES\@, + \"git\": \@JSON_REPO_DATA\@ +}" +) + +set(SRC_FILE_TEMPLATE +"{ + \"name\": \"\@GCOV_SRC_REL_PATH\@\", + \"source_digest\": \"\@GCOV_CONTENTS_MD5\@\", + \"coverage\": \@GCOV_FILE_COVERAGE\@ + }" +) + +message("\nGenerate JSON for files:") +message("=========================") + +set(JSON_GCOV_FILES "[") + +# Read the GCOV files line by line and get the coverage data. +foreach (GCOV_FILE ${GCOV_FILES}) + + get_source_path_from_gcov_filename(GCOV_SRC_PATH ${GCOV_FILE}) + file(RELATIVE_PATH GCOV_SRC_REL_PATH "${PROJECT_ROOT}" "${GCOV_SRC_PATH}") + + # The new coveralls API doesn't need the entire source (Yay!) + # However, still keeping that part for now. Will cleanup in the future. + file(MD5 "${GCOV_SRC_PATH}" GCOV_CONTENTS_MD5) + message("MD5: ${GCOV_SRC_PATH} = ${GCOV_CONTENTS_MD5}") + + # Loads the gcov file as a list of lines. + # (We first open the file and replace all occurences of [] with _ + # because CMake will fail to parse a line containing unmatched brackets... + # also the \ to escaped \n in macros screws up things.) + # https://public.kitware.com/Bug/view.php?id=15369 + file(READ ${GCOV_FILE} GCOV_CONTENTS) + string(REPLACE "[" "_" GCOV_CONTENTS "${GCOV_CONTENTS}") + string(REPLACE "]" "_" GCOV_CONTENTS "${GCOV_CONTENTS}") + string(REPLACE "\\" "_" GCOV_CONTENTS "${GCOV_CONTENTS}") + + # Remove file contents to avoid encoding issues (cmake 2.8 has no ENCODING option) + string(REGEX REPLACE "([^:]*):([^:]*):([^\n]*)\n" "\\1:\\2: \n" GCOV_CONTENTS "${GCOV_CONTENTS}") + file(WRITE ${GCOV_FILE}_tmp "${GCOV_CONTENTS}") + + file(STRINGS ${GCOV_FILE}_tmp GCOV_LINES) + list(LENGTH GCOV_LINES LINE_COUNT) + + # Instead of trying to parse the source from the + # gcov file, simply read the file contents from the source file. + # (Parsing it from the gcov is hard because C-code uses ; in many places + # which also happens to be the same as the CMake list delimeter). + file(READ ${GCOV_SRC_PATH} GCOV_FILE_SOURCE) + + string(REPLACE "\\" "\\\\" GCOV_FILE_SOURCE "${GCOV_FILE_SOURCE}") + string(REGEX REPLACE "\"" "\\\\\"" GCOV_FILE_SOURCE "${GCOV_FILE_SOURCE}") + string(REPLACE "\t" "\\\\t" GCOV_FILE_SOURCE "${GCOV_FILE_SOURCE}") + string(REPLACE "\r" "\\\\r" GCOV_FILE_SOURCE "${GCOV_FILE_SOURCE}") + string(REPLACE "\n" "\\\\n" GCOV_FILE_SOURCE "${GCOV_FILE_SOURCE}") + # According to http://json.org/ these should be escaped as well. + # Don't know how to do that in CMake however... + #string(REPLACE "\b" "\\\\b" GCOV_FILE_SOURCE "${GCOV_FILE_SOURCE}") + #string(REPLACE "\f" "\\\\f" GCOV_FILE_SOURCE "${GCOV_FILE_SOURCE}") + #string(REGEX REPLACE "\u([a-fA-F0-9]{4})" "\\\\u\\1" GCOV_FILE_SOURCE "${GCOV_FILE_SOURCE}") + + # We want a json array of coverage data as a single string + # start building them from the contents of the .gcov + set(GCOV_FILE_COVERAGE "[") + + set(GCOV_LINE_COUNT 1) # Line number for the .gcov. + set(DO_SKIP 0) + foreach (GCOV_LINE ${GCOV_LINES}) + #message("${GCOV_LINE}") + # Example of what we're parsing: + # Hitcount |Line | Source + # " 8: 26: if (!allowed || (strlen(allowed) == 0))" + string(REGEX REPLACE + "^([^:]*):([^:]*):(.*)$" + "\\1;\\2;\\3" + RES + "${GCOV_LINE}") + + # Check if we should exclude lines using the Lcov syntax. + string(REGEX MATCH "LCOV_EXCL_START" START_SKIP "${GCOV_LINE}") + string(REGEX MATCH "LCOV_EXCL_END" END_SKIP "${GCOV_LINE}") + string(REGEX MATCH "LCOV_EXCL_LINE" LINE_SKIP "${GCOV_LINE}") + + set(RESET_SKIP 0) + if (LINE_SKIP AND NOT DO_SKIP) + set(DO_SKIP 1) + set(RESET_SKIP 1) + endif() + + if (START_SKIP) + set(DO_SKIP 1) + message("${GCOV_LINE_COUNT}: Start skip") + endif() + + if (END_SKIP) + set(DO_SKIP 0) + endif() + + list(LENGTH RES RES_COUNT) + + if (RES_COUNT GREATER 2) + list(GET RES 0 HITCOUNT) + list(GET RES 1 LINE) + list(GET RES 2 SOURCE) + + string(STRIP ${HITCOUNT} HITCOUNT) + string(STRIP ${LINE} LINE) + + # Lines with 0 line numbers are metadata and can be ignored. + if (NOT ${LINE} EQUAL 0) + + if (DO_SKIP) + set(GCOV_FILE_COVERAGE "${GCOV_FILE_COVERAGE}null, ") + else() + # Translate the hitcount into valid JSON values. + if (${HITCOUNT} STREQUAL "#####" OR ${HITCOUNT} STREQUAL "=====") + set(GCOV_FILE_COVERAGE "${GCOV_FILE_COVERAGE}0, ") + elseif (${HITCOUNT} STREQUAL "-") + set(GCOV_FILE_COVERAGE "${GCOV_FILE_COVERAGE}null, ") + else() + set(GCOV_FILE_COVERAGE "${GCOV_FILE_COVERAGE}${HITCOUNT}, ") + endif() + endif() + endif() + else() + message(WARNING "Failed to properly parse line (RES_COUNT = ${RES_COUNT}) ${GCOV_FILE}:${GCOV_LINE_COUNT}\n-->${GCOV_LINE}") + endif() + + if (RESET_SKIP) + set(DO_SKIP 0) + endif() + math(EXPR GCOV_LINE_COUNT "${GCOV_LINE_COUNT}+1") + endforeach() + + message("${GCOV_LINE_COUNT} of ${LINE_COUNT} lines read!") + + # Advanced way of removing the trailing comma in the JSON array. + # "[1, 2, 3, " -> "[1, 2, 3" + string(REGEX REPLACE ",[ ]*$" "" GCOV_FILE_COVERAGE ${GCOV_FILE_COVERAGE}) + + # Append the trailing ] to complete the JSON array. + set(GCOV_FILE_COVERAGE "${GCOV_FILE_COVERAGE}]") + + # Generate the final JSON for this file. + message("Generate JSON for file: ${GCOV_SRC_REL_PATH}...") + string(CONFIGURE ${SRC_FILE_TEMPLATE} FILE_JSON) + + set(JSON_GCOV_FILES "${JSON_GCOV_FILES}${FILE_JSON}, ") +endforeach() + +# Loop through all files we couldn't find any coverage for +# as well, and generate JSON for those as well with 0% coverage. +foreach(NOT_COVERED_SRC ${COVERAGE_SRCS_REMAINING}) + + # Set variables for json replacement + set(GCOV_SRC_PATH ${NOT_COVERED_SRC}) + file(MD5 "${GCOV_SRC_PATH}" GCOV_CONTENTS_MD5) + file(RELATIVE_PATH GCOV_SRC_REL_PATH "${PROJECT_ROOT}" "${GCOV_SRC_PATH}") + + # Loads the source file as a list of lines. + file(STRINGS ${NOT_COVERED_SRC} SRC_LINES) + + set(GCOV_FILE_COVERAGE "[") + set(GCOV_FILE_SOURCE "") + + foreach (SOURCE ${SRC_LINES}) + set(GCOV_FILE_COVERAGE "${GCOV_FILE_COVERAGE}null, ") + + string(REPLACE "\\" "\\\\" SOURCE "${SOURCE}") + string(REGEX REPLACE "\"" "\\\\\"" SOURCE "${SOURCE}") + string(REPLACE "\t" "\\\\t" SOURCE "${SOURCE}") + string(REPLACE "\r" "\\\\r" SOURCE "${SOURCE}") + set(GCOV_FILE_SOURCE "${GCOV_FILE_SOURCE}${SOURCE}\\n") + endforeach() + + # Remove trailing comma, and complete JSON array with ] + string(REGEX REPLACE ",[ ]*$" "" GCOV_FILE_COVERAGE ${GCOV_FILE_COVERAGE}) + set(GCOV_FILE_COVERAGE "${GCOV_FILE_COVERAGE}]") + + # Generate the final JSON for this file. + message("Generate JSON for non-gcov file: ${NOT_COVERED_SRC}...") + string(CONFIGURE ${SRC_FILE_TEMPLATE} FILE_JSON) + set(JSON_GCOV_FILES "${JSON_GCOV_FILES}${FILE_JSON}, ") +endforeach() + +# Get rid of trailing comma. +string(REGEX REPLACE ",[ ]*$" "" JSON_GCOV_FILES ${JSON_GCOV_FILES}) +set(JSON_GCOV_FILES "${JSON_GCOV_FILES}]") + +# Generate the final complete JSON! +message("Generate final JSON...") +string(CONFIGURE ${JSON_TEMPLATE} JSON) + +file(WRITE "${COVERALLS_OUTPUT_FILE}" "${JSON}") +message("###########################################################################") +message("Generated coveralls JSON containing coverage data:") +message("${COVERALLS_OUTPUT_FILE}") +message("###########################################################################") diff --git a/cmake-modules/FindRT.cmake b/cmake-modules/FindRT.cmake new file mode 100644 index 000000000..17d5df81d --- /dev/null +++ b/cmake-modules/FindRT.cmake @@ -0,0 +1,20 @@ +# Try to find real time libraries +# Once done, this will define +# +# RT_FOUND - system has rt library +# RT_LIBRARIES - rt libraries directory +# +# Source: https://gitlab.cern.ch/dss/eos/commit/44070e575faaa46bd998708ef03eedb381506ff0 +# + +if(RT_LIBRARIES) + set(RT_FIND_QUIETLY TRUE) +endif(RT_LIBRARIES) + +find_library(RT_LIBRARY rt) +set(RT_LIBRARIES ${RT_LIBRARY}) +# handle the QUIETLY and REQUIRED arguments and set +# RT_FOUND to TRUE if all listed variables are TRUE +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(rt DEFAULT_MSG RT_LIBRARY) +mark_as_advanced(RT_LIBRARY) diff --git a/code/3DSExporter.cpp b/code/3DSExporter.cpp index 9bef33525..d34901854 100644 --- a/code/3DSExporter.cpp +++ b/code/3DSExporter.cpp @@ -44,6 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "3DSExporter.h" #include "3DSLoader.h" +#include "3DSHelper.h" #include "SceneCombiner.h" #include "SplitLargeMeshes.h" #include "StringComparison.h" @@ -54,6 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace Assimp; namespace Assimp { +using namespace D3DS; namespace { diff --git a/code/3DSHelper.h b/code/3DSHelper.h index b1de4ee77..7a2ad3f8a 100644 --- a/code/3DSHelper.h +++ b/code/3DSHelper.h @@ -369,14 +369,13 @@ struct Material { //! Default constructor. Builds a default name for the material Material() - : - mDiffuse (0.6,0.6,0.6), // FIX ... we won't want object to be black - mSpecularExponent (0.0), - mShininessStrength (1.0), - mShading(Discreet3DS::Gouraud), - mTransparency (1.0), - mBumpHeight (1.0), - mTwoSided (false) + : mDiffuse ( ai_real( 0.6 ), ai_real( 0.6 ), ai_real( 0.6 ) ) // FIX ... we won't want object to be black + , mSpecularExponent ( ai_real( 0.0 ) ) + , mShininessStrength ( ai_real( 1.0 ) ) + , mShading(Discreet3DS::Gouraud) + , mTransparency ( ai_real( 1.0 ) ) + , mBumpHeight ( ai_real( 1.0 ) ) + , mTwoSided (false) { static int iCnt = 0; diff --git a/code/3DSLoader.cpp b/code/3DSLoader.cpp index bae3cb1e6..0a1fe776b 100644 --- a/code/3DSLoader.cpp +++ b/code/3DSLoader.cpp @@ -1166,14 +1166,15 @@ void Discreet3DSImporter::ParseMaterialChunk() case Discreet3DS::CHUNK_MAT_TRANSPARENCY: { - // This is the material's transparency - ai_real* pcf = &mScene->mMaterials.back().mTransparency; - *pcf = ParsePercentageChunk(); + // This is the material's transparency + ai_real* pcf = &mScene->mMaterials.back().mTransparency; + *pcf = ParsePercentageChunk(); - // NOTE: transparency, not opacity - if (is_qnan(*pcf)) - *pcf = 1.0; - else *pcf = 1.0 - *pcf * (ai_real)0xFFFF / 100.0; + // NOTE: transparency, not opacity + if (is_qnan(*pcf)) + *pcf = ai_real( 1.0 ); + else + *pcf = ai_real( 1.0 ) - *pcf * (ai_real)0xFFFF / ai_real( 100.0 ); } break; @@ -1199,21 +1200,23 @@ void Discreet3DSImporter::ParseMaterialChunk() case Discreet3DS::CHUNK_MAT_SHININESS_PERCENT: { // This is the shininess strength of the material - ai_real* pcf = &mScene->mMaterials.back().mShininessStrength; - *pcf = ParsePercentageChunk(); - if (is_qnan(*pcf)) - *pcf = 0.0; - else *pcf *= (ai_real)0xffff / 100.0; + ai_real* pcf = &mScene->mMaterials.back().mShininessStrength; + *pcf = ParsePercentageChunk(); + if (is_qnan(*pcf)) + *pcf = ai_real( 0.0 ); + else + *pcf *= (ai_real)0xffff / ai_real( 100.0 ); } break; case Discreet3DS::CHUNK_MAT_SELF_ILPCT: { // This is the self illumination strength of the material - ai_real f = ParsePercentageChunk(); - if (is_qnan(f)) - f = 0.0; - else f *= (ai_real)0xFFFF / 100.0; - mScene->mMaterials.back().mEmissive = aiColor3D(f,f,f); + ai_real f = ParsePercentageChunk(); + if (is_qnan(f)) + f = ai_real( 0.0 ); + else + f *= (ai_real)0xFFFF / ai_real( 100.0 ); + mScene->mMaterials.back().mEmissive = aiColor3D(f,f,f); } break; @@ -1272,7 +1275,7 @@ void Discreet3DSImporter::ParseTextureChunk(D3DS::Texture* pcOut) case Discreet3DS::CHUNK_PERCENTD: // Manually parse the blend factor - pcOut->mTextureBlend = stream->GetF8(); + pcOut->mTextureBlend = ai_real( stream->GetF8() ); break; case Discreet3DS::CHUNK_PERCENTF: @@ -1282,7 +1285,7 @@ void Discreet3DSImporter::ParseTextureChunk(D3DS::Texture* pcOut) case Discreet3DS::CHUNK_PERCENTW: // Manually parse the blend factor - pcOut->mTextureBlend = (ai_real)((uint16_t)stream->GetI2()) / 100.0; + pcOut->mTextureBlend = (ai_real)((uint16_t)stream->GetI2()) / ai_real( 100.0 ); break; case Discreet3DS::CHUNK_MAT_MAP_USCALE: @@ -1355,8 +1358,7 @@ ai_real Discreet3DSImporter::ParsePercentageChunk() // ------------------------------------------------------------------------------------------------ // Read a color chunk. If a percentage chunk is found instead it is read as a grayscale color -void Discreet3DSImporter::ParseColorChunk(aiColor3D* out, - bool acceptPercent) +void Discreet3DSImporter::ParseColorChunk( aiColor3D* out, bool acceptPercent ) { ai_assert(out != NULL); @@ -1389,13 +1391,16 @@ void Discreet3DSImporter::ParseColorChunk(aiColor3D* out, case Discreet3DS::CHUNK_LINRGBB: bGamma = true; case Discreet3DS::CHUNK_RGBB: - if (sizeof(char) * 3 > diff) { - *out = clrError; - return; + { + if ( sizeof( char ) * 3 > diff ) { + *out = clrError; + return; + } + const ai_real invVal = ai_real( 1.0 ) / ai_real( 255.0 ); + out->r = ( ai_real ) ( uint8_t ) stream->GetI1() * invVal; + out->g = ( ai_real ) ( uint8_t ) stream->GetI1() * invVal; + out->b = ( ai_real ) ( uint8_t ) stream->GetI1() * invVal; } - out->r = (ai_real)(uint8_t)stream->GetI1() / 255.0; - out->g = (ai_real)(uint8_t)stream->GetI1() / 255.0; - out->b = (ai_real)(uint8_t)stream->GetI1() / 255.0; break; // Percentage chunks are accepted, too. @@ -1409,7 +1414,7 @@ void Discreet3DSImporter::ParseColorChunk(aiColor3D* out, case Discreet3DS::CHUNK_PERCENTW: if (acceptPercent && 1 <= diff) { - out->g = out->b = out->r = (ai_real)(uint8_t)stream->GetI1() / 255.0; + out->g = out->b = out->r = (ai_real)(uint8_t)stream->GetI1() / ai_real( 255.0 ); break; } *out = clrError; diff --git a/code/AMFImporter.cpp b/code/AMFImporter.cpp new file mode 100644 index 000000000..d68e01904 --- /dev/null +++ b/code/AMFImporter.cpp @@ -0,0 +1,702 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +/// \file AMFImporter.cpp +/// \brief AMF-format files importer for Assimp: main algorithm implementation. +/// \date 2016 +/// \author smal.root@gmail.com + +#ifndef ASSIMP_BUILD_NO_AMF_IMPORTER + +// Header files, Assimp. +#include "AMFImporter.hpp" +#include "AMFImporter_Macro.hpp" + +#include "fast_atof.h" +#include "DefaultIOSystem.h" + +// Header files, stdlib. +#include +#include + +namespace Assimp +{ + +/// \var aiImporterDesc AMFImporter::Description +/// Conastant which hold importer description +const aiImporterDesc AMFImporter::Description = { + "Additive manufacturing file format(AMF) Importer", + "smalcom", + "", + "See documentation in source code. Chapter: Limitations.", + aiImporterFlags_SupportTextFlavour | aiImporterFlags_LimitedSupport | aiImporterFlags_Experimental, + 0, + 0, + 0, + 0, + "amf" +}; + +void AMFImporter::Clear() +{ + mNodeElement_Cur = nullptr; + mUnit.clear(); + mMaterial_Converted.clear(); + mTexture_Converted.clear(); + // Delete all elements + if(mNodeElement_List.size()) + { + for(CAMFImporter_NodeElement* ne: mNodeElement_List) { delete ne; } + + mNodeElement_List.clear(); + } +} + +AMFImporter::~AMFImporter() +{ + if(mReader != nullptr) delete mReader; + // Clear() is accounting if data already is deleted. So, just check again if all data is deleted. + Clear(); +} + +/*********************************************************************************************************************************************/ +/************************************************************ Functions: find set ************************************************************/ +/*********************************************************************************************************************************************/ + +bool AMFImporter::Find_NodeElement(const std::string& pID, const CAMFImporter_NodeElement::EType pType, CAMFImporter_NodeElement** pNodeElement) const +{ + for(CAMFImporter_NodeElement* ne: mNodeElement_List) + { + if((ne->ID == pID) && (ne->Type == pType)) + { + if(pNodeElement != nullptr) *pNodeElement = ne; + + return true; + } + }// for(CAMFImporter_NodeElement* ne: mNodeElement_List) + + return false; +} + +bool AMFImporter::Find_ConvertedNode(const std::string& pID, std::list& pNodeList, aiNode** pNode) const +{ +aiString node_name(pID.c_str()); + + for(aiNode* node: pNodeList) + { + if(node->mName == node_name) + { + if(pNode != nullptr) *pNode = node; + + return true; + } + }// for(aiNode* node: pNodeList) + + return false; +} + +bool AMFImporter::Find_ConvertedMaterial(const std::string& pID, const SPP_Material** pConvertedMaterial) const +{ + for(const SPP_Material& mat: mMaterial_Converted) + { + if(mat.ID == pID) + { + if(pConvertedMaterial != nullptr) *pConvertedMaterial = &mat; + + return true; + } + }// for(const SPP_Material& mat: mMaterial_Converted) + + return false; +} + +/*********************************************************************************************************************************************/ +/************************************************************ Functions: throw set ***********************************************************/ +/*********************************************************************************************************************************************/ + +void AMFImporter::Throw_CloseNotFound(const std::string& pNode) +{ + throw DeadlyImportError("Close tag for node <" + pNode + "> not found. Seems file is corrupt."); +} + +void AMFImporter::Throw_IncorrectAttr(const std::string& pAttrName) +{ + throw DeadlyImportError("Node <" + std::string(mReader->getNodeName()) + "> has incorrect attribute \"" + pAttrName + "\"."); +} + +void AMFImporter::Throw_IncorrectAttrValue(const std::string& pAttrName) +{ + throw DeadlyImportError("Attribute \"" + pAttrName + "\" in node <" + std::string(mReader->getNodeName()) + "> has incorrect value."); +} + +void AMFImporter::Throw_MoreThanOnceDefined(const std::string& pNodeType, const std::string& pDescription) +{ + throw DeadlyImportError("\"" + pNodeType + "\" node can be used only once in " + mReader->getNodeName() + ". Description: " + pDescription); +} + +void AMFImporter::Throw_ID_NotFound(const std::string& pID) const +{ + throw DeadlyImportError("Not found node with name \"" + pID + "\"."); +} + +/*********************************************************************************************************************************************/ +/************************************************************* Functions: XML set ************************************************************/ +/*********************************************************************************************************************************************/ + +void AMFImporter::XML_CheckNode_MustHaveChildren() +{ + if(mReader->isEmptyElement()) throw DeadlyImportError(std::string("Node <") + mReader->getNodeName() + "> must have children."); +} + +void AMFImporter::XML_CheckNode_SkipUnsupported(const std::string& pParentNodeName) +{ +const size_t Uns_Skip_Len = 3; +const char* Uns_Skip[Uns_Skip_Len] = { "composite", "edge", "normal" }; + +static bool skipped_before[Uns_Skip_Len] = { false, false, false }; + +std::string nn(mReader->getNodeName()); +bool found = false; +bool close_found = false; +size_t sk_idx; + + for(sk_idx = 0; sk_idx < Uns_Skip_Len; sk_idx++) + { + if(nn != Uns_Skip[sk_idx]) continue; + + found = true; + if(mReader->isEmptyElement()) + { + close_found = true; + + goto casu_cres; + } + + while(mReader->read()) + { + if((mReader->getNodeType() == irr::io::EXN_ELEMENT_END) && (nn == mReader->getNodeName())) + { + close_found = true; + + goto casu_cres; + } + } + }// for(sk_idx = 0; sk_idx < Uns_Skip_Len; sk_idx++) + +casu_cres: + + if(!found) throw DeadlyImportError("Unknown node \"" + nn + "\" in " + pParentNodeName + "."); + if(!close_found) Throw_CloseNotFound(nn); + + if(!skipped_before[sk_idx]) + { + skipped_before[sk_idx] = true; + LogWarning("Skipping node \"" + nn + "\" in " + pParentNodeName + "."); + } +} + +bool AMFImporter::XML_SearchNode(const std::string& pNodeName) +{ + while(mReader->read()) + { + if((mReader->getNodeType() == irr::io::EXN_ELEMENT) && XML_CheckNode_NameEqual(pNodeName)) return true; + } + + return false; +} + +bool AMFImporter::XML_ReadNode_GetAttrVal_AsBool(const int pAttrIdx) +{ +std::string val(mReader->getAttributeValue(pAttrIdx)); + + if((val == "false") || (val == "0")) + return false; + else if((val == "true") || (val == "1")) + return true; + else + throw DeadlyImportError("Bool attribute value can contain \"false\"/\"0\" or \"true\"/\"1\" not the \"" + val + "\""); +} + +float AMFImporter::XML_ReadNode_GetAttrVal_AsFloat(const int pAttrIdx) +{ +std::string val; +float tvalf; + + ParseHelper_FixTruncatedFloatString(mReader->getAttributeValue(pAttrIdx), val); + fast_atoreal_move(val.c_str(), tvalf, false); + + return tvalf; +} + +uint32_t AMFImporter::XML_ReadNode_GetAttrVal_AsU32(const int pAttrIdx) +{ + return strtoul10(mReader->getAttributeValue(pAttrIdx)); +} + +float AMFImporter::XML_ReadNode_GetVal_AsFloat() +{ +std::string val; +float tvalf; + + if(!mReader->read()) throw DeadlyImportError("XML_ReadNode_GetVal_AsFloat. No data, seems file is corrupt."); + if(mReader->getNodeType() != irr::io::EXN_TEXT) throw DeadlyImportError("XML_ReadNode_GetVal_AsFloat. Invalid type of XML element, seems file is corrupt."); + + ParseHelper_FixTruncatedFloatString(mReader->getNodeData(), val); + fast_atoreal_move(val.c_str(), tvalf, false); + + return tvalf; +} + +uint32_t AMFImporter::XML_ReadNode_GetVal_AsU32() +{ + if(!mReader->read()) throw DeadlyImportError("XML_ReadNode_GetVal_AsU32. No data, seems file is corrupt."); + if(mReader->getNodeType() != irr::io::EXN_TEXT) throw DeadlyImportError("XML_ReadNode_GetVal_AsU32. Invalid type of XML element, seems file is corrupt."); + + return strtoul10(mReader->getNodeData()); +} + +void AMFImporter::XML_ReadNode_GetVal_AsString(std::string& pValue) +{ + if(!mReader->read()) throw DeadlyImportError("XML_ReadNode_GetVal_AsString. No data, seems file is corrupt."); + if(mReader->getNodeType() != irr::io::EXN_TEXT) + throw DeadlyImportError("XML_ReadNode_GetVal_AsString. Invalid type of XML element, seems file is corrupt."); + + pValue = mReader->getNodeData(); +} + +/*********************************************************************************************************************************************/ +/************************************************************ Functions: parse set ***********************************************************/ +/*********************************************************************************************************************************************/ + +void AMFImporter::ParseHelper_Node_Enter(CAMFImporter_NodeElement* pNode) +{ + mNodeElement_Cur->Child.push_back(pNode);// add new element to current element child list. + mNodeElement_Cur = pNode;// switch current element to new one. +} + +void AMFImporter::ParseHelper_Node_Exit() +{ + // check if we can walk up. + if(mNodeElement_Cur != nullptr) mNodeElement_Cur = mNodeElement_Cur->Parent; +} + +void AMFImporter::ParseHelper_FixTruncatedFloatString(const char* pInStr, std::string& pOutString) +{ +size_t instr_len; + + pOutString.clear(); + instr_len = strlen(pInStr); + if(!instr_len) return; + + pOutString.reserve(instr_len * 3 / 2); + // check and correct floats in format ".x". Must be "x.y". + if(pInStr[0] == '.') pOutString.push_back('0'); + + pOutString.push_back(pInStr[0]); + for(size_t ci = 1; ci < instr_len; ci++) + { + if((pInStr[ci] == '.') && ((pInStr[ci - 1] == ' ') || (pInStr[ci - 1] == '-') || (pInStr[ci - 1] == '+') || (pInStr[ci - 1] == '\t'))) + { + pOutString.push_back('0'); + pOutString.push_back('.'); + } + else + { + pOutString.push_back(pInStr[ci]); + } + } +} + +static bool ParseHelper_Decode_Base64_IsBase64(const char pChar) +{ + return (isalnum(pChar) || (pChar == '+') || (pChar == '/')); +} + +void AMFImporter::ParseHelper_Decode_Base64(const std::string& pInputBase64, std::vector& pOutputData) const +{ +// With help from +// RenИ Nyffenegger http://www.adp-gmbh.ch/cpp/common/base64.html +const std::string base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +uint8_t tidx = 0; +uint8_t arr4[4], arr3[3]; + + // check input data + if(pInputBase64.size() % 4) throw DeadlyImportError("Base64-encoded data must have size multiply of four."); + // prepare output place + pOutputData.clear(); + pOutputData.reserve(pInputBase64.size() / 4 * 3); + + for(size_t in_len = pInputBase64.size(), in_idx = 0; (in_len > 0) && (pInputBase64[in_idx] != '='); in_len--) + { + if(ParseHelper_Decode_Base64_IsBase64(pInputBase64[in_idx])) + { + arr4[tidx++] = pInputBase64[in_idx++]; + if(tidx == 4) + { + for(tidx = 0; tidx < 4; tidx++) arr4[tidx] = (uint8_t)base64_chars.find(arr4[tidx]); + + arr3[0] = (arr4[0] << 2) + ((arr4[1] & 0x30) >> 4); + arr3[1] = ((arr4[1] & 0x0F) << 4) + ((arr4[2] & 0x3C) >> 2); + arr3[2] = ((arr4[2] & 0x03) << 6) + arr4[3]; + for(tidx = 0; tidx < 3; tidx++) pOutputData.push_back(arr3[tidx]); + + tidx = 0; + }// if(tidx == 4) + }// if(ParseHelper_Decode_Base64_IsBase64(pInputBase64[in_idx])) + else + { + in_idx++; + }// if(ParseHelper_Decode_Base64_IsBase64(pInputBase64[in_idx])) else + } + + if(tidx) + { + for(uint8_t i = tidx; i < 4; i++) arr4[i] = 0; + for(uint8_t i = 0; i < 4; i++) arr4[i] = (uint8_t)(base64_chars.find(arr4[i])); + + arr3[0] = (arr4[0] << 2) + ((arr4[1] & 0x30) >> 4); + arr3[1] = ((arr4[1] & 0x0F) << 4) + ((arr4[2] & 0x3C) >> 2); + arr3[2] = ((arr4[2] & 0x03) << 6) + arr4[3]; + for(uint8_t i = 0; i < (tidx - 1); i++) pOutputData.push_back(arr3[i]); + } +} + +void AMFImporter::ParseFile(const std::string& pFile, IOSystem* pIOHandler) +{ +irr::io::IrrXMLReader* OldReader = mReader;// store current XMLreader. +std::unique_ptr file(pIOHandler->Open(pFile, "rb")); + + // Check whether we can read from the file + if(file.get() == NULL) throw DeadlyImportError("Failed to open AMF file " + pFile + "."); + + // generate a XML reader for it + std::unique_ptr mIOWrapper(new CIrrXML_IOStreamReader(file.get())); + mReader = irr::io::createIrrXMLReader(mIOWrapper.get()); + if(!mReader) throw DeadlyImportError("Failed to create XML reader for file" + pFile + "."); + // + // start reading + // search for root tag + if(XML_SearchNode("amf")) + ParseNode_Root(); + else + throw DeadlyImportError("Root node \"amf\" not found."); + + delete mReader; + // restore old XMLreader + mReader = OldReader; +} + +// +// +// Root XML element. +// Multi elements - No. +void AMFImporter::ParseNode_Root() +{ +std::string unit, version; +CAMFImporter_NodeElement* ne; + + // Read attributes for node . + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECK_RET("unit", unit, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_RET("version", version, mReader->getAttributeValue); + MACRO_ATTRREAD_LOOPEND_WSKIP; + + // Check attributes + if(!mUnit.empty()) + { + if((mUnit != "inch") && (mUnit != "millimeter") && (mUnit != "meter") && (mUnit != "feet") && (mUnit != "micron")) Throw_IncorrectAttrValue("unit"); + } + + // create root node element. + ne = new CAMFImporter_NodeElement_Root(nullptr); + mNodeElement_Cur = ne;// set first "current" element + // and assign attribute's values + ((CAMFImporter_NodeElement_Root*)ne)->Unit = unit; + ((CAMFImporter_NodeElement_Root*)ne)->Version = version; + + // Check for child nodes + if(!mReader->isEmptyElement()) + { + MACRO_NODECHECK_LOOPBEGIN("amf"); + if(XML_CheckNode_NameEqual("object")) { ParseNode_Object(); continue; } + if(XML_CheckNode_NameEqual("material")) { ParseNode_Material(); continue; } + if(XML_CheckNode_NameEqual("texture")) { ParseNode_Texture(); continue; } + if(XML_CheckNode_NameEqual("constellation")) { ParseNode_Constellation(); continue; } + if(XML_CheckNode_NameEqual("metadata")) { ParseNode_Metadata(); continue; } + MACRO_NODECHECK_LOOPEND("amf"); + mNodeElement_Cur = ne;// force restore "current" element + }// if(!mReader->isEmptyElement()) + + mNodeElement_List.push_back(ne);// add to node element list because its a new object in graph. +} + +// +// +// A collection of objects or constellations with specific relative locations. +// Multi elements - Yes. +// Parent element - . +void AMFImporter::ParseNode_Constellation() +{ +std::string id; +CAMFImporter_NodeElement* ne; + + // Read attributes for node . + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECK_RET("id", id, mReader->getAttributeValue); + MACRO_ATTRREAD_LOOPEND; + + // create and if needed - define new grouping object. + ne = new CAMFImporter_NodeElement_Constellation(mNodeElement_Cur); + + CAMFImporter_NodeElement_Constellation& als = *((CAMFImporter_NodeElement_Constellation*)ne);// alias for convenience + + if(!id.empty()) als.ID = id; + // Check for child nodes + if(!mReader->isEmptyElement()) + { + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("constellation"); + if(XML_CheckNode_NameEqual("instance")) { ParseNode_Instance(); continue; } + if(XML_CheckNode_NameEqual("metadata")) { ParseNode_Metadata(); continue; } + MACRO_NODECHECK_LOOPEND("constellation"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element + }// if(!mReader->isEmptyElement()) else + + mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph. +} + +// +// +// A collection of objects or constellations with specific relative locations. +// Multi elements - Yes. +// Parent element - . +void AMFImporter::ParseNode_Instance() +{ +std::string objectid; +CAMFImporter_NodeElement* ne; + + // Read attributes for node . + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECK_RET("objectid", objectid, mReader->getAttributeValue); + MACRO_ATTRREAD_LOOPEND; + + // used object id must be defined, check that. + if(objectid.empty()) throw DeadlyImportError("\"objectid\" in must be defined."); + // create and define new grouping object. + ne = new CAMFImporter_NodeElement_Instance(mNodeElement_Cur); + + CAMFImporter_NodeElement_Instance& als = *((CAMFImporter_NodeElement_Instance*)ne);// alias for convenience + + als.ObjectID = objectid; + // Check for child nodes + if(!mReader->isEmptyElement()) + { + bool read_flag[6] = { false, false, false, false, false, false }; + + als.Delta.Set(0, 0, 0); + als.Rotation.Set(0, 0, 0); + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("instance"); + MACRO_NODECHECK_READCOMP_F("deltax", read_flag[0], als.Delta.x); + MACRO_NODECHECK_READCOMP_F("deltay", read_flag[1], als.Delta.y); + MACRO_NODECHECK_READCOMP_F("deltaz", read_flag[2], als.Delta.z); + MACRO_NODECHECK_READCOMP_F("rx", read_flag[3], als.Rotation.x); + MACRO_NODECHECK_READCOMP_F("ry", read_flag[4], als.Rotation.y); + MACRO_NODECHECK_READCOMP_F("rz", read_flag[5], als.Rotation.z); + MACRO_NODECHECK_LOOPEND("instance"); + ParseHelper_Node_Exit(); + // also convert degrees to radians. + als.Rotation.x = AI_MATH_PI_F * als.Rotation.x / 180.0f; + als.Rotation.y = AI_MATH_PI_F * als.Rotation.y / 180.0f; + als.Rotation.z = AI_MATH_PI_F * als.Rotation.z / 180.0f; + }// if(!mReader->isEmptyElement()) + else + { + mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element + }// if(!mReader->isEmptyElement()) else + + mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph. +} + +// +// +// An object definition. +// Multi elements - Yes. +// Parent element - . +void AMFImporter::ParseNode_Object() +{ +std::string id; +CAMFImporter_NodeElement* ne; + + // Read attributes for node . + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECK_RET("id", id, mReader->getAttributeValue); + MACRO_ATTRREAD_LOOPEND; + + // create and if needed - define new geometry object. + ne = new CAMFImporter_NodeElement_Object(mNodeElement_Cur); + + CAMFImporter_NodeElement_Object& als = *((CAMFImporter_NodeElement_Object*)ne);// alias for convenience + + if(!id.empty()) als.ID = id; + // Check for child nodes + if(!mReader->isEmptyElement()) + { + bool col_read = false; + + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("object"); + if(XML_CheckNode_NameEqual("color")) + { + // Check if color already defined for object. + if(col_read) Throw_MoreThanOnceDefined("color", "Only one color can be defined for ."); + // read data and set flag about it + ParseNode_Color(); + col_read = true; + + continue; + } + + if(XML_CheckNode_NameEqual("mesh")) { ParseNode_Mesh(); continue; } + if(XML_CheckNode_NameEqual("metadata")) { ParseNode_Metadata(); continue; } + MACRO_NODECHECK_LOOPEND("object"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element + }// if(!mReader->isEmptyElement()) else + + mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph. +} + +// +// +// Specify additional information about an entity. +// Multi elements - Yes. +// Parent element - , , , , . +// +// Reserved types are: +// "Name" - The alphanumeric label of the entity, to be used by the interpreter if interacting with the user. +// "Description" - A description of the content of the entity +// "URL" - A link to an external resource relating to the entity +// "Author" - Specifies the name(s) of the author(s) of the entity +// "Company" - Specifying the company generating the entity +// "CAD" - specifies the name of the originating CAD software and version +// "Revision" - specifies the revision of the entity +// "Tolerance" - specifies the desired manufacturing tolerance of the entity in entity's unit system +// "Volume" - specifies the total volume of the entity, in the entity's unit system, to be used for verification (object and volume only) +void AMFImporter::ParseNode_Metadata() +{ +std::string type, value; +CAMFImporter_NodeElement* ne; + + // read attribute + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECK_RET("type", type, mReader->getAttributeValue); + MACRO_ATTRREAD_LOOPEND; + // and value of node. + value = mReader->getNodeData(); + // Create node element and assign read data. + ne = new CAMFImporter_NodeElement_Metadata(mNodeElement_Cur); + ((CAMFImporter_NodeElement_Metadata*)ne)->Type = type; + ((CAMFImporter_NodeElement_Metadata*)ne)->Value = value; + mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element + mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph. +} + +/*********************************************************************************************************************************************/ +/******************************************************** Functions: BaseImporter set ********************************************************/ +/*********************************************************************************************************************************************/ + +bool AMFImporter::CanRead(const std::string& pFile, IOSystem* pIOHandler, bool pCheckSig) const +{ +const std::string extension = GetExtension(pFile); + + if(extension == "amf") return true; + + if(!extension.length() || pCheckSig) + { + const char* tokens[] = { "& pExtensionList) +{ + pExtensionList.insert("amf"); +} + +const aiImporterDesc* AMFImporter::GetInfo () const +{ + return &Description; +} + +void AMFImporter::InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) +{ + Clear();// delete old graph. + ParseFile(pFile, pIOHandler); + Postprocess_BuildScene(pScene); + // scene graph is ready, exit. +} + +}// namespace Assimp + +#endif // !ASSIMP_BUILD_NO_AMF_IMPORTER diff --git a/code/AMFImporter.hpp b/code/AMFImporter.hpp new file mode 100644 index 000000000..64f9e6230 --- /dev/null +++ b/code/AMFImporter.hpp @@ -0,0 +1,563 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +/// \file AMFImporter.hpp +/// \brief AMF-format files importer for Assimp. +/// \date 2016 +/// \author smal.root@gmail.com +// Thanks to acorn89 for support. + +#pragma once +#ifndef INCLUDED_AI_AMF_IMPORTER_H +#define INCLUDED_AI_AMF_IMPORTER_H + +#include "AMFImporter_Node.hpp" + +// Header files, Assimp. +#include "assimp/DefaultLogger.hpp" +#include "assimp/importerdesc.h" +#include "assimp/ProgressHandler.hpp" +#include "assimp/types.h" +#include "BaseImporter.h" +#include "irrXMLWrapper.h" + +// Header files, stdlib. +#include + +namespace Assimp +{ +/// \class AMFImporter +/// Class that holding scene graph which include: geometry, metadata, materials etc. +/// +/// Implementing features. +/// +/// Limitations. +/// +/// 1. When for texture mapping used set of source textures (r, g, b, a) not only one then attribute "tiled" for all set will be true if it true in any of +/// source textures. +/// Example. Triangle use for texture mapping three textures. Two of them has "tiled" set to false and one - set to true. In scene all three textures +/// will be tiled. +/// +/// Unsupported features: +/// 1. Node , formulas in and . For implementing this feature can be used expression parser "muParser" like in project +/// "amf_tools". +/// 2. Attribute "profile" in node . +/// 3. Curved geometry: , and children nodes of them. +/// 4. Attributes: "unit" and "version" in read but do nothing. +/// 5. stored only for root node . +/// 6. Color averaging of vertices for which 's set different colors. +/// +/// Supported nodes: +/// General: +/// ; ; and children , , , , , ; ; +/// +/// Geometry: +/// ; ; ; ; and children , , ; ; and children , , ; +/// +/// Material: +/// and children , , , ; ; ; +/// two variants of texture coordinates: +/// new - and children , , , , , +/// old - and children , , , , , +/// +class AMFImporter : public BaseImporter +{ + /***********************************************/ + /******************** Types ********************/ + /***********************************************/ + +private: + + struct SPP_Material;// forward declaration + + /// \struct SPP_Composite + /// Data type for postprocessing step. More suitable container for part of material's composition. + struct SPP_Composite + { + SPP_Material* Material;///< Pointer to material - part of composition. + std::string Formula;///< Formula for calculating ratio of \ref Material. + }; + + /// \struct SPP_Material + /// Data type for postprocessing step. More suitable container for material. + struct SPP_Material + { + std::string ID;///< Material ID. + std::list Metadata;///< Metadata of material. + CAMFImporter_NodeElement_Color* Color;///< Color of material. + std::list Composition;///< List of child materials if current material is composition of few another. + + /// \fn aiColor4D GetColor(const float pX, const float pY, const float pZ) const + /// Return color calculated for specified coordinate. + /// \param [in] pX - "x" coordinate. + /// \param [in] pY - "y" coordinate. + /// \param [in] pZ - "z" coordinate. + /// \return calculated color. + aiColor4D GetColor(const float pX, const float pY, const float pZ) const; + }; + + /// \struct SPP_Texture + /// Data type for postprocessing step. More suitable container for texture. + struct SPP_Texture + { + std::string ID; + size_t Width, Height, Depth; + bool Tiled; + decltype(aiTexture::achFormatHint) FormatHint; + uint8_t* Data; + }; + + /// \struct SComplexFace + /// Data type for postprocessing step. Contain face data. + struct SComplexFace + { + aiFace Face;///< Face vertices. + const CAMFImporter_NodeElement_Color* Color;///< Face color. Equal to nullptr if color is not set for the face. + const CAMFImporter_NodeElement_TexMap* TexMap;///< Face texture mapping data. Equal to nullptr if texture mapping is not set for the face. + }; + + + + /***********************************************/ + /****************** Constants ******************/ + /***********************************************/ + +private: + + static const aiImporterDesc Description; + + /***********************************************/ + /****************** Variables ******************/ + /***********************************************/ + +private: + + CAMFImporter_NodeElement* mNodeElement_Cur;///< Current element. + std::list mNodeElement_List;///< All elements of scene graph. + irr::io::IrrXMLReader* mReader;///< Pointer to XML-reader object + std::string mUnit; + std::list mMaterial_Converted;///< List of converted materials for postprocessing step. + std::list mTexture_Converted;///< List of converted textures for postprocessing step. + + /***********************************************/ + /****************** Functions ******************/ + /***********************************************/ + +private: + + /// \fn AMFImporter(const AMFImporter& pScene) + /// Disabled copy constructor. + AMFImporter(const AMFImporter& pScene); + + /// \fn AMFImporter& operator=(const AMFImporter& pScene) + /// Disabled assign operator. + AMFImporter& operator=(const AMFImporter& pScene); + + /// \fn void Clear() + /// Clear all temporary data. + void Clear(); + + /***********************************************/ + /************* Functions: find set *************/ + /***********************************************/ + + /// \fn bool Find_NodeElement(const std::string& pID, const CAMFImporter_NodeElement::EType pType, aiNode** pNode) const + /// Find specified node element in node elements list ( \ref mNodeElement_List). + /// \param [in] pID - ID(name) of requested node element. + /// \param [in] pType - type of node element. + /// \param [out] pNode - pointer to pointer to item found. + /// \return true - if the node element is found, else - false. + bool Find_NodeElement(const std::string& pID, const CAMFImporter_NodeElement::EType pType, CAMFImporter_NodeElement** pNodeElement) const; + + /// \fn bool Find_ConvertedNode(const std::string& pID, std::list& pNodeList, aiNode** pNode) const + /// Find requested aiNode in node list. + /// \param [in] pID - ID(name) of requested node. + /// \param [in] pNodeList - list of nodes where to find the node. + /// \param [out] pNode - pointer to pointer to item found. + /// \return true - if the node is found, else - false. + bool Find_ConvertedNode(const std::string& pID, std::list& pNodeList, aiNode** pNode) const; + + /// \fn bool Find_ConvertedMaterial(const std::string& pID, const SPP_Material** pConvertedMaterial) const + /// Find material in list for converted materials. Use at postprocessing step. + /// \param [in] pID - material ID. + /// \param [out] pConvertedMaterial - pointer to found converted material (\ref SPP_Material). + /// \return true - if the material is found, else - false. + bool Find_ConvertedMaterial(const std::string& pID, const SPP_Material** pConvertedMaterial) const; + + /// \fn bool Find_ConvertedTexture(const std::string& pID_R, const std::string& pID_G, const std::string& pID_B, const std::string& pID_A, uint32_t* pConvertedTextureIndex = nullptr) const + /// Find texture in list of converted textures. Use at postprocessing step, + /// \param [in] pID_R - ID of source "red" texture. + /// \param [in] pID_G - ID of source "green" texture. + /// \param [in] pID_B - ID of source "blue" texture. + /// \param [in] pID_A - ID of source "alpha" texture. Use empty string to find RGB-texture. + /// \param [out] pConvertedTextureIndex - pointer where index in list of found texture will be written. If equivalent to nullptr then nothing will be + /// written. + /// \return true - if the texture is found, else - false. + bool Find_ConvertedTexture(const std::string& pID_R, const std::string& pID_G, const std::string& pID_B, const std::string& pID_A, + uint32_t* pConvertedTextureIndex = nullptr) const; + + /***********************************************/ + /********* Functions: postprocess set **********/ + /***********************************************/ + + /// \fn void PostprocessHelper_CreateMeshDataArray(const CAMFImporter_NodeElement_Mesh& pNodeElement, std::vector& pVertexCoordinateArray, std::vector& pVertexColorArray) const + /// Get data stored in and place it to arrays. + /// \param [in] pNodeElement - reference to node element which kept data. + /// \param [in] pVertexCoordinateArray - reference to vertices coordinates kept in . + /// \param [in] pVertexColorArray - reference to vertices colors for all & pVertexCoordinateArray, + std::vector& pVertexColorArray) const; + + /// \fn size_t PostprocessHelper_GetTextureID_Or_Create(const std::string& pID_R, const std::string& pID_G, const std::string& pID_B, const std::string& pID_A) + /// Return converted texture ID which related to specified source textures ID's. If converted texture does not exist then it will be created and ID on new + /// converted texture will be returned. Convertion: set of textures from \ref CAMFImporter_NodeElement_Texture to one \ref SPP_Texture and place it + /// to converted textures list. + /// Any of source ID's can be absent(empty string) or even one ID only specified. But at least one ID must be specified. + /// \param [in] pID_R - ID of source "red" texture. + /// \param [in] pID_G - ID of source "green" texture. + /// \param [in] pID_B - ID of source "blue" texture. + /// \param [in] pID_A - ID of source "alpha" texture. + /// \return index of the texture in array of the converted textures. + size_t PostprocessHelper_GetTextureID_Or_Create(const std::string& pID_R, const std::string& pID_G, const std::string& pID_B, const std::string& pID_A); + + /// \fn void PostprocessHelper_SplitFacesByTextureID(std::list& pInputList, std::list > pOutputList_Separated) + /// Separate input list by texture IDs. This step is needed because aiMesh can contain mesh which is use only one texture (or set: diffuse, bump etc). + /// \param [in] pInputList - input list with faces. Some of them can contain color or texture mapping, or both of them, or nothing. Will be cleared after + /// processing. + /// \param [out] pOutputList_Separated - output list of the faces lists. Separated faces list by used texture IDs. Will be cleared before processing. + void PostprocessHelper_SplitFacesByTextureID(std::list& pInputList, std::list >& pOutputList_Separated); + + /// \fn void Postprocess_AddMetadata(const std::list& pMetadataList, aiNode& pSceneNode) const + /// Check if child elements of node element is metadata and add it to scene node. + /// \param [in] pMetadataList - reference to list with collected metadata. + /// \param [out] pSceneNode - scene node in which metadata will be added. + void Postprocess_AddMetadata(const std::list& pMetadataList, aiNode& pSceneNode) const; + + /// \fn void Postprocess_BuildNodeAndObject(const CAMFImporter_NodeElement_Object& pNodeElement, std::list& pMeshList, aiNode** pSceneNode) + /// To create aiMesh and aiNode for it from . + /// \param [in] pNodeElement - reference to node element which kept data. + /// \param [out] pMeshList - reference to a list with all aiMesh of the scene. + /// \param [out] pSceneNode - pointer to place where new aiNode will be created. + void Postprocess_BuildNodeAndObject(const CAMFImporter_NodeElement_Object& pNodeElement, std::list& pMeshList, aiNode** pSceneNode); + + /// \fn void Postprocess_BuildMeshSet(const CAMFImporter_NodeElement_Mesh& pNodeElement, const std::vector& pVertexCoordinateArray, const std::vector& pVertexColorArray, const CAMFImporter_NodeElement_Color* pObjectColor, std::list& pMeshList, aiNode& pSceneNode) + /// Create mesh for every in . + /// \param [in] pNodeElement - reference to node element which kept data. + /// \param [in] pVertexCoordinateArray - reference to vertices coordinates for all 's. + /// \param [in] pVertexColorArray - reference to vertices colors for all 's. If color for vertex is not set then corresponding member of array + /// contain nullptr. + /// \param [in] pObjectColor - pointer to colors for . If color is not set then argument contain nullptr. + /// \param [in] pMaterialList - reference to a list with defined materials. + /// \param [out] pMeshList - reference to a list with all aiMesh of the scene. + /// \param [out] pSceneNode - reference to aiNode which will own new aiMesh's. + void Postprocess_BuildMeshSet(const CAMFImporter_NodeElement_Mesh& pNodeElement, const std::vector& pVertexCoordinateArray, + const std::vector& pVertexColorArray, const CAMFImporter_NodeElement_Color* pObjectColor, + std::list& pMeshList, aiNode& pSceneNode); + + /// \fn void Postprocess_BuildMaterial(const CAMFImporter_NodeElement_Material& pMaterial) + /// Convert material from \ref CAMFImporter_NodeElement_Material to \ref SPP_Material. + /// \param [in] pMaterial - source CAMFImporter_NodeElement_Material. + void Postprocess_BuildMaterial(const CAMFImporter_NodeElement_Material& pMaterial); + + /// \fn void Postprocess_BuildConstellation(CAMFImporter_NodeElement_Constellation& pConstellation, std::list& pNodeList) const + /// Create and add to aiNode's list new part of scene graph defined by . + /// \param [in] pConstellation - reference to node. + /// \param [out] pNodeList - reference to aiNode's list. + void Postprocess_BuildConstellation(CAMFImporter_NodeElement_Constellation& pConstellation, std::list& pNodeList) const; + + /// \fn void Postprocess_BuildScene() + /// Build Assimp scene graph in aiScene from collected data. + /// \param [out] pScene - pointer to aiScene where tree will be built. + void Postprocess_BuildScene(aiScene* pScene); + + /***********************************************/ + /************* Functions: throw set ************/ + /***********************************************/ + + /// \fn void Throw_CloseNotFound(const std::string& pNode) + /// Call that function when close tag of node not found and exception must be raised. + /// E.g.: + /// + /// + /// + /// \throw DeadlyImportError. + /// \param [in] pNode - node name in which exception happened. + void Throw_CloseNotFound(const std::string& pNode); + + /// \fn void Throw_IncorrectAttr(const std::string& pAttrName) + /// Call that function when attribute name is incorrect and exception must be raised. + /// \param [in] pAttrName - attribute name. + /// \throw DeadlyImportError. + void Throw_IncorrectAttr(const std::string& pAttrName); + + /// \fn void Throw_IncorrectAttrValue(const std::string& pAttrName) + /// Call that function when attribute value is incorrect and exception must be raised. + /// \param [in] pAttrName - attribute name. + /// \throw DeadlyImportError. + void Throw_IncorrectAttrValue(const std::string& pAttrName); + + /// \fn void Throw_MoreThanOnceDefined(const std::string& pNode, const std::string& pDescription) + /// Call that function when some type of nodes are defined twice or more when must be used only once and exception must be raised. + /// E.g.: + /// + /// ... + /// ... + /// + /// \throw DeadlyImportError. + /// \param [in] pNodeType - type of node which defined one more time. + /// \param [in] pDescription - message about error. E.g. what the node defined while exception raised. + void Throw_MoreThanOnceDefined(const std::string& pNodeType, const std::string& pDescription); + + /// \fn void Throw_ID_NotFound(const std::string& pID) const + /// Call that function when referenced element ID are not found in graph and exception must be raised. + /// \param [in] pID - ID of of element which not found. + /// \throw DeadlyImportError. + void Throw_ID_NotFound(const std::string& pID) const; + + /***********************************************/ + /************** Functions: LOG set *************/ + /***********************************************/ + + /// \fn void LogInfo(const std::string& pMessage) + /// Short variant for calling \ref DefaultLogger::get()->info() + void LogInfo(const std::string& pMessage) { DefaultLogger::get()->info(pMessage); } + + /// \fn void LogWarning(const std::string& pMessage) + /// Short variant for calling \ref DefaultLogger::get()->warn() + void LogWarning(const std::string& pMessage) { DefaultLogger::get()->warn(pMessage); } + + /// \fn void LogError(const std::string& pMessage) + /// Short variant for calling \ref DefaultLogger::get()->error() + void LogError(const std::string& pMessage) { DefaultLogger::get()->error(pMessage); } + + /***********************************************/ + /************** Functions: XML set *************/ + /***********************************************/ + + /// \fn void XML_CheckNode_MustHaveChildren() + /// Check if current node have children: .... If not then exception will throwed. + void XML_CheckNode_MustHaveChildren(); + + /// \fn bool XML_CheckNode_NameEqual(const std::string& pNodeName) + /// Chek if current node name is equal to pNodeName. + /// \param [in] pNodeName - name for checking. + /// return true if current node name is equal to pNodeName, else - false. + bool XML_CheckNode_NameEqual(const std::string& pNodeName) { return mReader->getNodeName() == pNodeName; } + + /// \fn void XML_CheckNode_SkipUnsupported(const std::string& pParentNodeName) + /// Skip unsupported node and report about that. Depend on node name can be skipped begin tag of node all whole node. + /// \param [in] pParentNodeName - parent node name. Used for reporting. + void XML_CheckNode_SkipUnsupported(const std::string& pParentNodeName); + + /// \fn bool XML_SearchNode(const std::string& pNodeName) + /// Search for specified node in file. XML file read pointer(mReader) will point to found node or file end after search is end. + /// \param [in] pNodeName - requested node name. + /// return true - if node is found, else - false. + bool XML_SearchNode(const std::string& pNodeName); + + /// \fn bool XML_ReadNode_GetAttrVal_AsBool(const int pAttrIdx) + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \return read data. + bool XML_ReadNode_GetAttrVal_AsBool(const int pAttrIdx); + + /// \fn float XML_ReadNode_GetAttrVal_AsFloat(const int pAttrIdx) + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \return read data. + float XML_ReadNode_GetAttrVal_AsFloat(const int pAttrIdx); + + /// \fn uint32_t XML_ReadNode_GetAttrVal_AsU32(const int pAttrIdx) + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \return read data. + uint32_t XML_ReadNode_GetAttrVal_AsU32(const int pAttrIdx); + + /// \fn float XML_ReadNode_GetVal_AsFloat() + /// Read node value. + /// \return read data. + float XML_ReadNode_GetVal_AsFloat(); + + /// \fn uint32_t XML_ReadNode_GetVal_AsU32() + /// Read node value. + /// \return read data. + uint32_t XML_ReadNode_GetVal_AsU32(); + + /// \fn void XML_ReadNode_GetVal_AsString(std::string& pValue) + /// Read node value. + /// \return read data. + void XML_ReadNode_GetVal_AsString(std::string& pValue); + + /***********************************************/ + /******** Functions: parse set private *********/ + /***********************************************/ + + /// \fn void ParseHelper_Node_Enter(CAMFImporter_NodeElement* pNode) + /// Make pNode as current and enter deeper for parsing child nodes. At end \ref ParseHelper_Node_Exit must be called. + /// \param [in] pNode - new current node. + void ParseHelper_Node_Enter(CAMFImporter_NodeElement* pNode); + + /// \fn void ParseHelper_Group_End() + /// This function must be called when exiting from grouping node. \ref ParseHelper_Group_Begin. + void ParseHelper_Node_Exit(); + + /// \fn void ParseHelper_FixTruncatedFloatString(const char* pInStr, std::string& pOutString) + /// Attribute values of floating point types can take form ".x"(without leading zero). irrXMLReader can not read this form of values and it + /// must be converted to right form - "0.xxx". + /// \param [in] pInStr - pointer to input string which can contain incorrect form of values. + /// \param [out[ pOutString - output string with right form of values. + void ParseHelper_FixTruncatedFloatString(const char* pInStr, std::string& pOutString); + + /// \fn void ParseHelper_Decode_Base64(const std::string& pInputBase64, std::vector& pOutputData) const + /// Decode Base64-encoded data. + /// \param [in] pInputBase64 - reference to input Base64-encoded string. + /// \param [out] pOutputData - reference to output array for decoded data. + void ParseHelper_Decode_Base64(const std::string& pInputBase64, std::vector& pOutputData) const; + + /// \fn void ParseNode_Root() + /// Parse node of the file. + void ParseNode_Root(); + + /******** Functions: top nodes *********/ + + /// \fn void ParseNode_Constellation() + /// Parse node of the file. + void ParseNode_Constellation(); + + /// \fn void ParseNode_Constellation() + /// Parse node of the file. + void ParseNode_Instance(); + + /// \fn void ParseNode_Material() + /// Parse node of the file. + void ParseNode_Material(); + + /// \fn void ParseNode_Metadata() + /// Parse node. + void ParseNode_Metadata(); + + /// \fn void ParseNode_Object() + /// Parse node of the file. + void ParseNode_Object(); + + /// \fn void ParseNode_Texture() + /// Parse node of the file. + void ParseNode_Texture(); + + /******** Functions: geometry nodes *********/ + + /// \fn void ParseNode_Coordinates() + /// Parse node of the file. + void ParseNode_Coordinates(); + + /// \fn void ParseNode_Edge() + /// Parse node of the file. + void ParseNode_Edge(); + + /// \fn void ParseNode_Mesh() + /// Parse node of the file. + void ParseNode_Mesh(); + + /// \fn void ParseNode_Triangle() + /// Parse node of the file. + void ParseNode_Triangle(); + + /// \fn void ParseNode_Vertex() + /// Parse node of the file. + void ParseNode_Vertex(); + + /// \fn void ParseNode_Vertices() + /// Parse node of the file. + void ParseNode_Vertices(); + + /// \fn void ParseNode_Volume() + /// Parse node of the file. + void ParseNode_Volume(); + + /******** Functions: material nodes *********/ + + /// \fn void ParseNode_Color() + /// Parse node of the file. + void ParseNode_Color(); + + /// \fn void ParseNode_TexMap(const bool pUseOldName = false) + /// Parse of node of the file. + /// \param [in] pUseOldName - if true then use old name of node(and children) - , instead of new name - . + void ParseNode_TexMap(const bool pUseOldName = false); + +public: + + /// \fn AMFImporter() + /// Default constructor. + AMFImporter() + : mNodeElement_Cur(nullptr), mReader(nullptr) + {} + + /// \fn ~AMFImporter() + /// Default destructor. + ~AMFImporter(); + + /***********************************************/ + /******** Functions: parse set, public *********/ + /***********************************************/ + + /// \fn void ParseFile(const std::string& pFile, IOSystem* pIOHandler) + /// Parse AMF file and fill scene graph. The function has no return value. Result can be found by analyzing the generated graph. + /// Also exception can be throwed if trouble will found. + /// \param [in] pFile - name of file to be parsed. + /// \param [in] pIOHandler - pointer to IO helper object. + void ParseFile(const std::string& pFile, IOSystem* pIOHandler); + + /***********************************************/ + /********* Functions: BaseImporter set *********/ + /***********************************************/ + + bool CanRead(const std::string& pFile, IOSystem* pIOHandler, bool pCheckSig) const; + void GetExtensionList(std::set& pExtensionList); + void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler); + const aiImporterDesc* GetInfo ()const; + +};// class AMFImporter + +}// namespace Assimp + +#endif // INCLUDED_AI_AMF_IMPORTER_H diff --git a/code/AMFImporter_Geometry.cpp b/code/AMFImporter_Geometry.cpp new file mode 100644 index 000000000..493d06bff --- /dev/null +++ b/code/AMFImporter_Geometry.cpp @@ -0,0 +1,355 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +/// \file AMFImporter_Geometry.cpp +/// \brief Parsing data from geometry nodes. +/// \date 2016 +/// \author smal.root@gmail.com + +#ifndef ASSIMP_BUILD_NO_AMF_IMPORTER + +#include "AMFImporter.hpp" +#include "AMFImporter_Macro.hpp" + +namespace Assimp +{ + +// +// +// A 3D mesh hull. +// Multi elements - Yes. +// Parent element - . +void AMFImporter::ParseNode_Mesh() +{ +CAMFImporter_NodeElement* ne; + + // create new mesh object. + ne = new CAMFImporter_NodeElement_Mesh(mNodeElement_Cur); + // Check for child nodes + if(!mReader->isEmptyElement()) + { + bool vert_read = false; + + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("mesh"); + if(XML_CheckNode_NameEqual("vertices")) + { + // Check if data already defined. + if(vert_read) Throw_MoreThanOnceDefined("vertices", "Only one vertices set can be defined for ."); + // read data and set flag about it + ParseNode_Vertices(); + vert_read = true; + + continue; + } + + if(XML_CheckNode_NameEqual("volume")) { ParseNode_Volume(); continue; } + MACRO_NODECHECK_LOOPEND("mesh"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element + }// if(!mReader->isEmptyElement()) else + + mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph. +} + +// +// +// The list of vertices to be used in defining triangles. +// Multi elements - No. +// Parent element - . +void AMFImporter::ParseNode_Vertices() +{ +CAMFImporter_NodeElement* ne; + + // create new mesh object. + ne = new CAMFImporter_NodeElement_Vertices(mNodeElement_Cur); + // Check for child nodes + if(!mReader->isEmptyElement()) + { + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("vertices"); + if(XML_CheckNode_NameEqual("vertex")) { ParseNode_Vertex(); continue; } + MACRO_NODECHECK_LOOPEND("vertices"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element + }// if(!mReader->isEmptyElement()) else + + mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph. +} + +// +// +// A vertex to be referenced in triangles. +// Multi elements - Yes. +// Parent element - . +void AMFImporter::ParseNode_Vertex() +{ +CAMFImporter_NodeElement* ne; + + // create new mesh object. + ne = new CAMFImporter_NodeElement_Vertex(mNodeElement_Cur); + // Check for child nodes + if(!mReader->isEmptyElement()) + { + bool col_read = false; + bool coord_read = false; + + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("vertex"); + if(XML_CheckNode_NameEqual("color")) + { + // Check if data already defined. + if(col_read) Throw_MoreThanOnceDefined("color", "Only one color can be defined for ."); + // read data and set flag about it + ParseNode_Color(); + col_read = true; + + continue; + } + + if(XML_CheckNode_NameEqual("coordinates")) + { + // Check if data already defined. + if(coord_read) Throw_MoreThanOnceDefined("coordinates", "Only one coordinates set can be defined for ."); + // read data and set flag about it + ParseNode_Coordinates(); + coord_read = true; + + continue; + } + + if(XML_CheckNode_NameEqual("metadata")) { ParseNode_Metadata(); continue; } + MACRO_NODECHECK_LOOPEND("vertex"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element + }// if(!mReader->isEmptyElement()) else + + mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph. +} + +// +// +// Specifies the 3D location of this vertex. +// Multi elements - No. +// Parent element - . +// +// Children elements: +// , , +// Multi elements - No. +// X, Y, or Z coordinate, respectively, of a vertex position in space. +void AMFImporter::ParseNode_Coordinates() +{ +CAMFImporter_NodeElement* ne; + + // create new color object. + ne = new CAMFImporter_NodeElement_Coordinates(mNodeElement_Cur); + + CAMFImporter_NodeElement_Coordinates& als = *((CAMFImporter_NodeElement_Coordinates*)ne);// alias for convenience + + // Check for child nodes + if(!mReader->isEmptyElement()) + { + bool read_flag[3] = { false, false, false }; + + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("coordinates"); + MACRO_NODECHECK_READCOMP_F("x", read_flag[0], als.Coordinate.x); + MACRO_NODECHECK_READCOMP_F("y", read_flag[1], als.Coordinate.y); + MACRO_NODECHECK_READCOMP_F("z", read_flag[2], als.Coordinate.z); + MACRO_NODECHECK_LOOPEND("coordinates"); + ParseHelper_Node_Exit(); + // check that all components was defined + if((read_flag[0] && read_flag[1] && read_flag[2]) == 0) throw DeadlyImportError("Not all coordinate's components are defined."); + + }// if(!mReader->isEmptyElement()) + else + { + mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element + }// if(!mReader->isEmptyElement()) else + + mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph. +} + +// +// +// Defines a volume from the established vertex list. +// Multi elements - Yes. +// Parent element - . +void AMFImporter::ParseNode_Volume() +{ +std::string materialid; +std::string type; +CAMFImporter_NodeElement* ne; + + // Read attributes for node . + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECK_RET("materialid", materialid, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_RET("type", type, mReader->getAttributeValue); + MACRO_ATTRREAD_LOOPEND; + + // create new object. + ne = new CAMFImporter_NodeElement_Volume(mNodeElement_Cur); + // and assign read data + ((CAMFImporter_NodeElement_Volume*)ne)->MaterialID = materialid; + ((CAMFImporter_NodeElement_Volume*)ne)->Type = type; + // Check for child nodes + if(!mReader->isEmptyElement()) + { + bool col_read = false; + + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("volume"); + if(XML_CheckNode_NameEqual("color")) + { + // Check if data already defined. + if(col_read) Throw_MoreThanOnceDefined("color", "Only one color can be defined for ."); + // read data and set flag about it + ParseNode_Color(); + col_read = true; + + continue; + } + + if(XML_CheckNode_NameEqual("triangle")) { ParseNode_Triangle(); continue; } + if(XML_CheckNode_NameEqual("metadata")) { ParseNode_Metadata(); continue; } + MACRO_NODECHECK_LOOPEND("volume"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element + }// if(!mReader->isEmptyElement()) else + + mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph. +} + +// +// +// Defines a 3D triangle from three vertices, according to the right-hand rule (counter-clockwise when looking from the outside). +// Multi elements - Yes. +// Parent element - . +// +// Children elements: +// , , +// Multi elements - No. +// Index of the desired vertices in a triangle or edge. +void AMFImporter::ParseNode_Triangle() +{ +CAMFImporter_NodeElement* ne; + + // create new color object. + ne = new CAMFImporter_NodeElement_Triangle(mNodeElement_Cur); + + CAMFImporter_NodeElement_Triangle& als = *((CAMFImporter_NodeElement_Triangle*)ne);// alias for convenience + + // Check for child nodes + if(!mReader->isEmptyElement()) + { + bool col_read = false, tex_read = false; + bool read_flag[3] = { false, false, false }; + + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("triangle"); + if(XML_CheckNode_NameEqual("color")) + { + // Check if data already defined. + if(col_read) Throw_MoreThanOnceDefined("color", "Only one color can be defined for ."); + // read data and set flag about it + ParseNode_Color(); + col_read = true; + + continue; + } + + if(XML_CheckNode_NameEqual("texmap"))// new name of node: "texmap". + { + // Check if data already defined. + if(tex_read) Throw_MoreThanOnceDefined("texmap", "Only one texture coordinate can be defined for ."); + // read data and set flag about it + ParseNode_TexMap(); + tex_read = true; + + continue; + } + else if(XML_CheckNode_NameEqual("map"))// old name of node: "map". + { + // Check if data already defined. + if(tex_read) Throw_MoreThanOnceDefined("map", "Only one texture coordinate can be defined for ."); + // read data and set flag about it + ParseNode_TexMap(true); + tex_read = true; + + continue; + } + + MACRO_NODECHECK_READCOMP_U32("v1", read_flag[0], als.V[0]); + MACRO_NODECHECK_READCOMP_U32("v2", read_flag[1], als.V[1]); + MACRO_NODECHECK_READCOMP_U32("v3", read_flag[2], als.V[2]); + MACRO_NODECHECK_LOOPEND("triangle"); + ParseHelper_Node_Exit(); + // check that all components was defined + if((read_flag[0] && read_flag[1] && read_flag[2]) == 0) throw DeadlyImportError("Not all vertices of the triangle are defined."); + + }// if(!mReader->isEmptyElement()) + else + { + mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element + }// if(!mReader->isEmptyElement()) else + + mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph. +} + +}// namespace Assimp + +#endif // !ASSIMP_BUILD_NO_AMF_IMPORTER diff --git a/code/AMFImporter_Macro.hpp b/code/AMFImporter_Macro.hpp new file mode 100644 index 000000000..973e17490 --- /dev/null +++ b/code/AMFImporter_Macro.hpp @@ -0,0 +1,164 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +/// \file AMFImporter_Macro.hpp +/// \brief Useful macrodefines. +/// \date 2016 +/// \author smal.root@gmail.com + +#pragma once +#ifndef AMFIMPORTER_MACRO_HPP_INCLUDED +#define AMFIMPORTER_MACRO_HPP_INCLUDED + +/// \def MACRO_ATTRREAD_LOOPBEG +/// Begin of loop that read attributes values. +#define MACRO_ATTRREAD_LOOPBEG \ + for(int idx = 0, idx_end = mReader->getAttributeCount(); idx < idx_end; idx++) \ + { \ + std::string an(mReader->getAttributeName(idx)); + +/// \def MACRO_ATTRREAD_LOOPEND +/// End of loop that read attributes values. +#define MACRO_ATTRREAD_LOOPEND \ + Throw_IncorrectAttr(an); \ + } + +/// \def MACRO_ATTRREAD_LOOPEND_WSKIP +/// End of loop that read attributes values. Difference from \ref MACRO_ATTRREAD_LOOPEND in that: current macro skip unknown attributes, but +/// \ref MACRO_ATTRREAD_LOOPEND throw an exception. +#define MACRO_ATTRREAD_LOOPEND_WSKIP \ + continue; \ + } + +/// \def MACRO_ATTRREAD_CHECK_REF +/// Check curent attribute name and if it equal to requested then read value. Result write to output variable by reference. If result was read then +/// "continue" will called. +/// \param [in] pAttrName - attribute name. +/// \param [out] pVarName - output variable name. +/// \param [in] pFunction - function which read attribute value and write it to pVarName. +#define MACRO_ATTRREAD_CHECK_REF(pAttrName, pVarName, pFunction) \ + if(an == pAttrName) \ + { \ + pFunction(idx, pVarName); \ + continue; \ + } + +/// \def MACRO_ATTRREAD_CHECK_RET +/// Check curent attribute name and if it equal to requested then read value. Result write to output variable using return value of \ref pFunction. +/// If result was read then "continue" will called. +/// \param [in] pAttrName - attribute name. +/// \param [out] pVarName - output variable name. +/// \param [in] pFunction - function which read attribute value and write it to pVarName. +#define MACRO_ATTRREAD_CHECK_RET(pAttrName, pVarName, pFunction) \ + if(an == pAttrName) \ + { \ + pVarName = pFunction(idx); \ + continue; \ + } + +/// \def MACRO_NODECHECK_LOOPBEGIN(pNodeName) +/// Begin of loop of parsing child nodes. Do not add ';' at end. +/// \param [in] pNodeName - current node name. +#define MACRO_NODECHECK_LOOPBEGIN(pNodeName) \ + do { \ + bool close_found = false; \ + \ + while(mReader->read()) \ + { \ + if(mReader->getNodeType() == irr::io::EXN_ELEMENT) \ + { + +/// \def MACRO_NODECHECK_LOOPEND(pNodeName) +/// End of loop of parsing child nodes. +/// \param [in] pNodeName - current node name. +#define MACRO_NODECHECK_LOOPEND(pNodeName) \ + XML_CheckNode_SkipUnsupported(pNodeName); \ + }/* if(mReader->getNodeType() == irr::io::EXN_ELEMENT) */ \ + else if(mReader->getNodeType() == irr::io::EXN_ELEMENT_END) \ + { \ + if(XML_CheckNode_NameEqual(pNodeName)) \ + { \ + close_found = true; \ + \ + break; \ + } \ + }/* else if(mReader->getNodeType() == irr::io::EXN_ELEMENT_END) */ \ + }/* while(mReader->read()) */ \ + \ + if(!close_found) Throw_CloseNotFound(pNodeName); \ + \ + } while(false) + +/// \def MACRO_NODECHECK_READCOMP_F +/// Check curent node name and if it equal to requested then read value. Result write to output variable of type "float". +/// If result was read then "continue" will called. Also check if node data already read then raise exception. +/// \param [in] pNodeName - node name. +/// \param [in, out] pReadFlag - read flag. +/// \param [out] pVarName - output variable name. +#define MACRO_NODECHECK_READCOMP_F(pNodeName, pReadFlag, pVarName) \ + if(XML_CheckNode_NameEqual(pNodeName)) \ + { \ + /* Check if field already read before. */ \ + if(pReadFlag) Throw_MoreThanOnceDefined(pNodeName, "Only one component can be defined."); \ + /* Read color component and assign it to object. */ \ + pVarName = XML_ReadNode_GetVal_AsFloat(); \ + pReadFlag = true; \ + continue; \ + } + +/// \def MACRO_NODECHECK_READCOMP_U32 +/// Check curent node name and if it equal to requested then read value. Result write to output variable of type "uint32_t". +/// If result was read then "continue" will called. Also check if node data already read then raise exception. +/// \param [in] pNodeName - node name. +/// \param [in, out] pReadFlag - read flag. +/// \param [out] pVarName - output variable name. +#define MACRO_NODECHECK_READCOMP_U32(pNodeName, pReadFlag, pVarName) \ + if(XML_CheckNode_NameEqual(pNodeName)) \ + { \ + /* Check if field already read before. */ \ + if(pReadFlag) Throw_MoreThanOnceDefined(pNodeName, "Only one component can be defined."); \ + /* Read color component and assign it to object. */ \ + pVarName = XML_ReadNode_GetVal_AsU32(); \ + pReadFlag = true; \ + continue; \ + } + +#endif // AMFIMPORTER_MACRO_HPP_INCLUDED diff --git a/code/AMFImporter_Material.cpp b/code/AMFImporter_Material.cpp new file mode 100644 index 000000000..4550f6fe2 --- /dev/null +++ b/code/AMFImporter_Material.cpp @@ -0,0 +1,309 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +/// \file AMFImporter_Material.cpp +/// \brief Parsing data from material nodes. +/// \date 2016 +/// \author smal.root@gmail.com + +#ifndef ASSIMP_BUILD_NO_AMF_IMPORTER + +#include "AMFImporter.hpp" +#include "AMFImporter_Macro.hpp" + +namespace Assimp +{ + +// , and . +// > +// +// A color definition. +// Multi elements - No. +// Parent element - , , , , . +// +// "profile" can be one of "sRGB", "AdobeRGB", "Wide-Gamut-RGB", "CIERGB", "CIELAB", or "CIEXYZ". +// Children elements: +// , , , +// Multi elements - No. +// Red, Greed, Blue and Alpha (transparency) component of a color in sRGB space, values ranging from 0 to 1. The +// values can be specified as constants, or as a formula depending on the coordinates. +void AMFImporter::ParseNode_Color() +{ +std::string profile; +CAMFImporter_NodeElement* ne; + + // Read attributes for node . + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECK_RET("profile", profile, mReader->getAttributeValue); + MACRO_ATTRREAD_LOOPEND; + + // create new color object. + ne = new CAMFImporter_NodeElement_Color(mNodeElement_Cur); + + CAMFImporter_NodeElement_Color& als = *((CAMFImporter_NodeElement_Color*)ne);// alias for convenience + + als.Profile = profile; + // Check for child nodes + if(!mReader->isEmptyElement()) + { + bool read_flag[4] = { false, false, false, false }; + + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("color"); + MACRO_NODECHECK_READCOMP_F("r", read_flag[0], als.Color.r); + MACRO_NODECHECK_READCOMP_F("g", read_flag[1], als.Color.g); + MACRO_NODECHECK_READCOMP_F("b", read_flag[2], als.Color.b); + MACRO_NODECHECK_READCOMP_F("a", read_flag[3], als.Color.a); + MACRO_NODECHECK_LOOPEND("color"); + ParseHelper_Node_Exit(); + // check that all components was defined + if(!(read_flag[0] && read_flag[1] && read_flag[2])) throw DeadlyImportError("Not all color components are defined."); + // check if is absent. Then manualy add "a == 1". + if(!read_flag[3]) als.Color.a = 1; + + }// if(!mReader->isEmptyElement()) + else + { + mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element + }// if(!mReader->isEmptyElement()) else + + als.Composed = false; + mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph. +} + +// +// +// An available material. +// Multi elements - Yes. +// Parent element - . +void AMFImporter::ParseNode_Material() +{ +std::string id; +CAMFImporter_NodeElement* ne; + + // Read attributes for node . + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECK_RET("id", id, mReader->getAttributeValue); + MACRO_ATTRREAD_LOOPEND; + + // create new object. + ne = new CAMFImporter_NodeElement_Material(mNodeElement_Cur); + // and assign read data + ((CAMFImporter_NodeElement_Material*)ne)->ID = id; + // Check for child nodes + if(!mReader->isEmptyElement()) + { + bool col_read = false; + + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("material"); + if(XML_CheckNode_NameEqual("color")) + { + // Check if data already defined. + if(col_read) Throw_MoreThanOnceDefined("color", "Only one color can be defined for ."); + // read data and set flag about it + ParseNode_Color(); + col_read = true; + + continue; + } + + if(XML_CheckNode_NameEqual("metadata")) { ParseNode_Metadata(); continue; } + MACRO_NODECHECK_LOOPEND("material"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element + }// if(!mReader->isEmptyElement()) else + + mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph. +} + +// +// +// Specifies an texture data to be used as a map. Lists a sequence of Base64 values specifying values for pixels from left to right then top to bottom, +// then layer by layer. +// Multi elements - Yes. +// Parent element - . +void AMFImporter::ParseNode_Texture() +{ +std::string id; +uint32_t width = 0; +uint32_t height = 0; +uint32_t depth = 1; +std::string type; +bool tiled = false; +std::string enc64_data; +CAMFImporter_NodeElement* ne; + + // Read attributes for node . + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECK_RET("id", id, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_RET("width", width, XML_ReadNode_GetAttrVal_AsU32); + MACRO_ATTRREAD_CHECK_RET("height", height, XML_ReadNode_GetAttrVal_AsU32); + MACRO_ATTRREAD_CHECK_RET("depth", depth, XML_ReadNode_GetAttrVal_AsU32); + MACRO_ATTRREAD_CHECK_RET("type", type, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_RET("tiled", tiled, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_LOOPEND; + + // create new texture object. + ne = new CAMFImporter_NodeElement_Texture(mNodeElement_Cur); + + CAMFImporter_NodeElement_Texture& als = *((CAMFImporter_NodeElement_Texture*)ne);// alias for convenience + + // Check for child nodes + if(!mReader->isEmptyElement()) XML_ReadNode_GetVal_AsString(enc64_data); + + // check that all components was defined + if(id.empty()) throw DeadlyImportError("ID for texture must be defined."); + if(width < 1) Throw_IncorrectAttrValue("width"); + if(height < 1) Throw_IncorrectAttrValue("height"); + if(depth < 1) Throw_IncorrectAttrValue("depth"); + if(type != "grayscale") Throw_IncorrectAttrValue("type"); + if(enc64_data.empty()) throw DeadlyImportError("Texture data not defined."); + // copy data + als.ID = id; + als.Width = width; + als.Height = height; + als.Depth = depth; + als.Tiled = tiled; + ParseHelper_Decode_Base64(enc64_data, als.Data); + // check data size + if((width * height * depth) != als.Data.size()) throw DeadlyImportError("Texture has incorrect data size."); + + mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element + mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph. +} + +// +// , old name: +// Specifies texture coordinates for triangle. +// Multi elements - No. +// Parent element - . +// Children elements: +// , , , , , . Old name: , , , , , . +// Multi elements - No. +// Texture coordinates for every vertex of triangle. +void AMFImporter::ParseNode_TexMap(const bool pUseOldName) +{ +std::string rtexid, gtexid, btexid, atexid; +CAMFImporter_NodeElement* ne; + + // Read attributes for node . + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECK_RET("rtexid", rtexid, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_RET("gtexid", gtexid, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_RET("btexid", btexid, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_RET("atexid", atexid, mReader->getAttributeValue); + MACRO_ATTRREAD_LOOPEND; + + // create new texture coordinates object. + ne = new CAMFImporter_NodeElement_TexMap(mNodeElement_Cur); + + CAMFImporter_NodeElement_TexMap& als = *((CAMFImporter_NodeElement_TexMap*)ne);// alias for convenience + // check data + if(rtexid.empty() && gtexid.empty() && btexid.empty()) throw DeadlyImportError("ParseNode_TexMap. At least one texture ID must be defined."); + // Check for children nodes + XML_CheckNode_MustHaveChildren(); + // read children nodes + bool read_flag[6] = { false, false, false, false, false, false }; + + ParseHelper_Node_Enter(ne); + if(!pUseOldName) + { + MACRO_NODECHECK_LOOPBEGIN("texmap"); + MACRO_NODECHECK_READCOMP_F("utex1", read_flag[0], als.TextureCoordinate[0].x); + MACRO_NODECHECK_READCOMP_F("utex2", read_flag[1], als.TextureCoordinate[1].x); + MACRO_NODECHECK_READCOMP_F("utex3", read_flag[2], als.TextureCoordinate[2].x); + MACRO_NODECHECK_READCOMP_F("vtex1", read_flag[3], als.TextureCoordinate[0].y); + MACRO_NODECHECK_READCOMP_F("vtex2", read_flag[4], als.TextureCoordinate[1].y); + MACRO_NODECHECK_READCOMP_F("vtex3", read_flag[5], als.TextureCoordinate[2].y); + MACRO_NODECHECK_LOOPEND("texmap"); + } + else + { + MACRO_NODECHECK_LOOPBEGIN("map"); + MACRO_NODECHECK_READCOMP_F("u1", read_flag[0], als.TextureCoordinate[0].x); + MACRO_NODECHECK_READCOMP_F("u2", read_flag[1], als.TextureCoordinate[1].x); + MACRO_NODECHECK_READCOMP_F("u3", read_flag[2], als.TextureCoordinate[2].x); + MACRO_NODECHECK_READCOMP_F("v1", read_flag[3], als.TextureCoordinate[0].y); + MACRO_NODECHECK_READCOMP_F("v2", read_flag[4], als.TextureCoordinate[1].y); + MACRO_NODECHECK_READCOMP_F("v3", read_flag[5], als.TextureCoordinate[2].y); + MACRO_NODECHECK_LOOPEND("map"); + }// if(!pUseOldName) else + + ParseHelper_Node_Exit(); + + // check that all components was defined + if(!(read_flag[0] && read_flag[1] && read_flag[2] && read_flag[3] && read_flag[4] && read_flag[5])) + throw DeadlyImportError("Not all texture coordinates are defined."); + + // copy attributes data + als.TextureID_R = rtexid; + als.TextureID_G = gtexid; + als.TextureID_B = btexid; + als.TextureID_A = atexid; + + mNodeElement_List.push_back(ne);// add to node element list because its a new object in graph. +} + +}// namespace Assimp + +#endif // !ASSIMP_BUILD_NO_AMF_IMPORTER diff --git a/code/AMFImporter_Node.hpp b/code/AMFImporter_Node.hpp new file mode 100644 index 000000000..f8c3a7933 --- /dev/null +++ b/code/AMFImporter_Node.hpp @@ -0,0 +1,423 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +/// \file AMFImporter_Node.hpp +/// \brief Elements of scene graph. +/// \date 2016 +/// \author smal.root@gmail.com + +#pragma once +#ifndef INCLUDED_AI_AMF_IMPORTER_NODE_H +#define INCLUDED_AI_AMF_IMPORTER_NODE_H + +// Header files, stdlib. +#include +#include +#include + +// Header files, Assimp. +#include "assimp/types.h" +#include "assimp/scene.h" + +/// \class CAMFImporter_NodeElement +/// Base class for elements of nodes. +class CAMFImporter_NodeElement +{ + /***********************************************/ + /******************** Types ********************/ + /***********************************************/ + +public: + + /// \enum EType + /// Define what data type contain node element. + enum EType + { + ENET_Color, ///< Color element: . + ENET_Constellation,///< Grouping element: . + ENET_Coordinates, ///< Coordinates element: . + ENET_Edge, ///< Edge element: . + ENET_Instance, ///< Grouping element: . + ENET_Material, ///< Material element: . + ENET_Metadata, ///< Metadata element: . + ENET_Mesh, ///< Metadata element: . + ENET_Object, ///< Element which hold object: . + ENET_Root, ///< Root element: . + ENET_Triangle, ///< Triangle element: . + ENET_TexMap, ///< Texture coordinates element: or . + ENET_Texture, ///< Texture element: . + ENET_Vertex, ///< Vertex element: . + ENET_Vertices, ///< Vertex element: . + ENET_Volume, ///< Volume element: . + + ENET_Invalid ///< Element has invalid type and possible contain invalid data. + }; + + /***********************************************/ + /****************** Constants ******************/ + /***********************************************/ + +public: + + const EType Type;///< Type of element. + + /***********************************************/ + /****************** Variables ******************/ + /***********************************************/ + +public: + + std::string ID;///< ID of element. + CAMFImporter_NodeElement* Parent;///< Parrent element. If nullptr then this node is root. + std::list Child;///< Child elements. + + /***********************************************/ + /****************** Functions ******************/ + /***********************************************/ + +private: + + /// \fn CAMFImporter_NodeElement(const CAMFImporter_NodeElement& pNodeElement) + /// Disabled copy constructor. + CAMFImporter_NodeElement(const CAMFImporter_NodeElement& pNodeElement); + + /// \fn CAMFImporter_NodeElement& operator=(const CAMFImporter_NodeElement& pNodeElement) + /// Disabled assign operator. + CAMFImporter_NodeElement& operator=(const CAMFImporter_NodeElement& pNodeElement); + + /// \fn CAMFImporter_NodeElement() + /// Disabled default constructor. + CAMFImporter_NodeElement(); + +protected: + + /// \fn CAMFImporter_NodeElement(const EType pType, CAMFImporter_NodeElement* pParent) + /// In constructor inheritor must set element type. + /// \param [in] pType - element type. + /// \param [in] pParent - parent element. + CAMFImporter_NodeElement(const EType pType, CAMFImporter_NodeElement* pParent) + : Type(pType), Parent(pParent) + {} + +};// class IAMFImporter_NodeElement + +/// \struct CAMFImporter_NodeElement_Constellation +/// A collection of objects or constellations with specific relative locations. +struct CAMFImporter_NodeElement_Constellation : public CAMFImporter_NodeElement +{ + /// \fn CAMFImporter_NodeElement_Constellation(CAMFImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + CAMFImporter_NodeElement_Constellation(CAMFImporter_NodeElement* pParent) + : CAMFImporter_NodeElement(ENET_Constellation, pParent) + {} + +};// struct CAMFImporter_NodeElement_Constellation + +/// \struct CAMFImporter_NodeElement_Instance +/// Part of constellation. +struct CAMFImporter_NodeElement_Instance : public CAMFImporter_NodeElement +{ + /****************** Variables ******************/ + + std::string ObjectID;///< ID of object for instanciation. + /// \var Delta - The distance of translation in the x, y, or z direction, respectively, in the referenced object's coordinate system, to + /// create an instance of the object in the current constellation. + aiVector3D Delta; + + /// \var Rotation - The rotation, in degrees, to rotate the referenced object about its x, y, and z axes, respectively, to create an + /// instance of the object in the current constellation. Rotations shall be executed in order of x first, then y, then z. + aiVector3D Rotation; + + /****************** Functions ******************/ + + /// \fn CAMFImporter_NodeElement_Instance(CAMFImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + CAMFImporter_NodeElement_Instance(CAMFImporter_NodeElement* pParent) + : CAMFImporter_NodeElement(ENET_Instance, pParent) + {} + +};// struct CAMFImporter_NodeElement_Instance + +/// \struct CAMFImporter_NodeElement_Metadata +/// Structure that define metadata node. +struct CAMFImporter_NodeElement_Metadata : public CAMFImporter_NodeElement +{ + /****************** Variables ******************/ + + std::string Type;///< Type of "Value". + std::string Value;///< Value. + + /****************** Functions ******************/ + + /// \fn CAMFImporter_NodeElement_Metadata(CAMFImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + CAMFImporter_NodeElement_Metadata(CAMFImporter_NodeElement* pParent) + : CAMFImporter_NodeElement(ENET_Metadata, pParent) + {} + +};// struct CAMFImporter_NodeElement_Metadata + +/// \struct CAMFImporter_NodeElement_Root +/// Structure that define root node. +struct CAMFImporter_NodeElement_Root : public CAMFImporter_NodeElement +{ + /****************** Variables ******************/ + + std::string Unit;///< The units to be used. May be "inch", "millimeter", "meter", "feet", or "micron". + std::string Version;///< Version of format. + + /****************** Functions ******************/ + + /// \fn CAMFImporter_NodeElement_Root(CAMFImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + CAMFImporter_NodeElement_Root(CAMFImporter_NodeElement* pParent) + : CAMFImporter_NodeElement(ENET_Root, pParent) + {} + +};// struct CAMFImporter_NodeElement_Root + +/// \struct CAMFImporter_NodeElement_Color +/// Structure that define object node. +struct CAMFImporter_NodeElement_Color : public CAMFImporter_NodeElement +{ + /****************** Variables ******************/ + + bool Composed;///< Type of color stored: if true then look for formula in \ref Color_Composed[4], else - in \ref Color. + std::string Color_Composed[4];///< By components formulas of composed color. [0..3] => RGBA. + aiColor4D Color;///< Constant color. + std::string Profile;///< The ICC color space used to interpret the three color channels , and .. + + /****************** Functions ******************/ + + /// \fn CAMFImporter_NodeElement_Color(CAMFImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + CAMFImporter_NodeElement_Color(CAMFImporter_NodeElement* pParent) + : CAMFImporter_NodeElement(ENET_Color, pParent) + {} + +};// struct CAMFImporter_NodeElement_Color + +/// \struct CAMFImporter_NodeElement_Material +/// Structure that define material node. +struct CAMFImporter_NodeElement_Material : public CAMFImporter_NodeElement +{ + /// \fn CAMFImporter_NodeElement_Material(CAMFImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + CAMFImporter_NodeElement_Material(CAMFImporter_NodeElement* pParent) + : CAMFImporter_NodeElement(ENET_Material, pParent) + {} + +};// struct CAMFImporter_NodeElement_Material + +/// \struct CAMFImporter_NodeElement_Object +/// Structure that define object node. +struct CAMFImporter_NodeElement_Object : public CAMFImporter_NodeElement +{ + /// \fn CAMFImporter_NodeElement_Object(CAMFImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + CAMFImporter_NodeElement_Object(CAMFImporter_NodeElement* pParent) + : CAMFImporter_NodeElement(ENET_Object, pParent) + {} + +};// struct CAMFImporter_NodeElement_Object + +/// \struct CAMFImporter_NodeElement_Mesh +/// Structure that define mesh node. +struct CAMFImporter_NodeElement_Mesh : public CAMFImporter_NodeElement +{ + /// \fn CAMFImporter_NodeElement_Mesh(CAMFImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + CAMFImporter_NodeElement_Mesh(CAMFImporter_NodeElement* pParent) + : CAMFImporter_NodeElement(ENET_Mesh, pParent) + {} + +};// struct CAMFImporter_NodeElement_Mesh + +/// \struct CAMFImporter_NodeElement_Vertex +/// Structure that define vertex node. +struct CAMFImporter_NodeElement_Vertex : public CAMFImporter_NodeElement +{ + /// \fn CAMFImporter_NodeElement_Vertex(CAMFImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + CAMFImporter_NodeElement_Vertex(CAMFImporter_NodeElement* pParent) + : CAMFImporter_NodeElement(ENET_Vertex, pParent) + {} + +};// struct CAMFImporter_NodeElement_Vertex + +/// \struct CAMFImporter_NodeElement_Edge +/// Structure that define edge node. +struct CAMFImporter_NodeElement_Edge : public CAMFImporter_NodeElement +{ + /// \fn CAMFImporter_NodeElement_Edge(CAMFImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + CAMFImporter_NodeElement_Edge(CAMFImporter_NodeElement* pParent) + : CAMFImporter_NodeElement(ENET_Edge, pParent) + {} + +};// struct CAMFImporter_NodeElement_Vertex + +/// \struct CAMFImporter_NodeElement_Vertices +/// Structure that define vertices node. +struct CAMFImporter_NodeElement_Vertices : public CAMFImporter_NodeElement +{ + /// \fn CAMFImporter_NodeElement_Vertices(CAMFImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + CAMFImporter_NodeElement_Vertices(CAMFImporter_NodeElement* pParent) + : CAMFImporter_NodeElement(ENET_Vertices, pParent) + {} + +};// struct CAMFImporter_NodeElement_Vertices + +/// \struct CAMFImporter_NodeElement_Volume +/// Structure that define volume node. +struct CAMFImporter_NodeElement_Volume : public CAMFImporter_NodeElement +{ + /****************** Variables ******************/ + + std::string MaterialID;///< Which material to use. + std::string Type;///< What this volume describes can be “region” or “support”. If none specified, “object” is assumed. + + /****************** Functions ******************/ + + /// \fn CAMFImporter_NodeElement_Volume(CAMFImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + CAMFImporter_NodeElement_Volume(CAMFImporter_NodeElement* pParent) + : CAMFImporter_NodeElement(ENET_Volume, pParent) + {} + +};// struct CAMFImporter_NodeElement_Volume + +/// \struct CAMFImporter_NodeElement_Coordinates +/// Structure that define coordinates node. +struct CAMFImporter_NodeElement_Coordinates : public CAMFImporter_NodeElement +{ + /****************** Variables ******************/ + + aiVector3D Coordinate;///< Coordinate. + + /****************** Functions ******************/ + + /// \fn CAMFImporter_NodeElement_Coordinates(CAMFImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + CAMFImporter_NodeElement_Coordinates(CAMFImporter_NodeElement* pParent) + : CAMFImporter_NodeElement(ENET_Coordinates, pParent) + {} + +};// struct CAMFImporter_NodeElement_Coordinates + +/// \struct CAMFImporter_NodeElement_TexMap +/// Structure that define texture coordinates node. +struct CAMFImporter_NodeElement_TexMap : public CAMFImporter_NodeElement +{ + /****************** Variables ******************/ + + aiVector3D TextureCoordinate[3];///< Texture coordinates. + std::string TextureID_R;///< Texture ID for red color component. + std::string TextureID_G;///< Texture ID for green color component. + std::string TextureID_B;///< Texture ID for blue color component. + std::string TextureID_A;///< Texture ID for alpha color component. + + /****************** Functions ******************/ + + /// \fn CAMFImporter_NodeElement_TexMap(CAMFImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + CAMFImporter_NodeElement_TexMap(CAMFImporter_NodeElement* pParent) + : CAMFImporter_NodeElement(ENET_TexMap, pParent) + {} + +};// struct CAMFImporter_NodeElement_TexMap + +/// \struct CAMFImporter_NodeElement_Triangle +/// Structure that define triangle node. +struct CAMFImporter_NodeElement_Triangle : public CAMFImporter_NodeElement +{ + /****************** Variables ******************/ + + size_t V[3];///< Triangle vertices. + + /****************** Functions ******************/ + + /// \fn CAMFImporter_NodeElement_Triangle(CAMFImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + CAMFImporter_NodeElement_Triangle(CAMFImporter_NodeElement* pParent) + : CAMFImporter_NodeElement(ENET_Triangle, pParent) + {} + +};// struct CAMFImporter_NodeElement_Triangle + +/// \struct CAMFImporter_NodeElement_Texture +/// Structure that define texture node. +struct CAMFImporter_NodeElement_Texture : public CAMFImporter_NodeElement +{ + /****************** Variables ******************/ + + size_t Width, Height, Depth;///< Size of the texture. + std::vector Data;///< Data of the texture. + bool Tiled; + + /****************** Functions ******************/ + + /// \fn CAMFImporter_NodeElement_Texture(CAMFImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + CAMFImporter_NodeElement_Texture(CAMFImporter_NodeElement* pParent) + : CAMFImporter_NodeElement(ENET_Texture, pParent) + {} + +};// struct CAMFImporter_NodeElement_Texture + +#endif // INCLUDED_AI_AMF_IMPORTER_NODE_H diff --git a/code/AMFImporter_Postprocess.cpp b/code/AMFImporter_Postprocess.cpp new file mode 100644 index 000000000..e88c2c08b --- /dev/null +++ b/code/AMFImporter_Postprocess.cpp @@ -0,0 +1,970 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +/// \file AMFImporter_Postprocess.cpp +/// \brief Convert built scenegraph and objects to Assimp scenegraph. +/// \date 2016 +/// \author smal.root@gmail.com + +#ifndef ASSIMP_BUILD_NO_AMF_IMPORTER + +#include "AMFImporter.hpp" + +// Header files, Assimp. +#include "SceneCombiner.h" +#include "StandardShapes.h" +#include "StringUtils.h" + +// Header files, stdlib. +#include +#include + +namespace Assimp +{ + +aiColor4D AMFImporter::SPP_Material::GetColor(const float pX, const float pY, const float pZ) const +{ +aiColor4D tcol; + + // Check if stored data are supported. + if(Composition.size() != 0) + { + throw DeadlyImportError("IME. GetColor for composition"); + } + else if(Color->Composed) + { + throw DeadlyImportError("IME. GetColor, composed color"); + } + else + { + tcol = Color->Color; + } + + // Check if default color must be used + if((tcol.r == 0) && (tcol.g == 0) && (tcol.b == 0) && (tcol.a == 0)) + { + tcol.r = 0.5f; + tcol.g = 0.5f; + tcol.b = 0.5f; + tcol.a = 1; + } + + return tcol; +} + +void AMFImporter::PostprocessHelper_CreateMeshDataArray(const CAMFImporter_NodeElement_Mesh& pNodeElement, std::vector& pVertexCoordinateArray, + std::vector& pVertexColorArray) const +{ +CAMFImporter_NodeElement_Vertices* vn = nullptr; +size_t col_idx; + + // All data stored in "vertices", search for it. + for(CAMFImporter_NodeElement* ne_child: pNodeElement.Child) + { + if(ne_child->Type == CAMFImporter_NodeElement::ENET_Vertices) vn = (CAMFImporter_NodeElement_Vertices*)ne_child; + } + + // If "vertices" not found then no work for us. + if(vn == nullptr) return; + + pVertexCoordinateArray.reserve(vn->Child.size());// all coordinates stored as child and we need to reserve space for future push_back's. + pVertexColorArray.resize(vn->Child.size());// colors count equal vertices count. + col_idx = 0; + // Inside vertices collect all data and place to arrays + for(CAMFImporter_NodeElement* vn_child: vn->Child) + { + // vertices, colors + if(vn_child->Type == CAMFImporter_NodeElement::ENET_Vertex) + { + // by default clear color for current vertex + pVertexColorArray[col_idx] = nullptr; + + for(CAMFImporter_NodeElement* vtx: vn_child->Child) + { + if(vtx->Type == CAMFImporter_NodeElement::ENET_Coordinates) + { + pVertexCoordinateArray.push_back(((CAMFImporter_NodeElement_Coordinates*)vtx)->Coordinate); + + continue; + } + + if(vtx->Type == CAMFImporter_NodeElement::ENET_Color) + { + pVertexColorArray[col_idx] = (CAMFImporter_NodeElement_Color*)vtx; + + continue; + } + }// for(CAMFImporter_NodeElement* vtx: vn_child->Child) + + col_idx++; + }// if(vn_child->Type == CAMFImporter_NodeElement::ENET_Vertex) + }// for(CAMFImporter_NodeElement* vn_child: vn->Child) +} + +size_t AMFImporter::PostprocessHelper_GetTextureID_Or_Create(const std::string& pID_R, const std::string& pID_G, const std::string& pID_B, + const std::string& pID_A) +{ +size_t TextureConverted_Index; +std::string TextureConverted_ID; + + // check input data + if(pID_R.empty() && pID_G.empty() && pID_B.empty() && pID_A.empty()) + throw DeadlyImportError("PostprocessHelper_GetTextureID_Or_Create. At least one texture ID must be defined."); + + // Create ID + TextureConverted_ID = pID_R + "_" + pID_G + "_" + pID_B + "_" + pID_A; + // Check if texture specified by set of IDs is converted already. + TextureConverted_Index = 0; + for(const SPP_Texture& tex_convd: mTexture_Converted) + { + if(tex_convd.ID == TextureConverted_ID) + return TextureConverted_Index; + else + TextureConverted_Index++; + } + + // + // Converted texture not found, create it. + // + CAMFImporter_NodeElement_Texture* src_texture[4]{nullptr}; + std::vector src_texture_4check; + SPP_Texture converted_texture; + + {// find all specified source textures + CAMFImporter_NodeElement* t_tex; + + // R + if(!pID_R.empty()) + { + if(!Find_NodeElement(pID_R, CAMFImporter_NodeElement::ENET_Texture, &t_tex)) Throw_ID_NotFound(pID_R); + + src_texture[0] = (CAMFImporter_NodeElement_Texture*)t_tex; + src_texture_4check.push_back((CAMFImporter_NodeElement_Texture*)t_tex); + } + else + { + src_texture[0] = nullptr; + } + + // G + if(!pID_G.empty()) + { + if(!Find_NodeElement(pID_G, CAMFImporter_NodeElement::ENET_Texture, &t_tex)) Throw_ID_NotFound(pID_G); + + src_texture[1] = (CAMFImporter_NodeElement_Texture*)t_tex; + src_texture_4check.push_back((CAMFImporter_NodeElement_Texture*)t_tex); + } + else + { + src_texture[1] = nullptr; + } + + // B + if(!pID_B.empty()) + { + if(!Find_NodeElement(pID_B, CAMFImporter_NodeElement::ENET_Texture, &t_tex)) Throw_ID_NotFound(pID_B); + + src_texture[2] = (CAMFImporter_NodeElement_Texture*)t_tex; + src_texture_4check.push_back((CAMFImporter_NodeElement_Texture*)t_tex); + } + else + { + src_texture[2] = nullptr; + } + + // A + if(!pID_A.empty()) + { + if(!Find_NodeElement(pID_A, CAMFImporter_NodeElement::ENET_Texture, &t_tex)) Throw_ID_NotFound(pID_A); + + src_texture[3] = (CAMFImporter_NodeElement_Texture*)t_tex; + src_texture_4check.push_back((CAMFImporter_NodeElement_Texture*)t_tex); + } + else + { + src_texture[3] = nullptr; + } + }// END: find all specified source textures + + // check that all textures has same size + if(src_texture_4check.size() > 1) + { + for (size_t i = 0, i_e = (src_texture_4check.size() - 1); i < i_e; i++) + { + if((src_texture_4check[i]->Width != src_texture_4check[i + 1]->Width) || (src_texture_4check[i]->Height != src_texture_4check[i + 1]->Height) || + (src_texture_4check[i]->Depth != src_texture_4check[i + 1]->Depth)) + { + throw DeadlyImportError("PostprocessHelper_GetTextureID_Or_Create. Source texture must has the same size."); + } + } + }// if(src_texture_4check.size() > 1) + + // set texture attributes + converted_texture.Width = src_texture_4check[0]->Width; + converted_texture.Height = src_texture_4check[0]->Height; + converted_texture.Depth = src_texture_4check[0]->Depth; + // if one of source texture is tiled then converted texture is tiled too. + converted_texture.Tiled = false; + for(uint8_t i = 0; i < src_texture_4check.size(); i++) converted_texture.Tiled |= src_texture_4check[i]->Tiled; + + // Create format hint. + strcpy(converted_texture.FormatHint, "rgba0000");// copy initial string. + if(!pID_R.empty()) converted_texture.FormatHint[4] = '8'; + if(!pID_G.empty()) converted_texture.FormatHint[5] = '8'; + if(!pID_B.empty()) converted_texture.FormatHint[6] = '8'; + if(!pID_A.empty()) converted_texture.FormatHint[7] = '8'; + + // + // Сopy data of textures. + // + size_t tex_size = 0; + size_t step = 0; + size_t off_g = 0; + size_t off_b = 0; + + // Calculate size of the target array and rule how data will be copied. + if(!pID_R.empty()) { tex_size += src_texture[0]->Data.size(); step++, off_g++, off_b++; } + if(!pID_G.empty()) { tex_size += src_texture[1]->Data.size(); step++, off_b++; } + if(!pID_B.empty()) { tex_size += src_texture[2]->Data.size(); step++; } + if(!pID_A.empty()) { tex_size += src_texture[3]->Data.size(); step++; } + + // Create target array. + converted_texture.Data = new uint8_t[tex_size]; + // And copy data + auto CopyTextureData = [&](const std::string& pID, const size_t pOffset, const size_t pStep, const uint8_t pSrcTexNum) -> void + { + if(!pID.empty()) + { + for(size_t idx_target = pOffset, idx_src = 0; idx_target < tex_size; idx_target += pStep, idx_src++) + converted_texture.Data[idx_target] = src_texture[pSrcTexNum]->Data.at(idx_src); + } + };// auto CopyTextureData = [&](const size_t pOffset, const size_t pStep, const uint8_t pSrcTexNum) -> void + + CopyTextureData(pID_R, 0, step, 0); + CopyTextureData(pID_G, off_g, step, 1); + CopyTextureData(pID_B, off_b, step, 2); + CopyTextureData(pID_A, step - 1, step, 3); + + // Store new converted texture ID + converted_texture.ID = TextureConverted_ID; + // Store new converted texture + mTexture_Converted.push_back(converted_texture); + + return TextureConverted_Index; +} + +void AMFImporter::PostprocessHelper_SplitFacesByTextureID(std::list& pInputList, std::list >& pOutputList_Separated) +{ +auto texmap_is_equal = [](const CAMFImporter_NodeElement_TexMap* pTexMap1, const CAMFImporter_NodeElement_TexMap* pTexMap2) -> bool +{ + if((pTexMap1 == nullptr) && (pTexMap2 == nullptr)) return true; + if(pTexMap1 == nullptr) return false; + if(pTexMap2 == nullptr) return false; + + if(pTexMap1->TextureID_R != pTexMap2->TextureID_R) return false; + if(pTexMap1->TextureID_G != pTexMap2->TextureID_G) return false; + if(pTexMap1->TextureID_B != pTexMap2->TextureID_B) return false; + if(pTexMap1->TextureID_A != pTexMap2->TextureID_A) return false; + + return true; +}; + + pOutputList_Separated.clear(); + if(pInputList.size() == 0) return; + + do + { + SComplexFace face_start = pInputList.front(); + std::list face_list_cur; + + for(std::list::iterator it = pInputList.begin(), it_end = pInputList.end(); it != it_end;) + { + if(texmap_is_equal(face_start.TexMap, it->TexMap)) + { + auto it_old = it; + + it++; + face_list_cur.push_back(*it_old); + pInputList.erase(it_old); + } + else + { + it++; + } + } + + if(face_list_cur.size() > 0) pOutputList_Separated.push_back(face_list_cur); + + } while(pInputList.size() > 0); +} + +void AMFImporter::Postprocess_AddMetadata(const std::list& pMetadataList, aiNode& pSceneNode) const +{ + if(pMetadataList.size() > 0) + { + if(pSceneNode.mMetaData != nullptr) throw DeadlyImportError("Postprocess. MetaData member in node are not nullptr. Something went wrong."); + + // copy collected metadata to output node. + pSceneNode.mMetaData = new aiMetadata(); + pSceneNode.mMetaData->mNumProperties = pMetadataList.size(); + pSceneNode.mMetaData->mKeys = new aiString[pSceneNode.mMetaData->mNumProperties]; + pSceneNode.mMetaData->mValues = new aiMetadataEntry[pSceneNode.mMetaData->mNumProperties]; + + size_t meta_idx = 0; + + for(const CAMFImporter_NodeElement_Metadata& metadata: pMetadataList) + { + pSceneNode.mMetaData->Set(meta_idx++, metadata.Type, aiString(metadata.Value)); + } + }// if(pMetadataList.size() > 0) +} + +void AMFImporter::Postprocess_BuildNodeAndObject(const CAMFImporter_NodeElement_Object& pNodeElement, std::list& pMeshList, aiNode** pSceneNode) +{ +CAMFImporter_NodeElement_Color* object_color = nullptr; + + // create new aiNode and set name as has. + *pSceneNode = new aiNode; + (*pSceneNode)->mName = pNodeElement.ID; + // read mesh and color + for(const CAMFImporter_NodeElement* ne_child: pNodeElement.Child) + { + std::vector vertex_arr; + std::vector color_arr; + + // color for object + if(ne_child->Type == CAMFImporter_NodeElement::ENET_Color) object_color = (CAMFImporter_NodeElement_Color*)ne_child; + + if(ne_child->Type == CAMFImporter_NodeElement::ENET_Mesh) + { + // Create arrays from children of mesh: vertices. + PostprocessHelper_CreateMeshDataArray(*((CAMFImporter_NodeElement_Mesh*)ne_child), vertex_arr, color_arr); + // Use this arrays as a source when creating every aiMesh + Postprocess_BuildMeshSet(*((CAMFImporter_NodeElement_Mesh*)ne_child), vertex_arr, color_arr, object_color, pMeshList, **pSceneNode); + } + }// for(const CAMFImporter_NodeElement* ne_child: pNodeElement) +} + +void AMFImporter::Postprocess_BuildMeshSet(const CAMFImporter_NodeElement_Mesh& pNodeElement, const std::vector& pVertexCoordinateArray, + const std::vector& pVertexColorArray, + const CAMFImporter_NodeElement_Color* pObjectColor, std::list& pMeshList, aiNode& pSceneNode) +{ +std::list mesh_idx; + + // all data stored in "volume", search for it. + for(const CAMFImporter_NodeElement* ne_child: pNodeElement.Child) + { + const CAMFImporter_NodeElement_Color* ne_volume_color = nullptr; + const SPP_Material* cur_mat = nullptr; + + if(ne_child->Type == CAMFImporter_NodeElement::ENET_Volume) + { + /******************* Get faces *******************/ + const CAMFImporter_NodeElement_Volume* ne_volume = reinterpret_cast(ne_child); + + std::list complex_faces_list;// List of the faces of the volume. + std::list > complex_faces_toplist;// List of the face list for every mesh. + + // check if volume use material + if(!ne_volume->MaterialID.empty()) + { + if(!Find_ConvertedMaterial(ne_volume->MaterialID, &cur_mat)) Throw_ID_NotFound(ne_volume->MaterialID); + } + + // inside "volume" collect all data and place to arrays or create new objects + for(const CAMFImporter_NodeElement* ne_volume_child: ne_volume->Child) + { + // color for volume + if(ne_volume_child->Type == CAMFImporter_NodeElement::ENET_Color) + { + ne_volume_color = reinterpret_cast(ne_volume_child); + } + else if(ne_volume_child->Type == CAMFImporter_NodeElement::ENET_Triangle)// triangles, triangles colors + { + const CAMFImporter_NodeElement_Triangle& tri_al = *reinterpret_cast(ne_volume_child); + + SComplexFace complex_face; + + // initialize pointers + complex_face.Color = nullptr; + complex_face.TexMap = nullptr; + // get data from triangle children: color, texture coordinates. + if(tri_al.Child.size()) + { + for(const CAMFImporter_NodeElement* ne_triangle_child: tri_al.Child) + { + if(ne_triangle_child->Type == CAMFImporter_NodeElement::ENET_Color) + complex_face.Color = reinterpret_cast(ne_triangle_child); + else if(ne_triangle_child->Type == CAMFImporter_NodeElement::ENET_TexMap) + complex_face.TexMap = reinterpret_cast(ne_triangle_child); + } + }// if(tri_al.Child.size()) + + // create new face and store it. + complex_face.Face.mNumIndices = 3; + complex_face.Face.mIndices = new unsigned int[3]; + complex_face.Face.mIndices[0] = tri_al.V[0]; + complex_face.Face.mIndices[1] = tri_al.V[1]; + complex_face.Face.mIndices[2] = tri_al.V[2]; + complex_faces_list.push_back(complex_face); + } + }// for(const CAMFImporter_NodeElement* ne_volume_child: ne_volume->Child) + + /**** Split faces list: one list per mesh ****/ + PostprocessHelper_SplitFacesByTextureID(complex_faces_list, complex_faces_toplist); + + /***** Create mesh for every faces list ******/ + for(std::list& face_list_cur: complex_faces_toplist) + { + auto VertexIndex_GetMinimal = [](const std::list& pFaceList, const size_t* pBiggerThan) -> size_t + { + size_t rv; + + if(pBiggerThan != nullptr) + { + bool found = false; + + for(const SComplexFace& face: pFaceList) + { + for(size_t idx_vert = 0; idx_vert < face.Face.mNumIndices; idx_vert++) + { + if(face.Face.mIndices[idx_vert] > *pBiggerThan) + { + rv = face.Face.mIndices[idx_vert]; + found = true; + + break; + } + } + + if(found) break; + } + + if(!found) return *pBiggerThan; + } + else + { + rv = pFaceList.front().Face.mIndices[0]; + }// if(pBiggerThan != nullptr) else + + for(const SComplexFace& face: pFaceList) + { + for(size_t vi = 0; vi < face.Face.mNumIndices; vi++) + { + if(face.Face.mIndices[vi] < rv) + { + if(pBiggerThan != nullptr) + { + if(face.Face.mIndices[vi] > *pBiggerThan) rv = face.Face.mIndices[vi]; + } + else + { + rv = face.Face.mIndices[vi]; + } + } + } + }// for(const SComplexFace& face: pFaceList) + + return rv; + };// auto VertexIndex_GetMinimal = [](const std::list& pFaceList, const size_t* pBiggerThan) -> size_t + + auto VertexIndex_Replace = [](std::list& pFaceList, const size_t pIdx_From, const size_t pIdx_To) -> void + { + for(const SComplexFace& face: pFaceList) + { + for(size_t vi = 0; vi < face.Face.mNumIndices; vi++) + { + if(face.Face.mIndices[vi] == pIdx_From) face.Face.mIndices[vi] = pIdx_To; + } + } + };// auto VertexIndex_Replace = [](std::list& pFaceList, const size_t pIdx_From, const size_t pIdx_To) -> void + + auto Vertex_CalculateColor = [&](const size_t pIdx) -> aiColor4D + { + // Color priorities(In descending order): + // 1. triangle color; + // 2. vertex color; + // 3. volume color; + // 4. object color; + // 5. material; + // 6. default - invisible coat. + // + // Fill vertices colors in color priority list above that's points from 1 to 6. + if((pIdx < pVertexColorArray.size()) && (pVertexColorArray[pIdx] != nullptr))// check for vertex color + { + if(pVertexColorArray[pIdx]->Composed) + throw DeadlyImportError("IME: vertex color composed"); + else + return pVertexColorArray[pIdx]->Color; + } + else if(ne_volume_color != nullptr)// check for volume color + { + if(ne_volume_color->Composed) + throw DeadlyImportError("IME: volume color composed"); + else + return ne_volume_color->Color; + } + else if(pObjectColor != nullptr)// check for object color + { + if(pObjectColor->Composed) + throw DeadlyImportError("IME: object color composed"); + else + return pObjectColor->Color; + } + else if(cur_mat != nullptr)// check for material + { + return cur_mat->GetColor(pVertexCoordinateArray.at(pIdx).x, pVertexCoordinateArray.at(pIdx).y, pVertexCoordinateArray.at(pIdx).z); + } + else// set default color. + { + return {0, 0, 0, 0}; + }// if((vi < pVertexColorArray.size()) && (pVertexColorArray[vi] != nullptr)) else + + };// auto Vertex_CalculateColor = [&](const size_t pIdx) -> aiColor4D + + aiMesh* tmesh = new aiMesh; + + tmesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;// Only triangles is supported by AMF. + // + // set geometry and colors (vertices) + // + // copy faces/triangles + tmesh->mNumFaces = face_list_cur.size(); + tmesh->mFaces = new aiFace[tmesh->mNumFaces]; + + // Create vertices list and optimize indices. Optimisation mean following.In AMF all volumes use one big list of vertices. And one volume + // can use only part of vertices list, for example: vertices list contain few thousands of vertices and volume use vertices 1, 3, 10. + // Do you need all this thousands of garbage? Of course no. So, optimisation step transformate sparse indices set to continuous. + size_t VertexCount_Max = tmesh->mNumFaces * 3;// 3 - triangles. + std::vector vert_arr, texcoord_arr; + std::vector col_arr; + + vert_arr.reserve(VertexCount_Max * 2);// "* 2" - see below TODO. + col_arr.reserve(VertexCount_Max * 2); + + {// fill arrays + size_t vert_idx_from, vert_idx_to; + + // first iteration. + vert_idx_to = 0; + vert_idx_from = VertexIndex_GetMinimal(face_list_cur, nullptr); + vert_arr.push_back(pVertexCoordinateArray.at(vert_idx_from)); + col_arr.push_back(Vertex_CalculateColor(vert_idx_from)); + if(vert_idx_from != vert_idx_to) VertexIndex_Replace(face_list_cur, vert_idx_from, vert_idx_to); + + // rest iterations + do + { + vert_idx_from = VertexIndex_GetMinimal(face_list_cur, &vert_idx_to); + if(vert_idx_from == vert_idx_to) break;// all indices are transfered, + + vert_arr.push_back(pVertexCoordinateArray.at(vert_idx_from)); + col_arr.push_back(Vertex_CalculateColor(vert_idx_from)); + vert_idx_to++; + if(vert_idx_from != vert_idx_to) VertexIndex_Replace(face_list_cur, vert_idx_from, vert_idx_to); + + } while(true); + }// fill arrays. END. + + // + // check if triangle colors are used and create additional faces if needed. + // + for(const SComplexFace& face_cur: face_list_cur) + { + if(face_cur.Color != nullptr) + { + aiColor4D face_color; + size_t vert_idx_new = vert_arr.size(); + + if(face_cur.Color->Composed) + throw DeadlyImportError("IME: face color composed"); + else + face_color = face_cur.Color->Color; + + for(size_t idx_ind = 0; idx_ind < face_cur.Face.mNumIndices; idx_ind++) + { + vert_arr.push_back(vert_arr.at(face_cur.Face.mIndices[idx_ind])); + col_arr.push_back(face_color); + face_cur.Face.mIndices[idx_ind] = vert_idx_new++; + } + }// if(face_cur.Color != nullptr) + }// for(const SComplexFace& face_cur: face_list_cur) + + // + // if texture is used then copy texture coordinates too. + // + if(face_list_cur.front().TexMap != nullptr) + { + size_t idx_vert_new = vert_arr.size(); + ///TODO: clean unused vertices. "* 2": in certain cases - mesh full of triangle colors - vert_arr will contain duplicated vertices for + /// colored triangles and initial vertices (for colored vertices) which in real became unused. This part need more thinking about + /// optimisation. + bool* idx_vert_used; + + idx_vert_used = new bool[VertexCount_Max * 2]; + for(size_t i = 0, i_e = VertexCount_Max * 2; i < i_e; i++) idx_vert_used[i] = false; + + // This ID's will be used when set materials ID in scene. + tmesh->mMaterialIndex = PostprocessHelper_GetTextureID_Or_Create(face_list_cur.front().TexMap->TextureID_R, + face_list_cur.front().TexMap->TextureID_G, + face_list_cur.front().TexMap->TextureID_B, + face_list_cur.front().TexMap->TextureID_A); + texcoord_arr.resize(VertexCount_Max * 2); + for(const SComplexFace& face_cur: face_list_cur) + { + for(size_t idx_ind = 0; idx_ind < face_cur.Face.mNumIndices; idx_ind++) + { + const size_t idx_vert = face_cur.Face.mIndices[idx_ind]; + + if(!idx_vert_used[idx_vert]) + { + texcoord_arr.at(idx_vert) = face_cur.TexMap->TextureCoordinate[idx_ind]; + idx_vert_used[idx_vert] = true; + } + else if(texcoord_arr.at(idx_vert) != face_cur.TexMap->TextureCoordinate[idx_ind]) + { + // in that case one vertex is shared with many texture coordinates. We need to duplicate vertex with another texture + // coordinates. + vert_arr.push_back(vert_arr.at(idx_vert)); + col_arr.push_back(col_arr.at(idx_vert)); + texcoord_arr.at(idx_vert_new) = face_cur.TexMap->TextureCoordinate[idx_ind]; + face_cur.Face.mIndices[idx_ind] = idx_vert_new++; + } + }// for(size_t idx_ind = 0; idx_ind < face_cur.Face.mNumIndices; idx_ind++) + }// for(const SComplexFace& face_cur: face_list_cur) + + delete [] idx_vert_used; + // shrink array + texcoord_arr.resize(idx_vert_new); + }// if(face_list_cur.front().TexMap != nullptr) + + // + // copy collected data to mesh + // + tmesh->mNumVertices = vert_arr.size(); + tmesh->mVertices = new aiVector3D[tmesh->mNumVertices]; + tmesh->mColors[0] = new aiColor4D[tmesh->mNumVertices]; + tmesh->mFaces = new aiFace[face_list_cur.size()]; + + memcpy(tmesh->mVertices, vert_arr.data(), tmesh->mNumVertices * sizeof(aiVector3D)); + memcpy(tmesh->mColors[0], col_arr.data(), tmesh->mNumVertices * sizeof(aiColor4D)); + if(texcoord_arr.size() > 0) + { + tmesh->mTextureCoords[0] = new aiVector3D[tmesh->mNumVertices]; + memcpy(tmesh->mTextureCoords[0], texcoord_arr.data(), tmesh->mNumVertices * sizeof(aiVector3D)); + tmesh->mNumUVComponents[0] = 2;// U and V stored in "x", "y" of aiVector3D. + } + + size_t idx_face = 0; + for(const SComplexFace& face_cur: face_list_cur) tmesh->mFaces[idx_face++] = face_cur.Face; + + // store new aiMesh + mesh_idx.push_back(pMeshList.size()); + pMeshList.push_back(tmesh); + }// for(const std::list& face_list_cur: complex_faces_toplist) + }// if(ne_child->Type == CAMFImporter_NodeElement::ENET_Volume) + }// for(const CAMFImporter_NodeElement* ne_child: pNodeElement.Child) + + // if meshes was created then assign new indices with current aiNode + if(mesh_idx.size() > 0) + { + std::list::const_iterator mit = mesh_idx.begin(); + + pSceneNode.mNumMeshes = mesh_idx.size(); + pSceneNode.mMeshes = new unsigned int[pSceneNode.mNumMeshes]; + for(size_t i = 0; i < pSceneNode.mNumMeshes; i++) pSceneNode.mMeshes[i] = *mit++; + }// if(mesh_idx.size() > 0) +} + +void AMFImporter::Postprocess_BuildMaterial(const CAMFImporter_NodeElement_Material& pMaterial) +{ +SPP_Material new_mat; + + new_mat.ID = pMaterial.ID; + for(const CAMFImporter_NodeElement* mat_child: pMaterial.Child) + { + if(mat_child->Type == CAMFImporter_NodeElement::ENET_Color) + { + new_mat.Color = (CAMFImporter_NodeElement_Color*)mat_child; + } + else if(mat_child->Type == CAMFImporter_NodeElement::ENET_Metadata) + { + new_mat.Metadata.push_back((CAMFImporter_NodeElement_Metadata*)mat_child); + } + }// for(const CAMFImporter_NodeElement* mat_child; pMaterial.Child) + + // place converted material to special list + mMaterial_Converted.push_back(new_mat); +} + +void AMFImporter::Postprocess_BuildConstellation(CAMFImporter_NodeElement_Constellation& pConstellation, std::list& pNodeList) const +{ +aiNode* con_node; +std::list ch_node; + + // We will build next hierarchy: + // aiNode as parent () for set of nodes as a children + // |- aiNode for transformation ( -> , ) - aiNode for pointing to object ("objectid") + // ... + // \_ aiNode for transformation ( -> , ) - aiNode for pointing to object ("objectid") + con_node = new aiNode; + con_node->mName = pConstellation.ID; + // Walk thru children and search for instances of another objects, constellations. + for(const CAMFImporter_NodeElement* ne: pConstellation.Child) + { + aiMatrix4x4 tmat; + aiNode* t_node; + aiNode* found_node; + + if(ne->Type == CAMFImporter_NodeElement::ENET_Metadata) continue; + if(ne->Type != CAMFImporter_NodeElement::ENET_Instance) throw DeadlyImportError("Only nodes can be in ."); + + // create alias for conveniance + CAMFImporter_NodeElement_Instance& als = *((CAMFImporter_NodeElement_Instance*)ne); + // find referenced object + if(!Find_ConvertedNode(als.ObjectID, pNodeList, &found_node)) Throw_ID_NotFound(als.ObjectID); + + // create node for apllying transformation + t_node = new aiNode; + t_node->mParent = con_node; + // apply transformation + aiMatrix4x4::Translation(als.Delta, tmat), t_node->mTransformation *= tmat; + aiMatrix4x4::RotationX(als.Rotation.x, tmat), t_node->mTransformation *= tmat; + aiMatrix4x4::RotationY(als.Rotation.y, tmat), t_node->mTransformation *= tmat; + aiMatrix4x4::RotationZ(als.Rotation.z, tmat), t_node->mTransformation *= tmat; + // create array for one child node + t_node->mNumChildren = 1; + t_node->mChildren = new aiNode*[t_node->mNumChildren]; + SceneCombiner::Copy(&t_node->mChildren[0], found_node); + t_node->mChildren[0]->mParent = t_node; + ch_node.push_back(t_node); + }// for(const CAMFImporter_NodeElement* ne: pConstellation.Child) + + // copy found aiNode's as children + if(ch_node.size() == 0) throw DeadlyImportError(" must have at least one ."); + + size_t ch_idx = 0; + + con_node->mNumChildren = ch_node.size(); + con_node->mChildren = new aiNode*[con_node->mNumChildren]; + for(aiNode* node: ch_node) con_node->mChildren[ch_idx++] = node; + + // and place "root" of node to node list + pNodeList.push_back(con_node); +} + +void AMFImporter::Postprocess_BuildScene(aiScene* pScene) +{ +std::list node_list; +std::list mesh_list; +std::list meta_list; + + // + // Because for AMF "material" is just complex colors mixing so aiMaterial will not be used. + // For building aiScene we are must to do few steps: + // at first creating root node for aiScene. + pScene->mRootNode = new aiNode; + pScene->mRootNode->mParent = nullptr; + pScene->mFlags |= AI_SCENE_FLAGS_ALLOW_SHARED; + // search for root() element + CAMFImporter_NodeElement* root_el = nullptr; + + for(CAMFImporter_NodeElement* ne: mNodeElement_List) + { + if(ne->Type != CAMFImporter_NodeElement::ENET_Root) continue; + + root_el = ne; + + break; + }// for(const CAMFImporter_NodeElement* ne: mNodeElement_List) + + // Check if root element are found. + if(root_el == nullptr) throw DeadlyImportError("Root() element not found."); + + // after that walk thru children of root and collect data. Five types of nodes can be placed at top level - in : , , , + // and . But at first we must read and because they will be used in . can be read + // at any moment. + // + // 1. + // 2. will be converted later when processing triangles list. \sa Postprocess_BuildMeshSet + for(const CAMFImporter_NodeElement* root_child: root_el->Child) + { + if(root_child->Type == CAMFImporter_NodeElement::ENET_Material) Postprocess_BuildMaterial(*((CAMFImporter_NodeElement_Material*)root_child)); + } + + // After "appearance" nodes we must read because it will be used in -> . + // + // 3. + for(const CAMFImporter_NodeElement* root_child: root_el->Child) + { + if(root_child->Type == CAMFImporter_NodeElement::ENET_Object) + { + aiNode* tnode = nullptr; + + // for mesh and node must be built: object ID assigned to aiNode name and will be used in future for + Postprocess_BuildNodeAndObject(*((CAMFImporter_NodeElement_Object*)root_child), mesh_list, &tnode); + if(tnode != nullptr) node_list.push_back(tnode); + + } + }// for(const CAMFImporter_NodeElement* root_child: root_el->Child) + + // And finally read rest of nodes. + // + for(const CAMFImporter_NodeElement* root_child: root_el->Child) + { + // 4. + if(root_child->Type == CAMFImporter_NodeElement::ENET_Constellation) + { + // and at top of self abstraction use aiNode. So we can use only aiNode list for creating new aiNode's. + Postprocess_BuildConstellation(*((CAMFImporter_NodeElement_Constellation*)root_child), node_list); + } + + // 5, + if(root_child->Type == CAMFImporter_NodeElement::ENET_Metadata) meta_list.push_back((CAMFImporter_NodeElement_Metadata*)root_child); + }// for(const CAMFImporter_NodeElement* root_child: root_el->Child) + + // at now we can add collected metadata to root node + Postprocess_AddMetadata(meta_list, *pScene->mRootNode); + // + // Check constellation children + // + // As said in specification: + // "When multiple objects and constellations are defined in a single file, only the top level objects and constellations are available for printing." + // What that means? For example: if some object is used in constellation then you must show only constellation but not original object. + // And at this step we are checking that relations. +nl_clean_loop: + + if(node_list.size() > 1) + { + // walk thru all nodes + for(std::list::iterator nl_it = node_list.begin(); nl_it != node_list.end(); nl_it++) + { + // and try to find them in another top nodes. + std::list::const_iterator next_it = nl_it; + + next_it++; + for(; next_it != node_list.end(); next_it++) + { + if((*next_it)->FindNode((*nl_it)->mName) != nullptr) + { + // if current top node(nl_it) found in another top node then erase it from node_list and restart search loop. + node_list.erase(nl_it); + + goto nl_clean_loop; + } + }// for(; next_it != node_list.end(); next_it++) + }// for(std::list::const_iterator nl_it = node_list.begin(); nl_it != node_list.end(); nl_it++) + } + + // + // move created objects to aiScene + // + // + // Nodes + if(node_list.size() > 0) + { + std::list::const_iterator nl_it = node_list.begin(); + + pScene->mRootNode->mNumChildren = node_list.size(); + pScene->mRootNode->mChildren = new aiNode*[pScene->mRootNode->mNumChildren]; + for(size_t i = 0; i < pScene->mRootNode->mNumChildren; i++) + { + // Objects and constellation that must be showed placed at top of hierarchy in node. So all aiNode's in node_list must have + // mRootNode only as parent. + (*nl_it)->mParent = pScene->mRootNode; + pScene->mRootNode->mChildren[i] = *nl_it++; + } + }// if(node_list.size() > 0) + + // + // Meshes + if(mesh_list.size() > 0) + { + std::list::const_iterator ml_it = mesh_list.begin(); + + pScene->mNumMeshes = mesh_list.size(); + pScene->mMeshes = new aiMesh*[pScene->mNumMeshes]; + for(size_t i = 0; i < pScene->mNumMeshes; i++) pScene->mMeshes[i] = *ml_it++; + }// if(mesh_list.size() > 0) + + // + // Textures + pScene->mNumTextures = mTexture_Converted.size(); + if(pScene->mNumTextures > 0) + { + size_t idx; + + idx = 0; + pScene->mTextures = new aiTexture*[pScene->mNumTextures]; + for(const SPP_Texture& tex_convd: mTexture_Converted) + { + pScene->mTextures[idx] = new aiTexture; + pScene->mTextures[idx]->mWidth = tex_convd.Width; + pScene->mTextures[idx]->mHeight = tex_convd.Height; + pScene->mTextures[idx]->pcData = (aiTexel*)tex_convd.Data; + // texture format description. + strcpy(pScene->mTextures[idx]->achFormatHint, tex_convd.FormatHint); + idx++; + }// for(const SPP_Texture& tex_convd: mTexture_Converted) + + // Create materials for embedded textures. + idx = 0; + pScene->mNumMaterials = mTexture_Converted.size(); + pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials]; + for(const SPP_Texture& tex_convd: mTexture_Converted) + { + const aiString texture_id(AI_EMBEDDED_TEXNAME_PREFIX + to_string(idx)); + const int mode = aiTextureOp_Multiply; + const int repeat = tex_convd.Tiled ? 1 : 0; + + pScene->mMaterials[idx] = new aiMaterial; + pScene->mMaterials[idx]->AddProperty(&texture_id, AI_MATKEY_TEXTURE_DIFFUSE(0)); + pScene->mMaterials[idx]->AddProperty(&mode, 1, AI_MATKEY_TEXOP_DIFFUSE(0)); + pScene->mMaterials[idx]->AddProperty(&repeat, 1, AI_MATKEY_MAPPINGMODE_U_DIFFUSE(0)); + pScene->mMaterials[idx]->AddProperty(&repeat, 1, AI_MATKEY_MAPPINGMODE_V_DIFFUSE(0)); + idx++; + } + }// if(pScene->mNumTextures > 0) +}// END: after that walk thru children of root and collect data + +}// namespace Assimp + +#endif // !ASSIMP_BUILD_NO_AMF_IMPORTER diff --git a/code/ASEParser.cpp b/code/ASEParser.cpp index d34da2578..3b3b696e5 100644 --- a/code/ASEParser.cpp +++ b/code/ASEParser.cpp @@ -618,7 +618,8 @@ void Parser::ParseLV2MaterialBlock(ASE::Material& mat) if (TokenMatch(filePtr,"MATERIAL_TRANSPARENCY",21)) { ParseLV4MeshFloat(mat.mTransparency); - mat.mTransparency = 1.0 - mat.mTransparency;continue; + mat.mTransparency = ai_real( 1.0 ) - mat.mTransparency; + continue; } // material self illumination if (TokenMatch(filePtr,"MATERIAL_SELFILLUM",18)) diff --git a/code/AssimpCExport.cpp b/code/AssimpCExport.cpp index c5f26fc47..fff9d8e21 100644 --- a/code/AssimpCExport.cpp +++ b/code/AssimpCExport.cpp @@ -70,11 +70,11 @@ ASSIMP_API const aiExportFormatDesc* aiGetExportFormatDescription( size_t index) } aiExportFormatDesc *desc = new aiExportFormatDesc; - desc->description = new char[ strlen( orig->description ) + 1 ]; + desc->description = new char[ strlen( orig->description ) + 1 ](); ::strncpy( (char*) desc->description, orig->description, strlen( orig->description ) ); - desc->fileExtension = new char[ strlen( orig->fileExtension ) + 1 ]; + desc->fileExtension = new char[ strlen( orig->fileExtension ) + 1 ](); ::strncpy( ( char* ) desc->fileExtension, orig->fileExtension, strlen( orig->fileExtension ) ); - desc->id = new char[ strlen( orig->id ) + 1 ]; + desc->id = new char[ strlen( orig->id ) + 1 ](); ::strncpy( ( char* ) desc->id, orig->id, strlen( orig->id ) ); return desc; diff --git a/code/AssxmlExporter.cpp b/code/AssxmlExporter.cpp index 5bd174cce..e236df664 100644 --- a/code/AssxmlExporter.cpp +++ b/code/AssxmlExporter.cpp @@ -299,7 +299,7 @@ void WriteDump(const aiScene* scene, IOStream* io, bool shortened) { else if (!shortened){ ioprintf(io,"\t\t \n",tex->mWidth*tex->mHeight*4); - // const unsigned int width = (unsigned int)log10((double)std::max(tex->mHeight,tex->mWidth))+1; + // const unsigned int width = (unsigned int)std::log10((double)std::max(tex->mHeight,tex->mWidth))+1; for (unsigned int y = 0; y < tex->mHeight;++y) { for (unsigned int x = 0; x < tex->mWidth;++x) { aiTexel* tx = tex->pcData + y*tex->mWidth+x; @@ -457,7 +457,7 @@ void WriteDump(const aiScene* scene, IOStream* io, bool shortened) { ioprintf(io,"\n",scene->mNumMeshes); for (unsigned int i = 0; i < scene->mNumMeshes;++i) { aiMesh* mesh = scene->mMeshes[i]; - // const unsigned int width = (unsigned int)log10((double)mesh->mNumVertices)+1; + // const unsigned int width = (unsigned int)std::log10((double)mesh->mNumVertices)+1; // mesh header ioprintf(io,"\t\n", diff --git a/code/BaseImporter.cpp b/code/BaseImporter.cpp index aa615e592..ca5264d3d 100644 --- a/code/BaseImporter.cpp +++ b/code/BaseImporter.cpp @@ -481,7 +481,7 @@ namespace Assimp BatchLoader::PropertyMap map; unsigned int id; - bool operator== (const std::string& f) { + bool operator== (const std::string& f) const { return file == f; } }; @@ -489,13 +489,22 @@ namespace Assimp // ------------------------------------------------------------------------------------------------ // BatchLoader::pimpl data structure -struct Assimp::BatchData -{ - BatchData() - : pIOSystem() - , pImporter() - , next_id(0xffff) - {} +struct Assimp::BatchData { + BatchData( IOSystem* pIO, bool validate ) + : pIOSystem( pIO ) + , pImporter( nullptr ) + , next_id(0xffff) + , validate( validate ) { + ai_assert( NULL != pIO ); + + pImporter = new Importer(); + pImporter->SetIOHandler( pIO ); + } + + ~BatchData() { + pImporter->SetIOHandler( NULL ); /* get pointer back into our possession */ + delete pImporter; + } // IO system to be used for all imports IOSystem* pIOSystem; @@ -511,53 +520,59 @@ struct Assimp::BatchData // Id for next item unsigned int next_id; + + // Validation enabled state + bool validate; }; +typedef std::list::iterator LoadReqIt; + // ------------------------------------------------------------------------------------------------ -BatchLoader::BatchLoader(IOSystem* pIO) +BatchLoader::BatchLoader(IOSystem* pIO, bool validate ) { ai_assert(NULL != pIO); - data = new BatchData(); - data->pIOSystem = pIO; - - data->pImporter = new Importer(); - data->pImporter->SetIOHandler(data->pIOSystem); + m_data = new BatchData( pIO, validate ); } // ------------------------------------------------------------------------------------------------ BatchLoader::~BatchLoader() { - // delete all scenes wthat have not been polled by the user - for (std::list::iterator it = data->requests.begin();it != data->requests.end(); ++it) { - + // delete all scenes what have not been polled by the user + for ( LoadReqIt it = m_data->requests.begin();it != m_data->requests.end(); ++it) { delete (*it).scene; } - data->pImporter->SetIOHandler(NULL); /* get pointer back into our possession */ - delete data->pImporter; - delete data; + delete m_data; } +// ------------------------------------------------------------------------------------------------ +void BatchLoader::setValidation( bool enabled ) { + m_data->validate = enabled; +} // ------------------------------------------------------------------------------------------------ -unsigned int BatchLoader::AddLoadRequest (const std::string& file, +bool BatchLoader::getValidation() const { + return m_data->validate; +} + +// ------------------------------------------------------------------------------------------------ +unsigned int BatchLoader::AddLoadRequest(const std::string& file, unsigned int steps /*= 0*/, const PropertyMap* map /*= NULL*/) { ai_assert(!file.empty()); // check whether we have this loading request already - std::list::iterator it; - for (it = data->requests.begin();it != data->requests.end(); ++it) { - + for ( LoadReqIt it = m_data->requests.begin();it != m_data->requests.end(); ++it) { // Call IOSystem's path comparison function here - if (data->pIOSystem->ComparePaths((*it).file,file)) { - + if ( m_data->pIOSystem->ComparePaths((*it).file,file)) { if (map) { - if (!((*it).map == *map)) + if ( !( ( *it ).map == *map ) ) { continue; + } } - else if (!(*it).map.empty()) + else if ( !( *it ).map.empty() ) { continue; + } (*it).refCnt++; return (*it).id; @@ -565,20 +580,18 @@ unsigned int BatchLoader::AddLoadRequest (const std::string& file, } // no, we don't have it. So add it to the queue ... - data->requests.push_back(LoadRequest(file,steps,map,data->next_id)); - return data->next_id++; + m_data->requests.push_back(LoadRequest(file,steps,map, m_data->next_id)); + return m_data->next_id++; } // ------------------------------------------------------------------------------------------------ -aiScene* BatchLoader::GetImport (unsigned int which) +aiScene* BatchLoader::GetImport( unsigned int which ) { - for (std::list::iterator it = data->requests.begin();it != data->requests.end(); ++it) { - + for ( LoadReqIt it = m_data->requests.begin();it != m_data->requests.end(); ++it) { if ((*it).id == which && (*it).loaded) { - aiScene* sc = (*it).scene; if (!(--(*it).refCnt)) { - data->requests.erase(it); + m_data->requests.erase(it); } return sc; } @@ -590,14 +603,15 @@ aiScene* BatchLoader::GetImport (unsigned int which) void BatchLoader::LoadAll() { // no threaded implementation for the moment - for (std::list::iterator it = data->requests.begin();it != data->requests.end(); ++it) { + for ( LoadReqIt it = m_data->requests.begin();it != m_data->requests.end(); ++it) { // force validation in debug builds unsigned int pp = (*it).flags; -#ifdef ASSIMP_BUILD_DEBUG - pp |= aiProcess_ValidateDataStructure; -#endif + if ( m_data->validate ) { + pp |= aiProcess_ValidateDataStructure; + } + // setup config properties if necessary - ImporterPimpl* pimpl = data->pImporter->Pimpl(); + ImporterPimpl* pimpl = m_data->pImporter->Pimpl(); pimpl->mFloatProperties = (*it).map.floats; pimpl->mIntProperties = (*it).map.ints; pimpl->mStringProperties = (*it).map.strings; @@ -608,8 +622,8 @@ void BatchLoader::LoadAll() DefaultLogger::get()->info("%%% BEGIN EXTERNAL FILE %%%"); DefaultLogger::get()->info("File: " + (*it).file); } - data->pImporter->ReadFile((*it).file,pp); - (*it).scene = data->pImporter->GetOrphanedScene(); + m_data->pImporter->ReadFile((*it).file,pp); + (*it).scene = m_data->pImporter->GetOrphanedScene(); (*it).loaded = true; DefaultLogger::get()->info("%%% END EXTERNAL FILE %%%"); diff --git a/code/BaseImporter.h b/code/BaseImporter.h index 5c9ddfa5e..7c8932a3f 100644 --- a/code/BaseImporter.h +++ b/code/BaseImporter.h @@ -347,7 +347,12 @@ public: // static utilities static void ConvertUTF8toISO8859_1( std::string& data); - enum TextFileMode { ALLOW_EMPTY, FORBID_EMPTY }; + // ------------------------------------------------------------------- + /// @brief Enum to define, if empty files are ok or not. + enum TextFileMode { + ALLOW_EMPTY, + FORBID_EMPTY + }; // ------------------------------------------------------------------- /** Utility for text file loaders which copies the contents of the @@ -382,14 +387,10 @@ public: // static utilities } } - - protected: - - /** Error description in case there was one. */ + /// Error description in case there was one. std::string m_ErrorText; - - /** Currently set progress handler */ + /// Currently set progress handler. ProgressHandler* m_progress; }; diff --git a/code/BlenderDNA.cpp b/code/BlenderDNA.cpp index 19d08a590..e8f335bce 100644 --- a/code/BlenderDNA.cpp +++ b/code/BlenderDNA.cpp @@ -56,10 +56,10 @@ using namespace Assimp::Formatter; static bool match4(StreamReaderAny& stream, const char* string) { ai_assert( nullptr != string ); char tmp[] = { - (stream).GetI1(), - (stream).GetI1(), - (stream).GetI1(), - (stream).GetI1() + (const char)(stream).GetI1(), + (const char)(stream).GetI1(), + (const char)(stream).GetI1(), + (const char)(stream).GetI1() }; return (tmp[0]==string[0] && tmp[1]==string[1] && tmp[2]==string[2] && tmp[3]==string[3]); } @@ -346,10 +346,10 @@ void SectionParser :: Next() stream.SetCurrentPos(current.start + current.size); const char tmp[] = { - stream.GetI1(), - stream.GetI1(), - stream.GetI1(), - stream.GetI1() + (const char)stream.GetI1(), + (const char)stream.GetI1(), + (const char)stream.GetI1(), + (const char)stream.GetI1() }; current.id = std::string(tmp,tmp[3]?4:tmp[2]?3:tmp[1]?2:1); diff --git a/code/BlenderLoader.cpp b/code/BlenderLoader.cpp index dd9ebec38..a3810a3a1 100644 --- a/code/BlenderLoader.cpp +++ b/code/BlenderLoader.cpp @@ -1145,7 +1145,7 @@ aiCamera* BlenderImporter::ConvertCamera(const Scene& /*in*/, const Object* obj, out->mUp = aiVector3D(0.f, 1.f, 0.f); out->mLookAt = aiVector3D(0.f, 0.f, -1.f); if (cam->sensor_x && cam->lens) { - out->mHorizontalFOV = atan2(cam->sensor_x, 2.f * cam->lens); + out->mHorizontalFOV = std::atan2(cam->sensor_x, 2.f * cam->lens); } out->mClipPlaneNear = cam->clipsta; out->mClipPlaneFar = cam->clipend; diff --git a/code/BlenderLoader.h b/code/BlenderLoader.h index c964eee32..505409260 100644 --- a/code/BlenderLoader.h +++ b/code/BlenderLoader.h @@ -105,7 +105,6 @@ public: BlenderImporter(); ~BlenderImporter(); - public: // -------------------- diff --git a/code/BlenderScene.cpp b/code/BlenderScene.cpp index 8d6e96eb5..70b0c108f 100644 --- a/code/BlenderScene.cpp +++ b/code/BlenderScene.cpp @@ -806,4 +806,4 @@ void DNA::RegisterConverters() { } -#endif ASSIMP_BUILD_NO_BLEND_IMPORTER +#endif // ASSIMP_BUILD_NO_BLEND_IMPORTER diff --git a/code/BlenderScene.h b/code/BlenderScene.h index 4f4ed81cc..04eb4bcad 100644 --- a/code/BlenderScene.h +++ b/code/BlenderScene.h @@ -91,8 +91,17 @@ namespace Blender { // value for the field. // -#define WARN // warn if field is missing, substitute default value -#define FAIL // fail the import if the field does not exist +// warn if field is missing, substitute default value +#ifdef WARN +# undef WARN +#endif +#define WARN + +// fail the import if the field does not exist +#ifdef FAIL +# undef FAIL +#endif +#define FAIL struct Object; struct MTex; diff --git a/code/CInterfaceIOWrapper.cpp b/code/CInterfaceIOWrapper.cpp new file mode 100644 index 000000000..0a80c1990 --- /dev/null +++ b/code/CInterfaceIOWrapper.cpp @@ -0,0 +1,134 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +/** @file aiFileIO -> IOSystem wrapper*/ + +#include "CInterfaceIOWrapper.h" + +namespace Assimp { + +CIOStreamWrapper::~CIOStreamWrapper(void) +{ + /* Various places depend on this destructor to close the file */ + if (mFile) { + mIO->mFileSystem->CloseProc(mIO->mFileSystem, mFile); + mFile = nullptr; + } +} + +// ................................................................... +size_t CIOStreamWrapper::Read(void* pvBuffer, + size_t pSize, + size_t pCount +){ + // need to typecast here as C has no void* + return mFile->ReadProc(mFile,(char*)pvBuffer,pSize,pCount); +} + +// ................................................................... +size_t CIOStreamWrapper::Write(const void* pvBuffer, + size_t pSize, + size_t pCount +){ + // need to typecast here as C has no void* + return mFile->WriteProc(mFile,(const char*)pvBuffer,pSize,pCount); +} + +// ................................................................... +aiReturn CIOStreamWrapper::Seek(size_t pOffset, + aiOrigin pOrigin +){ + return mFile->SeekProc(mFile,pOffset,pOrigin); +} + +// ................................................................... +size_t CIOStreamWrapper::Tell(void) const { + return mFile->TellProc(mFile); +} + +// ................................................................... +size_t CIOStreamWrapper::FileSize() const { + return mFile->FileSizeProc(mFile); +} + +// ................................................................... +void CIOStreamWrapper::Flush () { + return mFile->FlushProc(mFile); +} + +// ------------------------------------------------------------------------------------------------ +// Custom IOStream implementation for the C-API +bool CIOSystemWrapper::Exists( const char* pFile) const { + aiFile* p = mFileSystem->OpenProc(mFileSystem,pFile,"rb"); + if (p){ + mFileSystem->CloseProc(mFileSystem,p); + return true; + } + return false; +} + +// ................................................................... +char CIOSystemWrapper::getOsSeparator() const { +#ifndef _WIN32 + return '/'; +#else + return '\\'; +#endif +} + +// ................................................................... +IOStream* CIOSystemWrapper::Open(const char* pFile,const char* pMode) { + aiFile* p = mFileSystem->OpenProc(mFileSystem,pFile,pMode); + if (!p) { + return NULL; + } + return new CIOStreamWrapper(p, this); +} + +// ................................................................... +void CIOSystemWrapper::Close( IOStream* pFile) { + if (!pFile) { + return; + } + delete pFile; +} + +} diff --git a/code/CInterfaceIOWrapper.h b/code/CInterfaceIOWrapper.h index beffd8678..0172fb49f 100644 --- a/code/CInterfaceIOWrapper.h +++ b/code/CInterfaceIOWrapper.h @@ -50,106 +50,43 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace Assimp { +class CIOSystemWrapper; + // ------------------------------------------------------------------------------------------------ // Custom IOStream implementation for the C-API class CIOStreamWrapper : public IOStream { - friend class CIOSystemWrapper; public: - - explicit CIOStreamWrapper(aiFile* pFile) - : mFile(pFile) + explicit CIOStreamWrapper(aiFile* pFile, CIOSystemWrapper* io) + : mFile(pFile), + mIO(io) {} + ~CIOStreamWrapper(void); - // ................................................................... - size_t Read(void* pvBuffer, - size_t pSize, - size_t pCount - ){ - // need to typecast here as C has no void* - return mFile->ReadProc(mFile,(char*)pvBuffer,pSize,pCount); - } - - // ................................................................... - size_t Write(const void* pvBuffer, - size_t pSize, - size_t pCount - ){ - // need to typecast here as C has no void* - return mFile->WriteProc(mFile,(const char*)pvBuffer,pSize,pCount); - } - - // ................................................................... - aiReturn Seek(size_t pOffset, - aiOrigin pOrigin - ){ - return mFile->SeekProc(mFile,pOffset,pOrigin); - } - - // ................................................................... - size_t Tell(void) const { - return mFile->TellProc(mFile); - } - - // ................................................................... - size_t FileSize() const { - return mFile->FileSizeProc(mFile); - } - - // ................................................................... - void Flush () { - return mFile->FlushProc(mFile); - } + size_t Read(void* pvBuffer, size_t pSize, size_t pCount); + size_t Write(const void* pvBuffer, size_t pSize, size_t pCount); + aiReturn Seek(size_t pOffset, aiOrigin pOrigin); + size_t Tell(void) const; + size_t FileSize() const; + void Flush(); private: aiFile* mFile; + CIOSystemWrapper* mIO; }; -// ------------------------------------------------------------------------------------------------ -// Custom IOStream implementation for the C-API class CIOSystemWrapper : public IOSystem { + friend class CIOStreamWrapper; public: explicit CIOSystemWrapper(aiFileIO* pFile) : mFileSystem(pFile) {} - // ................................................................... - bool Exists( const char* pFile) const { - aiFile* p = mFileSystem->OpenProc(mFileSystem,pFile,"rb"); - if (p){ - mFileSystem->CloseProc(mFileSystem,p); - return true; - } - return false; - } - - // ................................................................... - char getOsSeparator() const { -#ifndef _WIN32 - return '/'; -#else - return '\\'; -#endif - } - - // ................................................................... - IOStream* Open(const char* pFile,const char* pMode = "rb") { - aiFile* p = mFileSystem->OpenProc(mFileSystem,pFile,pMode); - if (!p) { - return NULL; - } - return new CIOStreamWrapper(p); - } - - // ................................................................... - void Close( IOStream* pFile) { - if (!pFile) { - return; - } - mFileSystem->CloseProc(mFileSystem,((CIOStreamWrapper*) pFile)->mFile); - delete pFile; - } + bool Exists( const char* pFile) const; + char getOsSeparator() const; + IOStream* Open(const char* pFile,const char* pMode = "rb"); + void Close( IOStream* pFile); private: aiFileIO* mFileSystem; }; diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 8b3d23773..7f42d9ee7 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -128,6 +128,7 @@ SET( Common_SRCS DefaultIOStream.h DefaultIOSystem.cpp DefaultIOSystem.h + CInterfaceIOWrapper.cpp CInterfaceIOWrapper.h Hash.h Importer.cpp @@ -171,6 +172,7 @@ SET( Common_SRCS Bitmap.h XMLTools.h Version.cpp + IOStreamBuffer.h ) SOURCE_GROUP(Common FILES ${Common_SRCS}) @@ -202,6 +204,16 @@ SET(ASSIMP_LOADER_SRCS "") SET(ASSIMP_IMPORTERS_ENABLED "") # list of enabled importers SET(ASSIMP_IMPORTERS_DISABLED "") # disabled list (used to print) +ADD_ASSIMP_IMPORTER( AMF + AMFImporter.hpp + AMFImporter_Macro.hpp + AMFImporter_Node.hpp + AMFImporter.cpp + AMFImporter_Geometry.cpp + AMFImporter_Material.cpp + AMFImporter_Postprocess.cpp +) + ADD_ASSIMP_IMPORTER( 3DS 3DSConverter.cpp 3DSHelper.h @@ -433,7 +445,8 @@ ADD_ASSIMP_IMPORTER( BLEND ADD_ASSIMP_IMPORTER( IFC IFCLoader.cpp IFCLoader.h - IFCReaderGen.cpp + IFCReaderGen1.cpp + IFCReaderGen2.cpp IFCReaderGen.h IFCUtil.h IFCUtil.cpp @@ -450,7 +463,7 @@ ADD_ASSIMP_IMPORTER( IFC STEPFileEncoding.h ) if (MSVC AND ASSIMP_BUILD_IFC_IMPORTER) - set_source_files_properties(IFCReaderGen.cpp PROPERTIES COMPILE_FLAGS "/bigobj") + set_source_files_properties(IFCReaderGen1.cpp IFCReaderGen2.cpp PROPERTIES COMPILE_FLAGS "/bigobj") endif (MSVC AND ASSIMP_BUILD_IFC_IMPORTER) ADD_ASSIMP_IMPORTER( XGL @@ -599,6 +612,25 @@ ADD_ASSIMP_IMPORTER( X XFileExporter.cpp ) +ADD_ASSIMP_IMPORTER(X3D + X3DExporter.cpp + X3DExporter.hpp + X3DImporter.cpp + X3DImporter.hpp + X3DImporter_Geometry2D.cpp + X3DImporter_Geometry3D.cpp + X3DImporter_Group.cpp + X3DImporter_Light.cpp + X3DImporter_Macro.hpp + X3DImporter_Metadata.cpp + X3DImporter_Networking.cpp + X3DImporter_Node.hpp + X3DImporter_Postprocess.cpp + X3DImporter_Rendering.cpp + X3DImporter_Shape.cpp + X3DImporter_Texturing.cpp +) + ADD_ASSIMP_IMPORTER( GLTF glTFAsset.h glTFAsset.inl @@ -699,7 +731,54 @@ SET ( openddl_parser_SRCS ) SOURCE_GROUP( openddl_parser FILES ${openddl_parser_SRCS}) +SET ( open3dgc_SRCS + ../contrib/Open3DGC/o3dgcAdjacencyInfo.h + ../contrib/Open3DGC/o3dgcArithmeticCodec.cpp + ../contrib/Open3DGC/o3dgcArithmeticCodec.h + ../contrib/Open3DGC/o3dgcBinaryStream.h + ../contrib/Open3DGC/o3dgcCommon.h + ../contrib/Open3DGC/o3dgcDVEncodeParams.h + ../contrib/Open3DGC/o3dgcDynamicVectorDecoder.cpp + ../contrib/Open3DGC/o3dgcDynamicVectorDecoder.h + ../contrib/Open3DGC/o3dgcDynamicVectorEncoder.cpp + ../contrib/Open3DGC/o3dgcDynamicVectorEncoder.h + ../contrib/Open3DGC/o3dgcDynamicVector.h + ../contrib/Open3DGC/o3dgcFIFO.h + ../contrib/Open3DGC/o3dgcIndexedFaceSet.h + ../contrib/Open3DGC/o3dgcIndexedFaceSet.inl + ../contrib/Open3DGC/o3dgcSC3DMCDecoder.h + ../contrib/Open3DGC/o3dgcSC3DMCDecoder.inl + ../contrib/Open3DGC/o3dgcSC3DMCEncodeParams.h + ../contrib/Open3DGC/o3dgcSC3DMCEncoder.h + ../contrib/Open3DGC/o3dgcSC3DMCEncoder.inl + ../contrib/Open3DGC/o3dgcTimer.h + ../contrib/Open3DGC/o3dgcTools.cpp + ../contrib/Open3DGC/o3dgcTriangleFans.cpp + ../contrib/Open3DGC/o3dgcTriangleFans.h + ../contrib/Open3DGC/o3dgcTriangleListDecoder.h + ../contrib/Open3DGC/o3dgcTriangleListDecoder.inl + ../contrib/Open3DGC/o3dgcTriangleListEncoder.h + ../contrib/Open3DGC/o3dgcTriangleListEncoder.inl + ../contrib/Open3DGC/o3dgcVector.h + ../contrib/Open3DGC/o3dgcVector.inl +) +SOURCE_GROUP( open3dgc FILES ${open3dgc_SRCS}) + +# Check dependencies for glTF importer with Open3DGC-compression. +# RT-extensions is used in "contrib/Open3DGC/o3dgcTimer.h" for collecting statistics. Pointed file +# has implementation for different platforms: WIN32, __MACH__ and other ("else" block). +FIND_PACKAGE(RT QUIET) +IF (RT_FOUND OR MSVC) + SET( ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC 1 ) + ADD_DEFINITIONS( -DASSIMP_IMPORTER_GLTF_USE_OPEN3DGC=1 ) +ELSE () + SET (open3dgc_SRCS "") + MESSAGE (INFO " RT-extension not found. glTF import/export will be built without Open3DGC-compression.") + #!TODO: off course is better to remove statistics timers from o3dgc codec. Or propose to choose what to use. +ENDIF () + INCLUDE_DIRECTORIES( "../contrib/rapidjson/include" ) +INCLUDE_DIRECTORIES( "../contrib" ) # VC2010 fixes if(MSVC10) @@ -746,6 +825,7 @@ SET( assimp_src ${Poly2Tri_SRCS} ${Clipper_SRCS} ${openddl_parser_SRCS} + ${open3dgc_SRCS} # Necessary to show the headers in the project when using the VC++ generator: ${PUBLIC_HEADERS} @@ -820,6 +900,11 @@ else (UNZIP_FOUND) INCLUDE_DIRECTORIES("../") endif (UNZIP_FOUND) +# Add RT-extension library for glTF importer with Open3DGC-compression. +IF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC) + TARGET_LINK_LIBRARIES(assimp ${RT_LIBRARY}) +ENDIF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC) + INSTALL( TARGETS assimp LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR} ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR} @@ -843,3 +928,15 @@ if(MSVC AND ASSIMP_INSTALL_PDB) CONFIGURATIONS RelWithDebInfo ) endif () + +if (ASSIMP_COVERALLS) + include(Coveralls) + + set(COVERAGE_SRCS ${assimp_src} ${TEST_SRCS} ) + + # Create the coveralls target. + coveralls_setup( + "${COVERAGE_SRCS}" # The source files. + ON # If we should upload. + "${PROJECT_SOURCE_DIR}/cmake-modules/") # (Optional) Alternate project cmake module path. +endif() diff --git a/code/CalcTangentsProcess.cpp b/code/CalcTangentsProcess.cpp index dbba1bed3..c13ffcb24 100644 --- a/code/CalcTangentsProcess.cpp +++ b/code/CalcTangentsProcess.cpp @@ -256,7 +256,7 @@ bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex) } std::vector verticesFound; - const float fLimit = cosf(configMaxAngle); + const float fLimit = std::cos(configMaxAngle); std::vector closeVertices; // in the second pass we now smooth out all tangents and bitangents at the same local position diff --git a/code/ColladaExporter.cpp b/code/ColladaExporter.cpp index 48629ce05..fdb31903f 100644 --- a/code/ColladaExporter.cpp +++ b/code/ColladaExporter.cpp @@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "fast_atof.h" #include "SceneCombiner.h" #include "DefaultIOSystem.h" +#include "StringUtils.h" #include "XMLTools.h" #include #include @@ -149,7 +150,7 @@ void ColladaExporter::WriteFile() // Writes the asset header void ColladaExporter::WriteHeader() { - static const ai_real epsilon = 0.00001; + static const ai_real epsilon = ai_real( 0.00001 ); static const aiQuaternion x_rot(aiMatrix3x3( 0, -1, 0, 1, 0, 0, @@ -635,9 +636,24 @@ void ColladaExporter::WriteMaterials() const aiMaterial* mat = mScene->mMaterials[a]; aiString name; - if( mat->Get( AI_MATKEY_NAME, name) != aiReturn_SUCCESS ) + if( mat->Get( AI_MATKEY_NAME, name) != aiReturn_SUCCESS ) { name = "mat"; - materials[a].name = std::string( "m") + std::to_string(a) + name.C_Str(); + materials[a].name = std::string( "m") + to_string(a) + name.C_Str(); + } else { + // try to use the material's name if no other material has already taken it, else append # + std::string testName = name.C_Str(); + size_t materialCountWithThisName = 0; + for( size_t i = 0; i < a; i ++ ) { + if( materials[i].name == testName ) { + materialCountWithThisName ++; + } + } + if( materialCountWithThisName == 0 ) { + materials[a].name = name.C_Str(); + } else { + materials[a].name = std::string(name.C_Str()) + to_string(materialCountWithThisName); + } + } for( std::string::iterator it = materials[a].name.begin(); it != materials[a].name.end(); ++it ) { if( !isalnum_C( *it ) ) { *it = '_'; @@ -813,7 +829,7 @@ void ColladaExporter::WriteGeometry( size_t pIndex) { if( mesh->HasTextureCoords( a) ) { - WriteFloatArray( idstr + "-tex" + std::to_string(a), mesh->mNumUVComponents[a] == 3 ? FloatType_TexCoord3 : FloatType_TexCoord2, + WriteFloatArray( idstr + "-tex" + to_string(a), mesh->mNumUVComponents[a] == 3 ? FloatType_TexCoord3 : FloatType_TexCoord2, (ai_real*) mesh->mTextureCoords[a], mesh->mNumVertices); } } @@ -822,7 +838,7 @@ void ColladaExporter::WriteGeometry( size_t pIndex) for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) { if( mesh->HasVertexColors( a) ) - WriteFloatArray( idstr + "-color" + std::to_string(a), FloatType_Color, (ai_real*) mesh->mColors[a], mesh->mNumVertices); + WriteFloatArray( idstr + "-color" + to_string(a), FloatType_Color, (ai_real*) mesh->mColors[a], mesh->mNumVertices); } // assemble vertex structure diff --git a/code/ColladaExporter.h b/code/ColladaExporter.h index ffb841b0e..e8bd9b71f 100644 --- a/code/ColladaExporter.h +++ b/code/ColladaExporter.h @@ -53,6 +53,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include "StringUtils.h" + struct aiScene; struct aiNode; @@ -122,7 +124,9 @@ protected: void PopTag() { ai_assert( startstr.length() > 1); startstr.erase( startstr.length() - 2); } /// Creates a mesh ID for the given mesh - std::string GetMeshId( size_t pIndex) const { return std::string( "meshId" ) + std::to_string(pIndex); } + std::string GetMeshId( size_t pIndex) const { + return std::string( "meshId" ) + to_string(pIndex); + } public: /// Stringstream to write all output into diff --git a/code/ColladaLoader.cpp b/code/ColladaLoader.cpp index 04fcfd507..81a43754e 100644 --- a/code/ColladaLoader.cpp +++ b/code/ColladaLoader.cpp @@ -420,13 +420,13 @@ void ColladaLoader::BuildCamerasForNode( const ColladaParser& pParser, const Col out->mHorizontalFOV = srcCamera->mHorFov; if (srcCamera->mVerFov != 10e10f && srcCamera->mAspect == 10e10f) { - out->mAspect = tan(AI_DEG_TO_RAD(srcCamera->mHorFov)) / - tan(AI_DEG_TO_RAD(srcCamera->mVerFov)); + out->mAspect = std::tan(AI_DEG_TO_RAD(srcCamera->mHorFov)) / + std::tan(AI_DEG_TO_RAD(srcCamera->mVerFov)); } } else if (srcCamera->mAspect != 10e10f && srcCamera->mVerFov != 10e10f) { - out->mHorizontalFOV = 2.0f * AI_RAD_TO_DEG(atan(srcCamera->mAspect * - tan(AI_DEG_TO_RAD(srcCamera->mVerFov) * 0.5f))); + out->mHorizontalFOV = 2.0f * AI_RAD_TO_DEG(std::atan(srcCamera->mAspect * + std::tan(AI_DEG_TO_RAD(srcCamera->mVerFov) * 0.5f))); } // Collada uses degrees, we use radians @@ -1071,7 +1071,7 @@ void ColladaLoader::CreateAnimation( aiScene* pScene, const ColladaParser& pPars continue; // resolve the data pointers for all anim channels. Find the minimum time while we're at it - ai_real startTime = 1e20, endTime = -1e20; + ai_real startTime = ai_real( 1e20 ), endTime = ai_real( -1e20 ); for( std::vector::iterator it = entries.begin(); it != entries.end(); ++it) { Collada::ChannelEntry& e = *it; @@ -1152,7 +1152,7 @@ void ColladaLoader::CreateAnimation( aiScene* pScene, const ColladaParser& pPars resultTrafos.push_back( mat); // find next point in time to evaluate. That's the closest frame larger than the current in any channel - ai_real nextTime = 1e20; + ai_real nextTime = ai_real( 1e20 ); for( std::vector::iterator it = entries.begin(); it != entries.end(); ++it) { Collada::ChannelEntry& channelElement = *it; @@ -1181,7 +1181,7 @@ void ColladaLoader::CreateAnimation( aiScene* pScene, const ColladaParser& pPars const ai_real last_eval_angle = last_key_angle + (cur_key_angle - last_key_angle) * (time - last_key_time) / (cur_key_time - last_key_time); const ai_real delta = std::abs(cur_key_angle - last_eval_angle); if (delta >= 180.0) { - const int subSampleCount = static_cast(floorf(delta / 90.0)); + const int subSampleCount = static_cast(std::floor(delta / 90.0)); if (cur_key_time != time) { const ai_real nextSampleTime = time + (cur_key_time - time) / subSampleCount; nextTime = std::min(nextTime, nextSampleTime); diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index 4fb30675f..1fd762e40 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -300,7 +300,7 @@ void ColladaParser::ReadAnimationClipLibrary() else if (indexID >= 0) animName = mReader->getAttributeValue(indexID); else - animName = std::string("animation_") + std::to_string(mAnimationClipLibrary.size()); + animName = std::string("animation_") + to_string(mAnimationClipLibrary.size()); std::pair > clip; @@ -3075,7 +3075,7 @@ aiMatrix4x4 ColladaParser::CalculateResultTransform( const std::vectormNumFaces;++fidx) { @@ -206,7 +206,7 @@ void ComputeUVMappingProcess::ComputeSphereMapping(aiMesh* mesh,const aiVector3D // lon = arctan (y/x) for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) { const aiVector3D diff = (mesh->mVertices[pnt]-center).Normalize(); - out[pnt] = aiVector3D((atan2 (diff.z, diff.y) + AI_MATH_PI_F ) / AI_MATH_TWO_PI_F, + out[pnt] = aiVector3D((std::atan2(diff.z, diff.y) + AI_MATH_PI_F ) / AI_MATH_TWO_PI_F, (std::asin (diff.x) + AI_MATH_HALF_PI_F) / AI_MATH_PI_F, 0.0); } } @@ -214,7 +214,7 @@ void ComputeUVMappingProcess::ComputeSphereMapping(aiMesh* mesh,const aiVector3D // ... just the same again for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) { const aiVector3D diff = (mesh->mVertices[pnt]-center).Normalize(); - out[pnt] = aiVector3D((atan2 (diff.x, diff.z) + AI_MATH_PI_F ) / AI_MATH_TWO_PI_F, + out[pnt] = aiVector3D((std::atan2(diff.x, diff.z) + AI_MATH_PI_F ) / AI_MATH_TWO_PI_F, (std::asin (diff.y) + AI_MATH_HALF_PI_F) / AI_MATH_PI_F, 0.0); } } @@ -222,7 +222,7 @@ void ComputeUVMappingProcess::ComputeSphereMapping(aiMesh* mesh,const aiVector3D // ... just the same again for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) { const aiVector3D diff = (mesh->mVertices[pnt]-center).Normalize(); - out[pnt] = aiVector3D((atan2 (diff.y, diff.x) + AI_MATH_PI_F ) / AI_MATH_TWO_PI_F, + out[pnt] = aiVector3D((std::atan2(diff.y, diff.x) + AI_MATH_PI_F ) / AI_MATH_TWO_PI_F, (std::asin (diff.z) + AI_MATH_HALF_PI_F) / AI_MATH_PI_F, 0.0); } } @@ -234,8 +234,8 @@ void ComputeUVMappingProcess::ComputeSphereMapping(aiMesh* mesh,const aiVector3D // again the same, except we're applying a transformation now for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) { const aiVector3D diff = ((mTrafo*mesh->mVertices[pnt])-center).Normalize(); - out[pnt] = aiVector3D((atan2 (diff.y, diff.x) + AI_MATH_PI_F ) / AI_MATH_TWO_PI_F, - (asin (diff.z) + AI_MATH_HALF_PI_F) / AI_MATH_PI_F, 0.0); + out[pnt] = aiVector3D((std::atan2(diff.y, diff.x) + AI_MATH_PI_F ) / AI_MATH_TWO_PI_F, + (std::asin(diff.z) + AI_MATH_HALF_PI_F) / AI_MATH_PI_F, 0.0); } } @@ -268,7 +268,7 @@ void ComputeUVMappingProcess::ComputeCylinderMapping(aiMesh* mesh,const aiVector aiVector3D& uv = out[pnt]; uv.y = (pos.x - min.x) / diff; - uv.x = (atan2 ( pos.z - center.z, pos.y - center.y) +(ai_real)AI_MATH_PI ) / (ai_real)AI_MATH_TWO_PI; + uv.x = (std::atan2( pos.z - center.z, pos.y - center.y) +(ai_real)AI_MATH_PI ) / (ai_real)AI_MATH_TWO_PI; } } else if (axis * base_axis_y >= angle_epsilon) { @@ -281,7 +281,7 @@ void ComputeUVMappingProcess::ComputeCylinderMapping(aiMesh* mesh,const aiVector aiVector3D& uv = out[pnt]; uv.y = (pos.y - min.y) / diff; - uv.x = (atan2 ( pos.x - center.x, pos.z - center.z) +(ai_real)AI_MATH_PI ) / (ai_real)AI_MATH_TWO_PI; + uv.x = (std::atan2( pos.x - center.x, pos.z - center.z) +(ai_real)AI_MATH_PI ) / (ai_real)AI_MATH_TWO_PI; } } else if (axis * base_axis_z >= angle_epsilon) { @@ -294,7 +294,7 @@ void ComputeUVMappingProcess::ComputeCylinderMapping(aiMesh* mesh,const aiVector aiVector3D& uv = out[pnt]; uv.y = (pos.z - min.z) / diff; - uv.x = (atan2 ( pos.y - center.y, pos.x - center.x) +(ai_real)AI_MATH_PI ) / (ai_real)AI_MATH_TWO_PI; + uv.x = (std::atan2( pos.y - center.y, pos.x - center.x) +(ai_real)AI_MATH_PI ) / (ai_real)AI_MATH_TWO_PI; } } // slower code path in case the mapping axis is not one of the coordinate system axes @@ -310,7 +310,7 @@ void ComputeUVMappingProcess::ComputeCylinderMapping(aiMesh* mesh,const aiVector aiVector3D& uv = out[pnt]; uv.y = (pos.y - min.y) / diff; - uv.x = (atan2 ( pos.x - center.x, pos.z - center.z) +(ai_real)AI_MATH_PI ) / (ai_real)AI_MATH_TWO_PI; + uv.x = (std::atan2( pos.x - center.x, pos.z - center.z) +(ai_real)AI_MATH_PI ) / (ai_real)AI_MATH_TWO_PI; } } diff --git a/code/D3MFImporter.cpp b/code/D3MFImporter.cpp index 045138be1..e75b89f7e 100644 --- a/code/D3MFImporter.cpp +++ b/code/D3MFImporter.cpp @@ -44,8 +44,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include -#include "irrXMLWrapper.h" #include "StringComparison.h" #include "StringUtils.h" @@ -61,10 +59,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -#include "D3MFOpcPackage.h" - #ifndef ASSIMP_BUILD_NO_3MF_IMPORTER +#include "D3MFOpcPackage.h" +#include +#include "irrXMLWrapper.h" + namespace Assimp { namespace D3MF { @@ -113,7 +113,7 @@ public: std::vector children; while(ReadToEndElement(D3MF::XmlTag::model)) - { + { if(xmlReader->getNodeName() == D3MF::XmlTag::object) { @@ -123,7 +123,7 @@ public: { } - } + } if(scene->mRootNode->mName.length == 0) scene->mRootNode->mName.Set("3MF"); @@ -143,24 +143,31 @@ public: private: aiNode* ReadObject(aiScene* scene) - { + { ScopeGuard node(new aiNode()); std::vector meshIds; - int id = std::atoi(xmlReader->getAttributeValue(D3MF::XmlTag::id.c_str())); - std::string name(xmlReader->getAttributeValue(D3MF::XmlTag::name.c_str())); - std::string type(xmlReader->getAttributeValue(D3MF::XmlTag::type.c_str())); + const char *attrib( nullptr ); + std::string name, type; + attrib = xmlReader->getAttributeValue( D3MF::XmlTag::name.c_str() ); + if ( nullptr != attrib ) { + name = attrib; + } + attrib = xmlReader->getAttributeValue( D3MF::XmlTag::name.c_str() ); + if ( nullptr != attrib ) { + type = attrib; + } node->mParent = scene->mRootNode; - node->mName.Set(name); + node->mName.Set(name); - unsigned long meshIdx = meshes.size(); + size_t meshIdx = meshes.size(); while(ReadToEndElement(D3MF::XmlTag::object)) { if(xmlReader->getNodeName() == D3MF::XmlTag::mesh) - { + { auto mesh = ReadMesh(); mesh->mName.Set(name); @@ -186,7 +193,7 @@ private: aiMesh* mesh = new aiMesh(); while(ReadToEndElement(D3MF::XmlTag::mesh)) - { + { if(xmlReader->getNodeName() == D3MF::XmlTag::vertices) { ImportVertices(mesh); @@ -204,12 +211,12 @@ private: void ImportVertices(aiMesh* mesh) { - std::vector vertices; + std::vector vertices; while(ReadToEndElement(D3MF::XmlTag::vertices)) - { + { if(xmlReader->getNodeName() == D3MF::XmlTag::vertex) - { + { vertices.push_back(ReadVertex()); } } @@ -220,7 +227,7 @@ private: } aiVector3D ReadVertex() - { + { aiVector3D vertex; vertex.x = ai_strtof(xmlReader->getAttributeValue(D3MF::XmlTag::x.c_str()), nullptr); vertex.y = ai_strtof(xmlReader->getAttributeValue(D3MF::XmlTag::y.c_str()), nullptr); @@ -231,7 +238,7 @@ private: void ImportTriangles(aiMesh* mesh) { - std::vector faces; + std::vector faces; while(ReadToEndElement(D3MF::XmlTag::triangles)) @@ -337,7 +344,7 @@ D3MFImporter::~D3MFImporter() } bool D3MFImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const -{ +{ const std::string extension = GetExtension(pFile); if(extension == "3mf") { return true; diff --git a/code/D3MFOpcPackage.cpp b/code/D3MFOpcPackage.cpp index f01ca7e0f..2e63a346e 100644 --- a/code/D3MFOpcPackage.cpp +++ b/code/D3MFOpcPackage.cpp @@ -42,7 +42,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "D3MFOpcPackage.h" #include "Exceptional.h" -#include #include #include #include @@ -57,6 +56,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_3MF_IMPORTER +#include + namespace Assimp { namespace D3MF { diff --git a/code/DefaultIOStream.cpp b/code/DefaultIOStream.cpp index e9da3ff70..11bad9b64 100644 --- a/code/DefaultIOStream.cpp +++ b/code/DefaultIOStream.cpp @@ -120,7 +120,7 @@ size_t DefaultIOStream::FileSize() const // // See here for details: // https://www.securecoding.cert.org/confluence/display/seccode/FIO19-C.+Do+not+use+fseek()+and+ftell()+to+compute+the+size+of+a+regular+file -#if defined _WIN32 && !defined __GNUC__ +#if defined _WIN32 struct __stat64 fileStat; int err = _stat64( mFilename.c_str(), &fileStat ); if (0 != err) diff --git a/code/DefaultIOStream.h b/code/DefaultIOStream.h index 83bd3a9d4..294c5b797 100644 --- a/code/DefaultIOStream.h +++ b/code/DefaultIOStream.h @@ -105,7 +105,7 @@ public: void Flush(); private: - // File datastructure, using clib + // File data-structure, using clib FILE* mFile; // Filename std::string mFilename; @@ -114,7 +114,6 @@ private: mutable size_t mCachedSize; }; - // ---------------------------------------------------------------------------------- inline DefaultIOStream::DefaultIOStream () : mFile (NULL), @@ -124,7 +123,6 @@ inline DefaultIOStream::DefaultIOStream () : // empty } - // ---------------------------------------------------------------------------------- inline DefaultIOStream::DefaultIOStream (FILE* pFile, const std::string &strFilename) : diff --git a/code/Exporter.cpp b/code/Exporter.cpp index e510b7642..26cb5e998 100644 --- a/code/Exporter.cpp +++ b/code/Exporter.cpp @@ -91,6 +91,7 @@ void ExportSceneGLTF(const char*, IOSystem*, const aiScene*, const ExportPropert void ExportSceneGLB(const char*, IOSystem*, const aiScene*, const ExportProperties*); void ExportSceneAssbin(const char*, IOSystem*, const aiScene*, const ExportProperties*); void ExportSceneAssxml(const char*, IOSystem*, const aiScene*, const ExportProperties*); +void ExportSceneX3D(const char*, IOSystem*, const aiScene*, const ExportProperties*); // ------------------------------------------------------------------------------------------------ // global array of all export formats which Assimp supports in its current build @@ -139,9 +140,9 @@ Exporter::ExportFormatEntry gExporters[] = #ifndef ASSIMP_BUILD_NO_GLTF_EXPORTER Exporter::ExportFormatEntry( "gltf", "GL Transmission Format", "gltf", &ExportSceneGLTF, - aiProcess_JoinIdenticalVertices /*| aiProcess_SortByPType*/), + aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType), Exporter::ExportFormatEntry( "glb", "GL Transmission Format (binary)", "glb", &ExportSceneGLB, - aiProcess_JoinIdenticalVertices /*| aiProcess_SortByPType*/), + aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType), #endif #ifndef ASSIMP_BUILD_NO_ASSBIN_EXPORTER @@ -151,6 +152,10 @@ Exporter::ExportFormatEntry gExporters[] = #ifndef ASSIMP_BUILD_NO_ASSXML_EXPORTER Exporter::ExportFormatEntry( "assxml", "Assxml Document", "assxml" , &ExportSceneAssxml, 0), #endif + +#ifndef ASSIMP_BUILD_NO_X3D_EXPORTER + Exporter::ExportFormatEntry( "x3d", "Extensible 3D", "x3d" , &ExportSceneX3D, 0), +#endif }; #define ASSIMP_NUM_EXPORTERS (sizeof(gExporters)/sizeof(gExporters[0])) diff --git a/code/FBXBinaryTokenizer.cpp b/code/FBXBinaryTokenizer.cpp index 551b174ed..1c2585798 100644 --- a/code/FBXBinaryTokenizer.cpp +++ b/code/FBXBinaryTokenizer.cpp @@ -55,6 +55,46 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace Assimp { namespace FBX { +enum Flag +{ + e_unknown_0 = 1 << 0, + e_unknown_1 = 1 << 1, + e_unknown_2 = 1 << 2, + e_unknown_3 = 1 << 3, + e_unknown_4 = 1 << 4, + e_unknown_5 = 1 << 5, + e_unknown_6 = 1 << 6, + e_unknown_7 = 1 << 7, + e_unknown_8 = 1 << 8, + e_unknown_9 = 1 << 9, + e_unknown_10 = 1 << 10, + e_unknown_11 = 1 << 11, + e_unknown_12 = 1 << 12, + e_unknown_13 = 1 << 13, + e_unknown_14 = 1 << 14, + e_unknown_15 = 1 << 15, + e_unknown_16 = 1 << 16, + e_unknown_17 = 1 << 17, + e_unknown_18 = 1 << 18, + e_unknown_19 = 1 << 19, + e_unknown_20 = 1 << 20, + e_unknown_21 = 1 << 21, + e_unknown_22 = 1 << 22, + e_unknown_23 = 1 << 23, + e_flag_field_size_64_bit = 1 << 24, // Not sure what is + e_unknown_25 = 1 << 25, + e_unknown_26 = 1 << 26, + e_unknown_27 = 1 << 27, + e_unknown_28 = 1 << 28, + e_unknown_29 = 1 << 29, + e_unknown_30 = 1 << 30, + e_unknown_31 = 1 << 31 +}; + +bool check_flag(uint32_t flags, Flag to_check) +{ + return (flags & to_check) != 0; +} // ------------------------------------------------------------------------------------------------ Token::Token(const char* sbegin, const char* send, TokenType type, unsigned int offset) @@ -118,6 +158,21 @@ uint32_t ReadWord(const char* input, const char*& cursor, const char* end) return word; } +uint64_t ReadDoubleWord(const char* input, const char*& cursor, const char* end) +{ + const size_t k_to_read = sizeof(uint64_t); + if(Offset(cursor, end) < k_to_read) { + TokenizeError("cannot ReadDoubleWord, out of bounds",input, cursor); + } + + uint64_t dword = *reinterpret_cast(cursor); + AI_SWAP8(dword); + + cursor += k_to_read; + + return dword; +} + // ------------------------------------------------------------------------------------------------ uint8_t ReadByte(const char* input, const char*& cursor, const char* end) @@ -287,10 +342,10 @@ void ReadData(const char*& sbegin_out, const char*& send_out, const char* input, // ------------------------------------------------------------------------------------------------ -bool ReadScope(TokenList& output_tokens, const char* input, const char*& cursor, const char* end) +bool ReadScope(TokenList& output_tokens, const char* input, const char*& cursor, const char* end, uint32_t const flags) { // the first word contains the offset at which this block ends - const uint32_t end_offset = ReadWord(input, cursor, end); + const uint64_t end_offset = check_flag(flags, e_flag_field_size_64_bit) ? ReadDoubleWord(input, cursor, end) : ReadWord(input, cursor, end); // we may get 0 if reading reached the end of the file - // fbx files have a mysterious extra footer which I don't know @@ -308,10 +363,10 @@ bool ReadScope(TokenList& output_tokens, const char* input, const char*& cursor, } // the second data word contains the number of properties in the scope - const uint32_t prop_count = ReadWord(input, cursor, end); + const uint64_t prop_count = check_flag(flags, e_flag_field_size_64_bit) ? ReadDoubleWord(input, cursor, end) : ReadWord(input, cursor, end); // the third data word contains the length of the property list - const uint32_t prop_length = ReadWord(input, cursor, end); + const uint64_t prop_length = check_flag(flags, e_flag_field_size_64_bit) ? ReadDoubleWord(input, cursor, end) : ReadWord(input, cursor, end); // now comes the name of the scope/key const char* sbeg, *send; @@ -337,29 +392,28 @@ bool ReadScope(TokenList& output_tokens, const char* input, const char*& cursor, // at the end of each nested block, there is a NUL record to indicate // that the sub-scope exists (i.e. to distinguish between P: and P : {}) - // this NUL record is 13 bytes long. -#define BLOCK_SENTINEL_LENGTH 13 + // this NUL record is 13 bytes long on 32 bit version and 25 bytes long on 64 bit. + const size_t sentinel_block_length = check_flag(flags, e_flag_field_size_64_bit) ? (sizeof(uint64_t) * 3 + 1) : (sizeof(uint32_t) * 3 + 1); if (Offset(input, cursor) < end_offset) { - - if (end_offset - Offset(input, cursor) < BLOCK_SENTINEL_LENGTH) { + if (end_offset - Offset(input, cursor) < sentinel_block_length) { TokenizeError("insufficient padding bytes at block end",input, cursor); } output_tokens.push_back(new_Token(cursor, cursor + 1, TokenType_OPEN_BRACKET, Offset(input, cursor) )); // XXX this is vulnerable to stack overflowing .. - while(Offset(input, cursor) < end_offset - BLOCK_SENTINEL_LENGTH) { - ReadScope(output_tokens, input, cursor, input + end_offset - BLOCK_SENTINEL_LENGTH); + while(Offset(input, cursor) < end_offset - sentinel_block_length) { + ReadScope(output_tokens, input, cursor, input + end_offset - sentinel_block_length, flags); } output_tokens.push_back(new_Token(cursor, cursor + 1, TokenType_CLOSE_BRACKET, Offset(input, cursor) )); - for (unsigned int i = 0; i < BLOCK_SENTINEL_LENGTH; ++i) { + for (unsigned int i = 0; i < sentinel_block_length; ++i) { if(cursor[i] != '\0') { TokenizeError("failed to read nested block sentinel, expected all bytes to be 0",input, cursor); } } - cursor += BLOCK_SENTINEL_LENGTH; + cursor += sentinel_block_length; } if (Offset(input, cursor) != end_offset) { @@ -386,12 +440,17 @@ void TokenizeBinary(TokenList& output_tokens, const char* input, unsigned int le } - //uint32_t offset = 0x1b; + //uint32_t offset = 0x15; + const char* cursor = input + 0x15; - const char* cursor = input + 0x1b; + const uint32_t flags = ReadWord(input, cursor, input + length); - while (cursor < input + length) { - if(!ReadScope(output_tokens, input, cursor, input + length)) { + const uint8_t padding_0 = ReadByte(input, cursor, input + length); // unused + const uint8_t padding_1 = ReadByte(input, cursor, input + length); // unused + + while (cursor < input + length) + { + if(!ReadScope(output_tokens, input, cursor, input + length, flags)) { break; } } diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index 1f6274d8f..365d7fe65 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -3068,9 +3068,7 @@ void Converter::InterpolateKeys( aiVectorKey* valOut, const KeyTimeList& keys, c const KeyTimeList::value_type timeA = std::get<0>(kfl)->at( id0 ); const KeyTimeList::value_type timeB = std::get<0>(kfl)->at( id1 ); - // do the actual interpolation in double-precision arithmetics - // because it is a bit sensitive to rounding errors. - const double factor = timeB == timeA ? 0. : static_cast( ( time - timeA ) / ( timeB - timeA ) ); + const ai_real factor = timeB == timeA ? 0. : static_cast( ( time - timeA ) ) / ( timeB - timeA ); const ai_real interpValue = static_cast( valueA + ( valueB - valueA ) * factor ); result[ std::get<2>(kfl) ] = interpValue; diff --git a/code/FBXMeshGeometry.cpp b/code/FBXMeshGeometry.cpp index e9d83911b..e7a105d45 100644 --- a/code/FBXMeshGeometry.cpp +++ b/code/FBXMeshGeometry.cpp @@ -117,12 +117,12 @@ MeshGeometry::MeshGeometry(uint64_t id, const Element& element, const std::strin return; } - vertices.reserve(tempFaces.size()); - faces.reserve(tempFaces.size() / 3); + m_vertices.reserve(tempFaces.size()); + m_faces.reserve(tempFaces.size() / 3); - mapping_offsets.resize(tempVerts.size()); - mapping_counts.resize(tempVerts.size(),0); - mappings.resize(tempFaces.size()); + m_mapping_offsets.resize(tempVerts.size()); + m_mapping_counts.resize(tempVerts.size(),0); + m_mappings.resize(tempFaces.size()); const size_t vertex_count = tempVerts.size(); @@ -135,29 +135,29 @@ MeshGeometry::MeshGeometry(uint64_t id, const Element& element, const std::strin DOMError("polygon vertex index out of range",&PolygonVertexIndex); } - vertices.push_back(tempVerts[absi]); + m_vertices.push_back(tempVerts[absi]); ++count; - ++mapping_counts[absi]; + ++m_mapping_counts[absi]; if (index < 0) { - faces.push_back(count); + m_faces.push_back(count); count = 0; } } unsigned int cursor = 0; for (size_t i = 0, e = tempVerts.size(); i < e; ++i) { - mapping_offsets[i] = cursor; - cursor += mapping_counts[i]; + m_mapping_offsets[i] = cursor; + cursor += m_mapping_counts[i]; - mapping_counts[i] = 0; + m_mapping_counts[i] = 0; } cursor = 0; for(int index : tempFaces) { const int absi = index < 0 ? (-index - 1) : index; - mappings[mapping_offsets[absi] + mapping_counts[absi]++] = cursor++; + m_mappings[m_mapping_offsets[absi] + m_mapping_counts[absi]++] = cursor++; } // if settings.readAllLayers is true: @@ -191,84 +191,84 @@ MeshGeometry::~MeshGeometry() // ------------------------------------------------------------------------------------------------ const std::vector& MeshGeometry::GetVertices() const { - return vertices; + return m_vertices; } // ------------------------------------------------------------------------------------------------ const std::vector& MeshGeometry::GetNormals() const { - return normals; + return m_normals; } // ------------------------------------------------------------------------------------------------ const std::vector& MeshGeometry::GetTangents() const { - return tangents; + return m_tangents; } // ------------------------------------------------------------------------------------------------ const std::vector& MeshGeometry::GetBinormals() const { - return binormals; + return m_binormals; } // ------------------------------------------------------------------------------------------------ const std::vector& MeshGeometry::GetFaceIndexCounts() const { - return faces; + return m_faces; } // ------------------------------------------------------------------------------------------------ const std::vector& MeshGeometry::GetTextureCoords( unsigned int index ) const { static const std::vector empty; - return index >= AI_MAX_NUMBER_OF_TEXTURECOORDS ? empty : uvs[ index ]; + return index >= AI_MAX_NUMBER_OF_TEXTURECOORDS ? empty : m_uvs[ index ]; } std::string MeshGeometry::GetTextureCoordChannelName( unsigned int index ) const { - return index >= AI_MAX_NUMBER_OF_TEXTURECOORDS ? "" : uvNames[ index ]; + return index >= AI_MAX_NUMBER_OF_TEXTURECOORDS ? "" : m_uvNames[ index ]; } const std::vector& MeshGeometry::GetVertexColors( unsigned int index ) const { static const std::vector empty; - return index >= AI_MAX_NUMBER_OF_COLOR_SETS ? empty : colors[ index ]; + return index >= AI_MAX_NUMBER_OF_COLOR_SETS ? empty : m_colors[ index ]; } const MatIndexArray& MeshGeometry::GetMaterialIndices() const { - return materials; + return m_materials; } // ------------------------------------------------------------------------------------------------ const unsigned int* MeshGeometry::ToOutputVertexIndex( unsigned int in_index, unsigned int& count ) const { - if ( in_index >= mapping_counts.size() ) { + if ( in_index >= m_mapping_counts.size() ) { return NULL; } - ai_assert( mapping_counts.size() == mapping_offsets.size() ); - count = mapping_counts[ in_index ]; + ai_assert( m_mapping_counts.size() == m_mapping_offsets.size() ); + count = m_mapping_counts[ in_index ]; - ai_assert( count != 0 ); - ai_assert( mapping_offsets[ in_index ] + count <= mappings.size() ); +// ai_assert( count != 0 ); + ai_assert( m_mapping_offsets[ in_index ] + count <= m_mappings.size() ); - return &mappings[ mapping_offsets[ in_index ] ]; + return &m_mappings[ m_mapping_offsets[ in_index ] ]; } // ------------------------------------------------------------------------------------------------ unsigned int MeshGeometry::FaceForVertexIndex( unsigned int in_index ) const { - ai_assert( in_index < vertices.size() ); + ai_assert( in_index < m_vertices.size() ); // in the current conversion pattern this will only be needed if // weights are present, so no need to always pre-compute this table - if ( facesVertexStartIndices.empty() ) { - facesVertexStartIndices.resize( faces.size() + 1, 0 ); + if ( m_facesVertexStartIndices.empty() ) { + m_facesVertexStartIndices.resize( m_faces.size() + 1, 0 ); - std::partial_sum( faces.begin(), faces.end(), facesVertexStartIndices.begin() + 1 ); - facesVertexStartIndices.pop_back(); + std::partial_sum( m_faces.begin(), m_faces.end(), m_facesVertexStartIndices.begin() + 1 ); + m_facesVertexStartIndices.pop_back(); } - ai_assert( facesVertexStartIndices.size() == faces.size() ); + ai_assert( m_facesVertexStartIndices.size() == m_faces.size() ); const std::vector::iterator it = std::upper_bound( - facesVertexStartIndices.begin(), - facesVertexStartIndices.end(), + m_facesVertexStartIndices.begin(), + m_facesVertexStartIndices.end(), in_index ); - return static_cast< unsigned int >( std::distance( facesVertexStartIndices.begin(), it - 1 ) ); + return static_cast< unsigned int >( std::distance( m_facesVertexStartIndices.begin(), it - 1 ) ); } // ------------------------------------------------------------------------------------------------ @@ -327,18 +327,18 @@ void MeshGeometry::ReadVertexData(const std::string& type, int index, const Scop } const Element* Name = source["Name"]; - uvNames[index] = ""; + m_uvNames[index] = ""; if(Name) { - uvNames[index] = ParseTokenAsString(GetRequiredToken(*Name,0)); + m_uvNames[index] = ParseTokenAsString(GetRequiredToken(*Name,0)); } - ReadVertexDataUV(uvs[index],source, + ReadVertexDataUV(m_uvs[index],source, MappingInformationType, ReferenceInformationType ); } else if (type == "LayerElementMaterial") { - if (materials.size() > 0) { + if (m_materials.size() > 0) { FBXImporter::LogError("ignoring additional material layer"); return; } @@ -362,37 +362,37 @@ void MeshGeometry::ReadVertexData(const std::string& type, int index, const Scop return; } - std::swap(temp_materials, materials); + std::swap(temp_materials, m_materials); } else if (type == "LayerElementNormal") { - if (normals.size() > 0) { + if (m_normals.size() > 0) { FBXImporter::LogError("ignoring additional normal layer"); return; } - ReadVertexDataNormals(normals,source, + ReadVertexDataNormals(m_normals,source, MappingInformationType, ReferenceInformationType ); } else if (type == "LayerElementTangent") { - if (tangents.size() > 0) { + if (m_tangents.size() > 0) { FBXImporter::LogError("ignoring additional tangent layer"); return; } - ReadVertexDataTangents(tangents,source, + ReadVertexDataTangents(m_tangents,source, MappingInformationType, ReferenceInformationType ); } else if (type == "LayerElementBinormal") { - if (binormals.size() > 0) { + if (m_binormals.size() > 0) { FBXImporter::LogError("ignoring additional binormal layer"); return; } - ReadVertexDataBinormals(binormals,source, + ReadVertexDataBinormals(m_binormals,source, MappingInformationType, ReferenceInformationType ); @@ -404,7 +404,7 @@ void MeshGeometry::ReadVertexData(const std::string& type, int index, const Scop return; } - ReadVertexDataColors(colors[index],source, + ReadVertexDataColors(m_colors[index],source, MappingInformationType, ReferenceInformationType ); @@ -515,10 +515,10 @@ void MeshGeometry::ReadVertexDataNormals(std::vector& normals_out, c ResolveVertexDataArray(normals_out,source,MappingInformationType,ReferenceInformationType, "Normals", "NormalsIndex", - vertices.size(), - mapping_counts, - mapping_offsets, - mappings); + m_vertices.size(), + m_mapping_counts, + m_mapping_offsets, + m_mappings); } @@ -530,10 +530,10 @@ void MeshGeometry::ReadVertexDataUV(std::vector& uv_out, const Scope ResolveVertexDataArray(uv_out,source,MappingInformationType,ReferenceInformationType, "UV", "UVIndex", - vertices.size(), - mapping_counts, - mapping_offsets, - mappings); + m_vertices.size(), + m_mapping_counts, + m_mapping_offsets, + m_mappings); } @@ -545,10 +545,10 @@ void MeshGeometry::ReadVertexDataColors(std::vector& colors_out, cons ResolveVertexDataArray(colors_out,source,MappingInformationType,ReferenceInformationType, "Colors", "ColorIndex", - vertices.size(), - mapping_counts, - mapping_offsets, - mappings); + m_vertices.size(), + m_mapping_counts, + m_mapping_offsets, + m_mappings); } // ------------------------------------------------------------------------------------------------ @@ -564,10 +564,10 @@ void MeshGeometry::ReadVertexDataTangents(std::vector& tangents_out, ResolveVertexDataArray(tangents_out,source,MappingInformationType,ReferenceInformationType, str, strIdx, - vertices.size(), - mapping_counts, - mapping_offsets, - mappings); + m_vertices.size(), + m_mapping_counts, + m_mapping_offsets, + m_mappings); } // ------------------------------------------------------------------------------------------------ @@ -583,10 +583,10 @@ void MeshGeometry::ReadVertexDataBinormals(std::vector& binormals_ou ResolveVertexDataArray(binormals_out,source,MappingInformationType,ReferenceInformationType, str, strIdx, - vertices.size(), - mapping_counts, - mapping_offsets, - mappings); + m_vertices.size(), + m_mapping_counts, + m_mapping_offsets, + m_mappings); } @@ -595,7 +595,7 @@ void MeshGeometry::ReadVertexDataMaterials(std::vector& materials_out, cons const std::string& MappingInformationType, const std::string& ReferenceInformationType) { - const size_t face_count = faces.size(); + const size_t face_count = m_faces.size(); ai_assert(face_count); // materials are handled separately. First of all, they are assigned per-face @@ -614,10 +614,10 @@ void MeshGeometry::ReadVertexDataMaterials(std::vector& materials_out, cons materials_out.clear(); } - materials.assign(vertices.size(),materials_out[0]); + m_materials.assign(m_vertices.size(),materials_out[0]); } else if (MappingInformationType == "ByPolygon" && ReferenceInformationType == "IndexToDirect") { - materials.resize(face_count); + m_materials.resize(face_count); if(materials_out.size() != face_count) { FBXImporter::LogError(Formatter::format("length of input data unexpected for ByPolygon mapping: ") diff --git a/code/FBXMeshGeometry.h b/code/FBXMeshGeometry.h index 48ac550c1..690a86a01 100644 --- a/code/FBXMeshGeometry.h +++ b/code/FBXMeshGeometry.h @@ -156,21 +156,21 @@ private: private: // cached data arrays - MatIndexArray materials; - std::vector vertices; - std::vector faces; - mutable std::vector facesVertexStartIndices; - std::vector tangents; - std::vector binormals; - std::vector normals; + MatIndexArray m_materials; + std::vector m_vertices; + std::vector m_faces; + mutable std::vector m_facesVertexStartIndices; + std::vector m_tangents; + std::vector m_binormals; + std::vector m_normals; - std::string uvNames[ AI_MAX_NUMBER_OF_TEXTURECOORDS ]; - std::vector uvs[ AI_MAX_NUMBER_OF_TEXTURECOORDS ]; - std::vector colors[ AI_MAX_NUMBER_OF_COLOR_SETS ]; + std::string m_uvNames[ AI_MAX_NUMBER_OF_TEXTURECOORDS ]; + std::vector m_uvs[ AI_MAX_NUMBER_OF_TEXTURECOORDS ]; + std::vector m_colors[ AI_MAX_NUMBER_OF_COLOR_SETS ]; - std::vector mapping_counts; - std::vector mapping_offsets; - std::vector mappings; + std::vector m_mapping_counts; + std::vector m_mapping_offsets; + std::vector m_mappings; }; } diff --git a/code/FixNormalsStep.cpp b/code/FixNormalsStep.cpp index 9249b13e9..0325f8dfb 100644 --- a/code/FixNormalsStep.cpp +++ b/code/FixNormalsStep.cpp @@ -148,9 +148,9 @@ bool FixInfacingNormalsProcess::ProcessMesh( aiMesh* pcMesh, unsigned int index) // Check whether this is a planar surface const float fDelta1_yz = fDelta1_y * fDelta1_z; - if (fDelta1_x < 0.05f * sqrtf( fDelta1_yz ))return false; - if (fDelta1_y < 0.05f * sqrtf( fDelta1_z * fDelta1_x ))return false; - if (fDelta1_z < 0.05f * sqrtf( fDelta1_y * fDelta1_x ))return false; + if (fDelta1_x < 0.05f * std::sqrt( fDelta1_yz ))return false; + if (fDelta1_y < 0.05f * std::sqrt( fDelta1_z * fDelta1_x ))return false; + if (fDelta1_z < 0.05f * std::sqrt( fDelta1_y * fDelta1_x ))return false; // now compare the volumes of the bounding boxes if (std::fabs(fDelta0_x * fDelta0_y * fDelta0_z) < diff --git a/code/GenVertexNormalsProcess.cpp b/code/GenVertexNormalsProcess.cpp index 14b7962c0..c205ac5ac 100644 --- a/code/GenVertexNormalsProcess.cpp +++ b/code/GenVertexNormalsProcess.cpp @@ -154,7 +154,7 @@ bool GenVertexNormalsProcess::GenMeshVertexNormals (aiMesh* pMesh, unsigned int // check whether we can reuse the SpatialSort of a previous step. SpatialSort* vertexFinder = NULL; SpatialSort _vertexFinder; - ai_real posEpsilon = 1e-5; + ai_real posEpsilon = ai_real( 1e-5 ); if (shared) { std::vector >* avf; shared->GetProperty(AI_SPP_SPATIAL_SORT,avf); diff --git a/code/IFCReaderGen.cpp b/code/IFCReaderGen.cpp deleted file mode 100644 index 00ee22415..000000000 --- a/code/IFCReaderGen.cpp +++ /dev/null @@ -1,5034 +0,0 @@ -/* -Open Asset Import Library (ASSIMP) ----------------------------------------------------------------------- - -Copyright (c) 2006-2010, ASSIMP Development Team -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the ASSIMP team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the ASSIMP Development Team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -/** MACHINE-GENERATED by scripts/ICFImporter/CppGenerator.py */ - - -#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER - -#include "IFCReaderGen.h" - -namespace Assimp { -using namespace IFC; - -namespace { - - typedef EXPRESS::ConversionSchema::SchemaEntry SchemaEntry; - const SchemaEntry schema_raw[] = { - SchemaEntry("ifcabsorbeddosemeasure",NULL ) -, SchemaEntry("ifcaccelerationmeasure",NULL ) -, SchemaEntry("ifcamountofsubstancemeasure",NULL ) -, SchemaEntry("ifcangularvelocitymeasure",NULL ) -, SchemaEntry("ifcareameasure",NULL ) -, SchemaEntry("ifcboolean",NULL ) -, SchemaEntry("ifcboxalignment",NULL ) -, SchemaEntry("ifccomplexnumber",NULL ) -, SchemaEntry("ifccompoundplaneanglemeasure",NULL ) -, SchemaEntry("ifccontextdependentmeasure",NULL ) -, SchemaEntry("ifccountmeasure",NULL ) -, SchemaEntry("ifccurvaturemeasure",NULL ) -, SchemaEntry("ifcdayinmonthnumber",NULL ) -, SchemaEntry("ifcdaylightsavinghour",NULL ) -, SchemaEntry("ifcdescriptivemeasure",NULL ) -, SchemaEntry("ifcdimensioncount",NULL ) -, SchemaEntry("ifcdoseequivalentmeasure",NULL ) -, SchemaEntry("ifcdynamicviscositymeasure",NULL ) -, SchemaEntry("ifcelectriccapacitancemeasure",NULL ) -, SchemaEntry("ifcelectricchargemeasure",NULL ) -, SchemaEntry("ifcelectricconductancemeasure",NULL ) -, SchemaEntry("ifcelectriccurrentmeasure",NULL ) -, SchemaEntry("ifcelectricresistancemeasure",NULL ) -, SchemaEntry("ifcelectricvoltagemeasure",NULL ) -, SchemaEntry("ifcenergymeasure",NULL ) -, SchemaEntry("ifcfontstyle",NULL ) -, SchemaEntry("ifcfontvariant",NULL ) -, SchemaEntry("ifcfontweight",NULL ) -, SchemaEntry("ifcforcemeasure",NULL ) -, SchemaEntry("ifcfrequencymeasure",NULL ) -, SchemaEntry("ifcgloballyuniqueid",NULL ) -, SchemaEntry("ifcheatfluxdensitymeasure",NULL ) -, SchemaEntry("ifcheatingvaluemeasure",NULL ) -, SchemaEntry("ifchourinday",NULL ) -, SchemaEntry("ifcidentifier",NULL ) -, SchemaEntry("ifcilluminancemeasure",NULL ) -, SchemaEntry("ifcinductancemeasure",NULL ) -, SchemaEntry("ifcinteger",NULL ) -, SchemaEntry("ifcintegercountratemeasure",NULL ) -, SchemaEntry("ifcionconcentrationmeasure",NULL ) -, SchemaEntry("ifcisothermalmoisturecapacitymeasure",NULL ) -, SchemaEntry("ifckinematicviscositymeasure",NULL ) -, SchemaEntry("ifclabel",NULL ) -, SchemaEntry("ifclengthmeasure",NULL ) -, SchemaEntry("ifclinearforcemeasure",NULL ) -, SchemaEntry("ifclinearmomentmeasure",NULL ) -, SchemaEntry("ifclinearstiffnessmeasure",NULL ) -, SchemaEntry("ifclinearvelocitymeasure",NULL ) -, SchemaEntry("ifclogical",NULL ) -, SchemaEntry("ifcluminousfluxmeasure",NULL ) -, SchemaEntry("ifcluminousintensitydistributionmeasure",NULL ) -, SchemaEntry("ifcluminousintensitymeasure",NULL ) -, SchemaEntry("ifcmagneticfluxdensitymeasure",NULL ) -, SchemaEntry("ifcmagneticfluxmeasure",NULL ) -, SchemaEntry("ifcmassdensitymeasure",NULL ) -, SchemaEntry("ifcmassflowratemeasure",NULL ) -, SchemaEntry("ifcmassmeasure",NULL ) -, SchemaEntry("ifcmassperlengthmeasure",NULL ) -, SchemaEntry("ifcminuteinhour",NULL ) -, SchemaEntry("ifcmodulusofelasticitymeasure",NULL ) -, SchemaEntry("ifcmodulusoflinearsubgradereactionmeasure",NULL ) -, SchemaEntry("ifcmodulusofrotationalsubgradereactionmeasure",NULL ) -, SchemaEntry("ifcmodulusofsubgradereactionmeasure",NULL ) -, SchemaEntry("ifcmoisturediffusivitymeasure",NULL ) -, SchemaEntry("ifcmolecularweightmeasure",NULL ) -, SchemaEntry("ifcmomentofinertiameasure",NULL ) -, SchemaEntry("ifcmonetarymeasure",NULL ) -, SchemaEntry("ifcmonthinyearnumber",NULL ) -, SchemaEntry("ifcnormalisedratiomeasure",NULL ) -, SchemaEntry("ifcnumericmeasure",NULL ) -, SchemaEntry("ifcphmeasure",NULL ) -, SchemaEntry("ifcparametervalue",NULL ) -, SchemaEntry("ifcplanarforcemeasure",NULL ) -, SchemaEntry("ifcplaneanglemeasure",NULL ) -, SchemaEntry("ifcpositivelengthmeasure",NULL ) -, SchemaEntry("ifcpositiveplaneanglemeasure",NULL ) -, SchemaEntry("ifcpositiveratiomeasure",NULL ) -, SchemaEntry("ifcpowermeasure",NULL ) -, SchemaEntry("ifcpresentabletext",NULL ) -, SchemaEntry("ifcpressuremeasure",NULL ) -, SchemaEntry("ifcradioactivitymeasure",NULL ) -, SchemaEntry("ifcratiomeasure",NULL ) -, SchemaEntry("ifcreal",NULL ) -, SchemaEntry("ifcrotationalfrequencymeasure",NULL ) -, SchemaEntry("ifcrotationalmassmeasure",NULL ) -, SchemaEntry("ifcrotationalstiffnessmeasure",NULL ) -, SchemaEntry("ifcsecondinminute",NULL ) -, SchemaEntry("ifcsectionmodulusmeasure",NULL ) -, SchemaEntry("ifcsectionalareaintegralmeasure",NULL ) -, SchemaEntry("ifcshearmodulusmeasure",NULL ) -, SchemaEntry("ifcsolidanglemeasure",NULL ) -, SchemaEntry("ifcsoundpowermeasure",NULL ) -, SchemaEntry("ifcsoundpressuremeasure",NULL ) -, SchemaEntry("ifcspecificheatcapacitymeasure",NULL ) -, SchemaEntry("ifcspecularexponent",NULL ) -, SchemaEntry("ifcspecularroughness",NULL ) -, SchemaEntry("ifctemperaturegradientmeasure",NULL ) -, SchemaEntry("ifctext",NULL ) -, SchemaEntry("ifctextalignment",NULL ) -, SchemaEntry("ifctextdecoration",NULL ) -, SchemaEntry("ifctextfontname",NULL ) -, SchemaEntry("ifctexttransformation",NULL ) -, SchemaEntry("ifcthermaladmittancemeasure",NULL ) -, SchemaEntry("ifcthermalconductivitymeasure",NULL ) -, SchemaEntry("ifcthermalexpansioncoefficientmeasure",NULL ) -, SchemaEntry("ifcthermalresistancemeasure",NULL ) -, SchemaEntry("ifcthermaltransmittancemeasure",NULL ) -, SchemaEntry("ifcthermodynamictemperaturemeasure",NULL ) -, SchemaEntry("ifctimemeasure",NULL ) -, SchemaEntry("ifctimestamp",NULL ) -, SchemaEntry("ifctorquemeasure",NULL ) -, SchemaEntry("ifcvaporpermeabilitymeasure",NULL ) -, SchemaEntry("ifcvolumemeasure",NULL ) -, SchemaEntry("ifcvolumetricflowratemeasure",NULL ) -, SchemaEntry("ifcwarpingconstantmeasure",NULL ) -, SchemaEntry("ifcwarpingmomentmeasure",NULL ) -, SchemaEntry("ifcyearnumber",NULL ) -, SchemaEntry("ifcactionsourcetypeenum",NULL ) -, SchemaEntry("ifcactiontypeenum",NULL ) -, SchemaEntry("ifcactuatortypeenum",NULL ) -, SchemaEntry("ifcaddresstypeenum",NULL ) -, SchemaEntry("ifcaheadorbehind",NULL ) -, SchemaEntry("ifcairterminalboxtypeenum",NULL ) -, SchemaEntry("ifcairterminaltypeenum",NULL ) -, SchemaEntry("ifcairtoairheatrecoverytypeenum",NULL ) -, SchemaEntry("ifcalarmtypeenum",NULL ) -, SchemaEntry("ifcanalysismodeltypeenum",NULL ) -, SchemaEntry("ifcanalysistheorytypeenum",NULL ) -, SchemaEntry("ifcarithmeticoperatorenum",NULL ) -, SchemaEntry("ifcassemblyplaceenum",NULL ) -, SchemaEntry("ifcbsplinecurveform",NULL ) -, SchemaEntry("ifcbeamtypeenum",NULL ) -, SchemaEntry("ifcbenchmarkenum",NULL ) -, SchemaEntry("ifcboilertypeenum",NULL ) -, SchemaEntry("ifcbooleanoperator",NULL ) -, SchemaEntry("ifcbuildingelementproxytypeenum",NULL ) -, SchemaEntry("ifccablecarrierfittingtypeenum",NULL ) -, SchemaEntry("ifccablecarriersegmenttypeenum",NULL ) -, SchemaEntry("ifccablesegmenttypeenum",NULL ) -, SchemaEntry("ifcchangeactionenum",NULL ) -, SchemaEntry("ifcchillertypeenum",NULL ) -, SchemaEntry("ifccoiltypeenum",NULL ) -, SchemaEntry("ifccolumntypeenum",NULL ) -, SchemaEntry("ifccompressortypeenum",NULL ) -, SchemaEntry("ifccondensertypeenum",NULL ) -, SchemaEntry("ifcconnectiontypeenum",NULL ) -, SchemaEntry("ifcconstraintenum",NULL ) -, SchemaEntry("ifccontrollertypeenum",NULL ) -, SchemaEntry("ifccooledbeamtypeenum",NULL ) -, SchemaEntry("ifccoolingtowertypeenum",NULL ) -, SchemaEntry("ifccostscheduletypeenum",NULL ) -, SchemaEntry("ifccoveringtypeenum",NULL ) -, SchemaEntry("ifccurrencyenum",NULL ) -, SchemaEntry("ifccurtainwalltypeenum",NULL ) -, SchemaEntry("ifcdampertypeenum",NULL ) -, SchemaEntry("ifcdataoriginenum",NULL ) -, SchemaEntry("ifcderivedunitenum",NULL ) -, SchemaEntry("ifcdimensionextentusage",NULL ) -, SchemaEntry("ifcdirectionsenseenum",NULL ) -, SchemaEntry("ifcdistributionchamberelementtypeenum",NULL ) -, SchemaEntry("ifcdocumentconfidentialityenum",NULL ) -, SchemaEntry("ifcdocumentstatusenum",NULL ) -, SchemaEntry("ifcdoorpaneloperationenum",NULL ) -, SchemaEntry("ifcdoorpanelpositionenum",NULL ) -, SchemaEntry("ifcdoorstyleconstructionenum",NULL ) -, SchemaEntry("ifcdoorstyleoperationenum",NULL ) -, SchemaEntry("ifcductfittingtypeenum",NULL ) -, SchemaEntry("ifcductsegmenttypeenum",NULL ) -, SchemaEntry("ifcductsilencertypeenum",NULL ) -, SchemaEntry("ifcelectricappliancetypeenum",NULL ) -, SchemaEntry("ifcelectriccurrentenum",NULL ) -, SchemaEntry("ifcelectricdistributionpointfunctionenum",NULL ) -, SchemaEntry("ifcelectricflowstoragedevicetypeenum",NULL ) -, SchemaEntry("ifcelectricgeneratortypeenum",NULL ) -, SchemaEntry("ifcelectricheatertypeenum",NULL ) -, SchemaEntry("ifcelectricmotortypeenum",NULL ) -, SchemaEntry("ifcelectrictimecontroltypeenum",NULL ) -, SchemaEntry("ifcelementassemblytypeenum",NULL ) -, SchemaEntry("ifcelementcompositionenum",NULL ) -, SchemaEntry("ifcenergysequenceenum",NULL ) -, SchemaEntry("ifcenvironmentalimpactcategoryenum",NULL ) -, SchemaEntry("ifcevaporativecoolertypeenum",NULL ) -, SchemaEntry("ifcevaporatortypeenum",NULL ) -, SchemaEntry("ifcfantypeenum",NULL ) -, SchemaEntry("ifcfiltertypeenum",NULL ) -, SchemaEntry("ifcfiresuppressionterminaltypeenum",NULL ) -, SchemaEntry("ifcflowdirectionenum",NULL ) -, SchemaEntry("ifcflowinstrumenttypeenum",NULL ) -, SchemaEntry("ifcflowmetertypeenum",NULL ) -, SchemaEntry("ifcfootingtypeenum",NULL ) -, SchemaEntry("ifcgasterminaltypeenum",NULL ) -, SchemaEntry("ifcgeometricprojectionenum",NULL ) -, SchemaEntry("ifcglobalorlocalenum",NULL ) -, SchemaEntry("ifcheatexchangertypeenum",NULL ) -, SchemaEntry("ifchumidifiertypeenum",NULL ) -, SchemaEntry("ifcinternalorexternalenum",NULL ) -, SchemaEntry("ifcinventorytypeenum",NULL ) -, SchemaEntry("ifcjunctionboxtypeenum",NULL ) -, SchemaEntry("ifclamptypeenum",NULL ) -, SchemaEntry("ifclayersetdirectionenum",NULL ) -, SchemaEntry("ifclightdistributioncurveenum",NULL ) -, SchemaEntry("ifclightemissionsourceenum",NULL ) -, SchemaEntry("ifclightfixturetypeenum",NULL ) -, SchemaEntry("ifcloadgrouptypeenum",NULL ) -, SchemaEntry("ifclogicaloperatorenum",NULL ) -, SchemaEntry("ifcmembertypeenum",NULL ) -, SchemaEntry("ifcmotorconnectiontypeenum",NULL ) -, SchemaEntry("ifcnullstyle",NULL ) -, SchemaEntry("ifcobjecttypeenum",NULL ) -, SchemaEntry("ifcobjectiveenum",NULL ) -, SchemaEntry("ifcoccupanttypeenum",NULL ) -, SchemaEntry("ifcoutlettypeenum",NULL ) -, SchemaEntry("ifcpermeablecoveringoperationenum",NULL ) -, SchemaEntry("ifcphysicalorvirtualenum",NULL ) -, SchemaEntry("ifcpileconstructionenum",NULL ) -, SchemaEntry("ifcpiletypeenum",NULL ) -, SchemaEntry("ifcpipefittingtypeenum",NULL ) -, SchemaEntry("ifcpipesegmenttypeenum",NULL ) -, SchemaEntry("ifcplatetypeenum",NULL ) -, SchemaEntry("ifcproceduretypeenum",NULL ) -, SchemaEntry("ifcprofiletypeenum",NULL ) -, SchemaEntry("ifcprojectorderrecordtypeenum",NULL ) -, SchemaEntry("ifcprojectordertypeenum",NULL ) -, SchemaEntry("ifcprojectedortruelengthenum",NULL ) -, SchemaEntry("ifcpropertysourceenum",NULL ) -, SchemaEntry("ifcprotectivedevicetypeenum",NULL ) -, SchemaEntry("ifcpumptypeenum",NULL ) -, SchemaEntry("ifcrailingtypeenum",NULL ) -, SchemaEntry("ifcrampflighttypeenum",NULL ) -, SchemaEntry("ifcramptypeenum",NULL ) -, SchemaEntry("ifcreflectancemethodenum",NULL ) -, SchemaEntry("ifcreinforcingbarroleenum",NULL ) -, SchemaEntry("ifcreinforcingbarsurfaceenum",NULL ) -, SchemaEntry("ifcresourceconsumptionenum",NULL ) -, SchemaEntry("ifcribplatedirectionenum",NULL ) -, SchemaEntry("ifcroleenum",NULL ) -, SchemaEntry("ifcrooftypeenum",NULL ) -, SchemaEntry("ifcsiprefix",NULL ) -, SchemaEntry("ifcsiunitname",NULL ) -, SchemaEntry("ifcsanitaryterminaltypeenum",NULL ) -, SchemaEntry("ifcsectiontypeenum",NULL ) -, SchemaEntry("ifcsensortypeenum",NULL ) -, SchemaEntry("ifcsequenceenum",NULL ) -, SchemaEntry("ifcservicelifefactortypeenum",NULL ) -, SchemaEntry("ifcservicelifetypeenum",NULL ) -, SchemaEntry("ifcslabtypeenum",NULL ) -, SchemaEntry("ifcsoundscaleenum",NULL ) -, SchemaEntry("ifcspaceheatertypeenum",NULL ) -, SchemaEntry("ifcspacetypeenum",NULL ) -, SchemaEntry("ifcstackterminaltypeenum",NULL ) -, SchemaEntry("ifcstairflighttypeenum",NULL ) -, SchemaEntry("ifcstairtypeenum",NULL ) -, SchemaEntry("ifcstateenum",NULL ) -, SchemaEntry("ifcstructuralcurvetypeenum",NULL ) -, SchemaEntry("ifcstructuralsurfacetypeenum",NULL ) -, SchemaEntry("ifcsurfaceside",NULL ) -, SchemaEntry("ifcsurfacetextureenum",NULL ) -, SchemaEntry("ifcswitchingdevicetypeenum",NULL ) -, SchemaEntry("ifctanktypeenum",NULL ) -, SchemaEntry("ifctendontypeenum",NULL ) -, SchemaEntry("ifctextpath",NULL ) -, SchemaEntry("ifcthermalloadsourceenum",NULL ) -, SchemaEntry("ifcthermalloadtypeenum",NULL ) -, SchemaEntry("ifctimeseriesdatatypeenum",NULL ) -, SchemaEntry("ifctimeseriesscheduletypeenum",NULL ) -, SchemaEntry("ifctransformertypeenum",NULL ) -, SchemaEntry("ifctransitioncode",NULL ) -, SchemaEntry("ifctransportelementtypeenum",NULL ) -, SchemaEntry("ifctrimmingpreference",NULL ) -, SchemaEntry("ifctubebundletypeenum",NULL ) -, SchemaEntry("ifcunitenum",NULL ) -, SchemaEntry("ifcunitaryequipmenttypeenum",NULL ) -, SchemaEntry("ifcvalvetypeenum",NULL ) -, SchemaEntry("ifcvibrationisolatortypeenum",NULL ) -, SchemaEntry("ifcwalltypeenum",NULL ) -, SchemaEntry("ifcwasteterminaltypeenum",NULL ) -, SchemaEntry("ifcwindowpaneloperationenum",NULL ) -, SchemaEntry("ifcwindowpanelpositionenum",NULL ) -, SchemaEntry("ifcwindowstyleconstructionenum",NULL ) -, SchemaEntry("ifcwindowstyleoperationenum",NULL ) -, SchemaEntry("ifcworkcontroltypeenum",NULL ) -, SchemaEntry("ifcactorselect",NULL ) -, SchemaEntry("ifcappliedvalueselect",NULL ) -, SchemaEntry("ifcaxis2placement",NULL ) -, SchemaEntry("ifcbooleanoperand",NULL ) -, SchemaEntry("ifccharacterstyleselect",NULL ) -, SchemaEntry("ifcclassificationnotationselect",NULL ) -, SchemaEntry("ifccolour",NULL ) -, SchemaEntry("ifccolourorfactor",NULL ) -, SchemaEntry("ifcconditioncriterionselect",NULL ) -, SchemaEntry("ifccsgselect",NULL ) -, SchemaEntry("ifccurvefontorscaledcurvefontselect",NULL ) -, SchemaEntry("ifccurveoredgecurve",NULL ) -, SchemaEntry("ifccurvestylefontselect",NULL ) -, SchemaEntry("ifcdatetimeselect",NULL ) -, SchemaEntry("ifcdefinedsymbolselect",NULL ) -, SchemaEntry("ifcderivedmeasurevalue",NULL ) -, SchemaEntry("ifcdocumentselect",NULL ) -, SchemaEntry("ifcdraughtingcalloutelement",NULL ) -, SchemaEntry("ifcfillareastyletileshapeselect",NULL ) -, SchemaEntry("ifcfillstyleselect",NULL ) -, SchemaEntry("ifcgeometricsetselect",NULL ) -, SchemaEntry("ifchatchlinedistanceselect",NULL ) -, SchemaEntry("ifclayereditem",NULL ) -, SchemaEntry("ifclibraryselect",NULL ) -, SchemaEntry("ifclightdistributiondatasourceselect",NULL ) -, SchemaEntry("ifcmaterialselect",NULL ) -, SchemaEntry("ifcmeasurevalue",NULL ) -, SchemaEntry("ifcmetricvalueselect",NULL ) -, SchemaEntry("ifcobjectreferenceselect",NULL ) -, SchemaEntry("ifcorientationselect",NULL ) -, SchemaEntry("ifcpointorvertexpoint",NULL ) -, SchemaEntry("ifcpresentationstyleselect",NULL ) -, SchemaEntry("ifcshell",NULL ) -, SchemaEntry("ifcsimplevalue",NULL ) -, SchemaEntry("ifcsizeselect",NULL ) -, SchemaEntry("ifcspecularhighlightselect",NULL ) -, SchemaEntry("ifcstructuralactivityassignmentselect",NULL ) -, SchemaEntry("ifcsurfaceorfacesurface",NULL ) -, SchemaEntry("ifcsurfacestyleelementselect",NULL ) -, SchemaEntry("ifcsymbolstyleselect",NULL ) -, SchemaEntry("ifctextfontselect",NULL ) -, SchemaEntry("ifctextstyleselect",NULL ) -, SchemaEntry("ifctrimmingselect",NULL ) -, SchemaEntry("ifcunit",NULL ) -, SchemaEntry("ifcvalue",NULL ) -, SchemaEntry("ifcvectorordirection",NULL ) -, SchemaEntry("ifcrepresentationitem",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcgeometricrepresentationitem",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccurve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcboundedcurve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccompositecurve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifc2dcompositecurve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcroot",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcobjectdefinition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcobject",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccontrol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcactionrequest",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcactor",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcactorrole",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctypeobject",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctypeproduct",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcelementtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdistributionelementtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdistributioncontrolelementtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcactuatortype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcaddress",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdistributionflowelementtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcflowcontrollertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcairterminalboxtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcflowterminaltype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcairterminaltype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcenergyconversiondevicetype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcairtoairheatrecoverytype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcalarmtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdraughtingcallout",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdimensioncurvedirectedcallout",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcangulardimension",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcproduct",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcannotation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstyleditem",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcannotationoccurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcannotationcurveoccurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcannotationfillarea",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcannotationfillareaoccurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcannotationsurface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcannotationsurfaceoccurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcannotationsymboloccurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcannotationtextoccurrence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcapplication",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcappliedvalue",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcappliedvaluerelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcapproval",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcapprovalactorrelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcapprovalpropertyrelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcapprovalrelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcarbitraryclosedprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcarbitraryopenprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcarbitraryprofiledefwithvoids",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcgroup",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcasset",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcparameterizedprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcishapeprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcasymmetricishapeprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcplacement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcaxis1placement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcaxis2placement2d",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcaxis2placement3d",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcbsplinecurve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcbuildingelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcbeam",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcbuildingelementtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcbeamtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcbeziercurve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsurfacetexture",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcblobtexture",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccsgprimitive3d",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcblock",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcboilertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcbooleanresult",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcbooleanclippingresult",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcboundarycondition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcboundaryedgecondition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcboundaryfacecondition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcboundarynodecondition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcboundarynodeconditionwarping",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsurface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcboundedsurface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcboundingbox",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifchalfspacesolid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcboxedhalfspace",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcspatialstructureelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcbuilding",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcbuildingelementcomponent",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcbuildingelementpart",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcbuildingelementproxy",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcbuildingelementproxytype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcbuildingstorey",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccshapeprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcflowfittingtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccablecarrierfittingtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcflowsegmenttype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccablecarriersegmenttype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccablesegmenttype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccalendardate",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpoint",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccartesianpoint",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccartesiantransformationoperator",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccartesiantransformationoperator2d",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccartesiantransformationoperator2dnonuniform",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccartesiantransformationoperator3d",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccartesiantransformationoperator3dnonuniform",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccenterlineprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfeatureelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfeatureelementsubtraction",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcedgefeature",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcchamferedgefeature",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcchillertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconic",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccircle",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccircleprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccirclehollowprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcclassification",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcclassificationitem",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcclassificationitemrelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcclassificationnotation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcclassificationnotationfacet",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcexternalreference",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcclassificationreference",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctopologicalrepresentationitem",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconnectedfaceset",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcclosedshell",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccoiltype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccolourspecification",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccolourrgb",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccolumn",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccolumntype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcproperty",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccomplexproperty",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccompositecurvesegment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccompositeprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcflowmovingdevicetype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccompressortype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccondensertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccondition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconditioncriterion",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconnectiongeometry",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconnectioncurvegeometry",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconnectionpointgeometry",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconnectionpointeccentricity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconnectionportgeometry",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconnectionsurfacegeometry",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconstraint",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconstraintaggregationrelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconstraintclassificationrelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconstraintrelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcresource",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconstructionresource",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconstructionequipmentresource",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconstructionmaterialresource",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconstructionproductresource",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcnamedunit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccontextdependentunit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccontrollertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcconversionbasedunit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccooledbeamtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccoolingtowertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccoordinateduniversaltimeoffset",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccostitem",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccostschedule",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccostvalue",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccovering",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccoveringtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccranerailashapeprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccranerailfshapeprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccrewresource",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsolidmodel",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccsgsolid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccurrencyrelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccurtainwall",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccurtainwalltype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccurveboundedplane",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpresentationstyle",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccurvestyle",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccurvestylefont",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccurvestylefontandscaling",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifccurvestylefontpattern",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdampertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdateandtime",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdefinedsymbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcderivedprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcderivedunit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcderivedunitelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdiameterdimension",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdraughtingcalloutrelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdimensioncalloutrelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdimensioncurve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcterminatorsymbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdimensioncurveterminator",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdimensionpair",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdimensionalexponents",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdirection",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcelementcomponent",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdiscreteaccessory",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcelementcomponenttype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdiscreteaccessorytype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdistributionelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdistributionflowelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdistributionchamberelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdistributionchamberelementtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdistributioncontrolelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcport",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdistributionport",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdocumentelectronicformat",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdocumentinformation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdocumentinformationrelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdocumentreference",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdoor",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpropertydefinition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpropertysetdefinition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdoorliningproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdoorpanelproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdoorstyle",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpredefineditem",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpredefinedcolour",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdraughtingpredefinedcolour",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpredefinedcurvefont",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdraughtingpredefinedcurvefont",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpredefinedtextfont",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcdraughtingpredefinedtextfont",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcductfittingtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcductsegmenttype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcflowtreatmentdevicetype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcductsilencertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcedge",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcedgecurve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcloop",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcedgeloop",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcelectricappliancetype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcflowcontroller",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcelectricdistributionpoint",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcflowstoragedevicetype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcelectricflowstoragedevicetype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcelectricgeneratortype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcelectricheatertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcelectricmotortype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcelectrictimecontroltype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcenergyproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcelectricalbaseproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsystem",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcelectricalcircuit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcelectricalelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcelementassembly",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcelementquantity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcelementarysurface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcellipse",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcellipseprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcenergyconversiondevice",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcenvironmentalimpactvalue",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcequipmentelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcequipmentstandard",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcevaporativecoolertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcevaporatortype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmaterialproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcextendedmaterialproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcexternallydefinedhatchstyle",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcexternallydefinedsurfacestyle",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcexternallydefinedsymbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcexternallydefinedtextfont",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsweptareasolid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcextrudedareasolid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfacebasedsurfacemodel",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfacebound",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfaceouterbound",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfacesurface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmanifoldsolidbrep",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfacetedbrep",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfacetedbrepwithvoids",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralconnectioncondition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfailureconnectioncondition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfantype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfastener",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfastenertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfeatureelementaddition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfillareastyle",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfillareastylehatching",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfillareastyletilesymbolwithstyle",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfillareastyletiles",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfiltertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfiresuppressionterminaltype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcflowfitting",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcflowinstrumenttype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcflowmetertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcflowmovingdevice",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcflowsegment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcflowstoragedevice",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcflowterminal",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcflowtreatmentdevice",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfluidflowproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfooting",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfuelproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfurnishingelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfurnishingelementtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfurniturestandard",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcfurnituretype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcgasterminaltype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcgeneralmaterialproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcprofileproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcgeneralprofileproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcgeometricset",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcgeometriccurveset",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrepresentationcontext",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcgeometricrepresentationcontext",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcgeometricrepresentationsubcontext",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcgrid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcgridaxis",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcobjectplacement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcgridplacement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcheatexchangertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifchumidifiertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifchygroscopicmaterialproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcimagetexture",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcinventory",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctimeseries",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcirregulartimeseries",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcirregulartimeseriesvalue",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcjunctionboxtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifclshapeprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifclaborresource",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifclamptype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifclibraryinformation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifclibraryreference",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifclightdistributiondata",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifclightfixturetype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifclightintensitydistribution",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifclightsource",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifclightsourceambient",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifclightsourcedirectional",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifclightsourcegoniometric",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifclightsourcepositional",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifclightsourcespot",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcline",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifclineardimension",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifclocalplacement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifclocaltime",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmappeditem",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmaterial",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmaterialclassificationrelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcproductrepresentation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmaterialdefinitionrepresentation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmateriallayer",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmateriallayerset",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmateriallayersetusage",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmateriallist",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmeasurewithunit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmechanicalmaterialproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmechanicalconcretematerialproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmechanicalfastener",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmechanicalfastenertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmechanicalsteelmaterialproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmember",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmembertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmetric",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmonetaryunit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmotorconnectiontype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcprocess",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctask",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcmove",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcobjective",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcoccupant",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcoffsetcurve2d",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcoffsetcurve3d",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifconedirectionrepeatfactor",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcopenshell",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcopeningelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcopticalmaterialproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcorderaction",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcorganization",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcorganizationrelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcorientededge",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcoutlettype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcownerhistory",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpath",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcperformancehistory",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpermeablecoveringproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpermit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcperson",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpersonandorganization",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcphysicalquantity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcphysicalcomplexquantity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcphysicalsimplequantity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpile",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpipefittingtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpipesegmenttype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpixeltexture",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcplanarextent",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcplanarbox",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcplane",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcplate",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcplatetype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpointoncurve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpointonsurface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpolyloop",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpolygonalboundedhalfspace",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpolyline",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpostaladdress",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpredefinedsymbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpredefineddimensionsymbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpredefinedpointmarkersymbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpredefinedterminatorsymbol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpresentationlayerassignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpresentationlayerwithstyle",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpresentationstyleassignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcprocedure",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcproductdefinitionshape",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcproductsofcombustionproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcproject",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcprojectorder",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcprojectorderrecord",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcprojectioncurve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcprojectionelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsimpleproperty",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpropertyboundedvalue",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpropertyconstraintrelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpropertydependencyrelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpropertyenumeratedvalue",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpropertyenumeration",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpropertylistvalue",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpropertyreferencevalue",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpropertyset",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpropertysinglevalue",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpropertytablevalue",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcprotectivedevicetype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcproxy",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcpumptype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcquantityarea",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcquantitycount",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcquantitylength",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcquantitytime",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcquantityvolume",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcquantityweight",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcradiusdimension",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrailing",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrailingtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcramp",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrampflight",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrampflighttype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrationalbeziercurve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrectangleprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrectanglehollowprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrectangularpyramid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrectangulartrimmedsurface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcreferencesvaluedocument",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcregulartimeseries",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcreinforcementbarproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcreinforcementdefinitionproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcreinforcingelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcreinforcingbar",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcreinforcingmesh",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcreldecomposes",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelaggregates",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassigns",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassignstocontrol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassignstasks",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassignstoactor",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassignstogroup",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassignstoprocess",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassignstoproduct",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassignstoprojectorder",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassignstoresource",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassociates",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassociatesappliedvalue",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassociatesapproval",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassociatesclassification",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassociatesconstraint",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassociatesdocument",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassociateslibrary",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassociatesmaterial",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelassociatesprofileproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelconnects",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelconnectselements",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelconnectspathelements",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelconnectsporttoelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelconnectsports",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelconnectsstructuralactivity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelconnectsstructuralelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelconnectsstructuralmember",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelconnectswitheccentricity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelconnectswithrealizingelements",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelcontainedinspatialstructure",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelcoversbldgelements",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelcoversspaces",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcreldefines",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcreldefinesbyproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcreldefinesbytype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelfillselement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelflowcontrolelements",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelinteractionrequirements",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelnests",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcreloccupiesspaces",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcreloverridesproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelprojectselement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelreferencedinspatialstructure",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelschedulescostitems",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelsequence",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelservicesbuildings",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelspaceboundary",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelvoidselement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrelaxation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrepresentation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrepresentationmap",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrevolvedareasolid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcribplateprofileproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrightcircularcone",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcrightcircularcylinder",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcroof",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcroundededgefeature",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcroundedrectangleprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsiunit",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsanitaryterminaltype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcscheduletimecontrol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsectionproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsectionreinforcementproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsectionedspine",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsensortype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcservicelife",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcservicelifefactor",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcshapeaspect",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcshapemodel",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcshaperepresentation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcshellbasedsurfacemodel",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsite",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcslab",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcslabtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcslippageconnectioncondition",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsoundproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsoundvalue",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcspace",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcspaceheatertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcspaceprogram",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcspacethermalloadproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcspatialstructureelementtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcspacetype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsphere",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstackterminaltype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstair",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstairflight",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstairflighttype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralactivity",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralaction",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralanalysismodel",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralitem",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralconnection",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralcurveconnection",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralmember",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralcurvemember",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralcurvemembervarying",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructurallinearaction",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructurallinearactionvarying",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralload",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralloadgroup",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralloadstatic",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralloadlinearforce",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralloadplanarforce",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralloadsingledisplacement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralloadsingledisplacementdistortion",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralloadsingleforce",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralloadsingleforcewarping",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralloadtemperature",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralplanaraction",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralplanaractionvarying",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralpointaction",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralpointconnection",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralreaction",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralpointreaction",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralprofileproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralresultgroup",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralsteelprofileproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralsurfaceconnection",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralsurfacemember",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructuralsurfacemembervarying",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstructureddimensioncallout",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstylemodel",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcstyledrepresentation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsubcontractresource",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsubedge",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsurfacecurvesweptareasolid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsweptsurface",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsurfaceoflinearextrusion",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsurfaceofrevolution",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsurfacestyle",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsurfacestylelighting",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsurfacestylerefraction",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsurfacestyleshading",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsurfacestylerendering",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsurfacestylewithtextures",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsweptdisksolid",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcswitchingdevicetype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsymbolstyle",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcsystemfurnitureelementtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctshapeprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctable",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctablerow",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctanktype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctelecomaddress",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctendon",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctendonanchor",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctextliteral",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctextliteralwithextent",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctextstyle",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctextstylefontmodel",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctextstylefordefinedfont",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctextstyletextmodel",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctextstylewithboxcharacteristics",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctexturecoordinate",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctexturecoordinategenerator",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctexturemap",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctexturevertex",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcthermalmaterialproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctimeseriesreferencerelationship",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctimeseriesschedule",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctimeseriesvalue",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctopologyrepresentation",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctransformertype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctransportelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctransportelementtype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctrapeziumprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctrimmedcurve",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctubebundletype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifctwodirectionrepeatfactor",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcushapeprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcunitassignment",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcunitaryequipmenttype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcvalvetype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcvector",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcvertex",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcvertexbasedtexturemap",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcvertexloop",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcvertexpoint",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcvibrationisolatortype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcvirtualelement",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcvirtualgridintersection",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcwall",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcwallstandardcase",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcwalltype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcwasteterminaltype",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcwaterproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcwindow",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcwindowliningproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcwindowpanelproperties",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcwindowstyle",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcworkcontrol",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcworkplan",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifcworkschedule",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifczshapeprofiledef",&STEP::ObjectHelper::Construct ) -, SchemaEntry("ifczone",&STEP::ObjectHelper::Construct ) - - }; -} - -// ----------------------------------------------------------------------------------------------------------- -void IFC::GetSchema(EXPRESS::ConversionSchema& out) -{ - out = EXPRESS::ConversionSchema(schema_raw); -} - -namespace STEP { - -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const STEP::DB& db, const LIST& params, NotImplemented* in) -{ - return 0; -} - - - -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRepresentationItem* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricRepresentationItem* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCurve* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoundedCurve* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompositeCurve* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcCompositeCurve"); } do { // convert the 'Segments' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->Segments, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCompositeCurve to be a `LIST [1:?] OF IfcCompositeCurveSegment`")); } - } while(0); - do { // convert the 'SelfIntersect' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->SelfIntersect, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCompositeCurve to be a `LOGICAL`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, Ifc2DCompositeCurve* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRoot* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRoot"); } do { // convert the 'GlobalId' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->GlobalId, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRoot to be a `IfcGloballyUniqueId`")); } - } while(0); - do { // convert the 'OwnerHistory' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->OwnerHistory, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRoot to be a `IfcOwnerHistory`")); } - } while(0); - do { // convert the 'Name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Name, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcRoot to be a `IfcLabel`")); } - } while(0); - do { // convert the 'Description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Description, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRoot to be a `IfcText`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcObjectDefinition* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcObjectDefinition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcObject* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcObject"); } do { // convert the 'ObjectType' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->ObjectType, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcObject to be a `IfcLabel`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcControl* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcActionRequest* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcActor* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTypeObject* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTypeProduct* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionElementType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionControlElementType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcActuatorType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionFlowElementType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowControllerType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAirTerminalBoxType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowTerminalType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAirTerminalType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcEnergyConversionDeviceType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAirToAirHeatRecoveryType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAlarmType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDraughtingCallout* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDimensionCurveDirectedCallout* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAngularDimension* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcProduct* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to IfcProduct"); } do { // convert the 'ObjectPlacement' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->ObjectPlacement, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcProduct to be a `IfcObjectPlacement`")); } - } while(0); - do { // convert the 'Representation' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Representation, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcProduct to be a `IfcProductRepresentation`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotation* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to IfcAnnotation"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStyledItem* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcStyledItem"); } do { // convert the 'Item' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Item, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcStyledItem to be a `IfcRepresentationItem`")); } - } while(0); - do { // convert the 'Styles' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->Styles, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcStyledItem to be a `SET [1:?] OF IfcPresentationStyleAssignment`")); } - } while(0); - do { // convert the 'Name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Name, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcStyledItem to be a `IfcLabel`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationOccurrence* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationCurveOccurrence* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationFillArea* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationFillAreaOccurrence* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationSurface* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationSurfaceOccurrence* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationSymbolOccurrence* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationTextOccurrence* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcProfileDef* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcProfileDef"); } do { // convert the 'ProfileType' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->ProfileType, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcProfileDef to be a `IfcProfileTypeEnum`")); } - } while(0); - do { // convert the 'ProfileName' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->ProfileName, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcProfileDef to be a `IfcLabel`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcArbitraryClosedProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcArbitraryClosedProfileDef"); } do { // convert the 'OuterCurve' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->OuterCurve, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcArbitraryClosedProfileDef to be a `IfcCurve`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcArbitraryOpenProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcArbitraryOpenProfileDef"); } do { // convert the 'Curve' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->Curve, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcArbitraryOpenProfileDef to be a `IfcBoundedCurve`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcArbitraryProfileDefWithVoids* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcArbitraryProfileDefWithVoids"); } do { // convert the 'InnerCurves' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->InnerCurves, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcArbitraryProfileDefWithVoids to be a `SET [1:?] OF IfcCurve`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcGroup* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAsset* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcParameterizedProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcParameterizedProfileDef"); } do { // convert the 'Position' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->Position, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcParameterizedProfileDef to be a `IfcAxis2Placement2D`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcIShapeProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcIShapeProfileDef"); } do { // convert the 'OverallWidth' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->OverallWidth, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } - } while(0); - do { // convert the 'OverallDepth' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->OverallDepth, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } - } while(0); - do { // convert the 'WebThickness' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } - try { GenericConvert( in->WebThickness, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } - } while(0); - do { // convert the 'FlangeThickness' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } - try { GenericConvert( in->FlangeThickness, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } - } while(0); - do { // convert the 'FilletRadius' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[4]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->FilletRadius, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAsymmetricIShapeProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlacement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPlacement"); } do { // convert the 'Location' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->Location, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPlacement to be a `IfcCartesianPoint`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAxis1Placement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcAxis1Placement"); } do { // convert the 'Axis' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Axis, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcAxis1Placement to be a `IfcDirection`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAxis2Placement2D* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcAxis2Placement2D"); } do { // convert the 'RefDirection' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->RefDirection, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcAxis2Placement2D to be a `IfcDirection`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcAxis2Placement3D* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcAxis2Placement3D"); } do { // convert the 'Axis' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Axis, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcAxis2Placement3D to be a `IfcDirection`")); } - } while(0); - do { // convert the 'RefDirection' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->RefDirection, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcAxis2Placement3D to be a `IfcDirection`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBSplineCurve* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcBSplineCurve"); } do { // convert the 'Degree' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->Degree, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcBSplineCurve to be a `INTEGER`")); } - } while(0); - do { // convert the 'ControlPointsList' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->ControlPointsList, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBSplineCurve to be a `LIST [2:?] OF IfcCartesianPoint`")); } - } while(0); - do { // convert the 'CurveForm' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } - try { GenericConvert( in->CurveForm, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBSplineCurve to be a `IfcBSplineCurveForm`")); } - } while(0); - do { // convert the 'ClosedCurve' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } - try { GenericConvert( in->ClosedCurve, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcBSplineCurve to be a `LOGICAL`")); } - } while(0); - do { // convert the 'SelfIntersect' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[4]=true; break; } - try { GenericConvert( in->SelfIntersect, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcBSplineCurve to be a `LOGICAL`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcElement"); } do { // convert the 'Tag' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Tag, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcElement to be a `IfcIdentifier`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcBuildingElement"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBeam* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBeamType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBezierCurve* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCsgPrimitive3D* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBlock* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoilerType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBooleanResult* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcBooleanResult"); } do { // convert the 'Operator' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->Operator, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcBooleanResult to be a `IfcBooleanOperator`")); } - } while(0); - do { // convert the 'FirstOperand' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->FirstOperand, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBooleanResult to be a `IfcBooleanOperand`")); } - } while(0); - do { // convert the 'SecondOperand' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } - try { GenericConvert( in->SecondOperand, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBooleanResult to be a `IfcBooleanOperand`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBooleanClippingResult* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcBooleanClippingResult"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurface* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoundedSurface* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoundingBox* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcBoundingBox"); } do { // convert the 'Corner' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Corner, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcBoundingBox to be a `IfcCartesianPoint`")); } - } while(0); - do { // convert the 'XDim' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->XDim, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); } - } while(0); - do { // convert the 'YDim' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->YDim, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); } - } while(0); - do { // convert the 'ZDim' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->ZDim, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcHalfSpaceSolid* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcHalfSpaceSolid"); } do { // convert the 'BaseSurface' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->BaseSurface, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcHalfSpaceSolid to be a `IfcSurface`")); } - } while(0); - do { // convert the 'AgreementFlag' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->AgreementFlag, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcHalfSpaceSolid to be a `BOOLEAN`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoxedHalfSpace* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpatialStructureElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to IfcSpatialStructureElement"); } do { // convert the 'LongName' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->LongName, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcSpatialStructureElement to be a `IfcLabel`")); } - } while(0); - do { // convert the 'CompositionType' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->CompositionType, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcSpatialStructureElement to be a `IfcElementCompositionEnum`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuilding* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 12) { throw STEP::TypeError("expected 12 arguments to IfcBuilding"); } do { // convert the 'ElevationOfRefHeight' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->ElevationOfRefHeight, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcBuilding to be a `IfcLengthMeasure`")); } - } while(0); - do { // convert the 'ElevationOfTerrain' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->ElevationOfTerrain, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcBuilding to be a `IfcLengthMeasure`")); } - } while(0); - do { // convert the 'BuildingAddress' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->BuildingAddress, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 11 to IfcBuilding to be a `IfcPostalAddress`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementComponent* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementPart* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementProxy* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementProxyType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingStorey* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCShapeProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowFittingType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCableCarrierFittingType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowSegmentType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCableCarrierSegmentType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCableSegmentType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPoint* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianPoint* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcCartesianPoint"); } do { // convert the 'Coordinates' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Coordinates, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCartesianPoint to be a `LIST [1:3] OF IfcLengthMeasure`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcCartesianTransformationOperator"); } do { // convert the 'Axis1' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Axis1, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCartesianTransformationOperator to be a `IfcDirection`")); } - } while(0); - do { // convert the 'Axis2' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Axis2, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCartesianTransformationOperator to be a `IfcDirection`")); } - } while(0); - do { // convert the 'LocalOrigin' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } - try { GenericConvert( in->LocalOrigin, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcCartesianTransformationOperator to be a `IfcCartesianPoint`")); } - } while(0); - do { // convert the 'Scale' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Scale, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcCartesianTransformationOperator to be a `REAL`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator2D* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator2DnonUniform* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator3D* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcCartesianTransformationOperator3D"); } do { // convert the 'Axis3' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Axis3, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcCartesianTransformationOperator3D to be a `IfcDirection`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator3DnonUniform* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to IfcCartesianTransformationOperator3DnonUniform"); } do { // convert the 'Scale2' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Scale2, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcCartesianTransformationOperator3DnonUniform to be a `REAL`")); } - } while(0); - do { // convert the 'Scale3' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Scale3, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcCartesianTransformationOperator3DnonUniform to be a `REAL`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCenterLineProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFeatureElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcFeatureElement"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFeatureElementSubtraction* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcFeatureElementSubtraction"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcEdgeFeature* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcChamferEdgeFeature* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcChillerType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcConic* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcConic"); } do { // convert the 'Position' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->Position, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcConic to be a `IfcAxis2Placement`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCircle* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcCircle"); } do { // convert the 'Radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Radius, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCircle to be a `IfcPositiveLengthMeasure`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCircleProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcCircleProfileDef"); } do { // convert the 'Radius' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->Radius, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcCircleProfileDef to be a `IfcPositiveLengthMeasure`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCircleHollowProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcCircleHollowProfileDef"); } do { // convert the 'WallThickness' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->WallThickness, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcCircleHollowProfileDef to be a `IfcPositiveLengthMeasure`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTopologicalRepresentationItem* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcConnectedFaceSet* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcConnectedFaceSet"); } do { // convert the 'CfsFaces' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->CfsFaces, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcConnectedFaceSet to be a `SET [1:?] OF IfcFace`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcClosedShell* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcClosedShell"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCoilType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcColourSpecification* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcColourSpecification"); } do { // convert the 'Name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Name, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcColourSpecification to be a `IfcLabel`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcColourRgb* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcColourRgb"); } do { // convert the 'Red' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Red, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); } - } while(0); - do { // convert the 'Green' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Green, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); } - } while(0); - do { // convert the 'Blue' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Blue, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcColumn* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcColumnType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcProperty* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcProperty"); } do { // convert the 'Name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->Name, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcProperty to be a `IfcIdentifier`")); } - } while(0); - do { // convert the 'Description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Description, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcProperty to be a `IfcText`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcComplexProperty* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcComplexProperty"); } do { // convert the 'UsageName' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->UsageName, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcComplexProperty to be a `IfcIdentifier`")); } - } while(0); - do { // convert the 'HasProperties' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->HasProperties, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcComplexProperty to be a `SET [1:?] OF IfcProperty`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompositeCurveSegment* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcCompositeCurveSegment"); } do { // convert the 'Transition' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Transition, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCompositeCurveSegment to be a `IfcTransitionCode`")); } - } while(0); - do { // convert the 'SameSense' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->SameSense, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCompositeCurveSegment to be a `BOOLEAN`")); } - } while(0); - do { // convert the 'ParentCurve' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->ParentCurve, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcCompositeCurveSegment to be a `IfcCurve`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompositeProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowMovingDeviceType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompressorType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCondenserType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCondition* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcConditionCriterion* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcResource* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionResource* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionEquipmentResource* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionMaterialResource* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionProductResource* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcNamedUnit* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcNamedUnit"); } do { // convert the 'Dimensions' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->Dimensions, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcNamedUnit to be a `IfcDimensionalExponents`")); } - } while(0); - do { // convert the 'UnitType' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->UnitType, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcNamedUnit to be a `IfcUnitEnum`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcContextDependentUnit* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcControllerType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcConversionBasedUnit* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcConversionBasedUnit"); } do { // convert the 'Name' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Name, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcConversionBasedUnit to be a `IfcLabel`")); } - } while(0); - do { // convert the 'ConversionFactor' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->ConversionFactor, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcConversionBasedUnit to be a `IfcMeasureWithUnit`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCooledBeamType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCoolingTowerType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCostItem* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCostSchedule* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCovering* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCoveringType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCraneRailAShapeProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCraneRailFShapeProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCrewResource* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSolidModel* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCsgSolid* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCurtainWall* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCurtainWallType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcCurveBoundedPlane* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPresentationStyle* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPresentationStyle"); } do { // convert the 'Name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Name, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPresentationStyle to be a `IfcLabel`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDamperType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDefinedSymbol* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDerivedProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDiameterDimension* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDimensionCurve* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTerminatorSymbol* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDimensionCurveTerminator* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDirection* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcDirection"); } do { // convert the 'DirectionRatios' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->DirectionRatios, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcDirection to be a `LIST [2:3] OF REAL`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementComponent* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDiscreteAccessory* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementComponentType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDiscreteAccessoryType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionFlowElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionChamberElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionChamberElementType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionControlElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPort* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionPort* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDoor* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 10) { throw STEP::TypeError("expected 10 arguments to IfcDoor"); } do { // convert the 'OverallHeight' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->OverallHeight, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcDoor to be a `IfcPositiveLengthMeasure`")); } - } while(0); - do { // convert the 'OverallWidth' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->OverallWidth, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcDoor to be a `IfcPositiveLengthMeasure`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyDefinition* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPropertyDefinition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertySetDefinition* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPropertySetDefinition"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDoorStyle* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDuctFittingType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDuctSegmentType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowTreatmentDeviceType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcDuctSilencerType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcEdge* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcEdgeCurve* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcLoop* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcEdgeLoop* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricApplianceType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowController* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricDistributionPoint* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowStorageDeviceType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricFlowStorageDeviceType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricGeneratorType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricHeaterType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricMotorType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricTimeControlType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSystem* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricalCircuit* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricalElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementAssembly* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementQuantity* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcElementQuantity"); } do { // convert the 'MethodOfMeasurement' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->MethodOfMeasurement, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcElementQuantity to be a `IfcLabel`")); } - } while(0); - do { // convert the 'Quantities' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Quantities, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcElementQuantity to be a `SET [1:?] OF IfcPhysicalQuantity`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementarySurface* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcElementarySurface"); } do { // convert the 'Position' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->Position, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcElementarySurface to be a `IfcAxis2Placement3D`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcEllipse* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcEllipse"); } do { // convert the 'SemiAxis1' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->SemiAxis1, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcEllipse to be a `IfcPositiveLengthMeasure`")); } - } while(0); - do { // convert the 'SemiAxis2' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->SemiAxis2, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcEllipse to be a `IfcPositiveLengthMeasure`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcEllipseProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcEnergyConversionDevice* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcEquipmentElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcEquipmentStandard* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcEvaporativeCoolerType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcEvaporatorType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSweptAreaSolid* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcSweptAreaSolid"); } do { // convert the 'SweptArea' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->SweptArea, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSweptAreaSolid to be a `IfcProfileDef`")); } - } while(0); - do { // convert the 'Position' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->Position, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSweptAreaSolid to be a `IfcAxis2Placement3D`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcExtrudedAreaSolid* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcExtrudedAreaSolid"); } do { // convert the 'ExtrudedDirection' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->ExtrudedDirection, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcExtrudedAreaSolid to be a `IfcDirection`")); } - } while(0); - do { // convert the 'Depth' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Depth, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcExtrudedAreaSolid to be a `IfcPositiveLengthMeasure`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFace* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcFace"); } do { // convert the 'Bounds' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->Bounds, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcFace to be a `SET [1:?] OF IfcFaceBound`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFaceBasedSurfaceModel* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcFaceBasedSurfaceModel"); } do { // convert the 'FbsmFaces' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->FbsmFaces, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcFaceBasedSurfaceModel to be a `SET [1:?] OF IfcConnectedFaceSet`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFaceBound* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcFaceBound"); } do { // convert the 'Bound' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->Bound, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcFaceBound to be a `IfcLoop`")); } - } while(0); - do { // convert the 'Orientation' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->Orientation, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcFaceBound to be a `BOOLEAN`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFaceOuterBound* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcFaceOuterBound"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFaceSurface* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcManifoldSolidBrep* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcManifoldSolidBrep"); } do { // convert the 'Outer' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->Outer, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcManifoldSolidBrep to be a `IfcClosedShell`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFacetedBrep* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFacetedBrepWithVoids* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFanType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFastener* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFastenerType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFeatureElementAddition* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFillAreaStyleHatching* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFillAreaStyleTileSymbolWithStyle* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFillAreaStyleTiles* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFilterType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFireSuppressionTerminalType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowFitting* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowInstrumentType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowMeterType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowMovingDevice* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowSegment* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowStorageDevice* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowTerminal* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowTreatmentDevice* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFooting* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFurnishingElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFurnishingElementType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFurnitureStandard* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcFurnitureType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcGasTerminalType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricSet* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricCurveSet* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRepresentationContext* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcRepresentationContext"); } do { // convert the 'ContextIdentifier' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->ContextIdentifier, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentationContext to be a `IfcLabel`")); } - } while(0); - do { // convert the 'ContextType' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->ContextType, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentationContext to be a `IfcLabel`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricRepresentationContext* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcGeometricRepresentationContext"); } do { // convert the 'CoordinateSpaceDimension' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->CoordinateSpaceDimension, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcGeometricRepresentationContext to be a `IfcDimensionCount`")); } - } while(0); - do { // convert the 'Precision' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Precision, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcGeometricRepresentationContext to be a `REAL`")); } - } while(0); - do { // convert the 'WorldCoordinateSystem' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } - try { GenericConvert( in->WorldCoordinateSystem, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcGeometricRepresentationContext to be a `IfcAxis2Placement`")); } - } while(0); - do { // convert the 'TrueNorth' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->TrueNorth, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcGeometricRepresentationContext to be a `IfcDirection`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricRepresentationSubContext* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcGrid* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcObjectPlacement* in) -{ - size_t base = 0; - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcGridPlacement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcHeatExchangerType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcHumidifierType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcInventory* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcJunctionBoxType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcLShapeProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcLaborResource* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcLampType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightFixtureType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSource* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourceAmbient* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourceDirectional* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourceGoniometric* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourcePositional* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourceSpot* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcLine* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcLine"); } do { // convert the 'Pnt' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Pnt, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcLine to be a `IfcCartesianPoint`")); } - } while(0); - do { // convert the 'Dir' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Dir, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcLine to be a `IfcVector`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcLinearDimension* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcLocalPlacement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcLocalPlacement"); } do { // convert the 'PlacementRelTo' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->PlacementRelTo, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcLocalPlacement to be a `IfcObjectPlacement`")); } - } while(0); - do { // convert the 'RelativePlacement' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->RelativePlacement, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcLocalPlacement to be a `IfcAxis2Placement`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcMappedItem* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcMappedItem"); } do { // convert the 'MappingSource' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->MappingSource, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcMappedItem to be a `IfcRepresentationMap`")); } - } while(0); - do { // convert the 'MappingTarget' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->MappingTarget, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcMappedItem to be a `IfcCartesianTransformationOperator`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcProductRepresentation* in) -{ - size_t base = 0; - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcProductRepresentation"); } do { // convert the 'Name' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Name, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcProductRepresentation to be a `IfcLabel`")); } - } while(0); - do { // convert the 'Description' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Description, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcProductRepresentation to be a `IfcText`")); } - } while(0); - do { // convert the 'Representations' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } - try { GenericConvert( in->Representations, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcProductRepresentation to be a `LIST [1:?] OF IfcRepresentation`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcMaterialDefinitionRepresentation* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcMeasureWithUnit* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcMeasureWithUnit"); } do { // convert the 'ValueComponent' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->ValueComponent, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcMeasureWithUnit to be a `IfcValue`")); } - } while(0); - do { // convert the 'UnitComponent' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->UnitComponent, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcMeasureWithUnit to be a `IfcUnit`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcMechanicalFastener* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcMechanicalFastenerType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcMember* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcMemberType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcMotorConnectionType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcProcess* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTask* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcMove* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcOccupant* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcOffsetCurve2D* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcOffsetCurve3D* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcOneDirectionRepeatFactor* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcOpenShell* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcOpeningElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcOpeningElement"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcOrderAction* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcOrientedEdge* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcOutletType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPath* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPerformanceHistory* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPermit* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPile* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPipeFittingType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPipeSegmentType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlanarExtent* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlanarBox* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlane* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPlane"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlate* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlateType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPointOnCurve* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPointOnSurface* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPolyLoop* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPolyLoop"); } do { // convert the 'Polygon' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Polygon, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPolyLoop to be a `LIST [3:?] OF IfcCartesianPoint`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPolygonalBoundedHalfSpace* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPolygonalBoundedHalfSpace"); } do { // convert the 'Position' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Position, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcPolygonalBoundedHalfSpace to be a `IfcAxis2Placement3D`")); } - } while(0); - do { // convert the 'PolygonalBoundary' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->PolygonalBoundary, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPolygonalBoundedHalfSpace to be a `IfcBoundedCurve`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPolyline* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPolyline"); } do { // convert the 'Points' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Points, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPolyline to be a `LIST [2:?] OF IfcCartesianPoint`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPresentationStyleAssignment* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPresentationStyleAssignment"); } do { // convert the 'Styles' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Styles, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPresentationStyleAssignment to be a `SET [1:?] OF IfcPresentationStyleSelect`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcProcedure* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcProductDefinitionShape* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcProject* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to IfcProject"); } do { // convert the 'LongName' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->LongName, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcProject to be a `IfcLabel`")); } - } while(0); - do { // convert the 'Phase' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Phase, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcProject to be a `IfcLabel`")); } - } while(0); - do { // convert the 'RepresentationContexts' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->RepresentationContexts, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcProject to be a `SET [1:?] OF IfcRepresentationContext`")); } - } while(0); - do { // convert the 'UnitsInContext' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->UnitsInContext, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcProject to be a `IfcUnitAssignment`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcProjectOrder* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcProjectOrderRecord* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcProjectionCurve* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcProjectionElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSimpleProperty* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcSimpleProperty"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyBoundedValue* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyEnumeratedValue* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyListValue* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPropertyListValue"); } do { // convert the 'ListValues' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->ListValues, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcPropertyListValue to be a `LIST [1:?] OF IfcValue`")); } - } while(0); - do { // convert the 'Unit' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Unit, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPropertyListValue to be a `IfcUnit`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyReferenceValue* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertySet* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcPropertySet"); } do { // convert the 'HasProperties' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->HasProperties, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcPropertySet to be a `SET [1:?] OF IfcProperty`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertySingleValue* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPropertySingleValue"); } do { // convert the 'NominalValue' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->NominalValue, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcPropertySingleValue to be a `IfcValue`")); } - } while(0); - do { // convert the 'Unit' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Unit, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPropertySingleValue to be a `IfcUnit`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyTableValue* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcProtectiveDeviceType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcProxy* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcPumpType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRadiusDimension* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRailing* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRailingType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRamp* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRampFlight* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRampFlightType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRationalBezierCurve* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRectangleProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcRectangleProfileDef"); } do { // convert the 'XDim' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->XDim, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRectangleProfileDef to be a `IfcPositiveLengthMeasure`")); } - } while(0); - do { // convert the 'YDim' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->YDim, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRectangleProfileDef to be a `IfcPositiveLengthMeasure`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRectangleHollowProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRectangularPyramid* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRectangularTrimmedSurface* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcReinforcingElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcReinforcingBar* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcReinforcingMesh* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelationship* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRelationship"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelDecomposes* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelDecomposes"); } do { // convert the 'RelatingObject' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->RelatingObject, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelDecomposes to be a `IfcObjectDefinition`")); } - } while(0); - do { // convert the 'RelatedObjects' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - try { GenericConvert( in->RelatedObjects, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelDecomposes to be a `SET [1:?] OF IfcObjectDefinition`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelAggregates* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelAggregates"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelConnects* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRelConnects"); } return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelContainedInSpatialStructure* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelContainedInSpatialStructure"); } do { // convert the 'RelatedElements' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->RelatedElements, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelContainedInSpatialStructure to be a `SET [1:?] OF IfcProduct`")); } - } while(0); - do { // convert the 'RelatingStructure' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->RelatingStructure, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelContainedInSpatialStructure to be a `IfcSpatialStructureElement`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelDefines* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcRelDefines"); } do { // convert the 'RelatedObjects' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->RelatedObjects, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelDefines to be a `SET [1:?] OF IfcObject`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelDefinesByProperties* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelDefinesByProperties"); } do { // convert the 'RelatingPropertyDefinition' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->RelatingPropertyDefinition, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelDefinesByProperties to be a `IfcPropertySetDefinition`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelFillsElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelFillsElement"); } do { // convert the 'RelatingOpeningElement' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->RelatingOpeningElement, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelFillsElement to be a `IfcOpeningElement`")); } - } while(0); - do { // convert the 'RelatedBuildingElement' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->RelatedBuildingElement, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelFillsElement to be a `IfcElement`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelOverridesProperties* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelVoidsElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelVoidsElement"); } do { // convert the 'RelatingBuildingElement' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->RelatingBuildingElement, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelVoidsElement to be a `IfcElement`")); } - } while(0); - do { // convert the 'RelatedOpeningElement' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->RelatedOpeningElement, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelVoidsElement to be a `IfcFeatureElementSubtraction`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRepresentation* in) -{ - size_t base = 0; - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRepresentation"); } do { // convert the 'ContextOfItems' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->ContextOfItems, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentation to be a `IfcRepresentationContext`")); } - } while(0); - do { // convert the 'RepresentationIdentifier' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->RepresentationIdentifier, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentation to be a `IfcLabel`")); } - } while(0); - do { // convert the 'RepresentationType' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->RepresentationType, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcRepresentation to be a `IfcLabel`")); } - } while(0); - do { // convert the 'Items' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } - try { GenericConvert( in->Items, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRepresentation to be a `SET [1:?] OF IfcRepresentationItem`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRepresentationMap* in) -{ - size_t base = 0; - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcRepresentationMap"); } do { // convert the 'MappingOrigin' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->MappingOrigin, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentationMap to be a `IfcAxis2Placement`")); } - } while(0); - do { // convert the 'MappedRepresentation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->MappedRepresentation, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentationMap to be a `IfcRepresentation`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRevolvedAreaSolid* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRevolvedAreaSolid"); } do { // convert the 'Axis' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Axis, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcRevolvedAreaSolid to be a `IfcAxis1Placement`")); } - } while(0); - do { // convert the 'Angle' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Angle, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRevolvedAreaSolid to be a `IfcPlaneAngleMeasure`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRightCircularCone* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRightCircularCylinder* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRoof* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRoundedEdgeFeature* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcRoundedRectangleProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSIUnit* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcSIUnit"); } do { // convert the 'Prefix' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Prefix, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSIUnit to be a `IfcSIPrefix`")); } - } while(0); - do { // convert the 'Name' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Name, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcSIUnit to be a `IfcSIUnitName`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSanitaryTerminalType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcScheduleTimeControl* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSectionedSpine* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSensorType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcServiceLife* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcShapeModel* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcShapeRepresentation* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcShellBasedSurfaceModel* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcShellBasedSurfaceModel"); } do { // convert the 'SbsmBoundary' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->SbsmBoundary, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcShellBasedSurfaceModel to be a `SET [1:?] OF IfcShell`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSite* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 14) { throw STEP::TypeError("expected 14 arguments to IfcSite"); } do { // convert the 'RefLatitude' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->RefLatitude, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcSite to be a `IfcCompoundPlaneAngleMeasure`")); } - } while(0); - do { // convert the 'RefLongitude' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->RefLongitude, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcSite to be a `IfcCompoundPlaneAngleMeasure`")); } - } while(0); - do { // convert the 'RefElevation' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->RefElevation, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 11 to IfcSite to be a `IfcLengthMeasure`")); } - } while(0); - do { // convert the 'LandTitleNumber' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->LandTitleNumber, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 12 to IfcSite to be a `IfcLabel`")); } - } while(0); - do { // convert the 'SiteAddress' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->SiteAddress, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 13 to IfcSite to be a `IfcPostalAddress`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSlab* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSlabType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpace* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 11) { throw STEP::TypeError("expected 11 arguments to IfcSpace"); } do { // convert the 'InteriorOrExteriorSpace' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->InteriorOrExteriorSpace, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcSpace to be a `IfcInternalOrExternalEnum`")); } - } while(0); - do { // convert the 'ElevationWithFlooring' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->ElevationWithFlooring, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcSpace to be a `IfcLengthMeasure`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpaceHeaterType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpaceProgram* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpatialStructureElementType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpaceType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSphere* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStackTerminalType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStair* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStairFlight* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStairFlightType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralActivity* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralAction* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralAnalysisModel* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralItem* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralConnection* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralCurveConnection* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralMember* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralCurveMember* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralCurveMemberVarying* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralLinearAction* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralLinearActionVarying* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralLoadGroup* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPlanarAction* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPlanarActionVarying* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPointAction* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPointConnection* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralReaction* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPointReaction* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralResultGroup* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralSurfaceConnection* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralSurfaceMember* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralSurfaceMemberVarying* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuredDimensionCallout* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStyleModel* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcStyledRepresentation* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSubContractResource* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSubedge* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceCurveSweptAreaSolid* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSweptSurface* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceOfLinearExtrusion* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceOfRevolution* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceStyle* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcSurfaceStyle"); } do { // convert the 'Side' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Side, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSurfaceStyle to be a `IfcSurfaceSide`")); } - } while(0); - do { // convert the 'Styles' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Styles, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSurfaceStyle to be a `SET [1:5] OF IfcSurfaceStyleElementSelect`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceStyleShading* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcSurfaceStyleShading"); } do { // convert the 'SurfaceColour' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } - try { GenericConvert( in->SurfaceColour, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSurfaceStyleShading to be a `IfcColourRgb`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceStyleRendering* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to IfcSurfaceStyleRendering"); } do { // convert the 'Transparency' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->Transparency, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSurfaceStyleRendering to be a `IfcNormalisedRatioMeasure`")); } - } while(0); - do { // convert the 'DiffuseColour' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->DiffuseColour, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } - } while(0); - do { // convert the 'TransmissionColour' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->TransmissionColour, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } - } while(0); - do { // convert the 'DiffuseTransmissionColour' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->DiffuseTransmissionColour, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } - } while(0); - do { // convert the 'ReflectionColour' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->ReflectionColour, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } - } while(0); - do { // convert the 'SpecularColour' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->SpecularColour, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } - } while(0); - do { // convert the 'SpecularHighlight' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->SpecularHighlight, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcSurfaceStyleRendering to be a `IfcSpecularHighlightSelect`")); } - } while(0); - do { // convert the 'ReflectanceMethod' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->ReflectanceMethod, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcSurfaceStyleRendering to be a `IfcReflectanceMethodEnum`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceStyleWithTextures* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcSurfaceStyleWithTextures"); } do { // convert the 'Textures' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Textures, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSurfaceStyleWithTextures to be a `LIST [1:?] OF IfcSurfaceTexture`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSweptDiskSolid* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcSweptDiskSolid"); } do { // convert the 'Directrix' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Directrix, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSweptDiskSolid to be a `IfcCurve`")); } - } while(0); - do { // convert the 'Radius' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Radius, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSweptDiskSolid to be a `IfcPositiveLengthMeasure`")); } - } while(0); - do { // convert the 'InnerRadius' argument - std::shared_ptr arg = params[base++]; - if (dynamic_cast(&*arg)) break; - try { GenericConvert( in->InnerRadius, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSweptDiskSolid to be a `IfcPositiveLengthMeasure`")); } - } while(0); - do { // convert the 'StartParam' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->StartParam, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcSweptDiskSolid to be a `IfcParameterValue`")); } - } while(0); - do { // convert the 'EndParam' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->EndParam, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcSweptDiskSolid to be a `IfcParameterValue`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSwitchingDeviceType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcSystemFurnitureElementType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTShapeProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTankType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTendon* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTendonAnchor* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTextLiteral* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTextLiteralWithExtent* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTimeSeriesSchedule* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTopologyRepresentation* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTransformerType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTransportElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTransportElementType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTrapeziumProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTrimmedCurve* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcTrimmedCurve"); } do { // convert the 'BasisCurve' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->BasisCurve, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcTrimmedCurve to be a `IfcCurve`")); } - } while(0); - do { // convert the 'Trim1' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Trim1, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcTrimmedCurve to be a `SET [1:2] OF IfcTrimmingSelect`")); } - } while(0); - do { // convert the 'Trim2' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Trim2, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcTrimmedCurve to be a `SET [1:2] OF IfcTrimmingSelect`")); } - } while(0); - do { // convert the 'SenseAgreement' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->SenseAgreement, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcTrimmedCurve to be a `BOOLEAN`")); } - } while(0); - do { // convert the 'MasterRepresentation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->MasterRepresentation, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcTrimmedCurve to be a `IfcTrimmingPreference`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTubeBundleType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcTwoDirectionRepeatFactor* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcUShapeProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcUnitAssignment* in) -{ - size_t base = 0; - if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcUnitAssignment"); } do { // convert the 'Units' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Units, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcUnitAssignment to be a `SET [1:?] OF IfcUnit`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcUnitaryEquipmentType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcValveType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcVector* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); - if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcVector"); } do { // convert the 'Orientation' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Orientation, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcVector to be a `IfcDirection`")); } - } while(0); - do { // convert the 'Magnitude' argument - std::shared_ptr arg = params[base++]; - try { GenericConvert( in->Magnitude, arg, db ); break; } - catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcVector to be a `IfcLengthMeasure`")); } - } while(0); - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcVertex* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcVertexLoop* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcVertexPoint* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcVibrationIsolatorType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcVirtualElement* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcWall* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcWallStandardCase* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcWallType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcWasteTerminalType* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcWindow* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcWindowStyle* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcWorkControl* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcWorkPlan* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcWorkSchedule* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcZShapeProfileDef* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} -// ----------------------------------------------------------------------------------------------------------- -template <> size_t GenericFill(const DB& db, const LIST& params, IfcZone* in) -{ - size_t base = GenericFill(db,params,static_cast(in)); -// this data structure is not used yet, so there is no code generated to fill its members - return base; -} - -} // ! STEP -} // ! Assimp - -#endif diff --git a/code/IFCReaderGen1.cpp b/code/IFCReaderGen1.cpp new file mode 100644 index 000000000..d334e8322 --- /dev/null +++ b/code/IFCReaderGen1.cpp @@ -0,0 +1,3168 @@ +/* +Open Asset Import Library (ASSIMP) +---------------------------------------------------------------------- + +Copyright (c) 2006-2010, ASSIMP Development Team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the ASSIMP team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the ASSIMP Development Team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ + +/** MACHINE-GENERATED by scripts/ICFImporter/CppGenerator.py */ + +//#include "AssimpPCH.h" +#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER + +#include "IFCReaderGen.h" + +namespace Assimp { +using namespace IFC; + +namespace { + + typedef EXPRESS::ConversionSchema::SchemaEntry SchemaEntry; + const SchemaEntry schema_raw[] = { + SchemaEntry("ifcstairtypeenum",NULL ) +, SchemaEntry("ifcspacetypeenum",NULL ) +, SchemaEntry("ifcwalltypeenum",NULL ) +, SchemaEntry("ifcmonthinyearnumber",NULL ) +, SchemaEntry("ifcheatfluxdensitymeasure",NULL ) +, SchemaEntry("ifckinematicviscositymeasure",NULL ) +, SchemaEntry("ifcsequenceenum",NULL ) +, SchemaEntry("ifcairtoairheatrecoverytypeenum",NULL ) +, SchemaEntry("ifcactorselect",NULL ) +, SchemaEntry("ifctransformertypeenum",NULL ) +, SchemaEntry("ifcunitaryequipmenttypeenum",NULL ) +, SchemaEntry("ifcelectricflowstoragedevicetypeenum",NULL ) +, SchemaEntry("ifcenergysequenceenum",NULL ) +, SchemaEntry("ifcworkcontroltypeenum",NULL ) +, SchemaEntry("ifccurvaturemeasure",NULL ) +, SchemaEntry("ifcparametervalue",NULL ) +, SchemaEntry("ifcappliedvalueselect",NULL ) +, SchemaEntry("ifcwarpingconstantmeasure",NULL ) +, SchemaEntry("ifcarithmeticoperatorenum",NULL ) +, SchemaEntry("ifclinearforcemeasure",NULL ) +, SchemaEntry("ifcwindowpanelpositionenum",NULL ) +, SchemaEntry("ifcflowmetertypeenum",NULL ) +, SchemaEntry("ifcrampflighttypeenum",NULL ) +, SchemaEntry("ifcspecularhighlightselect",NULL ) +, SchemaEntry("ifcactiontypeenum",NULL ) +, SchemaEntry("ifcgeometricprojectionenum",NULL ) +, SchemaEntry("ifctimeseriesdatatypeenum",NULL ) +, SchemaEntry("ifcmagneticfluxmeasure",NULL ) +, SchemaEntry("ifcobjecttypeenum",NULL ) +, SchemaEntry("ifcdataoriginenum",NULL ) +, SchemaEntry("ifcmassdensitymeasure",NULL ) +, SchemaEntry("ifclightfixturetypeenum",NULL ) +, SchemaEntry("ifcservicelifetypeenum",NULL ) +, SchemaEntry("ifcelectricvoltagemeasure",NULL ) +, SchemaEntry("ifcheatingvaluemeasure",NULL ) +, SchemaEntry("ifcpresentabletext",NULL ) +, SchemaEntry("ifcaheadorbehind",NULL ) +, SchemaEntry("ifcsimplevalue",NULL ) +, SchemaEntry("ifcsensortypeenum",NULL ) +, SchemaEntry("ifcderivedunitenum",NULL ) +, SchemaEntry("ifcsizeselect",NULL ) +, SchemaEntry("ifctransportelementtypeenum",NULL ) +, SchemaEntry("ifcinventorytypeenum",NULL ) +, SchemaEntry("ifctextdecoration",NULL ) +, SchemaEntry("ifcdirectionsenseenum",NULL ) +, SchemaEntry("ifcductfittingtypeenum",NULL ) +, SchemaEntry("ifcdocumentstatusenum",NULL ) +, SchemaEntry("ifcslabtypeenum",NULL ) +, SchemaEntry("ifcdoorstyleconstructionenum",NULL ) +, SchemaEntry("ifcvolumemeasure",NULL ) +, SchemaEntry("ifcinductancemeasure",NULL ) +, SchemaEntry("ifccurtainwalltypeenum",NULL ) +, SchemaEntry("ifcsiunitname",NULL ) +, SchemaEntry("ifcspecularexponent",NULL ) +, SchemaEntry("ifcsoundpressuremeasure",NULL ) +, SchemaEntry("ifcanalysistheorytypeenum",NULL ) +, SchemaEntry("ifcgasterminaltypeenum",NULL ) +, SchemaEntry("ifcyearnumber",NULL ) +, SchemaEntry("ifcmodulusofelasticitymeasure",NULL ) +, SchemaEntry("ifcchangeactionenum",NULL ) +, SchemaEntry("ifcdampertypeenum",NULL ) +, SchemaEntry("ifcevaporatortypeenum",NULL ) +, SchemaEntry("ifcionconcentrationmeasure",NULL ) +, SchemaEntry("ifcductsegmenttypeenum",NULL ) +, SchemaEntry("ifcprotectivedevicetypeenum",NULL ) +, SchemaEntry("ifcabsorbeddosemeasure",NULL ) +, SchemaEntry("ifcmassperlengthmeasure",NULL ) +, SchemaEntry("ifctextfontname",NULL ) +, SchemaEntry("ifcorientationselect",NULL ) +, SchemaEntry("ifcilluminancemeasure",NULL ) +, SchemaEntry("ifcfiresuppressionterminaltypeenum",NULL ) +, SchemaEntry("ifcfontstyle",NULL ) +, SchemaEntry("ifcmomentofinertiameasure",NULL ) +, SchemaEntry("ifcmodulusofsubgradereactionmeasure",NULL ) +, SchemaEntry("ifccomplexnumber",NULL ) +, SchemaEntry("ifchumidifiertypeenum",NULL ) +, SchemaEntry("ifcpresentationstyleselect",NULL ) +, SchemaEntry("ifcthermaltransmittancemeasure",NULL ) +, SchemaEntry("ifcribplatedirectionenum",NULL ) +, SchemaEntry("ifcclassificationnotationselect",NULL ) +, SchemaEntry("ifcminuteinhour",NULL ) +, SchemaEntry("ifcinternalorexternalenum",NULL ) +, SchemaEntry("ifcrotationalfrequencymeasure",NULL ) +, SchemaEntry("ifcsanitaryterminaltypeenum",NULL ) +, SchemaEntry("ifcsymbolstyleselect",NULL ) +, SchemaEntry("ifcelementcompositionenum",NULL ) +, SchemaEntry("ifctextpath",NULL ) +, SchemaEntry("ifcpowermeasure",NULL ) +, SchemaEntry("ifcsurfacestyleelementselect",NULL ) +, SchemaEntry("ifcresourceconsumptionenum",NULL ) +, SchemaEntry("ifcelectriccapacitancemeasure",NULL ) +, SchemaEntry("ifclayersetdirectionenum",NULL ) +, SchemaEntry("ifcrailingtypeenum",NULL ) +, SchemaEntry("ifcobjectiveenum",NULL ) +, SchemaEntry("ifcdocumentselect",NULL ) +, SchemaEntry("ifcmodulusoflinearsubgradereactionmeasure",NULL ) +, SchemaEntry("ifcthermaladmittancemeasure",NULL ) +, SchemaEntry("ifctransitioncode",NULL ) +, SchemaEntry("ifcconnectiontypeenum",NULL ) +, SchemaEntry("ifcmonetarymeasure",NULL ) +, SchemaEntry("ifcstackterminaltypeenum",NULL ) +, SchemaEntry("ifccolour",NULL ) +, SchemaEntry("ifctext",NULL ) +, SchemaEntry("ifccontextdependentmeasure",NULL ) +, SchemaEntry("ifcthermalconductivitymeasure",NULL ) +, SchemaEntry("ifcprojectedortruelengthenum",NULL ) +, SchemaEntry("ifcpressuremeasure",NULL ) +, SchemaEntry("ifcmoisturediffusivitymeasure",NULL ) +, SchemaEntry("ifcbooleanoperator",NULL ) +, SchemaEntry("ifcpropertysourceenum",NULL ) +, SchemaEntry("ifctimestamp",NULL ) +, SchemaEntry("ifcmaterialselect",NULL ) +, SchemaEntry("ifcgloballyuniqueid",NULL ) +, SchemaEntry("ifcreflectancemethodenum",NULL ) +, SchemaEntry("ifcvaporpermeabilitymeasure",NULL ) +, SchemaEntry("ifctimeseriesscheduletypeenum",NULL ) +, SchemaEntry("ifclinearmomentmeasure",NULL ) +, SchemaEntry("ifcgeometricsetselect",NULL ) +, SchemaEntry("ifcsectionmodulusmeasure",NULL ) +, SchemaEntry("ifcbsplinecurveform",NULL ) +, SchemaEntry("ifcdimensionextentusage",NULL ) +, SchemaEntry("ifcthermalexpansioncoefficientmeasure",NULL ) +, SchemaEntry("ifchourinday",NULL ) +, SchemaEntry("ifclinearvelocitymeasure",NULL ) +, SchemaEntry("ifctorquemeasure",NULL ) +, SchemaEntry("ifctemperaturegradientmeasure",NULL ) +, SchemaEntry("ifcfillstyleselect",NULL ) +, SchemaEntry("ifcelectricchargemeasure",NULL ) +, SchemaEntry("ifcheatexchangertypeenum",NULL ) +, SchemaEntry("ifcelectriccurrentenum",NULL ) +, SchemaEntry("ifcdaylightsavinghour",NULL ) +, SchemaEntry("ifcshell",NULL ) +, SchemaEntry("ifcdoseequivalentmeasure",NULL ) +, SchemaEntry("ifcprojectordertypeenum",NULL ) +, SchemaEntry("ifcderivedmeasurevalue",NULL ) +, SchemaEntry("ifclightdistributioncurveenum",NULL ) +, SchemaEntry("ifcwarpingmomentmeasure",NULL ) +, SchemaEntry("ifcmembertypeenum",NULL ) +, SchemaEntry("ifcsoundpowermeasure",NULL ) +, SchemaEntry("ifctextalignment",NULL ) +, SchemaEntry("ifccurveoredgecurve",NULL ) +, SchemaEntry("ifcmassflowratemeasure",NULL ) +, SchemaEntry("ifcisothermalmoisturecapacitymeasure",NULL ) +, SchemaEntry("ifccsgselect",NULL ) +, SchemaEntry("ifccoolingtowertypeenum",NULL ) +, SchemaEntry("ifcmassmeasure",NULL ) +, SchemaEntry("ifcpileconstructionenum",NULL ) +, SchemaEntry("ifcdoorstyleoperationenum",NULL ) +, SchemaEntry("ifcflowdirectionenum",NULL ) +, SchemaEntry("ifcthermalloadsourceenum",NULL ) +, SchemaEntry("ifclengthmeasure",NULL ) +, SchemaEntry("ifcconstraintenum",NULL ) +, SchemaEntry("ifcaxis2placement",NULL ) +, SchemaEntry("ifcloadgrouptypeenum",NULL ) +, SchemaEntry("ifcvalue",NULL ) +, SchemaEntry("ifcreinforcingbarsurfaceenum",NULL ) +, SchemaEntry("ifcprojectorderrecordtypeenum",NULL ) +, SchemaEntry("ifcdatetimeselect",NULL ) +, SchemaEntry("ifcstructuralsurfacetypeenum",NULL ) +, SchemaEntry("ifcpermeablecoveringoperationenum",NULL ) +, SchemaEntry("ifcfontweight",NULL ) +, SchemaEntry("ifcphmeasure",NULL ) +, SchemaEntry("ifcdescriptivemeasure",NULL ) +, SchemaEntry("ifccurvestylefontselect",NULL ) +, SchemaEntry("ifcunit",NULL ) +, SchemaEntry("ifchatchlinedistanceselect",NULL ) +, SchemaEntry("ifctextstyleselect",NULL ) +, SchemaEntry("ifcmetricvalueselect",NULL ) +, SchemaEntry("ifcvectorordirection",NULL ) +, SchemaEntry("ifcassemblyplaceenum",NULL ) +, SchemaEntry("ifcairterminaltypeenum",NULL ) +, SchemaEntry("ifccoveringtypeenum",NULL ) +, SchemaEntry("ifcplanarforcemeasure",NULL ) +, SchemaEntry("ifcvalvetypeenum",NULL ) +, SchemaEntry("ifcalarmtypeenum",NULL ) +, SchemaEntry("ifcdynamicviscositymeasure",NULL ) +, SchemaEntry("ifccurrencyenum",NULL ) +, SchemaEntry("ifcmodulusofrotationalsubgradereactionmeasure",NULL ) +, SchemaEntry("ifccablecarrierfittingtypeenum",NULL ) +, SchemaEntry("ifcboolean",NULL ) +, SchemaEntry("ifcactionsourcetypeenum",NULL ) +, SchemaEntry("ifcstructuralactivityassignmentselect",NULL ) +, SchemaEntry("ifcdistributionchamberelementtypeenum",NULL ) +, SchemaEntry("ifcevaporativecoolertypeenum",NULL ) +, SchemaEntry("ifcmagneticfluxdensitymeasure",NULL ) +, SchemaEntry("ifclightdistributiondatasourceselect",NULL ) +, SchemaEntry("ifctubebundletypeenum",NULL ) +, SchemaEntry("ifcaccelerationmeasure",NULL ) +, SchemaEntry("ifcboilertypeenum",NULL ) +, SchemaEntry("ifcramptypeenum",NULL ) +, SchemaEntry("ifcluminousintensitydistributionmeasure",NULL ) +, SchemaEntry("ifctrimmingpreference",NULL ) +, SchemaEntry("ifcspecificheatcapacitymeasure",NULL ) +, SchemaEntry("ifcamountofsubstancemeasure",NULL ) +, SchemaEntry("ifcroleenum",NULL ) +, SchemaEntry("ifcdocumentconfidentialityenum",NULL ) +, SchemaEntry("ifcfrequencymeasure",NULL ) +, SchemaEntry("ifcsectiontypeenum",NULL ) +, SchemaEntry("ifcelementassemblytypeenum",NULL ) +, SchemaEntry("ifcfootingtypeenum",NULL ) +, SchemaEntry("ifclayereditem",NULL ) +, SchemaEntry("ifccablesegmenttypeenum",NULL ) +, SchemaEntry("ifcdefinedsymbolselect",NULL ) +, SchemaEntry("ifcbuildingelementproxytypeenum",NULL ) +, SchemaEntry("ifcelectricgeneratortypeenum",NULL ) +, SchemaEntry("ifcrotationalstiffnessmeasure",NULL ) +, SchemaEntry("ifcspaceheatertypeenum",NULL ) +, SchemaEntry("ifcareameasure",NULL ) +, SchemaEntry("ifclabel",NULL ) +, SchemaEntry("ifccostscheduletypeenum",NULL ) +, SchemaEntry("ifcswitchingdevicetypeenum",NULL ) +, SchemaEntry("ifcelectrictimecontroltypeenum",NULL ) +, SchemaEntry("ifcfiltertypeenum",NULL ) +, SchemaEntry("ifcpositivelengthmeasure",NULL ) +, SchemaEntry("ifcnullstyle",NULL ) +, SchemaEntry("ifcconditioncriterionselect",NULL ) +, SchemaEntry("ifcshearmodulusmeasure",NULL ) +, SchemaEntry("ifcnormalisedratiomeasure",NULL ) +, SchemaEntry("ifcdoorpaneloperationenum",NULL ) +, SchemaEntry("ifcpointorvertexpoint",NULL ) +, SchemaEntry("ifcrooftypeenum",NULL ) +, SchemaEntry("ifccountmeasure",NULL ) +, SchemaEntry("ifcelectricconductancemeasure",NULL ) +, SchemaEntry("ifcproceduretypeenum",NULL ) +, SchemaEntry("ifcflowinstrumenttypeenum",NULL ) +, SchemaEntry("ifcelectricmotortypeenum",NULL ) +, SchemaEntry("ifcsurfaceside",NULL ) +, SchemaEntry("ifcstructuralcurvetypeenum",NULL ) +, SchemaEntry("ifccondensertypeenum",NULL ) +, SchemaEntry("ifclinearstiffnessmeasure",NULL ) +, SchemaEntry("ifcunitenum",NULL ) +, SchemaEntry("ifcoccupanttypeenum",NULL ) +, SchemaEntry("ifcthermalloadtypeenum",NULL ) +, SchemaEntry("ifcreinforcingbarroleenum",NULL ) +, SchemaEntry("ifcbenchmarkenum",NULL ) +, SchemaEntry("ifcpositiveplaneanglemeasure",NULL ) +, SchemaEntry("ifctexttransformation",NULL ) +, SchemaEntry("ifcdraughtingcalloutelement",NULL ) +, SchemaEntry("ifcratiomeasure",NULL ) +, SchemaEntry("ifcsolidanglemeasure",NULL ) +, SchemaEntry("ifcpipesegmenttypeenum",NULL ) +, SchemaEntry("ifccablecarriersegmenttypeenum",NULL ) +, SchemaEntry("ifccolourorfactor",NULL ) +, SchemaEntry("ifcidentifier",NULL ) +, SchemaEntry("ifctendontypeenum",NULL ) +, SchemaEntry("ifccontrollertypeenum",NULL ) +, SchemaEntry("ifcradioactivitymeasure",NULL ) +, SchemaEntry("ifctimemeasure",NULL ) +, SchemaEntry("ifcpumptypeenum",NULL ) +, SchemaEntry("ifcelectricheatertypeenum",NULL ) +, SchemaEntry("ifcbeamtypeenum",NULL ) +, SchemaEntry("ifcstateenum",NULL ) +, SchemaEntry("ifcsiprefix",NULL ) +, SchemaEntry("ifcnumericmeasure",NULL ) +, SchemaEntry("ifcoutlettypeenum",NULL ) +, SchemaEntry("ifccompoundplaneanglemeasure",NULL ) +, SchemaEntry("ifcservicelifefactortypeenum",NULL ) +, SchemaEntry("ifclogicaloperatorenum",NULL ) +, SchemaEntry("ifcbooleanoperand",NULL ) +, SchemaEntry("ifcobjectreferenceselect",NULL ) +, SchemaEntry("ifccooledbeamtypeenum",NULL ) +, SchemaEntry("ifcductsilencertypeenum",NULL ) +, SchemaEntry("ifcsectionalareaintegralmeasure",NULL ) +, SchemaEntry("ifcfontvariant",NULL ) +, SchemaEntry("ifcvolumetricflowratemeasure",NULL ) +, SchemaEntry("ifcplatetypeenum",NULL ) +, SchemaEntry("ifcenvironmentalimpactcategoryenum",NULL ) +, SchemaEntry("ifcvibrationisolatortypeenum",NULL ) +, SchemaEntry("ifcthermodynamictemperaturemeasure",NULL ) +, SchemaEntry("ifcrotationalmassmeasure",NULL ) +, SchemaEntry("ifcsecondinminute",NULL ) +, SchemaEntry("ifcdayinmonthnumber",NULL ) +, SchemaEntry("ifcdimensioncount",NULL ) +, SchemaEntry("ifcwindowstyleoperationenum",NULL ) +, SchemaEntry("ifcthermalresistancemeasure",NULL ) +, SchemaEntry("ifcmeasurevalue",NULL ) +, SchemaEntry("ifcwindowpaneloperationenum",NULL ) +, SchemaEntry("ifcchillertypeenum",NULL ) +, SchemaEntry("ifcpositiveratiomeasure",NULL ) +, SchemaEntry("ifcinteger",NULL ) +, SchemaEntry("ifclogical",NULL ) +, SchemaEntry("ifcjunctionboxtypeenum",NULL ) +, SchemaEntry("ifcaddresstypeenum",NULL ) +, SchemaEntry("ifcwasteterminaltypeenum",NULL ) +, SchemaEntry("ifctrimmingselect",NULL ) +, SchemaEntry("ifclightemissionsourceenum",NULL ) +, SchemaEntry("ifcsoundscaleenum",NULL ) +, SchemaEntry("ifcluminousfluxmeasure",NULL ) +, SchemaEntry("ifcelectricresistancemeasure",NULL ) +, SchemaEntry("ifcintegercountratemeasure",NULL ) +, SchemaEntry("ifcphysicalorvirtualenum",NULL ) +, SchemaEntry("ifcmolecularweightmeasure",NULL ) +, SchemaEntry("ifcprofiletypeenum",NULL ) +, SchemaEntry("ifcboxalignment",NULL ) +, SchemaEntry("ifcglobalorlocalenum",NULL ) +, SchemaEntry("ifcspecularroughness",NULL ) +, SchemaEntry("ifclamptypeenum",NULL ) +, SchemaEntry("ifcpiletypeenum",NULL ) +, SchemaEntry("ifcelectriccurrentmeasure",NULL ) +, SchemaEntry("ifcfantypeenum",NULL ) +, SchemaEntry("ifcsurfaceorfacesurface",NULL ) +, SchemaEntry("ifcpipefittingtypeenum",NULL ) +, SchemaEntry("ifctanktypeenum",NULL ) +, SchemaEntry("ifccurvefontorscaledcurvefontselect",NULL ) +, SchemaEntry("ifcwindowstyleconstructionenum",NULL ) +, SchemaEntry("ifcairterminalboxtypeenum",NULL ) +, SchemaEntry("ifcstairflighttypeenum",NULL ) +, SchemaEntry("ifcluminousintensitymeasure",NULL ) +, SchemaEntry("ifcmotorconnectiontypeenum",NULL ) +, SchemaEntry("ifcplaneanglemeasure",NULL ) +, SchemaEntry("ifcactuatortypeenum",NULL ) +, SchemaEntry("ifccolumntypeenum",NULL ) +, SchemaEntry("ifctextfontselect",NULL ) +, SchemaEntry("ifcdoorpanelpositionenum",NULL ) +, SchemaEntry("ifccoiltypeenum",NULL ) +, SchemaEntry("ifcangularvelocitymeasure",NULL ) +, SchemaEntry("ifcanalysismodeltypeenum",NULL ) +, SchemaEntry("ifclibraryselect",NULL ) +, SchemaEntry("ifcforcemeasure",NULL ) +, SchemaEntry("ifcfillareastyletileshapeselect",NULL ) +, SchemaEntry("ifcelectricappliancetypeenum",NULL ) +, SchemaEntry("ifcsurfacetextureenum",NULL ) +, SchemaEntry("ifccharacterstyleselect",NULL ) +, SchemaEntry("ifcenergymeasure",NULL ) +, SchemaEntry("ifcreal",NULL ) +, SchemaEntry("ifccompressortypeenum",NULL ) +, SchemaEntry("ifcelectricdistributionpointfunctionenum",NULL ) +, SchemaEntry("ifcroot",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcobjectdefinition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctypeobject",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctypeproduct",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionflowelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowcontrollertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectrictimecontroltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcshapemodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctopologyrepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnects",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelcoversspaces",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowfittingtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccablecarrierfittingtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralconnectioncondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcslippageconnectioncondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcenergyconversiondevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccoiltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcobject",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccontrol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcperformancehistory",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrepresentationitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeometricrepresentationitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextliteral",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextliteralwithextent",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproductrepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproduct",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionflowelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundedcurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccompositecurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifc2dcompositecurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundarycondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundaryfacecondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesiantransformationoperator",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesiantransformationoperator3d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproperty",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsimpleproperty",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyenumeratedvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpresentationlayerassignment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpresentationlayerwithstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstairflighttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementarysurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplane",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbooleanresult",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbooleanclippingresult",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsolidmodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmanifoldsolidbrep",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprofileproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeneralprofileproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralprofileproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstackterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralconnection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralcurveconnection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcjunctionboxtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociates",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesconstraint",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertydefinition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertysetdefinition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdoorpanelproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstraintrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspacethermalloadproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclibraryinformation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprocess",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctask",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcappliedvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcenvironmentalimpactvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelfillselement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprocedure",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralload",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadstatic",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadsingledisplacement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproxy",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurvestylefont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstructionresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsubcontractresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccalendardate",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdocumentelectronicformat",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelcontainedinspatialstructure",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproductsofcombustionproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctopologicalrepresentationitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcedge",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcedgecurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplatetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcobjectplacement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgridplacement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfiresuppressionterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmechanicalmaterialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowstoragedevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcperson",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsweptsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfaceofrevolution",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcorientededge",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcownerhistory",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassigns",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstoactor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdirection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcementbarproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcparameterizedprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccshapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfeatureelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfeatureelementsubtraction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcedgefeature",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcchamferedgefeature",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccolumn",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyreferencevalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialclassificationrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricmotortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspatialstructureelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspacetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternalreference",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternallydefinedhatchstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccolumntype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccranerailashapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccondensertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectselements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectswithrealizingelements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccircleprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccirclehollowprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcorganizationrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplacement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcaxis2placement3d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpresentationstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurvestyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcequipmentelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccompositecurvesegment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrectangleprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcphysicalquantity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcphysicalcomplexquantity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociateslibrary",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelsequence",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelementproxy",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributioncontrolelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowinstrumenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdraughtingcallout",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdimensioncurvedirectedcallout",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclineardimension",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementassembly",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdraughtingcalloutrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccsgprimitive3d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrightcircularcone",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternallydefinedsurfacestyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprojectorder",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyconstraintrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclshapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcangulardimension",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextstylefordefinedfont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclocalplacement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsweptareasolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrevolvedareasolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralsurfaceconnection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcradiusdimension",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsweptdisksolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifchalfspacesolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpolygonalboundedhalfspace",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctimeseriesschedule",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdimensioncalloutrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccooledbeamtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproject",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcapprovalrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcevaporatortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclaborresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadsingledisplacementdistortion",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyboundedvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrampflighttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmember",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadplanarforce",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctubebundletype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvalvetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternallydefinedtextfont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctrimmedcurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreldefines",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreldefinesbyproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstocontrol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcactor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcoccupant",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifchumidifiertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcarbitraryopenprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstoprojectorder",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpermit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcoffsetcurve3d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsourcepositional",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacetexture",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcblobtexture",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccompositeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdocumentinformation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestylelighting",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcphysicalsimplequantity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantityarea",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctimeseries",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcclassificationnotation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcramp",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefineditem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefinedcurvefont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefinedcolour",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurrencyrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowmovingdevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspaceheatertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclamptype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelementcomponent",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcingelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcingbar",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricheatertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctshapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstraint",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcobjective",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralactivity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctexturecoordinate",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctexturemap",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmonetaryunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantitytime",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctablerow",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightdistributiondata",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcductfittingtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesiantransformationoperator2d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesiantransformationoperator2dnonuniform",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcclassificationnotationfacet",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesapproval",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdraughtingpredefinedcurvefont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadsingleforce",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadsingleforcewarping",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurvestylefontandscaling",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvirtualelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrightcircularcylinder",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcoutlettype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreldecomposes",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelnests",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccovering",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternallydefinedsymbol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcirregulartimeseries",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpolyline",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpath",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementcomponent",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfastener",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmappeditem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmetric",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdocumentreference",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsectionproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrectangularpyramid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelreferencedinspatialstructure",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccrewresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcnamedunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccontextdependentunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcunitaryequipmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcroof",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstasks",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralmember",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectsports",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstylemodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstyledrepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspatialstructureelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuilding",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectedfaceset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcopenshell",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfacetedbrep",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclocaltime",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmechanicalconcretematerialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconic",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccoveringtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcroundedrectangleprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcairterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowmovingdevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccompressortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwindowpanelproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefinedsymbol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefinedterminatorsymbol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcishapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcasymmetricishapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccontrollertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrailing",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgroup",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcasset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialdefinitionrepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurvestylefontpattern",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcapprovalpropertyrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrailingtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwall",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcclassificationitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralpointconnection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectiongeometry",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectionpointgeometry",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctimeseriesvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertylistvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfurniturestandard",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelschedulescostitems",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricgeneratortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdoor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstyleditem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotationoccurrence",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotationsymboloccurrence",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcarbitraryclosedprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcarbitraryprofiledefwithvoids",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcline",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmateriallayerset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowsegmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcairterminalboxtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectsstructuralmember",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertysinglevalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcalarmtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcellipseprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstair",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefinedtextfont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextstylefontmodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestyleshading",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpumptype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdefinedsymbol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcclassificationitemrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeneralmaterialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementcomponenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfastenertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmechanicalfastenertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpermeablecoveringproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowfitting",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcapproval",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcshapeaspect",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstraintclassificationrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsourcedirectional",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectsstructuralactivity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesprofileproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotationsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfuelproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowcontroller",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfailureconnectioncondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingstorey",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcworkcontrol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcworkschedule",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctable",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcductsegmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralsteelprofileproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdraughtingpredefinedtextfont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralsurfacemember",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralsurfacemembervarying",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfacesurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcclassification",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmateriallist",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccostschedule",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccoordinateduniversaltimeoffset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplanarextent",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplanarbox",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfillareastyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsectionreinforcementproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccolourspecification",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvector",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbeam",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccolourrgb",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralplanaraction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralplanaractionvarying",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsite",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdiscreteaccessorytype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvibrationisolatortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcevaporativecoolertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionchamberelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfeatureelementaddition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstoresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructureddimensioncallout",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccoolingtowertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccenterlineprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctexturevertex",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcorganization",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwindowstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsourcegoniometric",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcribplateprofileproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctransformertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmembertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfaceoflinearextrusion",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmotorconnectiontype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowtreatmentdevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcductsilencertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwindowliningproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfurnishingelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsystemfurnitureelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectionpointeccentricity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwasteterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbsplinecurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbeziercurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdocumentinformationrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcactuatortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributioncontrolelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesdocument",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdoorliningproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcshellbasedsurfacemodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcactionrequest",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcextrudedareasolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsystem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfillareastylehatching",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelvoidselement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectspathelements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelspaceboundary",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacecurvesweptareasolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesiantransformationoperator3dnonuniform",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelinteractionrequirements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurtainwalltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantitylength",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcequipmentstandard",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowstoragedevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvirtualgridintersection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdiameterdimension",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcswitchingdevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcaddress",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctelecomaddress",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwindow",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmechanicalsteelmaterialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowtreatmentdevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelservicesbuildings",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcchillertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstoproduct",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrectanglehollowprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcenergyproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboxedhalfspace",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcaxis2placement2d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspaceprogram",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpoint",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesianpoint",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundedsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcloop",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpolyloop",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefinedpointmarkersymbol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcterminatorsymbol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdimensioncurveterminator",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelprojectselement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctrapeziumprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrepresentationcontext",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeometricrepresentationcontext",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextstylewithboxcharacteristics",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurveboundedplane",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantitycount",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctimeseriesreferencerelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadtemperature",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsiunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralreaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralpointreaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcaxis1placement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcementdefinitionproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricappliancetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsensortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfurnishingelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprotectivedevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifczshapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcscheduletimecontrol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrepresentationmap",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcclosedshell",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelementpart",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdraughtingpredefinedcolour",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpostaladdress",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcblock",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightfixturetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcopeningelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsourcespot",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctendonanchor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestylerefraction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricflowstoragedevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfluidflowproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsphere",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesappliedvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdampertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprojectorderrecord",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdimensionalexponents",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreldefinesbytype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionchamberelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmechanicalfastener",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantityvolume",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrectangulartrimmedsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdateandtime",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifczone",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfantype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeometricset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfillareastyletiles",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpixeltexture",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccablesegmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreloverridesproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmeasurewithunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcslabtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcservicelife",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfurnituretype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccostitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcingmesh",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcextendedmaterialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcactorrole",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfacetedbrepwithvoids",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstraintaggregationrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgasterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectswitheccentricity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpile",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfillareastyletilesymbolwithstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricalbaseproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstructionmaterialresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotationcurveoccurrence",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdimensioncurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeometriccurveset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelaggregates",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfacebasedsurfacemodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcenergyconversiondevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrampflight",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyenumeration",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvertexloop",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplate",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcushapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifchygroscopicmaterialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfacebound",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfaceouterbound",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifconedirectionrepeatfactor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboilertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstructionequipmentresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccomplexproperty",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfooting",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcopticalmaterialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstructionproductresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundaryedgecondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcderivedprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertytablevalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstogroup",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowmetertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdoorstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectsporttoelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesclassification",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcunitassignment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowterminal",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccranerailfshapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowsegment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementquantity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundarynodecondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundarynodeconditionwarping",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurtainwall",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdiscreteaccessory",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgrid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsanitaryterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsoundproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsubedge",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextstyletextmodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfiltertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsymbolstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctendon",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdimensionpair",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadgroup",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpresentationstyleassignment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcregulartimeseries",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralcurvemember",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsourceambient",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcport",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspace",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcheatexchangertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctanktype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcinventory",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcappliedvaluerelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsoundvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctransportelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcairtoairheatrecoverytype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstairflight",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricalelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightintensitydistribution",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcclassificationreference",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestylewithtextures",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundingbox",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcapplication",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwalltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmove",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccircle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcoffsetcurve2d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmateriallayersetusage",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpointoncurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralresultgroup",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsectionedspine",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcslab",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectionportgeometry",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantityweight",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesmaterial",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvertex",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvertexpoint",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreferencesvaluedocument",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpersonandorganization",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelflowcontrolelements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstoprocess",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructurallinearaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructurallinearactionvarying",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelementproxytype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprojectionelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcderivedunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcapprovalactorrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconversionbasedunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterial",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeometricrepresentationsubcontext",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotationsurfaceoccurrence",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefineddimensionsymbol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcroundededgefeature",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelcoversbldgelements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricdistributionpoint",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccablecarriersegmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadlinearforce",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgridaxis",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcirregulartimeseriesvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwallstandardcase",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreloccupiesspaces",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcderivedunitelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccsgsolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbeamtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotationfillarea",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelaxation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralcurvemembervarying",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpointonsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertydependencyrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvertexbasedtexturemap",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcorderaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclibraryreference",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcedgeloop",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotationfillareaoccurrence",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectsstructuralelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcworkplan",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcellipse",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproductdefinitionshape",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprojectioncurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricalcircuit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrationalbeziercurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralpointaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcservicelifefactor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcthermalmaterialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctexturecoordinategenerator",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpipesegmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctwodirectionrepeatfactor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcshaperepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestylerendering",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionport",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcimagetexture",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpipefittingtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctransportelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotationtextoccurrence",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectionsurfacegeometry",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralanalysismodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectioncurvegeometry",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconditioncriterion",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwaterproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmateriallayer",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccostvalue",&STEP::ObjectHelper::Construct ) + + }; +} + +// ----------------------------------------------------------------------------------------------------------- +void IFC::GetSchema(EXPRESS::ConversionSchema& out) +{ + out = EXPRESS::ConversionSchema(schema_raw); +} + +namespace STEP { + +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const STEP::DB& db, const LIST& params, NotImplemented* in) +{ + return 0; +} + + + +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRoot* in) +{ + size_t base = 0; + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRoot"); } do { // convert the 'GlobalId' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->GlobalId, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRoot to be a `IfcGloballyUniqueId`")); } + } while(0); + do { // convert the 'OwnerHistory' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->OwnerHistory, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRoot to be a `IfcOwnerHistory`")); } + } while(0); + do { // convert the 'Name' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcRoot to be a `IfcLabel`")); } + } while(0); + do { // convert the 'Description' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Description, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRoot to be a `IfcText`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcObjectDefinition* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcObjectDefinition"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTypeObject* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTypeProduct* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionFlowElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowControllerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricTimeControlType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRepresentation* in) +{ + size_t base = 0; + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRepresentation"); } do { // convert the 'ContextOfItems' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->ContextOfItems, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentation to be a `IfcRepresentationContext`")); } + } while(0); + do { // convert the 'RepresentationIdentifier' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->RepresentationIdentifier, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentation to be a `IfcLabel`")); } + } while(0); + do { // convert the 'RepresentationType' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->RepresentationType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcRepresentation to be a `IfcLabel`")); } + } while(0); + do { // convert the 'Items' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } + try { GenericConvert( in->Items, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRepresentation to be a `SET [1:?] OF IfcRepresentationItem`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcShapeModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTopologyRepresentation* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelationship* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRelationship"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelConnects* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRelConnects"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowFittingType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCableCarrierFittingType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEnergyConversionDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCoilType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcObject* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcObject"); } do { // convert the 'ObjectType' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ObjectType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcObject to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcControl* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPerformanceHistory* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRepresentationItem* in) +{ + size_t base = 0; + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricRepresentationItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTextLiteral* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTextLiteralWithExtent* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProductRepresentation* in) +{ + size_t base = 0; + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcProductRepresentation"); } do { // convert the 'Name' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcProductRepresentation to be a `IfcLabel`")); } + } while(0); + do { // convert the 'Description' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Description, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcProductRepresentation to be a `IfcText`")); } + } while(0); + do { // convert the 'Representations' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->Representations, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcProductRepresentation to be a `LIST [1:?] OF IfcRepresentation`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProduct* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to IfcProduct"); } do { // convert the 'ObjectPlacement' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ObjectPlacement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcProduct to be a `IfcObjectPlacement`")); } + } while(0); + do { // convert the 'Representation' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Representation, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcProduct to be a `IfcProductRepresentation`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcElement"); } do { // convert the 'Tag' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Tag, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcElement to be a `IfcIdentifier`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionFlowElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoundedCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompositeCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcCompositeCurve"); } do { // convert the 'Segments' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Segments, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCompositeCurve to be a `LIST [1:?] OF IfcCompositeCurveSegment`")); } + } while(0); + do { // convert the 'SelfIntersect' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->SelfIntersect, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCompositeCurve to be a `LOGICAL`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, Ifc2DCompositeCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcCartesianTransformationOperator"); } do { // convert the 'Axis1' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Axis1, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCartesianTransformationOperator to be a `IfcDirection`")); } + } while(0); + do { // convert the 'Axis2' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Axis2, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCartesianTransformationOperator to be a `IfcDirection`")); } + } while(0); + do { // convert the 'LocalOrigin' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->LocalOrigin, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcCartesianTransformationOperator to be a `IfcCartesianPoint`")); } + } while(0); + do { // convert the 'Scale' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Scale, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcCartesianTransformationOperator to be a `REAL`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator3D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcCartesianTransformationOperator3D"); } do { // convert the 'Axis3' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Axis3, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcCartesianTransformationOperator3D to be a `IfcDirection`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProperty* in) +{ + size_t base = 0; + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcProperty"); } do { // convert the 'Name' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcProperty to be a `IfcIdentifier`")); } + } while(0); + do { // convert the 'Description' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Description, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcProperty to be a `IfcText`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSimpleProperty* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcSimpleProperty"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyEnumeratedValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStairFlightType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementarySurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcElementarySurface"); } do { // convert the 'Position' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Position, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcElementarySurface to be a `IfcAxis2Placement3D`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlane* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPlane"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBooleanResult* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcBooleanResult"); } do { // convert the 'Operator' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Operator, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcBooleanResult to be a `IfcBooleanOperator`")); } + } while(0); + do { // convert the 'FirstOperand' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->FirstOperand, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBooleanResult to be a `IfcBooleanOperand`")); } + } while(0); + do { // convert the 'SecondOperand' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->SecondOperand, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBooleanResult to be a `IfcBooleanOperand`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBooleanClippingResult* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcBooleanClippingResult"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSolidModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcManifoldSolidBrep* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcManifoldSolidBrep"); } do { // convert the 'Outer' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Outer, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcManifoldSolidBrep to be a `IfcClosedShell`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStackTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralConnection* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralCurveConnection* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcJunctionBoxType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyDefinition* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPropertyDefinition"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertySetDefinition* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPropertySetDefinition"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProcess* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTask* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelFillsElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelFillsElement"); } do { // convert the 'RelatingOpeningElement' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatingOpeningElement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelFillsElement to be a `IfcOpeningElement`")); } + } while(0); + do { // convert the 'RelatedBuildingElement' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatedBuildingElement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelFillsElement to be a `IfcElement`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProcedure* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProxy* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSubContractResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelContainedInSpatialStructure* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelContainedInSpatialStructure"); } do { // convert the 'RelatedElements' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatedElements, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelContainedInSpatialStructure to be a `SET [1:?] OF IfcProduct`")); } + } while(0); + do { // convert the 'RelatingStructure' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatingStructure, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelContainedInSpatialStructure to be a `IfcSpatialStructureElement`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTopologicalRepresentationItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEdge* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEdgeCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlateType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcObjectPlacement* in) +{ + size_t base = 0; + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGridPlacement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFireSuppressionTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowStorageDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSweptSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceOfRevolution* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOrientedEdge* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDirection* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcDirection"); } do { // convert the 'DirectionRatios' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->DirectionRatios, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcDirection to be a `LIST [2:3] OF REAL`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProfileDef* in) +{ + size_t base = 0; + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcProfileDef"); } do { // convert the 'ProfileType' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->ProfileType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcProfileDef to be a `IfcProfileTypeEnum`")); } + } while(0); + do { // convert the 'ProfileName' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ProfileName, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcProfileDef to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcParameterizedProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcParameterizedProfileDef"); } do { // convert the 'Position' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Position, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcParameterizedProfileDef to be a `IfcAxis2Placement2D`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFeatureElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcFeatureElement"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFeatureElementSubtraction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcFeatureElementSubtraction"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEdgeFeature* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcChamferEdgeFeature* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcBuildingElement"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcColumn* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyReferenceValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricMotorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpatialStructureElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpaceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcColumnType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCraneRailAShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCondenserType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCircleProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcCircleProfileDef"); } do { // convert the 'Radius' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Radius, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcCircleProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCircleHollowProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcCircleHollowProfileDef"); } do { // convert the 'WallThickness' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->WallThickness, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcCircleHollowProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlacement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPlacement"); } do { // convert the 'Location' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Location, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPlacement to be a `IfcCartesianPoint`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAxis2Placement3D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcAxis2Placement3D"); } do { // convert the 'Axis' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Axis, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcAxis2Placement3D to be a `IfcDirection`")); } + } while(0); + do { // convert the 'RefDirection' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->RefDirection, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcAxis2Placement3D to be a `IfcDirection`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPresentationStyle* in) +{ + size_t base = 0; + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPresentationStyle"); } do { // convert the 'Name' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPresentationStyle to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEquipmentElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompositeCurveSegment* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcCompositeCurveSegment"); } do { // convert the 'Transition' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Transition, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCompositeCurveSegment to be a `IfcTransitionCode`")); } + } while(0); + do { // convert the 'SameSense' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->SameSense, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCompositeCurveSegment to be a `BOOLEAN`")); } + } while(0); + do { // convert the 'ParentCurve' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->ParentCurve, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcCompositeCurveSegment to be a `IfcCurve`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRectangleProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcRectangleProfileDef"); } do { // convert the 'XDim' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->XDim, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRectangleProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'YDim' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->YDim, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRectangleProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementProxy* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionControlElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowInstrumentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDraughtingCallout* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDimensionCurveDirectedCallout* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLinearDimension* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementAssembly* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCsgPrimitive3D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRightCircularCone* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProjectOrder* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAngularDimension* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLocalPlacement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcLocalPlacement"); } do { // convert the 'PlacementRelTo' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->PlacementRelTo, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcLocalPlacement to be a `IfcObjectPlacement`")); } + } while(0); + do { // convert the 'RelativePlacement' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelativePlacement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcLocalPlacement to be a `IfcAxis2Placement`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSweptAreaSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcSweptAreaSolid"); } do { // convert the 'SweptArea' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->SweptArea, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSweptAreaSolid to be a `IfcProfileDef`")); } + } while(0); + do { // convert the 'Position' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->Position, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSweptAreaSolid to be a `IfcAxis2Placement3D`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRevolvedAreaSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRevolvedAreaSolid"); } do { // convert the 'Axis' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Axis, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcRevolvedAreaSolid to be a `IfcAxis1Placement`")); } + } while(0); + do { // convert the 'Angle' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Angle, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRevolvedAreaSolid to be a `IfcPlaneAngleMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralSurfaceConnection* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRadiusDimension* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSweptDiskSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcSweptDiskSolid"); } do { // convert the 'Directrix' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Directrix, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSweptDiskSolid to be a `IfcCurve`")); } + } while(0); + do { // convert the 'Radius' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Radius, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSweptDiskSolid to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'InnerRadius' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->InnerRadius, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSweptDiskSolid to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'StartParam' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->StartParam, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcSweptDiskSolid to be a `IfcParameterValue`")); } + } while(0); + do { // convert the 'EndParam' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->EndParam, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcSweptDiskSolid to be a `IfcParameterValue`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcHalfSpaceSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcHalfSpaceSolid"); } do { // convert the 'BaseSurface' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->BaseSurface, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcHalfSpaceSolid to be a `IfcSurface`")); } + } while(0); + do { // convert the 'AgreementFlag' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->AgreementFlag, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcHalfSpaceSolid to be a `BOOLEAN`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPolygonalBoundedHalfSpace* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPolygonalBoundedHalfSpace"); } do { // convert the 'Position' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Position, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcPolygonalBoundedHalfSpace to be a `IfcAxis2Placement3D`")); } + } while(0); + do { // convert the 'PolygonalBoundary' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->PolygonalBoundary, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPolygonalBoundedHalfSpace to be a `IfcBoundedCurve`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTimeSeriesSchedule* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCooledBeamType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProject* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to IfcProject"); } do { // convert the 'LongName' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->LongName, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcProject to be a `IfcLabel`")); } + } while(0); + do { // convert the 'Phase' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Phase, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcProject to be a `IfcLabel`")); } + } while(0); + do { // convert the 'RepresentationContexts' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->RepresentationContexts, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcProject to be a `SET [1:?] OF IfcRepresentationContext`")); } + } while(0); + do { // convert the 'UnitsInContext' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->UnitsInContext, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcProject to be a `IfcUnitAssignment`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEvaporatorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLaborResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyBoundedValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRampFlightType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMember* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTubeBundleType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcValveType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTrimmedCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcTrimmedCurve"); } do { // convert the 'BasisCurve' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->BasisCurve, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcTrimmedCurve to be a `IfcCurve`")); } + } while(0); + do { // convert the 'Trim1' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Trim1, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcTrimmedCurve to be a `SET [1:2] OF IfcTrimmingSelect`")); } + } while(0); + do { // convert the 'Trim2' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Trim2, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcTrimmedCurve to be a `SET [1:2] OF IfcTrimmingSelect`")); } + } while(0); + do { // convert the 'SenseAgreement' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->SenseAgreement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcTrimmedCurve to be a `BOOLEAN`")); } + } while(0); + do { // convert the 'MasterRepresentation' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->MasterRepresentation, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcTrimmedCurve to be a `IfcTrimmingPreference`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelDefines* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcRelDefines"); } do { // convert the 'RelatedObjects' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->RelatedObjects, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelDefines to be a `SET [1:?] OF IfcObject`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelDefinesByProperties* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelDefinesByProperties"); } do { // convert the 'RelatingPropertyDefinition' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->RelatingPropertyDefinition, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelDefinesByProperties to be a `IfcPropertySetDefinition`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcActor* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOccupant* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcHumidifierType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcArbitraryOpenProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcArbitraryOpenProfileDef"); } do { // convert the 'Curve' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Curve, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcArbitraryOpenProfileDef to be a `IfcBoundedCurve`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPermit* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOffsetCurve3D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourcePositional* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompositeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRamp* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowMovingDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpaceHeaterType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLampType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementComponent* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcReinforcingElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcReinforcingBar* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricHeaterType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralActivity* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralAction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDuctFittingType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator2D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator2DnonUniform* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVirtualElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRightCircularCylinder* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOutletType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelDecomposes* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelDecomposes"); } do { // convert the 'RelatingObject' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->RelatingObject, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelDecomposes to be a `IfcObjectDefinition`")); } + } while(0); + do { // convert the 'RelatedObjects' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->RelatedObjects, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelDecomposes to be a `SET [1:?] OF IfcObjectDefinition`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCovering* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPolyline* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPolyline"); } do { // convert the 'Points' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Points, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPolyline to be a `LIST [2:?] OF IfcCartesianPoint`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPath* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementComponent* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFastener* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMappedItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcMappedItem"); } do { // convert the 'MappingSource' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->MappingSource, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcMappedItem to be a `IfcRepresentationMap`")); } + } while(0); + do { // convert the 'MappingTarget' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->MappingTarget, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcMappedItem to be a `IfcCartesianTransformationOperator`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRectangularPyramid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCrewResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcNamedUnit* in) +{ + size_t base = 0; + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcNamedUnit"); } do { // convert the 'Dimensions' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Dimensions, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcNamedUnit to be a `IfcDimensionalExponents`")); } + } while(0); + do { // convert the 'UnitType' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->UnitType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcNamedUnit to be a `IfcUnitEnum`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcContextDependentUnit* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcUnitaryEquipmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRoof* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralMember* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStyleModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStyledRepresentation* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpatialStructureElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to IfcSpatialStructureElement"); } do { // convert the 'LongName' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->LongName, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcSpatialStructureElement to be a `IfcLabel`")); } + } while(0); + do { // convert the 'CompositionType' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->CompositionType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcSpatialStructureElement to be a `IfcElementCompositionEnum`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuilding* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 12) { throw STEP::TypeError("expected 12 arguments to IfcBuilding"); } do { // convert the 'ElevationOfRefHeight' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ElevationOfRefHeight, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcBuilding to be a `IfcLengthMeasure`")); } + } while(0); + do { // convert the 'ElevationOfTerrain' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ElevationOfTerrain, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcBuilding to be a `IfcLengthMeasure`")); } + } while(0); + do { // convert the 'BuildingAddress' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->BuildingAddress, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 11 to IfcBuilding to be a `IfcPostalAddress`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConnectedFaceSet* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcConnectedFaceSet"); } do { // convert the 'CfsFaces' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->CfsFaces, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcConnectedFaceSet to be a `SET [1:?] OF IfcFace`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOpenShell* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFacetedBrep* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConic* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcConic"); } do { // convert the 'Position' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Position, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcConic to be a `IfcAxis2Placement`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCoveringType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRoundedRectangleProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAirTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowMovingDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompressorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcIShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcIShapeProfileDef"); } do { // convert the 'OverallWidth' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->OverallWidth, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'OverallDepth' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->OverallDepth, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'WebThickness' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->WebThickness, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'FlangeThickness' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } + try { GenericConvert( in->FlangeThickness, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'FilletRadius' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[4]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->FilletRadius, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAsymmetricIShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcControllerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRailing* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGroup* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAsset* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMaterialDefinitionRepresentation* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRailingType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWall* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPointConnection* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyListValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPropertyListValue"); } do { // convert the 'ListValues' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->ListValues, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcPropertyListValue to be a `LIST [1:?] OF IfcValue`")); } + } while(0); + do { // convert the 'Unit' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Unit, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPropertyListValue to be a `IfcUnit`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFurnitureStandard* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricGeneratorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDoor* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 10) { throw STEP::TypeError("expected 10 arguments to IfcDoor"); } do { // convert the 'OverallHeight' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->OverallHeight, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcDoor to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'OverallWidth' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->OverallWidth, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcDoor to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStyledItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcStyledItem"); } do { // convert the 'Item' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Item, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcStyledItem to be a `IfcRepresentationItem`")); } + } while(0); + do { // convert the 'Styles' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->Styles, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcStyledItem to be a `SET [1:?] OF IfcPresentationStyleAssignment`")); } + } while(0); + do { // convert the 'Name' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcStyledItem to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationOccurrence* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationSymbolOccurrence* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcArbitraryClosedProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcArbitraryClosedProfileDef"); } do { // convert the 'OuterCurve' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->OuterCurve, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcArbitraryClosedProfileDef to be a `IfcCurve`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcArbitraryProfileDefWithVoids* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLine* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcLine"); } do { // convert the 'Pnt' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Pnt, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcLine to be a `IfcCartesianPoint`")); } + } while(0); + do { // convert the 'Dir' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Dir, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcLine to be a `IfcVector`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowSegmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAirTerminalBoxType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertySingleValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPropertySingleValue"); } do { // convert the 'NominalValue' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->NominalValue, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcPropertySingleValue to be a `IfcValue`")); } + } while(0); + do { // convert the 'Unit' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Unit, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPropertySingleValue to be a `IfcUnit`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAlarmType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEllipseProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStair* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceStyleShading* in) +{ + size_t base = 0; + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcSurfaceStyleShading"); } do { // convert the 'SurfaceColour' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->SurfaceColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSurfaceStyleShading to be a `IfcColourRgb`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPumpType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDefinedSymbol* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementComponentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFastenerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMechanicalFastenerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowFitting* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourceDirectional* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- + +} // ! STEP +} // ! Assimp + +#endif diff --git a/code/IFCReaderGen2.cpp b/code/IFCReaderGen2.cpp new file mode 100644 index 000000000..52979260c --- /dev/null +++ b/code/IFCReaderGen2.cpp @@ -0,0 +1,1917 @@ +/* +Open Asset Import Library (ASSIMP) +---------------------------------------------------------------------- + +Copyright (c) 2006-2010, ASSIMP Development Team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the ASSIMP team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the ASSIMP Development Team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ + +//#include "AssimpPCH.h" +#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER + +#include "IFCReaderGen.h" + +namespace Assimp { +using namespace IFC; + +namespace STEP { + +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceStyle* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcSurfaceStyle"); } do { // convert the 'Side' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Side, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSurfaceStyle to be a `IfcSurfaceSide`")); } + } while(0); + do { // convert the 'Styles' argument + std::shared_ptr arg = params[ base++ ]; + try { GenericConvert( in->Styles, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSurfaceStyle to be a `SET [1:5] OF IfcSurfaceStyleElementSelect`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowController* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingStorey* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWorkControl* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWorkSchedule* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDuctSegmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFace* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcFace"); } do { // convert the 'Bounds' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Bounds, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcFace to be a `SET [1:?] OF IfcFaceBound`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralSurfaceMember* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralSurfaceMemberVarying* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFaceSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCostSchedule* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlanarExtent* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlanarBox* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcColourSpecification* in) +{ + size_t base = 0; + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcColourSpecification"); } do { // convert the 'Name' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcColourSpecification to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVector* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcVector"); } do { // convert the 'Orientation' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Orientation, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcVector to be a `IfcDirection`")); } + } while(0); + do { // convert the 'Magnitude' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Magnitude, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcVector to be a `IfcLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBeam* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcColourRgb* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcColourRgb"); } do { // convert the 'Red' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Red, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); } + } while(0); + do { // convert the 'Green' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Green, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); } + } while(0); + do { // convert the 'Blue' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Blue, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPlanarAction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPlanarActionVarying* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSite* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 14) { throw STEP::TypeError("expected 14 arguments to IfcSite"); } do { // convert the 'RefLatitude' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->RefLatitude, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcSite to be a `IfcCompoundPlaneAngleMeasure`")); } + } while(0); + do { // convert the 'RefLongitude' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->RefLongitude, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcSite to be a `IfcCompoundPlaneAngleMeasure`")); } + } while(0); + do { // convert the 'RefElevation' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->RefElevation, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 11 to IfcSite to be a `IfcLengthMeasure`")); } + } while(0); + do { // convert the 'LandTitleNumber' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->LandTitleNumber, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 12 to IfcSite to be a `IfcLabel`")); } + } while(0); + do { // convert the 'SiteAddress' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->SiteAddress, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 13 to IfcSite to be a `IfcPostalAddress`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDiscreteAccessoryType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVibrationIsolatorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEvaporativeCoolerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionChamberElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFeatureElementAddition* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuredDimensionCallout* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCoolingTowerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCenterLineProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWindowStyle* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourceGoniometric* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTransformerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMemberType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceOfLinearExtrusion* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMotorConnectionType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowTreatmentDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDuctSilencerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFurnishingElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSystemFurnitureElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWasteTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBSplineCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcBSplineCurve"); } do { // convert the 'Degree' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Degree, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcBSplineCurve to be a `INTEGER`")); } + } while(0); + do { // convert the 'ControlPointsList' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->ControlPointsList, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBSplineCurve to be a `LIST [2:?] OF IfcCartesianPoint`")); } + } while(0); + do { // convert the 'CurveForm' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->CurveForm, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBSplineCurve to be a `IfcBSplineCurveForm`")); } + } while(0); + do { // convert the 'ClosedCurve' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } + try { GenericConvert( in->ClosedCurve, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcBSplineCurve to be a `LOGICAL`")); } + } while(0); + do { // convert the 'SelfIntersect' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[4]=true; break; } + try { GenericConvert( in->SelfIntersect, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcBSplineCurve to be a `LOGICAL`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBezierCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcActuatorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionControlElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotation* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to IfcAnnotation"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcShellBasedSurfaceModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcShellBasedSurfaceModel"); } do { // convert the 'SbsmBoundary' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->SbsmBoundary, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcShellBasedSurfaceModel to be a `SET [1:?] OF IfcShell`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcActionRequest* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcExtrudedAreaSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcExtrudedAreaSolid"); } do { // convert the 'ExtrudedDirection' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->ExtrudedDirection, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcExtrudedAreaSolid to be a `IfcDirection`")); } + } while(0); + do { // convert the 'Depth' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Depth, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcExtrudedAreaSolid to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSystem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFillAreaStyleHatching* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelVoidsElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelVoidsElement"); } do { // convert the 'RelatingBuildingElement' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatingBuildingElement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelVoidsElement to be a `IfcElement`")); } + } while(0); + do { // convert the 'RelatedOpeningElement' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatedOpeningElement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelVoidsElement to be a `IfcFeatureElementSubtraction`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceCurveSweptAreaSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator3DnonUniform* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to IfcCartesianTransformationOperator3DnonUniform"); } do { // convert the 'Scale2' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Scale2, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcCartesianTransformationOperator3DnonUniform to be a `REAL`")); } + } while(0); + do { // convert the 'Scale3' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Scale3, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcCartesianTransformationOperator3DnonUniform to be a `REAL`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCurtainWallType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEquipmentStandard* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowStorageDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDiameterDimension* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSwitchingDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWindow* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowTreatmentDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcChillerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRectangleHollowProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoxedHalfSpace* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAxis2Placement2D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcAxis2Placement2D"); } do { // convert the 'RefDirection' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->RefDirection, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcAxis2Placement2D to be a `IfcDirection`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpaceProgram* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPoint* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianPoint* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcCartesianPoint"); } do { // convert the 'Coordinates' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Coordinates, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCartesianPoint to be a `LIST [1:3] OF IfcLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoundedSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLoop* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPolyLoop* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPolyLoop"); } do { // convert the 'Polygon' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Polygon, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPolyLoop to be a `LIST [3:?] OF IfcCartesianPoint`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTerminatorSymbol* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDimensionCurveTerminator* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTrapeziumProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRepresentationContext* in) +{ + size_t base = 0; + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcRepresentationContext"); } do { // convert the 'ContextIdentifier' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ContextIdentifier, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentationContext to be a `IfcLabel`")); } + } while(0); + do { // convert the 'ContextType' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ContextType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentationContext to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricRepresentationContext* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcGeometricRepresentationContext"); } do { // convert the 'CoordinateSpaceDimension' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->CoordinateSpaceDimension, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcGeometricRepresentationContext to be a `IfcDimensionCount`")); } + } while(0); + do { // convert the 'Precision' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Precision, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcGeometricRepresentationContext to be a `REAL`")); } + } while(0); + do { // convert the 'WorldCoordinateSystem' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->WorldCoordinateSystem, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcGeometricRepresentationContext to be a `IfcAxis2Placement`")); } + } while(0); + do { // convert the 'TrueNorth' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->TrueNorth, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcGeometricRepresentationContext to be a `IfcDirection`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCurveBoundedPlane* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSIUnit* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcSIUnit"); } do { // convert the 'Prefix' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Prefix, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSIUnit to be a `IfcSIPrefix`")); } + } while(0); + do { // convert the 'Name' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcSIUnit to be a `IfcSIUnitName`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralReaction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPointReaction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAxis1Placement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcAxis1Placement"); } do { // convert the 'Axis' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Axis, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcAxis1Placement to be a `IfcDirection`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricApplianceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSensorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFurnishingElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProtectiveDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcZShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcScheduleTimeControl* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRepresentationMap* in) +{ + size_t base = 0; + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcRepresentationMap"); } do { // convert the 'MappingOrigin' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->MappingOrigin, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentationMap to be a `IfcAxis2Placement`")); } + } while(0); + do { // convert the 'MappedRepresentation' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->MappedRepresentation, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentationMap to be a `IfcRepresentation`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcClosedShell* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcClosedShell"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementPart* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBlock* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightFixtureType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOpeningElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcOpeningElement"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourceSpot* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTendonAnchor* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricFlowStorageDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSphere* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDamperType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProjectOrderRecord* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionChamberElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMechanicalFastener* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRectangularTrimmedSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcZone* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFanType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricSet* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFillAreaStyleTiles* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCableSegmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelOverridesProperties* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMeasureWithUnit* in) +{ + size_t base = 0; + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcMeasureWithUnit"); } do { // convert the 'ValueComponent' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->ValueComponent, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcMeasureWithUnit to be a `IfcValue`")); } + } while(0); + do { // convert the 'UnitComponent' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->UnitComponent, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcMeasureWithUnit to be a `IfcUnit`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSlabType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcServiceLife* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFurnitureType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCostItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcReinforcingMesh* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFacetedBrepWithVoids* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGasTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPile* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFillAreaStyleTileSymbolWithStyle* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionMaterialResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationCurveOccurrence* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDimensionCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricCurveSet* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelAggregates* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelAggregates"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFaceBasedSurfaceModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcFaceBasedSurfaceModel"); } do { // convert the 'FbsmFaces' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->FbsmFaces, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcFaceBasedSurfaceModel to be a `SET [1:?] OF IfcConnectedFaceSet`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEnergyConversionDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRampFlight* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVertexLoop* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlate* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcUShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFaceBound* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcFaceBound"); } do { // convert the 'Bound' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Bound, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcFaceBound to be a `IfcLoop`")); } + } while(0); + do { // convert the 'Orientation' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->Orientation, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcFaceBound to be a `BOOLEAN`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFaceOuterBound* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcFaceOuterBound"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOneDirectionRepeatFactor* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoilerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionEquipmentResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcComplexProperty* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcComplexProperty"); } do { // convert the 'UsageName' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->UsageName, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcComplexProperty to be a `IfcIdentifier`")); } + } while(0); + do { // convert the 'HasProperties' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->HasProperties, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcComplexProperty to be a `SET [1:?] OF IfcProperty`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFooting* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionProductResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDerivedProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyTableValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowMeterType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDoorStyle* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcUnitAssignment* in) +{ + size_t base = 0; + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcUnitAssignment"); } do { // convert the 'Units' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Units, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcUnitAssignment to be a `SET [1:?] OF IfcUnit`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowTerminal* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCraneRailFShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowSegment* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementQuantity* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcElementQuantity"); } do { // convert the 'MethodOfMeasurement' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->MethodOfMeasurement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcElementQuantity to be a `IfcLabel`")); } + } while(0); + do { // convert the 'Quantities' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Quantities, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcElementQuantity to be a `SET [1:?] OF IfcPhysicalQuantity`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCurtainWall* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDiscreteAccessory* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGrid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSanitaryTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSubedge* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFilterType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTendon* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralLoadGroup* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPresentationStyleAssignment* in) +{ + size_t base = 0; + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPresentationStyleAssignment"); } do { // convert the 'Styles' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Styles, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPresentationStyleAssignment to be a `SET [1:?] OF IfcPresentationStyleSelect`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralCurveMember* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourceAmbient* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCondition* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPort* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpace* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 11) { throw STEP::TypeError("expected 11 arguments to IfcSpace"); } do { // convert the 'InteriorOrExteriorSpace' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->InteriorOrExteriorSpace, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcSpace to be a `IfcInternalOrExternalEnum`")); } + } while(0); + do { // convert the 'ElevationWithFlooring' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ElevationWithFlooring, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcSpace to be a `IfcLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcHeatExchangerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTankType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcInventory* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTransportElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAirToAirHeatRecoveryType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStairFlight* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricalElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceStyleWithTextures* in) +{ + size_t base = 0; + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcSurfaceStyleWithTextures"); } do { // convert the 'Textures' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Textures, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSurfaceStyleWithTextures to be a `LIST [1:?] OF IfcSurfaceTexture`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoundingBox* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcBoundingBox"); } do { // convert the 'Corner' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Corner, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcBoundingBox to be a `IfcCartesianPoint`")); } + } while(0); + do { // convert the 'XDim' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->XDim, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'YDim' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->YDim, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'ZDim' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->ZDim, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWallType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMove* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCircle* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcCircle"); } do { // convert the 'Radius' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Radius, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCircle to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOffsetCurve2D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPointOnCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralResultGroup* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSectionedSpine* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSlab* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVertex* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVertexPoint* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralLinearAction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralLinearActionVarying* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementProxyType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProjectionElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConversionBasedUnit* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcConversionBasedUnit"); } do { // convert the 'Name' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcConversionBasedUnit to be a `IfcLabel`")); } + } while(0); + do { // convert the 'ConversionFactor' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->ConversionFactor, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcConversionBasedUnit to be a `IfcMeasureWithUnit`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricRepresentationSubContext* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationSurfaceOccurrence* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRoundedEdgeFeature* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricDistributionPoint* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCableCarrierSegmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWallStandardCase* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCsgSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBeamType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationFillArea* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralCurveMemberVarying* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPointOnSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOrderAction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEdgeLoop* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationFillAreaOccurrence* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWorkPlan* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEllipse* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcEllipse"); } do { // convert the 'SemiAxis1' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->SemiAxis1, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcEllipse to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'SemiAxis2' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->SemiAxis2, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcEllipse to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProductDefinitionShape* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProjectionCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricalCircuit* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRationalBezierCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPointAction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPipeSegmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTwoDirectionRepeatFactor* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcShapeRepresentation* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertySet* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcPropertySet"); } do { // convert the 'HasProperties' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->HasProperties, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcPropertySet to be a `SET [1:?] OF IfcProperty`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceStyleRendering* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to IfcSurfaceStyleRendering"); } do { // convert the 'Transparency' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Transparency, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSurfaceStyleRendering to be a `IfcNormalisedRatioMeasure`")); } + } while(0); + do { // convert the 'DiffuseColour' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->DiffuseColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } + } while(0); + do { // convert the 'TransmissionColour' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->TransmissionColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } + } while(0); + do { // convert the 'DiffuseTransmissionColour' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->DiffuseTransmissionColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } + } while(0); + do { // convert the 'ReflectionColour' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ReflectionColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } + } while(0); + do { // convert the 'SpecularColour' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->SpecularColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } + } while(0); + do { // convert the 'SpecularHighlight' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->SpecularHighlight, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcSurfaceStyleRendering to be a `IfcSpecularHighlightSelect`")); } + } while(0); + do { // convert the 'ReflectanceMethod' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->ReflectanceMethod, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcSurfaceStyleRendering to be a `IfcReflectanceMethodEnum`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionPort* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPipeFittingType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTransportElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationTextOccurrence* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralAnalysisModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConditionCriterion* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} + +} // ! STEP +} // ! Assimp + +#endif diff --git a/code/IOStreamBuffer.h b/code/IOStreamBuffer.h new file mode 100644 index 000000000..8fb58e548 --- /dev/null +++ b/code/IOStreamBuffer.h @@ -0,0 +1,255 @@ +#pragma once + +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ + +#include +#include +#include "ParsingUtils.h" + +#include + +namespace Assimp { + +// --------------------------------------------------------------------------- +/** + * Implementation of a cached stream buffer. + */ +template +class IOStreamBuffer { +public: + /// @brief The class constructor. + IOStreamBuffer( size_t cache = 4096 * 4096 ); + + /// @brief The class destructor. + ~IOStreamBuffer(); + + /// @brief Will open the cached access for a given stream. + /// @param stream The stream to cache. + /// @return true if successful. + bool open( IOStream *stream ); + + /// @brief Will close the cached access. + /// @return true if successful. + bool close(); + + /// @brief Returns the filesize. + /// @return The filesize. + size_t size() const; + + /// @brief Returns the cache size. + /// @return The cache size. + size_t cacheSize() const; + + /// @brief Will read the next block. + /// @return true if successful. + bool readNextBlock(); + + /// @brief Returns the number of blocks to read. + /// @return The number of blocks. + size_t getNumBlocks() const; + + /// @brief Returns the current block index. + /// @return The current block index. + size_t getCurrentBlockIndex() const; + + /// @brief Returns the current file pos. + /// @return The current file pos. + size_t getFilePos() const; + + /// @brief Will read the next line. + /// @param buffer The buffer for the next line. + /// @return true if successful. + bool getNextLine( std::vector &buffer ); + +private: + IOStream *m_stream; + size_t m_filesize; + size_t m_cacheSize; + size_t m_numBlocks; + size_t m_blockIdx; + std::vector m_cache; + size_t m_cachePos; + size_t m_filePos; +}; + +template +inline +IOStreamBuffer::IOStreamBuffer( size_t cache ) +: m_stream( nullptr ) +, m_filesize( 0 ) +, m_cacheSize( cache ) +, m_numBlocks( 0 ) +, m_blockIdx( 0 ) +, m_cachePos( 0 ) +, m_filePos( 0 ) { + m_cache.resize( cache ); + std::fill( m_cache.begin(), m_cache.end(), '\n' ); +} + +template +inline +IOStreamBuffer::~IOStreamBuffer() { + // empty +} + +template +inline +bool IOStreamBuffer::open( IOStream *stream ) { + // file still opened! + if ( nullptr != m_stream ) { + return false; + } + + // Invalid stream pointer + if ( nullptr == stream ) { + return false; + } + + m_stream = stream; + m_filesize = m_stream->FileSize(); + if ( m_filesize == 0 ) { + return false; + } + if ( m_filesize < m_cacheSize ) { + m_cacheSize = m_filesize; + } + + m_numBlocks = m_filesize / m_cacheSize; + if ( ( m_filesize % m_cacheSize ) > 0 ) { + m_numBlocks++; + } + + return true; +} + +template +inline +bool IOStreamBuffer::close() { + if ( nullptr == m_stream ) { + return false; + } + + // init counters and state vars + m_stream = nullptr; + m_filesize = 0; + m_numBlocks = 0; + m_blockIdx = 0; + m_cachePos = 0; + m_filePos = 0; + + return true; +} + +template +inline +size_t IOStreamBuffer::size() const { + return m_filesize; +} + +template +inline +size_t IOStreamBuffer::cacheSize() const { + return m_cacheSize; +} + +template +inline +bool IOStreamBuffer::readNextBlock() { + m_stream->Seek( m_filePos, aiOrigin_SET ); + size_t readLen = m_stream->Read( &m_cache[ 0 ], sizeof( T ), m_cacheSize ); + if ( readLen == 0 ) { + return false; + } + if ( readLen < m_cacheSize ) { + m_cacheSize = readLen; + } + m_filePos += m_cacheSize; + m_cachePos = 0; + m_blockIdx++; + + return true; +} + +template +inline +size_t IOStreamBuffer::getNumBlocks() const { + return m_numBlocks; +} + +template +inline +size_t IOStreamBuffer::getCurrentBlockIndex() const { + return m_blockIdx; +} + +template +inline +size_t IOStreamBuffer::getFilePos() const { + return m_filePos; +} + +template +inline +bool IOStreamBuffer::getNextLine( std::vector &buffer ) { + buffer.resize( m_cacheSize ); + if ( m_cachePos == m_cacheSize || 0 == m_filePos ) { + if ( !readNextBlock() ) { + return false; + } + } + size_t i = 0; + while ( !IsLineEnd( m_cache[ m_cachePos ] ) ) { + buffer[ i ] = m_cache[ m_cachePos ]; + m_cachePos++; + i++; + if ( m_cachePos >= m_cacheSize ) { + if ( !readNextBlock() ) { + return false; + } + } + } + buffer[ i ] = '\n'; + m_cachePos++; + + return true; +} + +} // !ns Assimp diff --git a/code/IRRLoader.cpp b/code/IRRLoader.cpp index a1cfaf28b..6e2a9a5b5 100644 --- a/code/IRRLoader.cpp +++ b/code/IRRLoader.cpp @@ -542,7 +542,7 @@ void IRRImporter::ComputeAnimations(Node* root, aiNode* real, std::vectormPositionKeys[i]; - const ai_real dt = (i * in.speed * 0.001 ); + const ai_real dt = (i * in.speed * ai_real( 0.001 ) ); const ai_real u = dt - std::floor(dt); const int idx = (int)std::floor(dt) % size; @@ -556,9 +556,9 @@ void IRRImporter::ComputeAnimations(Node* root, aiNode* real, std::vector& out) #if (!defined ASSIMP_BUILD_NO_OBJ_IMPORTER) out.push_back( new ObjFileImporter()); #endif +#ifndef ASSIMP_BUILD_NO_AMF_IMPORTER + out.push_back( new AMFImporter() ); +#endif #if (!defined ASSIMP_BUILD_NO_3DS_IMPORTER) out.push_back( new Discreet3DSImporter()); #endif @@ -325,6 +334,9 @@ void GetImporterInstanceList(std::vector< BaseImporter* >& out) #if ( !defined ASSIMP_BUILD_NO_3MF_IMPORTER ) out.push_back(new D3MFImporter() ); #endif +#ifndef ASSIMP_BUILD_NO_X3D_IMPORTER + out.push_back( new X3DImporter() ); +#endif } /** will delete all registered importers. */ diff --git a/code/LWOAnimation.cpp b/code/LWOAnimation.cpp index 9f23c13b2..f41853dad 100644 --- a/code/LWOAnimation.cpp +++ b/code/LWOAnimation.cpp @@ -160,7 +160,7 @@ void AnimResolver::UpdateAnimRangeSetup() case LWO::PrePostBehaviour_Repeat: case LWO::PrePostBehaviour_Oscillate: { - const double start_time = delta - fmod(my_first-first,delta); + const double start_time = delta - std::fmod(my_first-first,delta); std::vector::iterator n = std::find_if((*it).keys.begin(),(*it).keys.end(), std::bind1st(std::greater(),start_time)),m; diff --git a/code/LWOMaterial.cpp b/code/LWOMaterial.cpp index 494f70033..555cc8787 100644 --- a/code/LWOMaterial.cpp +++ b/code/LWOMaterial.cpp @@ -286,7 +286,7 @@ void LWOImporter::ConvertMaterial(const LWO::Surface& surf,aiMaterial* pcMat) { float fGloss; if (mIsLWO2) { - fGloss = std::pow( surf.mGlossiness*10.0+2.0, 2.0); + fGloss = std::pow( surf.mGlossiness*ai_real( 10.0 )+ ai_real( 2.0 ), ai_real( 2.0 ) ); } else { @@ -312,7 +312,7 @@ void LWOImporter::ConvertMaterial(const LWO::Surface& surf,aiMaterial* pcMat) // emissive color // luminosity is not really the same but it affects the surface in a similar way. Some scaling looks good. - clr.g = clr.b = clr.r = surf.mLuminosity*0.8; + clr.g = clr.b = clr.r = surf.mLuminosity*ai_real( 0.8 ); pcMat->AddProperty(&clr,1,AI_MATKEY_COLOR_EMISSIVE); // opacity ... either additive or default-blended, please @@ -851,7 +851,7 @@ void LWOImporter::LoadLWO2Surface(unsigned int size) case AI_LWO_SMAN: { AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,SMAN,4); - surf.mMaximumSmoothAngle = fabs( GetF4() ); + surf.mMaximumSmoothAngle = std::fabs( GetF4() ); break; } // vertex color channel to be applied to the surface diff --git a/code/MD3FileData.h b/code/MD3FileData.h index 51a573959..3a59d0d1d 100644 --- a/code/MD3FileData.h +++ b/code/MD3FileData.h @@ -261,13 +261,13 @@ inline void LatLngNormalToVec3(uint16_t p_iNormal, ai_real* p_afOut) { ai_real lat = (ai_real)(( p_iNormal >> 8u ) & 0xff); ai_real lng = (ai_real)(( p_iNormal & 0xff )); - lat *= 3.141926/128.0; - lng *= 3.141926/128.0; + const ai_real invVal( ai_real( 1.0 ) / ai_real( 128.0 ) ); + lat *= ai_real( 3.141926 ) * invVal; + lng *= ai_real( 3.141926 ) * invVal; - p_afOut[0] = std::cos(lat) * std::sin(lng); - p_afOut[1] = std::sin(lat) * std::sin(lng); - p_afOut[2] = std::cos(lng); - return; + p_afOut[ 0 ] = std::cos(lat) * std::sin(lng); + p_afOut[ 1 ] = std::sin(lat) * std::sin(lng); + p_afOut[ 2 ] = std::cos(lng); } @@ -298,10 +298,10 @@ inline void Vec3NormalToLatLng( const aiVector3D& p_vIn, uint16_t& p_iOut ) { int a, b; - a = int(57.2957795f * ( atan2f( p_vIn[1], p_vIn[0] ) ) * (255.0f / 360.0f )); + a = int(57.2957795f * ( std::atan2( p_vIn[1], p_vIn[0] ) ) * (255.0f / 360.0f )); a &= 0xff; - b = int(57.2957795f * ( acosf( p_vIn[2] ) ) * ( 255.0f / 360.0f )); + b = int(57.2957795f * ( std::acos( p_vIn[2] ) ) * ( 255.0f / 360.0f )); b &= 0xff; ((unsigned char*)&p_iOut)[0] = b; // longitude diff --git a/code/MD5Parser.cpp b/code/MD5Parser.cpp index df666751b..9379deab1 100644 --- a/code/MD5Parser.cpp +++ b/code/MD5Parser.cpp @@ -195,7 +195,7 @@ bool MD5Parser::ParseSection(Section& out) #define AI_MD5_SKIP_SPACES() if(!SkipSpaces(&sz)) \ MD5Parser::ReportWarning("Unexpected end of line",elem.iLineNumber); - // read a triple float in brackets: (1.0 1.0 1.0) + // read a triple float in brackets: (1.0 1.0 1.0) #define AI_MD5_READ_TRIPLE(vec) \ AI_MD5_SKIP_SPACES(); \ if ('(' != *sz++) \ @@ -210,7 +210,7 @@ bool MD5Parser::ParseSection(Section& out) if (')' != *sz++) \ MD5Parser::ReportWarning("Unexpected token: ) was expected",elem.iLineNumber); - // parse a string, enclosed in quotation marks or not + // parse a string, enclosed in quotation marks or not #define AI_MD5_PARSE_STRING(out) \ bool bQuota = (*sz == '\"'); \ const char* szStart = sz; \ @@ -228,6 +228,15 @@ bool MD5Parser::ParseSection(Section& out) ::memcpy(out.data,szStart,out.length); \ out.data[out.length] = '\0'; + // parse a string, enclosed in quotation marks +#define AI_MD5_PARSE_STRING_IN_QUOTATION(out) \ + while('\"'!=*sz)++sz; \ + const char* szStart = ++sz; \ + while('\"'!=*sz)++sz; \ + const char* szEnd = (sz++); \ + out.length = (size_t)(szEnd - szStart); \ + ::memcpy(out.data,szStart,out.length); \ + out.data[out.length] = '\0'; // ------------------------------------------------------------------------------------------------ // .MD5MESH parsing function MD5MeshParser::MD5MeshParser(SectionList& mSections) @@ -247,9 +256,9 @@ MD5MeshParser::MD5MeshParser(SectionList& mSections) for (const auto & elem : (*iter).mElements){ mJoints.push_back(BoneDesc()); BoneDesc& desc = mJoints.back(); - + const char* sz = elem.szStart; - AI_MD5_PARSE_STRING(desc.mName); + AI_MD5_PARSE_STRING_IN_QUOTATION(desc.mName); AI_MD5_SKIP_SPACES(); // negative values, at least -1, is allowed here @@ -269,7 +278,7 @@ MD5MeshParser::MD5MeshParser(SectionList& mSections) // shader attribute if (TokenMatch(sz,"shader",6)) { AI_MD5_SKIP_SPACES(); - AI_MD5_PARSE_STRING(desc.mShader); + AI_MD5_PARSE_STRING_IN_QUOTATION(desc.mShader); } // numverts attribute else if (TokenMatch(sz,"numverts",8)) { @@ -362,7 +371,7 @@ MD5AnimParser::MD5AnimParser(SectionList& mSections) AnimBoneDesc& desc = mAnimatedBones.back(); const char* sz = elem.szStart; - AI_MD5_PARSE_STRING(desc.mName); + AI_MD5_PARSE_STRING_IN_QUOTATION(desc.mName); AI_MD5_SKIP_SPACES(); // parent index - negative values are allowed (at least -1) diff --git a/code/MDCLoader.cpp b/code/MDCLoader.cpp index 50a3d9422..d97215864 100644 --- a/code/MDCLoader.cpp +++ b/code/MDCLoader.cpp @@ -408,7 +408,7 @@ void MDCImporter::InternReadFile( // copy texture coordinates pcUVCur->x = pcUVs[quak].u; - pcUVCur->y = 1.0-pcUVs[quak].v; // DX to OGL + pcUVCur->y = ai_real( 1.0 )-pcUVs[quak].v; // DX to OGL } pcVertCur->x += pcFrame->localOrigin[0] ; pcVertCur->y += pcFrame->localOrigin[1] ; diff --git a/code/MaterialSystem.cpp b/code/MaterialSystem.cpp index 088336ef3..21cd38f79 100644 --- a/code/MaterialSystem.cpp +++ b/code/MaterialSystem.cpp @@ -42,8 +42,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * @brief Implementation of the material system of the library */ - - #include "Hash.h" #include "fast_atof.h" #include "ParsingUtils.h" @@ -71,7 +69,7 @@ aiReturn aiGetMaterialProperty(const aiMaterial* pMat, * could be improved by hashing, but it's possibly * no worth the effort (we're bound to C structures, * thus std::map or derivates are not applicable. */ - for (unsigned int i = 0; i < pMat->mNumProperties;++i) { + for ( unsigned int i = 0; i < pMat->mNumProperties; ++i ) { aiMaterialProperty* prop = pMat->mProperties[i]; if (prop /* just for safety ... */ @@ -151,14 +149,15 @@ aiReturn aiGetMaterialFloatArray(const aiMaterial* pMat, iWrite = *pMax; } // strings are zero-terminated with a 32 bit length prefix, so this is safe - const char* cur = prop->mData+4; - ai_assert(prop->mDataLength>=5 && !prop->mData[prop->mDataLength-1]); - for (unsigned int a = 0; ;++a) { + const char *cur = prop->mData + 4; + ai_assert( prop->mDataLength >= 5 ); + ai_assert( !prop->mData[ prop->mDataLength - 1 ] ); + for ( unsigned int a = 0; ;++a) { cur = fast_atoreal_move(cur,pOut[a]); - if(a==iWrite-1) { + if ( a==iWrite-1 ) { break; } - if(!IsSpace(*cur)) { + if ( !IsSpace(*cur) ) { DefaultLogger::get()->error("Material property" + std::string(pKey) + " is a string; failed to parse a float array out of it."); return AI_FAILURE; @@ -170,7 +169,6 @@ aiReturn aiGetMaterialFloatArray(const aiMaterial* pMat, } } return AI_SUCCESS; - } // ------------------------------------------------------------------------------------------------ @@ -224,8 +222,9 @@ aiReturn aiGetMaterialIntegerArray(const aiMaterial* pMat, iWrite = *pMax; } // strings are zero-terminated with a 32 bit length prefix, so this is safe - const char* cur = prop->mData+4; - ai_assert(prop->mDataLength>=5 && !prop->mData[prop->mDataLength-1]); + const char *cur = prop->mData+4; + ai_assert( prop->mDataLength >= 5 ); + ai_assert( !prop->mData[ prop->mDataLength - 1 ] ); for (unsigned int a = 0; ;++a) { pOut[a] = strtol10(cur,&cur); if(a==iWrite-1) { @@ -298,7 +297,8 @@ aiReturn aiGetMaterialString(const aiMaterial* pMat, // The string is stored as 32 but length prefix followed by zero-terminated UTF8 data pOut->length = static_cast(*reinterpret_cast(prop->mData)); - ai_assert(pOut->length+1+4==prop->mDataLength && !prop->mData[prop->mDataLength-1]); + ai_assert( pOut->length+1+4==prop->mDataLength ); + ai_assert( !prop->mData[ prop->mDataLength - 1 ] ); memcpy(pOut->data,prop->mData+4,pOut->length+1); } else { @@ -317,12 +317,12 @@ ASSIMP_API unsigned int aiGetMaterialTextureCount(const C_STRUCT aiMaterial* pMa { ai_assert (pMat != NULL); - /* Textures are always stored with ascending indices (ValidateDS provides a check, so we don't need to do it again) */ + // Textures are always stored with ascending indices (ValidateDS provides a check, so we don't need to do it again) unsigned int max = 0; for (unsigned int i = 0; i < pMat->mNumProperties;++i) { aiMaterialProperty* prop = pMat->mProperties[i]; - if (prop /* just a sanity check ... */ + if ( prop /* just a sanity check ... */ && 0 == strcmp( prop->mKey.data, _AI_MATKEY_TEXTURE_BASE ) && prop->mSemantic == type) { @@ -381,14 +381,16 @@ aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial* mat, return AI_SUCCESS; } +static const unsigned int DefaultNumAllocated = 5; + // ------------------------------------------------------------------------------------------------ // Construction. Actually the one and only way to get an aiMaterial instance -aiMaterial::aiMaterial() -{ +aiMaterial::aiMaterial() +: mProperties( NULL ) +, mNumProperties( 0 ) +, mNumAllocated( DefaultNumAllocated ) { // Allocate 5 entries by default - mNumProperties = 0; - mNumAllocated = 5; - mProperties = new aiMaterialProperty*[5]; + mProperties = new aiMaterialProperty*[ DefaultNumAllocated ]; } // ------------------------------------------------------------------------------------------------ @@ -543,10 +545,10 @@ aiReturn aiMaterial::AddProperty (const aiString* pInput, } // ------------------------------------------------------------------------------------------------ -uint32_t Assimp :: ComputeMaterialHash(const aiMaterial* mat, bool includeMatName /*= false*/) +uint32_t Assimp::ComputeMaterialHash(const aiMaterial* mat, bool includeMatName /*= false*/) { uint32_t hash = 1503; // magic start value, chosen to be my birthday :-) - for (unsigned int i = 0; i < mat->mNumProperties;++i) { + for ( unsigned int i = 0; i < mat->mNumProperties; ++i ) { aiMaterialProperty* prop; // Exclude all properties whose first character is '?' from the hash @@ -585,15 +587,16 @@ void aiMaterial::CopyPropertyList(aiMaterial* pcDest, } } - if(pcOld) - delete[] pcOld; + if ( pcOld ) { + delete[] pcOld; + } for (unsigned int i = iOldNum; i< pcDest->mNumProperties;++i) { aiMaterialProperty* propSrc = pcSrc->mProperties[i]; // search whether we have already a property with this name -> if yes, overwrite it aiMaterialProperty* prop; - for (unsigned int q = 0; q < iOldNum;++q) { + for ( unsigned int q = 0; q < iOldNum; ++q ) { prop = pcDest->mProperties[q]; if (prop /* just for safety */ && prop->mKey == propSrc->mKey && prop->mSemantic == propSrc->mSemantic && prop->mIndex == propSrc->mIndex) { @@ -617,5 +620,4 @@ void aiMaterial::CopyPropertyList(aiMaterial* pcDest, prop->mData = new char[propSrc->mDataLength]; memcpy(prop->mData,propSrc->mData,prop->mDataLength); } - return; } diff --git a/code/OFFLoader.cpp b/code/OFFLoader.cpp index 3139bc238..cb2226bf6 100644 --- a/code/OFFLoader.cpp +++ b/code/OFFLoader.cpp @@ -242,7 +242,7 @@ void OFFImporter::InternReadFile( const std::string& pFile, pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials]; aiMaterial* pcMat = new aiMaterial(); - aiColor4D clr(0.6,0.6,0.6,1.0); + aiColor4D clr( ai_real( 0.6 ), ai_real( 0.6 ), ai_real( 0.6 ), ai_real( 1.0 ) ); pcMat->AddProperty(&clr,1,AI_MATKEY_COLOR_DIFFUSE); pScene->mMaterials[0] = pcMat; diff --git a/code/ObjFileData.h b/code/ObjFileData.h index 2d282e6a9..c72175d4d 100644 --- a/code/ObjFileData.h +++ b/code/ObjFileData.h @@ -38,6 +38,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ +#pragma once #ifndef OBJ_FILEDATA_H_INC #define OBJ_FILEDATA_H_INC @@ -56,59 +57,43 @@ struct Material; // ------------------------------------------------------------------------------------------------ //! \struct Face //! \brief Data structure for a simple obj-face, describes discredit,l.ation and materials -struct Face -{ +// ------------------------------------------------------------------------------------------------ +struct Face { typedef std::vector IndexArray; //! Primitive type aiPrimitiveType m_PrimitiveType; //! Vertex indices - IndexArray *m_pVertices; + IndexArray m_vertices; //! Normal indices - IndexArray *m_pNormals; + IndexArray m_normals; //! Texture coordinates indices - IndexArray *m_pTexturCoords; + IndexArray m_texturCoords; //! Pointer to assigned material Material *m_pMaterial; //! \brief Default constructor - //! \param pVertices Pointer to assigned vertex indexbuffer - //! \param pNormals Pointer to assigned normals indexbuffer - //! \param pTexCoords Pointer to assigned texture indexbuffer - Face( std::vector *pVertices, - std::vector *pNormals, - std::vector *pTexCoords, - aiPrimitiveType pt = aiPrimitiveType_POLYGON) : - m_PrimitiveType( pt ), - m_pVertices( pVertices ), - m_pNormals( pNormals ), - m_pTexturCoords( pTexCoords ), - m_pMaterial( 0L ) - { + Face( aiPrimitiveType pt = aiPrimitiveType_POLYGON) + : m_PrimitiveType( pt ) + , m_vertices() + , m_normals() + , m_texturCoords() + , m_pMaterial( 0L ) { // empty } //! \brief Destructor - ~Face() - { - delete m_pVertices; - m_pVertices = NULL; - - delete m_pNormals; - m_pNormals = NULL; - - delete m_pTexturCoords; - m_pTexturCoords = NULL; + ~Face() { + // empty } }; // ------------------------------------------------------------------------------------------------ //! \struct Object -//! \brief Stores all objects of an objfile object definition -struct Object -{ - enum ObjectType - { +//! \brief Stores all objects of an obj-file object definition +// ------------------------------------------------------------------------------------------------ +struct Object { + enum ObjectType { ObjType, GroupType }; @@ -123,29 +108,24 @@ struct Object std::vector m_Meshes; //! \brief Default constructor - Object() : - m_strObjName("") - { + Object() + : m_strObjName("") { // empty } //! \brief Destructor - ~Object() - { - for (std::vector::iterator it = m_SubObjects.begin(); - it != m_SubObjects.end(); ++it) - { + ~Object() { + for ( std::vector::iterator it = m_SubObjects.begin(); it != m_SubObjects.end(); ++it) { delete *it; } - m_SubObjects.clear(); } }; // ------------------------------------------------------------------------------------------------ //! \struct Material //! \brief Data structure to store all material specific data -struct Material -{ +// ------------------------------------------------------------------------------------------------ +struct Material { //! Name of material description aiString MaterialName; @@ -160,8 +140,8 @@ struct Material aiString textureSpecularity; aiString textureOpacity; aiString textureDisp; - enum TextureType - { + + enum TextureType { TextureDiffuseType = 0, TextureSpecularType, TextureAmbientType, @@ -201,22 +181,19 @@ struct Material //! Constructor Material() - : diffuse (0.6,0.6,0.6) - , alpha (1.0) - , shineness (0.0) - , illumination_model (1) - , ior (1.0) - { + : diffuse ( ai_real( 0.6 ), ai_real( 0.6 ), ai_real( 0.6 ) ) + , alpha (ai_real( 1.0 ) ) + , shineness ( ai_real( 0.0) ) + , illumination_model (1) + , ior ( ai_real( 1.0 ) ) { // empty - for (size_t i = 0; i < TextureTypeCount; ++i) - { - clamp[i] = false; + for (size_t i = 0; i < TextureTypeCount; ++i) { + clamp[ i ] = false; } } // Destructor - ~Material() - { + ~Material() { // empty } }; @@ -224,6 +201,7 @@ struct Material // ------------------------------------------------------------------------------------------------ //! \struct Mesh //! \brief Data structure to store a mesh +// ------------------------------------------------------------------------------------------------ struct Mesh { static const unsigned int NoMaterial = ~0u; /// The name for the mesh @@ -254,8 +232,7 @@ struct Mesh { } /// Destructor - ~Mesh() - { + ~Mesh() { for (std::vector::iterator it = m_Faces.begin(); it != m_Faces.end(); ++it) { @@ -267,8 +244,8 @@ struct Mesh { // ------------------------------------------------------------------------------------------------ //! \struct Model //! \brief Data structure to store all obj-specific model datas -struct Model -{ +// ------------------------------------------------------------------------------------------------ +struct Model { typedef std::map* > GroupMap; typedef std::map* >::iterator GroupMapIt; typedef std::map* >::const_iterator ConstGroupMapIt; @@ -320,8 +297,7 @@ struct Model } //! \brief The class destructor - ~Model() - { + ~Model() { // Clear all stored object instances for (std::vector::iterator it = m_Objects.begin(); it != m_Objects.end(); ++it) { @@ -352,4 +328,4 @@ struct Model } // Namespace ObjFile } // Namespace Assimp -#endif +#endif // OBJ_FILEDATA_H_INC diff --git a/code/ObjFileImporter.cpp b/code/ObjFileImporter.cpp index a70d69b4a..97ae29996 100644 --- a/code/ObjFileImporter.cpp +++ b/code/ObjFileImporter.cpp @@ -45,6 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "ObjFileImporter.h" #include "ObjFileParser.h" #include "ObjFileData.h" +#include "IOStreamBuffer.h" #include #include #include @@ -126,8 +127,11 @@ void ObjFileImporter::InternReadFile( const std::string &file, aiScene* pScene, throw DeadlyImportError( "OBJ-file is too small."); } + IOStreamBuffer streamedBuffer; + streamedBuffer.open( fileStream.get() ); + // Allocate buffer and read file into it - TextFileToBuffer( fileStream.get(),m_Buffer); + //TextFileToBuffer( fileStream.get(),m_Buffer); // Get the model name std::string modelName, folderName; @@ -150,7 +154,7 @@ void ObjFileImporter::InternReadFile( const std::string &file, aiScene* pScene, const unsigned int updateProgressEveryBytes = 100 * 1024; const unsigned int progressTotal = (3*m_Buffer.size()/updateProgressEveryBytes); // process all '\' - std::vector ::iterator iter = m_Buffer.begin(); + /*std::vector ::iterator iter = m_Buffer.begin(); while (iter != m_Buffer.end()) { if (*iter == '\\') @@ -169,17 +173,19 @@ void ObjFileImporter::InternReadFile( const std::string &file, aiScene* pScene, m_progress->UpdateFileRead(++progress, progressTotal); progressCounter = 0; } - } + }*/ // 1/3rd progress m_progress->UpdateFileRead(1, 3); // parse the file into a temporary representation - ObjFileParser parser(m_Buffer, modelName, pIOHandler, m_progress, file); + ObjFileParser parser( streamedBuffer, modelName, pIOHandler, m_progress, file); // And create the proper return structures out of it CreateDataFromImport(parser.GetModel(), pScene); + streamedBuffer.close(); + // Clean up allocated storage for the next import m_Buffer.clear(); @@ -291,9 +297,7 @@ aiNode *ObjFileImporter::createNodes(const ObjFile::Model* pModel, const ObjFile // ------------------------------------------------------------------------------------------------ // Create topology data -aiMesh *ObjFileImporter::createTopology( const ObjFile::Model* pModel, const ObjFile::Object* pData, - unsigned int meshIndex ) -{ +aiMesh *ObjFileImporter::createTopology( const ObjFile::Model* pModel, const ObjFile::Object* pData, unsigned int meshIndex ) { // Checking preconditions ai_assert( NULL != pModel ); @@ -322,14 +326,14 @@ aiMesh *ObjFileImporter::createTopology( const ObjFile::Model* pModel, const Obj ai_assert( NULL != inp ); if (inp->m_PrimitiveType == aiPrimitiveType_LINE) { - pMesh->mNumFaces += inp->m_pVertices->size() - 1; + pMesh->mNumFaces += inp->m_vertices.size() - 1; pMesh->mPrimitiveTypes |= aiPrimitiveType_LINE; } else if (inp->m_PrimitiveType == aiPrimitiveType_POINT) { - pMesh->mNumFaces += inp->m_pVertices->size(); + pMesh->mNumFaces += inp->m_vertices.size(); pMesh->mPrimitiveTypes |= aiPrimitiveType_POINT; } else { ++pMesh->mNumFaces; - if (inp->m_pVertices->size() > 3) { + if (inp->m_vertices.size() > 3) { pMesh->mPrimitiveTypes |= aiPrimitiveType_POLYGON; } else { pMesh->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE; @@ -350,7 +354,7 @@ aiMesh *ObjFileImporter::createTopology( const ObjFile::Model* pModel, const Obj for (size_t index = 0; index < pObjMesh->m_Faces.size(); index++) { ObjFile::Face* const inp = pObjMesh->m_Faces[ index ]; if (inp->m_PrimitiveType == aiPrimitiveType_LINE) { - for(size_t i = 0; i < inp->m_pVertices->size() - 1; ++i) { + for(size_t i = 0; i < inp->m_vertices.size() - 1; ++i) { aiFace& f = pMesh->mFaces[ outIndex++ ]; uiIdxCount += f.mNumIndices = 2; f.mIndices = new unsigned int[2]; @@ -358,7 +362,7 @@ aiMesh *ObjFileImporter::createTopology( const ObjFile::Model* pModel, const Obj continue; } else if (inp->m_PrimitiveType == aiPrimitiveType_POINT) { - for(size_t i = 0; i < inp->m_pVertices->size(); ++i) { + for(size_t i = 0; i < inp->m_vertices.size(); ++i) { aiFace& f = pMesh->mFaces[ outIndex++ ]; uiIdxCount += f.mNumIndices = 1; f.mIndices = new unsigned int[1]; @@ -367,7 +371,7 @@ aiMesh *ObjFileImporter::createTopology( const ObjFile::Model* pModel, const Obj } aiFace *pFace = &pMesh->mFaces[ outIndex++ ]; - const unsigned int uiNumIndices = (unsigned int) pObjMesh->m_Faces[ index ]->m_pVertices->size(); + const unsigned int uiNumIndices = (unsigned int) pObjMesh->m_Faces[ index ]->m_vertices.size(); uiIdxCount += pFace->mNumIndices = (unsigned int) uiNumIndices; if (pFace->mNumIndices > 0) { pFace->mIndices = new unsigned int[ uiNumIndices ]; @@ -432,8 +436,8 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel, ObjFile::Face *pSourceFace = pObjMesh->m_Faces[ index ]; // Copy all index arrays - for ( size_t vertexIndex = 0, outVertexIndex = 0; vertexIndex < pSourceFace->m_pVertices->size(); vertexIndex++ ) { - const unsigned int vertex = pSourceFace->m_pVertices->at( vertexIndex ); + for ( size_t vertexIndex = 0, outVertexIndex = 0; vertexIndex < pSourceFace->m_vertices.size(); vertexIndex++ ) { + const unsigned int vertex = pSourceFace->m_vertices.at( vertexIndex ); if ( vertex >= pModel->m_Vertices.size() ) { throw DeadlyImportError( "OBJ: vertex index out of range" ); } @@ -441,8 +445,8 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel, pMesh->mVertices[ newIndex ] = pModel->m_Vertices[ vertex ]; // Copy all normals - if ( !pModel->m_Normals.empty() && vertexIndex < pSourceFace->m_pNormals->size()) { - const unsigned int normal = pSourceFace->m_pNormals->at( vertexIndex ); + if ( !pModel->m_Normals.empty() && vertexIndex < pSourceFace->m_normals.size()) { + const unsigned int normal = pSourceFace->m_normals.at( vertexIndex ); if ( normal >= pModel->m_Normals.size() ) { throw DeadlyImportError( "OBJ: vertex normal index out of range" ); } @@ -457,9 +461,9 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel, } // Copy all texture coordinates - if ( !pModel->m_TextureCoord.empty() && vertexIndex < pSourceFace->m_pTexturCoords->size()) + if ( !pModel->m_TextureCoord.empty() && vertexIndex < pSourceFace->m_texturCoords.size()) { - const unsigned int tex = pSourceFace->m_pTexturCoords->at( vertexIndex ); + const unsigned int tex = pSourceFace->m_texturCoords.at( vertexIndex ); ai_assert( tex < pModel->m_TextureCoord.size() ); if ( tex >= pModel->m_TextureCoord.size() ) @@ -476,20 +480,16 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel, // Get destination face aiFace *pDestFace = &pMesh->mFaces[ outIndex ]; - const bool last = ( vertexIndex == pSourceFace->m_pVertices->size() - 1 ); - if (pSourceFace->m_PrimitiveType != aiPrimitiveType_LINE || !last) - { + const bool last = ( vertexIndex == pSourceFace->m_vertices.size() - 1 ); + if (pSourceFace->m_PrimitiveType != aiPrimitiveType_LINE || !last) { pDestFace->mIndices[ outVertexIndex ] = newIndex; outVertexIndex++; } - if (pSourceFace->m_PrimitiveType == aiPrimitiveType_POINT) - { + if (pSourceFace->m_PrimitiveType == aiPrimitiveType_POINT) { outIndex++; outVertexIndex = 0; - } - else if (pSourceFace->m_PrimitiveType == aiPrimitiveType_LINE) - { + } else if (pSourceFace->m_PrimitiveType == aiPrimitiveType_LINE) { outVertexIndex = 0; if(!last) @@ -498,7 +498,7 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel, if (vertexIndex) { if(!last) { pMesh->mVertices[ newIndex+1 ] = pMesh->mVertices[ newIndex ]; - if ( !pSourceFace->m_pNormals->empty() && !pModel->m_Normals.empty()) { + if ( !pSourceFace->m_normals.empty() && !pModel->m_Normals.empty()) { pMesh->mNormals[ newIndex+1 ] = pMesh->mNormals[newIndex ]; } if ( !pModel->m_TextureCoord.empty() ) { diff --git a/code/ObjFileImporter.h b/code/ObjFileImporter.h index 8c482017b..a962d43c4 100644 --- a/code/ObjFileImporter.h +++ b/code/ObjFileImporter.h @@ -50,8 +50,8 @@ struct aiNode; namespace Assimp { namespace ObjFile { -struct Object; -struct Model; + struct Object; + struct Model; } // ------------------------------------------------------------------------------------------------ diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index 4c3232fa7..27e4b27c4 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -38,8 +38,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------- */ - - #ifndef ASSIMP_BUILD_NO_OBJ_IMPORTER #include "ObjFileParser.h" @@ -54,16 +52,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include - namespace Assimp { const std::string ObjFileParser::DEFAULT_MATERIAL = AI_DEFAULT_MATERIAL_NAME; // ------------------------------------------------------------------- // Constructor with loaded data and directories. -ObjFileParser::ObjFileParser(std::vector &data, const std::string &modelName, IOSystem *io, ProgressHandler* progress, const std::string &originalObjFileName) : - m_DataIt(data.begin()), - m_DataItEnd(data.end()), +ObjFileParser::ObjFileParser( IOStreamBuffer &streamBuffer, const std::string &modelName, + IOSystem *io, ProgressHandler* progress, + const std::string &originalObjFileName) : + m_DataIt(), + m_DataItEnd(), m_pModel(NULL), m_uiLine(0), m_pIO( io ), @@ -83,55 +82,50 @@ ObjFileParser::ObjFileParser(std::vector &data, const std::string &modelNa m_pModel->m_MaterialMap[ DEFAULT_MATERIAL ] = m_pModel->m_pDefaultMaterial; // Start parsing the file - parseFile(); + parseFile( streamBuffer ); } // ------------------------------------------------------------------- // Destructor -ObjFileParser::~ObjFileParser() -{ +ObjFileParser::~ObjFileParser() { delete m_pModel; m_pModel = NULL; } // ------------------------------------------------------------------- // Returns a pointer to the model instance. -ObjFile::Model *ObjFileParser::GetModel() const -{ +ObjFile::Model *ObjFileParser::GetModel() const { return m_pModel; } // ------------------------------------------------------------------- // File parsing method. -void ObjFileParser::parseFile() -{ - if (m_DataIt == m_DataItEnd) - return; - +void ObjFileParser::parseFile( IOStreamBuffer &streamBuffer ) { // only update every 100KB or it'll be too slow const unsigned int updateProgressEveryBytes = 100 * 1024; unsigned int progressCounter = 0; - const unsigned int bytesToProcess = std::distance(m_DataIt, m_DataItEnd); + const unsigned int bytesToProcess = streamBuffer.size(); const unsigned int progressTotal = 3 * bytesToProcess; const unsigned int progressOffset = bytesToProcess; unsigned int processed = 0; + size_t lastFilePos( 0 ); - DataArrayIt lastDataIt = m_DataIt; + std::vector buffer; + while ( streamBuffer.getNextLine( buffer ) ) { + m_DataIt = buffer.begin(); + m_DataItEnd = buffer.end(); - while (m_DataIt != m_DataItEnd) - { - // Handle progress reporting - processed += std::distance(lastDataIt, m_DataIt); - lastDataIt = m_DataIt; - if (processed > (progressCounter * updateProgressEveryBytes)) - { + // Handle progress reporting + const size_t filePos( streamBuffer.getFilePos() ); + if ( lastFilePos < filePos ) { + processed += filePos; + lastFilePos = filePos; progressCounter++; - m_progress->UpdateFileRead(progressOffset + processed*2, progressTotal); + m_progress->UpdateFileRead( progressOffset + processed * 2, progressTotal ); } // parse line - switch (*m_DataIt) - { + switch (*m_DataIt) { case 'v': // Parse a vertex texture coordinate { ++m_DataIt; @@ -140,14 +134,17 @@ void ObjFileParser::parseFile() if (numComponents == 3) { // read in vertex definition getVector3(m_pModel->m_Vertices); + } else if (numComponents == 4) { + // read in vertex definition (homogeneous coords) + getHomogeneousVector3(m_pModel->m_Vertices); } else if (numComponents == 6) { // read vertex and vertex-color getTwoVectors3(m_pModel->m_Vertices, m_pModel->m_VertexColors); } } else if (*m_DataIt == 't') { // read in texture coordinate ( 2D or 3D ) - ++m_DataIt; - getVector( m_pModel->m_TextureCoord ); + ++m_DataIt; + getVector( m_pModel->m_TextureCoord ); } else if (*m_DataIt == 'n') { // Read in normal vector definition ++m_DataIt; @@ -179,10 +176,20 @@ void ObjFileParser::parseFile() case 'm': // Parse a material library or merging group ('mg') { - if (*(m_DataIt + 1) == 'g') + std::string name; + + getNameNoSpace(m_DataIt, m_DataItEnd, name); + + size_t nextSpace = name.find(" "); + if (nextSpace != std::string::npos) + name = name.substr(0, nextSpace); + + if (name == "mg") getGroupNumberAndResolution(); - else + else if(name == "mtllib") getMaterialLib(); + else + goto pf_skip_line; } break; @@ -206,6 +213,8 @@ void ObjFileParser::parseFile() default: { +pf_skip_line: + m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } break; @@ -215,8 +224,7 @@ void ObjFileParser::parseFile() // ------------------------------------------------------------------- // Copy the next word in a temporary buffer -void ObjFileParser::copyNextWord(char *pBuffer, size_t length) -{ +void ObjFileParser::copyNextWord(char *pBuffer, size_t length) { size_t index = 0; m_DataIt = getNextWord(m_DataIt, m_DataItEnd); while( m_DataIt != m_DataItEnd && !IsSpaceOrNewLine( *m_DataIt ) ) { @@ -232,37 +240,6 @@ void ObjFileParser::copyNextWord(char *pBuffer, size_t length) pBuffer[index] = '\0'; } -// ------------------------------------------------------------------- -// Copy the next line into a temporary buffer -void ObjFileParser::copyNextLine(char *pBuffer, size_t length) -{ - size_t index = 0u; - - // some OBJ files have line continuations using \ (such as in C++ et al) - bool continuation = false; - for (;m_DataIt != m_DataItEnd && index < length-1; ++m_DataIt) - { - const char c = *m_DataIt; - if (c == '\\') { - continuation = true; - continue; - } - - if (c == '\n' || c == '\r') { - if(continuation) { - pBuffer[ index++ ] = ' '; - continue; - } - break; - } - - continuation = false; - pBuffer[ index++ ] = c; - } - ai_assert(index < length); - pBuffer[ index ] = '\0'; -} - size_t ObjFileParser::getNumComponentsInLine() { size_t numComponents( 0 ); const char* tmp( &m_DataIt[0] ); @@ -276,7 +253,6 @@ size_t ObjFileParser::getNumComponentsInLine() { return numComponents; } -// ------------------------------------------------------------------- void ObjFileParser::getVector( std::vector &point3d_array ) { size_t numComponents = getNumComponentsInLine(); ai_real x, y, z; @@ -320,6 +296,26 @@ void ObjFileParser::getVector3( std::vector &point3d_array ) { m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } +void ObjFileParser::getHomogeneousVector3( std::vector &point3d_array ) { + ai_real x, y, z, w; + copyNextWord(m_buffer, Buffersize); + x = (ai_real) fast_atof(m_buffer); + + copyNextWord(m_buffer, Buffersize); + y = (ai_real) fast_atof(m_buffer); + + copyNextWord( m_buffer, Buffersize ); + z = ( ai_real ) fast_atof( m_buffer ); + + copyNextWord( m_buffer, Buffersize ); + w = ( ai_real ) fast_atof( m_buffer ); + + ai_assert( w != 0 ); + + point3d_array.push_back( aiVector3D( x/w, y/w, z/w ) ); + m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); +} + // ------------------------------------------------------------------- // Get values for two 3D vectors on the same line void ObjFileParser::getTwoVectors3( std::vector &point3d_array_a, std::vector &point3d_array_b ) { @@ -368,18 +364,17 @@ static const std::string DefaultObjName = "defaultobject"; // ------------------------------------------------------------------- // Get values for a new face instance -void ObjFileParser::getFace(aiPrimitiveType type) { - copyNextLine(m_buffer, Buffersize); - char *pPtr = m_buffer; - char *pEnd = &pPtr[Buffersize]; - pPtr = getNextToken(pPtr, pEnd); - if ( pPtr == pEnd || *pPtr == '\0' ) { +void ObjFileParser::getFace( aiPrimitiveType type ) { + //copyNextLine(m_buffer, Buffersize); + //char *pPtr = m_DataIt; + //char *pPtr = m_buffer; + //char *pEnd = &pPtr[Buffersize]; + m_DataIt = getNextToken( m_DataIt, m_DataItEnd ); + if ( m_DataIt == m_DataItEnd || *m_DataIt == '\0' ) { return; } - std::vector *pIndices = new std::vector; - std::vector *pTexID = new std::vector; - std::vector *pNormalID = new std::vector; + ObjFile::Face *face = new ObjFile::Face( type ); bool hasNormal = false; const int vSize = m_pModel->m_Vertices.size(); @@ -389,14 +384,14 @@ void ObjFileParser::getFace(aiPrimitiveType type) { const bool vt = (!m_pModel->m_TextureCoord.empty()); const bool vn = (!m_pModel->m_Normals.empty()); int iStep = 0, iPos = 0; - while (pPtr != pEnd) { + while ( m_DataIt != m_DataItEnd ) { iStep = 1; - if ( IsLineEnd( *pPtr ) ) { + if ( IsLineEnd( *m_DataIt ) ) { break; } - if (*pPtr=='/' ) { + if ( *m_DataIt =='/' ) { if (type == aiPrimitiveType_POINT) { DefaultLogger::get()->error("Obj: Separator unexpected in point statement"); } @@ -408,11 +403,11 @@ void ObjFileParser::getFace(aiPrimitiveType type) { } } iPos++; - } else if( IsSpaceOrNewLine( *pPtr ) ) { + } else if( IsSpaceOrNewLine( *m_DataIt ) ) { iPos = 0; } else { //OBJ USES 1 Base ARRAYS!!!! - const int iVal( ::atoi( pPtr ) ); + const int iVal( ::atoi( & ( *m_DataIt ) ) ); // increment iStep position based off of the sign and # of digits int tmp = iVal; @@ -423,65 +418,42 @@ void ObjFileParser::getFace(aiPrimitiveType type) { ++iStep; } - if ( iVal > 0 ) - { + if ( iVal > 0 ) { // Store parsed index - if ( 0 == iPos ) - { - pIndices->push_back( iVal-1 ); - } - else if ( 1 == iPos ) - { - pTexID->push_back( iVal-1 ); - } - else if ( 2 == iPos ) - { - pNormalID->push_back( iVal-1 ); + if ( 0 == iPos ) { + face->m_vertices.push_back( iVal - 1 ); + } else if ( 1 == iPos ) { + face->m_texturCoords.push_back( iVal - 1 ); + } else if ( 2 == iPos ) { + face->m_normals.push_back( iVal - 1 ); hasNormal = true; - } - else - { + } else { reportErrorTokenInFace(); } - } - else if ( iVal < 0 ) - { + } else if ( iVal < 0 ) { // Store relatively index - if ( 0 == iPos ) - { - pIndices->push_back( vSize + iVal ); - } - else if ( 1 == iPos ) - { - pTexID->push_back( vtSize + iVal ); - } - else if ( 2 == iPos ) - { - pNormalID->push_back( vnSize + iVal ); + if ( 0 == iPos ) { + face->m_vertices.push_back( vSize + iVal ); + } else if ( 1 == iPos ) { + face->m_texturCoords.push_back( vtSize + iVal ); + } else if ( 2 == iPos ) { + face->m_normals.push_back( vnSize + iVal ); hasNormal = true; - } - else - { + } else { reportErrorTokenInFace(); } } } - pPtr += iStep; + m_DataIt += iStep; } - if ( pIndices->empty() ) { + if ( face->m_vertices.empty() ) { DefaultLogger::get()->error("Obj: Ignoring empty face"); // skip line and clean up m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); - delete pNormalID; - delete pTexID; - delete pIndices; - return; } - ObjFile::Face *face = new ObjFile::Face( pIndices, pNormalID, pTexID, type ); - // Set active material, if one set if( NULL != m_pModel->m_pCurrentMaterial ) { face->m_pMaterial = m_pModel->m_pCurrentMaterial; @@ -501,8 +473,8 @@ void ObjFileParser::getFace(aiPrimitiveType type) { // Store the face m_pModel->m_pCurrentMesh->m_Faces.push_back( face ); - m_pModel->m_pCurrentMesh->m_uiNumIndices += (unsigned int)face->m_pVertices->size(); - m_pModel->m_pCurrentMesh->m_uiUVCoordinates[ 0 ] += (unsigned int)face->m_pTexturCoords[0].size(); + m_pModel->m_pCurrentMesh->m_uiNumIndices += (unsigned int) face->m_vertices.size(); + m_pModel->m_pCurrentMesh->m_uiUVCoordinates[ 0 ] += (unsigned int) face->m_texturCoords.size(); if( !m_pModel->m_pCurrentMesh->m_hasNormals && hasNormal ) { m_pModel->m_pCurrentMesh->m_hasNormals = true; } @@ -512,8 +484,7 @@ void ObjFileParser::getFace(aiPrimitiveType type) { // ------------------------------------------------------------------- // Get values for a new material description -void ObjFileParser::getMaterialDesc() -{ +void ObjFileParser::getMaterialDesc() { // Get next data for material data m_DataIt = getNextToken(m_DataIt, m_DataItEnd); if (m_DataIt == m_DataItEnd) { @@ -536,28 +507,26 @@ void ObjFileParser::getMaterialDesc() // If the current mesh has the same material, we simply ignore that 'usemtl' command // There is no need to create another object or even mesh here - if (m_pModel->m_pCurrentMaterial && m_pModel->m_pCurrentMaterial->MaterialName == aiString(strName)) + if ( m_pModel->m_pCurrentMaterial && m_pModel->m_pCurrentMaterial->MaterialName == aiString( strName ) ) { skip = true; + } - if (!skip) - { + if (!skip) { // Search for material std::map::iterator it = m_pModel->m_MaterialMap.find(strName); - if (it == m_pModel->m_MaterialMap.end()) - { + if (it == m_pModel->m_MaterialMap.end()) { // Not found, use default material m_pModel->m_pCurrentMaterial = m_pModel->m_pDefaultMaterial; DefaultLogger::get()->error("OBJ: failed to locate material " + strName + ", skipping"); strName = m_pModel->m_pDefaultMaterial->MaterialName.C_Str(); - } - else - { + } else { // Found, using detected material m_pModel->m_pCurrentMaterial = (*it).second; } - if (needsNewMesh(strName)) - createMesh(strName); + if ( needsNewMesh( strName ) ) { + createMesh( strName ); + } m_pModel->m_pCurrentMesh->m_uiMaterialIndex = getMaterialIndex(strName); } @@ -568,17 +537,12 @@ void ObjFileParser::getMaterialDesc() // ------------------------------------------------------------------- // Get a comment, values will be skipped -void ObjFileParser::getComment() -{ - while (m_DataIt != m_DataItEnd) - { - if ( '\n' == (*m_DataIt)) - { +void ObjFileParser::getComment() { + while (m_DataIt != m_DataItEnd) { + if ( '\n' == (*m_DataIt)) { ++m_DataIt; break; - } - else - { + } else { ++m_DataIt; } } @@ -586,8 +550,7 @@ void ObjFileParser::getComment() // ------------------------------------------------------------------- // Get material library from file. -void ObjFileParser::getMaterialLib() -{ +void ObjFileParser::getMaterialLib() { // Translate tuple m_DataIt = getNextToken(m_DataIt, m_DataItEnd); if( m_DataIt == m_DataItEnd ) { @@ -602,6 +565,10 @@ void ObjFileParser::getMaterialLib() // Check for existence const std::string strMatName(pStart, &(*m_DataIt)); std::string absName; + + // Check if directive is valid. + if(!strMatName.length()) throw DeadlyImportError("File name of the material is absent."); + if ( m_pIO->StackSize() > 0 ) { std::string path = m_pIO->CurrentDirectory(); if ( '/' != *path.rbegin() ) { @@ -639,8 +606,7 @@ void ObjFileParser::getMaterialLib() // ------------------------------------------------------------------- // Set a new material definition as the current material. -void ObjFileParser::getNewMaterial() -{ +void ObjFileParser::getNewMaterial() { m_DataIt = getNextToken(m_DataIt, m_DataItEnd); m_DataIt = getNextWord(m_DataIt, m_DataItEnd); if( m_DataIt == m_DataItEnd ) { @@ -653,17 +619,13 @@ void ObjFileParser::getNewMaterial() ++m_DataIt; } std::map::iterator it = m_pModel->m_MaterialMap.find( strMat ); - if ( it == m_pModel->m_MaterialMap.end() ) - { + if ( it == m_pModel->m_MaterialMap.end() ) { // Show a warning, if material was not found DefaultLogger::get()->warn("OBJ: Unsupported material requested: " + strMat); m_pModel->m_pCurrentMaterial = m_pModel->m_pDefaultMaterial; - } - else - { + } else { // Set new material - if ( needsNewMesh( strMat ) ) - { + if ( needsNewMesh( strMat ) ) { createMesh( strMat ); } m_pModel->m_pCurrentMesh->m_uiMaterialIndex = getMaterialIndex( strMat ); diff --git a/code/ObjFileParser.h b/code/ObjFileParser.h index f1be764f0..55be305bb 100644 --- a/code/ObjFileParser.h +++ b/code/ObjFileParser.h @@ -46,6 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include "IOStreamBuffer.h" namespace Assimp { @@ -72,7 +73,7 @@ public: public: /// \brief Constructor with data array. - ObjFileParser(std::vector &Data, const std::string &strModelName, IOSystem* io, ProgressHandler* progress, const std::string &originalObjFileName); + ObjFileParser( IOStreamBuffer &streamBuffer, const std::string &strModelName, IOSystem* io, ProgressHandler* progress, const std::string &originalObjFileName); /// \brief Destructor ~ObjFileParser(); /// \brief Model getter. @@ -80,15 +81,17 @@ public: private: /// Parse the loaded file - void parseFile(); + void parseFile( IOStreamBuffer &streamBuffer ); /// Method to copy the new delimited word in the current line. void copyNextWord(char *pBuffer, size_t length); /// Method to copy the new line. - void copyNextLine(char *pBuffer, size_t length); +// void copyNextLine(char *pBuffer, size_t length); /// Stores the vector void getVector( std::vector &point3d_array ); /// Stores the following 3d vector. void getVector3( std::vector &point3d_array ); + /// Stores the following homogeneous vector as a 3D vector + void getHomogeneousVector3( std::vector &point3d_array ); /// Stores the following two 3d vectors on the line. void getTwoVectors3( std::vector &point3d_array_a, std::vector &point3d_array_b ); /// Stores the following 3d vector. diff --git a/code/ObjTools.h b/code/ObjTools.h index 649ac5a51..b0978a199 100644 --- a/code/ObjTools.h +++ b/code/ObjTools.h @@ -142,11 +142,52 @@ inline char_t getName( char_t it, char_t end, std::string &name ) } char *pStart = &( *it ); - while( !isEndOfBuffer( it, end ) && !IsLineEnd( *it ) ) { + while( !isEndOfBuffer( it, end ) && !IsLineEnd( *it ) && !IsSpaceOrNewLine( *it ) ) { ++it; } - while( isEndOfBuffer( it, end ) || IsLineEnd( *it ) || IsSpaceOrNewLine( *it ) ) { + /*while( isEndOfBuffer( it, end ) || IsLineEnd( *it ) || IsSpaceOrNewLine( *it ) ) { + --it; + } + ++it; + */ + // Get name + // if there is no name, and the previous char is a separator, come back to start + while (&(*it) < pStart) { + ++it; + } + std::string strName( pStart, &(*it) ); + if ( strName.empty() ) + return it; + else + name = strName; + + return it; +} + +/** @brief Get a name from the current line. Do not preserve space + * in the middle, but trim it at the end. + * @param it set to current position + * @param end set to end of scratch buffer for readout + * @param name Separated name + * @return Current-iterator with new position + */ +template +inline char_t getNameNoSpace( char_t it, char_t end, std::string &name ) +{ + name = ""; + if( isEndOfBuffer( it, end ) ) { + return end; + } + + char *pStart = &( *it ); + while( !isEndOfBuffer( it, end ) && !IsLineEnd( *it ) + && !IsSpaceOrNewLine( *it ) ) { + ++it; + } + + while( isEndOfBuffer( it, end ) || IsLineEnd( *it ) + || IsSpaceOrNewLine( *it ) ) { --it; } ++it; @@ -246,6 +287,20 @@ string_type trim_whitespaces(string_type str) return str; } +template +bool hasLineEnd( T it, T end ) { + bool hasLineEnd( false ); + while ( !isEndOfBuffer( it, end ) ) { + it++; + if ( IsLineEnd( it ) ) { + hasLineEnd = true; + break; + } + } + + return hasLineEnd; +} + } // Namespace Assimp #endif // OBJ_TOOLS_H_INC diff --git a/code/OgreMaterial.cpp b/code/OgreMaterial.cpp index f9da9d584..a221ab274 100644 --- a/code/OgreMaterial.cpp +++ b/code/OgreMaterial.cpp @@ -93,7 +93,7 @@ void OgreImporter::ReadMaterials(const std::string &pFile, Assimp::IOSystem *pIO // Create materials that can be found and parsed via the IOSystem. for (size_t i=0, len=mesh->NumSubMeshes(); iGetSubMesh(i); + SubMeshXml *submesh = mesh->GetSubMesh( static_cast(i)); if (submesh && !submesh->materialRef.empty()) { aiMaterial *material = ReadMaterial(pFile, pIOHandler, submesh->materialRef); diff --git a/code/OpenGEXExporter.cpp b/code/OpenGEXExporter.cpp index 77a60fdfb..cf06c9f39 100644 --- a/code/OpenGEXExporter.cpp +++ b/code/OpenGEXExporter.cpp @@ -50,6 +50,10 @@ OpenGEXExporter::OpenGEXExporter() { OpenGEXExporter::~OpenGEXExporter() { } +bool OpenGEXExporter::exportScene( const char *filename, const aiScene* pScene ) { + return true; +} + #endif // ASSIMP_BUILD_NO_OPENGEX_EXPORTER } // Namespace OpenGEX diff --git a/code/OpenGEXImporter.cpp b/code/OpenGEXImporter.cpp index f3a886a96..1a4d511c4 100644 --- a/code/OpenGEXImporter.cpp +++ b/code/OpenGEXImporter.cpp @@ -124,7 +124,7 @@ namespace Grammar { MaterialToken, ColorToken, ParamToken, - TextureToken, + TextureToken, AttenToken }; @@ -223,19 +223,21 @@ static void propId2StdString( Property *prop, std::string &name, std::string &ke OpenGEXImporter::VertexContainer::VertexContainer() : m_numVerts( 0 ) , m_vertices( nullptr ) +, m_numColors( 0 ) +, m_colors( nullptr ) , m_numNormals( 0 ) , m_normals( nullptr ) , m_numUVComps() -, m_textureCoords() - { +, m_textureCoords() { // empty } //------------------------------------------------------------------------------------------------ OpenGEXImporter::VertexContainer::~VertexContainer() { delete[] m_vertices; + delete[] m_colors; delete[] m_normals; - + for(auto &texcoords : m_textureCoords) { delete [] texcoords; } @@ -279,7 +281,7 @@ OpenGEXImporter::OpenGEXImporter() //------------------------------------------------------------------------------------------------ OpenGEXImporter::~OpenGEXImporter() { - m_ctx = NULL; + m_ctx = nullptr; } //------------------------------------------------------------------------------------------------ @@ -411,7 +413,7 @@ void OpenGEXImporter::handleNodes( DDLNode *node, aiScene *pScene ) { case Grammar::ColorToken: handleColorNode( *it, pScene ); break; - + case Grammar::ParamToken: handleParamNode( *it, pScene ); break; @@ -464,20 +466,20 @@ void OpenGEXImporter::handleMetricNode( DDLNode *node, aiScene *pScene ) { //------------------------------------------------------------------------------------------------ void OpenGEXImporter::handleNameNode( DDLNode *node, aiScene *pScene ) { - if( NULL == m_currentNode ) { + if( nullptr == m_currentNode ) { throw DeadlyImportError( "No current node for name." ); return; } Value *val( node->getValue() ); - if( NULL != val ) { + if( nullptr != val ) { if( Value::ddl_string != val->m_type ) { throw DeadlyImportError( "OpenGEX: invalid data type for value in node name." ); return; } const std::string name( val->getString() ); - if( m_tokenType == Grammar::GeometryNodeToken || m_tokenType == Grammar::LightNodeToken + if( m_tokenType == Grammar::GeometryNodeToken || m_tokenType == Grammar::LightNodeToken || m_tokenType == Grammar::CameraNodeToken ) { m_currentNode->mName.Set( name.c_str() ); } else if( m_tokenType == Grammar::MaterialToken ) { @@ -488,7 +490,7 @@ void OpenGEXImporter::handleNameNode( DDLNode *node, aiScene *pScene ) { //------------------------------------------------------------------------------------------------ static void getRefNames( DDLNode *node, std::vector &names ) { - ai_assert( NULL != node ); + ai_assert( nullptr != node ); Reference *ref = node->getReferences(); if( nullptr != ref ) { @@ -513,7 +515,7 @@ void OpenGEXImporter::handleObjectRefNode( DDLNode *node, aiScene *pScene ) { std::vector objRefNames; getRefNames( node, objRefNames ); - + // when we are dealing with a geometry node prepare the mesh cache if ( m_tokenType == Grammar::GeometryNodeToken ) { m_currentNode->mNumMeshes = objRefNames.size(); @@ -594,7 +596,7 @@ void OpenGEXImporter::handleGeometryObject( DDLNode *node, aiScene *pScene ) { //------------------------------------------------------------------------------------------------ void OpenGEXImporter::handleCameraObject( ODDLParser::DDLNode *node, aiScene *pScene ) { // parameters will be parsed normally in the tree, so just go for it - + handleNodes( node, pScene ); } @@ -710,6 +712,7 @@ void OpenGEXImporter::handleMeshNode( ODDLParser::DDLNode *node, aiScene *pScene enum MeshAttribute { None, Position, + Color, Normal, TexCoord }; @@ -718,8 +721,10 @@ enum MeshAttribute { static MeshAttribute getAttributeByName( const char *attribName ) { ai_assert( nullptr != attribName ); - if( 0 == strncmp( "position", attribName, strlen( "position" ) ) ) { + if ( 0 == strncmp( "position", attribName, strlen( "position" ) ) ) { return Position; + } else if ( 0 == strncmp( "color", attribName, strlen( "color" ) ) ) { + return Color; } else if( 0 == strncmp( "normal", attribName, strlen( "normal" ) ) ) { return Normal; } else if( 0 == strncmp( "texcoord", attribName, strlen( "texcoord" ) ) ) { @@ -747,6 +752,21 @@ static void fillVector3( aiVector3D *vec3, Value *vals ) { vec3->Set( x, y, z ); } +//------------------------------------------------------------------------------------------------ +static void fillColor4( aiColor4D *col4, Value *vals ) { + ai_assert( nullptr != col4 ); + ai_assert( nullptr != vals ); + + Value *next( vals ); + col4->r = next->getFloat(); + next = next->m_next; + col4->g = next->getFloat(); + next = next->m_next; + col4->b = next->getFloat(); + next = next->m_next; + col4->a = next->getFloat(); +} + //------------------------------------------------------------------------------------------------ static size_t countDataArrayListItems( DataArrayList *vaList ) { size_t numItems( 0 ); @@ -774,6 +794,14 @@ static void copyVectorArray( size_t numItems, DataArrayList *vaList, aiVector3D } } +//------------------------------------------------------------------------------------------------ +static void copyColor4DArray( size_t numItems, DataArrayList *vaList, aiColor4D *colArray ) { + for ( size_t i = 0; i < numItems; i++ ) { + Value *next( vaList->m_dataList ); + fillColor4( &colArray[ i ], next ); + } +} + //------------------------------------------------------------------------------------------------ void OpenGEXImporter::handleVertexArrayNode( ODDLParser::DDLNode *node, aiScene *pScene ) { if( nullptr == node ) { @@ -801,6 +829,10 @@ void OpenGEXImporter::handleVertexArrayNode( ODDLParser::DDLNode *node, aiScene m_currentVertices.m_numVerts = numItems; m_currentVertices.m_vertices = new aiVector3D[ numItems ]; copyVectorArray( numItems, vaList, m_currentVertices.m_vertices ); + } else if ( Color == attribType ) { + m_currentVertices.m_numColors = numItems; + m_currentVertices.m_colors = new aiColor4D[ numItems ]; + copyColor4DArray( numItems, vaList, m_currentVertices.m_colors ); } else if( Normal == attribType ) { m_currentVertices.m_numNormals = numItems; m_currentVertices.m_normals = new aiVector3D[ numItems ]; @@ -835,6 +867,11 @@ void OpenGEXImporter::handleIndexArrayNode( ODDLParser::DDLNode *node, aiScene * m_currentMesh->mFaces = new aiFace[ numItems ]; m_currentMesh->mNumVertices = numItems * 3; m_currentMesh->mVertices = new aiVector3D[ m_currentMesh->mNumVertices ]; + bool hasColors( false ); + if ( m_currentVertices.m_numColors > 0 ) { + m_currentMesh->mColors[0] = new aiColor4D[ m_currentVertices.m_numColors ]; + hasColors = true; + } bool hasNormalCoords( false ); if ( m_currentVertices.m_numNormals > 0 ) { m_currentMesh->mNormals = new aiVector3D[ m_currentMesh->mNumVertices ]; @@ -858,6 +895,10 @@ void OpenGEXImporter::handleIndexArrayNode( ODDLParser::DDLNode *node, aiScene * ai_assert( index < m_currentMesh->mNumVertices ); aiVector3D &pos = ( m_currentVertices.m_vertices[ idx ] ); m_currentMesh->mVertices[ index ].Set( pos.x, pos.y, pos.z ); + if ( hasColors ) { + aiColor4D &col = m_currentVertices.m_colors[ idx ]; + m_currentMesh->mColors[ 0 ][ index ] = col; + } if ( hasNormalCoords ) { aiVector3D &normal = ( m_currentVertices.m_normals[ idx ] ); m_currentMesh->mNormals[ index ].Set( normal.x, normal.y, normal.z ); @@ -1082,10 +1123,10 @@ void OpenGEXImporter::resolveReferences() { return; } - RefInfo *currentRefInfo( NULL ); + RefInfo *currentRefInfo( nullptr ); for( std::vector::iterator it = m_unresolvedRefStack.begin(); it != m_unresolvedRefStack.end(); ++it ) { currentRefInfo = *it; - if( NULL != currentRefInfo ) { + if( nullptr != currentRefInfo ) { aiNode *node( currentRefInfo->m_node ); if( RefInfo::MeshRef == currentRefInfo->m_type ) { for( size_t i = 0; i < currentRefInfo->m_Names.size(); i++ ) { @@ -1124,10 +1165,10 @@ void OpenGEXImporter::createNodeTree( aiScene *pScene ) { void OpenGEXImporter::pushNode( aiNode *node, aiScene *pScene ) { ai_assert( nullptr != pScene ); - if ( NULL == node ) { + if ( nullptr == node ) { return; } - + ChildInfo *info( nullptr ); if( m_nodeStack.empty() ) { node->mParent = pScene->mRootNode; diff --git a/code/OpenGEXImporter.h b/code/OpenGEXImporter.h index d655fb60b..103b27903 100644 --- a/code/OpenGEXImporter.h +++ b/code/OpenGEXImporter.h @@ -142,6 +142,8 @@ private: struct VertexContainer { size_t m_numVerts; aiVector3D *m_vertices; + size_t m_numColors; + aiColor4D *m_colors; size_t m_numNormals; aiVector3D *m_normals; size_t m_numUVComps[ AI_MAX_NUMBER_OF_TEXTURECOORDS ]; @@ -150,9 +152,8 @@ private: VertexContainer(); ~VertexContainer(); - private: - VertexContainer( const VertexContainer & ); - VertexContainer &operator = ( const VertexContainer & ); + VertexContainer( const VertexContainer & ) = delete; + VertexContainer &operator = ( const VertexContainer & ) = delete; }; struct RefInfo { @@ -168,9 +169,8 @@ private: RefInfo( aiNode *node, Type type, std::vector &names ); ~RefInfo(); - private: - RefInfo( const RefInfo & ); - RefInfo &operator = ( const RefInfo & ); + RefInfo( const RefInfo & ) = delete; + RefInfo &operator = ( const RefInfo & ) = delete; }; struct ChildInfo { diff --git a/code/OpenGEXStructs.h b/code/OpenGEXStructs.h index 837597975..910b03f60 100644 --- a/code/OpenGEXStructs.h +++ b/code/OpenGEXStructs.h @@ -113,7 +113,6 @@ struct LightObject { bool shadowFlag; }; - struct CameraObject { float focalLength; float nearDepth; @@ -146,7 +145,6 @@ struct Name { std::string name; }; - struct ObjectRef { Object *targetStructure; }; @@ -173,7 +171,6 @@ struct BoneIndex { unsigned short *arrayStorage; }; - struct BoneWeight { int boneWeightCount; const float *boneWeightArray; diff --git a/code/PretransformVertices.cpp b/code/PretransformVertices.cpp index 48a3e6f61..90a58e321 100644 --- a/code/PretransformVertices.cpp +++ b/code/PretransformVertices.cpp @@ -690,7 +690,7 @@ void PretransformVertices::Execute( aiScene* pScene) // find the dominant axis aiVector3D d = max-min; - const ai_real div = std::max(d.x,std::max(d.y,d.z))*0.5; + const ai_real div = std::max(d.x,std::max(d.y,d.z))*ai_real( 0.5); d = min + d * (ai_real)0.5; for (unsigned int a = 0; a < pScene->mNumMeshes; ++a) { diff --git a/code/ProcessHelper.cpp b/code/ProcessHelper.cpp index c77049061..4bfbbd5a3 100644 --- a/code/ProcessHelper.cpp +++ b/code/ProcessHelper.cpp @@ -77,8 +77,8 @@ void ConvertListToStrings(const std::string& in, std::list& out) void FindAABBTransformed (const aiMesh* mesh, aiVector3D& min, aiVector3D& max, const aiMatrix4x4& m) { - min = aiVector3D (10e10, 10e10, 10e10); - max = aiVector3D (-10e10,-10e10,-10e10); + min = aiVector3D ( ai_real( 10e10 ), ai_real( 10e10 ), ai_real( 10e10 ) ); + max = aiVector3D ( ai_real( -10e10 ), ai_real( -10e10 ), ai_real( -10e10 ) ); for (unsigned int i = 0;i < mesh->mNumVertices;++i) { const aiVector3D v = m * mesh->mVertices[i]; @@ -144,7 +144,7 @@ void FindMeshCenterTransformed (aiMesh* mesh, aiVector3D& out, // ------------------------------------------------------------------------------- ai_real ComputePositionEpsilon(const aiMesh* pMesh) { - const ai_real epsilon = 1e-4; + const ai_real epsilon = ai_real( 1e-4 ); // calculate the position bounds so we have a reliable epsilon to check position differences against aiVector3D minVec, maxVec; @@ -157,7 +157,7 @@ ai_real ComputePositionEpsilon(const aiMesh* const* pMeshes, size_t num) { ai_assert( NULL != pMeshes ); - const ai_real epsilon = 1e-4; + const ai_real epsilon = ai_real( 1e-4 ); // calculate the position bounds so we have a reliable epsilon to check position differences against aiVector3D minVec, maxVec, mi, ma; diff --git a/code/Q3BSPFileData.h b/code/Q3BSPFileData.h index 42e2bf148..ab46db24f 100644 --- a/code/Q3BSPFileData.h +++ b/code/Q3BSPFileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2008, assimp team +Copyright (c) 2006-2016, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Q3BSPFileImporter.cpp b/code/Q3BSPFileImporter.cpp index 47001d06f..1433dda9c 100644 --- a/code/Q3BSPFileImporter.cpp +++ b/code/Q3BSPFileImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------------------------------- -Copyright (c) 2006-2008, assimp team +Copyright (c) 2006-2016, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, @@ -40,7 +40,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER -//#include #include "DefaultIOSystem.h" #include "Q3BSPFileImporter.h" #include "Q3BSPZipArchive.h" @@ -76,14 +75,6 @@ static const aiImporterDesc desc = { namespace Assimp { -/* -static void getSupportedExtensions(std::vector &supportedExtensions) { - supportedExtensions.push_back( ".jpg" ); - supportedExtensions.push_back( ".png" ); - supportedExtensions.push_back( ".tga" ); -} -*/ - using namespace Q3BSP; // ------------------------------------------------------------------------------------------------ @@ -175,7 +166,7 @@ Q3BSPFileImporter::~Q3BSPFileImporter() { bool Q3BSPFileImporter::CanRead( const std::string& rFile, IOSystem* /*pIOHandler*/, bool checkSig ) const { if(!checkSig) { - return SimpleExtensionCheck( rFile, "pk3" ); + return SimpleExtensionCheck( rFile, "pk3", "bsp" ); } // TODO perhaps add keyword based detection return false; diff --git a/code/Q3BSPFileImporter.h b/code/Q3BSPFileImporter.h index c995f82ab..ee8991bea 100644 --- a/code/Q3BSPFileImporter.h +++ b/code/Q3BSPFileImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2008, assimp team +Copyright (c) 2006-2016, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Q3BSPFileParser.cpp b/code/Q3BSPFileParser.cpp index db2247b8a..0dabaf87d 100644 --- a/code/Q3BSPFileParser.cpp +++ b/code/Q3BSPFileParser.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2008, assimp team +Copyright (c) 2006-2016, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Q3BSPFileParser.h b/code/Q3BSPFileParser.h index 55de25491..8363d31c0 100644 --- a/code/Q3BSPFileParser.h +++ b/code/Q3BSPFileParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2008, assimp team +Copyright (c) 2006-2016, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Q3BSPZipArchive.cpp b/code/Q3BSPZipArchive.cpp index 59e437836..80b3e9c6b 100644 --- a/code/Q3BSPZipArchive.cpp +++ b/code/Q3BSPZipArchive.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2008, assimp team +Copyright (c) 2006-2016, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Q3BSPZipArchive.h b/code/Q3BSPZipArchive.h index e46a11b4c..4dcd7a849 100644 --- a/code/Q3BSPZipArchive.h +++ b/code/Q3BSPZipArchive.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2008, assimp team +Copyright (c) 2006-2016, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, @@ -58,24 +58,15 @@ namespace Q3BSP { /// \brief // ------------------------------------------------------------------------------------------------ class IOSystem2Unzip { - - public: - - static voidpf open(voidpf opaque, const char* filename, int mode); - - static uLong read(voidpf opaque, voidpf stream, void* buf, uLong size); - - static uLong write(voidpf opaque, voidpf stream, const void* buf, uLong size); - - static long tell(voidpf opaque, voidpf stream); - - static long seek(voidpf opaque, voidpf stream, uLong offset, int origin); - - static int close(voidpf opaque, voidpf stream); - - static int testerror(voidpf opaque, voidpf stream); - - static zlib_filefunc_def get(IOSystem* pIOHandler); +public: + static voidpf open(voidpf opaque, const char* filename, int mode); + static uLong read(voidpf opaque, voidpf stream, void* buf, uLong size); + static uLong write(voidpf opaque, voidpf stream, const void* buf, uLong size); + static long tell(voidpf opaque, voidpf stream); + static long seek(voidpf opaque, voidpf stream, uLong offset, int origin); + static int close(voidpf opaque, voidpf stream); + static int testerror(voidpf opaque, voidpf stream); + static zlib_filefunc_def get(IOSystem* pIOHandler); }; // ------------------------------------------------------------------------------------------------ @@ -85,32 +76,21 @@ class IOSystem2Unzip { /// \brief // ------------------------------------------------------------------------------------------------ class ZipFile : public IOStream { - friend class Q3BSPZipArchive; - public: +public: + explicit ZipFile(size_t size); + ~ZipFile(); + size_t Read(void* pvBuffer, size_t pSize, size_t pCount ); + size_t Write(const void* /*pvBuffer*/, size_t /*pSize*/, size_t /*pCount*/); + size_t FileSize() const; + aiReturn Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/); + size_t Tell() const; + void Flush(); - explicit ZipFile(size_t size); - - ~ZipFile(); - - size_t Read(void* pvBuffer, size_t pSize, size_t pCount ); - - size_t Write(const void* /*pvBuffer*/, size_t /*pSize*/, size_t /*pCount*/); - - size_t FileSize() const; - - aiReturn Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/); - - size_t Tell() const; - - void Flush(); - - private: - - void* m_Buffer; - - size_t m_Size; +private: + void* m_Buffer; + size_t m_Size; }; // ------------------------------------------------------------------------------------------------ @@ -121,39 +101,25 @@ class ZipFile : public IOStream { /// from a P3K archive ( Quake level format ). // ------------------------------------------------------------------------------------------------ class Q3BSPZipArchive : public Assimp::IOSystem { +public: + static const unsigned int FileNameSize = 256; - public: +public: + Q3BSPZipArchive(IOSystem* pIOHandler, const std::string & rFile); + ~Q3BSPZipArchive(); + bool Exists(const char* pFile) const; + char getOsSeparator() const; + IOStream* Open(const char* pFile, const char* pMode = "rb"); + void Close(IOStream* pFile); + bool isOpen() const; + void getFileList(std::vector &rFileList); - static const unsigned int FileNameSize = 256; - - public: - - Q3BSPZipArchive(IOSystem* pIOHandler, const std::string & rFile); - - ~Q3BSPZipArchive(); - - bool Exists(const char* pFile) const; - - char getOsSeparator() const; - - IOStream* Open(const char* pFile, const char* pMode = "rb"); - - void Close(IOStream* pFile); - - bool isOpen() const; - - void getFileList(std::vector &rFileList); - - private: - - bool mapArchive(); - - private: - - unzFile m_ZipFileHandle; - - std::map m_ArchiveMap; +private: + bool mapArchive(); +private: + unzFile m_ZipFileHandle; + std::map m_ArchiveMap; }; // ------------------------------------------------------------------------------------------------ diff --git a/code/RemoveRedundantMaterials.cpp b/code/RemoveRedundantMaterials.cpp index a3e61ae8d..a9954b946 100644 --- a/code/RemoveRedundantMaterials.cpp +++ b/code/RemoveRedundantMaterials.cpp @@ -177,12 +177,14 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene) continue; } - // generate new names for all modified materials + // generate new names for modified materials that had no names const unsigned int idx = aiMappingTable[p]; if (ppcMaterials[idx]) { aiString sz; - sz.length = ::ai_snprintf(sz.data,MAXLEN,"JoinedMaterial_#%u",p); - ((aiMaterial*)ppcMaterials[idx])->AddProperty(&sz,AI_MATKEY_NAME); + if( ppcMaterials[idx]->Get(AI_MATKEY_NAME, sz) != AI_SUCCESS ) { + sz.length = ::ai_snprintf(sz.data,MAXLEN,"JoinedMaterial_#%u",p); + ((aiMaterial*)ppcMaterials[idx])->AddProperty(&sz,AI_MATKEY_NAME); + } } else { ppcMaterials[idx] = pScene->mMaterials[p]; } diff --git a/code/SIBImporter.cpp b/code/SIBImporter.cpp index 8dfacc106..05afb5198 100644 --- a/code/SIBImporter.cpp +++ b/code/SIBImporter.cpp @@ -709,9 +709,9 @@ static void ReadLightInfo(aiLight* light, StreamReaderLE* stream) // 99% and 1% percentiles. // OpenGL: I = cos(angle)^E // Solving: angle = acos(I^(1/E)) - ai_real E = 1.0 / std::max(spotExponent, (ai_real)0.00001); - ai_real inner = acos(pow((ai_real)0.99, E)); - ai_real outer = acos(pow((ai_real)0.01, E)); + ai_real E = ai_real( 1.0 ) / std::max(spotExponent, (ai_real)0.00001); + ai_real inner = std::acos(std::pow((ai_real)0.99, E)); + ai_real outer = std::acos(std::pow((ai_real)0.01, E)); // Apply the cutoff. outer = std::min(outer, AI_DEG_TO_RAD(spotCutoff)); diff --git a/code/STEPFile.h b/code/STEPFile.h index e09add1eb..9a830c068 100644 --- a/code/STEPFile.h +++ b/code/STEPFile.h @@ -72,7 +72,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "LineSplitter.h" - // uncomment this to have the loader evaluate all entities upon loading. // this is intended as stress test - by default, entities are evaluated // lazily and therefore not unless needed. @@ -118,15 +117,13 @@ namespace STEP { // ******************************************************************************** - namespace STEP { // ------------------------------------------------------------------------------- /** Exception class used by the STEP loading & parsing code. It is typically * coupled with a line number. */ // ------------------------------------------------------------------------------- - struct SyntaxError : DeadlyImportError - { + struct SyntaxError : DeadlyImportError { enum { LINE_NOT_SPECIFIED = 0xffffffffffffffffLL }; @@ -253,7 +250,7 @@ namespace STEP { { public: - // This is the type that will ultimatively be used to + // This is the type that will cd ultimatively be used to // expose this data type to the user. typedef T Out; @@ -1001,26 +998,20 @@ namespace STEP { refs.insert(std::make_pair(who,by_whom)); } - - private: - HeaderInfo header; ObjectMap objects; ObjectMapByType objects_bytype; RefMap refs; InverseWhitelist inv_whitelist; - std::shared_ptr reader; LineSplitter splitter; - uint64_t evaluated_count; - const EXPRESS::ConversionSchema* schema; }; } - } // end Assimp -#endif + +#endif // INCLUDED_AI_STEPFILE_H diff --git a/code/STLLoader.cpp b/code/STLLoader.cpp index 647bd8a96..0571e542b 100644 --- a/code/STLLoader.cpp +++ b/code/STLLoader.cpp @@ -168,8 +168,7 @@ void addFacesToMesh(aiMesh* pMesh) // ------------------------------------------------------------------------------------------------ // Imports the given file into the given scene structure. -void STLImporter::InternReadFile( const std::string& pFile, - aiScene* pScene, IOSystem* pIOHandler) +void STLImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler ) { std::unique_ptr file( pIOHandler->Open( pFile, "rb")); @@ -189,7 +188,7 @@ void STLImporter::InternReadFile( const std::string& pFile, this->mBuffer = &mBuffer2[0]; // the default vertex color is light gray. - clrColorDefault.r = clrColorDefault.g = clrColorDefault.b = clrColorDefault.a = 0.6; + clrColorDefault.r = clrColorDefault.g = clrColorDefault.b = clrColorDefault.a = (ai_real) 0.6; // allocate a single node pScene->mRootNode = new aiNode(); @@ -217,13 +216,13 @@ void STLImporter::InternReadFile( const std::string& pFile, s.Set(AI_DEFAULT_MATERIAL_NAME); pcMat->AddProperty(&s, AI_MATKEY_NAME); - aiColor4D clrDiffuse(0.6,0.6,0.6,1.0); + aiColor4D clrDiffuse(ai_real(0.6),ai_real(0.6),ai_real(0.6),ai_real(1.0)); if (bMatClr) { clrDiffuse = clrColorDefault; } pcMat->AddProperty(&clrDiffuse,1,AI_MATKEY_COLOR_DIFFUSE); pcMat->AddProperty(&clrDiffuse,1,AI_MATKEY_COLOR_SPECULAR); - clrDiffuse = aiColor4D(0.05,0.05,0.05,1.0); + clrDiffuse = aiColor4D( ai_real( 0.05), ai_real( 0.05), ai_real( 0.05), ai_real( 1.0)); pcMat->AddProperty(&clrDiffuse,1,AI_MATKEY_COLOR_AMBIENT); pScene->mNumMaterials = 1; @@ -275,7 +274,7 @@ void STLImporter::LoadASCIIFile() } else pScene->mRootNode->mName.Set(""); - unsigned int faceVertexCounter = 0; + unsigned int faceVertexCounter = 3; for ( ;; ) { // go to the next token @@ -416,10 +415,11 @@ bool STLImporter::LoadBinaryFile() // read the default vertex color for facets bIsMaterialise = true; DefaultLogger::get()->info("STL: Taking code path for Materialise files"); - clrColorDefault.r = (*sz2++) / 255.0; - clrColorDefault.g = (*sz2++) / 255.0; - clrColorDefault.b = (*sz2++) / 255.0; - clrColorDefault.a = (*sz2++) / 255.0; + const ai_real invByte = (ai_real)1.0 / ( ai_real )255.0; + clrColorDefault.r = (*sz2++) * invByte; + clrColorDefault.g = (*sz2++) * invByte; + clrColorDefault.b = (*sz2++) * invByte; + clrColorDefault.a = (*sz2++) * invByte; break; } } @@ -481,17 +481,18 @@ bool STLImporter::LoadBinaryFile() } aiColor4D* clr = &pMesh->mColors[0][i*3]; clr->a = 1.0; + const ai_real invVal( (ai_real)1.0 / ( ai_real )31.0 ); if (bIsMaterialise) // this is reversed { - clr->r = (color & 0x31u) / 31.0; - clr->g = ((color & (0x31u<<5))>>5u) / 31.0; - clr->b = ((color & (0x31u<<10))>>10u) / 31.0; + clr->r = (color & 0x31u) *invVal; + clr->g = ((color & (0x31u<<5))>>5u) *invVal; + clr->b = ((color & (0x31u<<10))>>10u) *invVal; } else { - clr->b = (color & 0x31u) / 31.0; - clr->g = ((color & (0x31u<<5))>>5u) / 31.0; - clr->r = ((color & (0x31u<<10))>>10u) / 31.0; + clr->b = (color & 0x31u) *invVal; + clr->g = ((color & (0x31u<<5))>>5u) *invVal; + clr->r = ((color & (0x31u<<10))>>10u) *invVal; } // assign the color to all vertices of the face *(clr+1) = *clr; diff --git a/code/SceneCombiner.cpp b/code/SceneCombiner.cpp index 68c595b26..e19741a9d 100644 --- a/code/SceneCombiner.cpp +++ b/code/SceneCombiner.cpp @@ -740,7 +740,7 @@ void SceneCombiner::MergeBones(aiMesh* out,std::vector::const_iterator aiVertexWeight* avw = pc->mWeights = new aiVertexWeight[pc->mNumWeights]; // And copy the final weights - adjust the vertex IDs by the - // face index offset of the coresponding mesh. + // face index offset of the corresponding mesh. for (std::vector< BoneSrcIndex >::const_iterator wmit = (*it).pSrcBones.begin(); wmit != wend; ++wmit) { aiBone* pip = (*wmit).first; for (unsigned int mp = 0; mp < pip->mNumWeights;++mp,++avw) { @@ -1237,8 +1237,8 @@ void SceneCombiner::Copy (aiMetadata** _dest, const aiMetadata* src) case AI_BOOL: out.mData = new bool(*static_cast(in.mData)); break; - case AI_INT: - out.mData = new int(*static_cast(in.mData)); + case AI_INT32: + out.mData = new int32_t(*static_cast(in.mData)); break; case AI_UINT64: out.mData = new uint64_t(*static_cast(in.mData)); diff --git a/code/SceneCombiner.h b/code/SceneCombiner.h index 81e58aaf3..a6ba06768 100644 --- a/code/SceneCombiner.h +++ b/code/SceneCombiner.h @@ -198,7 +198,7 @@ struct SceneHelper * The class is currently being used by various postprocessing steps * and loaders (ie. LWS). */ -class SceneCombiner +class ASSIMP_API SceneCombiner { // class cannot be instanced SceneCombiner() {} diff --git a/code/ScenePreprocessor.cpp b/code/ScenePreprocessor.cpp index a38a9430e..327da0b35 100644 --- a/code/ScenePreprocessor.cpp +++ b/code/ScenePreprocessor.cpp @@ -176,22 +176,22 @@ void ScenePreprocessor::ProcessAnimation (aiAnimation* anim) if (anim->mDuration == -1.) { // Position keys - for (unsigned int i = 0; i < channel->mNumPositionKeys;++i) { - aiVectorKey& key = channel->mPositionKeys[i]; + for (unsigned int j = 0; j < channel->mNumPositionKeys;++j) { + aiVectorKey& key = channel->mPositionKeys[j]; first = std::min (first, key.mTime); last = std::max (last, key.mTime); } // Scaling keys - for (unsigned int i = 0; i < channel->mNumScalingKeys;++i) { - aiVectorKey& key = channel->mScalingKeys[i]; + for (unsigned int j = 0; j < channel->mNumScalingKeys;++j ) { + aiVectorKey& key = channel->mScalingKeys[j]; first = std::min (first, key.mTime); last = std::max (last, key.mTime); } // Rotation keys - for (unsigned int i = 0; i < channel->mNumRotationKeys;++i) { - aiQuatKey& key = channel->mRotationKeys[i]; + for (unsigned int j = 0; j < channel->mNumRotationKeys;++j ) { + aiQuatKey& key = channel->mRotationKeys[ j ]; first = std::min (first, key.mTime); last = std::max (last, key.mTime); } diff --git a/code/SkeletonMeshBuilder.cpp b/code/SkeletonMeshBuilder.cpp index c564cbc95..d929ac361 100644 --- a/code/SkeletonMeshBuilder.cpp +++ b/code/SkeletonMeshBuilder.cpp @@ -132,7 +132,7 @@ void SkeletonMeshBuilder::CreateGeometry( const aiNode* pNode) { // if the node has no children, it's an end node. Put a little knob there instead aiVector3D ownpos( pNode->mTransformation.a4, pNode->mTransformation.b4, pNode->mTransformation.c4); - ai_real sizeEstimate = ownpos.Length() * 0.18; + ai_real sizeEstimate = ownpos.Length() * ai_real( 0.18 ); mVertices.push_back( aiVector3D( -sizeEstimate, 0.0, 0.0)); mVertices.push_back( aiVector3D( 0.0, sizeEstimate, 0.0)); diff --git a/code/StandardShapes.cpp b/code/StandardShapes.cpp index 943b73920..eed8ddabc 100644 --- a/code/StandardShapes.cpp +++ b/code/StandardShapes.cpp @@ -121,8 +121,7 @@ void Subdivide(std::vector& positions) aiMesh* StandardShapes::MakeMesh(const std::vector& positions, unsigned int numIndices) { - if (positions.size() & numIndices || positions.empty() || !numIndices) - return NULL; + if (positions.empty() || !numIndices) return NULL; // Determine which kinds of primitives the mesh consists of aiMesh* out = new aiMesh(); @@ -194,8 +193,8 @@ unsigned int StandardShapes::MakeIcosahedron(std::vector& positions) { positions.reserve(positions.size()+60); - const ai_real t = (1.0 + 2.236067977)/2.0; - const ai_real s = std::sqrt(1.0 + t*t); + const ai_real t = ( ai_real( 1.0 )+ ai_real( 2.236067977 ) ) / ai_real( 2.0 ); + const ai_real s = std::sqrt(ai_real(1.0) + t*t); const aiVector3D v0 = aiVector3D(t,1.0, 0.0)/s; const aiVector3D v1 = aiVector3D(-t,1.0, 0.0)/s; @@ -244,9 +243,9 @@ unsigned int StandardShapes::MakeDodecahedron(std::vector& positions { positions.reserve(positions.size()+108); - const ai_real a = 1.0 / 1.7320508; - const ai_real b = std::sqrt((3.0-2.23606797f)/6.0); - const ai_real c = std::sqrt((3.0+2.23606797f)/6.0); + const ai_real a = ai_real( 1.0 ) / ai_real(1.7320508); + const ai_real b = std::sqrt(( ai_real( 3.0 )- ai_real( 2.23606797))/ ai_real( 6.0) ); + const ai_real c = std::sqrt(( ai_real( 3.0 )+ ai_real( 2.23606797f))/ ai_real( 6.0) ); const aiVector3D v0 = aiVector3D(a,a,a); const aiVector3D v1 = aiVector3D(a,a,-a); @@ -316,13 +315,14 @@ unsigned int StandardShapes::MakeTetrahedron(std::vector& positions) { positions.reserve(positions.size()+9); - const ai_real a = 1.41421/3.0; - const ai_real b = 2.4494/3.0; + const ai_real invThree = ai_real( 1.0 ) / ai_real( 3.0 ); + const ai_real a = ai_real( 1.41421 ) * invThree; + const ai_real b = ai_real( 2.4494 ) * invThree; const aiVector3D v0 = aiVector3D(0.0,0.0,1.0); - const aiVector3D v1 = aiVector3D(2*a,0,-1.0/3.0); - const aiVector3D v2 = aiVector3D(-a,b,-1.0/3.0); - const aiVector3D v3 = aiVector3D(-a,-b,-1.0/3.0); + const aiVector3D v1 = aiVector3D(2*a,0,-invThree ); + const aiVector3D v2 = aiVector3D(-a,b,-invThree ); + const aiVector3D v3 = aiVector3D(-a,-b,-invThree ); ADD_TRIANGLE(v0,v1,v2); ADD_TRIANGLE(v0,v2,v3); @@ -337,7 +337,7 @@ unsigned int StandardShapes::MakeHexahedron(std::vector& positions, bool polygons /*= false*/) { positions.reserve(positions.size()+36); - const ai_real length = 1.0/1.73205080; + const ai_real length = ai_real(1.0)/ai_real(1.73205080); const aiVector3D v0 = aiVector3D(-1.0,-1.0,-1.0)*length; const aiVector3D v1 = aiVector3D(1.0,-1.0,-1.0)*length; @@ -396,7 +396,7 @@ void StandardShapes::MakeCone(ai_real height,ai_real radius1, radius1 = std::fabs(radius1); radius2 = std::fabs(radius2); - ai_real halfHeight = height / 2.0; + ai_real halfHeight = height / ai_real(2.0); // radius1 is always the smaller one if (radius2 > radius1) diff --git a/code/StdOStreamLogStream.h b/code/StdOStreamLogStream.h index 20482fef7..249e30458 100644 --- a/code/StdOStreamLogStream.h +++ b/code/StdOStreamLogStream.h @@ -38,6 +38,11 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------- */ + +/** @file StdOStreamLogStream.h +* @brief Implementation of StdOStreamLogStream +*/ + #ifndef AI_STROSTREAMLOGSTREAM_H_INC #define AI_STROSTREAMLOGSTREAM_H_INC @@ -50,8 +55,7 @@ namespace Assimp { /** @class StdOStreamLogStream * @brief Logs into a std::ostream */ -class StdOStreamLogStream : public LogStream -{ +class StdOStreamLogStream : public LogStream { public: /** @brief Construction from an existing std::ostream * @param _ostream Output stream to be used @@ -63,30 +67,33 @@ public: /** @brief Writer */ void write(const char* message); + private: - std::ostream& ostream; + std::ostream& mOstream; }; // --------------------------------------------------------------------------- // Default constructor inline StdOStreamLogStream::StdOStreamLogStream(std::ostream& _ostream) - : ostream (_ostream) -{} - -// --------------------------------------------------------------------------- -// Default constructor -inline StdOStreamLogStream::~StdOStreamLogStream() -{} - -// --------------------------------------------------------------------------- -// Write method -inline void StdOStreamLogStream::write(const char* message) -{ - ostream << message; - ostream.flush(); +: mOstream (_ostream){ + // empty } // --------------------------------------------------------------------------- +// Default constructor +inline StdOStreamLogStream::~StdOStreamLogStream() { + // empty +} + +// --------------------------------------------------------------------------- +// Write method +inline void StdOStreamLogStream::write(const char* message) { + mOstream << message; + mOstream.flush(); +} + +// --------------------------------------------------------------------------- + } // Namespace Assimp #endif // guard diff --git a/code/StringUtils.h b/code/StringUtils.h index 99352ebfb..15f7db2e7 100644 --- a/code/StringUtils.h +++ b/code/StringUtils.h @@ -43,6 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include #include @@ -103,7 +104,7 @@ float ai_strtof( const char *begin, const char *end ) { std::string token( begin, len ); val = static_cast< float >( ::atof( token.c_str() ) ); } - + return val; } diff --git a/code/TinyFormatter.h b/code/TinyFormatter.h index 7a5e7d21f..1182e3a5a 100644 --- a/code/TinyFormatter.h +++ b/code/TinyFormatter.h @@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include namespace Assimp { - namespace Formatter { +namespace Formatter { // ------------------------------------------------------------------------------------------------ /** stringstream utility. Usage: @@ -160,4 +160,5 @@ typedef basic_formatter< wchar_t > wformat; } // ! namespace Formatter } // ! namespace Assimp + #endif diff --git a/code/ValidateDataStructure.cpp b/code/ValidateDataStructure.cpp index fd6867012..44e361f71 100644 --- a/code/ValidateDataStructure.cpp +++ b/code/ValidateDataStructure.cpp @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- @@ -408,7 +408,8 @@ void ValidateDSProcess::Validate( const aiMesh* pMesh) // the MSB flag is temporarily used by the extra verbose // mode to tell us that the JoinVerticesProcess might have // been executed already. - if ( !(this->mScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT ) && abRefList[face.mIndices[a]]) + if ( !(this->mScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT ) && !(this->mScene->mFlags & AI_SCENE_FLAGS_ALLOW_SHARED) && + abRefList[face.mIndices[a]]) { ReportError("aiMesh::mVertices[%i] is referenced twice - second " "time by aiMesh::mFaces[%i]::mIndices[%i]",face.mIndices[a],i,a); diff --git a/code/Win32DebugLogStream.h b/code/Win32DebugLogStream.h index c7bd8ca62..de8606ebc 100644 --- a/code/Win32DebugLogStream.h +++ b/code/Win32DebugLogStream.h @@ -1,7 +1,51 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +/** @file Win32DebugLogStream.h +* @brief Implementation of Win32DebugLogStream +*/ #ifndef AI_WIN32DEBUGLOGSTREAM_H_INC #define AI_WIN32DEBUGLOGSTREAM_H_INC -#ifdef WIN32 +#ifdef _WIN32 #include #include "windows.h" @@ -12,9 +56,7 @@ namespace Assimp { /** @class Win32DebugLogStream * @brief Logs into the debug stream from win32. */ -class Win32DebugLogStream : - public LogStream -{ +class Win32DebugLogStream : public LogStream { public: /** @brief Default constructor */ Win32DebugLogStream(); @@ -27,24 +69,25 @@ public: }; // --------------------------------------------------------------------------- -// Default constructor -inline Win32DebugLogStream::Win32DebugLogStream() -{} +inline +Win32DebugLogStream::Win32DebugLogStream(){ + // empty +} // --------------------------------------------------------------------------- -// Default constructor -inline Win32DebugLogStream::~Win32DebugLogStream() -{} +inline +Win32DebugLogStream::~Win32DebugLogStream(){ + // empty +} // --------------------------------------------------------------------------- -// Write method -inline void Win32DebugLogStream::write(const char* message) -{ - OutputDebugStringA( message); +inline +void Win32DebugLogStream::write(const char* message) { + ::OutputDebugStringA( message); } // --------------------------------------------------------------------------- } // Namespace Assimp -#endif // ! WIN32 +#endif // ! _WIN32 #endif // guard diff --git a/code/X3DExporter.cpp b/code/X3DExporter.cpp new file mode 100644 index 000000000..cb6a6740f --- /dev/null +++ b/code/X3DExporter.cpp @@ -0,0 +1,731 @@ +/// \file X3DExporter.cpp +/// \brief X3D-format files exporter for Assimp. Implementation. +/// \date 2016 +/// \author smal.root@gmail.com + +#ifndef ASSIMP_BUILD_NO_EXPORT +#ifndef ASSIMP_BUILD_NO_X3D_EXPORTER + +#include "X3DExporter.hpp" + +// Header files, Assimp. +#include "Exceptional.h" +#include "StringUtils.h" +#include +#include + +using namespace std; + +namespace Assimp +{ + +void ExportSceneX3D(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* pProperties) +{ + X3DExporter exporter(pFile, pIOSystem, pScene, pProperties); +} + +}// namespace Assimp + +namespace Assimp +{ + +void X3DExporter::IndentationStringSet(const size_t pNewLevel) +{ + if(pNewLevel > mIndentationString.size()) + { + if(pNewLevel > mIndentationString.capacity()) mIndentationString.reserve(pNewLevel + 1); + + for(size_t i = 0, i_e = pNewLevel - mIndentationString.size(); i < i_e; i++) mIndentationString.push_back('\t'); + } + else if(pNewLevel < mIndentationString.size()) + { + mIndentationString.resize(pNewLevel); + } +} + +void X3DExporter::XML_Write(const string& pData) +{ + if(pData.size() == 0) return; + if(mOutFile->Write((void*)pData.data(), pData.length(), 1) != 1) throw DeadlyExportError("Failed to write scene data!"); +} + +aiMatrix4x4 X3DExporter::Matrix_GlobalToCurrent(const aiNode& pNode) const +{ +aiNode* cur_node; +std::list matr; +aiMatrix4x4 out_matr; + + // starting walk from current element to root + matr.push_back(pNode.mTransformation); + cur_node = pNode.mParent; + if(cur_node != nullptr) + { + do + { + matr.push_back(cur_node->mTransformation); + cur_node = cur_node->mParent; + } while(cur_node != nullptr); + } + + // multiplicate all matrices in reverse order + for(std::list::reverse_iterator rit = matr.rbegin(); rit != matr.rend(); rit++) out_matr = out_matr * (*rit); + + return out_matr; +} + +void X3DExporter::AttrHelper_FloatToString(const float pValue, std::string& pTargetString) +{ + pTargetString = to_string(pValue); + AttrHelper_CommaToPoint(pTargetString); +} + +void X3DExporter::AttrHelper_Vec3DArrToString(const aiVector3D* pArray, const size_t pArray_Size, string& pTargetString) +{ + pTargetString.clear(); + pTargetString.reserve(pArray_Size * 6);// (Number + space) * 3. + for(size_t idx = 0; idx < pArray_Size; idx++) + pTargetString.append(to_string(pArray[idx].x) + " " + to_string(pArray[idx].y) + " " + to_string(pArray[idx].z) + " "); + + // remove last space symbol. + pTargetString.resize(pTargetString.length() - 1); + AttrHelper_CommaToPoint(pTargetString); +} + +void X3DExporter::AttrHelper_Vec2DArrToString(const aiVector2D* pArray, const size_t pArray_Size, std::string& pTargetString) +{ + pTargetString.clear(); + pTargetString.reserve(pArray_Size * 4);// (Number + space) * 2. + for(size_t idx = 0; idx < pArray_Size; idx++) + pTargetString.append(to_string(pArray[idx].x) + " " + to_string(pArray[idx].y) + " "); + + // remove last space symbol. + pTargetString.resize(pTargetString.length() - 1); + AttrHelper_CommaToPoint(pTargetString); +} + +void X3DExporter::AttrHelper_Vec3DAsVec2fArrToString(const aiVector3D* pArray, const size_t pArray_Size, string& pTargetString) +{ + pTargetString.clear(); + pTargetString.reserve(pArray_Size * 4);// (Number + space) * 2. + for(size_t idx = 0; idx < pArray_Size; idx++) + pTargetString.append(to_string(pArray[idx].x) + " " + to_string(pArray[idx].y) + " "); + + // remove last space symbol. + pTargetString.resize(pTargetString.length() - 1); + AttrHelper_CommaToPoint(pTargetString); +} + +void X3DExporter::AttrHelper_Col4DArrToString(const aiColor4D* pArray, const size_t pArray_Size, string& pTargetString) +{ + pTargetString.clear(); + pTargetString.reserve(pArray_Size * 8);// (Number + space) * 4. + for(size_t idx = 0; idx < pArray_Size; idx++) + pTargetString.append(to_string(pArray[idx].r) + " " + to_string(pArray[idx].g) + " " + to_string(pArray[idx].b) + " " + + to_string(pArray[idx].a) + " "); + + // remove last space symbol. + pTargetString.resize(pTargetString.length() - 1); + AttrHelper_CommaToPoint(pTargetString); +} + +void X3DExporter::AttrHelper_Col3DArrToString(const aiColor3D* pArray, const size_t pArray_Size, std::string& pTargetString) +{ + pTargetString.clear(); + pTargetString.reserve(pArray_Size * 6);// (Number + space) * 3. + for(size_t idx = 0; idx < pArray_Size; idx++) + pTargetString.append(to_string(pArray[idx].r) + " " + to_string(pArray[idx].g) + " " + to_string(pArray[idx].b) + " "); + + // remove last space symbol. + pTargetString.resize(pTargetString.length() - 1); + AttrHelper_CommaToPoint(pTargetString); +} + +void X3DExporter::AttrHelper_Color3ToAttrList(std::list pList, const std::string& pName, const aiColor3D& pValue, const aiColor3D& pDefaultValue) +{ +string tstr; + + if(pValue == pDefaultValue) return; + + AttrHelper_Col3DArrToString(&pValue, 1, tstr); + pList.push_back({pName, tstr}); +} + +void X3DExporter::AttrHelper_FloatToAttrList(std::list pList, const string& pName, const float pValue, const float pDefaultValue) +{ +string tstr; + + if(pValue == pDefaultValue) return; + + AttrHelper_FloatToString(pValue, tstr); + pList.push_back({pName, tstr}); +}; + +void X3DExporter::NodeHelper_OpenNode(const string& pNodeName, const size_t pTabLevel, const bool pEmptyElement, const list& pAttrList) +{ + // Write indentation. + IndentationStringSet(pTabLevel); + XML_Write(mIndentationString); + // Begin of the element + XML_Write("<" + pNodeName); + // Write attributes + for(const SAttribute& attr: pAttrList) { XML_Write(" " + attr.Name + "='" + attr.Value + "'"); } + + // End of the element + if(pEmptyElement) + { + XML_Write("/>\n"); + } + else + { + XML_Write(">\n"); + } +} + +void X3DExporter::NodeHelper_OpenNode(const string& pNodeName, const size_t pTabLevel, const bool pEmptyElement) +{ +const list attr_list; + + NodeHelper_OpenNode(pNodeName, pTabLevel, pEmptyElement, attr_list); +} + +void X3DExporter::NodeHelper_CloseNode(const string& pNodeName, const size_t pTabLevel) +{ + // Write indentation. + IndentationStringSet(pTabLevel); + XML_Write(mIndentationString); + // Write element + XML_Write("\n"); +} + +void X3DExporter::Export_Node(const aiNode *pNode, const size_t pTabLevel) +{ +bool transform = false; +list attr_list; + + // In Assimp lights is stored in next way: light source store in mScene->mLights and in node tree must present aiNode with name same as + // light source has. Considering it we must compare every aiNode name with light sources names. Why not to look where ligths is present + // and save them to fili? Because corresponding aiNode can be already written to file and we can only add information to file not to edit. + if(CheckAndExport_Light(*pNode, pTabLevel)) return; + + // Check if need DEF. + if(pNode->mName.length) attr_list.push_back({"DEF", pNode->mName.C_Str()}); + + // Check if need node against . + if(!pNode->mTransformation.IsIdentity()) + { + auto Vector2String = [this](const aiVector3D pVector) -> string + { + string tstr = to_string(pVector.x) + " " + to_string(pVector.y) + " " + to_string(pVector.z); + + AttrHelper_CommaToPoint(tstr); + + return tstr; + }; + + auto Rotation2String = [this](const aiVector3D pAxis, const ai_real pAngle) -> string + { + string tstr = to_string(pAxis.x) + " " + to_string(pAxis.y) + " " + to_string(pAxis.z) + " " + to_string(pAngle); + + AttrHelper_CommaToPoint(tstr); + + return tstr; + }; + + aiVector3D scale, translate, rotate_axis; + ai_real rotate_angle; + + transform = true; + pNode->mTransformation.Decompose(scale, rotate_axis, rotate_angle, translate); + // Check if values different from default + if((rotate_angle != 0) && (rotate_axis.Length() > 0)) + attr_list.push_back({"rotation", Rotation2String(rotate_axis, rotate_angle)}); + + if(!scale.Equal({1, 1, 1})) attr_list.push_back({"scale", Vector2String(scale)}); + if(translate.Length() > 0) attr_list.push_back({"translation", Vector2String(translate)}); + } + + // Begin node if need. + if(transform) + NodeHelper_OpenNode("Transform", pTabLevel, false, attr_list); + else + NodeHelper_OpenNode("Group", pTabLevel); + + // Export metadata + if(pNode->mMetaData != nullptr) + { + for(size_t idx_prop = 0; idx_prop < pNode->mMetaData->mNumProperties; idx_prop++) + { + const aiString* key; + const aiMetadataEntry* entry; + + if(pNode->mMetaData->Get(idx_prop, key, entry)) + { + switch(entry->mType) + { + case AI_BOOL: + Export_MetadataBoolean(*key, *static_cast(entry->mData), pTabLevel + 1); + break; + case AI_DOUBLE: + Export_MetadataDouble(*key, *static_cast(entry->mData), pTabLevel + 1); + break; + case AI_FLOAT: + Export_MetadataFloat(*key, *static_cast(entry->mData), pTabLevel + 1); + break; + case AI_INT32: + Export_MetadataInteger(*key, *static_cast(entry->mData), pTabLevel + 1); + break; + case AI_AISTRING: + Export_MetadataString(*key, *static_cast(entry->mData), pTabLevel + 1); + break; + default: + LogError("Unsupported metadata type: " + to_string(entry->mType)); + break; + }// switch(entry->mType) + } + } + }// if(pNode->mMetaData != nullptr) + + // Export meshes. + for(size_t idx_mesh = 0; idx_mesh < pNode->mNumMeshes; idx_mesh++) Export_Mesh(pNode->mMeshes[idx_mesh], pTabLevel + 1); + // Export children. + for(size_t idx_node = 0; idx_node < pNode->mNumChildren; idx_node++) Export_Node(pNode->mChildren[idx_node], pTabLevel + 1); + + // End node if need. + if(transform) + NodeHelper_CloseNode("Transform", pTabLevel); + else + NodeHelper_CloseNode("Group", pTabLevel); +} + +void X3DExporter::Export_Mesh(const size_t pIdxMesh, const size_t pTabLevel) +{ +const char* NodeName_IFS = "IndexedFaceSet"; +const char* NodeName_Shape = "Shape"; + +list attr_list; +aiMesh& mesh = *mScene->mMeshes[pIdxMesh];// create alias for conveniance. + + // Check if mesh already defined early. + if(mDEF_Map_Mesh.find(pIdxMesh) != mDEF_Map_Mesh.end()) + { + // Mesh already defined, just refer to it + attr_list.push_back({"USE", mDEF_Map_Mesh.at(pIdxMesh)}); + NodeHelper_OpenNode(NodeName_Shape, pTabLevel, true, attr_list); + + return; + } + + string mesh_name(mesh.mName.C_Str() + string("_IDX_") + to_string(pIdxMesh));// Create mesh name + + // Define mesh name. + attr_list.push_back({"DEF", mesh_name}); + mDEF_Map_Mesh[pIdxMesh] = mesh_name; + + // + // "Shape" node. + // + NodeHelper_OpenNode(NodeName_Shape, pTabLevel, false, attr_list); + attr_list.clear(); + + // + // "Appearance" node. + // + Export_Material(mesh.mMaterialIndex, pTabLevel + 1); + + // + // "IndexedFaceSet" node. + // + // Fill attributes which differ from default. In Assimp for colors, vertices and normals used one indices set. So, only "coordIndex" must be set. + string coordIndex; + + // fill coordinates index. + coordIndex.reserve(mesh.mNumVertices * 4);// Index + space + Face delimiter + for(size_t idx_face = 0; idx_face < mesh.mNumFaces; idx_face++) + { + const aiFace& face_cur = mesh.mFaces[idx_face]; + + for(size_t idx_vert = 0; idx_vert < face_cur.mNumIndices; idx_vert++) + { + coordIndex.append(to_string(face_cur.mIndices[idx_vert]) + " "); + } + + coordIndex.append("-1 ");// face delimiter. + } + + // remove last space symbol. + coordIndex.resize(coordIndex.length() - 1); + attr_list.push_back({"coordIndex", coordIndex}); + // create node + NodeHelper_OpenNode(NodeName_IFS, pTabLevel + 1, false, attr_list); + attr_list.clear(); + // Child nodes for "IndexedFaceSet" needed when used colors, textures or normals. + string attr_value; + + // Export + AttrHelper_Vec3DArrToString(mesh.mVertices, mesh.mNumVertices, attr_value); + attr_list.push_back({"point", attr_value}); + NodeHelper_OpenNode("Coordinate", pTabLevel + 2, true, attr_list); + attr_list.clear(); + + // Export + if(mesh.HasVertexColors(0)) + { + AttrHelper_Col4DArrToString(mesh.mColors[0], mesh.mNumVertices, attr_value); + attr_list.push_back({"color", attr_value}); + NodeHelper_OpenNode("ColorRGBA", pTabLevel + 2, true, attr_list); + attr_list.clear(); + } + + // Export + if(mesh.HasTextureCoords(0)) + { + AttrHelper_Vec3DAsVec2fArrToString(mesh.mTextureCoords[0], mesh.mNumVertices, attr_value); + attr_list.push_back({"point", attr_value}); + NodeHelper_OpenNode("TextureCoordinate", pTabLevel + 2, true, attr_list); + attr_list.clear(); + } + + // Export + if(mesh.HasNormals()) + { + AttrHelper_Vec3DArrToString(mesh.mNormals, mesh.mNumVertices, attr_value); + attr_list.push_back({"vector", attr_value}); + NodeHelper_OpenNode("Normal", pTabLevel + 2, true, attr_list); + attr_list.clear(); + } + + // + // Close opened nodes. + // + NodeHelper_CloseNode(NodeName_IFS, pTabLevel + 1); + NodeHelper_CloseNode(NodeName_Shape, pTabLevel); +} + +void X3DExporter::Export_Material(const size_t pIdxMaterial, const size_t pTabLevel) +{ +const char* NodeName_A = "Appearance"; + +list attr_list; +aiMaterial& material = *mScene->mMaterials[pIdxMaterial];// create alias for conveniance. + + // Check if material already defined early. + if(mDEF_Map_Material.find(pIdxMaterial) != mDEF_Map_Material.end()) + { + // Material already defined, just refer to it + attr_list.push_back({"USE", mDEF_Map_Material.at(pIdxMaterial)}); + NodeHelper_OpenNode(NodeName_A, pTabLevel, true, attr_list); + + return; + } + + string material_name(string("_IDX_") + to_string(pIdxMaterial));// Create material name + aiString ai_mat_name; + + if(material.Get(AI_MATKEY_NAME, ai_mat_name) == AI_SUCCESS) material_name.insert(0, ai_mat_name.C_Str()); + + // Define material name. + attr_list.push_back({"DEF", material_name}); + mDEF_Map_Material[pIdxMaterial] = material_name; + + // + // "Appearance" node. + // + NodeHelper_OpenNode(NodeName_A, pTabLevel, false, attr_list); + attr_list.clear(); + + // + // "Material" node. + // + { + auto Color4ToAttrList = [&](const string& pAttrName, const aiColor4D& pAttrValue, const aiColor3D& pAttrDefaultValue) + { + string tstr; + + if(aiColor3D(pAttrValue.r, pAttrValue.g, pAttrValue.b) != pAttrDefaultValue) + { + AttrHelper_Col4DArrToString(&pAttrValue, 1, tstr); + attr_list.push_back({pAttrName, tstr}); + } + }; + + float tvalf; + aiColor3D color3; + aiColor4D color4; + + // ambientIntensity="0.2" SFFloat [inputOutput] + if(material.Get(AI_MATKEY_COLOR_AMBIENT, color3) == AI_SUCCESS) + AttrHelper_FloatToAttrList(attr_list, "ambientIntensity", (color3.r + color3.g + color3.b) / 3.0f, 0.2f); + else if(material.Get(AI_MATKEY_COLOR_AMBIENT, color4) == AI_SUCCESS) + AttrHelper_FloatToAttrList(attr_list, "ambientIntensity", (color4.r + color4.g + color4.b) / 3.0f, 0.2f); + + // diffuseColor="0.8 0.8 0.8" SFColor [inputOutput] + if(material.Get(AI_MATKEY_COLOR_DIFFUSE, color3) == AI_SUCCESS) + AttrHelper_Color3ToAttrList(attr_list, "diffuseColor", color3, aiColor3D(0.8f, 0.8f, 0.8f)); + else if(material.Get(AI_MATKEY_COLOR_DIFFUSE, color4) == AI_SUCCESS) + Color4ToAttrList("diffuseColor", color4, aiColor3D(0.8f, 0.8f, 0.8f)); + + // emissiveColor="0 0 0" SFColor [inputOutput] + if(material.Get(AI_MATKEY_COLOR_EMISSIVE, color3) == AI_SUCCESS) + AttrHelper_Color3ToAttrList(attr_list, "emissiveColor", color3, aiColor3D(0, 0, 0)); + else if(material.Get(AI_MATKEY_COLOR_EMISSIVE, color4) == AI_SUCCESS) + Color4ToAttrList("emissiveColor", color4, aiColor3D(0, 0, 0)); + + // shininess="0.2" SFFloat [inputOutput] + if(material.Get(AI_MATKEY_SHININESS, tvalf) == AI_SUCCESS) AttrHelper_FloatToAttrList(attr_list, "shininess", tvalf, 0.2f); + + // specularColor="0 0 0" SFColor [inputOutput] + if(material.Get(AI_MATKEY_COLOR_SPECULAR, color3) == AI_SUCCESS) + AttrHelper_Color3ToAttrList(attr_list, "specularColor", color3, aiColor3D(0, 0, 0)); + else if(material.Get(AI_MATKEY_COLOR_SPECULAR, color4) == AI_SUCCESS) + Color4ToAttrList("specularColor", color4, aiColor3D(0, 0, 0)); + + // transparency="0" SFFloat [inputOutput] + if(material.Get(AI_MATKEY_OPACITY, tvalf) == AI_SUCCESS) + { + if(tvalf > 1) tvalf = 1; + + tvalf = 1.0f - tvalf; + AttrHelper_FloatToAttrList(attr_list, "transparency", tvalf, 0); + } + + NodeHelper_OpenNode("Material", pTabLevel + 1, true, attr_list); + attr_list.clear(); + }// "Material" node. END. + + // + // "ImageTexture" node. + // + { + auto RepeatToAttrList = [&](const string& pAttrName, const bool pAttrValue) + { + if(!pAttrValue) attr_list.push_back({pAttrName, "false"}); + }; + + bool tvalb; + aiString tstring; + + // url="" MFString + if(material.Get(AI_MATKEY_TEXTURE_DIFFUSE(0), tstring) == AI_SUCCESS) + { + if(strncmp(tstring.C_Str(), AI_EMBEDDED_TEXNAME_PREFIX, strlen(AI_EMBEDDED_TEXNAME_PREFIX)) == 0) + LogError("Embedded texture is not supported"); + else + attr_list.push_back({"url", string("\"") + tstring.C_Str() + "\""}); + } + + // repeatS="true" SFBool + if(material.Get(AI_MATKEY_MAPPINGMODE_U_DIFFUSE(0), tvalb) == AI_SUCCESS) RepeatToAttrList("repeatS", tvalb); + + // repeatT="true" SFBool + if(material.Get(AI_MATKEY_MAPPINGMODE_V_DIFFUSE(0), tvalb) == AI_SUCCESS) RepeatToAttrList("repeatT", tvalb); + + NodeHelper_OpenNode("ImageTexture", pTabLevel + 1, true, attr_list); + attr_list.clear(); + }// "ImageTexture" node. END. + + // + // "TextureTransform" node. + // + { + auto Vec2ToAttrList = [&](const string& pAttrName, const aiVector2D& pAttrValue, const aiVector2D& pAttrDefaultValue) + { + string tstr; + + if(pAttrValue != pAttrDefaultValue) + { + AttrHelper_Vec2DArrToString(&pAttrValue, 1, tstr); + attr_list.push_back({pAttrName, tstr}); + } + }; + + aiUVTransform transform; + + if(material.Get(AI_MATKEY_UVTRANSFORM_DIFFUSE(0), transform) == AI_SUCCESS) + { + Vec2ToAttrList("translation", transform.mTranslation, aiVector2D(0, 0)); + AttrHelper_FloatToAttrList(attr_list, "rotation", transform.mRotation, 0); + Vec2ToAttrList("scale", transform.mScaling, aiVector2D(1, 1)); + + NodeHelper_OpenNode("TextureTransform", pTabLevel + 1, true, attr_list); + attr_list.clear(); + } + }// "TextureTransform" node. END. + + // + // Close opened nodes. + // + NodeHelper_CloseNode(NodeName_A, pTabLevel); + +} + +void X3DExporter::Export_MetadataBoolean(const aiString& pKey, const bool pValue, const size_t pTabLevel) +{ +list attr_list; + + attr_list.push_back({"name", pKey.C_Str()}); + attr_list.push_back({"value", pValue ? "true" : "false"}); + NodeHelper_OpenNode("MetadataBoolean", pTabLevel, true, attr_list); +} + +void X3DExporter::Export_MetadataDouble(const aiString& pKey, const double pValue, const size_t pTabLevel) +{ +list attr_list; + + attr_list.push_back({"name", pKey.C_Str()}); + attr_list.push_back({"value", to_string(pValue)}); + NodeHelper_OpenNode("MetadataDouble", pTabLevel, true, attr_list); +} + +void X3DExporter::Export_MetadataFloat(const aiString& pKey, const float pValue, const size_t pTabLevel) +{ +list attr_list; + + attr_list.push_back({"name", pKey.C_Str()}); + attr_list.push_back({"value", to_string(pValue)}); + NodeHelper_OpenNode("MetadataFloat", pTabLevel, true, attr_list); +} + +void X3DExporter::Export_MetadataInteger(const aiString& pKey, const int32_t pValue, const size_t pTabLevel) +{ +list attr_list; + + attr_list.push_back({"name", pKey.C_Str()}); + attr_list.push_back({"value", to_string(pValue)}); + NodeHelper_OpenNode("MetadataInteger", pTabLevel, true, attr_list); +} + +void X3DExporter::Export_MetadataString(const aiString& pKey, const aiString& pValue, const size_t pTabLevel) +{ +list attr_list; + + attr_list.push_back({"name", pKey.C_Str()}); + attr_list.push_back({"value", pValue.C_Str()}); + NodeHelper_OpenNode("MetadataString", pTabLevel, true, attr_list); +} + +bool X3DExporter::CheckAndExport_Light(const aiNode& pNode, const size_t pTabLevel) +{ +list attr_list; + +auto Vec3ToAttrList = [&](const string& pAttrName, const aiVector3D& pAttrValue, const aiVector3D& pAttrDefaultValue) +{ + string tstr; + + if(pAttrValue != pAttrDefaultValue) + { + AttrHelper_Vec3DArrToString(&pAttrValue, 1, tstr); + attr_list.push_back({pAttrName, tstr}); + } +}; + +size_t idx_light; +bool found = false; + + // Name of the light source can not be empty. + if(pNode.mName.length == 0) return false; + + // search for light with name like node has. + for(idx_light = 0; mScene->mNumLights; idx_light++) + { + if(pNode.mName == mScene->mLights[idx_light]->mName) + { + found = true; + break; + } + } + + if(!found) return false; + + // Light source is found. + const aiLight& light = *mScene->mLights[idx_light];// Alias for conveniance. + + aiMatrix4x4 trafo_mat = Matrix_GlobalToCurrent(pNode).Inverse(); + + attr_list.push_back({"DEF", light.mName.C_Str()}); + attr_list.push_back({"global", "true"});// "false" is not supported. + // ambientIntensity="0" SFFloat [inputOutput] + AttrHelper_FloatToAttrList(attr_list, "ambientIntensity", aiVector3D(light.mColorAmbient.r, light.mColorAmbient.g, light.mColorAmbient.b).Length(), 0); + // color="1 1 1" SFColor [inputOutput] + AttrHelper_Color3ToAttrList(attr_list, "color", light.mColorDiffuse, aiColor3D(1, 1, 1)); + + switch(light.mType) + { + case aiLightSource_DIRECTIONAL: + { + aiVector3D direction = trafo_mat * light.mDirection; + + Vec3ToAttrList("direction", direction, aiVector3D(0, 0, -1)); + NodeHelper_OpenNode("DirectionalLight", pTabLevel, true, attr_list); + } + + break; + case aiLightSource_POINT: + { + aiVector3D attenuation(light.mAttenuationConstant, light.mAttenuationLinear, light.mAttenuationQuadratic); + aiVector3D location = trafo_mat * light.mPosition; + + Vec3ToAttrList("attenuation", attenuation, aiVector3D(1, 0, 0)); + Vec3ToAttrList("location", location, aiVector3D(0, 0, 0)); + NodeHelper_OpenNode("PointLight", pTabLevel, true, attr_list); + } + + break; + case aiLightSource_SPOT: + { + aiVector3D attenuation(light.mAttenuationConstant, light.mAttenuationLinear, light.mAttenuationQuadratic); + aiVector3D location = trafo_mat * light.mPosition; + aiVector3D direction = trafo_mat * light.mDirection; + + Vec3ToAttrList("attenuation", attenuation, aiVector3D(1, 0, 0)); + Vec3ToAttrList("location", location, aiVector3D(0, 0, 0)); + Vec3ToAttrList("direction", direction, aiVector3D(0, 0, -1)); + AttrHelper_FloatToAttrList(attr_list, "beamWidth", light.mAngleInnerCone, 0.7854f); + AttrHelper_FloatToAttrList(attr_list, "cutOffAngle", light.mAngleOuterCone, 1.570796f); + NodeHelper_OpenNode("SpotLight", pTabLevel, true, attr_list); + } + + break; + default: + throw DeadlyExportError("Unknown light type: " + to_string(light.mType)); + }// switch(light.mType) + + return true; +} + +X3DExporter::X3DExporter(const char* pFileName, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* pProperties) + : mScene(pScene) +{ +list attr_list; + + mOutFile = pIOSystem->Open(pFileName, "wt"); + if(mOutFile == nullptr) throw DeadlyExportError("Could not open output .x3d file: " + string(pFileName)); + + // Begin document + XML_Write("\n"); + XML_Write("\n"); + // Root node + attr_list.push_back({"profile", "Interchange"}); + attr_list.push_back({"version", "3.3"}); + attr_list.push_back({"xmlns:xsd", "http://www.w3.org/2001/XMLSchema-instance"}); + attr_list.push_back({"xsd:noNamespaceSchemaLocation", "http://www.web3d.org/specifications/x3d-3.3.xsd"}); + NodeHelper_OpenNode("X3D", 0, false, attr_list); + attr_list.clear(); + // : meta data. + NodeHelper_OpenNode("head", 1); + XML_Write(mIndentationString + "\n"); + NodeHelper_CloseNode("head", 1); + // Scene node. + NodeHelper_OpenNode("Scene", 1); + Export_Node(mScene->mRootNode, 2); + NodeHelper_CloseNode("Scene", 1); + // Close Root node. + NodeHelper_CloseNode("X3D", 0); + // Cleanup + pIOSystem->Close(mOutFile); + mOutFile = nullptr; +} + +}// namespace Assimp + +#endif // ASSIMP_BUILD_NO_X3D_EXPORTER +#endif // ASSIMP_BUILD_NO_EXPORT diff --git a/code/X3DExporter.hpp b/code/X3DExporter.hpp new file mode 100644 index 000000000..20aec951b --- /dev/null +++ b/code/X3DExporter.hpp @@ -0,0 +1,235 @@ +/// \file X3DExporter.hpp +/// \brief X3D-format files exporter for Assimp. +/// \date 2016 +/// \author smal.root@gmail.com +// Thanks to acorn89 for support. + +#ifndef INCLUDED_AI_X3D_EXPORTER_H +#define INCLUDED_AI_X3D_EXPORTER_H + +// Header files, Assimp. +#include +#include +#include +#include + +// Header files, stdlib. +#include +#include + +namespace Assimp +{ + +/// \class X3DExporter +/// Class which export aiScene to X3D file. +/// +/// Limitations. +/// +/// Pay attention that X3D is format for interactive graphic and simulations for web browsers. aiScene can not contain all features of the X3D format. +/// Also, aiScene contain rasterized-like data. For example, X3D can describe circle all cylinder with one tag, but aiScene contain result of tesselation: +/// vertices, faces etc. Yes, you can use algorithm for detecting figures or shapes, but thats not good idea at all. +/// +/// Supported nodes: +/// Core component: +/// "MetadataBoolean", "MetadataDouble", "MetadataFloat", "MetadataInteger", "MetadataSet", "MetadataString" +/// Geometry3D component: +/// "IndexedFaceSet" +/// Grouping component: +/// "Group", "Transform" +/// Lighting component: +/// "DirectionalLight", "PointLight", "SpotLight" +/// Rendering component: +/// "ColorRGBA", "Coordinate", "Normal" +/// Shape component: +/// "Shape", "Appearance", "Material" +/// Texturing component: +/// "ImageTexture", "TextureCoordinate", "TextureTransform" +/// +class X3DExporter +{ + /***********************************************/ + /******************** Types ********************/ + /***********************************************/ + + struct SAttribute + { + const std::string Name; + const std::string Value; + }; + + /***********************************************/ + /****************** Constants ******************/ + /***********************************************/ + + const aiScene* const mScene; + + /***********************************************/ + /****************** Variables ******************/ + /***********************************************/ + + IOStream* mOutFile; + std::map mDEF_Map_Mesh; + std::map mDEF_Map_Material; + +private: + + std::string mIndentationString; + + /***********************************************/ + /****************** Functions ******************/ + /***********************************************/ + + /// \fn void IndentationStringSet(const size_t pNewLevel) + /// Set value of the indentation string. + /// \param [in] pNewLevel - new level of the indentation. + void IndentationStringSet(const size_t pNewLevel); + + /// \fn void XML_Write(const std::string& pData) + /// Write data to XML-file. + /// \param [in] pData - reference to string which must be written. + void XML_Write(const std::string& pData); + + /// \fn aiMatrix4x4 Matrix_GlobalToCurrent(const aiNode& pNode) const + /// Calculate transformation matrix for transformation from global coordinate system to pointed aiNode. + /// \param [in] pNode - reference to local node. + /// \return calculated matrix. + aiMatrix4x4 Matrix_GlobalToCurrent(const aiNode& pNode) const; + + /// \fn void AttrHelper_CommaToPoint(std::string& pStringWithComma) + /// Convert commas in string to points. Thats need because "std::to_string" result depend on locale (regional settings). + /// \param [in, out] pStringWithComma - reference to string, which must be modified. + void AttrHelper_CommaToPoint(std::string& pStringWithComma) { for(char& c: pStringWithComma) { if(c == ',') c = '.'; } } + + /// \fn void AttrHelper_FloatToString(const float pValue, std::string& pTargetString) + /// Converts float to string. + /// \param [in] pValue - value for converting. + /// \param [out] pTargetString - reference to string where result will be placed. Will be cleared before using. + void AttrHelper_FloatToString(const float pValue, std::string& pTargetString); + + /// \fn void AttrHelper_Vec3DArrToString(const aiVector3D* pArray, const size_t pArray_Size, std::string& pTargetString) + /// Converts array of vectors to string. + /// \param [in] pArray - pointer to array of vectors. + /// \param [in] pArray_Size - count of elements in array. + /// \param [out] pTargetString - reference to string where result will be placed. Will be cleared before using. + void AttrHelper_Vec3DArrToString(const aiVector3D* pArray, const size_t pArray_Size, std::string& pTargetString); + + /// \fn void AttrHelper_Vec2DArrToString(const aiVector2D* pArray, const size_t pArray_Size, std::string& pTargetString) + /// \overload void AttrHelper_Vec3DArrToString(const aiVector3D* pArray, const size_t pArray_Size, std::string& pTargetString) + void AttrHelper_Vec2DArrToString(const aiVector2D* pArray, const size_t pArray_Size, std::string& pTargetString); + + /// \fn void AttrHelper_Vec3DAsVec2fArrToString(const aiVector3D* pArray, const size_t pArray_Size, std::string& pTargetString) + /// \overload void AttrHelper_Vec3DArrToString(const aiVector3D* pArray, const size_t pArray_Size, std::string& pTargetString) + /// Only x, y is used from aiVector3D. + void AttrHelper_Vec3DAsVec2fArrToString(const aiVector3D* pArray, const size_t pArray_Size, std::string& pTargetString); + + /// \fn void AttrHelper_Col4DArrToString(const aiColor4D* pArray, const size_t pArray_Size, std::string& pTargetString) + /// \overload void AttrHelper_Vec3DArrToString(const aiVector3D* pArray, const size_t pArray_Size, std::string& pTargetString) + /// Converts array of colors to string. + void AttrHelper_Col4DArrToString(const aiColor4D* pArray, const size_t pArray_Size, std::string& pTargetString); + + /// \fn void AttrHelper_Col3DArrToString(const aiColor3D* pArray, const size_t pArray_Size, std::string& pTargetString) + /// \overload void AttrHelper_Col4DArrToString(const aiColor4D* pArray, const size_t pArray_Size, std::string& pTargetString) + /// Converts array of colors to string. + void AttrHelper_Col3DArrToString(const aiColor3D* pArray, const size_t pArray_Size, std::string& pTargetString); + + /// \fn void AttrHelper_FloatToAttrList(std::list pList, const std::string& pName, const float pValue, const float pDefaultValue) + /// \overload void AttrHelper_Col3DArrToString(const aiColor3D* pArray, const size_t pArray_Size, std::string& pTargetString) + void AttrHelper_FloatToAttrList(std::list pList, const std::string& pName, const float pValue, const float pDefaultValue); + + /// \fn void AttrHelper_Color3ToAttrList(std::list pList, const std::string& pName, const aiColor3D& pValue, const aiColor3D& pDefaultValue) + /// Add attribute to list if value not equal to default. + /// \param [in] pList - target list of the attributes. + /// \param [in] pName - name of new attribute. + /// \param [in] pValue - value of the new attribute. + /// \param [in] pDefaultValue - default value for checking: if pValue is equal to pDefaultValue then attribute will not be added. + void AttrHelper_Color3ToAttrList(std::list pList, const std::string& pName, const aiColor3D& pValue, const aiColor3D& pDefaultValue); + + /// \fn void NodeHelper_OpenNode(const std::string& pNodeName, const size_t pTabLevel, const bool pEmptyElement, const std::list& pAttrList) + /// Begin new XML-node element. + /// \param [in] pNodeName - name of the element. + /// \param [in] pTabLevel - indentation level. + /// \param [in] pEmtyElement - if true then empty element will be created. + /// \param [in] pAttrList - list of the attributes for element. + void NodeHelper_OpenNode(const std::string& pNodeName, const size_t pTabLevel, const bool pEmptyElement, const std::list& pAttrList); + + /// \fn void NodeHelper_OpenNode(const std::string& pNodeName, const size_t pTabLevel, const bool pEmptyElement = false) + /// \overload void NodeHelper_OpenNode(const std::string& pNodeName, const size_t pTabLevel, const bool pEmptyElement, const std::list& pAttrList) + void NodeHelper_OpenNode(const std::string& pNodeName, const size_t pTabLevel, const bool pEmptyElement = false); + + /// \fn void NodeHelper_CloseNode(const std::string& pNodeName, const size_t pTabLevel) + /// End XML-node element. + /// \param [in] pNodeName - name of the element. + /// \param [in] pTabLevel - indentation level. + void NodeHelper_CloseNode(const std::string& pNodeName, const size_t pTabLevel); + + /// \fn void Export_Node(const aiNode* pNode, const size_t pTabLevel) + /// Export data from scene to XML-file: aiNode. + /// \param [in] pNode - source aiNode. + /// \param [in] pTabLevel - indentation level. + void Export_Node(const aiNode* pNode, const size_t pTabLevel); + + /// \fn void Export_Mesh(const size_t pIdxMesh, const size_t pTabLevel) + /// Export data from scene to XML-file: aiMesh. + /// \param [in] pMesh - index of the source aiMesh. + /// \param [in] pTabLevel - indentation level. + void Export_Mesh(const size_t pIdxMesh, const size_t pTabLevel); + + /// \fn void Export_Material(const size_t pIdxMaterial, const size_t pTabLevel) + /// Export data from scene to XML-file: aiMaterial. + /// \param [in] pIdxMaterial - index of the source aiMaterial. + /// \param [in] pTabLevel - indentation level. + void Export_Material(const size_t pIdxMaterial, const size_t pTabLevel); + + /// \fn void Export_MetadataBoolean(const aiString& pKey, const bool pValue, const size_t pTabLevel) + /// Export data from scene to XML-file: aiMetadata. + /// \param [in] pKey - source data: value of the metadata key. + /// \param [in] pValue - source data: value of the metadata value. + /// \param [in] pTabLevel - indentation level. + void Export_MetadataBoolean(const aiString& pKey, const bool pValue, const size_t pTabLevel); + + /// \fn void Export_MetadataDouble(const aiString& pKey, const double pValue, const size_t pTabLevel) + /// \overload void Export_MetadataBoolean(const aiString& pKey, const bool pValue, const size_t pTabLevel) + void Export_MetadataDouble(const aiString& pKey, const double pValue, const size_t pTabLevel); + + /// \fn void Export_MetadataFloat(const aiString& pKey, const float pValue, const size_t pTabLevel) + /// \overload void Export_MetadataBoolean(const aiString& pKey, const bool pValue, const size_t pTabLevel) + void Export_MetadataFloat(const aiString& pKey, const float pValue, const size_t pTabLevel); + + /// \fn void Export_MetadataInteger(const aiString& pKey, const int32_t pValue, const size_t pTabLevel) + /// \overload void Export_MetadataBoolean(const aiString& pKey, const bool pValue, const size_t pTabLevel) + void Export_MetadataInteger(const aiString& pKey, const int32_t pValue, const size_t pTabLevel); + + /// \fn void Export_MetadataString(const aiString& pKey, const aiString& pValue, const size_t pTabLevel) + /// \overload void Export_MetadataBoolean(const aiString& pKey, const bool pValue, const size_t pTabLevel) + void Export_MetadataString(const aiString& pKey, const aiString& pValue, const size_t pTabLevel); + + /// \fn bool CheckAndExport_Light(const aiNode& pNode, const size_t pTabLevel) + /// Check if node point to light source. If yes then export light source. + /// \param [in] pNode - reference to node for checking. + /// \param [in] pTabLevel - indentation level. + /// \return true - if node assigned with light and it was exported, else - return false. + bool CheckAndExport_Light(const aiNode& pNode, const size_t pTabLevel); + + /***********************************************/ + /************** Functions: LOG set *************/ + /***********************************************/ + + /// \fn void LogError(const std::string& pMessage) + /// Short variant for calling \ref DefaultLogger::get()->error() + void LogError(const std::string& pMessage) { DefaultLogger::get()->error(pMessage); } + +public: + + /// \fn X3DExporter() + /// Default constructor. + X3DExporter(const char* pFileName, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* pProperties); + + /// \fn ~X3DExporter() + /// Default destructor. + ~X3DExporter() {} + +};// class X3DExporter + +}// namespace Assimp + +#endif // INCLUDED_AI_X3D_EXPORTER_H diff --git a/code/X3DImporter.cpp b/code/X3DImporter.cpp new file mode 100644 index 000000000..ad5e43d83 --- /dev/null +++ b/code/X3DImporter.cpp @@ -0,0 +1,1727 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +/// \file X3DImporter.cpp +/// \brief X3D-format files importer for Assimp: main algorithm implementation. +/// \date 2015-2016 +/// \author smal.root@gmail.com + +#ifndef ASSIMP_BUILD_NO_X3D_IMPORTER + +#include "X3DImporter.hpp" +#include "X3DImporter_Macro.hpp" +#include "StringUtils.h" + +// Header files, Assimp. +#include "DefaultIOSystem.h" +#include "fast_atof.h" + +// Header files, stdlib. +#include +#include + +namespace Assimp { + +/// \var aiImporterDesc X3DImporter::Description +/// Constant which holds the importer description +const aiImporterDesc X3DImporter::Description = { + "Extensible 3D(X3D) Importer", + "smalcom", + "", + "See documentation in source code. Chapter: Limitations.", + aiImporterFlags_SupportTextFlavour | aiImporterFlags_LimitedSupport | aiImporterFlags_Experimental, + 0, + 0, + 0, + 0, + "x3d" +}; + +void X3DImporter::Clear() +{ + NodeElement_Cur = nullptr; + // Delete all elements + if(NodeElement_List.size()) + { + for(std::list::iterator it = NodeElement_List.begin(); it != NodeElement_List.end(); it++) delete *it; + + NodeElement_List.clear(); + } +} + +X3DImporter::~X3DImporter() +{ + delete mReader; + // Clear() is accounting if data already is deleted. So, just check again if all data is deleted. + Clear(); +} + +/*********************************************************************************************************************************************/ +/************************************************************ Functions: find set ************************************************************/ +/*********************************************************************************************************************************************/ + +bool X3DImporter::FindNodeElement_FromRoot(const std::string& pID, const CX3DImporter_NodeElement::EType pType, CX3DImporter_NodeElement** pElement) +{ + for(std::list::iterator it = NodeElement_List.begin(); it != NodeElement_List.end(); it++) + { + if(((*it)->Type == pType) && ((*it)->ID == pID)) + { + if(pElement != nullptr) *pElement = *it; + + return true; + } + }// for(std::list::iterator it = NodeElement_List.begin(); it != NodeElement_List.end(); it++) + + return false; +} + +bool X3DImporter::FindNodeElement_FromNode(CX3DImporter_NodeElement* pStartNode, const std::string& pID, + const CX3DImporter_NodeElement::EType pType, CX3DImporter_NodeElement** pElement) +{ + bool found = false;// flag: true - if requested element is found. + + // Check if pStartNode - this is the element, we are looking for. + if((pStartNode->Type == pType) && (pStartNode->ID == pID)) + { + found = true; + if ( pElement != nullptr ) + { + *pElement = pStartNode; + } + + goto fne_fn_end; + }// if((pStartNode->Type() == pType) && (pStartNode->ID() == pID)) + + // Check childs of pStartNode. + for(std::list::iterator ch_it = pStartNode->Child.begin(); ch_it != pStartNode->Child.end(); ch_it++) + { + found = FindNodeElement_FromNode(*ch_it, pID, pType, pElement); + if ( found ) + { + break; + } + }// for(std::list::iterator ch_it = it->Child.begin(); ch_it != it->Child.end(); ch_it++) + +fne_fn_end: + + return found; +} + +bool X3DImporter::FindNodeElement(const std::string& pID, const CX3DImporter_NodeElement::EType pType, CX3DImporter_NodeElement** pElement) +{ + CX3DImporter_NodeElement* tnd = NodeElement_Cur;// temporary pointer to node. + bool static_search = false;// flag: true if searching in static node. + + // At first check if we have deal with static node. Go up thru parent nodes and check flag. + while(tnd != nullptr) + { + if(tnd->Type == CX3DImporter_NodeElement::ENET_Group) + { + if(((CX3DImporter_NodeElement_Group*)tnd)->Static) + { + static_search = true;// Flag found, stop walking up. Node with static flag will holded in tnd variable. + break; + } + } + + tnd = tnd->Parent;// go up in graph. + }// while(tnd != nullptr) + + // at now call appropriate search function. + if ( static_search ) + { + return FindNodeElement_FromNode( tnd, pID, pType, pElement ); + } + else + { + return FindNodeElement_FromRoot( pID, pType, pElement ); + } +} + +/*********************************************************************************************************************************************/ +/************************************************************ Functions: throw set ***********************************************************/ +/*********************************************************************************************************************************************/ + +void X3DImporter::Throw_ArgOutOfRange(const std::string& pArgument) +{ + throw DeadlyImportError("Argument value is out of range for: \"" + pArgument + "\"."); +} + +void X3DImporter::Throw_CloseNotFound(const std::string& pNode) +{ + throw DeadlyImportError("Close tag for node <" + pNode + "> not found. Seems file is corrupt."); +} + +void X3DImporter::Throw_ConvertFail_Str2ArrF(const std::string& pAttrValue) +{ + throw DeadlyImportError("In <" + std::string(mReader->getNodeName()) + "> failed to convert attribute value \"" + pAttrValue + + "\" from string to array of floats."); +} + +void X3DImporter::Throw_DEF_And_USE() +{ + throw DeadlyImportError("\"DEF\" and \"USE\" can not be defined both in <" + std::string(mReader->getNodeName()) + ">."); +} + +void X3DImporter::Throw_IncorrectAttr(const std::string& pAttrName) +{ + throw DeadlyImportError("Node <" + std::string(mReader->getNodeName()) + "> has incorrect attribute \"" + pAttrName + "\"."); +} + +void X3DImporter::Throw_IncorrectAttrValue(const std::string& pAttrName) +{ + throw DeadlyImportError("Attribute \"" + pAttrName + "\" in node <" + std::string(mReader->getNodeName()) + "> has incorrect value."); +} + +void X3DImporter::Throw_MoreThanOnceDefined(const std::string& pNodeType, const std::string& pDescription) +{ + throw DeadlyImportError("\"" + pNodeType + "\" node can be used only once in " + mReader->getNodeName() + ". Description: " + pDescription); +} + +void X3DImporter::Throw_TagCountIncorrect(const std::string& pNode) +{ + throw DeadlyImportError("Count of open and close tags for node <" + pNode + "> are not equivalent. Seems file is corrupt."); +} + +void X3DImporter::Throw_USE_NotFound(const std::string& pAttrValue) +{ + throw DeadlyImportError("Not found node with name \"" + pAttrValue + "\" in <" + std::string(mReader->getNodeName()) + ">."); +} + +/*********************************************************************************************************************************************/ +/************************************************************* Functions: XML set ************************************************************/ +/*********************************************************************************************************************************************/ + +void X3DImporter::XML_CheckNode_MustBeEmpty() +{ + if(!mReader->isEmptyElement()) throw DeadlyImportError(std::string("Node <") + mReader->getNodeName() + "> must be empty."); +} + +void X3DImporter::XML_CheckNode_SkipUnsupported(const std::string& pParentNodeName) +{ + const size_t Uns_Skip_Len = 189; + const char* Uns_Skip[ Uns_Skip_Len ] = { + // CAD geometry component + "CADAssembly", "CADFace", "CADLayer", "CADPart", "IndexedQuadSet", "QuadSet", + // Core + "ROUTE", "ExternProtoDeclare", "ProtoDeclare", "ProtoInstance", "ProtoInterface", "WorldInfo", + // Distributed interactive simulation (DIS) component + "DISEntityManager", "DISEntityTypeMapping", "EspduTransform", "ReceiverPdu", "SignalPdu", "TransmitterPdu", + // Cube map environmental texturing component + "ComposedCubeMapTexture", "GeneratedCubeMapTexture", "ImageCubeMapTexture", + // Environmental effects component + "Background", "Fog", "FogCoordinate", "LocalFog", "TextureBackground", + // Environmental sensor component + "ProximitySensor", "TransformSensor", "VisibilitySensor", + // Followers component + "ColorChaser", "ColorDamper", "CoordinateChaser", "CoordinateDamper", "OrientationChaser", "OrientationDamper", "PositionChaser", "PositionChaser2D", + "PositionDamper", "PositionDamper2D", "ScalarChaser", "ScalarDamper", "TexCoordChaser2D", "TexCoordDamper2D", + // Geospatial component + "GeoCoordinate", "GeoElevationGrid", "GeoLocation", "GeoLOD", "GeoMetadata", "GeoOrigin", "GeoPositionInterpolator", "GeoProximitySensor", + "GeoTouchSensor", "GeoTransform", "GeoViewpoint", + // Humanoid Animation (H-Anim) component + "HAnimDisplacer", "HAnimHumanoid", "HAnimJoint", "HAnimSegment", "HAnimSite", + // Interpolation component + "ColorInterpolator", "CoordinateInterpolator", "CoordinateInterpolator2D", "EaseInEaseOut", "NormalInterpolator", "OrientationInterpolator", + "PositionInterpolator", "PositionInterpolator2D", "ScalarInterpolator", "SplinePositionInterpolator", "SplinePositionInterpolator2D", + "SplineScalarInterpolator", "SquadOrientationInterpolator", + // Key device sensor component + "KeySensor", "StringSensor" + // Layering component + "Layer", "LayerSet", "Viewport", + // Layout component + "Layout", "LayoutGroup", "LayoutLayer", "ScreenFontStyle", "ScreenGroup", + // Navigation component + "Billboard", "Collision", "LOD", "NavigationInfo", "OrthoViewpoint", "Viewpoint", "ViewpointGroup", + // Networking component + "Anchor", "LoadSensor", + // NURBS component + "Contour2D", "ContourPolyline2D", "CoordinateDouble", "NurbsCurve", "NurbsCurve2D", "NurbsOrientationInterpolator", "NurbsPatchSurface", + "NurbsPositionInterpolator", "NurbsSet", "NurbsSurfaceInterpolator", "NurbsSweptSurface", "NurbsSwungSurface", "NurbsTextureCoordinate", + "NurbsTrimmedSurface", + // Particle systems component + "BoundedPhysicsModel", "ConeEmitter", "ExplosionEmitter", "ForcePhysicsModel", "ParticleSystem", "PointEmitter", "PolylineEmitter", "SurfaceEmitter", + "VolumeEmitter", "WindPhysicsModel", + // Picking component + "LinePickSensor", "PickableGroup", "PointPickSensor", "PrimitivePickSensor", "VolumePickSensor", + // Pointing device sensor component + "CylinderSensor", "PlaneSensor", "SphereSensor", "TouchSensor", + // Rendering component + "ClipPlane", + // Rigid body physics + "BallJoint", "CollidableOffset", "CollidableShape", "CollisionCollection", "CollisionSensor", "CollisionSpace", "Contact", "DoubleAxisHingeJoint", + "MotorJoint", "RigidBody", "RigidBodyCollection", "SingleAxisHingeJoint", "SliderJoint", "UniversalJoint", + // Scripting component + "Script", + // Programmable shaders component + "ComposedShader", "FloatVertexAttribute", "Matrix3VertexAttribute", "Matrix4VertexAttribute", "PackagedShader", "ProgramShader", "ShaderPart", + "ShaderProgram", + // Shape component + "FillProperties", "LineProperties", "TwoSidedMaterial", + // Sound component + "AudioClip", "Sound", + // Text component + "FontStyle", "Text", + // Texturing3D Component + "ComposedTexture3D", "ImageTexture3D", "PixelTexture3D", "TextureCoordinate3D", "TextureCoordinate4D", "TextureTransformMatrix3D", "TextureTransform3D", + // Texturing component + "MovieTexture", "MultiTexture", "MultiTextureCoordinate", "MultiTextureTransform", "PixelTexture", "TextureCoordinateGenerator", "TextureProperties", + // Time component + "TimeSensor", + // Event Utilities component + "BooleanFilter", "BooleanSequencer", "BooleanToggle", "BooleanTrigger", "IntegerSequencer", "IntegerTrigger", "TimeTrigger", + // Volume rendering component + "BlendedVolumeStyle", "BoundaryEnhancementVolumeStyle", "CartoonVolumeStyle", "ComposedVolumeStyle", "EdgeEnhancementVolumeStyle", "IsoSurfaceVolumeData", + "OpacityMapVolumeStyle", "ProjectionVolumeStyle", "SegmentedVolumeData", "ShadedVolumeStyle", "SilhouetteEnhancementVolumeStyle", "ToneMappedVolumeStyle", + "VolumeData" + }; + + const std::string nn( mReader->getNodeName() ); + bool found = false; + bool close_found = false; + + for(size_t i = 0; i < Uns_Skip_Len; i++) + { + if(nn == Uns_Skip[i]) + { + found = true; + if(mReader->isEmptyElement()) + { + close_found = true; + + goto casu_cres; + } + + while(mReader->read()) + { + if((mReader->getNodeType() == irr::io::EXN_ELEMENT_END) && (nn == mReader->getNodeName())) + { + close_found = true; + + goto casu_cres; + } + } + } + } + +casu_cres: + + if(!found) throw DeadlyImportError("Unknown node \"" + nn + "\" in " + pParentNodeName + "."); + + if(close_found) + LogInfo("Skipping node \"" + nn + "\" in " + pParentNodeName + "."); + else + Throw_CloseNotFound(nn); +} + +bool X3DImporter::XML_SearchNode(const std::string& pNodeName) +{ + while(mReader->read()) + { + if((mReader->getNodeType() == irr::io::EXN_ELEMENT) && XML_CheckNode_NameEqual(pNodeName)) return true; + } + + return false; +} + +bool X3DImporter::XML_ReadNode_GetAttrVal_AsBool(const int pAttrIdx) +{ +std::string val(mReader->getAttributeValue(pAttrIdx)); + + if(val == "false") + return false; + else if(val == "true") + return true; + else + throw DeadlyImportError("Bool attribute value can contain \"false\" or \"true\" not the \"" + val + "\""); +} + +float X3DImporter::XML_ReadNode_GetAttrVal_AsFloat(const int pAttrIdx) +{ + std::string val; + float tvalf; + + ParseHelper_FixTruncatedFloatString(mReader->getAttributeValue(pAttrIdx), val); + fast_atoreal_move(val.c_str(), tvalf, false); + + return tvalf; +} + +int32_t X3DImporter::XML_ReadNode_GetAttrVal_AsI32(const int pAttrIdx) +{ + return strtol10(mReader->getAttributeValue(pAttrIdx)); +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsCol3f(const int pAttrIdx, aiColor3D& pValue) +{ + std::list tlist; + std::list::iterator it; + + XML_ReadNode_GetAttrVal_AsListF(pAttrIdx, tlist); + if(tlist.size() != 3) Throw_ConvertFail_Str2ArrF(mReader->getAttributeValue(pAttrIdx)); + + it = tlist.begin(); + pValue.r = *it++; + pValue.g = *it++; + pValue.b = *it; +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsVec2f(const int pAttrIdx, aiVector2D& pValue) +{ + std::list tlist; + std::list::iterator it; + + XML_ReadNode_GetAttrVal_AsListF(pAttrIdx, tlist); + if(tlist.size() != 2) Throw_ConvertFail_Str2ArrF(mReader->getAttributeValue(pAttrIdx)); + + it = tlist.begin(); + pValue.x = *it++; + pValue.y = *it; +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsVec3f(const int pAttrIdx, aiVector3D& pValue) +{ + std::list tlist; + std::list::iterator it; + + XML_ReadNode_GetAttrVal_AsListF(pAttrIdx, tlist); + if(tlist.size() != 3) Throw_ConvertFail_Str2ArrF(mReader->getAttributeValue(pAttrIdx)); + + it = tlist.begin(); + pValue.x = *it++; + pValue.y = *it++; + pValue.z = *it; +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsListB(const int pAttrIdx, std::list& pValue) +{ + // make copy of attribute value - string with list of bool values. Also all bool values is strings. + size_t tok_str_len = strlen(mReader->getAttributeValue(pAttrIdx)); + if ( 0 == tok_str_len ) { + Throw_IncorrectAttrValue( mReader->getAttributeName( pAttrIdx ) ); + } + + tok_str_len++;// take in account terminating '\0'. + char *tok_str = new char[tok_str_len]; + + strcpy(tok_str, mReader->getAttributeValue(pAttrIdx)); + // change all spacebars to symbol '\0'. That is needed for parsing. + for(size_t i = 0; i < tok_str_len; i++) + { + if(tok_str[i] == ' ') tok_str[i] = 0; + } + + // at now check what current token is + for(char *tok_cur = tok_str, *tok_end = (tok_str + tok_str_len); tok_cur < tok_end;) + { + if(strncmp(tok_cur, "true", 4) == 0) + { + pValue.push_back(true); + tok_cur += 5;// five, not four. Because '\0' must be skipped too. + } + else if(strncmp(tok_cur, "false", 5) == 0) + { + pValue.push_back(true); + tok_cur += 6;// six, not five. Because '\0' must be skipped too. + } + else + { + Throw_IncorrectAttrValue(mReader->getAttributeName(pAttrIdx)); + } + }// for(char* tok_cur = tok_str, tok_end = (tok_str + tok_str_len); tok_cur < tok_end;) + + // delete temporary string + delete [] tok_str; +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsArrB(const int pAttrIdx, std::vector& pValue) +{ + std::list tlist; + + XML_ReadNode_GetAttrVal_AsListB(pAttrIdx, tlist);// read as list + // and copy to array + if(tlist.size() > 0) + { + pValue.reserve(tlist.size()); + for(std::list::iterator it = tlist.begin(); it != tlist.end(); it++) pValue.push_back(*it); + } +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsListI32(const int pAttrIdx, std::list& pValue) +{ + const char* tstr = mReader->getAttributeValue(pAttrIdx); + const char* tstr_end = tstr + strlen(tstr); + + do + { + const char* ostr; + + int32_t tval32; + + tval32 = strtol10(tstr, &ostr); + if(ostr == tstr) break; + + while((ostr < tstr_end) && (*ostr == ' ')) ostr++;// skip spaces between values. + + tstr = ostr; + pValue.push_back(tval32); + } while(tstr < tstr_end); +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsArrI32(const int pAttrIdx, std::vector& pValue) +{ + std::list tlist; + + XML_ReadNode_GetAttrVal_AsListI32(pAttrIdx, tlist);// read as list + // and copy to array + if(tlist.size() > 0) + { + pValue.reserve(tlist.size()); + for(std::list::iterator it = tlist.begin(); it != tlist.end(); it++) pValue.push_back(*it); + } +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsListF(const int pAttrIdx, std::list& pValue) +{ + std::string str_fixed; + + // at first check string values like '.xxx'. + ParseHelper_FixTruncatedFloatString(mReader->getAttributeValue(pAttrIdx), str_fixed); + if(!str_fixed.size()) Throw_ConvertFail_Str2ArrF(mReader->getAttributeValue(pAttrIdx)); + + // and convert all values and place it in list. + const char* pstr = str_fixed.c_str(); + const char* pstr_end = pstr + str_fixed.size(); + + do + { + float tvalf; + + while((*pstr == ' ') && (pstr < pstr_end)) pstr++;// skip spaces between values. + + if(pstr < pstr_end)// additional check, because attribute value can be ended with spaces. + { + pstr = fast_atoreal_move(pstr, tvalf, false); + pValue.push_back(tvalf); + } + } while(pstr < pstr_end); +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsArrF(const int pAttrIdx, std::vector& pValue) +{ + std::list tlist; + + XML_ReadNode_GetAttrVal_AsListF(pAttrIdx, tlist);// read as list + // and copy to array + if(tlist.size() > 0) + { + pValue.reserve(tlist.size()); + for(std::list::iterator it = tlist.begin(); it != tlist.end(); it++) pValue.push_back(*it); + } +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsListD(const int pAttrIdx, std::list& pValue) +{ + std::string str_fixed; + + // at first check string values like '.xxx'. + ParseHelper_FixTruncatedFloatString(mReader->getAttributeValue(pAttrIdx), str_fixed); + if(!str_fixed.size()) Throw_ConvertFail_Str2ArrF(mReader->getAttributeValue(pAttrIdx)); + + // and convert all values and place it in list. + const char* pstr = str_fixed.c_str(); + const char* pstr_end = pstr + str_fixed.size(); + + do + { + double tvald; + + while((*pstr == ' ') && (pstr < pstr_end)) pstr++;// skip spaces between values. + + if(pstr < pstr_end)// additional check, because attribute value can be ended with spaces. + { + pstr = fast_atoreal_move(pstr, tvald, false); + pValue.push_back(tvald); + } + } while(pstr < pstr_end); +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsArrD(const int pAttrIdx, std::vector& pValue) +{ + std::list tlist; + + XML_ReadNode_GetAttrVal_AsListD(pAttrIdx, tlist);// read as list + // and copy to array + if(tlist.size() > 0) + { + pValue.reserve(tlist.size()); + for(std::list::iterator it = tlist.begin(); it != tlist.end(); it++) pValue.push_back(*it); + } +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsListCol3f(const int pAttrIdx, std::list& pValue) +{ + std::list tlist; + + XML_ReadNode_GetAttrVal_AsListF(pAttrIdx, tlist);// read as list + if(tlist.size() % 3) Throw_ConvertFail_Str2ArrF(mReader->getAttributeValue(pAttrIdx)); + + // copy data to array + for(std::list::iterator it = tlist.begin(); it != tlist.end();) + { + aiColor3D tcol; + + tcol.r = *it++; + tcol.g = *it++; + tcol.b = *it++; + pValue.push_back(tcol); + } +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsArrCol3f(const int pAttrIdx, std::vector& pValue) +{ + std::list tlist; + + XML_ReadNode_GetAttrVal_AsListCol3f(pAttrIdx, tlist);// read as list + // and copy to array + if(tlist.size() > 0) + { + pValue.reserve(tlist.size()); + for(std::list::iterator it = tlist.begin(); it != tlist.end(); it++) pValue.push_back(*it); + } +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsListCol4f(const int pAttrIdx, std::list& pValue) +{ + std::list tlist; + + XML_ReadNode_GetAttrVal_AsListF(pAttrIdx, tlist);// read as list + if(tlist.size() % 4) Throw_ConvertFail_Str2ArrF(mReader->getAttributeValue(pAttrIdx)); + + // copy data to array + for(std::list::iterator it = tlist.begin(); it != tlist.end();) + { + aiColor4D tcol; + + tcol.r = *it++; + tcol.g = *it++; + tcol.b = *it++; + tcol.a = *it++; + pValue.push_back(tcol); + } +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsArrCol4f(const int pAttrIdx, std::vector& pValue) +{ + std::list tlist; + + XML_ReadNode_GetAttrVal_AsListCol4f(pAttrIdx, tlist);// read as list + // and copy to array + if(tlist.size() > 0) + { + pValue.reserve(tlist.size()); + for ( std::list::iterator it = tlist.begin(); it != tlist.end(); it++ ) + { + pValue.push_back( *it ); + } + } +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsListVec2f(const int pAttrIdx, std::list& pValue) +{ + std::list tlist; + + XML_ReadNode_GetAttrVal_AsListF(pAttrIdx, tlist);// read as list + if ( tlist.size() % 2 ) + { + Throw_ConvertFail_Str2ArrF( mReader->getAttributeValue( pAttrIdx ) ); + } + + // copy data to array + for(std::list::iterator it = tlist.begin(); it != tlist.end();) + { + aiVector2D tvec; + + tvec.x = *it++; + tvec.y = *it++; + pValue.push_back(tvec); + } +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsArrVec2f(const int pAttrIdx, std::vector& pValue) +{ + std::list tlist; + + XML_ReadNode_GetAttrVal_AsListVec2f(pAttrIdx, tlist);// read as list + // and copy to array + if(tlist.size() > 0) + { + pValue.reserve(tlist.size()); + for ( std::list::iterator it = tlist.begin(); it != tlist.end(); it++ ) + { + pValue.push_back( *it ); + } + } +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsListVec3f(const int pAttrIdx, std::list& pValue) +{ + std::list tlist; + + XML_ReadNode_GetAttrVal_AsListF(pAttrIdx, tlist);// read as list + if ( tlist.size() % 3 ) + { + Throw_ConvertFail_Str2ArrF( mReader->getAttributeValue( pAttrIdx ) ); + } + + // copy data to array + for(std::list::iterator it = tlist.begin(); it != tlist.end();) + { + aiVector3D tvec; + + tvec.x = *it++; + tvec.y = *it++; + tvec.z = *it++; + pValue.push_back(tvec); + } +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsArrVec3f(const int pAttrIdx, std::vector& pValue) +{ + std::list tlist; + + XML_ReadNode_GetAttrVal_AsListVec3f(pAttrIdx, tlist);// read as list + // and copy to array + if(tlist.size() > 0) + { + pValue.reserve(tlist.size()); + for ( std::list::iterator it = tlist.begin(); it != tlist.end(); it++ ) + { + pValue.push_back( *it ); + } + } +} + +void X3DImporter::XML_ReadNode_GetAttrVal_AsListS(const int pAttrIdx, std::list& pValue) +{ + // make copy of attribute value - strings list. + const size_t tok_str_len = strlen(mReader->getAttributeValue(pAttrIdx)); + if ( 0 == tok_str_len ) + { + Throw_IncorrectAttrValue( mReader->getAttributeName( pAttrIdx ) ); + } + + // get pointer to begin of value. + char *tok_str = const_cast(mReader->getAttributeValue(pAttrIdx)); + char *tok_str_end = tok_str + tok_str_len; + // string list has following format: attr_name='"s1" "s2" "sn"'. + do + { + char* tbeg; + char* tend; + size_t tlen; + std::string tstr; + + // find begin of string(element of string list): "sn". + tbeg = strstr(tok_str, "\""); + if(tbeg == nullptr) Throw_IncorrectAttrValue(mReader->getAttributeName(pAttrIdx)); + + tbeg++;// forward pointer from '\"' symbol to next after it. + tok_str = tbeg; + // find end of string(element of string list): "sn". + tend = strstr(tok_str, "\""); + if(tend == nullptr) Throw_IncorrectAttrValue(mReader->getAttributeName(pAttrIdx)); + + tok_str = tend + 1; + // create storage for new string + tlen = tend - tbeg; + tstr.resize(tlen);// reserve enough space and copy data + memcpy((void*)tstr.data(), tbeg, tlen);// not strcpy because end of copied string from tok_str has no terminator. + // and store string in output list. + pValue.push_back(tstr); + } while(tok_str < tok_str_end); +} + +/*********************************************************************************************************************************************/ +/****************************************************** Functions: geometry helper set ******************************************************/ +/*********************************************************************************************************************************************/ + +aiVector3D X3DImporter::GeometryHelper_Make_Point2D(const float pAngle, const float pRadius) +{ + return aiVector3D(pRadius * std::cos(pAngle), pRadius * std::sin(pAngle), 0); +} + +void X3DImporter::GeometryHelper_Make_Arc2D(const float pStartAngle, const float pEndAngle, const float pRadius, size_t pNumSegments, + std::list& pVertices) +{ + // check argument values ranges. + if ( ( pStartAngle < -AI_MATH_TWO_PI_F ) || ( pStartAngle > AI_MATH_TWO_PI_F ) ) + { + Throw_ArgOutOfRange( "GeometryHelper_Make_Arc2D.pStartAngle" ); + } + if ( ( pEndAngle < -AI_MATH_TWO_PI_F ) || ( pEndAngle > AI_MATH_TWO_PI_F ) ) + { + Throw_ArgOutOfRange( "GeometryHelper_Make_Arc2D.pEndAngle" ); + } + if ( pRadius <= 0 ) + { + Throw_ArgOutOfRange( "GeometryHelper_Make_Arc2D.pRadius" ); + } + + // calculate arc angle and check type of arc + float angle_full = std::fabs(pEndAngle - pStartAngle); + if ( ( angle_full > AI_MATH_TWO_PI_F ) || ( angle_full == 0.0f ) ) + { + angle_full = AI_MATH_TWO_PI_F; + } + + // calculate angle for one step - angle to next point of line. + float angle_step = angle_full / (float)pNumSegments; + // make points + for(size_t pi = 0; pi <= pNumSegments; pi++) + { + float tangle = pStartAngle + pi * angle_step; + pVertices.push_back(GeometryHelper_Make_Point2D(tangle, pRadius)); + }// for(size_t pi = 0; pi <= pNumSegments; pi++) + + // if we making full circle then add last vertex equal to first vertex + if(angle_full == AI_MATH_TWO_PI_F) pVertices.push_back(*pVertices.begin()); +} + +void X3DImporter::GeometryHelper_Extend_PointToLine(const std::list& pPoint, std::list& pLine) +{ + std::list::const_iterator pit = pPoint.begin(); + std::list::const_iterator pit_last = pPoint.end(); + + pit_last--; + + if ( pPoint.size() < 2 ) + { + Throw_ArgOutOfRange( "GeometryHelper_Extend_PointToLine.pPoint.size() can not be less than 2." ); + } + + // add first point of first line. + pLine.push_back(*pit++); + // add internal points + while(pit != pit_last) + { + pLine.push_back(*pit);// second point of previous line + pLine.push_back(*pit);// first point of next line + pit++; + } + // add last point of last line + pLine.push_back(*pit); +} + +void X3DImporter::GeometryHelper_Extend_PolylineIdxToLineIdx(const std::list& pPolylineCoordIdx, std::list& pLineCoordIdx) +{ + std::list::const_iterator plit = pPolylineCoordIdx.begin(); + + while(plit != pPolylineCoordIdx.end()) + { + // add first point of polyline + pLineCoordIdx.push_back(*plit++); + while((*plit != (-1)) && (plit != pPolylineCoordIdx.end())) + { + std::list::const_iterator plit_next; + + plit_next = plit, plit_next++; + pLineCoordIdx.push_back(*plit);// second point of previous line. + pLineCoordIdx.push_back(-1);// delimiter + if((*plit_next == (-1)) || (plit_next == pPolylineCoordIdx.end())) break;// current polyline is finished + + pLineCoordIdx.push_back(*plit);// first point of next line. + plit = plit_next; + }// while((*plit != (-1)) && (plit != pPolylineCoordIdx.end())) + }// while(plit != pPolylineCoordIdx.end()) +} + +#define MESH_RectParallelepiped_CREATE_VERT \ +aiVector3D vert_set[8]; \ +float x1, x2, y1, y2, z1, z2, hs; \ + \ + hs = pSize.x / 2, x1 = -hs, x2 = hs; \ + hs = pSize.y / 2, y1 = -hs, y2 = hs; \ + hs = pSize.z / 2, z1 = -hs, z2 = hs; \ + vert_set[0].Set(x2, y1, z2); \ + vert_set[1].Set(x2, y2, z2); \ + vert_set[2].Set(x2, y2, z1); \ + vert_set[3].Set(x2, y1, z1); \ + vert_set[4].Set(x1, y1, z2); \ + vert_set[5].Set(x1, y2, z2); \ + vert_set[6].Set(x1, y2, z1); \ + vert_set[7].Set(x1, y1, z1) + +void X3DImporter::GeometryHelper_MakeQL_RectParallelepiped(const aiVector3D& pSize, std::list& pVertices) +{ + MESH_RectParallelepiped_CREATE_VERT; + MACRO_FACE_ADD_QUAD_FA(true, pVertices, vert_set, 3, 2, 1, 0);// front + MACRO_FACE_ADD_QUAD_FA(true, pVertices, vert_set, 6, 7, 4, 5);// back + MACRO_FACE_ADD_QUAD_FA(true, pVertices, vert_set, 7, 3, 0, 4);// left + MACRO_FACE_ADD_QUAD_FA(true, pVertices, vert_set, 2, 6, 5, 1);// right + MACRO_FACE_ADD_QUAD_FA(true, pVertices, vert_set, 0, 1, 5, 4);// top + MACRO_FACE_ADD_QUAD_FA(true, pVertices, vert_set, 7, 6, 2, 3);// bottom +} + +#undef MESH_RectParallelepiped_CREATE_VERT + +void X3DImporter::GeometryHelper_CoordIdxStr2FacesArr(const std::list& pCoordIdx, std::vector& pFaces, unsigned int& pPrimitiveTypes) const +{ + std::list f_data(pCoordIdx); + std::vector inds; + unsigned int prim_type = 0; + + if ( f_data.back() != ( -1 ) ) + { + f_data.push_back( -1 ); + } + + // reserve average size. + pFaces.reserve(f_data.size() / 3); + inds.reserve(4); + //PrintVectorSet("build. ci", pCoordIdx); + for(std::list::iterator it = f_data.begin(); it != f_data.end(); it++) + { + // when face is got count how many indices in it. + if(*it == (-1)) + { + aiFace tface; + size_t ts; + + ts = inds.size(); + switch(ts) + { + case 0: goto mg_m_err; + case 1: prim_type |= aiPrimitiveType_POINT; break; + case 2: prim_type |= aiPrimitiveType_LINE; break; + case 3: prim_type |= aiPrimitiveType_TRIANGLE; break; + default: prim_type |= aiPrimitiveType_POLYGON; break; + } + + tface.mNumIndices = ts; + tface.mIndices = new unsigned int[ts]; + memcpy(tface.mIndices, inds.data(), ts * sizeof(unsigned int)); + pFaces.push_back(tface); + inds.clear(); + }// if(*it == (-1)) + else + { + inds.push_back(*it); + }// if(*it == (-1)) else + }// for(std::list::iterator it = f_data.begin(); it != f_data.end(); it++) +//PrintVectorSet("build. faces", pCoordIdx); + + pPrimitiveTypes = prim_type; + + return; + +mg_m_err: + + for(size_t i = 0, i_e = pFaces.size(); i < i_e; i++) delete [] pFaces.at(i).mIndices; + + pFaces.clear(); +} + +void X3DImporter::MeshGeometry_AddColor(aiMesh& pMesh, const std::list& pColors, const bool pColorPerVertex) const +{ +std::list tcol; + + // create RGBA array from RGB. + for(std::list::const_iterator it = pColors.begin(); it != pColors.end(); it++) tcol.push_back(aiColor4D((*it).r, (*it).g, (*it).b, 1)); + + // call existing function for adding RGBA colors + MeshGeometry_AddColor(pMesh, tcol, pColorPerVertex); +} + +void X3DImporter::MeshGeometry_AddColor(aiMesh& pMesh, const std::list& pColors, const bool pColorPerVertex) const +{ + std::list::const_iterator col_it = pColors.begin(); + + if(pColorPerVertex) + { + if(pColors.size() < pMesh.mNumVertices) + { + throw DeadlyImportError("MeshGeometry_AddColor1. Colors count(" + to_string(pColors.size()) + ") can not be less than Vertices count(" + + to_string(pMesh.mNumVertices) + ")."); + } + + // copy colors to mesh + pMesh.mColors[0] = new aiColor4D[pMesh.mNumVertices]; + for(size_t i = 0; i < pMesh.mNumVertices; i++) pMesh.mColors[0][i] = *col_it++; + }// if(pColorPerVertex) + else + { + if(pColors.size() < pMesh.mNumFaces) + { + throw DeadlyImportError("MeshGeometry_AddColor1. Colors count(" + to_string(pColors.size()) + ") can not be less than Faces count(" + + to_string(pMesh.mNumFaces) + ")."); + } + + // copy colors to mesh + pMesh.mColors[0] = new aiColor4D[pMesh.mNumVertices]; + for(size_t fi = 0; fi < pMesh.mNumFaces; fi++) + { + // apply color to all vertices of face + for ( size_t vi = 0, vi_e = pMesh.mFaces[ fi ].mNumIndices; vi < vi_e; vi++ ) + { + pMesh.mColors[ 0 ][ pMesh.mFaces[ fi ].mIndices[ vi ] ] = *col_it; + } + + col_it++; + } + }// if(pColorPerVertex) else +} + +void X3DImporter::MeshGeometry_AddColor(aiMesh& pMesh, const std::list& pCoordIdx, const std::list& pColorIdx, + const std::list& pColors, const bool pColorPerVertex) const +{ + std::list tcol; + + // create RGBA array from RGB. + for ( std::list::const_iterator it = pColors.begin(); it != pColors.end(); it++ ) + { + tcol.push_back( aiColor4D( ( *it ).r, ( *it ).g, ( *it ).b, 1 ) ); + } + + // call existing function for adding RGBA colors + MeshGeometry_AddColor(pMesh, pCoordIdx, pColorIdx, tcol, pColorPerVertex); +} + +void X3DImporter::MeshGeometry_AddColor(aiMesh& pMesh, const std::list& pCoordIdx, const std::list& pColorIdx, + const std::list& pColors, const bool pColorPerVertex) const +{ + std::vector col_tgt_arr; + std::list col_tgt_list; + std::vector col_arr_copy; + + if ( pCoordIdx.size() == 0 ) + { + throw DeadlyImportError( "MeshGeometry_AddColor2. pCoordIdx can not be empty." ); + } + + // copy list to array because we are need indexed access to colors. + col_arr_copy.reserve(pColors.size()); + for ( std::list::const_iterator it = pColors.begin(); it != pColors.end(); it++ ) + { + col_arr_copy.push_back( *it ); + } + + if(pColorPerVertex) + { + if(pColorIdx.size() > 0) + { + // check indices array count. + if(pColorIdx.size() < pCoordIdx.size()) + { + throw DeadlyImportError("MeshGeometry_AddColor2. Colors indices count(" + to_string(pColorIdx.size()) + + ") can not be less than Coords inidces count(" + to_string(pCoordIdx.size()) + ")."); + } + // create list with colors for every vertex. + col_tgt_arr.resize(pMesh.mNumVertices); + for(std::list::const_iterator colidx_it = pColorIdx.begin(), coordidx_it = pCoordIdx.begin(); colidx_it != pColorIdx.end(); colidx_it++, coordidx_it++) + { + if ( *colidx_it == ( -1 ) ) + { + continue;// skip faces delimiter + } + if ( ( unsigned int ) ( *coordidx_it ) > pMesh.mNumVertices ) + { + throw DeadlyImportError( "MeshGeometry_AddColor2. Coordinate idx is out of range." ); + } + if ( ( unsigned int ) *colidx_it > pMesh.mNumVertices ) + { + throw DeadlyImportError( "MeshGeometry_AddColor2. Color idx is out of range." ); + } + + col_tgt_arr[*coordidx_it] = col_arr_copy[*colidx_it]; + } + }// if(pColorIdx.size() > 0) + else + { + // when color indices list is absent use CoordIdx. + // check indices array count. + if(pColors.size() < pMesh.mNumVertices) + { + throw DeadlyImportError("MeshGeometry_AddColor2. Colors count(" + to_string(pColors.size()) + ") can not be less than Vertices count(" + + to_string(pMesh.mNumVertices) + ")."); + } + // create list with colors for every vertex. + col_tgt_arr.resize(pMesh.mNumVertices); + for ( size_t i = 0; i < pMesh.mNumVertices; i++ ) + { + col_tgt_arr[ i ] = col_arr_copy[ i ]; + } + }// if(pColorIdx.size() > 0) else + }// if(pColorPerVertex) + else + { + if(pColorIdx.size() > 0) + { + // check indices array count. + if(pColorIdx.size() < pMesh.mNumFaces) + { + throw DeadlyImportError("MeshGeometry_AddColor2. Colors indices count(" + to_string(pColorIdx.size()) + + ") can not be less than Faces count(" + to_string(pMesh.mNumFaces) + ")."); + } + // create list with colors for every vertex using faces indices. + col_tgt_arr.resize(pMesh.mNumFaces); + + std::list::const_iterator colidx_it = pColorIdx.begin(); + for(size_t fi = 0; fi < pMesh.mNumFaces; fi++) + { + if((unsigned int)*colidx_it > pMesh.mNumFaces) throw DeadlyImportError("MeshGeometry_AddColor2. Face idx is out of range."); + + col_tgt_arr[fi] = col_arr_copy[*colidx_it++]; + } + }// if(pColorIdx.size() > 0) + else + { + // when color indices list is absent use CoordIdx. + // check indices array count. + if(pColors.size() < pMesh.mNumFaces) + { + throw DeadlyImportError("MeshGeometry_AddColor2. Colors count(" + to_string(pColors.size()) + ") can not be less than Faces count(" + + to_string(pMesh.mNumFaces) + ")."); + } + // create list with colors for every vertex using faces indices. + col_tgt_arr.resize(pMesh.mNumFaces); + for(size_t fi = 0; fi < pMesh.mNumFaces; fi++) col_tgt_arr[fi] = col_arr_copy[fi]; + + }// if(pColorIdx.size() > 0) else + }// if(pColorPerVertex) else + + // copy array to list for calling function that add colors. + for(std::vector::const_iterator it = col_tgt_arr.begin(); it != col_tgt_arr.end(); it++) col_tgt_list.push_back(*it); + // add prepared colors list to mesh. + MeshGeometry_AddColor(pMesh, col_tgt_list, pColorPerVertex); +} + +void X3DImporter::MeshGeometry_AddNormal(aiMesh& pMesh, const std::list& pCoordIdx, const std::list& pNormalIdx, + const std::list& pNormals, const bool pNormalPerVertex) const +{ + std::vector tind; + std::vector norm_arr_copy; + + // copy list to array because we are need indexed access to normals. + norm_arr_copy.reserve(pNormals.size()); + for ( std::list::const_iterator it = pNormals.begin(); it != pNormals.end(); it++ ) + { + norm_arr_copy.push_back( *it ); + } + + if(pNormalPerVertex) + { + const std::list* srcidx; + + if(pNormalIdx.size() > 0) + { + // check indices array count. + if(pNormalIdx.size() != pCoordIdx.size()) throw DeadlyImportError("Normals and Coords inidces count must be equal."); + + srcidx = &pNormalIdx; + } + else + { + srcidx = &pCoordIdx; + } + + tind.reserve(srcidx->size()); + for(std::list::const_iterator it = srcidx->begin(); it != srcidx->end(); it++) + { + if(*it != (-1)) tind.push_back(*it); + } + + // copy normals to mesh + pMesh.mNormals = new aiVector3D[pMesh.mNumVertices]; + for(size_t i = 0; (i < pMesh.mNumVertices) && (i < tind.size()); i++) + { + if(tind[i] >= norm_arr_copy.size()) + throw DeadlyImportError("MeshGeometry_AddNormal. Normal index(" + to_string(tind[i]) + + ") is out of range. Normals count: " + to_string(norm_arr_copy.size()) + "."); + + pMesh.mNormals[i] = norm_arr_copy[tind[i]]; + } + }// if(pNormalPerVertex) + else + { + if(pNormalIdx.size() > 0) + { + if(pMesh.mNumFaces != pNormalIdx.size()) throw DeadlyImportError("Normals faces count must be equal to mesh faces count."); + + std::list::const_iterator normidx_it = pNormalIdx.begin(); + + tind.reserve(pNormalIdx.size()); + for(size_t i = 0, i_e = pNormalIdx.size(); i < i_e; i++) tind.push_back(*normidx_it++); + + } + else + { + tind.reserve(pMesh.mNumFaces); + for(size_t i = 0; i < pMesh.mNumFaces; i++) tind.push_back(i); + + } + + // copy normals to mesh + pMesh.mNormals = new aiVector3D[pMesh.mNumVertices]; + for(size_t fi = 0; fi < pMesh.mNumFaces; fi++) + { + aiVector3D tnorm; + + tnorm = norm_arr_copy[tind[fi]]; + for(size_t vi = 0, vi_e = pMesh.mFaces[fi].mNumIndices; vi < vi_e; vi++) pMesh.mNormals[pMesh.mFaces[fi].mIndices[vi]] = tnorm; + } + }// if(pNormalPerVertex) else +} + +void X3DImporter::MeshGeometry_AddNormal(aiMesh& pMesh, const std::list& pNormals, const bool pNormalPerVertex) const +{ + std::list::const_iterator norm_it = pNormals.begin(); + + if(pNormalPerVertex) + { + if(pNormals.size() != pMesh.mNumVertices) throw DeadlyImportError("MeshGeometry_AddNormal. Normals and vertices count must be equal."); + + // copy normals to mesh + pMesh.mNormals = new aiVector3D[pMesh.mNumVertices]; + for(size_t i = 0; i < pMesh.mNumVertices; i++) pMesh.mNormals[i] = *norm_it++; + }// if(pNormalPerVertex) + else + { + if(pNormals.size() != pMesh.mNumFaces) throw DeadlyImportError("MeshGeometry_AddNormal. Normals and faces count must be equal."); + + // copy normals to mesh + pMesh.mNormals = new aiVector3D[pMesh.mNumVertices]; + for(size_t fi = 0; fi < pMesh.mNumFaces; fi++) + { + // apply color to all vertices of face + for(size_t vi = 0, vi_e = pMesh.mFaces[fi].mNumIndices; vi < vi_e; vi++) pMesh.mNormals[pMesh.mFaces[fi].mIndices[vi]] = *norm_it; + + norm_it++; + } + }// if(pNormalPerVertex) else +} + +void X3DImporter::MeshGeometry_AddTexCoord(aiMesh& pMesh, const std::list& pCoordIdx, const std::list& pTexCoordIdx, + const std::list& pTexCoords) const +{ + std::vector texcoord_arr_copy; + std::vector faces; + unsigned int prim_type; + + // copy list to array because we are need indexed access to normals. + texcoord_arr_copy.reserve(pTexCoords.size()); + for(std::list::const_iterator it = pTexCoords.begin(); it != pTexCoords.end(); it++) + { + texcoord_arr_copy.push_back(aiVector3D((*it).x, (*it).y, 0)); + } + + if(pTexCoordIdx.size() > 0) + { + GeometryHelper_CoordIdxStr2FacesArr(pTexCoordIdx, faces, prim_type); + if ( faces.empty() ) + { + throw DeadlyImportError( "Failed to add texture coordinates to mesh, faces list is empty." ); + } + if ( faces.size() != pMesh.mNumFaces ) + { + throw DeadlyImportError( "Texture coordinates faces count must be equal to mesh faces count." ); + } + } + else + { + GeometryHelper_CoordIdxStr2FacesArr(pCoordIdx, faces, prim_type); + } + + pMesh.mTextureCoords[0] = new aiVector3D[pMesh.mNumVertices]; + pMesh.mNumUVComponents[0] = 2; + for(size_t fi = 0, fi_e = faces.size(); fi < fi_e; fi++) + { + if(pMesh.mFaces[fi].mNumIndices != faces.at(fi).mNumIndices) + throw DeadlyImportError("Number of indices in texture face and mesh face must be equal. Invalid face index: " + to_string(fi) + "."); + + for(size_t ii = 0; ii < pMesh.mFaces[fi].mNumIndices; ii++) + { + size_t vert_idx = pMesh.mFaces[fi].mIndices[ii]; + size_t tc_idx = faces.at(fi).mIndices[ii]; + + pMesh.mTextureCoords[0][vert_idx] = texcoord_arr_copy.at(tc_idx); + } + }// for(size_t fi = 0, fi_e = faces.size(); fi < fi_e; fi++) +} + +void X3DImporter::MeshGeometry_AddTexCoord(aiMesh& pMesh, const std::list& pTexCoords) const +{ + std::vector tc_arr_copy; + + if ( pTexCoords.size() != pMesh.mNumVertices ) + { + throw DeadlyImportError( "MeshGeometry_AddTexCoord. Texture coordinates and vertices count must be equal." ); + } + + // copy list to array because we are need convert aiVector2D to aiVector3D and also get indexed access as a bonus. + tc_arr_copy.reserve(pTexCoords.size()); + for ( std::list::const_iterator it = pTexCoords.begin(); it != pTexCoords.end(); it++ ) + { + tc_arr_copy.push_back( aiVector3D( ( *it ).x, ( *it ).y, 0 ) ); + } + + // copy texture coordinates to mesh + pMesh.mTextureCoords[0] = new aiVector3D[pMesh.mNumVertices]; + pMesh.mNumUVComponents[0] = 2; + for ( size_t i = 0; i < pMesh.mNumVertices; i++ ) + { + pMesh.mTextureCoords[ 0 ][ i ] = tc_arr_copy[ i ]; + } +} + +aiMesh* X3DImporter::GeometryHelper_MakeMesh(const std::list& pCoordIdx, const std::list& pVertices) const +{ + std::vector faces; + unsigned int prim_type = 0; + + // create faces array from input string with vertices indices. + GeometryHelper_CoordIdxStr2FacesArr(pCoordIdx, faces, prim_type); + if ( !faces.size() ) + { + throw DeadlyImportError( "Failed to create mesh, faces list is empty." ); + } + + // + // Create new mesh and copy geometry data. + // + aiMesh *tmesh = new aiMesh; + size_t ts = faces.size(); + // faces + tmesh->mFaces = new aiFace[ts]; + tmesh->mNumFaces = ts; + for(size_t i = 0; i < ts; i++) tmesh->mFaces[i] = faces.at(i); + + // vertices + std::list::const_iterator vit = pVertices.begin(); + + ts = pVertices.size(); + tmesh->mVertices = new aiVector3D[ts]; + tmesh->mNumVertices = ts; + for ( size_t i = 0; i < ts; i++ ) + { + tmesh->mVertices[ i ] = *vit++; + } + + // set primitives type and return result. + tmesh->mPrimitiveTypes = prim_type; + + return tmesh; +} + +/*********************************************************************************************************************************************/ +/************************************************************ Functions: parse set ***********************************************************/ +/*********************************************************************************************************************************************/ + +void X3DImporter::ParseHelper_Group_Begin(const bool pStatic) +{ + CX3DImporter_NodeElement_Group* new_group = new CX3DImporter_NodeElement_Group(NodeElement_Cur, pStatic);// create new node with current node as parent. + + // if we are adding not the root element then add new element to current element child list. + if ( NodeElement_Cur != nullptr ) + { + NodeElement_Cur->Child.push_back( new_group ); + } + + NodeElement_List.push_back(new_group);// it's a new element - add it to list. + NodeElement_Cur = new_group;// switch current element to new one. +} + +void X3DImporter::ParseHelper_Node_Enter(CX3DImporter_NodeElement* pNode) +{ + NodeElement_Cur->Child.push_back(pNode);// add new element to current element child list. + NodeElement_Cur = pNode;// switch current element to new one. +} + +void X3DImporter::ParseHelper_Node_Exit() +{ + // check if we can walk up. + if ( NodeElement_Cur != nullptr ) + { + NodeElement_Cur = NodeElement_Cur->Parent; + } +} + +void X3DImporter::ParseHelper_FixTruncatedFloatString(const char* pInStr, std::string& pOutString) +{ + pOutString.clear(); + const size_t instr_len = strlen(pInStr); + if ( 0 == instr_len ) + { + return; + } + + pOutString.reserve(instr_len * 3 / 2); + // check and correct floats in format ".x". Must be "x.y". + if ( pInStr[ 0 ] == '.' ) + { + pOutString.push_back( '0' ); + } + + pOutString.push_back(pInStr[0]); + for(size_t ci = 1; ci < instr_len; ci++) + { + if((pInStr[ci] == '.') && ((pInStr[ci - 1] == ' ') || (pInStr[ci - 1] == '-') || (pInStr[ci - 1] == '+') || (pInStr[ci - 1] == '\t'))) + { + pOutString.push_back('0'); + pOutString.push_back('.'); + } + else + { + pOutString.push_back(pInStr[ci]); + } + } +} + +void X3DImporter::ParseFile(const std::string& pFile, IOSystem* pIOHandler) +{ + irr::io::IrrXMLReader* OldReader = mReader;// store current XMLreader. + std::unique_ptr file(pIOHandler->Open(pFile, "rb")); + + // Check whether we can read from the file + if ( file.get() == nullptr ) + { + throw DeadlyImportError( "Failed to open X3D file " + pFile + "." ); + } + // generate a XML reader for it + std::unique_ptr mIOWrapper(new CIrrXML_IOStreamReader(file.get())); + mReader = irr::io::createIrrXMLReader(mIOWrapper.get()); + if ( !mReader ) + { + throw DeadlyImportError( "Failed to create XML reader for file" + pFile + "." ); + } + // start reading + ParseNode_Root(); + + delete mReader; + // restore old XMLreader + mReader = OldReader; +} + +void X3DImporter::ParseNode_Root() +{ + // search for root tag + if ( !XML_SearchNode( "X3D" ) ) + { + throw DeadlyImportError( "Root node \"X3D\" not found." ); + } + + ParseHelper_Group_Begin();// create root node element. + // parse other contents + while(mReader->read()) + { + if ( mReader->getNodeType() != irr::io::EXN_ELEMENT ) + { + continue; + } + + if(XML_CheckNode_NameEqual("head")) + ParseNode_Head(); + else if(XML_CheckNode_NameEqual("Scene")) + ParseNode_Scene(); + else + XML_CheckNode_SkipUnsupported("Root"); + } + + // exit from root node element. + ParseHelper_Node_Exit(); +} + +void X3DImporter::ParseNode_Head() +{ + bool close_found = false;// flag: true if close tag of node are found. + + while(mReader->read()) + { + if(mReader->getNodeType() == irr::io::EXN_ELEMENT) + { + if(XML_CheckNode_NameEqual("meta")) + { + XML_CheckNode_MustBeEmpty(); + + // adding metadata from as MetaString from + CX3DImporter_NodeElement_MetaString* ms = new CX3DImporter_NodeElement_MetaString(NodeElement_Cur); + + ms->Name = mReader->getAttributeValueSafe("name"); + // name can not be empty + if(!ms->Name.empty()) + { + ms->Value.push_back(mReader->getAttributeValueSafe("content")); + NodeElement_List.push_back(ms); + if ( NodeElement_Cur != nullptr ) + { + NodeElement_Cur->Child.push_back( ms ); + } + } + }// if(XML_CheckNode_NameEqual("meta")) + }// if(mReader->getNodeType() == irr::io::EXN_ELEMENT) + else if(mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if(XML_CheckNode_NameEqual("head")) + { + close_found = true; + break; + } + }// if(mReader->getNodeType() == irr::io::EXN_ELEMENT) else + }// while(mReader->read()) + + if ( !close_found ) + { + Throw_CloseNotFound( "head" ); + } +} + +void X3DImporter::ParseNode_Scene() +{ + auto GroupCounter_Increase = [](size_t& pCounter, const char* pGroupName) -> void + { + pCounter++; + if(pCounter == 0) throw DeadlyImportError("Group counter overflow. Too much groups with type: " + std::string(pGroupName) + "."); +}; + +auto GroupCounter_Decrease = [&](size_t& pCounter, const char* pGroupName) -> void +{ + if(pCounter == 0) Throw_TagCountIncorrect(pGroupName); + + pCounter--; +}; + +static const char* GroupName_Group = "Group"; +static const char* GroupName_StaticGroup = "StaticGroup"; +static const char* GroupName_Transform = "Transform"; +static const char* GroupName_Switch = "Switch"; + +bool close_found = false; +size_t counter_group = 0; +size_t counter_transform = 0; +size_t counter_switch = 0; + + // while create static node? Because objects name used deeper in "USE" attribute can be equal to some meta in node. + ParseHelper_Group_Begin(true); + while(mReader->read()) + { + if(mReader->getNodeType() == irr::io::EXN_ELEMENT) + { + if(XML_CheckNode_NameEqual("Shape")) + { + ParseNode_Shape_Shape(); + } + else if(XML_CheckNode_NameEqual(GroupName_Group)) + { + GroupCounter_Increase(counter_group, GroupName_Group); + ParseNode_Grouping_Group(); + // if node is empty then decrease group counter at this place. + if(mReader->isEmptyElement()) GroupCounter_Decrease(counter_group, GroupName_Group); + } + else if(XML_CheckNode_NameEqual(GroupName_StaticGroup)) + { + GroupCounter_Increase(counter_group, GroupName_StaticGroup); + ParseNode_Grouping_StaticGroup(); + // if node is empty then decrease group counter at this place. + if(mReader->isEmptyElement()) GroupCounter_Decrease(counter_group, GroupName_StaticGroup); + } + else if(XML_CheckNode_NameEqual(GroupName_Transform)) + { + GroupCounter_Increase(counter_transform, GroupName_Transform); + ParseNode_Grouping_Transform(); + // if node is empty then decrease group counter at this place. + if(mReader->isEmptyElement()) GroupCounter_Decrease(counter_transform, GroupName_Transform); + } + else if(XML_CheckNode_NameEqual(GroupName_Switch)) + { + GroupCounter_Increase(counter_switch, GroupName_Switch); + ParseNode_Grouping_Switch(); + // if node is empty then decrease group counter at this place. + if(mReader->isEmptyElement()) GroupCounter_Decrease(counter_switch, GroupName_Switch); + } + else if(XML_CheckNode_NameEqual("DirectionalLight")) + { + ParseNode_Lighting_DirectionalLight(); + } + else if(XML_CheckNode_NameEqual("PointLight")) + { + ParseNode_Lighting_PointLight(); + } + else if(XML_CheckNode_NameEqual("SpotLight")) + { + ParseNode_Lighting_SpotLight(); + } + else if(XML_CheckNode_NameEqual("Inline")) + { + ParseNode_Networking_Inline(); + } + else if(!ParseHelper_CheckRead_X3DMetadataObject()) + { + XML_CheckNode_SkipUnsupported("Scene"); + } + }// if(mReader->getNodeType() == irr::io::EXN_ELEMENT) + else if(mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if(XML_CheckNode_NameEqual("Scene")) + { + close_found = true; + + break; + } + else if(XML_CheckNode_NameEqual(GroupName_Group)) + { + GroupCounter_Decrease(counter_group, GroupName_Group); + ParseNode_Grouping_GroupEnd(); + } + else if(XML_CheckNode_NameEqual(GroupName_StaticGroup)) + { + GroupCounter_Decrease(counter_group, GroupName_StaticGroup); + ParseNode_Grouping_StaticGroupEnd(); + } + else if(XML_CheckNode_NameEqual(GroupName_Transform)) + { + GroupCounter_Decrease(counter_transform, GroupName_Transform); + ParseNode_Grouping_TransformEnd(); + } + else if(XML_CheckNode_NameEqual(GroupName_Switch)) + { + GroupCounter_Decrease(counter_switch, GroupName_Switch); + ParseNode_Grouping_SwitchEnd(); + } + }// if(mReader->getNodeType() == irr::io::EXN_ELEMENT) else + }// while(mReader->read()) + + ParseHelper_Node_Exit(); + + if(counter_group) Throw_TagCountIncorrect("Group"); + if(counter_transform) Throw_TagCountIncorrect("Transform"); + if(counter_switch) Throw_TagCountIncorrect("Switch"); + if(!close_found) Throw_CloseNotFound("Scene"); + +} + +/*********************************************************************************************************************************************/ +/******************************************************** Functions: BaseImporter set ********************************************************/ +/*********************************************************************************************************************************************/ + +bool X3DImporter::CanRead(const std::string& pFile, IOSystem* pIOHandler, bool pCheckSig) const +{ + const std::string extension = GetExtension(pFile); + + if(extension == "x3d") return true; + + if(!extension.length() || pCheckSig) + { + const char* tokens[] = { "DOCTYPE X3D PUBLIC", "http://www.web3d.org/specifications/x3d" }; + + return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 2); + } + + return false; +} + +void X3DImporter::GetExtensionList(std::set& pExtensionList) +{ + pExtensionList.insert("x3d"); +} + +const aiImporterDesc* X3DImporter::GetInfo () const +{ + return &Description; +} + +void X3DImporter::InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) +{ + Clear();// delete old graph. + mFileDir = DefaultIOSystem::absolutePath(pFile); + ParseFile(pFile, pIOHandler); + // + // Assimp use static arrays of objects for fast speed of rendering. That's good, but need some additional operations/ + // We know that geometry objects(meshes) are stored in , also in -> materials(in Assimp logical view) + // are stored. So at first we need to count how meshes and materials are stored in scene graph. + // + // at first creating root node for aiScene. + pScene->mRootNode = new aiNode; + pScene->mRootNode->mParent = nullptr; + pScene->mFlags |= AI_SCENE_FLAGS_ALLOW_SHARED; + //search for root node element + NodeElement_Cur = NodeElement_List.front(); + while(NodeElement_Cur->Parent != nullptr) NodeElement_Cur = NodeElement_Cur->Parent; + + {// fill aiScene with objects. + std::list mesh_list; + std::list mat_list; + std::list light_list; + + // create nodes tree + Postprocess_BuildNode(*NodeElement_Cur, *pScene->mRootNode, mesh_list, mat_list, light_list); + // copy needed data to scene + if(mesh_list.size() > 0) + { + std::list::const_iterator it = mesh_list.begin(); + + pScene->mNumMeshes = mesh_list.size(); + pScene->mMeshes = new aiMesh*[pScene->mNumMeshes]; + for(size_t i = 0; i < pScene->mNumMeshes; i++) pScene->mMeshes[i] = *it++; + } + + if(mat_list.size() > 0) + { + std::list::const_iterator it = mat_list.begin(); + + pScene->mNumMaterials = mat_list.size(); + pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials]; + for(size_t i = 0; i < pScene->mNumMaterials; i++) pScene->mMaterials[i] = *it++; + } + + if(light_list.size() > 0) + { + std::list::const_iterator it = light_list.begin(); + + pScene->mNumLights = light_list.size(); + pScene->mLights = new aiLight*[pScene->mNumLights]; + for(size_t i = 0; i < pScene->mNumLights; i++) pScene->mLights[i] = *it++; + } + }// END: fill aiScene with objects. + + ///TODO: IME optimize tree +} + +}// namespace Assimp + +#endif // !ASSIMP_BUILD_NO_X3D_IMPORTER diff --git a/code/X3DImporter.hpp b/code/X3DImporter.hpp new file mode 100644 index 000000000..f19fc0195 --- /dev/null +++ b/code/X3DImporter.hpp @@ -0,0 +1,842 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +/// \file X3DImporter.hpp +/// \brief X3D-format files importer for Assimp. +/// \date 2015-2016 +/// \author smal.root@gmail.com +// Thanks to acorn89 for support. + +#ifndef INCLUDED_AI_X3D_IMPORTER_H +#define INCLUDED_AI_X3D_IMPORTER_H + +#include "X3DImporter_Node.hpp" + +// Header files, Assimp. +#include +#include +#include +#include +#include "BaseImporter.h" +#include "irrXMLWrapper.h" + +namespace Assimp +{ + +/// \class X3DImporter +/// Class that holding scene graph which include: groups, geometry, metadata etc. +/// +/// Limitations. +/// +/// Pay attention that X3D is format for interactive graphic and simulations for web browsers. +/// So not all features can be imported using Assimp. +/// +/// Unsupported nodes: +/// CAD geometry component: +/// "CADAssembly", "CADFace", "CADLayer", "CADPart", "IndexedQuadSet", "QuadSet" +/// Core component: +/// "ROUTE", "ExternProtoDeclare", "ProtoDeclare", "ProtoInstance", "ProtoInterface", "WorldInfo" +/// Distributed interactive simulation (DIS) component: +/// "DISEntityManager", "DISEntityTypeMapping", "EspduTransform", "ReceiverPdu", "SignalPdu", "TransmitterPdu" +/// Cube map environmental texturing component: +/// "ComposedCubeMapTexture", "GeneratedCubeMapTexture", "ImageCubeMapTexture" +/// Environmental effects component: +/// "Background", "Fog", "FogCoordinate", "LocalFog", "TextureBackground" +/// Environmental sensor component: +/// "ProximitySensor", "TransformSensor", "VisibilitySensor" +/// Followers component: +/// "ColorChaser", "ColorDamper", "CoordinateChaser", "CoordinateDamper", "OrientationChaser", "OrientationDamper", "PositionChaser", +/// "PositionChaser2D", "PositionDamper", "PositionDamper2D", "ScalarChaser", "ScalarDamper", "TexCoordChaser2D", "TexCoordDamper2D" +/// Geospatial component: +/// "GeoCoordinate", "GeoElevationGrid", "GeoLocation", "GeoLOD", "GeoMetadata", "GeoOrigin", "GeoPositionInterpolator", "GeoProximitySensor", +/// "GeoTouchSensor", "GeoTransform", "GeoViewpoint" +/// Humanoid Animation (H-Anim) component: +/// "HAnimDisplacer", "HAnimHumanoid", "HAnimJoint", "HAnimSegment", "HAnimSite" +/// Interpolation component: +/// "ColorInterpolator", "CoordinateInterpolator", "CoordinateInterpolator2D", "EaseInEaseOut", "NormalInterpolator", "OrientationInterpolator", +/// "PositionInterpolator", "PositionInterpolator2D", "ScalarInterpolator", "SplinePositionInterpolator", "SplinePositionInterpolator2D", +/// "SplineScalarInterpolator", "SquadOrientationInterpolator", +/// Key device sensor component: +/// "KeySensor", "StringSensor" +/// Layering component: +/// "Layer", "LayerSet", "Viewport" +/// Layout component: +/// "Layout", "LayoutGroup", "LayoutLayer", "ScreenFontStyle", "ScreenGroup" +/// Navigation component: +/// "Billboard", "Collision", "LOD", "NavigationInfo", "OrthoViewpoint", "Viewpoint", "ViewpointGroup" +/// Networking component: +/// "Anchor", "LoadSensor" +/// NURBS component: +/// "Contour2D", "ContourPolyline2D", "CoordinateDouble", "NurbsCurve", "NurbsCurve2D", "NurbsOrientationInterpolator", "NurbsPatchSurface", +/// "NurbsPositionInterpolator", "NurbsSet", "NurbsSurfaceInterpolator", "NurbsSweptSurface", "NurbsSwungSurface", "NurbsTextureCoordinate", +/// "NurbsTrimmedSurface" +/// Particle systems component: +/// "BoundedPhysicsModel", "ConeEmitter", "ExplosionEmitter", "ForcePhysicsModel", "ParticleSystem", "PointEmitter", "PolylineEmitter", +/// "SurfaceEmitter", "VolumeEmitter", "WindPhysicsModel" +/// Picking component: +/// "LinePickSensor", "PickableGroup", "PointPickSensor", "PrimitivePickSensor", "VolumePickSensor" +/// Pointing device sensor component: +/// "CylinderSensor", "PlaneSensor", "SphereSensor", "TouchSensor" +/// Rendering component: +/// "ClipPlane" +/// Rigid body physics: +/// "BallJoint", "CollidableOffset", "CollidableShape", "CollisionCollection", "CollisionSensor", "CollisionSpace", "Contact", "DoubleAxisHingeJoint", +/// "MotorJoint", "RigidBody", "RigidBodyCollection", "SingleAxisHingeJoint", "SliderJoint", "UniversalJoint" +/// Scripting component: +/// "Script" +/// Programmable shaders component: +/// "ComposedShader", "FloatVertexAttribute", "Matrix3VertexAttribute", "Matrix4VertexAttribute", "PackagedShader", "ProgramShader", "ShaderPart", +/// "ShaderProgram", +/// Shape component: +/// "FillProperties", "LineProperties", "TwoSidedMaterial" +/// Sound component: +/// "AudioClip", "Sound" +/// Text component: +/// "FontStyle", "Text" +/// Texturing3D Component: +/// "ComposedTexture3D", "ImageTexture3D", "PixelTexture3D", "TextureCoordinate3D", "TextureCoordinate4D", "TextureTransformMatrix3D", +/// "TextureTransform3D" +/// Texturing component: +/// "MovieTexture", "MultiTexture", "MultiTextureCoordinate", "MultiTextureTransform", "PixelTexture", "TextureCoordinateGenerator", +/// "TextureProperties", +/// Time component: +/// "TimeSensor" +/// Event Utilities component: +/// "BooleanFilter", "BooleanSequencer", "BooleanToggle", "BooleanTrigger", "IntegerSequencer", "IntegerTrigger", "TimeTrigger", +/// Volume rendering component: +/// "BlendedVolumeStyle", "BoundaryEnhancementVolumeStyle", "CartoonVolumeStyle", "ComposedVolumeStyle", "EdgeEnhancementVolumeStyle", +/// "IsoSurfaceVolumeData", "OpacityMapVolumeStyle", "ProjectionVolumeStyle", "SegmentedVolumeData", "ShadedVolumeStyle", +/// "SilhouetteEnhancementVolumeStyle", "ToneMappedVolumeStyle", "VolumeData" +/// +/// Supported nodes: +/// Core component: +/// "MetadataBoolean", "MetadataDouble", "MetadataFloat", "MetadataInteger", "MetadataSet", "MetadataString" +/// Geometry2D component: +/// "Arc2D", "ArcClose2D", "Circle2D", "Disk2D", "Polyline2D", "Polypoint2D", "Rectangle2D", "TriangleSet2D" +/// Geometry3D component: +/// "Box", "Cone", "Cylinder", "ElevationGrid", "Extrusion", "IndexedFaceSet", "Sphere" +/// Grouping component: +/// "Group", "StaticGroup", "Switch", "Transform" +/// Lighting component: +/// "DirectionalLight", "PointLight", "SpotLight" +/// Networking component: +/// "Inline" +/// Rendering component: +/// "Color", "ColorRGBA", "Coordinate", "IndexedLineSet", "IndexedTriangleFanSet", "IndexedTriangleSet", "IndexedTriangleStripSet", "LineSet", +/// "PointSet", "TriangleFanSet", "TriangleSet", "TriangleStripSet", "Normal" +/// Shape component: +/// "Shape", "Appearance", "Material" +/// Texturing component: +/// "ImageTexture", "TextureCoordinate", "TextureTransform" +/// +/// Limitations of attribute "USE". +/// If "USE" is set then node must be empty, like that: +/// +/// not the +/// +/// +/// Ignored attributes: "creaseAngle", "convex", "solid". +/// +/// Texture coordinates generating: only for Sphere, Cone, Cylinder. In all other case used PLANE mapping. +/// It's better that Assimp main code has powerfull texture coordinates generator. Then is not needed to +/// duplicate this code in every importer. +/// +/// Lighting limitations. +/// If light source placed in some group with "DEF" set. And after that some node is use it group with "USE" attribute then +/// you will get error about duplicate light sources. That's happening because Assimp require names for lights but do not like +/// duplicates of it )). +/// +/// Color for faces. +/// That's happening when attribute "colorPerVertex" is set to "false". But Assimp do not hold how many colors has mesh and require +/// equal length for mVertices and mColors. You will see the colors but vertices will use call which last used in "colorIdx". +/// +/// That's all for now. Enjoy +/// +class X3DImporter : public BaseImporter +{ +public: + std::list NodeElement_List;///< All elements of scene graph. + +public: + /***********************************************/ + /****************** Functions ******************/ + /***********************************************/ + + /// Default constructor. + X3DImporter() + : NodeElement_Cur( nullptr ), mReader( nullptr ) + {} + + /// Default destructor. + ~X3DImporter(); + + /***********************************************/ + /******** Functions: parse set, public *********/ + /***********************************************/ + + /// Parse X3D file and fill scene graph. The function has no return value. Result can be found by analyzing the generated graph. + /// Also exception can be throwed if trouble will found. + /// \param [in] pFile - name of file to be parsed. + /// \param [in] pIOHandler - pointer to IO helper object. + void ParseFile( const std::string& pFile, IOSystem* pIOHandler ); + + /***********************************************/ + /********* Functions: BaseImporter set *********/ + /***********************************************/ + + bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool pCheckSig ) const; + void GetExtensionList( std::set& pExtensionList ); + void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler ); + const aiImporterDesc* GetInfo()const; + + +private: + /// Disabled copy constructor. + X3DImporter(const X3DImporter& pScene); + + /// Disabled assign operator. + X3DImporter& operator=(const X3DImporter& pScene); + + /// Clear all temporary data. + void Clear(); + + /***********************************************/ + /************* Functions: find set *************/ + /***********************************************/ + + /// Find requested node element. Search will be made in all existing nodes. + /// \param [in] pID - ID of requested element. + /// \param [in] pType - type of requested element. + /// \param [out] pElement - pointer to pointer to item found. + /// \return true - if the element is found, else - false. + bool FindNodeElement_FromRoot(const std::string& pID, const CX3DImporter_NodeElement::EType pType, CX3DImporter_NodeElement** pElement); + + /// Find requested node element. Search will be made from pointed node down to childs. + /// \param [in] pStartNode - pointer to start node. + /// \param [in] pID - ID of requested element. + /// \param [in] pType - type of requested element. + /// \param [out] pElement - pointer to pointer to item found. + /// \return true - if the element is found, else - false. + bool FindNodeElement_FromNode(CX3DImporter_NodeElement* pStartNode, const std::string& pID, const CX3DImporter_NodeElement::EType pType, + CX3DImporter_NodeElement** pElement); + + /// Find requested node element. For "Node"'s accounting flag "Static". + /// \param [in] pName - name of requested element. + /// \param [in] pType - type of requested element. + /// \param [out] pElement - pointer to pointer to item found. + /// \return true - if the element is found, else - false. + bool FindNodeElement(const std::string& pName, const CX3DImporter_NodeElement::EType pType, CX3DImporter_NodeElement** pElement); + + /***********************************************/ + /********* Functions: postprocess set **********/ + /***********************************************/ + + /// \return transformation matrix from global coordinate system to local. + aiMatrix4x4 PostprocessHelper_Matrix_GlobalToCurrent() const; + + /// Check if child elements of node element is metadata and add it to temporary list. + /// \param [in] pNodeElement - node element where metadata is searching. + /// \param [out] pList - temporary list for collected metadata. + void PostprocessHelper_CollectMetadata(const CX3DImporter_NodeElement& pNodeElement, std::list& pList) const; + + /// Check if type of node element is metadata. E.g. , . + /// \param [in] pType - checked type. + /// \return true - if the type corresponds to the metadata. + bool PostprocessHelper_ElementIsMetadata(const CX3DImporter_NodeElement::EType pType) const; + + /// Check if type of node element is geometry object and can be used to build mesh. E.g. , . + /// \param [in] pType - checked type. + /// \return true - if the type corresponds to the mesh. + bool PostprocessHelper_ElementIsMesh(const CX3DImporter_NodeElement::EType pType) const; + + /// Read CX3DImporter_NodeElement_Light, create aiLight and add it to list of the lights. + /// \param [in] pNodeElement - reference to lisght element(, , ). + /// \param [out] pSceneLightList - reference to list of the lights. + void Postprocess_BuildLight(const CX3DImporter_NodeElement& pNodeElement, std::list& pSceneLightList) const; + + /// Create filled structure with type \ref aiMaterial from \ref CX3DImporter_NodeElement. This function itseld extract + /// all needed data from scene graph. + /// \param [in] pNodeElement - reference to material element(). + /// \param [out] pMaterial - pointer to pointer to created material. *pMaterial must be nullptr. + void Postprocess_BuildMaterial(const CX3DImporter_NodeElement& pNodeElement, aiMaterial** pMaterial) const; + + /// Create filled structure with type \ref aiMaterial from \ref CX3DImporter_NodeElement. This function itseld extract + /// all needed data from scene graph. + /// \param [in] pNodeElement - reference to geometry object. + /// \param [out] pMesh - pointer to pointer to created mesh. *pMesh must be nullptr. + void Postprocess_BuildMesh(const CX3DImporter_NodeElement& pNodeElement, aiMesh** pMesh) const; + + /// Create aiNode from CX3DImporter_NodeElement. Also function check children and make recursive call. + /// \param [out] pNode - pointer to pointer to created node. *pNode must be nullptr. + /// \param [in] pNodeElement - CX3DImporter_NodeElement which read. + /// \param [out] pSceneNode - aiNode for filling. + /// \param [out] pSceneMeshList - list with aiMesh which belong to scene. + /// \param [out] pSceneMaterialList - list with aiMaterial which belong to scene. + /// \param [out] pSceneLightList - list with aiLight which belong to scene. + void Postprocess_BuildNode(const CX3DImporter_NodeElement& pNodeElement, aiNode& pSceneNode, std::list& pSceneMeshList, + std::list& pSceneMaterialList, std::list& pSceneLightList) const; + + /// To create mesh and material kept in . + /// \param pShapeNodeElement - reference to node element which kept data. + /// \param pNodeMeshInd - reference to list with mesh indices. When pShapeNodeElement will read new mesh index will be added to this list. + /// \param pSceneMeshList - reference to list with meshes. When pShapeNodeElement will read new mesh will be added to this list. + /// \param pSceneMaterialList - reference to list with materials. When pShapeNodeElement will read new material will be added to this list. + void Postprocess_BuildShape(const CX3DImporter_NodeElement_Shape& pShapeNodeElement, std::list& pNodeMeshInd, + std::list& pSceneMeshList, std::list& pSceneMaterialList) const; + + /// Check if child elements of node element is metadata and add it to scene node. + /// \param [in] pNodeElement - node element where metadata is searching. + /// \param [out] pSceneNode - scene node in which metadata will be added. + void Postprocess_CollectMetadata(const CX3DImporter_NodeElement& pNodeElement, aiNode& pSceneNode) const; + + /***********************************************/ + /************* Functions: throw set ************/ + /***********************************************/ + + /// Call that function when argument is out of range and exception must be raised. + /// \throw DeadlyImportError. + /// \param [in] pArgument - argument name. + void Throw_ArgOutOfRange(const std::string& pArgument); + + /// Call that function when close tag of node not found and exception must be raised. + /// E.g.: + /// + /// + /// + /// \throw DeadlyImportError. + /// \param [in] pNode - node name in which exception happened. + void Throw_CloseNotFound(const std::string& pNode); + + /// Call that function when string value can not be converted to floating point value and exception must be raised. + /// \param [in] pAttrValue - attribute value. + /// \throw DeadlyImportError. + void Throw_ConvertFail_Str2ArrF(const std::string& pAttrValue); + + /// Call that function when in node defined attributes "DEF" and "USE" and exception must be raised. + /// E.g.: + /// \throw DeadlyImportError. + void Throw_DEF_And_USE(); + + /// Call that function when attribute name is incorrect and exception must be raised. + /// \param [in] pAttrName - attribute name. + /// \throw DeadlyImportError. + void Throw_IncorrectAttr(const std::string& pAttrName); + + /// Call that function when attribute value is incorrect and exception must be raised. + /// \param [in] pAttrName - attribute name. + /// \throw DeadlyImportError. + void Throw_IncorrectAttrValue(const std::string& pAttrName); + + /// Call that function when some type of nodes are defined twice or more when must be used only once and exception must be raised. + /// E.g.: + /// + /// + /// + /// + /// \throw DeadlyImportError. + /// \param [in] pNodeType - type of node which defined one more time. + /// \param [in] pDescription - message about error. E.g. what the node defined while exception raised. + void Throw_MoreThanOnceDefined(const std::string& pNodeType, const std::string& pDescription); + + /// Call that function when count of opening and closing tags which create group(e.g. ) are not equal and exception must be raised. + /// E.g.: + /// + /// + /// + /// + /// + /// \throw DeadlyImportError. + /// \param [in] pNode - node name in which exception happened. + void Throw_TagCountIncorrect(const std::string& pNode); + + /// Call that function when defined in "USE" element are not found in graph and exception must be raised. + /// \param [in] pAttrValue - "USE" attribute value. + /// \throw DeadlyImportError. + void Throw_USE_NotFound(const std::string& pAttrValue); + + /***********************************************/ + /************** Functions: LOG set *************/ + /***********************************************/ + + /// Short variant for calling \ref DefaultLogger::get()->info() + void LogInfo(const std::string& pMessage) { DefaultLogger::get()->info(pMessage); } + + /***********************************************/ + /************** Functions: XML set *************/ + /***********************************************/ + + /// Chek if current node is empty: . If not then exception will throwed. + void XML_CheckNode_MustBeEmpty(); + + /// Chek if current node name is equal to pNodeName. + /// \param [in] pNodeName - name for checking. + /// return true if current node name is equal to pNodeName, else - false. + bool XML_CheckNode_NameEqual(const std::string& pNodeName) { return mReader->getNodeName() == pNodeName; } + + /// Skip unsupported node and report about that. Depend on node name can be skipped begin tag of node all whole node. + /// \param [in] pParentNodeName - parent node name. Used for reporting. + void XML_CheckNode_SkipUnsupported(const std::string& pParentNodeName); + + /// Search for specified node in file. XML file read pointer(mReader) will point to found node or file end after search is end. + /// \param [in] pNodeName - requested node name. + /// return true - if node is found, else - false. + bool XML_SearchNode(const std::string& pNodeName); + + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \return read data. + bool XML_ReadNode_GetAttrVal_AsBool(const int pAttrIdx); + + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \return read data. + float XML_ReadNode_GetAttrVal_AsFloat(const int pAttrIdx); + + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \return read data. + int32_t XML_ReadNode_GetAttrVal_AsI32(const int pAttrIdx); + + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \param [out] pValue - read data. + void XML_ReadNode_GetAttrVal_AsCol3f(const int pAttrIdx, aiColor3D& pValue); + + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \param [out] pValue - read data. + void XML_ReadNode_GetAttrVal_AsVec2f(const int pAttrIdx, aiVector2D& pValue); + + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \param [out] pValue - read data. + void XML_ReadNode_GetAttrVal_AsVec3f(const int pAttrIdx, aiVector3D& pValue); + + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \param [out] pValue - read data. + void XML_ReadNode_GetAttrVal_AsListB(const int pAttrIdx, std::list& pValue); + + /// \overload void XML_ReadNode_GetAttrVal_AsListBool(const int pAttrIdx, std::list& pValue) + void XML_ReadNode_GetAttrVal_AsArrB(const int pAttrIdx, std::vector& pValue); + + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \param [out] pValue - read data. + void XML_ReadNode_GetAttrVal_AsListI32(const int pAttrIdx, std::list& pValue); + + /// \overload void XML_ReadNode_GetAttrVal_AsListI32(const int pAttrIdx, std::list& pValue) + void XML_ReadNode_GetAttrVal_AsArrI32(const int pAttrIdx, std::vector& pValue); + + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \param [out] pValue - read data. + void XML_ReadNode_GetAttrVal_AsListF(const int pAttrIdx, std::list& pValue); + + /// \overload void XML_ReadNode_GetAttrVal_AsListF(const int pAttrIdx, std::list& pValue) + void XML_ReadNode_GetAttrVal_AsArrF(const int pAttrIdx, std::vector& pValue); + + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \param [out] pValue - read data. + void XML_ReadNode_GetAttrVal_AsListD(const int pAttrIdx, std::list& pValue); + + /// \overload void XML_ReadNode_GetAttrVal_AsListD(const int pAttrIdx, std::list& pValue) + void XML_ReadNode_GetAttrVal_AsArrD(const int pAttrIdx, std::vector& pValue); + + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \param [out] pValue - read data. + void XML_ReadNode_GetAttrVal_AsListCol3f(const int pAttrIdx, std::list& pValue); + + /// \overload void XML_ReadNode_GetAttrVal_AsListCol3f(const int pAttrIdx, std::vector& pValue) + void XML_ReadNode_GetAttrVal_AsArrCol3f(const int pAttrIdx, std::vector& pValue); + + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \param [out] pValue - read data. + void XML_ReadNode_GetAttrVal_AsListCol4f(const int pAttrIdx, std::list& pValue); + + /// \overload void XML_ReadNode_GetAttrVal_AsListCol4f(const int pAttrIdx, std::list& pValue) + void XML_ReadNode_GetAttrVal_AsArrCol4f(const int pAttrIdx, std::vector& pValue); + + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \param [out] pValue - read data. + void XML_ReadNode_GetAttrVal_AsListVec2f(const int pAttrIdx, std::list& pValue); + + /// \overload void XML_ReadNode_GetAttrVal_AsListVec2f(const int pAttrIdx, std::list& pValue) + void XML_ReadNode_GetAttrVal_AsArrVec2f(const int pAttrIdx, std::vector& pValue); + + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \param [out] pValue - read data. + void XML_ReadNode_GetAttrVal_AsListVec3f(const int pAttrIdx, std::list& pValue); + + /// \overload void XML_ReadNode_GetAttrVal_AsListVec3f(const int pAttrIdx, std::list& pValue) + void XML_ReadNode_GetAttrVal_AsArrVec3f(const int pAttrIdx, std::vector& pValue); + + /// Read attribute value. + /// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set). + /// \param [out] pValue - read data. + void XML_ReadNode_GetAttrVal_AsListS(const int pAttrIdx, std::list& pValue); + + /***********************************************/ + /******* Functions: geometry helper set *******/ + /***********************************************/ + + /// Make point on surface oXY. + /// \param [in] pAngle - angle in radians between radius-vector of point and oX axis. Angle extends from the oX axis counterclockwise to the radius-vector. + /// \param [in] pRadius - length of radius-vector. + /// \return made point coordinates. + aiVector3D GeometryHelper_Make_Point2D(const float pAngle, const float pRadius); + + /// Make 2D figure - linear circular arc with center in (0, 0). The z-coordinate is 0. The arc extends from the pStartAngle counterclockwise + /// to the pEndAngle. If pStartAngle and pEndAngle have the same value, a circle is specified. If the absolute difference between pStartAngle + /// and pEndAngle is greater than or equal to 2pi, a circle is specified. + /// \param [in] pStartAngle - angle in radians of start of the arc. + /// \param [in] pEndAngle - angle in radians of end of the arc. + /// \param [in] pRadius - radius of the arc. + /// \param [out] pNumSegments - number of segments in arc. In other words - tesselation factor. + /// \param [out] pVertices - generated vertices. + void GeometryHelper_Make_Arc2D(const float pStartAngle, const float pEndAngle, const float pRadius, size_t pNumSegments, std::list& pVertices); + + /// Create line set from point set. + /// \param [in] pPoint - input points list. + /// \param [out] pLine - made lines list. + void GeometryHelper_Extend_PointToLine(const std::list& pPoint, std::list& pLine); + + /// Create CoordIdx of line set from CoordIdx of polyline set. + /// \param [in] pPolylineCoordIdx - vertices indices divided by delimiter "-1". Must contain faces with two or more indices. + /// \param [out] pLineCoordIdx - made CoordIdx of line set. + void GeometryHelper_Extend_PolylineIdxToLineIdx(const std::list& pPolylineCoordIdx, std::list& pLineCoordIdx); + + /// Make 3D body - rectangular parallelepiped with center in (0, 0). QL mean quadlist (\sa pVertices). + /// \param [in] pSize - scale factor for body for every axis. E.g. (1, 2, 1) mean: X-size and Z-size - 1, Y-size - 2. + /// \param [out] pVertices - generated vertices. The list of vertices is grouped in quads. + void GeometryHelper_MakeQL_RectParallelepiped(const aiVector3D& pSize, std::list& pVertices); + + /// Create faces array from vertices indices array. + /// \param [in] pCoordIdx - vertices indices divided by delimiter "-1". + /// \param [in] pFaces - created faces array. + /// \param [in] pPrimitiveTypes - type of primitives in faces. + void GeometryHelper_CoordIdxStr2FacesArr(const std::list& pCoordIdx, std::vector& pFaces, unsigned int& pPrimitiveTypes) const; + + /// Add colors to mesh. + /// a. If colorPerVertex is FALSE, colours are applied to each face, as follows: + /// If the colorIndex field is not empty, one colour is used for each face of the mesh. There shall be at least as many indices in the + /// colorIndex field as there are faces in the mesh. The colorIndex field shall not contain any negative entries. + /// If the colorIndex field is empty, the colours in the X3DColorNode node are applied to each face of the mesh in order. + /// There shall be at least as many colours in the X3DColorNode node as there are faces. + /// b. If colorPerVertex is TRUE, colours are applied to each vertex, as follows: + /// If the colorIndex field is not empty, colours are applied to each vertex of the mesh in exactly the same manner that the coordIndex + /// field is used to choose coordinates for each vertex from the node. The colorIndex field shall contain end-of-face markers (−1) + /// in exactly the same places as the coordIndex field. + /// If the colorIndex field is empty, the coordIndex field is used to choose colours from the X3DColorNode node. + /// \param [in] pMesh - mesh for adding data. + /// \param [in] pCoordIdx - vertices indices divided by delimiter "-1". + /// \param [in] pColorIdx - color indices for every vertex divided by delimiter "-1" if \ref pColorPerVertex is true. if \ref pColorPerVertex is false + /// then pColorIdx contain color indices for every faces and must not contain delimiter "-1". + /// \param [in] pColors - defined colors. + /// \param [in] pColorPerVertex - if \ref pColorPerVertex is true then color in \ref pColors defined for every vertex, if false - for every face. + void MeshGeometry_AddColor(aiMesh& pMesh, const std::list& pCoordIdx, const std::list& pColorIdx, + const std::list& pColors, const bool pColorPerVertex) const; + + /// \overload void MeshGeometry_AddColor(aiMesh& pMesh, const std::list& pCoordIdx, const std::list& pColorIdx, const std::list& pColors, const bool pColorPerVertex) const; + void MeshGeometry_AddColor(aiMesh& pMesh, const std::list& pCoordIdx, const std::list& pColorIdx, + const std::list& pColors, const bool pColorPerVertex) const; + + /// Add colors to mesh. + /// \param [in] pMesh - mesh for adding data. + /// \param [in] pColors - defined colors. + /// \param [in] pColorPerVertex - if \ref pColorPerVertex is true then color in \ref pColors defined for every vertex, if false - for every face. + void MeshGeometry_AddColor(aiMesh& pMesh, const std::list& pColors, const bool pColorPerVertex) const; + + /// \overload void MeshGeometry_AddColor(aiMesh& pMesh, const std::list& pColors, const bool pColorPerVertex) const + void MeshGeometry_AddColor(aiMesh& pMesh, const std::list& pColors, const bool pColorPerVertex) const; + + /// Add normals to mesh. Function work similar to \ref MeshGeometry_AddColor; + void MeshGeometry_AddNormal(aiMesh& pMesh, const std::list& pCoordIdx, const std::list& pNormalIdx, + const std::list& pNormals, const bool pNormalPerVertex) const; + + /// Add normals to mesh. Function work similar to \ref MeshGeometry_AddColor; + void MeshGeometry_AddNormal(aiMesh& pMesh, const std::list& pNormals, const bool pNormalPerVertex) const; + + /// Add texture coordinates to mesh. Function work similar to \ref MeshGeometry_AddColor; + void MeshGeometry_AddTexCoord(aiMesh& pMesh, const std::list& pCoordIdx, const std::list& pTexCoordIdx, + const std::list& pTexCoords) const; + + /// Add texture coordinates to mesh. Function work similar to \ref MeshGeometry_AddColor; + void MeshGeometry_AddTexCoord(aiMesh& pMesh, const std::list& pTexCoords) const; + + /// Create mesh. + /// \param [in] pCoordIdx - vertices indices divided by delimiter "-1". + /// \param [in] pVertices - vertices of mesh. + /// \return created mesh. + aiMesh* GeometryHelper_MakeMesh(const std::list& pCoordIdx, const std::list& pVertices) const; + + /***********************************************/ + /******** Functions: parse set private *********/ + /***********************************************/ + + /// Create node element with type "Node" in scene graph. That operation is needed when you enter to X3D group node + /// like , etc. When exiting from X3D group node(e.g. ) \ref ParseHelper_Node_Exit must + /// be called. + /// \param [in] pStatic - flag: if true then static node is created(e.g. ). + void ParseHelper_Group_Begin(const bool pStatic = false); + + /// Make pNode as current and enter deeper for parsing child nodes. At end \ref ParseHelper_Node_Exit must be called. + /// \param [in] pNode - new current node. + void ParseHelper_Node_Enter(CX3DImporter_NodeElement* pNode); + + /// This function must be called when exiting from X3D group node(e.g. ). \ref ParseHelper_Group_Begin. + void ParseHelper_Node_Exit(); + + /// Attribute values of floating point types can take form ".x"(without leading zero). irrXMLReader can not read this form of values and it + /// must be converted to right form - "0.xxx". + /// \param [in] pInStr - pointer to input string which can contain incorrect form of values. + /// \param [out[ pOutString - output string with right form of values. + void ParseHelper_FixTruncatedFloatString(const char* pInStr, std::string& pOutString); + + /// Check if current node has nodes of type X3DMetadataObject. Why we must do it? Because X3DMetadataObject can be in any non-empty X3DNode. + /// Meaning that X3DMetadataObject can be in any non-empty node in . + /// \return true - if metadata node are found and parsed, false - metadata not found. + bool ParseHelper_CheckRead_X3DMetadataObject(); + + /// Check if current node has nodes of type X3DGeometricPropertyNode. X3DGeometricPropertyNode + /// X3DGeometricPropertyNode inheritors: + /// , , , , , , , , + /// , , , , , + /// , , . + /// \return true - if nodes are found and parsed, false - nodes not found. + bool ParseHelper_CheckRead_X3DGeometricPropertyNode(); + + /// Parse node of the file. + void ParseNode_Root(); + + /// Parse node of the file. + void ParseNode_Head(); + + /// Parse node of the file. + void ParseNode_Scene(); + + /// Parse child nodes of node. + /// \param [in] pNodeName - parsed node name. Must be set because that function is general and name needed for checking the end + /// and error reporing. + /// \param [in] pParentElement - parent metadata element. + void ParseNode_Metadata(CX3DImporter_NodeElement* pParentElement, const std::string& pNodeName); + + /// Parse node of the file. + void ParseNode_MetadataBoolean(); + + /// Parse node of the file. + void ParseNode_MetadataDouble(); + + /// Parse node of the file. + void ParseNode_MetadataFloat(); + + /// Parse node of the file. + void ParseNode_MetadataInteger(); + + /// Parse node of the file. + void ParseNode_MetadataSet(); + + /// \fn void ParseNode_MetadataString() + /// Parse node of the file. + void ParseNode_MetadataString(); + + /// Parse node of the file. + void ParseNode_Geometry2D_Arc2D(); + + /// Parse node of the file. + void ParseNode_Geometry2D_ArcClose2D(); + + /// Parse node of the file. + void ParseNode_Geometry2D_Circle2D(); + + /// Parse node of the file. + void ParseNode_Geometry2D_Disk2D(); + + /// Parse node of the file. + void ParseNode_Geometry2D_Polyline2D(); + + /// Parse node of the file. + void ParseNode_Geometry2D_Polypoint2D(); + + /// Parse node of the file. + void ParseNode_Geometry2D_Rectangle2D(); + + /// Parse node of the file. + void ParseNode_Geometry2D_TriangleSet2D(); + + /// Parse node of the file. + void ParseNode_Geometry3D_Box(); + + /// Parse node of the file. + void ParseNode_Geometry3D_Cone(); + + /// Parse node of the file. + void ParseNode_Geometry3D_Cylinder(); + + /// Parse node of the file. + void ParseNode_Geometry3D_ElevationGrid(); + + /// Parse node of the file. + void ParseNode_Geometry3D_Extrusion(); + + /// Parse node of the file. + void ParseNode_Geometry3D_IndexedFaceSet(); + + /// Parse node of the file. + void ParseNode_Geometry3D_Sphere(); + + /// Parse node of the file. And create new node in scene graph. + void ParseNode_Grouping_Group(); + + /// Doing actions at an exit from . Walk up in scene graph. + void ParseNode_Grouping_GroupEnd(); + + /// Parse node of the file. And create new node in scene graph. + void ParseNode_Grouping_StaticGroup(); + + /// Doing actions at an exit from . Walk up in scene graph. + void ParseNode_Grouping_StaticGroupEnd(); + + /// Parse node of the file. And create new node in scene graph. + void ParseNode_Grouping_Switch(); + + /// Doing actions at an exit from . Walk up in scene graph. + void ParseNode_Grouping_SwitchEnd(); + + /// Parse node of the file. And create new node in scene graph. + void ParseNode_Grouping_Transform(); + + /// Doing actions at an exit from . Walk up in scene graph. + void ParseNode_Grouping_TransformEnd(); + + /// Parse node of the file. + void ParseNode_Rendering_Color(); + + /// Parse node of the file. + void ParseNode_Rendering_ColorRGBA(); + + /// Parse node of the file. + void ParseNode_Rendering_Coordinate(); + + /// Parse node of the file. + void ParseNode_Rendering_Normal(); + + /// Parse node of the file. + void ParseNode_Rendering_IndexedLineSet(); + + /// Parse node of the file. + void ParseNode_Rendering_IndexedTriangleFanSet(); + + /// Parse node of the file. + void ParseNode_Rendering_IndexedTriangleSet(); + + /// Parse node of the file. + void ParseNode_Rendering_IndexedTriangleStripSet(); + + /// Parse node of the file. + void ParseNode_Rendering_LineSet(); + + /// Parse node of the file. + void ParseNode_Rendering_PointSet(); + + /// Parse node of the file. + void ParseNode_Rendering_TriangleFanSet(); + + /// Parse node of the file. + void ParseNode_Rendering_TriangleSet(); + + /// Parse node of the file. + void ParseNode_Rendering_TriangleStripSet(); + + /// Parse node of the file. + void ParseNode_Texturing_ImageTexture(); + + /// Parse node of the file. + void ParseNode_Texturing_TextureCoordinate(); + + /// Parse node of the file. + void ParseNode_Texturing_TextureTransform(); + + /// Parse node of the file. + void ParseNode_Shape_Shape(); + + /// Parse node of the file. + void ParseNode_Shape_Appearance(); + + /// Parse node of the file. + void ParseNode_Shape_Material(); + + /// Parse node of the file. + void ParseNode_Networking_Inline(); + + /// Parse node of the file. + void ParseNode_Lighting_DirectionalLight(); + + /// Parse node of the file. + void ParseNode_Lighting_PointLight(); + + /// Parse node of the file. + void ParseNode_Lighting_SpotLight(); + +private: + /***********************************************/ + /******************** Types ********************/ + /***********************************************/ + + /***********************************************/ + /****************** Constants ******************/ + /***********************************************/ + static const aiImporterDesc Description; + + /***********************************************/ + /****************** Variables ******************/ + /***********************************************/ + CX3DImporter_NodeElement* NodeElement_Cur;///< Current element. + irr::io::IrrXMLReader* mReader;///< Pointer to XML-reader object + std::string mFileDir; +};// class X3DImporter + +}// namespace Assimp + +#endif // INCLUDED_AI_X3D_IMPORTER_H diff --git a/code/X3DImporter_Geometry2D.cpp b/code/X3DImporter_Geometry2D.cpp new file mode 100644 index 000000000..bfa1834ec --- /dev/null +++ b/code/X3DImporter_Geometry2D.cpp @@ -0,0 +1,520 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +/// \file X3DImporter_Geometry2D.cpp +/// \brief Parsing data from nodes of "Geometry2D" set of X3D. +/// \date 2015-2016 +/// \author smal.root@gmail.com + +#ifndef ASSIMP_BUILD_NO_X3D_IMPORTER + +#include "X3DImporter.hpp" +#include "X3DImporter_Node.hpp" +#include "X3DImporter_Macro.hpp" + +namespace Assimp +{ + +// +// The Arc2D node specifies a linear circular arc whose center is at (0,0) and whose angles are measured starting at the positive x-axis and sweeping +// towards the positive y-axis. The radius field specifies the radius of the circle of which the arc is a portion. The arc extends from the startAngle +// counterclockwise to the endAngle. The values of startAngle and endAngle shall be in the range [-2pi, 2pi] radians (or the equivalent if a different +// angle base unit has been specified). If startAngle and endAngle have the same value, a circle is specified. +void X3DImporter::ParseNode_Geometry2D_Arc2D() +{ + std::string def, use; + float endAngle = AI_MATH_HALF_PI_F; + float radius = 1; + float startAngle = 0; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("endAngle", endAngle, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_RET("radius", radius, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_RET("startAngle", startAngle, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Arc2D, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Geometry2D(CX3DImporter_NodeElement::ENET_Arc2D, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + // create point list of geometry object and convert it to line set. + std::list tlist; + + GeometryHelper_Make_Arc2D(startAngle, endAngle, radius, 10, tlist);///TODO: IME - AI_CONFIG for NumSeg + GeometryHelper_Extend_PointToLine(tlist, ((CX3DImporter_NodeElement_Geometry2D*)ne)->Vertices); + ((CX3DImporter_NodeElement_Geometry2D*)ne)->NumIndices = 2; + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "Arc2D"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +// The ArcClose node specifies a portion of a circle whose center is at (0,0) and whose angles are measured starting at the positive x-axis and sweeping +// towards the positive y-axis. The end points of the arc specified are connected as defined by the closureType field. The radius field specifies the radius +// of the circle of which the arc is a portion. The arc extends from the startAngle counterclockwise to the endAngle. The value of radius shall be greater +// than zero. The values of startAngle and endAngle shall be in the range [-2pi, 2pi] radians (or the equivalent if a different default angle base unit has +// been specified). If startAngle and endAngle have the same value, a circle is specified and closureType is ignored. If the absolute difference between +// startAngle and endAngle is greater than or equal to 2pi, a complete circle is produced with no chord or radial line(s) drawn from the center. +// A closureType of "PIE" connects the end point to the start point by defining two straight line segments first from the end point to the center and then +// the center to the start point. A closureType of "CHORD" connects the end point to the start point by defining a straight line segment from the end point +// to the start point. Textures are applied individually to each face of the ArcClose2D. On the front (+Z) and back (-Z) faces of the ArcClose2D, when +// viewed from the +Z-axis, the texture is mapped onto each face with the same orientation as if the image were displayed normally in 2D. +void X3DImporter::ParseNode_Geometry2D_ArcClose2D() +{ + std::string def, use; + std::string closureType("PIE"); + float endAngle = AI_MATH_HALF_PI_F; + float radius = 1; + bool solid = false; + float startAngle = 0; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("closureType", closureType, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_RET("endAngle", endAngle, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_RET("radius", radius, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_RET("solid", solid, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("startAngle", startAngle, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_ArcClose2D, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Geometry2D(CX3DImporter_NodeElement::ENET_ArcClose2D, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + ((CX3DImporter_NodeElement_Geometry2D*)ne)->Solid = solid; + // create point list of geometry object. + GeometryHelper_Make_Arc2D(startAngle, endAngle, radius, 10, ((CX3DImporter_NodeElement_Geometry2D*)ne)->Vertices);///TODO: IME - AI_CONFIG for NumSeg + // add chord or two radiuses only if not a circle was defined + if(!((std::fabs(endAngle - startAngle) >= AI_MATH_TWO_PI_F) || (endAngle == startAngle))) + { + std::list& vlist = ((CX3DImporter_NodeElement_Geometry2D*)ne)->Vertices;// just short alias. + + if((closureType == "PIE") || (closureType == "\"PIE\"")) + vlist.push_back(aiVector3D(0, 0, 0));// center point - first radial line + else if((closureType != "CHORD") && (closureType != "\"CHORD\"")) + Throw_IncorrectAttrValue("closureType"); + + vlist.push_back(*vlist.begin());// arc first point - chord from first to last point of arc(if CHORD) or second radial line(if PIE). + } + + ((CX3DImporter_NodeElement_Geometry2D*)ne)->NumIndices = ((CX3DImporter_NodeElement_Geometry2D*)ne)->Vertices.size(); + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "ArcClose2D"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +void X3DImporter::ParseNode_Geometry2D_Circle2D() +{ + std::string def, use; + float radius = 1; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("radius", radius, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Circle2D, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Geometry2D(CX3DImporter_NodeElement::ENET_Circle2D, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + // create point list of geometry object and convert it to line set. + std::list tlist; + + GeometryHelper_Make_Arc2D(0, 0, radius, 10, tlist);///TODO: IME - AI_CONFIG for NumSeg + GeometryHelper_Extend_PointToLine(tlist, ((CX3DImporter_NodeElement_Geometry2D*)ne)->Vertices); + ((CX3DImporter_NodeElement_Geometry2D*)ne)->NumIndices = 2; + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "Circle2D"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +// The Disk2D node specifies a circular disk which is centred at (0, 0) in the local coordinate system. The outerRadius field specifies the radius of the +// outer dimension of the Disk2D. The innerRadius field specifies the inner dimension of the Disk2D. The value of outerRadius shall be greater than zero. +// The value of innerRadius shall be greater than or equal to zero and less than or equal to outerRadius. If innerRadius is zero, the Disk2D is completely +// filled. Otherwise, the area within the innerRadius forms a hole in the Disk2D. If innerRadius is equal to outerRadius, a solid circular line shall +// be drawn using the current line properties. Textures are applied individually to each face of the Disk2D. On the front (+Z) and back (-Z) faces of +// the Disk2D, when viewed from the +Z-axis, the texture is mapped onto each face with the same orientation as if the image were displayed normally in 2D. +void X3DImporter::ParseNode_Geometry2D_Disk2D() +{ + std::string def, use; + float innerRadius = 0; + float outerRadius = 1; + bool solid = false; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("innerRadius", innerRadius, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_RET("outerRadius", outerRadius, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_RET("solid", solid, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Disk2D, ne); + } + else + { + std::list tlist_o, tlist_i; + + if(innerRadius > outerRadius) Throw_IncorrectAttrValue("innerRadius"); + + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Geometry2D(CX3DImporter_NodeElement::ENET_Disk2D, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + // create point list of geometry object. + ///TODO: IME - AI_CONFIG for NumSeg + GeometryHelper_Make_Arc2D(0, 0, outerRadius, 10, tlist_o);// outer circle + if(innerRadius == 0.0f) + {// make filled disk + // in tlist_o we already have points of circle. just copy it and sign as polygon. + ((CX3DImporter_NodeElement_Geometry2D*)ne)->Vertices = tlist_o; + ((CX3DImporter_NodeElement_Geometry2D*)ne)->NumIndices = tlist_o.size(); + } + else if(innerRadius == outerRadius) + {// make circle + // in tlist_o we already have points of circle. convert it to line set. + GeometryHelper_Extend_PointToLine(tlist_o, ((CX3DImporter_NodeElement_Geometry2D*)ne)->Vertices); + ((CX3DImporter_NodeElement_Geometry2D*)ne)->NumIndices = 2; + } + else + {// make disk + std::list& vlist = ((CX3DImporter_NodeElement_Geometry2D*)ne)->Vertices;// just short alias. + + GeometryHelper_Make_Arc2D(0, 0, innerRadius, 10, tlist_i);// inner circle + // + // create quad list from two point lists + // + if(tlist_i.size() < 2) throw DeadlyImportError("Disk2D. Not enough points for creating quad list.");// tlist_i and tlist_o has equal size. + + // add all quads except last + for(std::list::iterator it_i = tlist_i.begin(), it_o = tlist_o.begin(); it_i != tlist_i.end();) + { + // do not forget - CCW direction + vlist.push_back(*it_i++);// 1st point + vlist.push_back(*it_o++);// 2nd point + vlist.push_back(*it_o);// 3rd point + vlist.push_back(*it_i);// 4th point + } + + // add last quad + vlist.push_back(*tlist_i.end());// 1st point + vlist.push_back(*tlist_o.end());// 2nd point + vlist.push_back(*tlist_o.begin());// 3rd point + vlist.push_back(*tlist_o.begin());// 4th point + + ((CX3DImporter_NodeElement_Geometry2D*)ne)->NumIndices = 4; + } + + ((CX3DImporter_NodeElement_Geometry2D*)ne)->Solid = solid; + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "Disk2D"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +void X3DImporter::ParseNode_Geometry2D_Polyline2D() +{ + std::string def, use; + std::list lineSegments; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_REF("lineSegments", lineSegments, XML_ReadNode_GetAttrVal_AsListVec2f); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Polyline2D, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Geometry2D(CX3DImporter_NodeElement::ENET_Polyline2D, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + // + // convert read point list of geometry object to line set. + // + std::list tlist; + + // convert vec2 to vec3 + for(std::list::iterator it2 = lineSegments.begin(); it2 != lineSegments.end(); it2++) tlist.push_back(aiVector3D(it2->x, it2->y, 0)); + + // convert point set to line set + GeometryHelper_Extend_PointToLine(tlist, ((CX3DImporter_NodeElement_Geometry2D*)ne)->Vertices); + ((CX3DImporter_NodeElement_Geometry2D*)ne)->NumIndices = 2; + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "Polyline2D"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +void X3DImporter::ParseNode_Geometry2D_Polypoint2D() +{ + std::string def, use; + std::list point; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_REF("point", point, XML_ReadNode_GetAttrVal_AsListVec2f); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Polypoint2D, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Geometry2D(CX3DImporter_NodeElement::ENET_Polypoint2D, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + // convert vec2 to vec3 + for(std::list::iterator it2 = point.begin(); it2 != point.end(); it2++) + { + ((CX3DImporter_NodeElement_Geometry2D*)ne)->Vertices.push_back(aiVector3D(it2->x, it2->y, 0)); + } + + ((CX3DImporter_NodeElement_Geometry2D*)ne)->NumIndices = 1; + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "Polypoint2D"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +void X3DImporter::ParseNode_Geometry2D_Rectangle2D() +{ + std::string def, use; + aiVector2D size(2, 2); + bool solid = false; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_REF("size", size, XML_ReadNode_GetAttrVal_AsVec2f); + MACRO_ATTRREAD_CHECK_RET("solid", solid, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Rectangle2D, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Geometry2D(CX3DImporter_NodeElement::ENET_Rectangle2D, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + float x1 = -size.x / 2.0f; + float x2 = size.x / 2.0f; + float y1 = -size.y / 2.0f; + float y2 = size.y / 2.0f; + std::list& vlist = ((CX3DImporter_NodeElement_Geometry2D*)ne)->Vertices;// just short alias. + + vlist.push_back(aiVector3D(x2, y1, 0));// 1st point + vlist.push_back(aiVector3D(x2, y2, 0));// 2nd point + vlist.push_back(aiVector3D(x1, y2, 0));// 3rd point + vlist.push_back(aiVector3D(x1, y1, 0));// 4th point + ((CX3DImporter_NodeElement_Geometry2D*)ne)->Solid = solid; + ((CX3DImporter_NodeElement_Geometry2D*)ne)->NumIndices = 4; + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "Rectangle2D"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +void X3DImporter::ParseNode_Geometry2D_TriangleSet2D() +{ + std::string def, use; + bool solid = false; + std::list vertices; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_REF("vertices", vertices, XML_ReadNode_GetAttrVal_AsListVec2f); + MACRO_ATTRREAD_CHECK_RET("solid", solid, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_TriangleSet2D, ne); + } + else + { + if(vertices.size() % 3) throw DeadlyImportError("TriangleSet2D. Not enough points for defining triangle."); + + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Geometry2D(CX3DImporter_NodeElement::ENET_TriangleSet2D, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + // convert vec2 to vec3 + for(std::list::iterator it2 = vertices.begin(); it2 != vertices.end(); it2++) + { + ((CX3DImporter_NodeElement_Geometry2D*)ne)->Vertices.push_back(aiVector3D(it2->x, it2->y, 0)); + } + + ((CX3DImporter_NodeElement_Geometry2D*)ne)->Solid = solid; + ((CX3DImporter_NodeElement_Geometry2D*)ne)->NumIndices = 3; + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "TriangleSet2D"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +}// namespace Assimp + +#endif // !ASSIMP_BUILD_NO_X3D_IMPORTER diff --git a/code/X3DImporter_Geometry3D.cpp b/code/X3DImporter_Geometry3D.cpp new file mode 100644 index 000000000..252593163 --- /dev/null +++ b/code/X3DImporter_Geometry3D.cpp @@ -0,0 +1,991 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +/// \file X3DImporter_Geometry3D.cpp +/// \brief Parsing data from nodes of "Geometry3D" set of X3D. +/// \date 2015-2016 +/// \author smal.root@gmail.com + +#ifndef ASSIMP_BUILD_NO_X3D_IMPORTER + +#include "X3DImporter.hpp" +#include "X3DImporter_Macro.hpp" + +// Header files, Assimp. +#include "StandardShapes.h" + +namespace Assimp +{ + +// +// The Box node specifies a rectangular parallelepiped box centred at (0, 0, 0) in the local coordinate system and aligned with the local coordinate axes. +// By default, the box measures 2 units in each dimension, from -1 to +1. The size field specifies the extents of the box along the X-, Y-, and Z-axes +// respectively and each component value shall be greater than zero. +void X3DImporter::ParseNode_Geometry3D_Box() +{ + std::string def, use; + bool solid = true; + aiVector3D size(2, 2, 2); + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_REF("size", size, XML_ReadNode_GetAttrVal_AsVec3f); + MACRO_ATTRREAD_CHECK_RET("solid", solid, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Box, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Geometry3D(CX3DImporter_NodeElement::ENET_Box, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + GeometryHelper_MakeQL_RectParallelepiped(size, ((CX3DImporter_NodeElement_Geometry3D*)ne)->Vertices);// get quad list + ((CX3DImporter_NodeElement_Geometry3D*)ne)->Solid = solid; + ((CX3DImporter_NodeElement_Geometry3D*)ne)->NumIndices = 4; + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "Box"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +void X3DImporter::ParseNode_Geometry3D_Cone() +{ + std::string use, def; + bool bottom = true; + float bottomRadius = 1; + float height = 2; + bool side = true; + bool solid = true; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("solid", solid, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("side", side, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("bottom", bottom, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("height", height, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_RET("bottomRadius", bottomRadius, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Cone, ne); + } + else + { + const unsigned int tess = 30;///TODO: IME tesselation factor thru ai_property + + std::vector tvec;// temp array for vertices. + + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Geometry3D(CX3DImporter_NodeElement::ENET_Cone, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + // make cone or parts according to flags. + if(side) + { + StandardShapes::MakeCone(height, 0, bottomRadius, tess, tvec, !bottom); + } + else if(bottom) + { + StandardShapes::MakeCircle(bottomRadius, tess, tvec); + height = -(height / 2); + for(std::vector::iterator it = tvec.begin(); it != tvec.end(); it++) it->y = height;// y - because circle made in oXZ. + } + + // copy data from temp array + for(std::vector::iterator it = tvec.begin(); it != tvec.end(); it++) ((CX3DImporter_NodeElement_Geometry3D*)ne)->Vertices.push_back(*it); + + ((CX3DImporter_NodeElement_Geometry3D*)ne)->Solid = solid; + ((CX3DImporter_NodeElement_Geometry3D*)ne)->NumIndices = 3; + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "Cone"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +void X3DImporter::ParseNode_Geometry3D_Cylinder() +{ + std::string use, def; + bool bottom = true; + float height = 2; + float radius = 1; + bool side = true; + bool solid = true; + bool top = true; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("radius", radius, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_RET("solid", solid, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("bottom", bottom, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("top", top, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("side", side, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("height", height, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Cylinder, ne); + } + else + { + const unsigned int tess = 30;///TODO: IME tesselation factor thru ai_property + + std::vector tside;// temp array for vertices of side. + std::vector tcir;// temp array for vertices of circle. + + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Geometry3D(CX3DImporter_NodeElement::ENET_Cylinder, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + // make cilynder or parts according to flags. + if(side) StandardShapes::MakeCone(height, radius, radius, tess, tside, true); + + height /= 2;// height defined for whole cylinder, when creating top and bottom circle we are using just half of height. + if(top || bottom) StandardShapes::MakeCircle(radius, tess, tcir); + // copy data from temp arrays + std::list& vlist = ((CX3DImporter_NodeElement_Geometry3D*)ne)->Vertices;// just short alias. + + for(std::vector::iterator it = tside.begin(); it != tside.end(); it++) vlist.push_back(*it); + + if(top) + { + for(std::vector::iterator it = tcir.begin(); it != tcir.end(); it++) + { + (*it).y = height;// y - because circle made in oXZ. + vlist.push_back(*it); + } + }// if(top) + + if(bottom) + { + for(std::vector::iterator it = tcir.begin(); it != tcir.end(); it++) + { + (*it).y = -height;// y - because circle made in oXZ. + vlist.push_back(*it); + } + }// if(top) + + ((CX3DImporter_NodeElement_Geometry3D*)ne)->Solid = solid; + ((CX3DImporter_NodeElement_Geometry3D*)ne)->NumIndices = 3; + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "Cylinder"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +// +// ColorNormalTexCoordContentModel can contain Color (or ColorRGBA), Normal and TextureCoordinate, in any order. No more than one instance of any single +// node type is allowed. A ProtoInstance node (with the proper node type) can be substituted for any node in this content model. +// +// The ElevationGrid node specifies a uniform rectangular grid of varying height in the Y=0 plane of the local coordinate system. The geometry is described +// by a scalar array of height values that specify the height of a surface above each point of the grid. The xDimension and zDimension fields indicate +// the number of elements of the grid height array in the X and Z directions. Both xDimension and zDimension shall be greater than or equal to zero. +// If either the xDimension or the zDimension is less than two, the ElevationGrid contains no quadrilaterals. +void X3DImporter::ParseNode_Geometry3D_ElevationGrid() +{ + std::string use, def; + bool ccw = true; + bool colorPerVertex = true; + float creaseAngle = 0; + std::list height; + bool normalPerVertex = true; + bool solid = true; + int32_t xDimension = 0; + float xSpacing = 1; + int32_t zDimension = 0; + float zSpacing = 1; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("solid", solid, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("ccw", ccw, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("colorPerVertex", colorPerVertex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("normalPerVertex", normalPerVertex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("creaseAngle", creaseAngle, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_REF("height", height, XML_ReadNode_GetAttrVal_AsListF); + MACRO_ATTRREAD_CHECK_RET("xDimension", xDimension, XML_ReadNode_GetAttrVal_AsI32); + MACRO_ATTRREAD_CHECK_RET("xSpacing", xSpacing, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_RET("zDimension", zDimension, XML_ReadNode_GetAttrVal_AsI32); + MACRO_ATTRREAD_CHECK_RET("zSpacing", zSpacing, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_ElevationGrid, ne); + } + else + { + if((xSpacing == 0.0f) || (zSpacing == 0.0f)) throw DeadlyImportError("Spacing in must be grater than zero."); + if((xDimension <= 0) || (zDimension <= 0)) throw DeadlyImportError("Dimension in must be grater than zero."); + if((size_t)(xDimension * zDimension) != height.size()) Throw_IncorrectAttrValue("Heights count must be equal to \"xDimension * zDimension\""); + + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_ElevationGrid(CX3DImporter_NodeElement::ENET_ElevationGrid, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + CX3DImporter_NodeElement_ElevationGrid& grid_alias = *((CX3DImporter_NodeElement_ElevationGrid*)ne);// create alias for conveience + + {// create grid vertices list + std::list::const_iterator he_it = height.begin(); + + for(int32_t zi = 0; zi < zDimension; zi++)// rows + { + for(int32_t xi = 0; xi < xDimension; xi++)// columns + { + aiVector3D tvec(xSpacing * xi, *he_it, zSpacing * zi); + + grid_alias.Vertices.push_back(tvec); + he_it++; + } + } + }// END: create grid vertices list + // + // create faces list. In "coordIdx" format + // + // check if we have quads + if((xDimension < 2) || (zDimension < 2))// only one element in dimension is set, create line set. + { + ((CX3DImporter_NodeElement_ElevationGrid*)ne)->NumIndices = 2;// will be holded as line set. + for(size_t i = 0, i_e = (grid_alias.Vertices.size() - 1); i < i_e; i++) + { + grid_alias.CoordIdx.push_back(i); + grid_alias.CoordIdx.push_back(i + 1); + grid_alias.CoordIdx.push_back(-1); + } + } + else// two or more elements in every dimension is set. create quad set. + { + ((CX3DImporter_NodeElement_ElevationGrid*)ne)->NumIndices = 4; + for(int32_t fzi = 0, fzi_e = (zDimension - 1); fzi < fzi_e; fzi++)// rows + { + for(int32_t fxi = 0, fxi_e = (xDimension - 1); fxi < fxi_e; fxi++)// columns + { + // points direction in face. + if(ccw) + { + // CCW: + // 3 2 + // 0 1 + grid_alias.CoordIdx.push_back((fzi + 1) * xDimension + fxi); + grid_alias.CoordIdx.push_back((fzi + 1) * xDimension + (fxi + 1)); + grid_alias.CoordIdx.push_back(fzi * xDimension + (fxi + 1)); + grid_alias.CoordIdx.push_back(fzi * xDimension + fxi); + } + else + { + // CW: + // 0 1 + // 3 2 + grid_alias.CoordIdx.push_back(fzi * xDimension + fxi); + grid_alias.CoordIdx.push_back(fzi * xDimension + (fxi + 1)); + grid_alias.CoordIdx.push_back((fzi + 1) * xDimension + (fxi + 1)); + grid_alias.CoordIdx.push_back((fzi + 1) * xDimension + fxi); + }// if(ccw) else + + grid_alias.CoordIdx.push_back(-1); + }// for(int32_t fxi = 0, fxi_e = (xDimension - 1); fxi < fxi_e; fxi++) + }// for(int32_t fzi = 0, fzi_e = (zDimension - 1); fzi < fzi_e; fzi++) + }// if((xDimension < 2) || (zDimension < 2)) else + + grid_alias.ColorPerVertex = colorPerVertex; + grid_alias.NormalPerVertex = normalPerVertex; + grid_alias.CreaseAngle = creaseAngle; + grid_alias.Solid = solid; + // check for child nodes + if(!mReader->isEmptyElement()) + { + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("ElevationGrid"); + // check for X3DComposedGeometryNodes + if(XML_CheckNode_NameEqual("Color")) { ParseNode_Rendering_Color(); continue; } + if(XML_CheckNode_NameEqual("ColorRGBA")) { ParseNode_Rendering_ColorRGBA(); continue; } + if(XML_CheckNode_NameEqual("Normal")) { ParseNode_Rendering_Normal(); continue; } + if(XML_CheckNode_NameEqual("TextureCoordinate")) { ParseNode_Texturing_TextureCoordinate(); continue; } + // check for X3DMetadataObject + if(!ParseHelper_CheckRead_X3DMetadataObject()) XML_CheckNode_SkipUnsupported("ElevationGrid"); + + MACRO_NODECHECK_LOOPEND("ElevationGrid"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + }// if(!mReader->isEmptyElement()) else + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +template +static void GeometryHelper_Extrusion_CurveIsClosed(std::vector& pCurve, const bool pDropTail, const bool pRemoveLastPoint, bool& pCurveIsClosed) +{ + size_t cur_sz = pCurve.size(); + + pCurveIsClosed = false; + // for curve with less than four points checking is have no sense, + if(cur_sz < 4) return; + + for(size_t s = 3, s_e = cur_sz; s < s_e; s++) + { + // search for first point of duplicated part. + if(pCurve[0] == pCurve[s]) + { + bool found = true; + + // check if tail(indexed by b2) is duplicate of head(indexed by b1). + for(size_t b1 = 1, b2 = (s + 1); b2 < cur_sz; b1++, b2++) + { + if(pCurve[b1] != pCurve[b2]) + {// points not match: clear flag and break loop. + found = false; + + break; + } + }// for(size_t b1 = 1, b2 = (s + 1); b2 < cur_sz; b1++, b2++) + + // if duplicate tail is found then drop or not it depending on flags. + if(found) + { + pCurveIsClosed = true; + if(pDropTail) + { + if(!pRemoveLastPoint) s++;// prepare value for iterator's arithmetics. + + pCurve.erase(pCurve.begin() + s, pCurve.end());// remove tail + } + + break; + }// if(found) + }// if(pCurve[0] == pCurve[s]) + }// for(size_t s = 3, s_e = (cur_sz - 1); s < s_e; s++) +} + +static aiVector3D GeometryHelper_Extrusion_GetNextY(const size_t pSpine_PointIdx, const std::vector& pSpine, const bool pSpine_Closed) +{ + const size_t spine_idx_last = pSpine.size() - 1; + aiVector3D tvec; + + if((pSpine_PointIdx == 0) || (pSpine_PointIdx == spine_idx_last))// at first special cases + { + if(pSpine_Closed) + {// If the spine curve is closed: The SCP for the first and last points is the same and is found using (spine[1] − spine[n − 2]) to compute the Y-axis. + // As we even for closed spine curve last and first point in pSpine are not the same: duplicates(spine[n - 1] which are equivalent to spine[0]) + // in tail are removed. + // So, last point in pSpine is a spine[n - 2] + tvec = pSpine[1] - pSpine[spine_idx_last]; + } + else if(pSpine_PointIdx == 0) + {// The Y-axis used for the first point is the vector from spine[0] to spine[1] + tvec = pSpine[1] - pSpine[0]; + } + else + {// The Y-axis used for the last point it is the vector from spine[n−2] to spine[n−1]. In our case(see above about droping tail) spine[n - 1] is + // the spine[0]. + tvec = pSpine[spine_idx_last] - pSpine[spine_idx_last - 1]; + } + }// if((pSpine_PointIdx == 0) || (pSpine_PointIdx == spine_idx_last)) + else + {// For all points other than the first or last: The Y-axis for spine[i] is found by normalizing the vector defined by (spine[i+1] − spine[i−1]). + tvec = pSpine[pSpine_PointIdx + 1] - pSpine[pSpine_PointIdx - 1]; + }// if((pSpine_PointIdx == 0) || (pSpine_PointIdx == spine_idx_last)) else + + return tvec.Normalize(); +} + +static aiVector3D GeometryHelper_Extrusion_GetNextZ(const size_t pSpine_PointIdx, const std::vector& pSpine, const bool pSpine_Closed, + const aiVector3D pVecZ_Prev) +{ + const aiVector3D zero_vec(0); + const size_t spine_idx_last = pSpine.size() - 1; + + aiVector3D tvec; + + // at first special cases + if(pSpine.size() < 3)// spine have not enough points for vector calculations. + { + tvec.Set(0, 0, 1); + } + else if(pSpine_PointIdx == 0)// special case: first point + { + if(pSpine_Closed)// for calculating use previous point in curve s[n - 2]. In list it's a last point, because point s[n - 1] was removed as duplicate. + { + tvec = (pSpine[1] - pSpine[0]) ^ (pSpine[spine_idx_last] - pSpine[0]); + } + else // for not closed curve first and next point(s[0] and s[1]) has the same vector Z. + { + bool found = false; + + // As said: "If the Z-axis of the first point is undefined (because the spine is not closed and the first two spine segments are collinear) + // then the Z-axis for the first spine point with a defined Z-axis is used." + // Walk thru spine and find Z. + for(size_t next_point = 2; (next_point <= spine_idx_last) && !found; next_point++) + { + // (pSpine[2] - pSpine[1]) ^ (pSpine[0] - pSpine[1]) + tvec = (pSpine[next_point] - pSpine[next_point - 1]) ^ (pSpine[next_point - 2] - pSpine[next_point - 1]); + found = !tvec.Equal(zero_vec); + } + + // if entire spine are collinear then use OZ axis. + if(!found) tvec.Set(0, 0, 1); + }// if(pSpine_Closed) else + }// else if(pSpine_PointIdx == 0) + else if(pSpine_PointIdx == spine_idx_last)// special case: last point + { + if(pSpine_Closed) + {// do not forget that real last point s[n - 1] is removed as duplicated. And in this case we are calculating vector Z for point s[n - 2]. + tvec = (pSpine[0] - pSpine[pSpine_PointIdx]) ^ (pSpine[pSpine_PointIdx - 1] - pSpine[pSpine_PointIdx]); + // if taken spine vectors are collinear then use previous vector Z. + if(tvec.Equal(zero_vec)) tvec = pVecZ_Prev; + } + else + {// vector Z for last point of not closed curve is previous vector Z. + tvec = pVecZ_Prev; + } + } + else// regular point + { + tvec = (pSpine[pSpine_PointIdx + 1] - pSpine[pSpine_PointIdx]) ^ (pSpine[pSpine_PointIdx - 1] - pSpine[pSpine_PointIdx]); + // if taken spine vectors are collinear then use previous vector Z. + if(tvec.Equal(zero_vec)) tvec = pVecZ_Prev; + } + + // After determining the Z-axis, its dot product with the Z-axis of the previous spine point is computed. If this value is negative, the Z-axis + // is flipped (multiplied by −1). + if((tvec * pVecZ_Prev) < 0) tvec = -tvec; + + return tvec.Normalize(); +} + +// +void X3DImporter::ParseNode_Geometry3D_Extrusion() +{ + std::string use, def; + bool beginCap = true; + bool ccw = true; + bool convex = true; + float creaseAngle = 0; + std::vector crossSection; + bool endCap = true; + std::vector orientation; + std::vector scale; + bool solid = true; + std::vector spine; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("beginCap", beginCap, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("ccw", ccw, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("convex", convex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("creaseAngle", creaseAngle, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_REF("crossSection", crossSection, XML_ReadNode_GetAttrVal_AsArrVec2f); + MACRO_ATTRREAD_CHECK_RET("endCap", endCap, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_REF("orientation", orientation, XML_ReadNode_GetAttrVal_AsArrF); + MACRO_ATTRREAD_CHECK_REF("scale", scale, XML_ReadNode_GetAttrVal_AsArrVec2f); + MACRO_ATTRREAD_CHECK_RET("solid", solid, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_REF("spine", spine, XML_ReadNode_GetAttrVal_AsArrVec3f); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Extrusion, ne); + } + else + { + // + // check if default values must be assigned + // + if(spine.size() == 0) + { + spine.resize(2); + spine[0].Set(0, 0, 0), spine[1].Set(0, 1, 0); + } + else if(spine.size() == 1) + { + throw DeadlyImportError("ParseNode_Geometry3D_Extrusion. Spine must have at least two points."); + } + + if(crossSection.size() == 0) + { + crossSection.resize(5); + crossSection[0].Set(1, 1), crossSection[1].Set(1, -1), crossSection[2].Set(-1, -1), crossSection[3].Set(-1, 1), crossSection[4].Set(1, 1); + } + + {// orientation + size_t ori_size = orientation.size() / 4; + + if(ori_size < spine.size()) + { + float add_ori[4];// values that will be added + + if(ori_size == 1)// if "orientation" has one element(means one MFRotation with four components) then use it value for all spine points. + { + add_ori[0] = orientation[0], add_ori[1] = orientation[1], add_ori[2] = orientation[2], add_ori[3] = orientation[3]; + } + else// else - use default values + { + add_ori[0] = 0, add_ori[1] = 0, add_ori[2] = 1, add_ori[3] = 0; + } + + orientation.reserve(spine.size() * 4); + for(size_t i = 0, i_e = (spine.size() - ori_size); i < i_e; i++) + orientation.push_back(add_ori[0]), orientation.push_back(add_ori[1]), orientation.push_back(add_ori[2]), orientation.push_back(add_ori[3]); + } + + if(orientation.size() % 4) throw DeadlyImportError("Attribute \"orientation\" in must has multiple four quantity of numbers."); + }// END: orientation + + {// scale + if(scale.size() < spine.size()) + { + aiVector2D add_sc; + + if(scale.size() == 1)// if "scale" has one element then use it value for all spine points. + add_sc = scale[0]; + else// else - use default values + add_sc.Set(1, 1); + + scale.reserve(spine.size()); + for(size_t i = 0, i_e = (spine.size() - scale.size()); i < i_e; i++) scale.push_back(add_sc); + } + }// END: scale + // + // create and if needed - define new geometry object. + // + ne = new CX3DImporter_NodeElement_IndexedSet(CX3DImporter_NodeElement::ENET_Extrusion, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + CX3DImporter_NodeElement_IndexedSet& ext_alias = *((CX3DImporter_NodeElement_IndexedSet*)ne);// create alias for conveience + // assign part of input data + ext_alias.CCW = ccw; + ext_alias.Convex = convex; + ext_alias.CreaseAngle = creaseAngle; + ext_alias.Solid = solid; + + // + // How we done it at all? + // 1. At first we will calculate array of basises for every point in spine(look SCP in ISO-dic). Also "orientation" vector + // are applied vor every basis. + // 2. After that we can create array of point sets: which are scaled, transfered to basis of relative basis and at final translated to real position + // using relative spine point. + // 3. Next step is creating CoordIdx array(do not forget "-1" delimiter). While creating CoordIdx also created faces for begin and end caps, if + // needed. While createing CootdIdx is taking in account CCW flag. + // 4. The last step: create Vertices list. + // + bool spine_closed;// flag: true if spine curve is closed. + bool cross_closed;// flag: true if cross curve is closed. + std::vector basis_arr;// array of basises. ROW_a - X, ROW_b - Y, ROW_c - Z. + std::vector > pointset_arr;// array of point sets: cross curves. + + // detect closed curves + GeometryHelper_Extrusion_CurveIsClosed(crossSection, true, true, cross_closed);// true - drop tail, true - remove duplicate end. + GeometryHelper_Extrusion_CurveIsClosed(spine, true, true, spine_closed);// true - drop tail, true - remove duplicate end. + // If both cap are requested and spine curve is closed then we can make only one cap. Because second cap will be the same surface. + if(spine_closed) + { + beginCap |= endCap; + endCap = false; + } + + {// 1. Calculate array of basises. + aiMatrix4x4 rotmat; + aiVector3D vecX(0), vecY(0), vecZ(0); + + basis_arr.resize(spine.size()); + for(size_t i = 0, i_e = spine.size(); i < i_e; i++) + { + aiVector3D tvec; + + // get axises of basis. + vecY = GeometryHelper_Extrusion_GetNextY(i, spine, spine_closed); + vecZ = GeometryHelper_Extrusion_GetNextZ(i, spine, spine_closed, vecZ); + vecX = (vecY ^ vecZ).Normalize(); + // get rotation matrix and apply "orientation" to basis + aiMatrix4x4::Rotation(orientation[i * 4 + 3], aiVector3D(orientation[i * 4], orientation[i * 4 + 1], orientation[i * 4 + 2]), rotmat); + tvec = vecX, tvec *= rotmat, basis_arr[i].a1 = tvec.x, basis_arr[i].a2 = tvec.y, basis_arr[i].a3 = tvec.z; + tvec = vecY, tvec *= rotmat, basis_arr[i].b1 = tvec.x, basis_arr[i].b2 = tvec.y, basis_arr[i].b3 = tvec.z; + tvec = vecZ, tvec *= rotmat, basis_arr[i].c1 = tvec.x, basis_arr[i].c2 = tvec.y, basis_arr[i].c3 = tvec.z; + }// for(size_t i = 0, i_e = spine.size(); i < i_e; i++) + }// END: 1. Calculate array of basises + + {// 2. Create array of point sets. + aiMatrix4x4 scmat; + std::vector tcross(crossSection.size()); + + pointset_arr.resize(spine.size()); + for(size_t spi = 0, spi_e = spine.size(); spi < spi_e; spi++) + { + aiVector3D tc23vec; + + tc23vec.Set(scale[spi].x, 0, scale[spi].y); + aiMatrix4x4::Scaling(tc23vec, scmat); + for(size_t cri = 0, cri_e = crossSection.size(); cri < cri_e; cri++) + { + aiVector3D tvecX, tvecY, tvecZ; + + tc23vec.Set(crossSection[cri].x, 0, crossSection[cri].y); + // apply scaling to point + tcross[cri] = scmat * tc23vec; + // + // transfer point to new basis + // calculate coordinate in new basis + tvecX.Set(basis_arr[spi].a1, basis_arr[spi].a2, basis_arr[spi].a3), tvecX *= tcross[cri].x; + tvecY.Set(basis_arr[spi].b1, basis_arr[spi].b2, basis_arr[spi].b3), tvecY *= tcross[cri].y; + tvecZ.Set(basis_arr[spi].c1, basis_arr[spi].c2, basis_arr[spi].c3), tvecZ *= tcross[cri].z; + // apply new coordinates and translate it to spine point. + tcross[cri] = tvecX + tvecY + tvecZ + spine[spi]; + }// for(size_t cri = 0, cri_e = crossSection.size(); cri < cri_e; i++) + + pointset_arr[spi] = tcross;// store transfered point set + }// for(size_t spi = 0, spi_e = spine.size(); spi < spi_e; i++) + }// END: 2. Create array of point sets. + + {// 3. Create CoordIdx. + // add caps if needed + if(beginCap) + { + // add cap as polygon. vertices of cap are places at begin, so just add numbers from zero. + for(size_t i = 0, i_e = crossSection.size(); i < i_e; i++) ext_alias.CoordIndex.push_back(i); + + // add delimiter + ext_alias.CoordIndex.push_back(-1); + }// if(beginCap) + + if(endCap) + { + // add cap as polygon. vertices of cap are places at end, as for beginCap use just sequence of numbers but with offset. + size_t beg = (pointset_arr.size() - 1) * crossSection.size(); + + for(size_t i = beg, i_e = (beg + crossSection.size()); i < i_e; i++) ext_alias.CoordIndex.push_back(i); + + // add delimiter + ext_alias.CoordIndex.push_back(-1); + }// if(beginCap) + + // add quads + for(size_t spi = 0, spi_e = (spine.size() - 1); spi <= spi_e; spi++) + { + const size_t cr_sz = crossSection.size(); + const size_t cr_last = crossSection.size() - 1; + + size_t right_col;// hold index basis for points of quad placed in right column; + + if(spi != spi_e) + right_col = spi + 1; + else if(spine_closed)// if spine curve is closed then one more quad is needed: between first and last points of curve. + right_col = 0; + else + break;// if spine curve is not closed then break the loop, because spi is out of range for that type of spine. + + for(size_t cri = 0; cri < cr_sz; cri++) + { + if(cri != cr_last) + { + MACRO_FACE_ADD_QUAD(ccw, ext_alias.CoordIndex, + spi * cr_sz + cri, right_col * cr_sz + cri, right_col * cr_sz + cri + 1, spi * cr_sz + cri + 1); + // add delimiter + ext_alias.CoordIndex.push_back(-1); + } + else if(cross_closed)// if cross curve is closed then one more quad is needed: between first and last points of curve. + { + MACRO_FACE_ADD_QUAD(ccw, ext_alias.CoordIndex, + spi * cr_sz + cri, right_col * cr_sz + cri, right_col * cr_sz + 0, spi * cr_sz + 0); + // add delimiter + ext_alias.CoordIndex.push_back(-1); + } + }// for(size_t cri = 0; cri < cr_sz; cri++) + }// for(size_t spi = 0, spi_e = (spine.size() - 2); spi < spi_e; spi++) + }// END: 3. Create CoordIdx. + + {// 4. Create vertices list. + // just copy all vertices + for(size_t spi = 0, spi_e = spine.size(); spi < spi_e; spi++) + { + for(size_t cri = 0, cri_e = crossSection.size(); cri < cri_e; cri++) + { + ext_alias.Vertices.push_back(pointset_arr[spi][cri]); + } + } + }// END: 4. Create vertices list. +//PrintVectorSet("Ext. CoordIdx", ext_alias.CoordIndex); +//PrintVectorSet("Ext. Vertices", ext_alias.Vertices); + // check for child nodes + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "Extrusion"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +// +// ComposedGeometryContentModel is the child-node content model corresponding to X3DComposedGeometryNodes. It can contain Color (or ColorRGBA), Coordinate, +// Normal and TextureCoordinate, in any order. No more than one instance of these nodes is allowed. Multiple VertexAttribute (FloatVertexAttribute, +// Matrix3VertexAttribute, Matrix4VertexAttribute) nodes can also be contained. +// A ProtoInstance node (with the proper node type) can be substituted for any node in this content model. +// +void X3DImporter::ParseNode_Geometry3D_IndexedFaceSet() +{ + std::string use, def; + bool ccw = true; + std::list colorIndex; + bool colorPerVertex = true; + bool convex = true; + std::list coordIndex; + float creaseAngle = 0; + std::list normalIndex; + bool normalPerVertex = true; + bool solid = true; + std::list texCoordIndex; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("ccw", ccw, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_REF("colorIndex", colorIndex, XML_ReadNode_GetAttrVal_AsListI32); + MACRO_ATTRREAD_CHECK_RET("colorPerVertex", colorPerVertex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("convex", convex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_REF("coordIndex", coordIndex, XML_ReadNode_GetAttrVal_AsListI32); + MACRO_ATTRREAD_CHECK_RET("creaseAngle", creaseAngle, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_REF("normalIndex", normalIndex, XML_ReadNode_GetAttrVal_AsListI32); + MACRO_ATTRREAD_CHECK_RET("normalPerVertex", normalPerVertex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("solid", solid, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_REF("texCoordIndex", texCoordIndex, XML_ReadNode_GetAttrVal_AsListI32); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_IndexedFaceSet, ne); + } + else + { + // check data + if(coordIndex.size() == 0) throw DeadlyImportError("IndexedFaceSet must contain not empty \"coordIndex\" attribute."); + + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_IndexedSet(CX3DImporter_NodeElement::ENET_IndexedFaceSet, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + CX3DImporter_NodeElement_IndexedSet& ne_alias = *((CX3DImporter_NodeElement_IndexedSet*)ne); + + ne_alias.CCW = ccw; + ne_alias.ColorIndex = colorIndex; + ne_alias.ColorPerVertex = colorPerVertex; + ne_alias.Convex = convex; + ne_alias.CoordIndex = coordIndex; + ne_alias.CreaseAngle = creaseAngle; + ne_alias.NormalIndex = normalIndex; + ne_alias.NormalPerVertex = normalPerVertex; + ne_alias.Solid = solid; + ne_alias.TexCoordIndex = texCoordIndex; + // check for child nodes + if(!mReader->isEmptyElement()) + { + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("IndexedFaceSet"); + // check for X3DComposedGeometryNodes + if(XML_CheckNode_NameEqual("Color")) { ParseNode_Rendering_Color(); continue; } + if(XML_CheckNode_NameEqual("ColorRGBA")) { ParseNode_Rendering_ColorRGBA(); continue; } + if(XML_CheckNode_NameEqual("Coordinate")) { ParseNode_Rendering_Coordinate(); continue; } + if(XML_CheckNode_NameEqual("Normal")) { ParseNode_Rendering_Normal(); continue; } + if(XML_CheckNode_NameEqual("TextureCoordinate")) { ParseNode_Texturing_TextureCoordinate(); continue; } + // check for X3DMetadataObject + if(!ParseHelper_CheckRead_X3DMetadataObject()) XML_CheckNode_SkipUnsupported("IndexedFaceSet"); + + MACRO_NODECHECK_LOOPEND("IndexedFaceSet"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + } + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +void X3DImporter::ParseNode_Geometry3D_Sphere() +{ + std::string use, def; + float radius = 1; + bool solid = true; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("radius", radius, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_RET("solid", solid, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Sphere, ne); + } + else + { + const unsigned int tess = 3;///TODO: IME tesselation factor thru ai_property + + std::vector tlist; + + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Geometry3D(CX3DImporter_NodeElement::ENET_Sphere, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + StandardShapes::MakeSphere(tess, tlist); + // copy data from temp array and apply scale + for(std::vector::iterator it = tlist.begin(); it != tlist.end(); it++) + { + ((CX3DImporter_NodeElement_Geometry3D*)ne)->Vertices.push_back(*it * radius); + } + + ((CX3DImporter_NodeElement_Geometry3D*)ne)->Solid = solid; + ((CX3DImporter_NodeElement_Geometry3D*)ne)->NumIndices = 3; + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "Sphere"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +}// namespace Assimp + +#endif // !ASSIMP_BUILD_NO_X3D_IMPORTER diff --git a/code/X3DImporter_Group.cpp b/code/X3DImporter_Group.cpp new file mode 100644 index 000000000..e476ba58b --- /dev/null +++ b/code/X3DImporter_Group.cpp @@ -0,0 +1,316 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +/// \file X3DImporter_Group.cpp +/// \brief Parsing data from nodes of "Grouping" set of X3D. +/// \date 2015-2016 +/// \author smal.root@gmail.com + +#ifndef ASSIMP_BUILD_NO_X3D_IMPORTER + +#include "X3DImporter.hpp" +#include "X3DImporter_Macro.hpp" + +namespace Assimp +{ + +// +// +// ChildContentModel is the child-node content model corresponding to X3DChildNode, combining all profiles. ChildContentModel can contain most nodes, +// other Grouping nodes, Prototype declarations and ProtoInstances in any order and any combination. When the assigned profile is less than Full, the +// precise palette of legal nodes that are available depends on assigned profile and components. +// A ProtoInstance node (with the proper node type) can be substituted for any node in this content model. +// +// A Group node contains children nodes without introducing a new transformation. It is equivalent to a Transform node containing an identity transform. +void X3DImporter::ParseNode_Grouping_Group() +{ + std::string def, use; + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + CX3DImporter_NodeElement* ne; + + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Group, ne); + } + else + { + ParseHelper_Group_Begin();// create new grouping element and go deeper if node has children. + // at this place new group mode created and made current, so we can name it. + if(!def.empty()) NodeElement_Cur->ID = def; + // in grouping set of nodes check X3DMetadataObject is not needed, because it is done in parser function. + + // for empty element exit from node in that place + if(mReader->isEmptyElement()) ParseHelper_Node_Exit(); + }// if(!use.empty()) else +} + +void X3DImporter::ParseNode_Grouping_GroupEnd() +{ + ParseHelper_Node_Exit();// go up in scene graph +} + +// +// +// ChildContentModel is the child-node content model corresponding to X3DChildNode, combining all profiles. ChildContentModel can contain most nodes, +// other Grouping nodes, Prototype declarations and ProtoInstances in any order and any combination. When the assigned profile is less than Full, the +// precise palette of legal nodes that are available depends on assigned profile and components. +// A ProtoInstance node (with the proper node type) can be substituted for any node in this content model. +// +// The StaticGroup node contains children nodes which cannot be modified. StaticGroup children are guaranteed to not change, send events, receive events or +// contain any USE references outside the StaticGroup. +void X3DImporter::ParseNode_Grouping_StaticGroup() +{ + std::string def, use; + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + CX3DImporter_NodeElement* ne; + + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Group, ne); + } + else + { + ParseHelper_Group_Begin(true);// create new grouping element and go deeper if node has children. + // at this place new group mode created and made current, so we can name it. + if(!def.empty()) NodeElement_Cur->ID = def; + // in grouping set of nodes check X3DMetadataObject is not needed, because it is done in parser function. + + // for empty element exit from node in that place + if(mReader->isEmptyElement()) ParseHelper_Node_Exit(); + }// if(!use.empty()) else +} + +void X3DImporter::ParseNode_Grouping_StaticGroupEnd() +{ + ParseHelper_Node_Exit();// go up in scene graph +} + +// +// +// ChildContentModel is the child-node content model corresponding to X3DChildNode, combining all profiles. ChildContentModel can contain most nodes, +// other Grouping nodes, Prototype declarations and ProtoInstances in any order and any combination. When the assigned profile is less than Full, the +// precise palette of legal nodes that are available depends on assigned profile and components. +// A ProtoInstance node (with the proper node type) can be substituted for any node in this content model. +// +// The Switch grouping node traverses zero or one of the nodes specified in the children field. The whichChoice field specifies the index of the child +// to traverse, with the first child having index 0. If whichChoice is less than zero or greater than the number of nodes in the children field, nothing +// is chosen. +void X3DImporter::ParseNode_Grouping_Switch() +{ + std::string def, use; + int32_t whichChoice = -1; + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("whichChoice", whichChoice, XML_ReadNode_GetAttrVal_AsI32); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + CX3DImporter_NodeElement* ne; + + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Group, ne); + } + else + { + ParseHelper_Group_Begin();// create new grouping element and go deeper if node has children. + // at this place new group mode created and made current, so we can name it. + if(!def.empty()) NodeElement_Cur->ID = def; + + // also set values specific to this type of group + ((CX3DImporter_NodeElement_Group*)NodeElement_Cur)->UseChoice = true; + ((CX3DImporter_NodeElement_Group*)NodeElement_Cur)->Choice = whichChoice; + // in grouping set of nodes check X3DMetadataObject is not needed, because it is done in parser function. + + // for empty element exit from node in that place + if(mReader->isEmptyElement()) ParseHelper_Node_Exit(); + }// if(!use.empty()) else +} + +void X3DImporter::ParseNode_Grouping_SwitchEnd() +{ + // just exit from node. Defined choice will be accepted at postprocessing stage. + ParseHelper_Node_Exit();// go up in scene graph +} + +// +// +// ChildContentModel is the child-node content model corresponding to X3DChildNode, combining all profiles. ChildContentModel can contain most nodes, +// other Grouping nodes, Prototype declarations and ProtoInstances in any order and any combination. When the assigned profile is less than Full, the +// precise palette of legal nodes that are available depends on assigned profile and components. +// A ProtoInstance node (with the proper node type) can be substituted for any node in this content model. +// +// The Transform node is a grouping node that defines a coordinate system for its children that is relative to the coordinate systems of its ancestors. +// Given a 3-dimensional point P and Transform node, P is transformed into point P' in its parent's coordinate system by a series of intermediate +// transformations. In matrix transformation notation, where C (center), SR (scaleOrientation), T (translation), R (rotation), and S (scale) are the +// equivalent transformation matrices, +// P' = T * C * R * SR * S * -SR * -C * P +void X3DImporter::ParseNode_Grouping_Transform() +{ + aiVector3D center(0, 0, 0); + float rotation[4] = {0, 0, 1, 0}; + aiVector3D scale(1, 1, 1);// A value of zero indicates that any child geometry shall not be displayed + float scale_orientation[4] = {0, 0, 1, 0}; + aiVector3D translation(0, 0, 0); + aiMatrix4x4 matr, tmatr; + std::string use, def; + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_REF("center", center, XML_ReadNode_GetAttrVal_AsVec3f); + MACRO_ATTRREAD_CHECK_REF("scale", scale, XML_ReadNode_GetAttrVal_AsVec3f); + MACRO_ATTRREAD_CHECK_REF("translation", translation, XML_ReadNode_GetAttrVal_AsVec3f); + if(an == "rotation") + { + std::vector tvec; + + XML_ReadNode_GetAttrVal_AsArrF(idx, tvec); + if(tvec.size() != 4) throw DeadlyImportError(": rotation vector must have 4 elements."); + + memcpy(rotation, tvec.data(), sizeof(rotation)); + + continue; + } + + if(an == "scaleOrientation") + { + std::vector tvec; + XML_ReadNode_GetAttrVal_AsArrF(idx, tvec); + if ( tvec.size() != 4 ) + { + throw DeadlyImportError( ": scaleOrientation vector must have 4 elements." ); + } + + ::memcpy(scale_orientation, tvec.data(), sizeof(scale_orientation) ); + + continue; + } + + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Group, ne); + } + else + { + ParseHelper_Group_Begin();// create new grouping element and go deeper if node has children. + // at this place new group mode created and made current, so we can name it. + if ( !def.empty() ) + { + NodeElement_Cur->ID = def; + } + + // + // also set values specific to this type of group + // + // calculate transformation matrix + aiMatrix4x4::Translation(translation, matr);// T + aiMatrix4x4::Translation(center, tmatr);// C + matr *= tmatr; + aiMatrix4x4::Rotation(rotation[3], aiVector3D(rotation[0], rotation[1], rotation[2]), tmatr);// R + matr *= tmatr; + aiMatrix4x4::Rotation(scale_orientation[3], aiVector3D(scale_orientation[0], scale_orientation[1], scale_orientation[2]), tmatr);// SR + matr *= tmatr; + aiMatrix4x4::Scaling(scale, tmatr);// S + matr *= tmatr; + aiMatrix4x4::Rotation(-scale_orientation[3], aiVector3D(scale_orientation[0], scale_orientation[1], scale_orientation[2]), tmatr);// -SR + matr *= tmatr; + aiMatrix4x4::Translation(-center, tmatr);// -C + matr *= tmatr; + // and assign it + ((CX3DImporter_NodeElement_Group*)NodeElement_Cur)->Transformation = matr; + // in grouping set of nodes check X3DMetadataObject is not needed, because it is done in parser function. + + // for empty element exit from node in that place + if ( mReader->isEmptyElement() ) + { + ParseHelper_Node_Exit(); + } + }// if(!use.empty()) else +} + +void X3DImporter::ParseNode_Grouping_TransformEnd() +{ + ParseHelper_Node_Exit();// go up in scene graph +} + +}// namespace Assimp + +#endif // !ASSIMP_BUILD_NO_X3D_IMPORTER diff --git a/code/X3DImporter_Light.cpp b/code/X3DImporter_Light.cpp new file mode 100644 index 000000000..54f56e76e --- /dev/null +++ b/code/X3DImporter_Light.cpp @@ -0,0 +1,288 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +/// \file X3DImporter_Light.cpp +/// \brief Parsing data from nodes of "Lighting" set of X3D. +/// \date 2015-2016 +/// \author smal.root@gmail.com + +#ifndef ASSIMP_BUILD_NO_X3D_IMPORTER + +#include "X3DImporter.hpp" +#include "X3DImporter_Macro.hpp" +#include "StringUtils.h" + +namespace Assimp { + +// +void X3DImporter::ParseNode_Lighting_DirectionalLight() +{ + std::string def, use; + float ambientIntensity = 0; + aiColor3D color(1, 1, 1); + aiVector3D direction(0, 0, -1); + bool global = false; + float intensity = 1; + bool on = true; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("ambientIntensity", ambientIntensity, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_REF("color", color, XML_ReadNode_GetAttrVal_AsCol3f); + MACRO_ATTRREAD_CHECK_REF("direction", direction, XML_ReadNode_GetAttrVal_AsVec3f); + MACRO_ATTRREAD_CHECK_RET("global", global, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("intensity", intensity, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_RET("on", on, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_DirectionalLight, ne); + } + else + { + if(on) + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Light(CX3DImporter_NodeElement::ENET_DirectionalLight, NodeElement_Cur); + if(!def.empty()) + ne->ID = def; + else + ne->ID = "DirectionalLight_" + to_string((size_t)ne);// make random name + + ((CX3DImporter_NodeElement_Light*)ne)->AmbientIntensity = ambientIntensity; + ((CX3DImporter_NodeElement_Light*)ne)->Color = color; + ((CX3DImporter_NodeElement_Light*)ne)->Direction = direction; + ((CX3DImporter_NodeElement_Light*)ne)->Global = global; + ((CX3DImporter_NodeElement_Light*)ne)->Intensity = intensity; + // Assimp want a node with name similar to a light. "Why? I don't no." ) + ParseHelper_Group_Begin(false); + + NodeElement_Cur->ID = ne->ID;// assign name to node and return to light element. + ParseHelper_Node_Exit(); + // check for child nodes + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "DirectionalLight"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(on) + }// if(!use.empty()) else +} + +// +void X3DImporter::ParseNode_Lighting_PointLight() +{ + std::string def, use; + float ambientIntensity = 0; + aiVector3D attenuation( 1, 0, 0 ); + aiColor3D color( 1, 1, 1 ); + bool global = true; + float intensity = 1; + aiVector3D location( 0, 0, 0 ); + bool on = true; + float radius = 100; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("ambientIntensity", ambientIntensity, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_REF("attenuation", attenuation, XML_ReadNode_GetAttrVal_AsVec3f); + MACRO_ATTRREAD_CHECK_REF("color", color, XML_ReadNode_GetAttrVal_AsCol3f); + MACRO_ATTRREAD_CHECK_RET("global", global, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("intensity", intensity, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_REF("location", location, XML_ReadNode_GetAttrVal_AsVec3f); + MACRO_ATTRREAD_CHECK_RET("on", on, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("radius", radius, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_PointLight, ne); + } + else + { + if(on) + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Light(CX3DImporter_NodeElement::ENET_PointLight, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + ((CX3DImporter_NodeElement_Light*)ne)->AmbientIntensity = ambientIntensity; + ((CX3DImporter_NodeElement_Light*)ne)->Attenuation = attenuation; + ((CX3DImporter_NodeElement_Light*)ne)->Color = color; + ((CX3DImporter_NodeElement_Light*)ne)->Global = global; + ((CX3DImporter_NodeElement_Light*)ne)->Intensity = intensity; + ((CX3DImporter_NodeElement_Light*)ne)->Location = location; + ((CX3DImporter_NodeElement_Light*)ne)->Radius = radius; + // Assimp want a node with name similar to a light. "Why? I don't no." ) + ParseHelper_Group_Begin(false); + // make random name + if(ne->ID.empty()) ne->ID = "PointLight_" + to_string((size_t)ne); + + NodeElement_Cur->ID = ne->ID;// assign name to node and return to light element. + ParseHelper_Node_Exit(); + // check for child nodes + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "PointLight"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(on) + }// if(!use.empty()) else +} + +// +void X3DImporter::ParseNode_Lighting_SpotLight() +{ + std::string def, use; + float ambientIntensity = 0; + aiVector3D attenuation( 1, 0, 0 ); + float beamWidth = 0.7854f; + aiColor3D color( 1, 1, 1 ); + float cutOffAngle = 1.570796f; + aiVector3D direction( 0, 0, -1 ); + bool global = true; + float intensity = 1; + aiVector3D location( 0, 0, 0 ); + bool on = true; + float radius = 100; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("ambientIntensity", ambientIntensity, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_REF("attenuation", attenuation, XML_ReadNode_GetAttrVal_AsVec3f); + MACRO_ATTRREAD_CHECK_RET("beamWidth", beamWidth, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_REF("color", color, XML_ReadNode_GetAttrVal_AsCol3f); + MACRO_ATTRREAD_CHECK_RET("cutOffAngle", cutOffAngle, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_REF("direction", direction, XML_ReadNode_GetAttrVal_AsVec3f); + MACRO_ATTRREAD_CHECK_RET("global", global, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("intensity", intensity, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_REF("location", location, XML_ReadNode_GetAttrVal_AsVec3f); + MACRO_ATTRREAD_CHECK_RET("on", on, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("radius", radius, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_SpotLight, ne); + } + else + { + if(on) + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Light(CX3DImporter_NodeElement::ENET_SpotLight, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + if(beamWidth > cutOffAngle) beamWidth = cutOffAngle; + + ((CX3DImporter_NodeElement_Light*)ne)->AmbientIntensity = ambientIntensity; + ((CX3DImporter_NodeElement_Light*)ne)->Attenuation = attenuation; + ((CX3DImporter_NodeElement_Light*)ne)->BeamWidth = beamWidth; + ((CX3DImporter_NodeElement_Light*)ne)->Color = color; + ((CX3DImporter_NodeElement_Light*)ne)->CutOffAngle = cutOffAngle; + ((CX3DImporter_NodeElement_Light*)ne)->Direction = direction; + ((CX3DImporter_NodeElement_Light*)ne)->Global = global; + ((CX3DImporter_NodeElement_Light*)ne)->Intensity = intensity; + ((CX3DImporter_NodeElement_Light*)ne)->Location = location; + ((CX3DImporter_NodeElement_Light*)ne)->Radius = radius; + + // Assimp want a node with name similar to a light. "Why? I don't no." ) + ParseHelper_Group_Begin(false); + // make random name + if(ne->ID.empty()) ne->ID = "SpotLight_" + to_string((size_t)ne); + + NodeElement_Cur->ID = ne->ID;// assign name to node and return to light element. + ParseHelper_Node_Exit(); + // check for child nodes + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "SpotLight"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(on) + }// if(!use.empty()) else +} + +}// namespace Assimp + +#endif // !ASSIMP_BUILD_NO_X3D_IMPORTER diff --git a/code/X3DImporter_Macro.hpp b/code/X3DImporter_Macro.hpp new file mode 100644 index 000000000..445edfe91 --- /dev/null +++ b/code/X3DImporter_Macro.hpp @@ -0,0 +1,193 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +/// \file X3DImporter_Macro.hpp +/// \brief Useful macrodefines. +/// \date 2015-2016 +/// \author smal.root@gmail.com + +#ifndef X3DIMPORTER_MACRO_HPP_INCLUDED +#define X3DIMPORTER_MACRO_HPP_INCLUDED + +/// \def MACRO_USE_CHECKANDAPPLY(pDEF, pUSE, pNE) +/// Used for regular checking while attribute "USE" is defined. +/// \param [in] pDEF - string holding "DEF" value. +/// \param [in] pUSE - string holding "USE" value. +/// \param [in] pType - type of element to find. +/// \param [out] pNE - pointer to found node element. +#define MACRO_USE_CHECKANDAPPLY(pDEF, pUSE, pType, pNE) \ + do { \ + XML_CheckNode_MustBeEmpty(); \ + if(!pDEF.empty()) Throw_DEF_And_USE(); \ + if(!FindNodeElement(pUSE, CX3DImporter_NodeElement::pType, &pNE)) Throw_USE_NotFound(pUSE); \ + \ + NodeElement_Cur->Child.push_back(pNE);/* add found object as child to current element */ \ + } while(false) + +/// \def MACRO_ATTRREAD_LOOPBEG +/// Begin of loop that read attributes values. +#define MACRO_ATTRREAD_LOOPBEG \ + for(int idx = 0, idx_end = mReader->getAttributeCount(); idx < idx_end; idx++) \ + { \ + std::string an(mReader->getAttributeName(idx)); + +/// \def MACRO_ATTRREAD_LOOPEND +/// End of loop that read attributes values. +#define MACRO_ATTRREAD_LOOPEND \ + Throw_IncorrectAttr(an); \ + } + +/// \def MACRO_ATTRREAD_CHECK_REF +/// Check curent attribute name and if it equal to requested then read value. Result write to output variable by reference. If result was read then +/// "continue" will called. +/// \param [in] pAttrName - attribute name. +/// \param [out] pVarName - output variable name. +/// \param [in] pFunction - function which read attribute value and write it to pVarName. +#define MACRO_ATTRREAD_CHECK_REF(pAttrName, pVarName, pFunction) \ + if(an == pAttrName) \ + { \ + pFunction(idx, pVarName); \ + continue; \ + } + +/// \def MACRO_ATTRREAD_CHECK_RET +/// Check curent attribute name and if it equal to requested then read value. Result write to output variable using return value of \ref pFunction. +/// If result was read then "continue" will called. +/// \param [in] pAttrName - attribute name. +/// \param [out] pVarName - output variable name. +/// \param [in] pFunction - function which read attribute value and write it to pVarName. +#define MACRO_ATTRREAD_CHECK_RET(pAttrName, pVarName, pFunction) \ + if(an == pAttrName) \ + { \ + pVarName = pFunction(idx); \ + continue; \ + } + +/// \def MACRO_ATTRREAD_CHECKUSEDEF_RET +/// Compact variant for checking "USE" and "DEF". Also skip bbox attributes: "bboxCenter", "bboxSize". +/// If result was read then "continue" will called. +/// \param [out] pDEF_Var - output variable name for "DEF" value. +/// \param [out] pUSE_Var - output variable name for "USE" value. +#define MACRO_ATTRREAD_CHECKUSEDEF_RET(pDEF_Var, pUSE_Var) \ + MACRO_ATTRREAD_CHECK_RET("DEF", pDEF_Var, mReader->getAttributeValue); \ + MACRO_ATTRREAD_CHECK_RET("USE", pUSE_Var, mReader->getAttributeValue); \ + if(an == "bboxCenter") continue; \ + if(an == "bboxSize") continue; \ + if(an == "containerField") continue; \ + do {} while(false) + +/// \def MACRO_NODECHECK_LOOPBEGIN(pNodeName) +/// Begin of loop of parsing child nodes. Do not add ';' at end. +/// \param [in] pNodeName - current node name. +#define MACRO_NODECHECK_LOOPBEGIN(pNodeName) \ + do { \ + bool close_found = false; \ + \ + while(mReader->read()) \ + { \ + if(mReader->getNodeType() == irr::io::EXN_ELEMENT) \ + { + +/// \def MACRO_NODECHECK_LOOPEND(pNodeName) +/// End of loop of parsing child nodes. +/// \param [in] pNodeName - current node name. +#define MACRO_NODECHECK_LOOPEND(pNodeName) \ + }/* if(mReader->getNodeType() == irr::io::EXN_ELEMENT) */ \ + else if(mReader->getNodeType() == irr::io::EXN_ELEMENT_END) \ + { \ + if(XML_CheckNode_NameEqual(pNodeName)) \ + { \ + close_found = true; \ + \ + break; \ + } \ + }/* else if(mReader->getNodeType() == irr::io::EXN_ELEMENT_END) */ \ + }/* while(mReader->read()) */ \ + \ + if(!close_found) Throw_CloseNotFound(pNodeName); \ + \ + } while(false) + +#define MACRO_NODECHECK_METADATA(pNodeName) \ + MACRO_NODECHECK_LOOPBEGIN(pNodeName) \ + /* and childs must be metadata nodes */ \ + if(!ParseHelper_CheckRead_X3DMetadataObject()) XML_CheckNode_SkipUnsupported(pNodeName); \ + MACRO_NODECHECK_LOOPEND(pNodeName) + +/// \def MACRO_FACE_ADD_QUAD_FA(pCCW, pOut, pIn, pP1, pP2, pP3, pP4) +/// Add points as quad. Means that pP1..pP4 set in CCW order. +#define MACRO_FACE_ADD_QUAD_FA(pCCW, pOut, pIn, pP1, pP2, pP3, pP4) \ + do { \ + if(pCCW) \ + { \ + pOut.push_back(pIn[pP1]); \ + pOut.push_back(pIn[pP2]); \ + pOut.push_back(pIn[pP3]); \ + pOut.push_back(pIn[pP4]); \ + } \ + else \ + { \ + pOut.push_back(pIn[pP4]); \ + pOut.push_back(pIn[pP3]); \ + pOut.push_back(pIn[pP2]); \ + pOut.push_back(pIn[pP1]); \ + } \ + } while(false) + +/// \def MACRO_FACE_ADD_QUAD(pCCW, pOut, pP1, pP2, pP3, pP4) +/// Add points as quad. Means that pP1..pP4 set in CCW order. +#define MACRO_FACE_ADD_QUAD(pCCW, pOut, pP1, pP2, pP3, pP4) \ + do { \ + if(pCCW) \ + { \ + pOut.push_back(pP1); \ + pOut.push_back(pP2); \ + pOut.push_back(pP3); \ + pOut.push_back(pP4); \ + } \ + else \ + { \ + pOut.push_back(pP4); \ + pOut.push_back(pP3); \ + pOut.push_back(pP2); \ + pOut.push_back(pP1); \ + } \ + } while(false) + +#endif // X3DIMPORTER_MACRO_HPP_INCLUDED diff --git a/code/X3DImporter_Metadata.cpp b/code/X3DImporter_Metadata.cpp new file mode 100644 index 000000000..1f57d9f63 --- /dev/null +++ b/code/X3DImporter_Metadata.cpp @@ -0,0 +1,275 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +/// \file X3DImporter_Metadata.cpp +/// \brief Parsing data from nodes of "Metadata" set of X3D. +/// \date 2015-2016 +/// \author smal.root@gmail.com + +#ifndef ASSIMP_BUILD_NO_X3D_IMPORTER + +#include "X3DImporter.hpp" +#include "X3DImporter_Macro.hpp" + +namespace Assimp +{ + +/// \def MACRO_METADATA_FINDCREATE(pDEF_Var, pUSE_Var, pReference, pValue, pNE, pMetaName) +/// Find element by "USE" or create new one. +/// \param [in] pDEF_Var - variable name with "DEF" value. +/// \param [in] pUSE_Var - variable name with "USE" value. +/// \param [in] pReference - variable name with "reference" value. +/// \param [in] pValue - variable name with "value" value. +/// \param [in, out] pNE - pointer to node element. +/// \param [in] pMetaClass - Class of node. +/// \param [in] pMetaName - Name of node. +/// \param [in] pType - type of element to find. +#define MACRO_METADATA_FINDCREATE(pDEF_Var, pUSE_Var, pReference, pValue, pNE, pMetaClass, pMetaName, pType) \ + /* if "USE" defined then find already defined element. */ \ + if(!pUSE_Var.empty()) \ + { \ + MACRO_USE_CHECKANDAPPLY(pDEF_Var, pUSE_Var, pType, pNE); \ + } \ + else \ + { \ + pNE = new pMetaClass(NodeElement_Cur); \ + if(!pDEF_Var.empty()) pNE->ID = pDEF_Var; \ + \ + ((pMetaClass*)pNE)->Reference = pReference; \ + ((pMetaClass*)pNE)->Value = pValue; \ + /* also metadata node can contain childs */ \ + if(!mReader->isEmptyElement()) \ + ParseNode_Metadata(pNE, pMetaName);/* in that case node element will be added to child elements list of current node. */ \ + else \ + NodeElement_Cur->Child.push_back(pNE);/* else - add element to child list manualy */ \ + \ + NodeElement_List.push_back(pNE);/* add new element to elements list. */ \ + }/* if(!pUSE_Var.empty()) else */ \ + \ + do {} while(false) + +bool X3DImporter::ParseHelper_CheckRead_X3DMetadataObject() +{ + if(XML_CheckNode_NameEqual("MetadataBoolean")) + ParseNode_MetadataBoolean(); + else if(XML_CheckNode_NameEqual("MetadataDouble")) + ParseNode_MetadataDouble(); + else if(XML_CheckNode_NameEqual("MetadataFloat")) + ParseNode_MetadataFloat(); + else if(XML_CheckNode_NameEqual("MetadataInteger")) + ParseNode_MetadataInteger(); + else if(XML_CheckNode_NameEqual("MetadataSet")) + ParseNode_MetadataSet(); + else if(XML_CheckNode_NameEqual("MetadataString")) + ParseNode_MetadataString(); + else + return false; + + return true; +} + +void X3DImporter::ParseNode_Metadata(CX3DImporter_NodeElement* pParentElement, const std::string& pNodeName) +{ + ParseHelper_Node_Enter(pParentElement); + MACRO_NODECHECK_METADATA(mReader->getNodeName()); + ParseHelper_Node_Exit(); +} + +// +void X3DImporter::ParseNode_MetadataBoolean() +{ + std::string def, use; + std::string name, reference; + std::list value; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("name", name, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_RET("reference", reference, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_REF("value", value, XML_ReadNode_GetAttrVal_AsListB); + MACRO_ATTRREAD_LOOPEND; + + MACRO_METADATA_FINDCREATE(def, use, reference, value, ne, CX3DImporter_NodeElement_MetaBoolean, "MetadataBoolean", ENET_MetaBoolean); +} + +// +void X3DImporter::ParseNode_MetadataDouble() +{ + std::string def, use; + std::string name, reference; + std::list value; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("name", name, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_RET("reference", reference, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_REF("value", value, XML_ReadNode_GetAttrVal_AsListD); + MACRO_ATTRREAD_LOOPEND; + + MACRO_METADATA_FINDCREATE(def, use, reference, value, ne, CX3DImporter_NodeElement_MetaDouble, "MetadataDouble", ENET_MetaDouble); +} + +// +void X3DImporter::ParseNode_MetadataFloat() +{ + std::string def, use; + std::string name, reference; + std::list value; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("name", name, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_RET("reference", reference, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_REF("value", value, XML_ReadNode_GetAttrVal_AsListF); + MACRO_ATTRREAD_LOOPEND; + + MACRO_METADATA_FINDCREATE(def, use, reference, value, ne, CX3DImporter_NodeElement_MetaFloat, "MetadataFloat", ENET_MetaFloat); +} + +// +void X3DImporter::ParseNode_MetadataInteger() +{ + std::string def, use; + std::string name, reference; + std::list value; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("name", name, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_RET("reference", reference, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_REF("value", value, XML_ReadNode_GetAttrVal_AsListI32); + MACRO_ATTRREAD_LOOPEND; + + MACRO_METADATA_FINDCREATE(def, use, reference, value, ne, CX3DImporter_NodeElement_MetaInteger, "MetadataInteger", ENET_MetaInteger); +} + +// +void X3DImporter::ParseNode_MetadataSet() +{ + std::string def, use; + std::string name, reference; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("name", name, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_RET("reference", reference, mReader->getAttributeValue); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_MetaSet, ne); + } + else + { + ne = new CX3DImporter_NodeElement_MetaSet(NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + ((CX3DImporter_NodeElement_MetaSet*)ne)->Reference = reference; + // also metadata node can contain childs + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "MetadataSet"); + else + NodeElement_Cur->Child.push_back(ne);// made object as child to current element + + NodeElement_List.push_back(ne);// add new element to elements list. + }// if(!use.empty()) else +} + +// +void X3DImporter::ParseNode_MetadataString() +{ + std::string def, use; + std::string name, reference; + std::list value; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("name", name, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_RET("reference", reference, mReader->getAttributeValue); + MACRO_ATTRREAD_CHECK_REF("value", value, XML_ReadNode_GetAttrVal_AsListS); + MACRO_ATTRREAD_LOOPEND; + + MACRO_METADATA_FINDCREATE(def, use, reference, value, ne, CX3DImporter_NodeElement_MetaString, "MetadataString", ENET_MetaString); +} + +}// namespace Assimp + +#endif // !ASSIMP_BUILD_NO_X3D_IMPORTER diff --git a/code/X3DImporter_Networking.cpp b/code/X3DImporter_Networking.cpp new file mode 100644 index 000000000..4a75c9e66 --- /dev/null +++ b/code/X3DImporter_Networking.cpp @@ -0,0 +1,109 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +/// \file X3DImporter_Networking.cpp +/// \brief Parsing data from nodes of "Networking" set of X3D. +/// \date 2015-2016 +/// \author smal.root@gmail.com + +#ifndef ASSIMP_BUILD_NO_X3D_IMPORTER + +#include "X3DImporter.hpp" +#include "X3DImporter_Macro.hpp" + +// Header files, Assimp. +#include "DefaultIOSystem.h" + +namespace Assimp +{ + +// +void X3DImporter::ParseNode_Networking_Inline() +{ + std::string def, use; + bool load = true; + std::list url; + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("load", load, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_REF("url", url, XML_ReadNode_GetAttrVal_AsListS); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + CX3DImporter_NodeElement* ne; + + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Group, ne); + } + else + { + ParseHelper_Group_Begin(true);// create new grouping element and go deeper if node has children. + // at this place new group mode created and made current, so we can name it. + if(!def.empty()) NodeElement_Cur->ID = def; + + if(load && (url.size() > 0)) + { + DefaultIOSystem io_handler; + std::string full_path; + + full_path = mFileDir + "/" + url.front(); + // Attribute "url" can contain list of strings. But we need only one - first. + ParseFile(full_path, &io_handler); + } + + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) ParseNode_Metadata(NodeElement_Cur, "Inline"); + + // exit from node in that place + ParseHelper_Node_Exit(); + }// if(!use.empty()) else +} + +}// namespace Assimp + +#endif // !ASSIMP_BUILD_NO_X3D_IMPORTER diff --git a/code/X3DImporter_Node.hpp b/code/X3DImporter_Node.hpp new file mode 100644 index 000000000..87ee73866 --- /dev/null +++ b/code/X3DImporter_Node.hpp @@ -0,0 +1,802 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +/// \file X3DImporter_Node.hpp +/// \brief Elements of scene graph. +/// \date 2015-2016 +/// \author smal.root@gmail.com + +#ifndef INCLUDED_AI_X3D_IMPORTER_NODE_H +#define INCLUDED_AI_X3D_IMPORTER_NODE_H + +// Header files, Assimp. +#include +#include + +// Header files, stdlib. +#include +#include + +/// \class CX3DImporter_NodeElement +/// Base class for elements of nodes. +class CX3DImporter_NodeElement +{ + /***********************************************/ + /******************** Types ********************/ + /***********************************************/ + +public: + + /// \enum EType + /// Define what data type contain node element. + enum EType + { + ENET_Group, ///< Element has type "Group". + ENET_MetaBoolean, ///< Element has type "Metadata boolean". + ENET_MetaDouble, ///< Element has type "Metadata double". + ENET_MetaFloat, ///< Element has type "Metadata float". + ENET_MetaInteger, ///< Element has type "Metadata integer". + ENET_MetaSet, ///< Element has type "Metadata set". + ENET_MetaString, ///< Element has type "Metadata string". + ENET_Arc2D, ///< Element has type "Arc2D". + ENET_ArcClose2D, ///< Element has type "ArcClose2D". + ENET_Circle2D, ///< Element has type "Circle2D". + ENET_Disk2D, ///< Element has type "Disk2D". + ENET_Polyline2D, ///< Element has type "Polyline2D". + ENET_Polypoint2D, ///< Element has type "Polypoint2D". + ENET_Rectangle2D, ///< Element has type "Rectangle2D". + ENET_TriangleSet2D, ///< Element has type "TriangleSet2D". + ENET_Box, ///< Element has type "Box". + ENET_Cone, ///< Element has type "Cone". + ENET_Cylinder, ///< Element has type "Cylinder". + ENET_Sphere, ///< Element has type "Sphere". + ENET_ElevationGrid, ///< Element has type "ElevationGrid". + ENET_Extrusion, ///< Element has type "Extrusion". + ENET_Coordinate, ///< Element has type "Coordinate". + ENET_Normal, ///< Element has type "Normal". + ENET_TextureCoordinate, ///< Element has type "TextureCoordinate". + ENET_IndexedFaceSet, ///< Element has type "IndexedFaceSet". + ENET_IndexedLineSet, ///< Element has type "IndexedLineSet". + ENET_IndexedTriangleSet, ///< Element has type "IndexedTriangleSet". + ENET_IndexedTriangleFanSet, ///< Element has type "IndexedTriangleFanSet". + ENET_IndexedTriangleStripSet,///< Element has type "IndexedTriangleStripSet". + ENET_LineSet, ///< Element has type "LineSet". + ENET_PointSet, ///< Element has type "PointSet". + ENET_TriangleSet, ///< Element has type "TriangleSet". + ENET_TriangleFanSet, ///< Element has type "TriangleFanSet". + ENET_TriangleStripSet, ///< Element has type "TriangleStripSet". + ENET_Color, ///< Element has type "Color". + ENET_ColorRGBA, ///< Element has type "ColorRGBA". + ENET_Shape, ///< Element has type "Shape". + ENET_Appearance, ///< Element has type "Appearance". + ENET_Material, ///< Element has type "Material". + ENET_ImageTexture, ///< Element has type "ImageTexture". + ENET_TextureTransform, ///< Element has type "TextureTransform". + ENET_DirectionalLight, ///< Element has type "DirectionalLight". + ENET_PointLight, ///< Element has type "PointLight". + ENET_SpotLight, ///< Element has type "SpotLight". + + ENET_Invalid ///< Element has invalid type and possible contain invalid data. + }; + + /***********************************************/ + /****************** Constants ******************/ + /***********************************************/ + +public: + + const EType Type; + + /***********************************************/ + /****************** Variables ******************/ + /***********************************************/ + +public: + + std::string ID;///< ID of the element. Can be empty. In X3D synonym for "ID" attribute. + CX3DImporter_NodeElement* Parent;///< Parrent element. If nullptr then this node is root. + std::list Child;///< Child elements. + + /***********************************************/ + /****************** Functions ******************/ + /***********************************************/ + +private: + + /// \fn CX3DImporter_NodeElement(const CX3DImporter_NodeElement& pNodeElement) + /// Disabled copy constructor. + CX3DImporter_NodeElement(const CX3DImporter_NodeElement& pNodeElement); + + /// \fn CX3DImporter_NodeElement& operator=(const CX3DImporter_NodeElement& pNodeElement) + /// Disabled assign operator. + CX3DImporter_NodeElement& operator=(const CX3DImporter_NodeElement& pNodeElement); + + /// \fn CX3DImporter_NodeElement() + /// Disabled default constructor. + CX3DImporter_NodeElement(); + +protected: + + /// \fn CX3DImporter_NodeElement(const EType pType, CX3DImporter_NodeElement* pParent) + /// In constructor inheritor must set element type. + /// \param [in] pType - element type. + /// \param [in] pParent - parent element. + CX3DImporter_NodeElement(const EType pType, CX3DImporter_NodeElement* pParent) + : Type(pType), Parent(pParent) + {} + +};// class IX3DImporter_NodeElement + +/// \class CX3DImporter_NodeElement_Group +/// Class that define grouping node. Define transformation matrix for children. +/// Also can select which child will be kept and others are removed. +class CX3DImporter_NodeElement_Group : public CX3DImporter_NodeElement +{ + /***********************************************/ + /****************** Variables ******************/ + /***********************************************/ + +public: + + aiMatrix4x4 Transformation;///< Transformation matrix. + + /// \var bool Static + /// As you know node elements can use already defined node elements when attribute "USE" is defined. + /// Standard search when looking for an element in the whole scene graph, existing at this moment. + /// If a node is marked as static, the children(or lower) can not search for elements in the nodes upper then static. + bool Static; + + bool UseChoice;///< Flag: if true then use number from \ref Choice to choose what the child will be kept. + int32_t Choice;///< Number of the child which will be kept. + + /***********************************************/ + /****************** Functions ******************/ + /***********************************************/ + +private: + + /// \fn CX3DImporter_NodeElement_Group(const CX3DImporter_NodeElement_Group& pNode) + /// Disabled copy constructor. + CX3DImporter_NodeElement_Group(const CX3DImporter_NodeElement_Group& pNode); + + /// \fn CX3DImporter_NodeElement_Group& operator=(const CX3DImporter_NodeElement_Group& pNode) + /// Disabled assign operator. + CX3DImporter_NodeElement_Group& operator=(const CX3DImporter_NodeElement_Group& pNode); + + /// \fn CX3DImporter_NodeElement_Group() + /// Disabled default constructor. + CX3DImporter_NodeElement_Group(); + +public: + + /// \fn CX3DImporter_NodeElement_Group(CX3DImporter_NodeElement_Group* pParent, const bool pStatic = false) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + /// \param [in] pStatic - static node flag. + CX3DImporter_NodeElement_Group(CX3DImporter_NodeElement* pParent, const bool pStatic = false) + : CX3DImporter_NodeElement(ENET_Group, pParent), Static(pStatic), UseChoice(false) + {} + +};// class CX3DImporter_NodeElement_Group + +/// \class CX3DImporter_NodeElement_Meta +/// This struct describe metavalue. +class CX3DImporter_NodeElement_Meta : public CX3DImporter_NodeElement +{ + /***********************************************/ + /****************** Variables ******************/ + /***********************************************/ + +public: + + std::string Name;///< Name of metadata object. + /// \var std::string Reference + /// If provided, it identifies the metadata standard or other specification that defines the name field. If the reference field is not provided or is + /// empty, the meaning of the name field is considered implicit to the characters in the string. + std::string Reference; + + /***********************************************/ + /****************** Functions ******************/ + /***********************************************/ + +private: + + /// \fn CX3DImporter_NodeElement_Meta(const CX3DImporter_NodeElement_Meta& pNode) + /// Disabled copy constructor. + CX3DImporter_NodeElement_Meta(const CX3DImporter_NodeElement_Meta& pNode); + + /// \fn CX3DImporter_NodeElement_Meta& operator=(const CX3DImporter_NodeElement_Meta& pNode) + /// Disabled assign operator. + CX3DImporter_NodeElement_Meta& operator=(const CX3DImporter_NodeElement_Meta& pNode); + + /// \fn CX3DImporter_NodeElement_Meta() + /// Disabled default constructor. + CX3DImporter_NodeElement_Meta(); + +public: + + /// \fn CX3DImporter_NodeElement_Meta(const EType pType, CX3DImporter_NodeElement* pParent) + /// In constructor inheritor must set element type. + /// \param [in] pType - element type. + /// \param [in] pParent - pointer to parent node. + CX3DImporter_NodeElement_Meta(const EType pType, CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement(pType, pParent) + {} + +};// class CX3DImporter_NodeElement_Meta + +/// \struct CX3DImporter_NodeElement_MetaBoolean +/// This struct describe metavalue of type boolean. +struct CX3DImporter_NodeElement_MetaBoolean : public CX3DImporter_NodeElement_Meta +{ + std::list Value;///< Stored value. + + /// \fn CX3DImporter_NodeElement_MetaBoolean(CX3DImporter_NodeElement* pParent) + /// Constructor + /// \param [in] pParent - pointer to parent node. + CX3DImporter_NodeElement_MetaBoolean(CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement_Meta(ENET_MetaBoolean, pParent) + {} + +};// struct CX3DImporter_NodeElement_MetaBoolean + +/// \struct CX3DImporter_NodeElement_MetaDouble +/// This struct describe metavalue of type double. +struct CX3DImporter_NodeElement_MetaDouble : public CX3DImporter_NodeElement_Meta +{ + std::list Value;///< Stored value. + + /// \fn CX3DImporter_NodeElement_MetaDouble(CX3DImporter_NodeElement* pParent) + /// Constructor + /// \param [in] pParent - pointer to parent node. + CX3DImporter_NodeElement_MetaDouble(CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement_Meta(ENET_MetaDouble, pParent) + {} + +};// struct CX3DImporter_NodeElement_MetaDouble + +/// \struct CX3DImporter_NodeElement_MetaFloat +/// This struct describe metavalue of type float. +struct CX3DImporter_NodeElement_MetaFloat : public CX3DImporter_NodeElement_Meta +{ + std::list Value;///< Stored value. + + /// \fn CX3DImporter_NodeElement_MetaFloat(CX3DImporter_NodeElement* pParent) + /// Constructor + /// \param [in] pParent - pointer to parent node. + CX3DImporter_NodeElement_MetaFloat(CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement_Meta(ENET_MetaFloat, pParent) + {} + +};// struct CX3DImporter_NodeElement_MetaFloat + +/// \struct CX3DImporter_NodeElement_MetaInteger +/// This struct describe metavalue of type integer. +struct CX3DImporter_NodeElement_MetaInteger : public CX3DImporter_NodeElement_Meta +{ + std::list Value;///< Stored value. + + /// \fn CX3DImporter_NodeElement_MetaInteger(CX3DImporter_NodeElement* pParent) + /// Constructor + /// \param [in] pParent - pointer to parent node. + CX3DImporter_NodeElement_MetaInteger(CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement_Meta(ENET_MetaInteger, pParent) + {} + +};// struct CX3DImporter_NodeElement_MetaInteger + +/// \struct CX3DImporter_NodeElement_MetaSet +/// This struct describe container for metaobjects. +struct CX3DImporter_NodeElement_MetaSet : public CX3DImporter_NodeElement_Meta +{ + std::list Value;///< Stored value. + + /// \fn CX3DImporter_NodeElement_MetaSet(CX3DImporter_NodeElement* pParent) + /// Constructor + /// \param [in] pParent - pointer to parent node. + CX3DImporter_NodeElement_MetaSet(CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement_Meta(ENET_MetaSet, pParent) + {} + +};// struct CX3DImporter_NodeElement_MetaSet + +/// \struct CX3DImporter_NodeElement_MetaString +/// This struct describe metavalue of type string. +struct CX3DImporter_NodeElement_MetaString : public CX3DImporter_NodeElement_Meta +{ + std::list Value;///< Stored value. + + /// \fn CX3DImporter_NodeElement_MetaString(CX3DImporter_NodeElement* pParent) + /// Constructor + /// \param [in] pParent - pointer to parent node. + CX3DImporter_NodeElement_MetaString(CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement_Meta(ENET_MetaString, pParent) + {} + +};// struct CX3DImporter_NodeElement_MetaString + +/// \struct CX3DImporter_NodeElement_Color +/// This struct hold value. +struct CX3DImporter_NodeElement_Color : public CX3DImporter_NodeElement +{ + std::list Value;///< Stored value. + + /// \fn CX3DImporter_NodeElement_Color(CX3DImporter_NodeElement* pParent) + /// Constructor + /// \param [in] pParent - pointer to parent node. + CX3DImporter_NodeElement_Color(CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement(ENET_Color, pParent) + {} + +};// struct CX3DImporter_NodeElement_Color + +/// \struct CX3DImporter_NodeElement_ColorRGBA +/// This struct hold value. +struct CX3DImporter_NodeElement_ColorRGBA : public CX3DImporter_NodeElement +{ + std::list Value;///< Stored value. + + /// \fn CX3DImporter_NodeElement_ColorRGBA(CX3DImporter_NodeElement* pParent) + /// Constructor + /// \param [in] pParent - pointer to parent node. + CX3DImporter_NodeElement_ColorRGBA(CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement(ENET_ColorRGBA, pParent) + {} + +};// struct CX3DImporter_NodeElement_ColorRGBA + +/// \struct CX3DImporter_NodeElement_Coordinate +/// This struct hold value. +struct CX3DImporter_NodeElement_Coordinate : public CX3DImporter_NodeElement +{ + std::list Value;///< Stored value. + + /// \fn CX3DImporter_NodeElement_Coordinate(CX3DImporter_NodeElement* pParent) + /// Constructor + /// \param [in] pParent - pointer to parent node. + CX3DImporter_NodeElement_Coordinate(CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement(ENET_Coordinate, pParent) + {} + +};// struct CX3DImporter_NodeElement_Coordinate + +/// \struct CX3DImporter_NodeElement_Normal +/// This struct hold value. +struct CX3DImporter_NodeElement_Normal : public CX3DImporter_NodeElement +{ + std::list Value;///< Stored value. + + /// \fn CX3DImporter_NodeElement_Normal(CX3DImporter_NodeElement* pParent) + /// Constructor + /// \param [in] pParent - pointer to parent node. + CX3DImporter_NodeElement_Normal(CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement(ENET_Normal, pParent) + {} + +};// struct CX3DImporter_NodeElement_Normal + +/// \struct CX3DImporter_NodeElement_TextureCoordinate +/// This struct hold value. +struct CX3DImporter_NodeElement_TextureCoordinate : public CX3DImporter_NodeElement +{ + std::list Value;///< Stored value. + + /// \fn CX3DImporter_NodeElement_TextureCoordinate(CX3DImporter_NodeElement* pParent) + /// Constructor + /// \param [in] pParent - pointer to parent node. + CX3DImporter_NodeElement_TextureCoordinate(CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement(ENET_TextureCoordinate, pParent) + {} + +};// struct CX3DImporter_NodeElement_TextureCoordinate + +/// \class CX3DImporter_NodeElement_Geometry2D +/// Two-dimensional figure. +class CX3DImporter_NodeElement_Geometry2D : public CX3DImporter_NodeElement +{ + /***********************************************/ + /****************** Variables ******************/ + /***********************************************/ + +public: + + std::list Vertices;///< Vertices list. + size_t NumIndices;///< Number of indices in one face. + bool Solid;///< Flag: if true then render must use back-face culling, else render must draw both sides of object. + + /***********************************************/ + /****************** Functions ******************/ + /***********************************************/ + +private: + + /// \fn CX3DImporter_NodeElement_Geometry2D(const CX3DImporter_NodeElement_Geometry2D& pNode) + /// Disabled copy constructor. + CX3DImporter_NodeElement_Geometry2D(const CX3DImporter_NodeElement_Geometry2D& pNode); + + /// \fn CX3DImporter_NodeElement_Geometry2D& operator=(const CX3DImporter_NodeElement_Geometry2D& pNode) + /// Disabled assign operator. + CX3DImporter_NodeElement_Geometry2D& operator=(const CX3DImporter_NodeElement_Geometry2D& pNode); + +public: + + /// \fn CX3DImporter_NodeElement_Geometry2D(const EType pType, CX3DImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + /// \param [in] pType - type of geometry object. + CX3DImporter_NodeElement_Geometry2D(const EType pType, CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement(pType, pParent), Solid(true) + {} + +};// class CX3DImporter_NodeElement_Geometry2D + +/// \class CX3DImporter_NodeElement_Geometry3D +/// Three-dimensional body. +class CX3DImporter_NodeElement_Geometry3D : public CX3DImporter_NodeElement +{ + /***********************************************/ + /****************** Variables ******************/ + /***********************************************/ + +public: + + std::list Vertices;///< Vertices list. + size_t NumIndices;///< Number of indices in one face. + bool Solid;///< Flag: if true then render must use back-face culling, else render must draw both sides of object. + + /***********************************************/ + /****************** Functions ******************/ + /***********************************************/ + +private: + + /// \fn CX3DImporter_NodeElement_Geometry3D(const CX3DImporter_NodeElement_Geometry3D& pNode) + /// Disabled copy constructor. + CX3DImporter_NodeElement_Geometry3D(const CX3DImporter_NodeElement_Geometry3D& pNode); + + /// \fn CX3DImporter_NodeElement_Geometry3D& operator=(const CX3DImporter_NodeElement_Geometry3D& pNode) + /// Disabled assign operator. + CX3DImporter_NodeElement_Geometry3D& operator=(const CX3DImporter_NodeElement_Geometry3D& pNode); + +public: + + /// \fn CX3DImporter_NodeElement_Geometry3D(const EType pType, CX3DImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + /// \param [in] pType - type of geometry object. + CX3DImporter_NodeElement_Geometry3D(const EType pType, CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement(pType, pParent), Solid(true) + {} + +};// class CX3DImporter_NodeElement_Geometry3D + +/// \class CX3DImporter_NodeElement_ElevationGrid +/// Uniform rectangular grid of varying height. +class CX3DImporter_NodeElement_ElevationGrid : public CX3DImporter_NodeElement_Geometry3D +{ + /***********************************************/ + /****************** Variables ******************/ + /***********************************************/ + +public: + + bool NormalPerVertex;///< If true then normals are defined for every vertex, else for every face(line). + bool ColorPerVertex;///< If true then colors are defined for every vertex, else for every face(line). + /// \var CreaseAngle + /// If the angle between the geometric normals of two adjacent faces is less than the crease angle, normals shall be calculated so that the faces are + /// shaded smoothly across the edge; otherwise, normals shall be calculated so that a lighting discontinuity across the edge is produced. + float CreaseAngle; + std::list CoordIdx;///< Coordinates list by faces. In X3D format: "-1" - delimiter for faces. + + /***********************************************/ + /****************** Functions ******************/ + /***********************************************/ + +private: + + /// \fn CX3DImporter_NodeElement_ElevationGrid(const CX3DImporter_NodeElement_ElevationGrid& pNode) + /// Disabled copy constructor. + CX3DImporter_NodeElement_ElevationGrid(const CX3DImporter_NodeElement_ElevationGrid& pNode); + + /// \fn CX3DImporter_NodeElement_ElevationGrid& operator=(const CX3DImporter_NodeElement_ElevationGrid& pNode) + /// Disabled assign operator. + CX3DImporter_NodeElement_ElevationGrid& operator=(const CX3DImporter_NodeElement_ElevationGrid& pNode); + +public: + + /// \fn CX3DImporter_NodeElement_ElevationGrid(const EType pType, CX3DImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + /// \param [in] pType - type of geometry object. + CX3DImporter_NodeElement_ElevationGrid(const EType pType, CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement_Geometry3D(pType, pParent) + {} + +};// class CX3DImporter_NodeElement_IndexedSet + +/// \class CX3DImporter_NodeElement_IndexedSet +/// Shape with indexed vertices. +class CX3DImporter_NodeElement_IndexedSet : public CX3DImporter_NodeElement_Geometry3D +{ + /***********************************************/ + /****************** Variables ******************/ + /***********************************************/ + +public: + + /// \var CCW + /// The ccw field defines the ordering of the vertex coordinates of the geometry with respect to user-given or automatically generated normal vectors + /// used in the lighting model equations. If ccw is TRUE, the normals shall follow the right hand rule; the orientation of each normal with respect to + /// the vertices (taken in order) shall be such that the vertices appear to be oriented in a counterclockwise order when the vertices are viewed (in the + /// local coordinate system of the Shape) from the opposite direction as the normal. If ccw is FALSE, the normals shall be oriented in the opposite + /// direction. If normals are not generated but are supplied using a Normal node, and the orientation of the normals does not match the setting of the + /// ccw field, results are undefined. + bool CCW; + std::list ColorIndex;///< Field to specify the polygonal faces by indexing into the or . + bool ColorPerVertex;///< If true then colors are defined for every vertex, else for every face(line). + /// \var Convex + /// The convex field indicates whether all polygons in the shape are convex (TRUE). A polygon is convex if it is planar, does not intersect itself, + /// and all of the interior angles at its vertices are less than 180 degrees. Non planar and self intersecting polygons may produce undefined results + /// even if the convex field is FALSE. + bool Convex; + std::list CoordIndex;///< Field to specify the polygonal faces by indexing into the . + /// \var CreaseAngle + /// If the angle between the geometric normals of two adjacent faces is less than the crease angle, normals shall be calculated so that the faces are + /// shaded smoothly across the edge; otherwise, normals shall be calculated so that a lighting discontinuity across the edge is produced. + float CreaseAngle; + std::list NormalIndex;///< Field to specify the polygonal faces by indexing into the . + bool NormalPerVertex;///< If true then normals are defined for every vertex, else for every face(line). + std::list TexCoordIndex;///< Field to specify the polygonal faces by indexing into the . + + /***********************************************/ + /****************** Functions ******************/ + /***********************************************/ + +private: + + /// \fn CX3DImporter_NodeElement_IndexedSet(const CX3DImporter_NodeElement_IndexedSet& pNode) + /// Disabled copy constructor. + CX3DImporter_NodeElement_IndexedSet(const CX3DImporter_NodeElement_IndexedSet& pNode); + + /// \fn CX3DImporter_NodeElement_IndexedSet& operator=(const CX3DImporter_NodeElement_IndexedSet& pNode) + /// Disabled assign operator. + CX3DImporter_NodeElement_IndexedSet& operator=(const CX3DImporter_NodeElement_IndexedSet& pNode); + +public: + + /// \fn CX3DImporter_NodeElement_IndexedSet(const EType pType, CX3DImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + /// \param [in] pType - type of geometry object. + CX3DImporter_NodeElement_IndexedSet(const EType pType, CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement_Geometry3D(pType, pParent) + {} + +};// class CX3DImporter_NodeElement_IndexedSet + +/// \class CX3DImporter_NodeElement_Set +/// Shape with set of vertices. +class CX3DImporter_NodeElement_Set : public CX3DImporter_NodeElement_Geometry3D +{ + /***********************************************/ + /****************** Variables ******************/ + /***********************************************/ + +public: + + /// \var CCW + /// The ccw field defines the ordering of the vertex coordinates of the geometry with respect to user-given or automatically generated normal vectors + /// used in the lighting model equations. If ccw is TRUE, the normals shall follow the right hand rule; the orientation of each normal with respect to + /// the vertices (taken in order) shall be such that the vertices appear to be oriented in a counterclockwise order when the vertices are viewed (in the + /// local coordinate system of the Shape) from the opposite direction as the normal. If ccw is FALSE, the normals shall be oriented in the opposite + /// direction. If normals are not generated but are supplied using a Normal node, and the orientation of the normals does not match the setting of the + /// ccw field, results are undefined. + bool CCW; + bool ColorPerVertex;///< If true then colors are defined for every vertex, else for every face(line). + bool NormalPerVertex;///< If true then normals are defined for every vertex, else for every face(line). + std::list CoordIndex;///< Field to specify the polygonal faces by indexing into the . + std::list NormalIndex;///< Field to specify the polygonal faces by indexing into the . + std::list TexCoordIndex;///< Field to specify the polygonal faces by indexing into the . + std::list VertexCount;///< Field describes how many vertices are to be used in each polyline(polygon) from the field. + + /***********************************************/ + /****************** Functions ******************/ + /***********************************************/ + +private: + + /// \fn CX3DImporter_NodeElement_Set(const CX3DImporter_NodeElement_Set& pNode) + /// Disabled copy constructor. + CX3DImporter_NodeElement_Set(const CX3DImporter_NodeElement_Set& pNode); + + /// \fn CX3DImporter_NodeElement_Set& operator=(const CX3DImporter_NodeElement_Set& pNode) + /// Disabled assign operator. + CX3DImporter_NodeElement_Set& operator=(const CX3DImporter_NodeElement_Set& pNode); + +public: + + /// \fn CX3DImporter_NodeElement_Set(const EType pType, CX3DImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + /// \param [in] pType - type of geometry object. + CX3DImporter_NodeElement_Set(const EType pType, CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement_Geometry3D(pType, pParent) + {} + +};// class CX3DImporter_NodeElement_Set + +/// \struct CX3DImporter_NodeElement_Shape +/// This struct hold value. +struct CX3DImporter_NodeElement_Shape : public CX3DImporter_NodeElement +{ + /// \fn CX3DImporter_NodeElement_Shape(CX3DImporter_NodeElement_Shape* pParent) + /// Constructor + /// \param [in] pParent - pointer to parent node. + CX3DImporter_NodeElement_Shape(CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement(ENET_Shape, pParent) + {} + +};// struct CX3DImporter_NodeElement_Shape + +/// \struct CX3DImporter_NodeElement_Appearance +/// This struct hold value. +struct CX3DImporter_NodeElement_Appearance : public CX3DImporter_NodeElement +{ + /// \fn CX3DImporter_NodeElement_Appearance(CX3DImporter_NodeElement_Appearance* pParent) + /// Constructor + /// \param [in] pParent - pointer to parent node. + CX3DImporter_NodeElement_Appearance(CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement(ENET_Appearance, pParent) + {} + +};// struct CX3DImporter_NodeElement_Appearance + +/// \class CX3DImporter_NodeElement_Material +/// Material. +class CX3DImporter_NodeElement_Material : public CX3DImporter_NodeElement +{ + /***********************************************/ + /****************** Variables ******************/ + /***********************************************/ + +public: + + float AmbientIntensity;///< Specifies how much ambient light from light sources this surface shall reflect. + aiColor3D DiffuseColor;///< Reflects all X3D light sources depending on the angle of the surface with respect to the light source. + aiColor3D EmissiveColor;///< Models "glowing" objects. This can be useful for displaying pre-lit models. + float Shininess;///< Lower shininess values produce soft glows, while higher values result in sharper, smaller highlights. + aiColor3D SpecularColor;///< The specularColor and shininess fields determine the specular highlights. + float Transparency;///< Specifies how "clear" an object is, with 1.0 being completely transparent, and 0.0 completely opaque. + + /***********************************************/ + /****************** Functions ******************/ + /***********************************************/ + +private: + + /// \fn CX3DImporter_NodeElement_Material(const CX3DImporter_NodeElement_Material& pNode) + /// Disabled copy constructor. + CX3DImporter_NodeElement_Material(const CX3DImporter_NodeElement_Material& pNode); + + /// \fn CX3DImporter_NodeElement_Material& operator=(const CX3DImporter_NodeElement_Material& pNode) + /// Disabled assign operator. + CX3DImporter_NodeElement_Material& operator=(const CX3DImporter_NodeElement_Material& pNode); + +public: + + /// \fn CX3DImporter_NodeElement_Material(const EType pType, CX3DImporter_NodeElement* pParent) + /// Constructor. + /// \param [in] pParent - pointer to parent node. + /// \param [in] pType - type of geometry object. + CX3DImporter_NodeElement_Material(CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement(ENET_Material, pParent) + {} + +};// class CX3DImporter_NodeElement_Material + +/// \struct CX3DImporter_NodeElement_ImageTexture +/// This struct hold value. +struct CX3DImporter_NodeElement_ImageTexture : public CX3DImporter_NodeElement +{ + /// \var RepeatS + /// RepeatS and RepeatT, that specify how the texture wraps in the S and T directions. If repeatS is TRUE (the default), the texture map is repeated + /// outside the [0.0, 1.0] texture coordinate range in the S direction so that it fills the shape. If repeatS is FALSE, the texture coordinates are + /// clamped in the S direction to lie within the [0.0, 1.0] range. The repeatT field is analogous to the repeatS field. + bool RepeatS; + bool RepeatT;///< See \ref RepeatS. + std::string URL;///< URL of the texture. + /// \fn CX3DImporter_NodeElement_ImageTexture(CX3DImporter_NodeElement_ImageTexture* pParent) + /// Constructor + /// \param [in] pParent - pointer to parent node. + CX3DImporter_NodeElement_ImageTexture(CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement(ENET_ImageTexture, pParent) + {} + +};// struct CX3DImporter_NodeElement_ImageTexture + +/// \struct CX3DImporter_NodeElement_TextureTransform +/// This struct hold value. +struct CX3DImporter_NodeElement_TextureTransform : public CX3DImporter_NodeElement +{ + aiVector2D Center;///< Specifies a translation offset in texture coordinate space about which the rotation and scale fields are applied. + float Rotation;///< Specifies a rotation in angle base units of the texture coordinates about the center point after the scale has been applied. + aiVector2D Scale;///< Specifies a scaling factor in S and T of the texture coordinates about the center point. + aiVector2D Translation;///< Specifies a translation of the texture coordinates. + + /// \fn CX3DImporter_NodeElement_TextureTransform(CX3DImporter_NodeElement_TextureTransform* pParent) + /// Constructor + /// \param [in] pParent - pointer to parent node. + CX3DImporter_NodeElement_TextureTransform(CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement(ENET_TextureTransform, pParent) + {} + +};// struct CX3DImporter_NodeElement_TextureTransform + +/// \struct CX3DImporter_NodeElement_Light +/// This struct hold value. +struct CX3DImporter_NodeElement_Light : public CX3DImporter_NodeElement +{ + float AmbientIntensity;///< Specifies the intensity of the ambient emission from the light. + aiColor3D Color;///< specifies the spectral colour properties of both the direct and ambient light emission as an RGB value. + aiVector3D Direction;///< Specifies the direction vector of the illumination emanating from the light source in the local coordinate system. + /// \var Global + /// Field that determines whether the light is global or scoped. Global lights illuminate all objects that fall within their volume of lighting influence. + /// Scoped lights only illuminate objects that are in the same transformation hierarchy as the light. + bool Global; + float Intensity;///< Specifies the brightness of the direct emission from the light. + /// \var Attenuation + /// PointLight node's illumination falls off with distance as specified by three attenuation coefficients. The attenuation factor + /// is: "1 / max(attenuation[0] + attenuation[1] × r + attenuation[2] × r2, 1)", where r is the distance from the light to the surface being illuminated. + aiVector3D Attenuation; + aiVector3D Location;///< Specifies a translation offset of the centre point of the light source from the light's local coordinate system origin. + float Radius;///< Specifies the radial extent of the solid angle and the maximum distance from location that may be illuminated by the light source. + float BeamWidth;///< Specifies an inner solid angle in which the light source emits light at uniform full intensity. + float CutOffAngle;///< The light source's emission intensity drops off from the inner solid angle (beamWidth) to the outer solid angle (cutOffAngle). + + /// \fn CX3DImporter_NodeElement_Light(EType pLightType, CX3DImporter_NodeElement* pParent) + /// Constructor + /// \param [in] pParent - pointer to parent node. + /// \param [in] pLightType - type of the light source. + CX3DImporter_NodeElement_Light(EType pLightType, CX3DImporter_NodeElement* pParent) + : CX3DImporter_NodeElement(pLightType, pParent) + {} + +};// struct CX3DImporter_NodeElement_Light + +#endif // INCLUDED_AI_X3D_IMPORTER_NODE_H diff --git a/code/X3DImporter_Postprocess.cpp b/code/X3DImporter_Postprocess.cpp new file mode 100644 index 000000000..c3ac102dd --- /dev/null +++ b/code/X3DImporter_Postprocess.cpp @@ -0,0 +1,816 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +/// \file X3DImporter_Postprocess.cpp +/// \brief Convert built scenegraph and objects to Assimp scenegraph. +/// \date 2015-2016 +/// \author smal.root@gmail.com + +#ifndef ASSIMP_BUILD_NO_X3D_IMPORTER + +#include "X3DImporter.hpp" + +// Header files, Assimp. +#include "StandardShapes.h" +#include "StringUtils.h" + +// Header files, stdlib. +#include +#include +#include + +namespace Assimp +{ + +aiMatrix4x4 X3DImporter::PostprocessHelper_Matrix_GlobalToCurrent() const +{ + CX3DImporter_NodeElement* cur_node; + std::list matr; + aiMatrix4x4 out_matr; + + // starting walk from current element to root + cur_node = NodeElement_Cur; + if(cur_node != nullptr) + { + do + { + // if cur_node is group then store group transformation matrix in list. + if(cur_node->Type == CX3DImporter_NodeElement::ENET_Group) matr.push_back(((CX3DImporter_NodeElement_Group*)cur_node)->Transformation); + + cur_node = cur_node->Parent; + } while(cur_node != nullptr); + } + + // multiplicate all matrices in reverse order + for(std::list::reverse_iterator rit = matr.rbegin(); rit != matr.rend(); rit++) out_matr = out_matr * (*rit); + + return out_matr; +} + +void X3DImporter::PostprocessHelper_CollectMetadata(const CX3DImporter_NodeElement& pNodeElement, std::list& pList) const +{ + // walk thru childs and find for metadata. + for(std::list::const_iterator el_it = pNodeElement.Child.begin(); el_it != pNodeElement.Child.end(); el_it++) + { + if(((*el_it)->Type == CX3DImporter_NodeElement::ENET_MetaBoolean) || ((*el_it)->Type == CX3DImporter_NodeElement::ENET_MetaDouble) || + ((*el_it)->Type == CX3DImporter_NodeElement::ENET_MetaFloat) || ((*el_it)->Type == CX3DImporter_NodeElement::ENET_MetaInteger) || + ((*el_it)->Type == CX3DImporter_NodeElement::ENET_MetaString)) + { + pList.push_back(*el_it); + } + else if((*el_it)->Type == CX3DImporter_NodeElement::ENET_MetaSet) + { + PostprocessHelper_CollectMetadata(**el_it, pList); + } + }// for(std::list::const_iterator el_it = pNodeElement.Child.begin(); el_it != pNodeElement.Child.end(); el_it++) +} + +bool X3DImporter::PostprocessHelper_ElementIsMetadata(const CX3DImporter_NodeElement::EType pType) const +{ + if((pType == CX3DImporter_NodeElement::ENET_MetaBoolean) || (pType == CX3DImporter_NodeElement::ENET_MetaDouble) || + (pType == CX3DImporter_NodeElement::ENET_MetaFloat) || (pType == CX3DImporter_NodeElement::ENET_MetaInteger) || + (pType == CX3DImporter_NodeElement::ENET_MetaString) || (pType == CX3DImporter_NodeElement::ENET_MetaSet)) + { + return true; + } + else + { + return false; + } +} + +bool X3DImporter::PostprocessHelper_ElementIsMesh(const CX3DImporter_NodeElement::EType pType) const +{ + if((pType == CX3DImporter_NodeElement::ENET_Arc2D) || (pType == CX3DImporter_NodeElement::ENET_ArcClose2D) || + (pType == CX3DImporter_NodeElement::ENET_Box) || (pType == CX3DImporter_NodeElement::ENET_Circle2D) || + (pType == CX3DImporter_NodeElement::ENET_Cone) || (pType == CX3DImporter_NodeElement::ENET_Cylinder) || + (pType == CX3DImporter_NodeElement::ENET_Disk2D) || (pType == CX3DImporter_NodeElement::ENET_ElevationGrid) || + (pType == CX3DImporter_NodeElement::ENET_Extrusion) || (pType == CX3DImporter_NodeElement::ENET_IndexedFaceSet) || + (pType == CX3DImporter_NodeElement::ENET_IndexedLineSet) || (pType == CX3DImporter_NodeElement::ENET_IndexedTriangleFanSet) || + (pType == CX3DImporter_NodeElement::ENET_IndexedTriangleSet) || (pType == CX3DImporter_NodeElement::ENET_IndexedTriangleStripSet) || + (pType == CX3DImporter_NodeElement::ENET_PointSet) || (pType == CX3DImporter_NodeElement::ENET_LineSet) || + (pType == CX3DImporter_NodeElement::ENET_Polyline2D) || (pType == CX3DImporter_NodeElement::ENET_Polypoint2D) || + (pType == CX3DImporter_NodeElement::ENET_Rectangle2D) || (pType == CX3DImporter_NodeElement::ENET_Sphere) || + (pType == CX3DImporter_NodeElement::ENET_TriangleFanSet) || (pType == CX3DImporter_NodeElement::ENET_TriangleSet) || + (pType == CX3DImporter_NodeElement::ENET_TriangleSet2D) || (pType == CX3DImporter_NodeElement::ENET_TriangleStripSet)) + { + return true; + } + else + { + return false; + } +} + +void X3DImporter::Postprocess_BuildLight(const CX3DImporter_NodeElement& pNodeElement, std::list& pSceneLightList) const +{ + const CX3DImporter_NodeElement_Light& ne = *( ( CX3DImporter_NodeElement_Light* ) &pNodeElement ); + aiMatrix4x4 transform_matr = PostprocessHelper_Matrix_GlobalToCurrent(); + aiLight* new_light = new aiLight; + + new_light->mName = ne.ID; + new_light->mColorAmbient = ne.Color * ne.AmbientIntensity; + new_light->mColorDiffuse = ne.Color * ne.Intensity; + new_light->mColorSpecular = ne.Color * ne.Intensity; + switch(pNodeElement.Type) + { + case CX3DImporter_NodeElement::ENET_DirectionalLight: + new_light->mType = aiLightSource_DIRECTIONAL; + new_light->mDirection = ne.Direction, new_light->mDirection *= transform_matr; + + break; + case CX3DImporter_NodeElement::ENET_PointLight: + new_light->mType = aiLightSource_POINT; + new_light->mPosition = ne.Location, new_light->mPosition *= transform_matr; + new_light->mAttenuationConstant = ne.Attenuation.x; + new_light->mAttenuationLinear = ne.Attenuation.y; + new_light->mAttenuationQuadratic = ne.Attenuation.z; + + break; + case CX3DImporter_NodeElement::ENET_SpotLight: + new_light->mType = aiLightSource_SPOT; + new_light->mPosition = ne.Location, new_light->mPosition *= transform_matr; + new_light->mDirection = ne.Direction, new_light->mDirection *= transform_matr; + new_light->mAttenuationConstant = ne.Attenuation.x; + new_light->mAttenuationLinear = ne.Attenuation.y; + new_light->mAttenuationQuadratic = ne.Attenuation.z; + new_light->mAngleInnerCone = ne.BeamWidth; + new_light->mAngleOuterCone = ne.CutOffAngle; + + break; + default: + throw DeadlyImportError("Postprocess_BuildLight. Unknown type of light: " + to_string(pNodeElement.Type) + "."); + } + + pSceneLightList.push_back(new_light); +} + +void X3DImporter::Postprocess_BuildMaterial(const CX3DImporter_NodeElement& pNodeElement, aiMaterial** pMaterial) const +{ + // check argument + if(pMaterial == nullptr) throw DeadlyImportError("Postprocess_BuildMaterial. pMaterial is nullptr."); + if(*pMaterial != nullptr) throw DeadlyImportError("Postprocess_BuildMaterial. *pMaterial must be nullptr."); + + *pMaterial = new aiMaterial; + aiMaterial& taimat = **pMaterial;// creating alias for convenience. + + // at this point pNodeElement point to node. Walk thru childs and add all stored data. + for(std::list::const_iterator el_it = pNodeElement.Child.begin(); el_it != pNodeElement.Child.end(); el_it++) + { + if((*el_it)->Type == CX3DImporter_NodeElement::ENET_Material) + { + aiColor3D tcol3; + float tvalf; + CX3DImporter_NodeElement_Material& tnemat = *((CX3DImporter_NodeElement_Material*)*el_it); + + tcol3.r = tnemat.AmbientIntensity, tcol3.g = tnemat.AmbientIntensity, tcol3.b = tnemat.AmbientIntensity; + taimat.AddProperty(&tcol3, 1, AI_MATKEY_COLOR_AMBIENT); + taimat.AddProperty(&tnemat.DiffuseColor, 1, AI_MATKEY_COLOR_DIFFUSE); + taimat.AddProperty(&tnemat.EmissiveColor, 1, AI_MATKEY_COLOR_EMISSIVE); + taimat.AddProperty(&tnemat.SpecularColor, 1, AI_MATKEY_COLOR_SPECULAR); + tvalf = 1; + taimat.AddProperty(&tvalf, 1, AI_MATKEY_SHININESS_STRENGTH); + taimat.AddProperty(&tnemat.Shininess, 1, AI_MATKEY_SHININESS); + tvalf = 1.0f - tnemat.Transparency; + taimat.AddProperty(&tvalf, 1, AI_MATKEY_OPACITY); + }// if((*el_it)->Type == CX3DImporter_NodeElement::ENET_Material) + else if((*el_it)->Type == CX3DImporter_NodeElement::ENET_ImageTexture) + { + CX3DImporter_NodeElement_ImageTexture& tnetex = *((CX3DImporter_NodeElement_ImageTexture*)*el_it); + aiString url_str(tnetex.URL.c_str()); + int mode = aiTextureOp_Multiply; + + taimat.AddProperty(&url_str, AI_MATKEY_TEXTURE_DIFFUSE(0)); + taimat.AddProperty(&tnetex.RepeatS, 1, AI_MATKEY_MAPPINGMODE_U_DIFFUSE(0)); + taimat.AddProperty(&tnetex.RepeatT, 1, AI_MATKEY_MAPPINGMODE_V_DIFFUSE(0)); + taimat.AddProperty(&mode, 1, AI_MATKEY_TEXOP_DIFFUSE(0)); + }// else if((*el_it)->Type == CX3DImporter_NodeElement::ENET_ImageTexture) + else if((*el_it)->Type == CX3DImporter_NodeElement::ENET_TextureTransform) + { + aiUVTransform trans; + CX3DImporter_NodeElement_TextureTransform& tnetextr = *((CX3DImporter_NodeElement_TextureTransform*)*el_it); + + trans.mTranslation = tnetextr.Translation - tnetextr.Center; + trans.mScaling = tnetextr.Scale; + trans.mRotation = tnetextr.Rotation; + taimat.AddProperty(&trans, 1, AI_MATKEY_UVTRANSFORM_DIFFUSE(0)); + }// else if((*el_it)->Type == CX3DImporter_NodeElement::ENET_TextureTransform) + }// for(std::list::const_iterator el_it = pNodeElement.Child.begin(); el_it != pNodeElement.Child.end(); el_it++) +} + +void X3DImporter::Postprocess_BuildMesh(const CX3DImporter_NodeElement& pNodeElement, aiMesh** pMesh) const +{ + // check argument + if(pMesh == nullptr) throw DeadlyImportError("Postprocess_BuildMesh. pMesh is nullptr."); + if(*pMesh != nullptr) throw DeadlyImportError("Postprocess_BuildMesh. *pMesh must be nullptr."); + + /************************************************************************************************************************************/ + /************************************************************ Geometry2D ************************************************************/ + /************************************************************************************************************************************/ + if((pNodeElement.Type == CX3DImporter_NodeElement::ENET_Arc2D) || (pNodeElement.Type == CX3DImporter_NodeElement::ENET_ArcClose2D) || + (pNodeElement.Type == CX3DImporter_NodeElement::ENET_Circle2D) || (pNodeElement.Type == CX3DImporter_NodeElement::ENET_Disk2D) || + (pNodeElement.Type == CX3DImporter_NodeElement::ENET_Polyline2D) || (pNodeElement.Type == CX3DImporter_NodeElement::ENET_Polypoint2D) || + (pNodeElement.Type == CX3DImporter_NodeElement::ENET_Rectangle2D) || (pNodeElement.Type == CX3DImporter_NodeElement::ENET_TriangleSet2D)) + { + CX3DImporter_NodeElement_Geometry2D& tnemesh = *((CX3DImporter_NodeElement_Geometry2D*)&pNodeElement);// create alias for convenience + std::vector tarr; + + tarr.reserve(tnemesh.Vertices.size()); + for(std::list::iterator it = tnemesh.Vertices.begin(); it != tnemesh.Vertices.end(); it++) tarr.push_back(*it); + *pMesh = StandardShapes::MakeMesh(tarr, tnemesh.NumIndices);// create mesh from vertices using Assimp help. + + return;// mesh is build, nothing to do anymore. + } + /************************************************************************************************************************************/ + /************************************************************ Geometry3D ************************************************************/ + /************************************************************************************************************************************/ + // + // Predefined figures + // + if((pNodeElement.Type == CX3DImporter_NodeElement::ENET_Box) || (pNodeElement.Type == CX3DImporter_NodeElement::ENET_Cone) || + (pNodeElement.Type == CX3DImporter_NodeElement::ENET_Cylinder) || (pNodeElement.Type == CX3DImporter_NodeElement::ENET_Sphere)) + { + CX3DImporter_NodeElement_Geometry3D& tnemesh = *((CX3DImporter_NodeElement_Geometry3D*)&pNodeElement);// create alias for convenience + std::vector tarr; + + tarr.reserve(tnemesh.Vertices.size()); + for(std::list::iterator it = tnemesh.Vertices.begin(); it != tnemesh.Vertices.end(); it++) tarr.push_back(*it); + + *pMesh = StandardShapes::MakeMesh(tarr, tnemesh.NumIndices);// create mesh from vertices using Assimp help. + + return;// mesh is build, nothing to do anymore. + } + // + // Parametric figures + // + if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_ElevationGrid) + { + CX3DImporter_NodeElement_ElevationGrid& tnemesh = *((CX3DImporter_NodeElement_ElevationGrid*)&pNodeElement);// create alias for convenience + + // at first create mesh from existing vertices. + *pMesh = GeometryHelper_MakeMesh(tnemesh.CoordIdx, tnemesh.Vertices); + // copy additional information from children + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + { + if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Color) + MeshGeometry_AddColor(**pMesh, ((CX3DImporter_NodeElement_Color*)*ch_it)->Value, tnemesh.ColorPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_ColorRGBA) + MeshGeometry_AddColor(**pMesh, ((CX3DImporter_NodeElement_ColorRGBA*)*ch_it)->Value, tnemesh.ColorPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Normal) + MeshGeometry_AddNormal(**pMesh, ((CX3DImporter_NodeElement_Normal*)*ch_it)->Value, tnemesh.NormalPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_TextureCoordinate) + MeshGeometry_AddTexCoord(**pMesh, ((CX3DImporter_NodeElement_TextureCoordinate*)*ch_it)->Value); + else + throw DeadlyImportError("Postprocess_BuildMesh. Unknown child of ElevationGrid: " + to_string((*ch_it)->Type) + "."); + }// for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + + return;// mesh is build, nothing to do anymore. + }// if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_ElevationGrid) + // + // Indexed primitives sets + // + if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_IndexedFaceSet) + { + CX3DImporter_NodeElement_IndexedSet& tnemesh = *((CX3DImporter_NodeElement_IndexedSet*)&pNodeElement);// create alias for convenience + + // at first search for node and create mesh. + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + { + if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Coordinate) + { + *pMesh = GeometryHelper_MakeMesh(tnemesh.CoordIndex, ((CX3DImporter_NodeElement_Coordinate*)*ch_it)->Value); + } + } + + // copy additional information from children + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + { + if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Color) + MeshGeometry_AddColor(**pMesh, tnemesh.CoordIndex, tnemesh.ColorIndex, ((CX3DImporter_NodeElement_Color*)*ch_it)->Value, tnemesh.ColorPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_ColorRGBA) + MeshGeometry_AddColor(**pMesh, tnemesh.CoordIndex, tnemesh.ColorIndex, ((CX3DImporter_NodeElement_ColorRGBA*)*ch_it)->Value, + tnemesh.ColorPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Coordinate) + {} // skip because already read when mesh created. + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Normal) + MeshGeometry_AddNormal(**pMesh, tnemesh.CoordIndex, tnemesh.NormalIndex, ((CX3DImporter_NodeElement_Normal*)*ch_it)->Value, + tnemesh.NormalPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_TextureCoordinate) + MeshGeometry_AddTexCoord(**pMesh, tnemesh.CoordIndex, tnemesh.TexCoordIndex, ((CX3DImporter_NodeElement_TextureCoordinate*)*ch_it)->Value); + else + throw DeadlyImportError("Postprocess_BuildMesh. Unknown child of IndexedFaceSet: " + to_string((*ch_it)->Type) + "."); + }// for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + + return;// mesh is build, nothing to do anymore. + }// if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_IndexedFaceSet) + + if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_IndexedLineSet) + { + CX3DImporter_NodeElement_IndexedSet& tnemesh = *((CX3DImporter_NodeElement_IndexedSet*)&pNodeElement);// create alias for convenience + + // at first search for node and create mesh. + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + { + if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Coordinate) + { + *pMesh = GeometryHelper_MakeMesh(tnemesh.CoordIndex, ((CX3DImporter_NodeElement_Coordinate*)*ch_it)->Value); + } + } + + // copy additional information from children + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + { + if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Color) + MeshGeometry_AddColor(**pMesh, tnemesh.CoordIndex, tnemesh.ColorIndex, ((CX3DImporter_NodeElement_Color*)*ch_it)->Value, tnemesh.ColorPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_ColorRGBA) + MeshGeometry_AddColor(**pMesh, tnemesh.CoordIndex, tnemesh.ColorIndex, ((CX3DImporter_NodeElement_ColorRGBA*)*ch_it)->Value, + tnemesh.ColorPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Coordinate) + {} // skip because already read when mesh created. + else + throw DeadlyImportError("Postprocess_BuildMesh. Unknown child of IndexedLineSet: " + to_string((*ch_it)->Type) + "."); + }// for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + + return;// mesh is build, nothing to do anymore. + }// if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_IndexedLineSet) + + if((pNodeElement.Type == CX3DImporter_NodeElement::ENET_IndexedTriangleSet) || + (pNodeElement.Type == CX3DImporter_NodeElement::ENET_IndexedTriangleFanSet) || + (pNodeElement.Type == CX3DImporter_NodeElement::ENET_IndexedTriangleStripSet)) + { + CX3DImporter_NodeElement_IndexedSet& tnemesh = *((CX3DImporter_NodeElement_IndexedSet*)&pNodeElement);// create alias for convenience + + // at first search for node and create mesh. + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + { + if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Coordinate) + { + *pMesh = GeometryHelper_MakeMesh(tnemesh.CoordIndex, ((CX3DImporter_NodeElement_Coordinate*)*ch_it)->Value); + } + } + + // copy additional information from children + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + { + if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Color) + MeshGeometry_AddColor(**pMesh, tnemesh.CoordIndex, tnemesh.ColorIndex, ((CX3DImporter_NodeElement_Color*)*ch_it)->Value, tnemesh.ColorPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_ColorRGBA) + MeshGeometry_AddColor(**pMesh, tnemesh.CoordIndex, tnemesh.ColorIndex, ((CX3DImporter_NodeElement_ColorRGBA*)*ch_it)->Value, + tnemesh.ColorPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Coordinate) + {} // skip because already read when mesh created. + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Normal) + MeshGeometry_AddNormal(**pMesh, tnemesh.CoordIndex, tnemesh.NormalIndex, ((CX3DImporter_NodeElement_Normal*)*ch_it)->Value, + tnemesh.NormalPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_TextureCoordinate) + MeshGeometry_AddTexCoord(**pMesh, tnemesh.CoordIndex, tnemesh.TexCoordIndex, ((CX3DImporter_NodeElement_TextureCoordinate*)*ch_it)->Value); + else + throw DeadlyImportError("Postprocess_BuildMesh. Unknown child of IndexedTriangleSet or IndexedTriangleFanSet, or \ + IndexedTriangleStripSet: " + to_string((*ch_it)->Type) + "."); + }// for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + + return;// mesh is build, nothing to do anymore. + }// if((pNodeElement.Type == CX3DImporter_NodeElement::ENET_IndexedTriangleFanSet) || (pNodeElement.Type == CX3DImporter_NodeElement::ENET_IndexedTriangleStripSet)) + + if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_Extrusion) + { + CX3DImporter_NodeElement_IndexedSet& tnemesh = *((CX3DImporter_NodeElement_IndexedSet*)&pNodeElement);// create alias for convenience + + *pMesh = GeometryHelper_MakeMesh(tnemesh.CoordIndex, tnemesh.Vertices); + + return;// mesh is build, nothing to do anymore. + }// if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_Extrusion) + + // + // Primitives sets + // + if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_PointSet) + { + CX3DImporter_NodeElement_Set& tnemesh = *((CX3DImporter_NodeElement_Set*)&pNodeElement);// create alias for convenience + + // at first search for node and create mesh. + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + { + if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Coordinate) + { + std::vector vec_copy; + + vec_copy.reserve(((CX3DImporter_NodeElement_Coordinate*)*ch_it)->Value.size()); + for(std::list::const_iterator it = ((CX3DImporter_NodeElement_Coordinate*)*ch_it)->Value.begin(); + it != ((CX3DImporter_NodeElement_Coordinate*)*ch_it)->Value.end(); it++) + { + vec_copy.push_back(*it); + } + + *pMesh = StandardShapes::MakeMesh(vec_copy, 1); + } + } + + // copy additional information from children + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + { + if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Color) + MeshGeometry_AddColor(**pMesh, ((CX3DImporter_NodeElement_Color*)*ch_it)->Value, true); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_ColorRGBA) + MeshGeometry_AddColor(**pMesh, ((CX3DImporter_NodeElement_ColorRGBA*)*ch_it)->Value, true); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Coordinate) + {} // skip because already read when mesh created. + else + throw DeadlyImportError("Postprocess_BuildMesh. Unknown child of PointSet: " + to_string((*ch_it)->Type) + "."); + }// for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + + return;// mesh is build, nothing to do anymore. + }// if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_PointSet) + + if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_LineSet) + { + CX3DImporter_NodeElement_Set& tnemesh = *((CX3DImporter_NodeElement_Set*)&pNodeElement);// create alias for convenience + + // at first search for node and create mesh. + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + { + if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Coordinate) + { + *pMesh = GeometryHelper_MakeMesh(tnemesh.CoordIndex, ((CX3DImporter_NodeElement_Coordinate*)*ch_it)->Value); + } + } + + // copy additional information from children + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + { + if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Color) + MeshGeometry_AddColor(**pMesh, ((CX3DImporter_NodeElement_Color*)*ch_it)->Value, true); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_ColorRGBA) + MeshGeometry_AddColor(**pMesh, ((CX3DImporter_NodeElement_ColorRGBA*)*ch_it)->Value, true); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Coordinate) + {} // skip because already read when mesh created. + else + throw DeadlyImportError("Postprocess_BuildMesh. Unknown child of LineSet: " + to_string((*ch_it)->Type) + "."); + }// for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + + return;// mesh is build, nothing to do anymore. + }// if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_LineSet) + + if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_TriangleFanSet) + { + CX3DImporter_NodeElement_Set& tnemesh = *((CX3DImporter_NodeElement_Set*)&pNodeElement);// create alias for convenience + + // at first search for node and create mesh. + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + { + if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Coordinate) + { + *pMesh = GeometryHelper_MakeMesh(tnemesh.CoordIndex, ((CX3DImporter_NodeElement_Coordinate*)*ch_it)->Value); + } + } + + // copy additional information from children + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + { + if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Color) + MeshGeometry_AddColor(**pMesh, ((CX3DImporter_NodeElement_Color*)*ch_it)->Value,tnemesh.ColorPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_ColorRGBA) + MeshGeometry_AddColor(**pMesh, ((CX3DImporter_NodeElement_ColorRGBA*)*ch_it)->Value, tnemesh.ColorPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Coordinate) + {} // skip because already read when mesh created. + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Normal) + MeshGeometry_AddNormal(**pMesh, tnemesh.CoordIndex, tnemesh.NormalIndex, ((CX3DImporter_NodeElement_Normal*)*ch_it)->Value, + tnemesh.NormalPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_TextureCoordinate) + MeshGeometry_AddTexCoord(**pMesh, tnemesh.CoordIndex, tnemesh.TexCoordIndex, ((CX3DImporter_NodeElement_TextureCoordinate*)*ch_it)->Value); + else + throw DeadlyImportError("Postprocess_BuildMesh. Unknown child of TrianlgeFanSet: " + to_string((*ch_it)->Type) + "."); + }// for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + + return;// mesh is build, nothing to do anymore. + }// if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_TriangleFanSet) + + if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_TriangleSet) + { + CX3DImporter_NodeElement_Set& tnemesh = *((CX3DImporter_NodeElement_Set*)&pNodeElement);// create alias for convenience + + // at first search for node and create mesh. + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + { + if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Coordinate) + { + std::vector vec_copy; + + vec_copy.reserve(((CX3DImporter_NodeElement_Coordinate*)*ch_it)->Value.size()); + for(std::list::const_iterator it = ((CX3DImporter_NodeElement_Coordinate*)*ch_it)->Value.begin(); + it != ((CX3DImporter_NodeElement_Coordinate*)*ch_it)->Value.end(); it++) + { + vec_copy.push_back(*it); + } + + *pMesh = StandardShapes::MakeMesh(vec_copy, 3); + } + } + + // copy additional information from children + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + { + if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Color) + MeshGeometry_AddColor(**pMesh, ((CX3DImporter_NodeElement_Color*)*ch_it)->Value, tnemesh.ColorPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_ColorRGBA) + MeshGeometry_AddColor(**pMesh, ((CX3DImporter_NodeElement_ColorRGBA*)*ch_it)->Value, tnemesh.ColorPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Coordinate) + {} // skip because already read when mesh created. + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Normal) + MeshGeometry_AddNormal(**pMesh, tnemesh.CoordIndex, tnemesh.NormalIndex, ((CX3DImporter_NodeElement_Normal*)*ch_it)->Value, + tnemesh.NormalPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_TextureCoordinate) + MeshGeometry_AddTexCoord(**pMesh, tnemesh.CoordIndex, tnemesh.TexCoordIndex, ((CX3DImporter_NodeElement_TextureCoordinate*)*ch_it)->Value); + else + throw DeadlyImportError("Postprocess_BuildMesh. Unknown child of TrianlgeSet: " + to_string((*ch_it)->Type) + "."); + }// for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + + return;// mesh is build, nothing to do anymore. + }// if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_TriangleSet) + + if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_TriangleStripSet) + { + CX3DImporter_NodeElement_Set& tnemesh = *((CX3DImporter_NodeElement_Set*)&pNodeElement);// create alias for convenience + + // at first search for node and create mesh. + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + { + if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Coordinate) + { + *pMesh = GeometryHelper_MakeMesh(tnemesh.CoordIndex, ((CX3DImporter_NodeElement_Coordinate*)*ch_it)->Value); + } + } + + // copy additional information from children + for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + { + if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Color) + MeshGeometry_AddColor(**pMesh, ((CX3DImporter_NodeElement_Color*)*ch_it)->Value, tnemesh.ColorPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_ColorRGBA) + MeshGeometry_AddColor(**pMesh, ((CX3DImporter_NodeElement_ColorRGBA*)*ch_it)->Value, tnemesh.ColorPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Coordinate) + {} // skip because already read when mesh created. + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_Normal) + MeshGeometry_AddNormal(**pMesh, tnemesh.CoordIndex, tnemesh.NormalIndex, ((CX3DImporter_NodeElement_Normal*)*ch_it)->Value, + tnemesh.NormalPerVertex); + else if((*ch_it)->Type == CX3DImporter_NodeElement::ENET_TextureCoordinate) + MeshGeometry_AddTexCoord(**pMesh, tnemesh.CoordIndex, tnemesh.TexCoordIndex, ((CX3DImporter_NodeElement_TextureCoordinate*)*ch_it)->Value); + else + throw DeadlyImportError("Postprocess_BuildMesh. Unknown child of TriangleStripSet: " + to_string((*ch_it)->Type) + "."); + }// for(std::list::iterator ch_it = tnemesh.Child.begin(); ch_it != tnemesh.Child.end(); ch_it++) + + return;// mesh is build, nothing to do anymore. + }// if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_TriangleStripSet) + + throw DeadlyImportError("Postprocess_BuildMesh. Unknown mesh type: " + to_string(pNodeElement.Type) + "."); +} + +void X3DImporter::Postprocess_BuildNode(const CX3DImporter_NodeElement& pNodeElement, aiNode& pSceneNode, std::list& pSceneMeshList, + std::list& pSceneMaterialList, std::list& pSceneLightList) const +{ + std::list::const_iterator chit_begin = pNodeElement.Child.begin(); + std::list::const_iterator chit_end = pNodeElement.Child.end(); + std::list SceneNode_Child; + std::list SceneNode_Mesh; + + // At first read all metadata + Postprocess_CollectMetadata(pNodeElement, pSceneNode); + // check if we have deal with grouping node. Which can contain transformation or switch + if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_Group) + { + const CX3DImporter_NodeElement_Group& tne_group = *((CX3DImporter_NodeElement_Group*)&pNodeElement);// create alias for convenience + + pSceneNode.mTransformation = tne_group.Transformation; + if(tne_group.UseChoice) + { + // If Choice is less than zero or greater than the number of nodes in the children field, nothing is chosen. + if((tne_group.Choice < 0) || ((size_t)tne_group.Choice >= pNodeElement.Child.size())) + { + chit_begin = pNodeElement.Child.end(); + chit_end = pNodeElement.Child.end(); + } + else + { + for(size_t i = 0; i < (size_t)tne_group.Choice; i++) chit_begin++;// forward iterator to choosed node. + + chit_end = chit_begin; + chit_end++;// point end iterator to next element after choosed. + } + }// if(tne_group.UseChoice) + }// if(pNodeElement.Type == CX3DImporter_NodeElement::ENET_Group) + + // Reserve memory for fast access and check children. + for(std::list::const_iterator it = chit_begin; it != chit_end; it++) + {// in this loop we do not read metadata because it's already read at begin. + if((*it)->Type == CX3DImporter_NodeElement::ENET_Group) + { + // if child is group then create new node and do recursive call. + aiNode* new_node = new aiNode; + + new_node->mName = (*it)->ID; + new_node->mParent = &pSceneNode; + SceneNode_Child.push_back(new_node); + Postprocess_BuildNode(**it, *new_node, pSceneMeshList, pSceneMaterialList, pSceneLightList); + } + else if((*it)->Type == CX3DImporter_NodeElement::ENET_Shape) + { + // shape can contain only one geometry and one appearance nodes. + Postprocess_BuildShape(*((CX3DImporter_NodeElement_Shape*)*it), SceneNode_Mesh, pSceneMeshList, pSceneMaterialList); + } + else if(((*it)->Type == CX3DImporter_NodeElement::ENET_DirectionalLight) || ((*it)->Type == CX3DImporter_NodeElement::ENET_PointLight) || + ((*it)->Type == CX3DImporter_NodeElement::ENET_SpotLight)) + { + Postprocess_BuildLight(*((CX3DImporter_NodeElement_Light*)*it), pSceneLightList); + } + else if(!PostprocessHelper_ElementIsMetadata((*it)->Type))// skip metadata + { + throw DeadlyImportError("Postprocess_BuildNode. Unknown type: " + to_string((*it)->Type) + "."); + } + }// for(std::list::const_iterator it = chit_begin; it != chit_end; it++) + + // copy data about children and meshes to aiNode. + if(SceneNode_Child.size() > 0) + { + std::list::const_iterator it = SceneNode_Child.begin(); + + pSceneNode.mNumChildren = SceneNode_Child.size(); + pSceneNode.mChildren = new aiNode*[pSceneNode.mNumChildren]; + for(size_t i = 0; i < pSceneNode.mNumChildren; i++) pSceneNode.mChildren[i] = *it++; + } + + if(SceneNode_Mesh.size() > 0) + { + std::list::const_iterator it = SceneNode_Mesh.begin(); + + pSceneNode.mNumMeshes = SceneNode_Mesh.size(); + pSceneNode.mMeshes = new unsigned int[pSceneNode.mNumMeshes]; + for(size_t i = 0; i < pSceneNode.mNumMeshes; i++) pSceneNode.mMeshes[i] = *it++; + } + + // that's all. return to previous deals +} + +void X3DImporter::Postprocess_BuildShape(const CX3DImporter_NodeElement_Shape& pShapeNodeElement, std::list& pNodeMeshInd, + std::list& pSceneMeshList, std::list& pSceneMaterialList) const +{ + aiMaterial* tmat = nullptr; + aiMesh* tmesh = nullptr; + CX3DImporter_NodeElement::EType mesh_type = CX3DImporter_NodeElement::ENET_Invalid; + unsigned int mat_ind = 0; + + for(std::list::const_iterator it = pShapeNodeElement.Child.begin(); it != pShapeNodeElement.Child.end(); it++) + { + if(PostprocessHelper_ElementIsMesh((*it)->Type)) + { + Postprocess_BuildMesh(**it, &tmesh); + if(tmesh != nullptr) + { + // if mesh successfully built then add data about it to arrays + pNodeMeshInd.push_back(pSceneMeshList.size()); + pSceneMeshList.push_back(tmesh); + // keep mesh type. Need above for texture coordinate generation. + mesh_type = (*it)->Type; + } + } + else if((*it)->Type == CX3DImporter_NodeElement::ENET_Appearance) + { + Postprocess_BuildMaterial(**it, &tmat); + if(tmat != nullptr) + { + // if material successfully built then add data about it to array + mat_ind = pSceneMaterialList.size(); + pSceneMaterialList.push_back(tmat); + } + } + }// for(std::list::const_iterator it = pShapeNodeElement.Child.begin(); it != pShapeNodeElement.Child.end(); it++) + + // associate read material with read mesh. + if((tmesh != nullptr) && (tmat != nullptr)) + { + tmesh->mMaterialIndex = mat_ind; + // Check texture mapping. If material has texture but mesh has no texture coordinate then try to ask Assimp to generate texture coordinates. + if((tmat->GetTextureCount(aiTextureType_DIFFUSE) != 0) && !tmesh->HasTextureCoords(0)) + { + int32_t tm; + aiVector3D tvec3; + + switch(mesh_type) + { + case CX3DImporter_NodeElement::ENET_Box: + tm = aiTextureMapping_BOX; + break; + case CX3DImporter_NodeElement::ENET_Cone: + case CX3DImporter_NodeElement::ENET_Cylinder: + tm = aiTextureMapping_CYLINDER; + break; + case CX3DImporter_NodeElement::ENET_Sphere: + tm = aiTextureMapping_SPHERE; + break; + default: + tm = aiTextureMapping_PLANE; + break; + }// switch(mesh_type) + + tmat->AddProperty(&tm, 1, AI_MATKEY_MAPPING_DIFFUSE(0)); + }// if((tmat->GetTextureCount(aiTextureType_DIFFUSE) != 0) && !tmesh->HasTextureCoords(0)) + }// if((tmesh != nullptr) && (tmat != nullptr)) +} + +void X3DImporter::Postprocess_CollectMetadata(const CX3DImporter_NodeElement& pNodeElement, aiNode& pSceneNode) const +{ + std::list meta_list; + size_t meta_idx; + + PostprocessHelper_CollectMetadata(pNodeElement, meta_list);// find metadata in current node element. + if(meta_list.size() > 0) + { + if(pSceneNode.mMetaData != nullptr) throw DeadlyImportError("Postprocess. MetaData member in node are not nullptr. Something went wrong."); + + // copy collected metadata to output node. + pSceneNode.mMetaData = new aiMetadata(); + pSceneNode.mMetaData->mNumProperties = meta_list.size(); + pSceneNode.mMetaData->mKeys = new aiString[pSceneNode.mMetaData->mNumProperties]; + pSceneNode.mMetaData->mValues = new aiMetadataEntry[pSceneNode.mMetaData->mNumProperties]; + meta_idx = 0; + for(std::list::const_iterator it = meta_list.begin(); it != meta_list.end(); it++, meta_idx++) + { + CX3DImporter_NodeElement_Meta* cur_meta = (CX3DImporter_NodeElement_Meta*)*it; + + // due to limitations we can add only first element of value list. + // Add an element according to its type. + if((*it)->Type == CX3DImporter_NodeElement::ENET_MetaBoolean) + { + if(((CX3DImporter_NodeElement_MetaBoolean*)cur_meta)->Value.size() > 0) + pSceneNode.mMetaData->Set(meta_idx, cur_meta->Name, *(((CX3DImporter_NodeElement_MetaBoolean*)cur_meta)->Value.begin())); + } + else if((*it)->Type == CX3DImporter_NodeElement::ENET_MetaDouble) + { + if(((CX3DImporter_NodeElement_MetaDouble*)cur_meta)->Value.size() > 0) + pSceneNode.mMetaData->Set(meta_idx, cur_meta->Name, (float)*(((CX3DImporter_NodeElement_MetaDouble*)cur_meta)->Value.begin())); + } + else if((*it)->Type == CX3DImporter_NodeElement::ENET_MetaFloat) + { + if(((CX3DImporter_NodeElement_MetaFloat*)cur_meta)->Value.size() > 0) + pSceneNode.mMetaData->Set(meta_idx, cur_meta->Name, *(((CX3DImporter_NodeElement_MetaFloat*)cur_meta)->Value.begin())); + } + else if((*it)->Type == CX3DImporter_NodeElement::ENET_MetaInteger) + { + if(((CX3DImporter_NodeElement_MetaInteger*)cur_meta)->Value.size() > 0) + pSceneNode.mMetaData->Set(meta_idx, cur_meta->Name, *(((CX3DImporter_NodeElement_MetaInteger*)cur_meta)->Value.begin())); + } + else if((*it)->Type == CX3DImporter_NodeElement::ENET_MetaString) + { + if(((CX3DImporter_NodeElement_MetaString*)cur_meta)->Value.size() > 0) + { + aiString tstr(((CX3DImporter_NodeElement_MetaString*)cur_meta)->Value.begin()->data()); + + pSceneNode.mMetaData->Set(meta_idx, cur_meta->Name, tstr); + } + } + else + { + throw DeadlyImportError("Postprocess. Unknown metadata type."); + }// if((*it)->Type == CX3DImporter_NodeElement::ENET_Meta*) else + }// for(std::list::const_iterator it = meta_list.begin(); it != meta_list.end(); it++) + }// if(meta_list.size() > 0) +} + +}// namespace Assimp + +#endif // !ASSIMP_BUILD_NO_X3D_IMPORTER diff --git a/code/X3DImporter_Rendering.cpp b/code/X3DImporter_Rendering.cpp new file mode 100644 index 000000000..ce0d7b607 --- /dev/null +++ b/code/X3DImporter_Rendering.cpp @@ -0,0 +1,974 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +/// \file X3DImporter_Rendering.cpp +/// \brief Parsing data from nodes of "Rendering" set of X3D. +/// \date 2015-2016 +/// \author smal.root@gmail.com + +#ifndef ASSIMP_BUILD_NO_X3D_IMPORTER + +#include "X3DImporter.hpp" +#include "X3DImporter_Macro.hpp" + +namespace Assimp +{ + +// +void X3DImporter::ParseNode_Rendering_Color() +{ + std::string use, def; + std::list color; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_REF("color", color, XML_ReadNode_GetAttrVal_AsListCol3f); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Color, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Color(NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + ((CX3DImporter_NodeElement_Color*)ne)->Value = color; + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "Color"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +void X3DImporter::ParseNode_Rendering_ColorRGBA() +{ + std::string use, def; + std::list color; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_REF("color", color, XML_ReadNode_GetAttrVal_AsListCol4f); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_ColorRGBA, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_ColorRGBA(NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + ((CX3DImporter_NodeElement_ColorRGBA*)ne)->Value = color; + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "ColorRGBA"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +void X3DImporter::ParseNode_Rendering_Coordinate() +{ + std::string use, def; + std::list point; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_REF("point", point, XML_ReadNode_GetAttrVal_AsListVec3f); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Coordinate, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Coordinate(NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + ((CX3DImporter_NodeElement_Coordinate*)ne)->Value = point; + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "Coordinate"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +// +// ColorCoordinateContentModel is the child-node content model corresponding to IndexedLineSet, LineSet and PointSet. ColorCoordinateContentModel can +// contain any-order Coordinate node with Color (or ColorRGBA) node. No more than one instance of any single node type is allowed. +// A ProtoInstance node (with the proper node type) can be substituted for any node in this content model. +// +void X3DImporter::ParseNode_Rendering_IndexedLineSet() +{ + std::string use, def; + std::list colorIndex; + bool colorPerVertex = true; + std::list coordIndex; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_REF("colorIndex", colorIndex, XML_ReadNode_GetAttrVal_AsListI32); + MACRO_ATTRREAD_CHECK_RET("colorPerVertex", colorPerVertex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_REF("coordIndex", coordIndex, XML_ReadNode_GetAttrVal_AsListI32); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_IndexedLineSet, ne); + } + else + { + // check data + if((coordIndex.size() < 2) || ((coordIndex.back() == (-1)) && (coordIndex.size() < 3))) + throw DeadlyImportError("IndexedLineSet must contain not empty \"coordIndex\" attribute."); + + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_IndexedSet(CX3DImporter_NodeElement::ENET_IndexedLineSet, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + CX3DImporter_NodeElement_IndexedSet& ne_alias = *((CX3DImporter_NodeElement_IndexedSet*)ne); + + ne_alias.ColorIndex = colorIndex; + ne_alias.ColorPerVertex = colorPerVertex; + ne_alias.CoordIndex = coordIndex; + // check for child nodes + if(!mReader->isEmptyElement()) + { + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("IndexedLineSet"); + // check for Color and Coordinate nodes + if(XML_CheckNode_NameEqual("Color")) { ParseNode_Rendering_Color(); continue; } + if(XML_CheckNode_NameEqual("ColorRGBA")) { ParseNode_Rendering_ColorRGBA(); continue; } + if(XML_CheckNode_NameEqual("Coordinate")) { ParseNode_Rendering_Coordinate(); continue; } + // check for X3DMetadataObject + if(!ParseHelper_CheckRead_X3DMetadataObject()) XML_CheckNode_SkipUnsupported("IndexedLineSet"); + + MACRO_NODECHECK_LOOPEND("IndexedLineSet"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + } + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +// +// ComposedGeometryContentModel is the child-node content model corresponding to X3DComposedGeometryNodes. It can contain Color (or ColorRGBA), Coordinate, +// Normal and TextureCoordinate, in any order. No more than one instance of these nodes is allowed. Multiple VertexAttribute (FloatVertexAttribute, +// Matrix3VertexAttribute, Matrix4VertexAttribute) nodes can also be contained. +// A ProtoInstance node (with the proper node type) can be substituted for any node in this content model. +// +void X3DImporter::ParseNode_Rendering_IndexedTriangleFanSet() +{ + std::string use, def; + bool ccw = true; + bool colorPerVertex = true; + std::list index; + bool normalPerVertex = true; + bool solid = true; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("ccw", ccw, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("colorPerVertex", colorPerVertex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_REF("index", index, XML_ReadNode_GetAttrVal_AsListI32); + MACRO_ATTRREAD_CHECK_RET("normalPerVertex", normalPerVertex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("solid", solid, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_IndexedTriangleFanSet, ne); + } + else + { + // check data + if(index.size() == 0) throw DeadlyImportError("IndexedTriangleFanSet must contain not empty \"index\" attribute."); + + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_IndexedSet(CX3DImporter_NodeElement::ENET_IndexedTriangleFanSet, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + CX3DImporter_NodeElement_IndexedSet& ne_alias = *((CX3DImporter_NodeElement_IndexedSet*)ne); + + ne_alias.CCW = ccw; + ne_alias.ColorPerVertex = colorPerVertex; + ne_alias.CoordIndex = index; + ne_alias.NormalPerVertex = normalPerVertex; + ne_alias.Solid = solid; + // check for child nodes + if(!mReader->isEmptyElement()) + { + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("IndexedTriangleFanSet"); + // check for X3DComposedGeometryNodes + if(XML_CheckNode_NameEqual("Color")) { ParseNode_Rendering_Color(); continue; } + if(XML_CheckNode_NameEqual("ColorRGBA")) { ParseNode_Rendering_ColorRGBA(); continue; } + if(XML_CheckNode_NameEqual("Coordinate")) { ParseNode_Rendering_Coordinate(); continue; } + if(XML_CheckNode_NameEqual("Normal")) { ParseNode_Rendering_Normal(); continue; } + if(XML_CheckNode_NameEqual("TextureCoordinate")) { ParseNode_Texturing_TextureCoordinate(); continue; } + // check for X3DMetadataObject + if(!ParseHelper_CheckRead_X3DMetadataObject()) XML_CheckNode_SkipUnsupported("IndexedTriangleFanSet"); + + MACRO_NODECHECK_LOOPEND("IndexedTriangleFanSet"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + } + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +// +// ComposedGeometryContentModel is the child-node content model corresponding to X3DComposedGeometryNodes. It can contain Color (or ColorRGBA), Coordinate, +// Normal and TextureCoordinate, in any order. No more than one instance of these nodes is allowed. Multiple VertexAttribute (FloatVertexAttribute, +// Matrix3VertexAttribute, Matrix4VertexAttribute) nodes can also be contained. +// A ProtoInstance node (with the proper node type) can be substituted for any node in this content model. +// +void X3DImporter::ParseNode_Rendering_IndexedTriangleSet() +{ + std::string use, def; + bool ccw = true; + bool colorPerVertex = true; + std::list index; + bool normalPerVertex = true; + bool solid = true; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("ccw", ccw, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("colorPerVertex", colorPerVertex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_REF("index", index, XML_ReadNode_GetAttrVal_AsListI32); + MACRO_ATTRREAD_CHECK_RET("normalPerVertex", normalPerVertex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("solid", solid, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_IndexedTriangleSet, ne); + } + else + { + // check data + if(index.size() == 0) throw DeadlyImportError("IndexedTriangleSet must contain not empty \"index\" attribute."); + + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_IndexedSet(CX3DImporter_NodeElement::ENET_IndexedTriangleSet, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + CX3DImporter_NodeElement_IndexedSet& ne_alias = *((CX3DImporter_NodeElement_IndexedSet*)ne); + + ne_alias.CCW = ccw; + ne_alias.ColorPerVertex = colorPerVertex; + ne_alias.CoordIndex = index; + ne_alias.NormalPerVertex = normalPerVertex; + ne_alias.Solid = solid; + // check for child nodes + if(!mReader->isEmptyElement()) + { + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("IndexedTriangleSet"); + // check for X3DComposedGeometryNodes + if(XML_CheckNode_NameEqual("Color")) { ParseNode_Rendering_Color(); continue; } + if(XML_CheckNode_NameEqual("ColorRGBA")) { ParseNode_Rendering_ColorRGBA(); continue; } + if(XML_CheckNode_NameEqual("Coordinate")) { ParseNode_Rendering_Coordinate(); continue; } + if(XML_CheckNode_NameEqual("Normal")) { ParseNode_Rendering_Normal(); continue; } + if(XML_CheckNode_NameEqual("TextureCoordinate")) { ParseNode_Texturing_TextureCoordinate(); continue; } + // check for X3DMetadataObject + if(!ParseHelper_CheckRead_X3DMetadataObject()) XML_CheckNode_SkipUnsupported("IndexedTriangleSet"); + + MACRO_NODECHECK_LOOPEND("IndexedTriangleSet"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + } + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +// +// ComposedGeometryContentModel is the child-node content model corresponding to X3DComposedGeometryNodes. It can contain Color (or ColorRGBA), Coordinate, +// Normal and TextureCoordinate, in any order. No more than one instance of these nodes is allowed. Multiple VertexAttribute (FloatVertexAttribute, +// Matrix3VertexAttribute, Matrix4VertexAttribute) nodes can also be contained. +// A ProtoInstance node (with the proper node type) can be substituted for any node in this content model. +// +void X3DImporter::ParseNode_Rendering_IndexedTriangleStripSet() +{ + std::string use, def; + bool ccw = true; + bool colorPerVertex = true; + std::list index; + bool normalPerVertex = true; + bool solid = true; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("ccw", ccw, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("colorPerVertex", colorPerVertex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_REF("index", index, XML_ReadNode_GetAttrVal_AsListI32); + MACRO_ATTRREAD_CHECK_RET("normalPerVertex", normalPerVertex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("solid", solid, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_IndexedTriangleStripSet, ne); + } + else + { + // check data + if(index.size() == 0) throw DeadlyImportError("IndexedTriangleStripSet must contain not empty \"index\" attribute."); + + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_IndexedSet(CX3DImporter_NodeElement::ENET_IndexedTriangleStripSet, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + CX3DImporter_NodeElement_IndexedSet& ne_alias = *((CX3DImporter_NodeElement_IndexedSet*)ne); + + ne_alias.CCW = ccw; + ne_alias.ColorPerVertex = colorPerVertex; + ne_alias.CoordIndex = index; + ne_alias.NormalPerVertex = normalPerVertex; + ne_alias.Solid = solid; + // check for child nodes + if(!mReader->isEmptyElement()) + { + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("IndexedTriangleStripSet"); + // check for X3DComposedGeometryNodes + if(XML_CheckNode_NameEqual("Color")) { ParseNode_Rendering_Color(); continue; } + if(XML_CheckNode_NameEqual("ColorRGBA")) { ParseNode_Rendering_ColorRGBA(); continue; } + if(XML_CheckNode_NameEqual("Coordinate")) { ParseNode_Rendering_Coordinate(); continue; } + if(XML_CheckNode_NameEqual("Normal")) { ParseNode_Rendering_Normal(); continue; } + if(XML_CheckNode_NameEqual("TextureCoordinate")) { ParseNode_Texturing_TextureCoordinate(); continue; } + // check for X3DMetadataObject + if(!ParseHelper_CheckRead_X3DMetadataObject()) XML_CheckNode_SkipUnsupported("IndexedTriangleStripSet"); + + MACRO_NODECHECK_LOOPEND("IndexedTriangleStripSet"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + } + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +// +// ColorCoordinateContentModel is the child-node content model corresponding to IndexedLineSet, LineSet and PointSet. ColorCoordinateContentModel can +// contain any-order Coordinate node with Color (or ColorRGBA) node. No more than one instance of any single node type is allowed. +// A ProtoInstance node (with the proper node type) can be substituted for any node in this content model. +// +void X3DImporter::ParseNode_Rendering_LineSet() +{ + std::string use, def; + std::list vertexCount; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_REF("vertexCount", vertexCount, XML_ReadNode_GetAttrVal_AsListI32); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_LineSet, ne); + } + else + { + // check data + if(vertexCount.size() == 0) throw DeadlyImportError("LineSet must contain not empty \"vertexCount\" attribute."); + + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Set(CX3DImporter_NodeElement::ENET_LineSet, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + CX3DImporter_NodeElement_Set& ne_alias = *((CX3DImporter_NodeElement_Set*)ne); + + ne_alias.VertexCount = vertexCount; + // create CoordIdx + size_t coord_num = 0; + + ne_alias.CoordIndex.clear(); + for(std::list::const_iterator vc_it = ne_alias.VertexCount.begin(); vc_it != ne_alias.VertexCount.end(); vc_it++) + { + if(*vc_it < 2) throw DeadlyImportError("LineSet. vertexCount shall be greater than or equal to two."); + + for(int32_t i = 0; i < *vc_it; i++) ne_alias.CoordIndex.push_back(coord_num++);// add vertices indices + + ne_alias.CoordIndex.push_back(-1);// add face delimiter. + } + + // check for child nodes + if(!mReader->isEmptyElement()) + { + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("LineSet"); + // check for X3DComposedGeometryNodes + if(XML_CheckNode_NameEqual("Color")) { ParseNode_Rendering_Color(); continue; } + if(XML_CheckNode_NameEqual("ColorRGBA")) { ParseNode_Rendering_ColorRGBA(); continue; } + if(XML_CheckNode_NameEqual("Coordinate")) { ParseNode_Rendering_Coordinate(); continue; } + // check for X3DMetadataObject + if(!ParseHelper_CheckRead_X3DMetadataObject()) XML_CheckNode_SkipUnsupported("LineSet"); + + MACRO_NODECHECK_LOOPEND("LineSet"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + } + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +// +// ColorCoordinateContentModel is the child-node content model corresponding to IndexedLineSet, LineSet and PointSet. ColorCoordinateContentModel can +// contain any-order Coordinate node with Color (or ColorRGBA) node. No more than one instance of any single node type is allowed. +// A ProtoInstance node (with the proper node type) can be substituted for any node in this content model. +// +void X3DImporter::ParseNode_Rendering_PointSet() +{ + std::string use, def; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_PointSet, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_IndexedSet(CX3DImporter_NodeElement::ENET_PointSet, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + // check for child nodes + if(!mReader->isEmptyElement()) + { + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("PointSet"); + // check for X3DComposedGeometryNodes + if(XML_CheckNode_NameEqual("Color")) { ParseNode_Rendering_Color(); continue; } + if(XML_CheckNode_NameEqual("ColorRGBA")) { ParseNode_Rendering_ColorRGBA(); continue; } + if(XML_CheckNode_NameEqual("Coordinate")) { ParseNode_Rendering_Coordinate(); continue; } + // check for X3DMetadataObject + if(!ParseHelper_CheckRead_X3DMetadataObject()) XML_CheckNode_SkipUnsupported("PointSet"); + + MACRO_NODECHECK_LOOPEND("PointSet"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + } + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +// +// ComposedGeometryContentModel is the child-node content model corresponding to X3DComposedGeometryNodes. It can contain Color (or ColorRGBA), Coordinate, +// Normal and TextureCoordinate, in any order. No more than one instance of these nodes is allowed. Multiple VertexAttribute (FloatVertexAttribute, +// Matrix3VertexAttribute, Matrix4VertexAttribute) nodes can also be contained. +// A ProtoInstance node (with the proper node type) can be substituted for any node in this content model. +// +void X3DImporter::ParseNode_Rendering_TriangleFanSet() +{ + std::string use, def; + bool ccw = true; + bool colorPerVertex = true; + std::list fanCount; + bool normalPerVertex = true; + bool solid = true; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("ccw", ccw, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("colorPerVertex", colorPerVertex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_REF("fanCount", fanCount, XML_ReadNode_GetAttrVal_AsListI32); + MACRO_ATTRREAD_CHECK_RET("normalPerVertex", normalPerVertex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("solid", solid, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_TriangleFanSet, ne); + } + else + { + // check data + if(fanCount.size() == 0) throw DeadlyImportError("TriangleFanSet must contain not empty \"fanCount\" attribute."); + + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Set(CX3DImporter_NodeElement::ENET_TriangleFanSet, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + CX3DImporter_NodeElement_Set& ne_alias = *((CX3DImporter_NodeElement_Set*)ne); + + ne_alias.CCW = ccw; + ne_alias.ColorPerVertex = colorPerVertex; + ne_alias.VertexCount = fanCount; + ne_alias.NormalPerVertex = normalPerVertex; + ne_alias.Solid = solid; + // create CoordIdx + size_t coord_num_first, coord_num_prev; + + ne_alias.CoordIndex.clear(); + // assign indices for first triangle + coord_num_first = 0; + coord_num_prev = 1; + for(std::list::const_iterator vc_it = ne_alias.VertexCount.begin(); vc_it != ne_alias.VertexCount.end(); vc_it++) + { + if(*vc_it < 3) throw DeadlyImportError("TriangleFanSet. fanCount shall be greater than or equal to three."); + + for(int32_t vc = 2; vc < *vc_it; vc++) + { + if(ccw) + { + // 2 1 + // 0 + ne_alias.CoordIndex.push_back(coord_num_first);// first vertex is a center and always is [0]. + ne_alias.CoordIndex.push_back(coord_num_prev++); + ne_alias.CoordIndex.push_back(coord_num_prev); + } + else + { + // 1 2 + // 0 + ne_alias.CoordIndex.push_back(coord_num_first);// first vertex is a center and always is [0]. + ne_alias.CoordIndex.push_back(coord_num_prev + 1); + ne_alias.CoordIndex.push_back(coord_num_prev++); + }// if(ccw) else + + ne_alias.CoordIndex.push_back(-1);// add face delimiter. + }// for(int32_t vc = 2; vc < *vc_it; vc++) + + coord_num_prev++;// that index will be center of next fan + coord_num_first = coord_num_prev++;// forward to next point - second point of fan + }// for(std::list::const_iterator vc_it = ne_alias.VertexCount.begin(); vc_it != ne_alias.VertexCount.end(); vc_it++) + // check for child nodes + if(!mReader->isEmptyElement()) + { + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("TriangleFanSet"); + // check for X3DComposedGeometryNodes + if(XML_CheckNode_NameEqual("Color")) { ParseNode_Rendering_Color(); continue; } + if(XML_CheckNode_NameEqual("ColorRGBA")) { ParseNode_Rendering_ColorRGBA(); continue; } + if(XML_CheckNode_NameEqual("Coordinate")) { ParseNode_Rendering_Coordinate(); continue; } + if(XML_CheckNode_NameEqual("Normal")) { ParseNode_Rendering_Normal(); continue; } + if(XML_CheckNode_NameEqual("TextureCoordinate")) { ParseNode_Texturing_TextureCoordinate(); continue; } + // check for X3DMetadataObject + if(!ParseHelper_CheckRead_X3DMetadataObject()) XML_CheckNode_SkipUnsupported("TriangleFanSet"); + + MACRO_NODECHECK_LOOPEND("TriangleFanSet"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + } + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +// +// ComposedGeometryContentModel is the child-node content model corresponding to X3DComposedGeometryNodes. It can contain Color (or ColorRGBA), Coordinate, +// Normal and TextureCoordinate, in any order. No more than one instance of these nodes is allowed. Multiple VertexAttribute (FloatVertexAttribute, +// Matrix3VertexAttribute, Matrix4VertexAttribute) nodes can also be contained. +// A ProtoInstance node (with the proper node type) can be substituted for any node in this content model. +// +void X3DImporter::ParseNode_Rendering_TriangleSet() +{ + std::string use, def; + bool ccw = true; + bool colorPerVertex = true; + bool normalPerVertex = true; + bool solid = true; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("ccw", ccw, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("colorPerVertex", colorPerVertex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("normalPerVertex", normalPerVertex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("solid", solid, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_TriangleSet, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_IndexedSet(CX3DImporter_NodeElement::ENET_TriangleSet, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + CX3DImporter_NodeElement_Set& ne_alias = *((CX3DImporter_NodeElement_Set*)ne); + + ne_alias.CCW = ccw; + ne_alias.ColorPerVertex = colorPerVertex; + ne_alias.NormalPerVertex = normalPerVertex; + ne_alias.Solid = solid; + // check for child nodes + if(!mReader->isEmptyElement()) + { + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("TriangleSet"); + // check for X3DComposedGeometryNodes + if(XML_CheckNode_NameEqual("Color")) { ParseNode_Rendering_Color(); continue; } + if(XML_CheckNode_NameEqual("ColorRGBA")) { ParseNode_Rendering_ColorRGBA(); continue; } + if(XML_CheckNode_NameEqual("Coordinate")) { ParseNode_Rendering_Coordinate(); continue; } + if(XML_CheckNode_NameEqual("Normal")) { ParseNode_Rendering_Normal(); continue; } + if(XML_CheckNode_NameEqual("TextureCoordinate")) { ParseNode_Texturing_TextureCoordinate(); continue; } + // check for X3DMetadataObject + if(!ParseHelper_CheckRead_X3DMetadataObject()) XML_CheckNode_SkipUnsupported("TriangleSet"); + + MACRO_NODECHECK_LOOPEND("TriangleSet"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + } + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +// +// ComposedGeometryContentModel is the child-node content model corresponding to X3DComposedGeometryNodes. It can contain Color (or ColorRGBA), Coordinate, +// Normal and TextureCoordinate, in any order. No more than one instance of these nodes is allowed. Multiple VertexAttribute (FloatVertexAttribute, +// Matrix3VertexAttribute, Matrix4VertexAttribute) nodes can also be contained. +// A ProtoInstance node (with the proper node type) can be substituted for any node in this content model. +// +void X3DImporter::ParseNode_Rendering_TriangleStripSet() +{ + std::string use, def; + bool ccw = true; + bool colorPerVertex = true; + std::list stripCount; + bool normalPerVertex = true; + bool solid = true; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("ccw", ccw, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("colorPerVertex", colorPerVertex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_REF("stripCount", stripCount, XML_ReadNode_GetAttrVal_AsListI32); + MACRO_ATTRREAD_CHECK_RET("normalPerVertex", normalPerVertex, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("solid", solid, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_TriangleStripSet, ne); + } + else + { + // check data + if(stripCount.size() == 0) throw DeadlyImportError("TriangleStripSet must contain not empty \"stripCount\" attribute."); + + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Set(CX3DImporter_NodeElement::ENET_TriangleStripSet, NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + CX3DImporter_NodeElement_Set& ne_alias = *((CX3DImporter_NodeElement_Set*)ne); + + ne_alias.CCW = ccw; + ne_alias.ColorPerVertex = colorPerVertex; + ne_alias.VertexCount = stripCount; + ne_alias.NormalPerVertex = normalPerVertex; + ne_alias.Solid = solid; + // create CoordIdx + size_t coord_num0, coord_num1, coord_num2;// indices of current triangle + bool odd_tri;// sequence of current triangle + size_t coord_num_sb;// index of first point of strip + + ne_alias.CoordIndex.clear(); + coord_num_sb = 0; + for(std::list::const_iterator vc_it = ne_alias.VertexCount.begin(); vc_it != ne_alias.VertexCount.end(); vc_it++) + { + if(*vc_it < 3) throw DeadlyImportError("TriangleStripSet. stripCount shall be greater than or equal to three."); + + // set initial values for first triangle + coord_num0 = coord_num_sb; + coord_num1 = coord_num_sb + 1; + coord_num2 = coord_num_sb + 2; + odd_tri = true; + + for(int32_t vc = 2; vc < *vc_it; vc++) + { + if(ccw) + { + // 0 2 + // 1 + ne_alias.CoordIndex.push_back(coord_num0); + ne_alias.CoordIndex.push_back(coord_num1); + ne_alias.CoordIndex.push_back(coord_num2); + } + else + { + // 0 1 + // 2 + ne_alias.CoordIndex.push_back(coord_num0); + ne_alias.CoordIndex.push_back(coord_num2); + ne_alias.CoordIndex.push_back(coord_num1); + }// if(ccw) else + + ne_alias.CoordIndex.push_back(-1);// add face delimiter. + // prepare values for next triangle + if(odd_tri) + { + coord_num0 = coord_num2; + coord_num2++; + } + else + { + coord_num1 = coord_num2; + coord_num2 = coord_num1 + 1; + } + + odd_tri = !odd_tri; + coord_num_sb = coord_num2;// that index will be start of next strip + }// for(int32_t vc = 2; vc < *vc_it; vc++) + }// for(std::list::const_iterator vc_it = ne_alias.VertexCount.begin(); vc_it != ne_alias.VertexCount.end(); vc_it++) + // check for child nodes + if(!mReader->isEmptyElement()) + { + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("TriangleStripSet"); + // check for X3DComposedGeometryNodes + if(XML_CheckNode_NameEqual("Color")) { ParseNode_Rendering_Color(); continue; } + if(XML_CheckNode_NameEqual("ColorRGBA")) { ParseNode_Rendering_ColorRGBA(); continue; } + if(XML_CheckNode_NameEqual("Coordinate")) { ParseNode_Rendering_Coordinate(); continue; } + if(XML_CheckNode_NameEqual("Normal")) { ParseNode_Rendering_Normal(); continue; } + if(XML_CheckNode_NameEqual("TextureCoordinate")) { ParseNode_Texturing_TextureCoordinate(); continue; } + // check for X3DMetadataObject + if(!ParseHelper_CheckRead_X3DMetadataObject()) XML_CheckNode_SkipUnsupported("TriangleStripSet"); + + MACRO_NODECHECK_LOOPEND("TriangleStripSet"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + } + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +void X3DImporter::ParseNode_Rendering_Normal() +{ +std::string use, def; +std::list vector; +CX3DImporter_NodeElement* ne; + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_REF("vector", vector, XML_ReadNode_GetAttrVal_AsListVec3f); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Normal, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Normal(NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + ((CX3DImporter_NodeElement_Normal*)ne)->Value = vector; + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "Normal"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +}// namespace Assimp + +#endif // !ASSIMP_BUILD_NO_X3D_IMPORTER diff --git a/code/X3DImporter_Shape.cpp b/code/X3DImporter_Shape.cpp new file mode 100644 index 000000000..7b3c7da77 --- /dev/null +++ b/code/X3DImporter_Shape.cpp @@ -0,0 +1,248 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +/// \file X3DImporter_Shape.cpp +/// \brief Parsing data from nodes of "Shape" set of X3D. +/// \date 2015-2016 +/// \author smal.root@gmail.com + +#ifndef ASSIMP_BUILD_NO_X3D_IMPORTER + +#include "X3DImporter.hpp" +#include "X3DImporter_Macro.hpp" + +namespace Assimp +{ + +// +// +// "ShapeChildContentModel is the child-node content model corresponding to X3DShapeNode. ShapeChildContentModel can contain a single Appearance node and a +// single geometry node, in any order. +// A ProtoInstance node (with the proper node type) can be substituted for any node in this content model." +// +// A Shape node is unlit if either of the following is true: +// The shape's appearance field is NULL (default). +// The material field in the Appearance node is NULL (default). +// NOTE Geometry nodes that represent lines or points do not support lighting. +void X3DImporter::ParseNode_Shape_Shape() +{ + std::string use, def; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Shape, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Shape(NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + // check for child nodes + if(!mReader->isEmptyElement()) + { + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("Shape"); + // check for appearance node + if(XML_CheckNode_NameEqual("Appearance")) { ParseNode_Shape_Appearance(); continue; } + // check for X3DGeometryNodes + if(XML_CheckNode_NameEqual("Arc2D")) { ParseNode_Geometry2D_Arc2D(); continue; } + if(XML_CheckNode_NameEqual("ArcClose2D")) { ParseNode_Geometry2D_ArcClose2D(); continue; } + if(XML_CheckNode_NameEqual("Circle2D")) { ParseNode_Geometry2D_Circle2D(); continue; } + if(XML_CheckNode_NameEqual("Disk2D")) { ParseNode_Geometry2D_Disk2D(); continue; } + if(XML_CheckNode_NameEqual("Polyline2D")) { ParseNode_Geometry2D_Polyline2D(); continue; } + if(XML_CheckNode_NameEqual("Polypoint2D")) { ParseNode_Geometry2D_Polypoint2D(); continue; } + if(XML_CheckNode_NameEqual("Rectangle2D")) { ParseNode_Geometry2D_Rectangle2D(); continue; } + if(XML_CheckNode_NameEqual("TriangleSet2D")) { ParseNode_Geometry2D_TriangleSet2D(); continue; } + if(XML_CheckNode_NameEqual("Box")) { ParseNode_Geometry3D_Box(); continue; } + if(XML_CheckNode_NameEqual("Cone")) { ParseNode_Geometry3D_Cone(); continue; } + if(XML_CheckNode_NameEqual("Cylinder")) { ParseNode_Geometry3D_Cylinder(); continue; } + if(XML_CheckNode_NameEqual("ElevationGrid")) { ParseNode_Geometry3D_ElevationGrid(); continue; } + if(XML_CheckNode_NameEqual("Extrusion")) { ParseNode_Geometry3D_Extrusion(); continue; } + if(XML_CheckNode_NameEqual("IndexedFaceSet")) { ParseNode_Geometry3D_IndexedFaceSet(); continue; } + if(XML_CheckNode_NameEqual("Sphere")) { ParseNode_Geometry3D_Sphere(); continue; } + if(XML_CheckNode_NameEqual("IndexedLineSet")) { ParseNode_Rendering_IndexedLineSet(); continue; } + if(XML_CheckNode_NameEqual("LineSet")) { ParseNode_Rendering_LineSet(); continue; } + if(XML_CheckNode_NameEqual("PointSet")) { ParseNode_Rendering_PointSet(); continue; } + if(XML_CheckNode_NameEqual("IndexedTriangleFanSet")) { ParseNode_Rendering_IndexedTriangleFanSet(); continue; } + if(XML_CheckNode_NameEqual("IndexedTriangleSet")) { ParseNode_Rendering_IndexedTriangleSet(); continue; } + if(XML_CheckNode_NameEqual("IndexedTriangleStripSet")) { ParseNode_Rendering_IndexedTriangleStripSet(); continue; } + if(XML_CheckNode_NameEqual("TriangleFanSet")) { ParseNode_Rendering_TriangleFanSet(); continue; } + if(XML_CheckNode_NameEqual("TriangleSet")) { ParseNode_Rendering_TriangleSet(); continue; } + if(XML_CheckNode_NameEqual("TriangleStripSet")) { ParseNode_Rendering_TriangleStripSet(); continue; } + // check for X3DMetadataObject + if(!ParseHelper_CheckRead_X3DMetadataObject()) XML_CheckNode_SkipUnsupported("Shape"); + + MACRO_NODECHECK_LOOPEND("Shape"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + } + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +// +// "Child-node content model corresponding to X3DAppearanceChildNode. Appearance can contain FillProperties, LineProperties, Material, any Texture node and +// any TextureTransform node, in any order. No more than one instance of these nodes is allowed. Appearance may also contain multiple shaders (ComposedShader, +// PackagedShader, ProgramShader). +// A ProtoInstance node (with the proper node type) can be substituted for any node in this content model." +// +void X3DImporter::ParseNode_Shape_Appearance() +{ + std::string use, def; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Appearance, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Appearance(NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + // check for child nodes + if(!mReader->isEmptyElement()) + { + ParseHelper_Node_Enter(ne); + MACRO_NODECHECK_LOOPBEGIN("Appearance"); + if(XML_CheckNode_NameEqual("Material")) { ParseNode_Shape_Material(); continue; } + if(XML_CheckNode_NameEqual("ImageTexture")) { ParseNode_Texturing_ImageTexture(); continue; } + if(XML_CheckNode_NameEqual("TextureTransform")) { ParseNode_Texturing_TextureTransform(); continue; } + // check for X3DMetadataObject + if(!ParseHelper_CheckRead_X3DMetadataObject()) XML_CheckNode_SkipUnsupported("Appearance"); + + MACRO_NODECHECK_LOOPEND("Appearance"); + ParseHelper_Node_Exit(); + }// if(!mReader->isEmptyElement()) + else + { + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + } + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +void X3DImporter::ParseNode_Shape_Material() +{ + std::string use, def; + float ambientIntensity = 0.2f; + float shininess = 0.2f; + float transparency = 0; + aiColor3D diffuseColor(0.8f, 0.8f, 0.8f); + aiColor3D emissiveColor(0, 0, 0); + aiColor3D specularColor(0, 0, 0); + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("ambientIntensity", ambientIntensity, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_RET("shininess", shininess, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_RET("transparency", transparency, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_REF("diffuseColor", diffuseColor, XML_ReadNode_GetAttrVal_AsCol3f); + MACRO_ATTRREAD_CHECK_REF("emissiveColor", emissiveColor, XML_ReadNode_GetAttrVal_AsCol3f); + MACRO_ATTRREAD_CHECK_REF("specularColor", specularColor, XML_ReadNode_GetAttrVal_AsCol3f); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_Material, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_Material(NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + ((CX3DImporter_NodeElement_Material*)ne)->AmbientIntensity = ambientIntensity; + ((CX3DImporter_NodeElement_Material*)ne)->Shininess = shininess; + ((CX3DImporter_NodeElement_Material*)ne)->Transparency = transparency; + ((CX3DImporter_NodeElement_Material*)ne)->DiffuseColor = diffuseColor; + ((CX3DImporter_NodeElement_Material*)ne)->EmissiveColor = emissiveColor; + ((CX3DImporter_NodeElement_Material*)ne)->SpecularColor = specularColor; + // check for child nodes + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "Material"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +}// namespace Assimp + +#endif // !ASSIMP_BUILD_NO_X3D_IMPORTER diff --git a/code/X3DImporter_Texturing.cpp b/code/X3DImporter_Texturing.cpp new file mode 100644 index 000000000..8372a231b --- /dev/null +++ b/code/X3DImporter_Texturing.cpp @@ -0,0 +1,195 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +/// \file X3DImporter_Texturing.cpp +/// \brief Parsing data from nodes of "Texturing" set of X3D. +/// \date 2015-2016 +/// \author smal.root@gmail.com + +#ifndef ASSIMP_BUILD_NO_X3D_IMPORTER + +#include "X3DImporter.hpp" +#include "X3DImporter_Macro.hpp" + +namespace Assimp +{ + +// +// When the url field contains no values ([]), texturing is disabled. +void X3DImporter::ParseNode_Texturing_ImageTexture() +{ + std::string use, def; + bool repeatS = true; + bool repeatT = true; + std::list url; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_RET("repeatS", repeatS, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_RET("repeatT", repeatT, XML_ReadNode_GetAttrVal_AsBool); + MACRO_ATTRREAD_CHECK_REF("url", url, XML_ReadNode_GetAttrVal_AsListS); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_ImageTexture, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_ImageTexture(NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + ((CX3DImporter_NodeElement_ImageTexture*)ne)->RepeatS = repeatS; + ((CX3DImporter_NodeElement_ImageTexture*)ne)->RepeatT = repeatT; + // Attribute "url" can contain list of strings. But we need only one - first. + if(url.size() > 0) + ((CX3DImporter_NodeElement_ImageTexture*)ne)->URL = url.front(); + else + ((CX3DImporter_NodeElement_ImageTexture*)ne)->URL = ""; + + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "ImageTexture"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +void X3DImporter::ParseNode_Texturing_TextureCoordinate() +{ + std::string use, def; + std::list point; + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_REF("point", point, XML_ReadNode_GetAttrVal_AsListVec2f); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_TextureCoordinate, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_TextureCoordinate(NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + ((CX3DImporter_NodeElement_TextureCoordinate*)ne)->Value = point; + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "TextureCoordinate"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +// +void X3DImporter::ParseNode_Texturing_TextureTransform() +{ + std::string use, def; + aiVector2D center(0, 0); + float rotation = 0; + aiVector2D scale(1, 1); + aiVector2D translation(0, 0); + CX3DImporter_NodeElement* ne( nullptr ); + + MACRO_ATTRREAD_LOOPBEG; + MACRO_ATTRREAD_CHECKUSEDEF_RET(def, use); + MACRO_ATTRREAD_CHECK_REF("center", center, XML_ReadNode_GetAttrVal_AsVec2f); + MACRO_ATTRREAD_CHECK_RET("rotation", rotation, XML_ReadNode_GetAttrVal_AsFloat); + MACRO_ATTRREAD_CHECK_REF("scale", scale, XML_ReadNode_GetAttrVal_AsVec2f); + MACRO_ATTRREAD_CHECK_REF("translation", translation, XML_ReadNode_GetAttrVal_AsVec2f); + MACRO_ATTRREAD_LOOPEND; + + // if "USE" defined then find already defined element. + if(!use.empty()) + { + MACRO_USE_CHECKANDAPPLY(def, use, ENET_TextureTransform, ne); + } + else + { + // create and if needed - define new geometry object. + ne = new CX3DImporter_NodeElement_TextureTransform(NodeElement_Cur); + if(!def.empty()) ne->ID = def; + + ((CX3DImporter_NodeElement_TextureTransform*)ne)->Center = center; + ((CX3DImporter_NodeElement_TextureTransform*)ne)->Rotation = rotation; + ((CX3DImporter_NodeElement_TextureTransform*)ne)->Scale = scale; + ((CX3DImporter_NodeElement_TextureTransform*)ne)->Translation = translation; + // check for X3DMetadataObject childs. + if(!mReader->isEmptyElement()) + ParseNode_Metadata(ne, "TextureTransform"); + else + NodeElement_Cur->Child.push_back(ne);// add made object as child to current element + + NodeElement_List.push_back(ne);// add element to node element list because its a new object in graph + }// if(!use.empty()) else +} + +}// namespace Assimp + +#endif // !ASSIMP_BUILD_NO_X3D_IMPORTER diff --git a/code/XFileParser.cpp b/code/XFileParser.cpp index 7c47ae7fd..83d017d92 100644 --- a/code/XFileParser.cpp +++ b/code/XFileParser.cpp @@ -731,7 +731,7 @@ void XFileParser::ParseDataObjectMaterial( Material* pMaterial) std::string matName; readHeadOfDataObject( &matName); if( matName.empty()) - matName = std::string( "material") + std::to_string( mLineNumber ); + matName = std::string( "material") + to_string( mLineNumber ); pMaterial->mName = matName; pMaterial->mIsReference = false; diff --git a/code/XGLLoader.cpp b/code/XGLLoader.cpp index 2df72849b..30f520097 100644 --- a/code/XGLLoader.cpp +++ b/code/XGLLoader.cpp @@ -501,7 +501,7 @@ aiMatrix4x4 XGLImporter::ReadTrafo() up.Normalize(); right = forward ^ up; - if (fabs(up * forward) > 1e-4) { + if (std::fabs(up * forward) > 1e-4) { // this is definitely wrong - a degenerate coordinate space ruins everything // so subtitute identity transform. LogError(" and vectors in are skewing, ignoring trafo"); diff --git a/code/glTFAsset.h b/code/glTFAsset.h index 6d5ac1a71..2e49b0d8f 100644 --- a/code/glTFAsset.h +++ b/code/glTFAsset.h @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- @@ -50,6 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include #include #include #include @@ -127,6 +128,7 @@ namespace glTF struct BufferView; // here due to cross-reference struct Texture; struct Light; + struct Skin; // Vec/matrix types, as raw float arrays @@ -235,6 +237,32 @@ namespace glTF BufferViewTarget_ELEMENT_ARRAY_BUFFER = 34963 }; + //! Values for the Sampler::magFilter field + enum SamplerMagFilter + { + SamplerMagFilter_Nearest = 9728, + SamplerMagFilter_Linear = 9729 + }; + + //! Values for the Sampler::minFilter field + enum SamplerMinFilter + { + SamplerMinFilter_Nearest = 9728, + SamplerMinFilter_Linear = 9729, + SamplerMinFilter_Nearest_Mipmap_Nearest = 9984, + SamplerMinFilter_Linear_Mipmap_Nearest = 9985, + SamplerMinFilter_Nearest_Mipmap_Linear = 9986, + SamplerMinFilter_Linear_Mipmap_Linear = 9987 + }; + + //! Values for the Sampler::wrapS and Sampler::wrapT field + enum SamplerWrap + { + SamplerWrap_Clamp_To_Edge = 33071, + SamplerWrap_Mirrored_Repeat = 33648, + SamplerWrap_Repeat = 10497 + }; + //! Values for the Texture::format and Texture::internalFormat fields enum TextureFormat { @@ -361,8 +389,6 @@ namespace glTF { return id; } }; - - // // Classes for each glTF top-level object type // @@ -378,8 +404,8 @@ namespace glTF ComponentType componentType; //!< The datatype of components in the attribute. (required) unsigned int count; //!< The number of attributes referenced by this accessor. (required) AttribType::Value type; //!< Specifies if the attribute is a scalar, vector, or matrix. (required) - //std::vector max; //!< Maximum value of each component in this attribute. - //std::vector min; //!< Minimum value of each component in this attribute. + std::vector max; //!< Maximum value of each component in this attribute. + std::vector min; //!< Minimum value of each component in this attribute. unsigned int GetNumComponents(); unsigned int GetBytesPerComponent(); @@ -430,53 +456,117 @@ namespace glTF void Read(Value& obj, Asset& r); }; - - struct Animation : public Object - { - struct Channel - { - - }; - - struct Target - { - - }; - - struct Sampler - { - - }; - }; - //! A buffer points to binary geometry, animation, or skins. struct Buffer : public Object - { - public: + { + /********************* Types *********************/ + public: - enum Type - { - Type_arraybuffer, - Type_text - }; + enum Type + { + Type_arraybuffer, + Type_text + }; - //std::string uri; //!< The uri of the buffer. Can be a filepath, a data uri, etc. (required) - size_t byteLength; //!< The length of the buffer in bytes. (default: 0) - //std::string type; //!< XMLHttpRequest responseType (default: "arraybuffer") + /// \struct SEncodedRegion + /// Descriptor of encoded region in "bufferView". + struct SEncodedRegion + { + const size_t Offset;///< Offset from begin of "bufferView" to encoded region, in bytes. + const size_t EncodedData_Length;///< Size of encoded region, in bytes. + uint8_t* const DecodedData;///< Cached encoded data. + const size_t DecodedData_Length;///< Size of decoded region, in bytes. + const std::string ID;///< ID of the region. - Type type; + /// \fn SEncodedRegion(const size_t pOffset, const size_t pEncodedData_Length, uint8_t* pDecodedData, const size_t pDecodedData_Length, const std::string pID) + /// Constructor. + /// \param [in] pOffset - offset from begin of "bufferView" to encoded region, in bytes. + /// \param [in] pEncodedData_Length - size of encoded region, in bytes. + /// \param [in] pDecodedData - pointer to decoded data array. + /// \param [in] pDecodedData_Length - size of encoded region, in bytes. + /// \param [in] pID - ID of the region. + SEncodedRegion(const size_t pOffset, const size_t pEncodedData_Length, uint8_t* pDecodedData, const size_t pDecodedData_Length, const std::string pID) + : Offset(pOffset), EncodedData_Length(pEncodedData_Length), DecodedData(pDecodedData), DecodedData_Length(pDecodedData_Length), ID(pID) + {} - private: - shared_ptr mData; //!< Pointer to the data - bool mIsSpecial; //!< Set to true for special cases (e.g. the body buffer) + /// \fn ~SEncodedRegion() + /// Destructor. + ~SEncodedRegion() { delete [] DecodedData; } + }; - public: - Buffer(); + /******************* Variables *******************/ - void Read(Value& obj, Asset& r); + //std::string uri; //!< The uri of the buffer. Can be a filepath, a data uri, etc. (required) + size_t byteLength; //!< The length of the buffer in bytes. (default: 0) + //std::string type; //!< XMLHttpRequest responseType (default: "arraybuffer") + + Type type; + + /// \var EncodedRegion_Current + /// Pointer to currently active encoded region. + /// Why not decoding all regions at once and not to set one buffer with decoded data? + /// Yes, why not? Even "accessor" point to decoded data. I mean that fields "byteOffset", "byteStride" and "count" has values which describes decoded + /// data array. But only in range of mesh while is active parameters from "compressedData". For another mesh accessors point to decoded data too. But + /// offset is counted for another regions is encoded. + /// Example. You have two meshes. For every of it you have 4 bytes of data. That data compressed to 2 bytes. So, you have buffer with encoded data: + /// M1_E0, M1_E1, M2_E0, M2_E1. + /// After decoding you'll get: + /// M1_D0, M1_D1, M1_D2, M1_D3, M2_D0, M2_D1, M2_D2, M2_D3. + /// "accessors" must to use values that point to decoded data - obviously. So, you'll expect "accessors" like + /// "accessor_0" : { byteOffset: 0, byteLength: 4}, "accessor_1" : { byteOffset: 4, byteLength: 4} + /// but in real life you'll get: + /// "accessor_0" : { byteOffset: 0, byteLength: 4}, "accessor_1" : { byteOffset: 2, byteLength: 4} + /// Yes, accessor of next mesh has offset and length which mean: current mesh data is decoded, all other data is encoded. + /// And when before you start to read data of current mesh (with encoded data ofcourse) you must decode region of "bufferView", after read finished + /// delete encoding mark. And after that you can repeat process: decode data of mesh, read, delete decoded data. + /// + /// Remark. Encoding all data at once is good in world with computers which do not has RAM limitation. So, you must use step by step encoding in + /// exporter and importer. And, thanks to such way, there is no need to load whole file into memory. + SEncodedRegion* EncodedRegion_Current; + + private: + + shared_ptr mData; //!< Pointer to the data + bool mIsSpecial; //!< Set to true for special cases (e.g. the body buffer) + + /// \var EncodedRegion_List + /// List of encoded regions. + std::list EncodedRegion_List; + + /******************* Functions *******************/ + + public: + + Buffer(); + ~Buffer(); + + void Read(Value& obj, Asset& r); bool LoadFromStream(IOStream& stream, size_t length = 0, size_t baseOffset = 0); + /// \fn void EncodedRegion_Mark(const size_t pOffset, const size_t pEncodedData_Length, uint8_t* pDecodedData, const size_t pDecodedData_Length, const std::string& pID) + /// Mark region of "bufferView" as encoded. When data is request from such region then "bufferView" use decoded data. + /// \param [in] pOffset - offset from begin of "bufferView" to encoded region, in bytes. + /// \param [in] pEncodedData_Length - size of encoded region, in bytes. + /// \param [in] pDecodedData - pointer to decoded data array. + /// \param [in] pDecodedData_Length - size of encoded region, in bytes. + /// \param [in] pID - ID of the region. + void EncodedRegion_Mark(const size_t pOffset, const size_t pEncodedData_Length, uint8_t* pDecodedData, const size_t pDecodedData_Length, const std::string& pID); + + /// \fn void EncodedRegion_SetCurrent(const std::string& pID) + /// Select current encoded region by ID. \sa EncodedRegion_Current. + /// \param [in] pID - ID of the region. + void EncodedRegion_SetCurrent(const std::string& pID); + + /// \fn bool ReplaceData(const size_t pBufferData_Offset, const size_t pBufferData_Count, const uint8_t* pReplace_Data, const size_t pReplace_Count) + /// Replace part of buffer data. Pay attention that function work with original array of data (\ref mData) not with encoded regions. + /// \param [in] pBufferData_Offset - index of first element in buffer from which new data will be placed. + /// \param [in] pBufferData_Count - count of bytes in buffer which will be replaced. + /// \param [in] pReplace_Data - pointer to array with new data for buffer. + /// \param [in] pReplace_Count - count of bytes in new data. + /// \return true - if successfully replaced, false if input arguments is out of range. + bool ReplaceData(const size_t pBufferData_Offset, const size_t pBufferData_Count, const uint8_t* pReplace_Data, const size_t pReplace_Count); + size_t AppendData(uint8_t* data, size_t length); void Grow(size_t amount); @@ -489,10 +579,12 @@ namespace glTF bool IsSpecial() const { return mIsSpecial; } + std::string GetURI() + { return std::string(this->id) + ".bin"; } + static const char* TranslateId(Asset& r, const char* id); }; - //! A view into a buffer generally representing a subset of the buffer. struct BufferView : public Object { @@ -502,11 +594,9 @@ namespace glTF BufferViewTarget target; //! The target that the WebGL buffer should be bound to. - BufferView() {} void Read(Value& obj, Asset& r); }; - struct Camera : public Object { enum Type @@ -631,10 +721,77 @@ namespace glTF Ref material; }; + /// \struct SExtension + /// Extension used for mesh. + struct SExtension + { + /// \enum EType + /// Type of extension. + enum EType + { + #ifdef ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC + Compression_Open3DGC,///< Compression of mesh data using Open3DGC algorythm. + #endif + + Unknown + }; + + EType Type;///< Type of extension. + + /// \fn SExtension + /// Constructor. + /// \param [in] pType - type of extension. + SExtension(const EType pType) + : Type(pType) + {} + }; + + #ifdef ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC + /// \struct SCompression_Open3DGC + /// Compression of mesh data using Open3DGC algorythm. + struct SCompression_Open3DGC : public SExtension + { + using SExtension::Type; + + std::string Buffer;///< ID of "buffer" used for storing compressed data. + size_t Offset;///< Offset in "bufferView" where compressed data are stored. + size_t Count;///< Count of elements in compressed data. Is always equivalent to size in bytes: look comments for "Type" and "Component_Type". + bool Binary;///< If true then "binary" mode is used for coding, if false - "ascii" mode. + size_t IndicesCount;///< Count of indices in mesh. + size_t VerticesCount;///< Count of vertices in mesh. + // AttribType::Value Type;///< Is always "SCALAR". + // ComponentType Component_Type;///< Is always "ComponentType_UNSIGNED_BYTE" (5121). + + /// \fn SCompression_Open3DGC + /// Constructor. + SCompression_Open3DGC() + : SExtension(Compression_Open3DGC) + {} + }; + #endif + std::vector primitives; + std::list Extension;///< List of extensions used in mesh. Mesh() {} - void Read(Value& obj, Asset& r); + + /// \fn ~Mesh() + /// Destructor. + ~Mesh() { for(std::list::iterator it = Extension.begin(), it_end = Extension.end(); it != it_end; it++) { delete *it; }; } + + /// \fn void Read(Value& pJSON_Object, Asset& pAsset_Root) + /// Get mesh data from JSON-object and place them to root asset. + /// \param [in] pJSON_Object - reference to pJSON-object from which data are read. + /// \param [out] pAsset_Root - reference to root assed where data will be stored. + void Read(Value& pJSON_Object, Asset& pAsset_Root); + + #ifdef ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC + /// \fn void Decode_O3DGC(const SCompression_Open3DGC& pCompression_Open3DGC, Asset& pAsset_Root) + /// Decode part of "buffer" which encoded with Open3DGC algorithm. + /// \param [in] pCompression_Open3DGC - reference to structure which describe encoded region. + /// \param [out] pAsset_Root - reference to root assed where data will be stored. + void Decode_O3DGC(const SCompression_Open3DGC& pCompression_Open3DGC, Asset& pAsset_Root); + #endif }; struct Node : public Object @@ -650,6 +807,12 @@ namespace glTF Ref camera; Ref light; + std::vector< Ref > skeletons; //!< The ID of skeleton nodes. Each of which is the root of a node hierarchy. + Ref skin; //!< The ID of the skin referenced by this node. + std::string jointName; //!< Name used when this node is a joint in a skin. + + Ref parent; //!< This is not part of the glTF specification. Used as a helper. + Node() {} void Read(Value& obj, Asset& r); }; @@ -663,8 +826,14 @@ namespace glTF struct Sampler : public Object { + SamplerMagFilter magFilter; //!< The texture magnification filter. (required) + SamplerMinFilter minFilter; //!< The texture minification filter. (required) + SamplerWrap wrapS; //!< The texture wrapping in the S direction. (required) + SamplerWrap wrapT; //!< The texture wrapping in the T direction. (required) + Sampler() {} void Read(Value& obj, Asset& r); + void SetDefaults(); }; struct Scene : public Object @@ -683,6 +852,11 @@ namespace glTF struct Skin : public Object { + Nullable bindShapeMatrix; //!< Floating-point 4x4 transformation matrix stored in column-major order. + Ref inverseBindMatrices; //!< The ID of the accessor containing the floating-point 4x4 inverse-bind matrices. + std::vector> jointNames; //!< Joint names of the joints (nodes with a jointName property) in this skin. + std::string name; //!< The user-defined name of this object. + Skin() {} void Read(Value& obj, Asset& r); }; @@ -711,8 +885,8 @@ namespace glTF //! A texture and its sampler. struct Texture : public Object { - //Ref source; //!< The ID of the sampler used by this texture. (required) - Ref source; //!< The ID of the image used by this texture. (required) + Ref sampler; //!< The ID of the sampler used by this texture. (required) + Ref source; //!< The ID of the image used by this texture. (required) //TextureFormat format; //!< The texture's format. (default: TextureFormat_RGBA) //TextureFormat internalFormat; //!< The texture's internal format. (default: TextureFormat_RGBA) @@ -753,6 +927,44 @@ namespace glTF void SetDefaults(); }; + struct Animation : public Object + { + struct AnimSampler { + std::string id; //!< The ID of this sampler. + std::string input; //!< The ID of a parameter in this animation to use as key-frame input. + std::string interpolation; //!< Type of interpolation algorithm to use between key-frames. + std::string output; //!< The ID of a parameter in this animation to use as key-frame output. + }; + + struct AnimChannel { + std::string sampler; //!< The ID of one sampler present in the containing animation's samplers property. + + struct AnimTarget { + Ref id; //!< The ID of the node to animate. + std::string path; //!< The name of property of the node to animate ("translation", "rotation", or "scale"). + } target; + }; + + struct AnimParameters { + Ref TIME; //!< Accessor reference to a buffer storing a array of floating point scalar values. + Ref rotation; //!< Accessor reference to a buffer storing a array of four-component floating-point vectors. + Ref scale; //!< Accessor reference to a buffer storing a array of three-component floating-point vectors. + Ref translation; //!< Accessor reference to a buffer storing a array of three-component floating-point vectors. + }; + + // AnimChannel Channels[3]; //!< Connect the output values of the key-frame animation to a specific node in the hierarchy. + // AnimParameters Parameters; //!< The samplers that interpolate between the key-frames. + // AnimSampler Samplers[3]; //!< The parameterized inputs representing the key-frame data. + + std::vector Channels; //!< Connect the output values of the key-frame animation to a specific node in the hierarchy. + AnimParameters Parameters; //!< The samplers that interpolate between the key-frames. + std::vector Samplers; //!< The parameterized inputs representing the key-frame data. + + Animation() {} + void Read(Value& obj, Asset& r); + }; + + //! Base class for LazyDict that acts as an interface class LazyDictBase { @@ -772,7 +984,7 @@ namespace glTF //! (Implemented in glTFAssetWriter.h) template void WriteLazyDict(LazyDict& d, AssetWriter& w); - + //! Manages lazy loading of the glTF top-level objects, and keeps a reference to them by ID //! It is the owner the loaded objects, so when it is destroyed it also deletes them @@ -785,7 +997,7 @@ namespace glTF typedef typename std::gltf_unordered_map< std::string, unsigned int > Dict; std::vector mObjs; //! The read objects - Dict mObjsById; //! The read objects accesible by id + Dict mObjsById; //! The read objects accessible by id const char* mDictId; //! ID of the dictionary object const char* mExtId; //! ID of the extension defining the dictionary Value* mDict; //! JSON dictionary object @@ -805,6 +1017,7 @@ namespace glTF Ref Get(const char* id); Ref Get(unsigned int i); + Ref Get(const std::string& pID) { return Get(pID.c_str()); } Ref Create(const char* id); Ref Create(const std::string& id) @@ -833,7 +1046,7 @@ namespace glTF int version; //!< The glTF format version (should be 1) void Read(Document& doc); - + AssetMetadata() : premultipliedAlpha(false) , version(0) @@ -899,10 +1112,10 @@ namespace glTF LazyDict meshes; LazyDict nodes; //LazyDict programs; - //LazyDict samplers; + LazyDict samplers; LazyDict scenes; //LazyDict shaders; - //LazyDict skins; + LazyDict skins; //LazyDict techniques; LazyDict textures; @@ -924,10 +1137,10 @@ namespace glTF , meshes (*this, "meshes") , nodes (*this, "nodes") //, programs (*this, "programs") - //, samplers (*this, "samplers") + , samplers (*this, "samplers") , scenes (*this, "scenes") //, shaders (*this, "shaders") - //, skins (*this, "skins") + , skins (*this, "skins") //, techniques (*this, "techniques") , textures (*this, "textures") , lights (*this, "lights", "KHR_materials_common") diff --git a/code/glTFAsset.inl b/code/glTFAsset.inl index 470246c94..a7afb3424 100644 --- a/code/glTFAsset.inl +++ b/code/glTFAsset.inl @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- @@ -40,12 +40,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "StringUtils.h" +// Header files, Assimp +#include + +#ifdef ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC + // Header files, Open3DGC. +# include +#endif + using namespace Assimp; namespace glTF { namespace { - + // // JSON Value reading helpers // @@ -54,7 +62,7 @@ namespace { struct ReadHelper { static bool Read(Value& val, T& out) { return val.IsInt() ? out = static_cast(val.GetInt()), true : false; }}; - + template<> struct ReadHelper { static bool Read(Value& val, bool& out) { return val.IsBool() ? out = val.GetBool(), true : false; }}; @@ -62,7 +70,7 @@ namespace { template<> struct ReadHelper { static bool Read(Value& val, float& out) { return val.IsNumber() ? out = static_cast(val.GetDouble()), true : false; }}; - + template struct ReadHelper { static bool Read(Value& val, float (&out)[N]) { if (!val.IsArray() || val.Size() != N) return false; for (unsigned int i = 0; i < N; ++i) { @@ -243,9 +251,14 @@ Ref LazyDict::Create(const char* id) inline Buffer::Buffer() -: byteLength(0), type(Type_arraybuffer), mIsSpecial(false) + : byteLength(0), type(Type_arraybuffer), EncodedRegion_Current(nullptr), mIsSpecial(false) { } +inline Buffer::~Buffer() +{ + for(SEncodedRegion* reg : EncodedRegion_List) delete reg; +} + inline const char* Buffer::TranslateId(Asset& r, const char* id) { // Compatibility with old spec @@ -279,14 +292,14 @@ inline void Buffer::Read(Value& obj, Asset& r) this->mData.reset(data); if (statedLength > 0 && this->byteLength != statedLength) { - throw DeadlyImportError("GLTF: buffer \"" + id + "\", expected " + std::to_string(statedLength) + - " bytes, but found " + std::to_string(dataURI.dataLength)); + throw DeadlyImportError("GLTF: buffer \"" + id + "\", expected " + to_string(statedLength) + + " bytes, but found " + to_string(dataURI.dataLength)); } } else { // assume raw data if (statedLength != dataURI.dataLength) { - throw DeadlyImportError("GLTF: buffer \"" + id + "\", expected " + std::to_string(statedLength) + - " bytes, but found " + std::to_string(dataURI.dataLength)); + throw DeadlyImportError("GLTF: buffer \"" + id + "\", expected " + to_string(statedLength) + + " bytes, but found " + to_string(dataURI.dataLength)); } this->mData.reset(new uint8_t[dataURI.dataLength]); @@ -299,7 +312,7 @@ inline void Buffer::Read(Value& obj, Asset& r) if (file) { bool ok = LoadFromStream(*file, byteLength); delete file; - + if (!ok) throw DeadlyImportError("GLTF: error while reading referenced file \"" + std::string(uri) + "\"" ); } @@ -326,6 +339,79 @@ inline bool Buffer::LoadFromStream(IOStream& stream, size_t length, size_t baseO return true; } +inline void Buffer::EncodedRegion_Mark(const size_t pOffset, const size_t pEncodedData_Length, uint8_t* pDecodedData, const size_t pDecodedData_Length, const std::string& pID) +{ + // Check pointer to data + if(pDecodedData == nullptr) throw DeadlyImportError("GLTF: for marking encoded region pointer to decoded data must be provided."); + + // Check offset + if(pOffset > byteLength) + { + const uint8_t val_size = 32; + + char val[val_size]; + + ai_snprintf(val, val_size, "%llu", (long long)pOffset); + throw DeadlyImportError(std::string("GLTF: incorrect offset value (") + val + ") for marking encoded region."); + } + + // Check length + if((pOffset + pEncodedData_Length) > byteLength) + { + const uint8_t val_size = 64; + + char val[val_size]; + + ai_snprintf(val, val_size, "%llu, %llu", (long long)pOffset, (long long)pEncodedData_Length); + throw DeadlyImportError(std::string("GLTF: encoded region with offset/length (") + val + ") is out of range."); + } + + // Add new region + EncodedRegion_List.push_back(new SEncodedRegion(pOffset, pEncodedData_Length, pDecodedData, pDecodedData_Length, pID)); + // And set new value for "byteLength" + byteLength += (pDecodedData_Length - pEncodedData_Length); +} + +inline void Buffer::EncodedRegion_SetCurrent(const std::string& pID) +{ + if((EncodedRegion_Current != nullptr) && (EncodedRegion_Current->ID == pID)) return; + + for(SEncodedRegion* reg : EncodedRegion_List) + { + if(reg->ID == pID) + { + EncodedRegion_Current = reg; + + return; + } + + } + + throw DeadlyImportError("GLTF: EncodedRegion with ID: \"" + pID + "\" not found."); +} + +inline bool Buffer::ReplaceData(const size_t pBufferData_Offset, const size_t pBufferData_Count, const uint8_t* pReplace_Data, const size_t pReplace_Count) +{ +const size_t new_data_size = byteLength + pReplace_Count - pBufferData_Count; + +uint8_t* new_data; + + if((pBufferData_Count == 0) || (pReplace_Count == 0) || (pReplace_Data == nullptr)) return false; + + new_data = new uint8_t[new_data_size]; + // Copy data which place before replacing part. + memcpy(new_data, mData.get(), pBufferData_Offset); + // Copy new data. + memcpy(&new_data[pBufferData_Offset], pReplace_Data, pReplace_Count); + // Copy data which place after replacing part. + memcpy(&new_data[pBufferData_Offset + pReplace_Count], &mData.get()[pBufferData_Offset + pBufferData_Count], pBufferData_Offset); + // Apply new data + mData.reset(new_data); + byteLength = new_data_size; + + return true; +} + inline size_t Buffer::AppendData(uint8_t* data, size_t length) { size_t offset = this->byteLength; @@ -343,6 +429,9 @@ inline void Buffer::Grow(size_t amount) byteLength += amount; } +// +// struct BufferView +// inline void BufferView::Read(Value& obj, Asset& r) { @@ -350,12 +439,14 @@ inline void BufferView::Read(Value& obj, Asset& r) if (bufferId) { buffer = r.buffers.Get(bufferId); } - + byteOffset = MemberOrDefault(obj, "byteOffset", 0u); byteLength = MemberOrDefault(obj, "byteLength", 0u); } - +// +// struct Accessor +// inline void Accessor::Read(Value& obj, Asset& r) { @@ -395,7 +486,18 @@ inline uint8_t* Accessor::GetPointer() if (!basePtr) return 0; size_t offset = byteOffset + bufferView->byteOffset; - return basePtr + offset; + + // Check if region is encoded. + if(bufferView->buffer->EncodedRegion_Current != nullptr) + { + const size_t begin = bufferView->buffer->EncodedRegion_Current->Offset; + const size_t end = begin + bufferView->buffer->EncodedRegion_Current->DecodedData_Length; + + if((offset >= begin) && (offset < end)) + return &bufferView->buffer->EncodedRegion_Current->DecodedData[offset - begin]; + } + + return basePtr + offset; } namespace { @@ -497,7 +599,7 @@ inline Image::Image() inline void Image::Read(Value& obj, Asset& r) { - // Check for extensions first (to detect binary embedded data) + // Check for extensions first (to detect binary embedded data) if (Value* extensions = FindObject(obj, "extensions")) { if (r.extensionsUsed.KHR_binary_glTF) { if (Value* ext = FindObject(*extensions, "KHR_binary_glTF")) { @@ -563,12 +665,35 @@ inline void Image::SetData(uint8_t* data, size_t length, Asset& r) } } +inline void Sampler::Read(Value& obj, Asset& r) +{ + SetDefaults(); + + ReadMember(obj, "magFilter", magFilter); + ReadMember(obj, "minFilter", minFilter); + ReadMember(obj, "wrapS", wrapS); + ReadMember(obj, "wrapT", wrapT); +} + +inline void Sampler::SetDefaults() +{ + magFilter = SamplerMagFilter_Linear; + minFilter = SamplerMinFilter_Linear; + wrapS = SamplerWrap_Repeat; + wrapT = SamplerWrap_Repeat; +} + inline void Texture::Read(Value& obj, Asset& r) { const char* sourcestr; if (ReadMember(obj, "source", sourcestr)) { source = r.images.Get(sourcestr); } + + const char* samplerstr; + if (ReadMember(obj, "sampler", samplerstr)) { + sampler = r.samplers.Get(samplerstr); + } } namespace { @@ -594,6 +719,7 @@ inline void Material::Read(Value& material, Asset& r) ReadMaterialProperty(r, *values, "diffuse", this->diffuse); ReadMaterialProperty(r, *values, "specular", this->specular); + ReadMember(*values, "transparency", transparency); ReadMember(*values, "shininess", shininess); } @@ -678,9 +804,10 @@ namespace { } } -inline void Mesh::Read(Value& obj, Asset& r) -{ - if (Value* primitives = FindArray(obj, "primitives")) { +inline void Mesh::Read(Value& pJSON_Object, Asset& pAsset_Root) +{ + /****************** Mesh primitives ******************/ + if (Value* primitives = FindArray(pJSON_Object, "primitives")) { this->primitives.resize(primitives->Size()); for (unsigned int i = 0; i < primitives->Size(); ++i) { Value& primitive = (*primitives)[i]; @@ -700,22 +827,249 @@ inline void Mesh::Read(Value& obj, Asset& r) if (GetAttribVector(prim, attr, vec, undPos)) { size_t idx = (attr[undPos] == '_') ? atoi(attr + undPos + 1) : 0; if ((*vec).size() <= idx) (*vec).resize(idx + 1); - (*vec)[idx] = r.accessors.Get(it->value.GetString()); + (*vec)[idx] = pAsset_Root.accessors.Get(it->value.GetString()); } } } if (Value* indices = FindString(primitive, "indices")) { - prim.indices = r.accessors.Get(indices->GetString()); + prim.indices = pAsset_Root.accessors.Get(indices->GetString()); } if (Value* material = FindString(primitive, "material")) { - prim.material = r.materials.Get(material->GetString()); + prim.material = pAsset_Root.materials.Get(material->GetString()); } } } + + /****************** Mesh extensions ******************/ + Value* json_extensions = FindObject(pJSON_Object, "extensions"); + + if(json_extensions == nullptr) goto mr_skip_extensions; + + for(Value::MemberIterator it_memb = json_extensions->MemberBegin(); it_memb != json_extensions->MemberEnd(); it_memb++) + { +#ifdef ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC + if(it_memb->name.GetString() == std::string("Open3DGC-compression")) + { + // Search for compressed data. + // Compressed data contain description of part of "buffer" which is encoded. This part must be decoded and + // new data will replace old encoded part by request. In fact \"compressedData\" is kind of "accessor" structure. + Value* comp_data = FindObject(it_memb->value, "compressedData"); + + if(comp_data == nullptr) throw DeadlyImportError("GLTF: \"Open3DGC-compression\" must has \"compressedData\"."); + + DefaultLogger::get()->info("GLTF: Decompressing Open3DGC data."); + + /************** Read data from JSON-document **************/ + #define MESH_READ_COMPRESSEDDATA_MEMBER(pFieldName, pOut) \ + if(!ReadMember(*comp_data, pFieldName, pOut)) \ + { \ + throw DeadlyImportError(std::string("GLTF: \"compressedData\" must has \"") + pFieldName + "\"."); \ + } + + const char* mode_str; + const char* type_str; + ComponentType component_type; + SCompression_Open3DGC* ext_o3dgc = new SCompression_Open3DGC; + + MESH_READ_COMPRESSEDDATA_MEMBER("buffer", ext_o3dgc->Buffer); + MESH_READ_COMPRESSEDDATA_MEMBER("byteOffset", ext_o3dgc->Offset); + MESH_READ_COMPRESSEDDATA_MEMBER("componentType", component_type); + MESH_READ_COMPRESSEDDATA_MEMBER("type", type_str); + MESH_READ_COMPRESSEDDATA_MEMBER("count", ext_o3dgc->Count); + MESH_READ_COMPRESSEDDATA_MEMBER("mode", mode_str); + MESH_READ_COMPRESSEDDATA_MEMBER("indicesCount", ext_o3dgc->IndicesCount); + MESH_READ_COMPRESSEDDATA_MEMBER("verticesCount", ext_o3dgc->VerticesCount); + + #undef MESH_READ_COMPRESSEDDATA_MEMBER + + // Check some values + if(strcmp(type_str, "SCALAR")) throw DeadlyImportError("GLTF: only \"SCALAR\" type is supported for compressed data."); + if(component_type != ComponentType_UNSIGNED_BYTE) throw DeadlyImportError("GLTF: only \"UNSIGNED_BYTE\" component type is supported for compressed data."); + + // Set read/write data mode. + if(strcmp(mode_str, "binary") == 0) + ext_o3dgc->Binary = true; + else if(strcmp(mode_str, "ascii") == 0) + ext_o3dgc->Binary = false; + else + throw DeadlyImportError(std::string("GLTF: for compressed data supported modes is: \"ascii\", \"binary\". Not the: \"") + mode_str + "\"."); + + /************************ Decoding ************************/ + Decode_O3DGC(*ext_o3dgc, pAsset_Root); + Extension.push_back(ext_o3dgc);// store info in mesh extensions list. + }// if(it_memb->name.GetString() == "Open3DGC-compression") + else +#endif + { + throw DeadlyImportError(std::string("GLTF: Unknown mesh extension: \"") + it_memb->name.GetString() + "\"."); + } + }// for(Value::MemberIterator it_memb = json_extensions->MemberBegin(); it_memb != json_extensions->MemberEnd(); json_extensions++) + +mr_skip_extensions: + + return;// After label some operators must be present. } +#ifdef ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC +inline void Mesh::Decode_O3DGC(const SCompression_Open3DGC& pCompression_Open3DGC, Asset& pAsset_Root) +{ +typedef unsigned short IndicesType;///< \sa glTFExporter::ExportMeshes. + +o3dgc::SC3DMCDecoder decoder; +o3dgc::IndexedFaceSet ifs; +o3dgc::BinaryStream bstream; +uint8_t* decoded_data; +size_t decoded_data_size = 0; +Ref buf = pAsset_Root.buffers.Get(pCompression_Open3DGC.Buffer); + + // Read data from buffer and place it in BinaryStream for decoder. + // Just "Count" because always is used type equivalent to uint8_t. + bstream.LoadFromBuffer(&buf->GetPointer()[pCompression_Open3DGC.Offset], pCompression_Open3DGC.Count); + + // After decoding header we can get size of primitives. + if(decoder.DecodeHeader(ifs, bstream) != o3dgc::O3DGC_OK) throw DeadlyImportError("GLTF: can not decode Open3DGC header."); + + /****************** Get sizes of arrays and check sizes ******************/ + // Note. See "Limitations for meshes when using Open3DGC-compression". + + // Indices + size_t size_coordindex = ifs.GetNCoordIndex() * 3;// See float attributes note. + + if(primitives[0].indices->count != size_coordindex) + throw DeadlyImportError("GLTF: Open3DGC. Compressed indices count (" + std::to_string(size_coordindex) + + ") not equal to uncompressed (" + std::to_string(primitives[0].indices->count) + ")."); + + size_coordindex *= sizeof(IndicesType); + // Coordinates + size_t size_coord = ifs.GetNCoord();// See float attributes note. + + if(primitives[0].attributes.position[0]->count != size_coord) + throw DeadlyImportError("GLTF: Open3DGC. Compressed positions count (" + std::to_string(size_coord) + + ") not equal to uncompressed (" + std::to_string(primitives[0].attributes.position[0]->count) + ")."); + + size_coord *= 3 * sizeof(float); + // Normals + size_t size_normal = ifs.GetNNormal();// See float attributes note. + + if(primitives[0].attributes.normal[0]->count != size_normal) + throw DeadlyImportError("GLTF: Open3DGC. Compressed normals count (" + std::to_string(size_normal) + + ") not equal to uncompressed (" + std::to_string(primitives[0].attributes.normal[0]->count) + ")."); + + size_normal *= 3 * sizeof(float); + // Additional attributes. + std::vector size_floatattr; + std::vector size_intattr; + + size_floatattr.resize(ifs.GetNumFloatAttributes()); + size_intattr.resize(ifs.GetNumIntAttributes()); + + decoded_data_size = size_coordindex + size_coord + size_normal; + for(size_t idx = 0, idx_end = size_floatattr.size(), idx_texcoord = 0; idx < idx_end; idx++) + { + // size = number_of_elements * components_per_element * size_of_component. + // Note. But as you can see above, at first we are use this variable in meaning "count". After checking count of objects... + size_t tval = ifs.GetNFloatAttribute(idx); + + switch(ifs.GetFloatAttributeType(idx)) + { + case o3dgc::O3DGC_IFS_FLOAT_ATTRIBUTE_TYPE_TEXCOORD: + // Check situation when encoded data contain texture coordinates but primitive not. + if(idx_texcoord < primitives[0].attributes.texcoord.size()) + { + if(primitives[0].attributes.texcoord[idx]->count != tval) + throw DeadlyImportError("GLTF: Open3DGC. Compressed texture coordinates count (" + std::to_string(tval) + + ") not equal to uncompressed (" + std::to_string(primitives[0].attributes.texcoord[idx]->count) + ")."); + + idx_texcoord++; + } + else + { + ifs.SetNFloatAttribute(idx, 0);// Disable decoding this attribute. + } + + break; + default: + throw DeadlyImportError("GLTF: Open3DGC. Unsupported type of float attribute: " + to_string(ifs.GetFloatAttributeType(idx))); + } + + tval *= ifs.GetFloatAttributeDim(idx) * sizeof(o3dgc::Real);// After checking count of objects we can get size of array. + size_floatattr[idx] = tval; + decoded_data_size += tval; + } + + for(size_t idx = 0, idx_end = size_intattr.size(); idx < idx_end; idx++) + { + // size = number_of_elements * components_per_element * size_of_component. See float attributes note. + size_t tval = ifs.GetNIntAttribute(idx); + switch( ifs.GetIntAttributeType( idx ) ) + { + default: + throw DeadlyImportError("GLTF: Open3DGC. Unsupported type of int attribute: " + to_string(ifs.GetIntAttributeType(idx))); + } + + tval *= ifs.GetIntAttributeDim(idx) * sizeof(long);// See float attributes note. + size_intattr[idx] = tval; + decoded_data_size += tval; + } + + // Create array for decoded data. + decoded_data = new uint8_t[decoded_data_size]; + + /****************** Set right array regions for decoder ******************/ + + auto get_buf_offset = [](Ref& pAccessor) -> size_t { return pAccessor->byteOffset + pAccessor->bufferView->byteOffset; }; + + // Indices + ifs.SetCoordIndex((IndicesType* const)(decoded_data + get_buf_offset(primitives[0].indices))); + // Coordinates + ifs.SetCoord((o3dgc::Real* const)(decoded_data + get_buf_offset(primitives[0].attributes.position[0]))); + // Normals + if(size_normal) + { + ifs.SetNormal((o3dgc::Real* const)(decoded_data + get_buf_offset(primitives[0].attributes.normal[0]))); + } + + for(size_t idx = 0, idx_end = size_floatattr.size(), idx_texcoord = 0; idx < idx_end; idx++) + { + switch(ifs.GetFloatAttributeType(idx)) + { + case o3dgc::O3DGC_IFS_FLOAT_ATTRIBUTE_TYPE_TEXCOORD: + if(idx_texcoord < primitives[0].attributes.texcoord.size()) + { + // See above about absent attributes. + ifs.SetFloatAttribute(idx, (o3dgc::Real* const)(decoded_data + get_buf_offset(primitives[0].attributes.texcoord[idx]))); + idx_texcoord++; + } + + break; + default: + throw DeadlyImportError("GLTF: Open3DGC. Unsupported type of float attribute: " + to_string(ifs.GetFloatAttributeType(idx))); + } + } + + for(size_t idx = 0, idx_end = size_intattr.size(); idx < idx_end; idx++) + { + switch(ifs.GetIntAttributeType(idx)) + { + // ifs.SetIntAttribute(idx, (long* const)(decoded_data + get_buf_offset(primitives[0].attributes.joint))); + default: + throw DeadlyImportError("GLTF: Open3DGC. Unsupported type of int attribute: " + to_string(ifs.GetIntAttributeType(idx))); + } + } + + // + // Decode data + // + if(decoder.DecodePayload(ifs, bstream) != o3dgc::O3DGC_OK) throw DeadlyImportError("GLTF: can not decode Open3DGC data."); + + // Set encoded region for "buffer". + buf->EncodedRegion_Mark(pCompression_Open3DGC.Offset, pCompression_Open3DGC.Count, decoded_data, decoded_data_size, id); + // No. Do not delete "output_data". After calling "EncodedRegion_Mark" bufferView is owner of "output_data". + // "delete [] output_data;" +} +#endif inline void Camera::Read(Value& obj, Asset& r) { @@ -800,7 +1154,7 @@ inline void Node::Read(Value& obj, Asset& r) } } - + if (Value* matrix = FindArray(obj, "matrix")) { ReadValue(*matrix, this->matrix); } @@ -1076,13 +1430,13 @@ inline std::string Asset::FindUniqueID(const std::string& str, const char* suffi id = buffer; it = mUsedIds.find(id); } - + return id; } namespace Util { - inline + inline bool ParseDataURI(const char* const_uri, size_t uriLen, DataURI& out) { if ( NULL == const_uri ) { return false; @@ -1266,6 +1620,4 @@ namespace Util { } -} - - +} // ns glTF diff --git a/code/glTFAssetWriter.h b/code/glTFAssetWriter.h index 370d2c0ab..4d2d3c919 100644 --- a/code/glTFAssetWriter.h +++ b/code/glTFAssetWriter.h @@ -79,6 +79,7 @@ public: AssetWriter(Asset& asset); void WriteFile(const char* path); + void WriteGLBFile(const char* path); }; } diff --git a/code/glTFAssetWriter.inl b/code/glTFAssetWriter.inl index 415db6714..0e7a71eb5 100644 --- a/code/glTFAssetWriter.inl +++ b/code/glTFAssetWriter.inl @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- @@ -56,11 +56,20 @@ namespace glTF { inline Value& MakeValue(Value& val, float(&r)[N], MemoryPoolAllocator<>& al) { val.SetArray(); val.Reserve(N, al); - for (int i = 0; i < N; ++i) { + for (decltype(N) i = 0; i < N; ++i) { val.PushBack(r[i], al); } return val; - }; + } + + inline Value& MakeValue(Value& val, const std::vector & r, MemoryPoolAllocator<>& al) { + val.SetArray(); + val.Reserve(r.size(), al); + for (unsigned int i = 0; i < r.size(); ++i) { + val.PushBack(r[i], al); + } + return val; + } template inline void AddRefsVector(Value& obj, const char* fieldId, std::vector< Ref >& v, MemoryPoolAllocator<>& al) { @@ -72,7 +81,7 @@ namespace glTF { lst.PushBack(StringRef(v[i]->id), al); } obj.AddMember(StringRef(fieldId), lst, al); - }; + } } @@ -85,18 +94,77 @@ namespace glTF { obj.AddMember("componentType", int(a.componentType), w.mAl); obj.AddMember("count", a.count, w.mAl); obj.AddMember("type", StringRef(AttribType::ToString(a.type)), w.mAl); + + Value vTmpMax, vTmpMin; + obj.AddMember("max", MakeValue(vTmpMax, a.max, w.mAl), w.mAl); + obj.AddMember("min", MakeValue(vTmpMin, a.min, w.mAl), w.mAl); } inline void Write(Value& obj, Animation& a, AssetWriter& w) { + /****************** Channels *******************/ + Value channels; + channels.SetArray(); + channels.Reserve(unsigned(a.Channels.size()), w.mAl); + for (size_t i = 0; i < unsigned(a.Channels.size()); ++i) { + Animation::AnimChannel& c = a.Channels[i]; + Value valChannel; + valChannel.SetObject(); + { + valChannel.AddMember("sampler", c.sampler, w.mAl); + + Value valTarget; + valTarget.SetObject(); + { + valTarget.AddMember("id", StringRef(c.target.id->id), w.mAl); + valTarget.AddMember("path", c.target.path, w.mAl); + } + valChannel.AddMember("target", valTarget, w.mAl); + } + channels.PushBack(valChannel, w.mAl); + } + obj.AddMember("channels", channels, w.mAl); + + /****************** Parameters *******************/ + Value valParameters; + valParameters.SetObject(); + { + if (a.Parameters.TIME) { + valParameters.AddMember("TIME", StringRef(a.Parameters.TIME->id), w.mAl); + } + if (a.Parameters.rotation) { + valParameters.AddMember("rotation", StringRef(a.Parameters.rotation->id), w.mAl); + } + if (a.Parameters.scale) { + valParameters.AddMember("scale", StringRef(a.Parameters.scale->id), w.mAl); + } + if (a.Parameters.translation) { + valParameters.AddMember("translation", StringRef(a.Parameters.translation->id), w.mAl); + } + } + obj.AddMember("parameters", valParameters, w.mAl); + + /****************** Samplers *******************/ + Value valSamplers; + valSamplers.SetObject(); + + for (size_t i = 0; i < unsigned(a.Samplers.size()); ++i) { + Animation::AnimSampler& s = a.Samplers[i]; + Value valSampler; + valSampler.SetObject(); + { + valSampler.AddMember("input", s.input, w.mAl); + valSampler.AddMember("interpolation", s.interpolation, w.mAl); + valSampler.AddMember("output", s.output, w.mAl); + } + valSamplers.AddMember(StringRef(s.id), valSampler, w.mAl); + } + obj.AddMember("samplers", valSamplers, w.mAl); } inline void Write(Value& obj, Buffer& b, AssetWriter& w) { - std::string dataURI = "data:application/octet-stream;base64,"; - Util::EncodeBase64(b.GetPointer(), b.byteLength, dataURI); - const char* type; switch (b.type) { case Buffer::Type_text: @@ -107,7 +175,7 @@ namespace glTF { obj.AddMember("byteLength", static_cast(b.byteLength), w.mAl); obj.AddMember("type", StringRef(type), w.mAl); - obj.AddMember("uri", Value(dataURI, w.mAl).Move(), w.mAl); + obj.AddMember("uri", Value(b.GetURI(), w.mAl).Move(), w.mAl); } inline void Write(Value& obj, BufferView& bv, AssetWriter& w) @@ -174,6 +242,9 @@ namespace glTF { WriteColorOrTex(v, m.specular, "specular", w.mAl); WriteColorOrTex(v, m.emission, "emission", w.mAl); + if (m.transparent) + v.AddMember("transparency", m.transparency, w.mAl); + v.AddMember("shininess", m.shininess, w.mAl); } obj.AddMember("values", v, w.mAl); @@ -199,6 +270,60 @@ namespace glTF { inline void Write(Value& obj, Mesh& m, AssetWriter& w) { + /********************* Name **********************/ + obj.AddMember("name", m.name, w.mAl); + + /**************** Mesh extensions ****************/ + if(m.Extension.size() > 0) + { + Value json_extensions; + + json_extensions.SetObject(); + for(Mesh::SExtension* ptr_ext : m.Extension) + { + switch(ptr_ext->Type) + { +#ifdef ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC + case Mesh::SExtension::EType::Compression_Open3DGC: + { + Value json_comp_data; + Mesh::SCompression_Open3DGC* ptr_ext_comp = (Mesh::SCompression_Open3DGC*)ptr_ext; + + // filling object "compressedData" + json_comp_data.SetObject(); + json_comp_data.AddMember("buffer", ptr_ext_comp->Buffer, w.mAl); + json_comp_data.AddMember("byteOffset", ptr_ext_comp->Offset, w.mAl); + json_comp_data.AddMember("componentType", 5121, w.mAl); + json_comp_data.AddMember("type", "SCALAR", w.mAl); + json_comp_data.AddMember("count", ptr_ext_comp->Count, w.mAl); + if(ptr_ext_comp->Binary) + json_comp_data.AddMember("mode", "binary", w.mAl); + else + json_comp_data.AddMember("mode", "ascii", w.mAl); + + json_comp_data.AddMember("indicesCount", ptr_ext_comp->IndicesCount, w.mAl); + json_comp_data.AddMember("verticesCount", ptr_ext_comp->VerticesCount, w.mAl); + // filling object "Open3DGC-compression" + Value json_o3dgc; + + json_o3dgc.SetObject(); + json_o3dgc.AddMember("compressedData", json_comp_data, w.mAl); + // add member to object "extensions" + json_extensions.AddMember("Open3DGC-compression", json_o3dgc, w.mAl); + } + + break; +#endif + default: + throw DeadlyImportError("GLTF: Can not write mesh: unknown mesh extension, only Open3DGC is supported."); + }// switch(ptr_ext->Type) + }// for(Mesh::SExtension* ptr_ext : m.Extension) + + // Add extensions to mesh + obj.AddMember("extensions", json_extensions, w.mAl); + }// if(m.Extension.size() > 0) + + /****************** Primitives *******************/ Value primitives; primitives.SetArray(); primitives.Reserve(unsigned(m.primitives.size()), w.mAl); @@ -231,7 +356,7 @@ namespace glTF { } primitives.PushBack(prim, w.mAl); } - + obj.AddMember("primitives", primitives, w.mAl); } @@ -260,6 +385,16 @@ namespace glTF { AddRefsVector(obj, "children", n.children, w.mAl); AddRefsVector(obj, "meshes", n.meshes, w.mAl); + + AddRefsVector(obj, "skeletons", n.skeletons, w.mAl); + + if (n.skin) { + obj.AddMember("skin", Value(n.skin->id, w.mAl).Move(), w.mAl); + } + + if (!n.jointName.empty()) { + obj.AddMember("jointName", n.jointName, w.mAl); + } } inline void Write(Value& obj, Program& b, AssetWriter& w) @@ -269,7 +404,18 @@ namespace glTF { inline void Write(Value& obj, Sampler& b, AssetWriter& w) { - + if (b.wrapS) { + obj.AddMember("wrapS", b.wrapS, w.mAl); + } + if (b.wrapT) { + obj.AddMember("wrapT", b.wrapT, w.mAl); + } + if (b.magFilter) { + obj.AddMember("magFilter", b.magFilter, w.mAl); + } + if (b.minFilter) { + obj.AddMember("minFilter", b.minFilter, w.mAl); + } } inline void Write(Value& scene, Scene& s, AssetWriter& w) @@ -284,6 +430,24 @@ namespace glTF { inline void Write(Value& obj, Skin& b, AssetWriter& w) { + /****************** jointNames *******************/ + Value vJointNames; + vJointNames.SetArray(); + vJointNames.Reserve(unsigned(b.jointNames.size()), w.mAl); + + for (size_t i = 0; i < unsigned(b.jointNames.size()); ++i) { + vJointNames.PushBack(StringRef(b.jointNames[i]->jointName), w.mAl); + } + obj.AddMember("jointNames", vJointNames, w.mAl); + + if (b.bindShapeMatrix.isPresent) { + Value val; + obj.AddMember("bindShapeMatrix", MakeValue(val, b.bindShapeMatrix.value, w.mAl).Move(), w.mAl); + } + + if (b.inverseBindMatrices) { + obj.AddMember("inverseBindMatrices", Value(b.inverseBindMatrices->id, w.mAl).Move(), w.mAl); + } } @@ -297,6 +461,9 @@ namespace glTF { if (tex.source) { obj.AddMember("source", Value(tex.source->id, w.mAl).Move(), w.mAl); } + if (tex.sampler) { + obj.AddMember("sampler", Value(tex.sampler->id, w.mAl).Move(), w.mAl); + } } inline void Write(Value& obj, Light& b, AssetWriter& w) @@ -328,39 +495,61 @@ namespace glTF { inline void AssetWriter::WriteFile(const char* path) { - bool isBinary = mAsset.extensionsUsed.KHR_binary_glTF; + std::unique_ptr jsonOutFile(mAsset.OpenFile(path, "wt", true)); - std::unique_ptr outfile - (mAsset.OpenFile(path, isBinary ? "wb" : "wt", true)); + if (jsonOutFile == 0) { + throw DeadlyExportError("Could not open output file: " + std::string(path)); + } + + StringBuffer docBuffer; + + PrettyWriter writer(docBuffer); + mDoc.Accept(writer); + + if (jsonOutFile->Write(docBuffer.GetString(), docBuffer.GetSize(), 1) != 1) { + throw DeadlyExportError("Failed to write scene data!"); + } + + // Write buffer data to separate .bin files + for (unsigned int i = 0; i < mAsset.buffers.Size(); ++i) { + Ref b = mAsset.buffers.Get(i); + + std::string binPath = b->GetURI(); + + std::unique_ptr binOutFile(mAsset.OpenFile(binPath, "wb", true)); + + if (binOutFile == 0) { + throw DeadlyExportError("Could not open output file: " + binPath); + } + + if (b->byteLength > 0) { + if (binOutFile->Write(b->GetPointer(), b->byteLength, 1) != 1) { + throw DeadlyExportError("Failed to write binary file: " + binPath); + } + } + } + } + + inline void AssetWriter::WriteGLBFile(const char* path) + { + std::unique_ptr outfile(mAsset.OpenFile(path, "wb", true)); if (outfile == 0) { throw DeadlyExportError("Could not open output file: " + std::string(path)); } - if (isBinary) { - // we will write the header later, skip its size - outfile->Seek(sizeof(GLB_Header), aiOrigin_SET); - } + // we will write the header later, skip its size + outfile->Seek(sizeof(GLB_Header), aiOrigin_SET); StringBuffer docBuffer; - - bool pretty = true; - if (!isBinary && pretty) { - PrettyWriter writer(docBuffer); - mDoc.Accept(writer); - } - else { - Writer writer(docBuffer); - mDoc.Accept(writer); - } + Writer writer(docBuffer); + mDoc.Accept(writer); if (outfile->Write(docBuffer.GetString(), docBuffer.GetSize(), 1) != 1) { - throw DeadlyExportError("Failed to write scene data!"); + throw DeadlyExportError("Failed to write scene data!"); } - if (isBinary) { - WriteBinaryData(outfile.get(), docBuffer.GetSize()); - } + WriteBinaryData(outfile.get(), docBuffer.GetSize()); } inline void AssetWriter::WriteBinaryData(IOStream* outfile, size_t sceneLength) @@ -385,7 +574,6 @@ namespace glTF { } } - // // write the header // @@ -412,13 +600,15 @@ namespace glTF { } } - + inline void AssetWriter::WriteMetadata() { Value asset; asset.SetObject(); { - asset.AddMember("version", mAsset.asset.version, mAl); + char versionChar[10]; + ai_snprintf(versionChar, sizeof(versionChar), "%d", mAsset.asset.version); + asset.AddMember("version", Value(versionChar, mAl).Move(), mAl); asset.AddMember("generator", Value(mAsset.asset.generator, mAl).Move(), mAl); } diff --git a/code/glTFExporter.cpp b/code/glTFExporter.cpp index e333272be..f2203929c 100644 --- a/code/glTFExporter.cpp +++ b/code/glTFExporter.cpp @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- @@ -58,10 +58,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +// Header files, standart library. #include +#include #include "glTFAssetWriter.h" +#ifdef ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC + // Header files, Open3DGC. +# include +#endif + using namespace rapidjson; using namespace Assimp; @@ -73,20 +80,8 @@ namespace Assimp { // Worker function for exporting a scene to GLTF. Prototyped and registered in Exporter.cpp void ExportSceneGLTF(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* pProperties) { - aiScene* sceneCopy_tmp; - SceneCombiner::CopyScene(&sceneCopy_tmp, pScene); - std::unique_ptr sceneCopy(sceneCopy_tmp); - - SplitLargeMeshesProcess_Triangle tri_splitter; - tri_splitter.SetLimit(0xffff); - tri_splitter.Execute(sceneCopy.get()); - - SplitLargeMeshesProcess_Vertex vert_splitter; - vert_splitter.SetLimit(0xffff); - vert_splitter.Execute(sceneCopy.get()); - // invoke the exporter - glTFExporter exporter(pFile, pIOSystem, sceneCopy.get(), pProperties, false); + glTFExporter exporter(pFile, pIOSystem, pScene, pProperties, false); } // ------------------------------------------------------------------------------------------------ @@ -105,9 +100,22 @@ glTFExporter::glTFExporter(const char* filename, IOSystem* pIOSystem, const aiSc const ExportProperties* pProperties, bool isBinary) : mFilename(filename) , mIOSystem(pIOSystem) - , mScene(pScene) , mProperties(pProperties) { + aiScene* sceneCopy_tmp; + SceneCombiner::CopyScene(&sceneCopy_tmp, pScene); + std::unique_ptr sceneCopy(sceneCopy_tmp); + + SplitLargeMeshesProcess_Triangle tri_splitter; + tri_splitter.SetLimit(0xffff); + tri_splitter.Execute(sceneCopy.get()); + + SplitLargeMeshesProcess_Vertex vert_splitter; + vert_splitter.SetLimit(0xffff); + vert_splitter.Execute(sceneCopy.get()); + + mScene = sceneCopy.get(); + std::unique_ptr asset(); mAsset.reset( new glTF::Asset( pIOSystem ) ); @@ -117,32 +125,37 @@ glTFExporter::glTFExporter(const char* filename, IOSystem* pIOSystem, const aiSc ExportMetadata(); - //for (unsigned int i = 0; i < pScene->mNumAnimations; ++i) {} - //for (unsigned int i = 0; i < pScene->mNumCameras; ++i) {} //for (unsigned int i = 0; i < pScene->mNumLights; ++i) {} - ExportMaterials(); + if (mScene->mRootNode) { + ExportNodeHierarchy(mScene->mRootNode); + } + ExportMeshes(); //for (unsigned int i = 0; i < pScene->mNumTextures; ++i) {} - - if (mScene->mRootNode) { - ExportNode(mScene->mRootNode); - } - ExportScene(); + ExportAnimations(); glTF::AssetWriter writer(*mAsset); - writer.WriteFile(filename); + + if (isBinary) { + writer.WriteGLBFile(filename); + } else { + writer.WriteFile(filename); + } } - +/* + * Copy a 4x4 matrix from struct aiMatrix to typedef mat4. + * Also converts from row-major to column-major storage. + */ static void CopyValue(const aiMatrix4x4& v, glTF::mat4& o) { o[ 0] = v.a1; o[ 1] = v.b1; o[ 2] = v.c1; o[ 3] = v.d1; @@ -151,6 +164,22 @@ static void CopyValue(const aiMatrix4x4& v, glTF::mat4& o) o[12] = v.a4; o[13] = v.b4; o[14] = v.c4; o[15] = v.d4; } +static void CopyValue(const aiMatrix4x4& v, aiMatrix4x4& o) +{ + o.a1 = v.a1; o.a2 = v.a2; o.a3 = v.a3; o.a4 = v.a4; + o.b1 = v.b1; o.b2 = v.b2; o.b3 = v.b3; o.b4 = v.b4; + o.c1 = v.c1; o.c2 = v.c2; o.c3 = v.c3; o.c4 = v.c4; + o.d1 = v.d1; o.d2 = v.d2; o.d3 = v.d3; o.d4 = v.d4; +} + +static void IdentityMatrix4(glTF::mat4& o) +{ + o[ 0] = 1; o[ 1] = 0; o[ 2] = 0; o[ 3] = 0; + o[ 4] = 0; o[ 5] = 1; o[ 6] = 0; o[ 7] = 0; + o[ 8] = 0; o[ 9] = 0; o[10] = 1; o[11] = 0; + o[12] = 0; o[13] = 0; o[14] = 0; o[15] = 1; +} + inline Ref ExportData(Asset& a, std::string& meshName, Ref& buffer, unsigned int count, void* data, AttribType::Value typeIn, AttribType::Value typeOut, ComponentType compType, bool isIndices = false) { @@ -180,6 +209,35 @@ inline Ref ExportData(Asset& a, std::string& meshName, Ref& bu acc->count = count; acc->type = typeOut; + // calculate min and max values + { + // Allocate and initialize with large values. + float float_MAX = 10000000000000.0f; + for (unsigned int i = 0 ; i < numCompsOut ; i++) { + acc->min.push_back( float_MAX); + acc->max.push_back(-float_MAX); + } + + // Search and set extreme values. + float valueTmp; + for (unsigned int i = 0 ; i < count ; i++) { + for (unsigned int j = 0 ; j < numCompsOut ; j++) { + if (numCompsOut == 1) { + valueTmp = static_cast(data)[i]; + } else { + valueTmp = static_cast(data)[i][j]; + } + + if (valueTmp < acc->min[j]) { + acc->min[j] = valueTmp; + } + if (valueTmp > acc->max[j]) { + acc->max[j] = valueTmp; + } + } + } + } + // copy the data acc->WriteData(count, data, numCompsIn*bytesPerComp); @@ -192,6 +250,52 @@ namespace { } } +void glTFExporter::GetTexSampler(const aiMaterial* mat, glTF::TexProperty& prop) +{ + std::string samplerId = mAsset->FindUniqueID("", "sampler"); + prop.texture->sampler = mAsset->samplers.Create(samplerId); + + aiTextureMapMode mapU, mapV; + aiGetMaterialInteger(mat,AI_MATKEY_MAPPINGMODE_U_DIFFUSE(0),(int*)&mapU); + aiGetMaterialInteger(mat,AI_MATKEY_MAPPINGMODE_V_DIFFUSE(0),(int*)&mapV); + + switch (mapU) { + case aiTextureMapMode_Wrap: + prop.texture->sampler->wrapS = SamplerWrap_Repeat; + break; + case aiTextureMapMode_Clamp: + prop.texture->sampler->wrapS = SamplerWrap_Clamp_To_Edge; + break; + case aiTextureMapMode_Mirror: + prop.texture->sampler->wrapS = SamplerWrap_Mirrored_Repeat; + break; + case aiTextureMapMode_Decal: + default: + prop.texture->sampler->wrapS = SamplerWrap_Repeat; + break; + }; + + switch (mapV) { + case aiTextureMapMode_Wrap: + prop.texture->sampler->wrapT = SamplerWrap_Repeat; + break; + case aiTextureMapMode_Clamp: + prop.texture->sampler->wrapT = SamplerWrap_Clamp_To_Edge; + break; + case aiTextureMapMode_Mirror: + prop.texture->sampler->wrapT = SamplerWrap_Mirrored_Repeat; + break; + case aiTextureMapMode_Decal: + default: + prop.texture->sampler->wrapT = SamplerWrap_Repeat; + break; + }; + + // Hard coded Texture filtering options because I do not know where to find them in the aiMaterial. + prop.texture->sampler->magFilter = SamplerMagFilter_Linear; + prop.texture->sampler->minFilter = SamplerMinFilter_Linear; +} + void glTFExporter::GetMatColorOrTex(const aiMaterial* mat, glTF::TexProperty& prop, const char* propName, int type, int idx, aiTextureType tt) { aiString tex; @@ -231,6 +335,8 @@ void glTFExporter::GetMatColorOrTex(const aiMaterial* mat, glTF::TexProperty& pr else { prop.texture->source->uri = path; } + + GetTexSampler(mat, prop); } } } @@ -241,6 +347,7 @@ void glTFExporter::GetMatColorOrTex(const aiMaterial* mat, glTF::TexProperty& pr } } + void glTFExporter::ExportMaterials() { aiString aiName; @@ -261,14 +368,200 @@ void glTFExporter::ExportMaterials() GetMatColorOrTex(mat, m->specular, AI_MATKEY_COLOR_SPECULAR, aiTextureType_SPECULAR); GetMatColorOrTex(mat, m->emission, AI_MATKEY_COLOR_EMISSIVE, aiTextureType_EMISSIVE); + m->transparent = mat->Get(AI_MATKEY_OPACITY, m->transparency) == aiReturn_SUCCESS && m->transparency != 1.0; + GetMatScalar(mat, m->shininess, AI_MATKEY_SHININESS); } } +/* + * Search through node hierarchy and find the node containing the given meshID. + * Returns true on success, and false otherwise. + */ +bool FindMeshNode(Ref& nodeIn, Ref& meshNode, std::string meshID) +{ + for (unsigned int i = 0; i < nodeIn->meshes.size(); ++i) { + if (meshID.compare(nodeIn->meshes[i]->id) == 0) { + meshNode = nodeIn; + return true; + } + } + + for (unsigned int i = 0; i < nodeIn->children.size(); ++i) { + if(FindMeshNode(nodeIn->children[i], meshNode, meshID)) { + return true; + } + } + + return false; +} + +/* + * Find the root joint of the skeleton. + * Starts will any joint node and traces up the tree, + * until a parent is found that does not have a jointName. + * Returns the first parent Ref found that does not have a jointName. + */ +Ref FindSkeletonRootJoint(Ref& skinRef) +{ + Ref startNodeRef; + Ref parentNodeRef; + + // Arbitrarily use the first joint to start the search. + startNodeRef = skinRef->jointNames[0]; + parentNodeRef = skinRef->jointNames[0]; + + do { + startNodeRef = parentNodeRef; + parentNodeRef = startNodeRef->parent; + } while (!parentNodeRef->jointName.empty()); + + return parentNodeRef; +} + +void ExportSkin(Asset& mAsset, const aiMesh* aim, Ref& meshRef, Ref& bufferRef, Ref& skinRef, std::vector& inverseBindMatricesData) +{ + if (aim->mNumBones < 1) { + return; + } + + // Store the vertex joint and weight data. + vec4* vertexJointData = new vec4[aim->mNumVertices]; + vec4* vertexWeightData = new vec4[aim->mNumVertices]; + int* jointsPerVertex = new int[aim->mNumVertices]; + for (size_t i = 0; i < aim->mNumVertices; ++i) { + jointsPerVertex[i] = 0; + for (size_t j = 0; j < 4; ++j) { + vertexJointData[i][j] = 0; + vertexWeightData[i][j] = 0; + } + } + + for (unsigned int idx_bone = 0; idx_bone < aim->mNumBones; ++idx_bone) { + const aiBone* aib = aim->mBones[idx_bone]; + + // aib->mName =====> skinRef->jointNames + // Find the node with id = mName. + Ref nodeRef = mAsset.nodes.Get(aib->mName.C_Str()); + nodeRef->jointName = nodeRef->id; + + unsigned int jointNamesIndex; + bool addJointToJointNames = true; + for ( unsigned int idx_joint = 0; idx_joint < skinRef->jointNames.size(); ++idx_joint) { + if (skinRef->jointNames[idx_joint]->jointName.compare(nodeRef->jointName) == 0) { + addJointToJointNames = false; + jointNamesIndex = idx_joint; + } + } + + if (addJointToJointNames) { + skinRef->jointNames.push_back(nodeRef); + + // aib->mOffsetMatrix =====> skinRef->inverseBindMatrices + aiMatrix4x4 tmpMatrix4; + CopyValue(aib->mOffsetMatrix, tmpMatrix4); + inverseBindMatricesData.push_back(tmpMatrix4); + jointNamesIndex = inverseBindMatricesData.size() - 1; + } + + // aib->mWeights =====> vertexWeightData + for (unsigned int idx_weights = 0; idx_weights < aib->mNumWeights; ++idx_weights) { + unsigned int vertexId = aib->mWeights[idx_weights].mVertexId; + float vertWeight = aib->mWeights[idx_weights].mWeight; + + // A vertex can only have at most four joint weights. Ignore all others. + if (jointsPerVertex[vertexId] > 3) { continue; } + + vertexJointData[vertexId][jointsPerVertex[vertexId]] = jointNamesIndex; + vertexWeightData[vertexId][jointsPerVertex[vertexId]] = vertWeight; + + jointsPerVertex[vertexId] += 1; + } + + } // End: for-loop mNumMeshes + + Mesh::Primitive& p = meshRef->primitives.back(); + Ref vertexJointAccessor = ExportData(mAsset, skinRef->id, bufferRef, aim->mNumVertices, vertexJointData, AttribType::VEC4, AttribType::VEC4, ComponentType_FLOAT); + if (vertexJointAccessor) p.attributes.joint.push_back(vertexJointAccessor); + + Ref vertexWeightAccessor = ExportData(mAsset, skinRef->id, bufferRef, aim->mNumVertices, vertexWeightData, AttribType::VEC4, AttribType::VEC4, ComponentType_FLOAT); + if (vertexWeightAccessor) p.attributes.weight.push_back(vertexWeightAccessor); +} + void glTFExporter::ExportMeshes() { - for (unsigned int i = 0; i < mScene->mNumMeshes; ++i) { - const aiMesh* aim = mScene->mMeshes[i]; + // Not for + // using IndicesType = decltype(aiFace::mNumIndices); + // But yes for + // using IndicesType = unsigned short; + // because "ComponentType_UNSIGNED_SHORT" used for indices. And it's a maximal type according to glTF specification. + typedef unsigned short IndicesType; + + // Variables needed for compression. BEGIN. + // Indices, not pointers - because pointer to buffer is changing while writing to it. + size_t idx_srcdata_begin;// Index of buffer before writing mesh data. Also, index of begin of coordinates array in buffer. + size_t idx_srcdata_normal = SIZE_MAX;// Index of begin of normals array in buffer. SIZE_MAX - mean that mesh has no normals. + std::vector idx_srcdata_tc;// Array of indices. Every index point to begin of texture coordinates array in buffer. + size_t idx_srcdata_ind;// Index of begin of coordinates indices array in buffer. + bool comp_allow;// Point that data of current mesh can be compressed. + // Variables needed for compression. END. + + std::string fname = std::string(mFilename); + std::string bufferIdPrefix = fname.substr(0, fname.find(".")); + std::string bufferId = mAsset->FindUniqueID("", bufferIdPrefix.c_str()); + + Ref b = mAsset->GetBodyBuffer(); + if (!b) { + b = mAsset->buffers.Create(bufferId); + } + + //---------------------------------------- + // Initialize variables for the skin + bool createSkin = false; + for (unsigned int idx_mesh = 0; idx_mesh < mScene->mNumMeshes; ++idx_mesh) { + const aiMesh* aim = mScene->mMeshes[idx_mesh]; + if(aim->HasBones()) { + createSkin = true; + break; + } + } + + Ref skinRef; + std::string skinName = mAsset->FindUniqueID("skin", "skin"); + std::vector inverseBindMatricesData; + if(createSkin) { + skinRef = mAsset->skins.Create(skinName); + skinRef->name = skinName; + } + //---------------------------------------- + + for (unsigned int idx_mesh = 0; idx_mesh < mScene->mNumMeshes; ++idx_mesh) { + const aiMesh* aim = mScene->mMeshes[idx_mesh]; + + // Check if compressing requested and mesh can be encoded. +#ifdef ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC + comp_allow = mProperties->GetPropertyBool("extensions.Open3DGC.use", false); +#else + comp_allow = false; +#endif + + if(comp_allow && (aim->mPrimitiveTypes == aiPrimitiveType_TRIANGLE) && (aim->mNumVertices > 0) && (aim->mNumFaces > 0)) + { + idx_srcdata_tc.clear(); + idx_srcdata_tc.reserve(AI_MAX_NUMBER_OF_TEXTURECOORDS); + } + else + { + std::string msg; + + if(aim->mPrimitiveTypes != aiPrimitiveType_TRIANGLE) + msg = "all primitives of the mesh must be a triangles."; + else + msg = "mesh must has vertices and faces."; + + DefaultLogger::get()->warn("GLTF: can not use Open3DGC-compression: " + msg); + comp_allow = false; + } std::string meshId = mAsset->FindUniqueID(aim->mName.C_Str(), "mesh"); Ref m = mAsset->meshes.Create(meshId); @@ -277,38 +570,53 @@ void glTFExporter::ExportMeshes() p.material = mAsset->materials.Get(aim->mMaterialIndex); - std::string bufferId = mAsset->FindUniqueID(meshId, "buffer"); - - Ref b = mAsset->GetBodyBuffer(); - if (!b) { - b = mAsset->buffers.Create(bufferId); - } + /******************* Vertices ********************/ + // If compression is used then you need parameters of uncompressed region: begin and size. At this step "begin" is stored. + if(comp_allow) idx_srcdata_begin = b->byteLength; Ref v = ExportData(*mAsset, meshId, b, aim->mNumVertices, aim->mVertices, AttribType::VEC3, AttribType::VEC3, ComponentType_FLOAT); - if (v) p.attributes.position.push_back(v); + if (v) p.attributes.position.push_back(v); - Ref n = ExportData(*mAsset, meshId, b, aim->mNumVertices, aim->mNormals, AttribType::VEC3, AttribType::VEC3, ComponentType_FLOAT); - if (n) p.attributes.normal.push_back(n); + /******************** Normals ********************/ + if(comp_allow && (aim->mNormals > 0)) idx_srcdata_normal = b->byteLength;// Store index of normals array. + Ref n = ExportData(*mAsset, meshId, b, aim->mNumVertices, aim->mNormals, AttribType::VEC3, AttribType::VEC3, ComponentType_FLOAT); + if (n) p.attributes.normal.push_back(n); + + /************** Texture coordinates **************/ for (int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) { + // Flip UV y coords + if (aim -> mNumUVComponents[i] > 1) { + for (unsigned int j = 0; j < aim->mNumVertices; ++j) { + aim->mTextureCoords[i][j].y = 1 - aim->mTextureCoords[i][j].y; + } + } + if (aim->mNumUVComponents[i] > 0) { AttribType::Value type = (aim->mNumUVComponents[i] == 2) ? AttribType::VEC2 : AttribType::VEC3; - Ref tc = ExportData(*mAsset, meshId, b, aim->mNumVertices, aim->mTextureCoords[i], AttribType::VEC3, type, ComponentType_FLOAT, true); - if (tc) p.attributes.texcoord.push_back(tc); - } - } - if (aim->mNumFaces > 0) { - unsigned int nIndicesPerFace = aim->mFaces[0].mNumIndices; - std::vector indices; + if(comp_allow) idx_srcdata_tc.push_back(b->byteLength);// Store index of texture coordinates array. + + Ref tc = ExportData(*mAsset, meshId, b, aim->mNumVertices, aim->mTextureCoords[i], AttribType::VEC3, type, ComponentType_FLOAT, false); + if (tc) p.attributes.texcoord.push_back(tc); + } + } + + /*************** Vertices indices ****************/ + idx_srcdata_ind = b->byteLength;// Store index of indices array. + + if (aim->mNumFaces > 0) { + std::vector indices; + unsigned int nIndicesPerFace = aim->mFaces[0].mNumIndices; indices.resize(aim->mNumFaces * nIndicesPerFace); for (size_t i = 0; i < aim->mNumFaces; ++i) { for (size_t j = 0; j < nIndicesPerFace; ++j) { indices[i*nIndicesPerFace + j] = uint16_t(aim->mFaces[i].mIndices[j]); } } - p.indices = ExportData(*mAsset, meshId, b, unsigned(indices.size()), &indices[0], AttribType::SCALAR, AttribType::SCALAR, ComponentType_UNSIGNED_SHORT, true); - } + + p.indices = ExportData(*mAsset, meshId, b, unsigned(indices.size()), &indices[0], AttribType::SCALAR, AttribType::SCALAR, ComponentType_UNSIGNED_SHORT, true); + } switch (aim->mPrimitiveTypes) { case aiPrimitiveType_POLYGON: @@ -320,10 +628,139 @@ void glTFExporter::ExportMeshes() default: // aiPrimitiveType_TRIANGLE p.mode = PrimitiveMode_TRIANGLES; } + + /*************** Skins ****************/ + if(aim->HasBones()) { + ExportSkin(*mAsset, aim, m, b, skinRef, inverseBindMatricesData); + } + + /****************** Compression ******************/ + ///TODO: animation: weights, joints. + if(comp_allow) + { +#ifdef ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC + // Only one type of compression supported at now - Open3DGC. + // + o3dgc::BinaryStream bs; + o3dgc::SC3DMCEncoder encoder; + o3dgc::IndexedFaceSet comp_o3dgc_ifs; + o3dgc::SC3DMCEncodeParams comp_o3dgc_params; + + // + // Fill data for encoder. + // + // Quantization + unsigned quant_coord = mProperties->GetPropertyInteger("extensions.Open3DGC.quantization.POSITION", 12); + unsigned quant_normal = mProperties->GetPropertyInteger("extensions.Open3DGC.quantization.NORMAL", 10); + unsigned quant_texcoord = mProperties->GetPropertyInteger("extensions.Open3DGC.quantization.TEXCOORD", 10); + + // Prediction + o3dgc::O3DGCSC3DMCPredictionMode prediction_position = o3dgc::O3DGC_SC3DMC_PARALLELOGRAM_PREDICTION; + o3dgc::O3DGCSC3DMCPredictionMode prediction_normal = o3dgc::O3DGC_SC3DMC_SURF_NORMALS_PREDICTION; + o3dgc::O3DGCSC3DMCPredictionMode prediction_texcoord = o3dgc::O3DGC_SC3DMC_PARALLELOGRAM_PREDICTION; + + // IndexedFacesSet: "Crease angle", "solid", "convex" are set to default. + comp_o3dgc_ifs.SetCCW(true); + comp_o3dgc_ifs.SetIsTriangularMesh(true); + comp_o3dgc_ifs.SetNumFloatAttributes(0); + // Coordinates + comp_o3dgc_params.SetCoordQuantBits(quant_coord); + comp_o3dgc_params.SetCoordPredMode(prediction_position); + comp_o3dgc_ifs.SetNCoord(aim->mNumVertices); + comp_o3dgc_ifs.SetCoord((o3dgc::Real* const)&b->GetPointer()[idx_srcdata_begin]); + // Normals + if(idx_srcdata_normal != SIZE_MAX) + { + comp_o3dgc_params.SetNormalQuantBits(quant_normal); + comp_o3dgc_params.SetNormalPredMode(prediction_normal); + comp_o3dgc_ifs.SetNNormal(aim->mNumVertices); + comp_o3dgc_ifs.SetNormal((o3dgc::Real* const)&b->GetPointer()[idx_srcdata_normal]); + } + + // Texture coordinates + for(size_t num_tc = 0; num_tc < idx_srcdata_tc.size(); num_tc++) + { + size_t num = comp_o3dgc_ifs.GetNumFloatAttributes(); + + comp_o3dgc_params.SetFloatAttributeQuantBits(num, quant_texcoord); + comp_o3dgc_params.SetFloatAttributePredMode(num, prediction_texcoord); + comp_o3dgc_ifs.SetNFloatAttribute(num, aim->mNumVertices);// number of elements. + comp_o3dgc_ifs.SetFloatAttributeDim(num, aim->mNumUVComponents[num_tc]);// components per element: aiVector3D => x * float + comp_o3dgc_ifs.SetFloatAttributeType(num, o3dgc::O3DGC_IFS_FLOAT_ATTRIBUTE_TYPE_TEXCOORD); + comp_o3dgc_ifs.SetFloatAttribute(num, (o3dgc::Real* const)&b->GetPointer()[idx_srcdata_tc[num_tc]]); + comp_o3dgc_ifs.SetNumFloatAttributes(num + 1); + } + + // Coordinates indices + comp_o3dgc_ifs.SetNCoordIndex(aim->mNumFaces); + comp_o3dgc_ifs.SetCoordIndex((IndicesType* const)&b->GetPointer()[idx_srcdata_ind]); + // Prepare to enconding + comp_o3dgc_params.SetNumFloatAttributes(comp_o3dgc_ifs.GetNumFloatAttributes()); + if(mProperties->GetPropertyBool("extensions.Open3DGC.binary", true)) + comp_o3dgc_params.SetStreamType(o3dgc::O3DGC_STREAM_TYPE_BINARY); + else + comp_o3dgc_params.SetStreamType(o3dgc::O3DGC_STREAM_TYPE_ASCII); + + comp_o3dgc_ifs.ComputeMinMax(o3dgc::O3DGC_SC3DMC_MAX_ALL_DIMS); + // + // Encoding + // + encoder.Encode(comp_o3dgc_params, comp_o3dgc_ifs, bs); + // Replace data in buffer. + b->ReplaceData(idx_srcdata_begin, b->byteLength - idx_srcdata_begin, bs.GetBuffer(), bs.GetSize()); + // + // Add information about extension to mesh. + // + // Create extension structure. + Mesh::SCompression_Open3DGC* ext = new Mesh::SCompression_Open3DGC; + + // Fill it. + ext->Buffer = b->id; + ext->Offset = idx_srcdata_begin; + ext->Count = b->byteLength - idx_srcdata_begin; + ext->Binary = mProperties->GetPropertyBool("extensions.Open3DGC.binary"); + ext->IndicesCount = comp_o3dgc_ifs.GetNCoordIndex() * 3; + ext->VerticesCount = comp_o3dgc_ifs.GetNCoord(); + // And assign to mesh. + m->Extension.push_back(ext); +#endif + }// if(comp_allow) + }// for (unsigned int i = 0; i < mScene->mNumMeshes; ++i) + + //---------------------------------------- + // Finish the skin + // Create the Accessor for skinRef->inverseBindMatrices + if (createSkin) { + mat4* invBindMatrixData = new mat4[inverseBindMatricesData.size()]; + for ( unsigned int idx_joint = 0; idx_joint < inverseBindMatricesData.size(); ++idx_joint) { + CopyValue(inverseBindMatricesData[idx_joint], invBindMatrixData[idx_joint]); + } + + Ref invBindMatrixAccessor = ExportData(*mAsset, skinName, b, inverseBindMatricesData.size(), invBindMatrixData, AttribType::MAT4, AttribType::MAT4, ComponentType_FLOAT); + if (invBindMatrixAccessor) skinRef->inverseBindMatrices = invBindMatrixAccessor; + + // Identity Matrix =====> skinRef->bindShapeMatrix + // Temporary. Hard-coded identity matrix here + skinRef->bindShapeMatrix.isPresent = true; + IdentityMatrix4(skinRef->bindShapeMatrix.value); + + // Find node that contains this mesh and add "skeletons" and "skin" attributes to that node. + Ref rootNode = mAsset->nodes.Get(unsigned(0)); + Ref meshNode; + std::string meshID = mAsset->meshes.Get(unsigned(0))->id; + FindMeshNode(rootNode, meshNode, meshID); + + Ref rootJoint = FindSkeletonRootJoint(skinRef); + meshNode->skeletons.push_back(rootJoint); + meshNode->skin = skinRef; } } -unsigned int glTFExporter::ExportNode(const aiNode* n) +/* + * Export the root node of the node hierarchy. + * Calls ExportNode for all children. + */ +unsigned int glTFExporter::ExportNodeHierarchy(const aiNode* n) { Ref node = mAsset->nodes.Create(mAsset->FindUniqueID(n->mName.C_Str(), "node")); @@ -337,7 +774,34 @@ unsigned int glTFExporter::ExportNode(const aiNode* n) } for (unsigned int i = 0; i < n->mNumChildren; ++i) { - unsigned int idx = ExportNode(n->mChildren[i]); + unsigned int idx = ExportNode(n->mChildren[i], node); + node->children.push_back(mAsset->nodes.Get(idx)); + } + + return node.GetIndex(); +} + +/* + * Export node and recursively calls ExportNode for all children. + * Since these nodes are not the root node, we also export the parent Ref + */ +unsigned int glTFExporter::ExportNode(const aiNode* n, Ref& parent) +{ + Ref node = mAsset->nodes.Create(mAsset->FindUniqueID(n->mName.C_Str(), "node")); + + node->parent = parent; + + if (!n->mTransformation.IsIdentity()) { + node->matrix.isPresent = true; + CopyValue(n->mTransformation, node->matrix.value); + } + + for (unsigned int i = 0; i < n->mNumMeshes; ++i) { + node->meshes.push_back(mAsset->meshes.Get(n->mMeshes[i])); + } + + for (unsigned int i = 0; i < n->mNumChildren; ++i) { + unsigned int idx = ExportNode(n->mChildren[i], node); node->children.push_back(mAsset->nodes.Get(idx)); } @@ -371,10 +835,137 @@ void glTFExporter::ExportMetadata() asset.generator = buffer; } +inline void ExtractAnimationData(Asset& mAsset, std::string& animId, Ref& animRef, Ref& buffer, const aiNodeAnim* nodeChannel) +{ + // Loop over the data and check to see if it exactly matches an existing buffer. + // If yes, then reference the existing corresponding accessor. + // Otherwise, add to the buffer and create a new accessor. + //------------------------------------------------------- + // Extract TIME parameter data. + // Check if the timeStamps are the same for mPositionKeys, mRotationKeys, and mScalingKeys. + if(nodeChannel->mNumPositionKeys > 0) { + typedef float TimeType; + std::vector timeData; + timeData.resize(nodeChannel->mNumPositionKeys); + for (size_t i = 0; i < nodeChannel->mNumPositionKeys; ++i) { + timeData[i] = nodeChannel->mPositionKeys[i].mTime; // Check if we have to cast type here. e.g. uint16_t() + } + Ref timeAccessor = ExportData(mAsset, animId, buffer, nodeChannel->mNumPositionKeys, &timeData[0], AttribType::SCALAR, AttribType::SCALAR, ComponentType_FLOAT); + if (timeAccessor) animRef->Parameters.TIME = timeAccessor; + } + //------------------------------------------------------- + // Extract translation parameter data + if(nodeChannel->mNumPositionKeys > 0) { + C_STRUCT aiVector3D* translationData = new aiVector3D[nodeChannel->mNumPositionKeys]; + for (size_t i = 0; i < nodeChannel->mNumPositionKeys; ++i) { + translationData[i] = nodeChannel->mPositionKeys[i].mValue; + } + Ref tranAccessor = ExportData(mAsset, animId, buffer, nodeChannel->mNumPositionKeys, translationData, AttribType::VEC3, AttribType::VEC3, ComponentType_FLOAT); + if (tranAccessor) animRef->Parameters.translation = tranAccessor; + } + + //------------------------------------------------------- + // Extract scale parameter data + if(nodeChannel->mNumScalingKeys > 0) { + C_STRUCT aiVector3D* scaleData = new aiVector3D[nodeChannel->mNumScalingKeys]; + for (size_t i = 0; i < nodeChannel->mNumScalingKeys; ++i) { + scaleData[i] = nodeChannel->mScalingKeys[i].mValue; + } + + Ref scaleAccessor = ExportData(mAsset, animId, buffer, nodeChannel->mNumScalingKeys, scaleData, AttribType::VEC3, AttribType::VEC3, ComponentType_FLOAT); + if (scaleAccessor) animRef->Parameters.scale = scaleAccessor; + } + + //------------------------------------------------------- + // Extract rotation parameter data + if(nodeChannel->mNumRotationKeys > 0) { + vec4* rotationData = new vec4[nodeChannel->mNumRotationKeys]; + for (size_t i = 0; i < nodeChannel->mNumRotationKeys; ++i) { + rotationData[i][0] = nodeChannel->mRotationKeys[i].mValue.x; + rotationData[i][1] = nodeChannel->mRotationKeys[i].mValue.y; + rotationData[i][2] = nodeChannel->mRotationKeys[i].mValue.z; + rotationData[i][3] = nodeChannel->mRotationKeys[i].mValue.w; + } + + Ref rotAccessor = ExportData(mAsset, animId, buffer, nodeChannel->mNumRotationKeys, rotationData, AttribType::VEC4, AttribType::VEC4, ComponentType_FLOAT); + if (rotAccessor) animRef->Parameters.rotation = rotAccessor; + } +} + +void glTFExporter::ExportAnimations() +{ + Ref bufferRef = mAsset->buffers.Get(unsigned (0)); + + for (unsigned int i = 0; i < mScene->mNumAnimations; ++i) { + const aiAnimation* anim = mScene->mAnimations[i]; + + std::string nameAnim = "anim"; + if (anim->mName.length > 0) { + nameAnim = anim->mName.C_Str(); + } + + for (unsigned int channelIndex = 0; channelIndex < anim->mNumChannels; ++channelIndex) { + const aiNodeAnim* nodeChannel = anim->mChannels[channelIndex]; + + // It appears that assimp stores this type of animation as multiple animations. + // where each aiNodeAnim in mChannels animates a specific node. + std::string name = nameAnim + "_" + to_string(channelIndex); + name = mAsset->FindUniqueID(name, "animation"); + Ref animRef = mAsset->animations.Create(name); + + /******************* Parameters ********************/ + ExtractAnimationData(*mAsset, name, animRef, bufferRef, nodeChannel); + + for (unsigned int j = 0; j < 3; ++j) { + std::string channelType; + int channelSize; + switch (j) { + case 0: + channelType = "rotation"; + channelSize = nodeChannel->mNumRotationKeys; + break; + case 1: + channelType = "scale"; + channelSize = nodeChannel->mNumScalingKeys; + break; + case 2: + channelType = "translation"; + channelSize = nodeChannel->mNumPositionKeys; + break; + } + + if (channelSize < 1) { continue; } + + Animation::AnimChannel tmpAnimChannel; + Animation::AnimSampler tmpAnimSampler; + + tmpAnimChannel.sampler = name + "_" + channelType; + tmpAnimChannel.target.path = channelType; + tmpAnimSampler.output = channelType; + tmpAnimSampler.id = name + "_" + channelType; + + tmpAnimChannel.target.id = mAsset->nodes.Get(nodeChannel->mNodeName.C_Str()); + + tmpAnimSampler.input = "TIME"; + tmpAnimSampler.interpolation = "LINEAR"; + + animRef->Channels.push_back(tmpAnimChannel); + animRef->Samplers.push_back(tmpAnimSampler); + } + + } + + // Assimp documentation staes this is not used (not implemented) + // for (unsigned int channelIndex = 0; channelIndex < anim->mNumMeshChannels; ++channelIndex) { + // const aiMeshAnim* meshChannel = anim->mMeshChannels[channelIndex]; + // } + + } // End: for-loop mNumAnimations +} #endif // ASSIMP_BUILD_NO_GLTF_EXPORTER diff --git a/code/glTFExporter.h b/code/glTFExporter.h index dfd0108b5..49df9193e 100644 --- a/code/glTFExporter.h +++ b/code/glTFExporter.h @@ -58,9 +58,12 @@ struct aiMaterial; namespace glTF { - class Asset; + template + class Ref; + class Asset; struct TexProperty; + struct Node; } namespace Assimp @@ -94,12 +97,15 @@ namespace Assimp void WriteBinaryData(IOStream* outfile, std::size_t sceneLength); + void GetTexSampler(const aiMaterial* mat, glTF::TexProperty& prop); void GetMatColorOrTex(const aiMaterial* mat, glTF::TexProperty& prop, const char* propName, int type, int idx, aiTextureType tt); void ExportMetadata(); void ExportMaterials(); void ExportMeshes(); - unsigned int ExportNode(const aiNode* node); + unsigned int ExportNodeHierarchy(const aiNode* n); + unsigned int ExportNode(const aiNode* node, glTF::Ref& parent); void ExportScene(); + void ExportAnimations(); }; } diff --git a/code/glTFImporter.cpp b/code/glTFImporter.cpp index a1781b04c..4867a9e09 100644 --- a/code/glTFImporter.cpp +++ b/code/glTFImporter.cpp @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- @@ -41,8 +41,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_GLTF_IMPORTER #include "glTFImporter.h" - #include "StringComparison.h" +#include "StringUtils.h" #include #include @@ -259,7 +259,39 @@ void glTFImporter::ImportMeshes(glTF::Asset& r) for (unsigned int m = 0; m < r.meshes.Size(); ++m) { Mesh& mesh = r.meshes[m]; - meshOffsets.push_back(k); + // Check if mesh extensions is used + if(mesh.Extension.size() > 0) + { + for(Mesh::SExtension* cur_ext : mesh.Extension) + { +#ifdef ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC + if(cur_ext->Type == Mesh::SExtension::EType::Compression_Open3DGC) + { + // Limitations for meshes when using Open3DGC-compression. + // It's a current limitation of sp... Specification have not this part still - about mesh compression. Why only one primitive? + // Because glTF is very flexibly. But in fact it ugly flexible. Every primitive can has own set of accessors and accessors can + // point to a-a-a-a-any part of buffer (thru bufferview ofcourse) and even to another buffer. We know that "Open3DGC-compression" + // is applicable only to part of buffer. As we can't guaranty continuity of the data for decoder, we will limit quantity of primitives. + // Yes indices, coordinates etc. still can br stored in different buffers, but with current specification it's a exporter problem. + // Also primitive can has only one of "POSITION", "NORMAL" and less then "AI_MAX_NUMBER_OF_TEXTURECOORDS" of "TEXCOORD". All accessor + // of primitive must point to one continuous region of the buffer. + if(mesh.primitives.size() > 2) throw DeadlyImportError("GLTF: When using Open3DGC compression then only one primitive per mesh are allowed."); + + Mesh::SCompression_Open3DGC* o3dgc_ext = (Mesh::SCompression_Open3DGC*)cur_ext; + Ref buf = r.buffers.Get(o3dgc_ext->Buffer); + + buf->EncodedRegion_SetCurrent(mesh.id); + } + else +#endif + { + throw DeadlyImportError("GLTF: Can not import mesh: unknown mesh extension (code: \"" + to_string(cur_ext->Type) + + "\"), only Open3DGC is supported."); + } + } + }// if(mesh.Extension.size() > 0) + + meshOffsets.push_back(k); k += unsigned(mesh.primitives.size()); for (unsigned int p = 0; p < mesh.primitives.size(); ++p) { @@ -294,14 +326,13 @@ void glTFImporter::ImportMeshes(glTF::Asset& r) } Mesh::Primitive::Attributes& attr = prim.attributes; - if (attr.position.size() > 0 && attr.position[0]) { + + if (attr.position.size() > 0 && attr.position[0]) { aim->mNumVertices = attr.position[0]->count; attr.position[0]->ExtractData(aim->mVertices); - } + } - if (attr.normal.size() > 0 && attr.normal[0]) { - attr.normal[0]->ExtractData(aim->mNormals); - } + if (attr.normal.size() > 0 && attr.normal[0]) attr.normal[0]->ExtractData(aim->mNormals); for (size_t tc = 0; tc < attr.texcoord.size() && tc < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++tc) { attr.texcoord[tc]->ExtractData(aim->mTextureCoords[tc]); @@ -315,7 +346,7 @@ void glTFImporter::ImportMeshes(glTF::Asset& r) if (prim.indices) { - aiFace* faces = 0; + aiFace* faces = 0; unsigned int nFaces = 0; unsigned int count = prim.indices->count; @@ -641,7 +672,7 @@ void glTFImporter::InternReadFile(const std::string& pFile, aiScene* pScene, IOS // TODO: it does not split the loaded vertices, should it? //pScene->mFlags |= AI_SCENE_FLAGS_NON_VERBOSE_FORMAT; - Assimp::MakeVerboseFormatProcess process; + MakeVerboseFormatProcess process; process.Execute(pScene); diff --git a/contrib/Open3DGC/o3dgcAdjacencyInfo.h b/contrib/Open3DGC/o3dgcAdjacencyInfo.h new file mode 100644 index 000000000..6b53a242d --- /dev/null +++ b/contrib/Open3DGC/o3dgcAdjacencyInfo.h @@ -0,0 +1,155 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + + +#pragma once +#ifndef O3DGC_ADJACENCY_INFO_H +#define O3DGC_ADJACENCY_INFO_H + +#include "o3dgcCommon.h" + +namespace o3dgc +{ + const long O3DGC_MIN_NEIGHBORS_SIZE = 128; + const long O3DGC_MIN_NUM_NEIGHBORS_SIZE = 16; + //! + class AdjacencyInfo + { + public: + //! Constructor. + AdjacencyInfo(long numNeighborsSize = O3DGC_MIN_NUM_NEIGHBORS_SIZE, + long neighborsSize = O3DGC_MIN_NUM_NEIGHBORS_SIZE) + { + m_numElements = 0; + m_neighborsSize = neighborsSize; + m_numNeighborsSize = numNeighborsSize; + m_numNeighbors = new long [m_numNeighborsSize]; + m_neighbors = new long [m_neighborsSize ]; + }; + //! Destructor. + ~AdjacencyInfo(void) + { + delete [] m_neighbors; + delete [] m_numNeighbors; + }; + O3DGCErrorCode Allocate(long numNeighborsSize, long neighborsSize) + { + m_numElements = numNeighborsSize; + if (neighborsSize > m_neighborsSize) + { + delete [] m_numNeighbors; + m_neighborsSize = neighborsSize; + m_numNeighbors = new long [m_numNeighborsSize]; + } + if (numNeighborsSize > m_numNeighborsSize) + { + delete [] m_neighbors; + m_numNeighborsSize = numNeighborsSize; + m_neighbors = new long [m_neighborsSize]; + } + return O3DGC_OK; + } + O3DGCErrorCode AllocateNumNeighborsArray(long numElements) + { + if (numElements > m_numNeighborsSize) + { + delete [] m_numNeighbors; + m_numNeighborsSize = numElements; + m_numNeighbors = new long [m_numNeighborsSize]; + } + m_numElements = numElements; + return O3DGC_OK; + } + O3DGCErrorCode AllocateNeighborsArray() + { + for(long i = 1; i < m_numElements; ++i) + { + m_numNeighbors[i] += m_numNeighbors[i-1]; + } + if (m_numNeighbors[m_numElements-1] > m_neighborsSize) + { + delete [] m_neighbors; + m_neighborsSize = m_numNeighbors[m_numElements-1]; + m_neighbors = new long [m_neighborsSize]; + } + return O3DGC_OK; + } + O3DGCErrorCode ClearNumNeighborsArray() + { + memset(m_numNeighbors, 0x00, sizeof(long) * m_numElements); + return O3DGC_OK; + } + O3DGCErrorCode ClearNeighborsArray() + { + memset(m_neighbors, 0xFF, sizeof(long) * m_neighborsSize); + return O3DGC_OK; + } + O3DGCErrorCode AddNeighbor(long element, long neighbor) + { + assert(m_numNeighbors[element] <= m_numNeighbors[m_numElements-1]); + long p0 = Begin(element); + long p1 = End(element); + for(long p = p0; p < p1; p++) + { + if (m_neighbors[p] == -1) + { + m_neighbors[p] = neighbor; + return O3DGC_OK; + } + } + return O3DGC_ERROR_BUFFER_FULL; + } + long Begin(long element) const + { + assert(element < m_numElements); + assert(element >= 0); + return (element>0)?m_numNeighbors[element-1]:0; + } + long End(long element) const + { + assert(element < m_numElements); + assert(element >= 0); + return m_numNeighbors[element]; + } + long GetNeighbor(long element) const + { + assert(element < m_neighborsSize); + assert(element >= 0); + return m_neighbors[element]; + } + long GetNumNeighbors(long element) const + { + return End(element) - Begin(element); + } + long * const GetNumNeighborsBuffer() { return m_numNeighbors;} + long * const GetNeighborsBuffer() { return m_neighbors;} + + private: + long m_neighborsSize; // actual allocated size for m_neighbors + long m_numNeighborsSize; // actual allocated size for m_numNeighbors + long m_numElements; // number of elements + long * m_neighbors; // + long * m_numNeighbors; // + }; +} +#endif // O3DGC_ADJACENCY_INFO_H + diff --git a/contrib/Open3DGC/o3dgcArithmeticCodec.cpp b/contrib/Open3DGC/o3dgcArithmeticCodec.cpp new file mode 100644 index 000000000..1d160ba95 --- /dev/null +++ b/contrib/Open3DGC/o3dgcArithmeticCodec.cpp @@ -0,0 +1,863 @@ +/* +Copyright (c) 2004 Amir Said (said@ieee.org) & William A. Pearlman (pearlw@ecse.rpi.edu) +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, this list + of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. + +*/ +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// - +// **************************** - +// ARITHMETIC CODING EXAMPLES - +// **************************** - +// - +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// - +// Fast arithmetic coding implementation - +// -> 32-bit variables, 32-bit product, periodic updates, table decoding - +// - +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// - +// Version 1.00 - April 25, 2004 - +// - +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// - +// WARNING - +// ========= - +// - +// The only purpose of this program is to demonstrate the basic principles - +// of arithmetic coding. It is provided as is, without any express or - +// implied warranty, without even the warranty of fitness for any particular - +// purpose, or that the implementations are correct. - +// - +// Permission to copy and redistribute this code is hereby granted, provided - +// that this warning and copyright notices are not removed or altered. - +// - +// Copyright (c) 2004 by Amir Said (said@ieee.org) & - +// William A. Pearlman (pearlw@ecse.rpi.edu) - +// - +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// - +// A description of the arithmetic coding method used here is available in - +// - +// Lossless Compression Handbook, ed. K. Sayood - +// Chapter 5: Arithmetic Coding (A. Said), pp. 101-152, Academic Press, 2003 - +// - +// A. Said, Introduction to Arithetic Coding Theory and Practice - +// HP Labs report HPL-2004-76 - http://www.hpl.hp.com/techreports/ - +// - +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +// - - Inclusion - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +#include +#include "o3dgcArithmeticCodec.h" + +namespace o3dgc +{ + // - - Constants - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + const unsigned AC__MinLength = 0x01000000U; // threshold for renormalization + const unsigned AC__MaxLength = 0xFFFFFFFFU; // maximum AC interval length + + // Maximum values for binary models + const unsigned BM__LengthShift = 13; // length bits discarded before mult. + const unsigned BM__MaxCount = 1 << BM__LengthShift; // for adaptive models + + // Maximum values for general models + const unsigned DM__LengthShift = 15; // length bits discarded before mult. + const unsigned DM__MaxCount = 1 << DM__LengthShift; // for adaptive models + + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - Static functions - - - - - - - - - - - - - - - - - - - - - - - - - - - + + static void AC_Error(const char * msg) + { + fprintf(stderr, "\n\n -> Arithmetic coding error: "); + fputs(msg, stderr); + fputs("\n Execution terminated!\n", stderr); + getchar(); + exit(1); + } + + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - Coding implementations - - - - - - - - - - - - - - - - - - - - - - - - + + inline void Arithmetic_Codec::propagate_carry(void) + { + unsigned char * p; // carry propagation on compressed data buffer + for (p = ac_pointer - 1; *p == 0xFFU; p--) *p = 0; + ++*p; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + inline void Arithmetic_Codec::renorm_enc_interval(void) + { + do { // output and discard top byte + *ac_pointer++ = (unsigned char)(base >> 24); + base <<= 8; + } while ((length <<= 8) < AC__MinLength); // length multiplied by 256 + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + inline void Arithmetic_Codec::renorm_dec_interval(void) + { + do { // read least-significant byte + value = (value << 8) | unsigned(*++ac_pointer); + } while ((length <<= 8) < AC__MinLength); // length multiplied by 256 + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Arithmetic_Codec::put_bit(unsigned bit) + { + #ifdef _DEBUG + if (mode != 1) AC_Error("encoder not initialized"); + #endif + + length >>= 1; // halve interval + if (bit) { + unsigned init_base = base; + base += length; // move base + if (init_base > base) propagate_carry(); // overflow = carry + } + + if (length < AC__MinLength) renorm_enc_interval(); // renormalization + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + unsigned Arithmetic_Codec::get_bit(void) + { + #ifdef _DEBUG + if (mode != 2) AC_Error("decoder not initialized"); + #endif + + length >>= 1; // halve interval + unsigned bit = (value >= length); // decode bit + if (bit) value -= length; // move base + + if (length < AC__MinLength) renorm_dec_interval(); // renormalization + + return bit; // return data bit value + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Arithmetic_Codec::put_bits(unsigned data, unsigned bits) + { + #ifdef _DEBUG + if (mode != 1) AC_Error("encoder not initialized"); + if ((bits < 1) || (bits > 20)) AC_Error("invalid number of bits"); + if (data >= (1U << bits)) AC_Error("invalid data"); + #endif + + unsigned init_base = base; + base += data * (length >>= bits); // new interval base and length + + if (init_base > base) propagate_carry(); // overflow = carry + if (length < AC__MinLength) renorm_enc_interval(); // renormalization + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + unsigned Arithmetic_Codec::get_bits(unsigned bits) + { + #ifdef _DEBUG + if (mode != 2) AC_Error("decoder not initialized"); + if ((bits < 1) || (bits > 20)) AC_Error("invalid number of bits"); + #endif + + unsigned s = value / (length >>= bits); // decode symbol, change length + + value -= length * s; // update interval + if (length < AC__MinLength) renorm_dec_interval(); // renormalization + + return s; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Arithmetic_Codec::encode(unsigned bit, + Static_Bit_Model & M) + { + #ifdef _DEBUG + if (mode != 1) AC_Error("encoder not initialized"); + #endif + + unsigned x = M.bit_0_prob * (length >> BM__LengthShift); // product l x p0 + // update interval + if (bit == 0) + length = x; + else { + unsigned init_base = base; + base += x; + length -= x; + if (init_base > base) propagate_carry(); // overflow = carry + } + + if (length < AC__MinLength) renorm_enc_interval(); // renormalization + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + unsigned Arithmetic_Codec::decode(Static_Bit_Model & M) + { + #ifdef _DEBUG + if (mode != 2) AC_Error("decoder not initialized"); + #endif + + unsigned x = M.bit_0_prob * (length >> BM__LengthShift); // product l x p0 + unsigned bit = (value >= x); // decision + // update & shift interval + if (bit == 0) + length = x; + else { + value -= x; // shifted interval base = 0 + length -= x; + } + + if (length < AC__MinLength) renorm_dec_interval(); // renormalization + + return bit; // return data bit value + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Arithmetic_Codec::encode(unsigned bit, + Adaptive_Bit_Model & M) + { + #ifdef _DEBUG + if (mode != 1) AC_Error("encoder not initialized"); + #endif + + unsigned x = M.bit_0_prob * (length >> BM__LengthShift); // product l x p0 + // update interval + if (bit == 0) { + length = x; + ++M.bit_0_count; + } + else { + unsigned init_base = base; + base += x; + length -= x; + if (init_base > base) propagate_carry(); // overflow = carry + } + + if (length < AC__MinLength) renorm_enc_interval(); // renormalization + + if (--M.bits_until_update == 0) M.update(); // periodic model update + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + unsigned Arithmetic_Codec::decode(Adaptive_Bit_Model & M) + { + #ifdef _DEBUG + if (mode != 2) AC_Error("decoder not initialized"); + #endif + + unsigned x = M.bit_0_prob * (length >> BM__LengthShift); // product l x p0 + unsigned bit = (value >= x); // decision + // update interval + if (bit == 0) { + length = x; + ++M.bit_0_count; + } + else { + value -= x; + length -= x; + } + + if (length < AC__MinLength) renorm_dec_interval(); // renormalization + + if (--M.bits_until_update == 0) M.update(); // periodic model update + + return bit; // return data bit value + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Arithmetic_Codec::encode(unsigned data, + Static_Data_Model & M) + { + #ifdef _DEBUG + if (mode != 1) AC_Error("encoder not initialized"); + if (data >= M.data_symbols) AC_Error("invalid data symbol"); + #endif + + unsigned x, init_base = base; + // compute products + if (data == M.last_symbol) { + x = M.distribution[data] * (length >> DM__LengthShift); + base += x; // update interval + length -= x; // no product needed + } + else { + x = M.distribution[data] * (length >>= DM__LengthShift); + base += x; // update interval + length = M.distribution[data+1] * length - x; + } + + if (init_base > base) propagate_carry(); // overflow = carry + + if (length < AC__MinLength) renorm_enc_interval(); // renormalization + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + unsigned Arithmetic_Codec::decode(Static_Data_Model & M) + { + #ifdef _DEBUG + if (mode != 2) AC_Error("decoder not initialized"); + #endif + + unsigned n, s, x, y = length; + + if (M.decoder_table) { // use table look-up for faster decoding + + unsigned dv = value / (length >>= DM__LengthShift); + unsigned t = dv >> M.table_shift; + + s = M.decoder_table[t]; // initial decision based on table look-up + n = M.decoder_table[t+1] + 1; + + while (n > s + 1) { // finish with bisection search + unsigned m = (s + n) >> 1; + if (M.distribution[m] > dv) n = m; else s = m; + } + // compute products + x = M.distribution[s] * length; + if (s != M.last_symbol) y = M.distribution[s+1] * length; + } + + else { // decode using only multiplications + + x = s = 0; + length >>= DM__LengthShift; + unsigned m = (n = M.data_symbols) >> 1; + // decode via bisection search + do { + unsigned z = length * M.distribution[m]; + if (z > value) { + n = m; + y = z; // value is smaller + } + else { + s = m; + x = z; // value is larger or equal + } + } while ((m = (s + n) >> 1) != s); + } + + value -= x; // update interval + length = y - x; + + if (length < AC__MinLength) renorm_dec_interval(); // renormalization + + return s; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Arithmetic_Codec::encode(unsigned data, + Adaptive_Data_Model & M) + { + #ifdef _DEBUG + if (mode != 1) AC_Error("encoder not initialized"); + if (data >= M.data_symbols) + { + AC_Error("invalid data symbol"); + } + #endif + + unsigned x, init_base = base; + // compute products + if (data == M.last_symbol) { + x = M.distribution[data] * (length >> DM__LengthShift); + base += x; // update interval + length -= x; // no product needed + } + else { + x = M.distribution[data] * (length >>= DM__LengthShift); + base += x; // update interval + length = M.distribution[data+1] * length - x; + } + + if (init_base > base) propagate_carry(); // overflow = carry + + if (length < AC__MinLength) renorm_enc_interval(); // renormalization + + ++M.symbol_count[data]; + if (--M.symbols_until_update == 0) M.update(true); // periodic model update + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + unsigned Arithmetic_Codec::decode(Adaptive_Data_Model & M) + { + #ifdef _DEBUG + if (mode != 2) AC_Error("decoder not initialized"); + #endif + + unsigned n, s, x, y = length; + + if (M.decoder_table) { // use table look-up for faster decoding + + unsigned dv = value / (length >>= DM__LengthShift); + unsigned t = dv >> M.table_shift; + + s = M.decoder_table[t]; // initial decision based on table look-up + n = M.decoder_table[t+1] + 1; + + while (n > s + 1) { // finish with bisection search + unsigned m = (s + n) >> 1; + if (M.distribution[m] > dv) n = m; else s = m; + } + // compute products + x = M.distribution[s] * length; + if (s != M.last_symbol) { + y = M.distribution[s+1] * length; + } + } + + else { // decode using only multiplications + + x = s = 0; + length >>= DM__LengthShift; + unsigned m = (n = M.data_symbols) >> 1; + // decode via bisection search + do { + unsigned z = length * M.distribution[m]; + if (z > value) { + n = m; + y = z; // value is smaller + } + else { + s = m; + x = z; // value is larger or equal + } + } while ((m = (s + n) >> 1) != s); + } + + value -= x; // update interval + length = y - x; + + if (length < AC__MinLength) renorm_dec_interval(); // renormalization + + ++M.symbol_count[s]; + if (--M.symbols_until_update == 0) M.update(false); // periodic model update + + return s; + } + + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - Other Arithmetic_Codec implementations - - - - - - - - - - - - - - - - + + Arithmetic_Codec::Arithmetic_Codec(void) + { + mode = buffer_size = 0; + new_buffer = code_buffer = 0; + } + + Arithmetic_Codec::Arithmetic_Codec(unsigned max_code_bytes, + unsigned char * user_buffer) + { + mode = buffer_size = 0; + new_buffer = code_buffer = 0; + set_buffer(max_code_bytes, user_buffer); + } + + Arithmetic_Codec::~Arithmetic_Codec(void) + { + delete [] new_buffer; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Arithmetic_Codec::set_buffer(unsigned max_code_bytes, + unsigned char * user_buffer) + { + // test for reasonable sizes + if (!max_code_bytes)// || (max_code_bytes > 0x10000000U)) // updated by K. Mammou + { + AC_Error("invalid codec buffer size"); + } + if (mode != 0) AC_Error("cannot set buffer while encoding or decoding"); + + if (user_buffer != 0) { // user provides memory buffer + buffer_size = max_code_bytes; + code_buffer = user_buffer; // set buffer for compressed data + delete [] new_buffer; // free anything previously assigned + new_buffer = 0; + return; + } + + if (max_code_bytes <= buffer_size) return; // enough available + + buffer_size = max_code_bytes; // assign new memory + delete [] new_buffer; // free anything previously assigned + if ((new_buffer = new unsigned char[buffer_size+16]) == 0) // 16 extra bytes + AC_Error("cannot assign memory for compressed data buffer"); + code_buffer = new_buffer; // set buffer for compressed data + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Arithmetic_Codec::start_encoder(void) + { + if (mode != 0) AC_Error("cannot start encoder"); + if (buffer_size == 0) AC_Error("no code buffer set"); + + mode = 1; + base = 0; // initialize encoder variables: interval and pointer + length = AC__MaxLength; + ac_pointer = code_buffer; // pointer to next data byte + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Arithmetic_Codec::start_decoder(void) + { + if (mode != 0) AC_Error("cannot start decoder"); + if (buffer_size == 0) AC_Error("no code buffer set"); + + // initialize decoder: interval, pointer, initial code value + mode = 2; + length = AC__MaxLength; + ac_pointer = code_buffer + 3; + value = (unsigned(code_buffer[0]) << 24)|(unsigned(code_buffer[1]) << 16) | + (unsigned(code_buffer[2]) << 8)| unsigned(code_buffer[3]); + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Arithmetic_Codec::read_from_file(FILE * code_file) + { + unsigned shift = 0, code_bytes = 0; + int file_byte; + // read variable-length header with number of code bytes + do { + if ((file_byte = getc(code_file)) == EOF) + AC_Error("cannot read code from file"); + code_bytes |= unsigned(file_byte & 0x7F) << shift; + shift += 7; + } while (file_byte & 0x80); + // read compressed data + if (code_bytes > buffer_size) AC_Error("code buffer overflow"); + if (fread(code_buffer, 1, code_bytes, code_file) != code_bytes) + AC_Error("cannot read code from file"); + + start_decoder(); // initialize decoder + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + unsigned Arithmetic_Codec::stop_encoder(void) + { + if (mode != 1) AC_Error("invalid to stop encoder"); + mode = 0; + + unsigned init_base = base; // done encoding: set final data bytes + + if (length > 2 * AC__MinLength) { + base += AC__MinLength; // base offset + length = AC__MinLength >> 1; // set new length for 1 more byte + } + else { + base += AC__MinLength >> 1; // base offset + length = AC__MinLength >> 9; // set new length for 2 more bytes + } + + if (init_base > base) propagate_carry(); // overflow = carry + + renorm_enc_interval(); // renormalization = output last bytes + + unsigned code_bytes = unsigned(ac_pointer - code_buffer); + if (code_bytes > buffer_size) AC_Error("code buffer overflow"); + + return code_bytes; // number of bytes used + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + unsigned Arithmetic_Codec::write_to_file(FILE * code_file) + { + unsigned header_bytes = 0, code_bytes = stop_encoder(), nb = code_bytes; + + // write variable-length header with number of code bytes + do { + int file_byte = int(nb & 0x7FU); + if ((nb >>= 7) > 0) file_byte |= 0x80; + if (putc(file_byte, code_file) == EOF) + AC_Error("cannot write compressed data to file"); + header_bytes++; + } while (nb); + // write compressed data + if (fwrite(code_buffer, 1, code_bytes, code_file) != code_bytes) + AC_Error("cannot write compressed data to file"); + + return code_bytes + header_bytes; // bytes used + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Arithmetic_Codec::stop_decoder(void) + { + if (mode != 2) AC_Error("invalid to stop decoder"); + mode = 0; + } + + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - Static bit model implementation - - - - - - - - - - - - - - - - - - - - - + + Static_Bit_Model::Static_Bit_Model(void) + { + bit_0_prob = 1U << (BM__LengthShift - 1); // p0 = 0.5 + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Static_Bit_Model::set_probability_0(double p0) + { + if ((p0 < 0.0001)||(p0 > 0.9999)) AC_Error("invalid bit probability"); + bit_0_prob = unsigned(p0 * (1 << BM__LengthShift)); + } + + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - Adaptive bit model implementation - - - - - - - - - - - - - - - - - - - - + + Adaptive_Bit_Model::Adaptive_Bit_Model(void) + { + reset(); + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Adaptive_Bit_Model::reset(void) + { + // initialization to equiprobable model + bit_0_count = 1; + bit_count = 2; + bit_0_prob = 1U << (BM__LengthShift - 1); + update_cycle = bits_until_update = 4; // start with frequent updates + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Adaptive_Bit_Model::update(void) + { + // halve counts when a threshold is reached + + if ((bit_count += update_cycle) > BM__MaxCount) { + bit_count = (bit_count + 1) >> 1; + bit_0_count = (bit_0_count + 1) >> 1; + if (bit_0_count == bit_count) ++bit_count; + } + // compute scaled bit 0 probability + unsigned scale = 0x80000000U / bit_count; + bit_0_prob = (bit_0_count * scale) >> (31 - BM__LengthShift); + + // set frequency of model updates + update_cycle = (5 * update_cycle) >> 2; + if (update_cycle > 64) update_cycle = 64; + bits_until_update = update_cycle; + } + + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - Static data model implementation - - - - - - - - - - - - - - - - - - - + + Static_Data_Model::Static_Data_Model(void) + { + data_symbols = 0; + distribution = 0; + } + + Static_Data_Model::~Static_Data_Model(void) + { + delete [] distribution; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Static_Data_Model::set_distribution(unsigned number_of_symbols, + const double probability[]) + { + if ((number_of_symbols < 2) || (number_of_symbols > (1 << 11))) + AC_Error("invalid number of data symbols"); + + if (data_symbols != number_of_symbols) { // assign memory for data model + data_symbols = number_of_symbols; + last_symbol = data_symbols - 1; + delete [] distribution; + // define size of table for fast decoding + if (data_symbols > 16) { + unsigned table_bits = 3; + while (data_symbols > (1U << (table_bits + 2))) ++table_bits; + table_size = 1 << table_bits; + table_shift = DM__LengthShift - table_bits; + distribution = new unsigned[data_symbols+table_size+2]; + decoder_table = distribution + data_symbols; + } + else { // small alphabet: no table needed + decoder_table = 0; + table_size = table_shift = 0; + distribution = new unsigned[data_symbols]; + } + if (distribution == 0) AC_Error("cannot assign model memory"); + } + // compute cumulative distribution, decoder table + unsigned s = 0; + double sum = 0.0, p = 1.0 / double(data_symbols); + + for (unsigned k = 0; k < data_symbols; k++) { + if (probability) p = probability[k]; + if ((p < 0.0001) || (p > 0.9999)) AC_Error("invalid symbol probability"); + distribution[k] = unsigned(sum * (1 << DM__LengthShift)); + sum += p; + if (table_size == 0) continue; + unsigned w = distribution[k] >> table_shift; + while (s < w) decoder_table[++s] = k - 1; + } + + if (table_size != 0) { + decoder_table[0] = 0; + while (s <= table_size) decoder_table[++s] = data_symbols - 1; + } + + if ((sum < 0.9999) || (sum > 1.0001)) AC_Error("invalid probabilities"); + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - Adaptive data model implementation - - - - - - - - - - - - - - - - - - + + Adaptive_Data_Model::Adaptive_Data_Model(void) + { + data_symbols = 0; + distribution = 0; + } + + Adaptive_Data_Model::Adaptive_Data_Model(unsigned number_of_symbols) + { + data_symbols = 0; + distribution = 0; + set_alphabet(number_of_symbols); + } + + Adaptive_Data_Model::~Adaptive_Data_Model(void) + { + delete [] distribution; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Adaptive_Data_Model::set_alphabet(unsigned number_of_symbols) + { + if ((number_of_symbols < 2) || (number_of_symbols > (1 << 11))) + AC_Error("invalid number of data symbols"); + + if (data_symbols != number_of_symbols) { // assign memory for data model + data_symbols = number_of_symbols; + last_symbol = data_symbols - 1; + delete [] distribution; + // define size of table for fast decoding + if (data_symbols > 16) { + unsigned table_bits = 3; + while (data_symbols > (1U << (table_bits + 2))) ++table_bits; + table_size = 1 << table_bits; + table_shift = DM__LengthShift - table_bits; + distribution = new unsigned[2*data_symbols+table_size+2]; + decoder_table = distribution + 2 * data_symbols; + } + else { // small alphabet: no table needed + decoder_table = 0; + table_size = table_shift = 0; + distribution = new unsigned[2*data_symbols]; + } + symbol_count = distribution + data_symbols; + if (distribution == 0) AC_Error("cannot assign model memory"); + } + + reset(); // initialize model + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Adaptive_Data_Model::update(bool from_encoder) + { + // halve counts when a threshold is reached + + if ((total_count += update_cycle) > DM__MaxCount) { + total_count = 0; + for (unsigned n = 0; n < data_symbols; n++) + total_count += (symbol_count[n] = (symbol_count[n] + 1) >> 1); + } + // compute cumulative distribution, decoder table + unsigned k, sum = 0, s = 0; + unsigned scale = 0x80000000U / total_count; + + if (from_encoder || (table_size == 0)) + for (k = 0; k < data_symbols; k++) { + distribution[k] = (scale * sum) >> (31 - DM__LengthShift); + sum += symbol_count[k]; + } + else { + for (k = 0; k < data_symbols; k++) { + distribution[k] = (scale * sum) >> (31 - DM__LengthShift); + sum += symbol_count[k]; + unsigned w = distribution[k] >> table_shift; + while (s < w) decoder_table[++s] = k - 1; + } + decoder_table[0] = 0; + while (s <= table_size) decoder_table[++s] = data_symbols - 1; + } + // set frequency of model updates + update_cycle = (5 * update_cycle) >> 2; + unsigned max_cycle = (data_symbols + 6) << 3; + if (update_cycle > max_cycle) update_cycle = max_cycle; + symbols_until_update = update_cycle; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + void Adaptive_Data_Model::reset(void) + { + if (data_symbols == 0) return; + + // restore probability estimates to uniform distribution + total_count = 0; + update_cycle = data_symbols; + for (unsigned k = 0; k < data_symbols; k++) symbol_count[k] = 1; + update(false); + symbols_until_update = update_cycle = (data_symbols + 6) >> 1; + } +} +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/contrib/Open3DGC/o3dgcArithmeticCodec.h b/contrib/Open3DGC/o3dgcArithmeticCodec.h new file mode 100644 index 000000000..d3cf6d14a --- /dev/null +++ b/contrib/Open3DGC/o3dgcArithmeticCodec.h @@ -0,0 +1,339 @@ +/* +Copyright (c) 2004 Amir Said (said@ieee.org) & William A. Pearlman (pearlw@ecse.rpi.edu) +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, this list + of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// - +// **************************** - +// ARITHMETIC CODING EXAMPLES - +// **************************** - +// - +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// - +// Fast arithmetic coding implementation - +// -> 32-bit variables, 32-bit product, periodic updates, table decoding - +// - +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// - +// Version 1.00 - April 25, 2004 - +// - +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// - +// WARNING - +// ========= - +// - +// The only purpose of this program is to demonstrate the basic principles - +// of arithmetic coding. It is provided as is, without any express or - +// implied warranty, without even the warranty of fitness for any particular - +// purpose, or that the implementations are correct. - +// - +// Permission to copy and redistribute this code is hereby granted, provided - +// that this warning and copyright notices are not removed or altered. - +// - +// Copyright (c) 2004 by Amir Said (said@ieee.org) & - +// William A. Pearlman (pearlw@ecse.rpi.edu) - +// - +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// - +// A description of the arithmetic coding method used here is available in - +// - +// Lossless Compression Handbook, ed. K. Sayood - +// Chapter 5: Arithmetic Coding (A. Said), pp. 101-152, Academic Press, 2003 - +// - +// A. Said, Introduction to Arithetic Coding Theory and Practice - +// HP Labs report HPL-2004-76 - http://www.hpl.hp.com/techreports/ - +// - +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +// - - Definitions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +#ifndef O3DGC_ARITHMETIC_CODEC +#define O3DGC_ARITHMETIC_CODEC + +#include +#include "o3dgcCommon.h" + +namespace o3dgc +{ + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - Class definitions - - - - - - - - - - - - - - - - - - - - - - - - - - - + + class Static_Bit_Model // static model for binary data + { + public: + + Static_Bit_Model(void); + + void set_probability_0(double); // set probability of symbol '0' + + private: // . . . . . . . . . . . . . . . . . . . . . . + unsigned bit_0_prob; + friend class Arithmetic_Codec; + }; + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + class Static_Data_Model // static model for general data + { + public: + + Static_Data_Model(void); + ~Static_Data_Model(void); + + unsigned model_symbols(void) { return data_symbols; } + + void set_distribution(unsigned number_of_symbols, + const double probability[] = 0); // 0 means uniform + + private: // . . . . . . . . . . . . . . . . . . . . . . + unsigned * distribution, * decoder_table; + unsigned data_symbols, last_symbol, table_size, table_shift; + friend class Arithmetic_Codec; + }; + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + class Adaptive_Bit_Model // adaptive model for binary data + { + public: + + Adaptive_Bit_Model(void); + + void reset(void); // reset to equiprobable model + + private: // . . . . . . . . . . . . . . . . . . . . . . + void update(void); + unsigned update_cycle, bits_until_update; + unsigned bit_0_prob, bit_0_count, bit_count; + friend class Arithmetic_Codec; + }; + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + class Adaptive_Data_Model // adaptive model for binary data + { + public: + + Adaptive_Data_Model(void); + Adaptive_Data_Model(unsigned number_of_symbols); + ~Adaptive_Data_Model(void); + + unsigned model_symbols(void) { return data_symbols; } + + void reset(void); // reset to equiprobable model + void set_alphabet(unsigned number_of_symbols); + + private: // . . . . . . . . . . . . . . . . . . . . . . + void update(bool); + unsigned * distribution, * symbol_count, * decoder_table; + unsigned total_count, update_cycle, symbols_until_update; + unsigned data_symbols, last_symbol, table_size, table_shift; + friend class Arithmetic_Codec; + }; + + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - Encoder and decoder class - - - - - - - - - - - - - - - - - - - - - - - + + // Class with both the arithmetic encoder and decoder. All compressed data is + // saved to a memory buffer + + class Arithmetic_Codec + { + public: + + Arithmetic_Codec(void); + ~Arithmetic_Codec(void); + Arithmetic_Codec(unsigned max_code_bytes, + unsigned char * user_buffer = 0); // 0 = assign new + + unsigned char * buffer(void) { return code_buffer; } + + void set_buffer(unsigned max_code_bytes, + unsigned char * user_buffer = 0); // 0 = assign new + + void start_encoder(void); + void start_decoder(void); + void read_from_file(FILE * code_file); // read code data, start decoder + + unsigned stop_encoder(void); // returns number of bytes used + unsigned write_to_file(FILE * code_file); // stop encoder, write code data + void stop_decoder(void); + + void put_bit(unsigned bit); + unsigned get_bit(void); + + void put_bits(unsigned data, unsigned number_of_bits); + unsigned get_bits(unsigned number_of_bits); + + void encode(unsigned bit, + Static_Bit_Model &); + unsigned decode(Static_Bit_Model &); + + void encode(unsigned data, + Static_Data_Model &); + unsigned decode(Static_Data_Model &); + + void encode(unsigned bit, + Adaptive_Bit_Model &); + unsigned decode(Adaptive_Bit_Model &); + + void encode(unsigned data, + Adaptive_Data_Model &); + unsigned decode(Adaptive_Data_Model &); + +// This section was added by K. Mammou + void ExpGolombEncode(unsigned int symbol, + int k, + Static_Bit_Model & bModel0, + Adaptive_Bit_Model & bModel1) + { + while(1) + { + if (symbol >= (unsigned int)(1<>k)&1), bModel0); + } + break; + } + } + } + + + unsigned ExpGolombDecode(int k, + Static_Bit_Model & bModel0, + Adaptive_Bit_Model & bModel1) + { + unsigned int l; + int symbol = 0; + int binary_symbol = 0; + do + { + l=decode(bModel1); + if (l==1) + { + symbol += (1<>= O3DGC_BINARY_STREAM_BITS_PER_SYMBOL0; + } + } + void WriteUInt32ASCII(unsigned long value) + { + for(unsigned long i = 0; i < O3DGC_BINARY_STREAM_NUM_SYMBOLS_UINT32; ++i) + { + m_stream.PushBack(value & O3DGC_BINARY_STREAM_MAX_SYMBOL0); + value >>= O3DGC_BINARY_STREAM_BITS_PER_SYMBOL0; + } + } + void WriteIntASCII(long value) + { + WriteUIntASCII(IntToUInt(value)); + } + void WriteUIntASCII(unsigned long value) + { + if (value >= O3DGC_BINARY_STREAM_MAX_SYMBOL0) + { + m_stream.PushBack(O3DGC_BINARY_STREAM_MAX_SYMBOL0); + value -= O3DGC_BINARY_STREAM_MAX_SYMBOL0; + unsigned char a, b; + do + { + a = ((value & O3DGC_BINARY_STREAM_MAX_SYMBOL1) << 1); + b = ( (value >>= O3DGC_BINARY_STREAM_BITS_PER_SYMBOL1) > 0); + a += b; + m_stream.PushBack(a); + } while (b); + } + else + { + m_stream.PushBack((unsigned char) value); + } + } + void WriteUCharASCII(unsigned char value) + { + assert(value <= O3DGC_BINARY_STREAM_MAX_SYMBOL0); + m_stream.PushBack(value); + } + float ReadFloat32ASCII(unsigned long & position) const + { + unsigned long value = ReadUInt32ASCII(position); + float fvalue = *((float *)(&value)); + return fvalue; + } + unsigned long ReadUInt32ASCII(unsigned long & position) const + { + assert(position < m_stream.GetSize() - O3DGC_BINARY_STREAM_NUM_SYMBOLS_UINT32); + unsigned long value = 0; + unsigned long shift = 0; + for(unsigned long i = 0; i < O3DGC_BINARY_STREAM_NUM_SYMBOLS_UINT32; ++i) + { + value += (m_stream[position++] << shift); + shift += O3DGC_BINARY_STREAM_BITS_PER_SYMBOL0; + } + return value; + } + long ReadIntASCII(unsigned long & position) const + { + return UIntToInt(ReadUIntASCII(position)); + } + unsigned long ReadUIntASCII(unsigned long & position) const + { + unsigned long value = m_stream[position++]; + if (value == O3DGC_BINARY_STREAM_MAX_SYMBOL0) + { + long x; + unsigned long i = 0; + do + { + x = m_stream[position++]; + value += ( (x>>1) << i); + i += O3DGC_BINARY_STREAM_BITS_PER_SYMBOL1; + } while (x & 1); + } + return value; + } + unsigned char ReadUCharASCII(unsigned long & position) const + { + return m_stream[position++]; + } + O3DGCErrorCode Save(const char * const fileName) + { + FILE * fout = fopen(fileName, "wb"); + if (!fout) + { + return O3DGC_ERROR_CREATE_FILE; + } + fwrite(m_stream.GetBuffer(), 1, m_stream.GetSize(), fout); + fclose(fout); + return O3DGC_OK; + } + O3DGCErrorCode Load(const char * const fileName) + { + FILE * fin = fopen(fileName, "rb"); + if (!fin) + { + return O3DGC_ERROR_OPEN_FILE; + } + fseek(fin, 0, SEEK_END); + unsigned long size = ftell(fin); + m_stream.Allocate(size); + rewind(fin); + unsigned int nread = (unsigned int) fread((void *) m_stream.GetBuffer(), 1, size, fin); + m_stream.SetSize(size); + if (nread != size) + { + return O3DGC_ERROR_READ_FILE; + } + fclose(fin); + return O3DGC_OK; + } + O3DGCErrorCode LoadFromBuffer(unsigned char * buffer, unsigned long bufferSize) + { + m_stream.Allocate(bufferSize); + memcpy(m_stream.GetBuffer(), buffer, bufferSize); + m_stream.SetSize(bufferSize); + return O3DGC_OK; + } + unsigned long GetSize() const + { + return m_stream.GetSize(); + } + const unsigned char * const GetBuffer(unsigned long position) const + { + return m_stream.GetBuffer() + position; + } + unsigned char * const GetBuffer(unsigned long position) + { + return (m_stream.GetBuffer() + position); + } + unsigned char * const GetBuffer() + { + return m_stream.GetBuffer(); + } + void GetBuffer(unsigned long position, unsigned char * & buffer) const + { + buffer = (unsigned char *) (m_stream.GetBuffer() + position); // fix me: ugly! + } + void SetSize(unsigned long size) + { + m_stream.SetSize(size); + }; + void Allocate(unsigned long size) + { + m_stream.Allocate(size); + } + + private: + Vector m_stream; + O3DGCEndianness m_endianness; + }; + +} +#endif // O3DGC_BINARY_STREAM_H + diff --git a/contrib/Open3DGC/o3dgcCommon.h b/contrib/Open3DGC/o3dgcCommon.h new file mode 100644 index 000000000..13af4153d --- /dev/null +++ b/contrib/Open3DGC/o3dgcCommon.h @@ -0,0 +1,412 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + + +#pragma once +#ifndef O3DGC_COMMON_H +#define O3DGC_COMMON_H + +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS +#endif + +#include +#include +#include +#include + +namespace o3dgc +{ + typedef float Real; + const double O3DGC_MAX_DOUBLE = 1.79769e+308; + const long O3DGC_MIN_LONG = -2147483647; + const long O3DGC_MAX_LONG = 2147483647; + const long O3DGC_MAX_UCHAR8 = 255; + const long O3DGC_MAX_TFAN_SIZE = 256; + const unsigned long O3DGC_MAX_ULONG = 4294967295; + + const unsigned long O3DGC_SC3DMC_START_CODE = 0x00001F1; + const unsigned long O3DGC_DV_START_CODE = 0x00001F2; + const unsigned long O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES = 256; + const unsigned long O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES = 256; + const unsigned long O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES = 32; + + const unsigned long O3DGC_SC3DMC_MAX_PREDICTION_NEIGHBORS = 2; + const unsigned long O3DGC_SC3DMC_MAX_PREDICTION_SYMBOLS = 257; + + enum O3DGCEndianness + { + O3DGC_BIG_ENDIAN = 0, + O3DGC_LITTLE_ENDIAN = 1 + }; + enum O3DGCErrorCode + { + O3DGC_OK, + O3DGC_ERROR_BUFFER_FULL, + O3DGC_ERROR_CREATE_FILE, + O3DGC_ERROR_OPEN_FILE, + O3DGC_ERROR_READ_FILE, + O3DGC_ERROR_CORRUPTED_STREAM, + O3DGC_ERROR_NON_SUPPORTED_FEATURE + }; + enum O3DGCSC3DMCBinarization + { + O3DGC_SC3DMC_BINARIZATION_FL = 0, // Fixed Length (not supported) + O3DGC_SC3DMC_BINARIZATION_BP = 1, // BPC (not supported) + O3DGC_SC3DMC_BINARIZATION_FC = 2, // 4 bits Coding (not supported) + O3DGC_SC3DMC_BINARIZATION_AC = 3, // Arithmetic Coding (not supported) + O3DGC_SC3DMC_BINARIZATION_AC_EGC = 4, // Arithmetic Coding & EGCk + O3DGC_SC3DMC_BINARIZATION_ASCII = 5 // Arithmetic Coding & EGCk + }; + enum O3DGCStreamType + { + O3DGC_STREAM_TYPE_UNKOWN = 0, + O3DGC_STREAM_TYPE_ASCII = 1, + O3DGC_STREAM_TYPE_BINARY = 2 + }; + enum O3DGCSC3DMCQuantizationMode + { + O3DGC_SC3DMC_DIAG_BB = 0, // supported + O3DGC_SC3DMC_MAX_ALL_DIMS = 1, // supported + O3DGC_SC3DMC_MAX_SEP_DIM = 2 // supported + }; + enum O3DGCSC3DMCPredictionMode + { + O3DGC_SC3DMC_NO_PREDICTION = 0, // supported + O3DGC_SC3DMC_DIFFERENTIAL_PREDICTION = 1, // supported + O3DGC_SC3DMC_XOR_PREDICTION = 2, // not supported + O3DGC_SC3DMC_ADAPTIVE_DIFFERENTIAL_PREDICTION = 3, // not supported + O3DGC_SC3DMC_CIRCULAR_DIFFERENTIAL_PREDICTION = 4, // not supported + O3DGC_SC3DMC_PARALLELOGRAM_PREDICTION = 5, // supported + O3DGC_SC3DMC_SURF_NORMALS_PREDICTION = 6 // supported + }; + enum O3DGCSC3DMCEncodingMode + { + O3DGC_SC3DMC_ENCODE_MODE_QBCR = 0, // not supported + O3DGC_SC3DMC_ENCODE_MODE_SVA = 1, // not supported + O3DGC_SC3DMC_ENCODE_MODE_TFAN = 2, // supported + }; + enum O3DGCDVEncodingMode + { + O3DGC_DYNAMIC_VECTOR_ENCODE_MODE_LIFT = 0 + }; + enum O3DGCIFSFloatAttributeType + { + O3DGC_IFS_FLOAT_ATTRIBUTE_TYPE_UNKOWN = 0, + O3DGC_IFS_FLOAT_ATTRIBUTE_TYPE_POSITION = 1, + O3DGC_IFS_FLOAT_ATTRIBUTE_TYPE_NORMAL = 2, + O3DGC_IFS_FLOAT_ATTRIBUTE_TYPE_COLOR = 3, + O3DGC_IFS_FLOAT_ATTRIBUTE_TYPE_TEXCOORD = 4, + O3DGC_IFS_FLOAT_ATTRIBUTE_TYPE_WEIGHT = 5 + + }; + enum O3DGCIFSIntAttributeType + { + O3DGC_IFS_INT_ATTRIBUTE_TYPE_UNKOWN = 0, + O3DGC_IFS_INT_ATTRIBUTE_TYPE_INDEX = 1, + O3DGC_IFS_INT_ATTRIBUTE_TYPE_JOINT_ID = 2, + O3DGC_IFS_INT_ATTRIBUTE_TYPE_INDEX_BUFFER_ID = 3 + }; + + template + inline const T absolute(const T& a) + { + return (a < (T)(0)) ? -a : a; + } + template + inline const T min(const T& a, const T& b) + { + return (b < a) ? b : a; + } + template + inline const T max(const T& a, const T& b) + { + return (b > a) ? b : a; + } + template + inline void swap(T& a, T& b) + { + T tmp = a; + a = b; + b = tmp; + } + inline double log2( double n ) + { + return log(n) / log(2.0); + } + + inline O3DGCEndianness SystemEndianness() + { + unsigned long num = 1; + return ( *((char *)(&num)) == 1 )? O3DGC_LITTLE_ENDIAN : O3DGC_BIG_ENDIAN ; + } + class SC3DMCStats + { + public: + SC3DMCStats(void) + { + memset(this, 0, sizeof(SC3DMCStats)); + }; + ~SC3DMCStats(void){}; + + double m_timeCoord; + double m_timeNormal; + double m_timeCoordIndex; + double m_timeFloatAttribute[O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES]; + double m_timeIntAttribute [O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES ]; + double m_timeReorder; + + unsigned long m_streamSizeCoord; + unsigned long m_streamSizeNormal; + unsigned long m_streamSizeCoordIndex; + unsigned long m_streamSizeFloatAttribute[O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES]; + unsigned long m_streamSizeIntAttribute [O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES ]; + + }; + typedef struct + { + long m_a; + long m_b; + long m_c; + } SC3DMCTriplet; + + typedef struct + { + SC3DMCTriplet m_id; + long m_pred[O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES]; + } SC3DMCPredictor; + + inline bool operator< (const SC3DMCTriplet& lhs, const SC3DMCTriplet& rhs) + { + if (lhs.m_c != rhs.m_c) + { + return (lhs.m_c < rhs.m_c); + } + else if (lhs.m_b != rhs.m_b) + { + return (lhs.m_b < rhs.m_b); + } + return (lhs.m_a < rhs.m_a); + } + inline bool operator== (const SC3DMCTriplet& lhs, const SC3DMCTriplet& rhs) + { + return (lhs.m_c == rhs.m_c && lhs.m_b == rhs.m_b && lhs.m_a == rhs.m_a); + } + + + // fix me: optimize this function (e.g., binary search) + inline unsigned long Insert(SC3DMCTriplet e, unsigned long & nPred, SC3DMCPredictor * const list) + { + unsigned long pos = 0xFFFFFFFF; + bool foundOrInserted = false; + for (unsigned long j = 0; j < nPred; ++j) + { + if (e == list[j].m_id) + { + foundOrInserted = true; + break; + } + else if (e < list[j].m_id) + { + if (nPred < O3DGC_SC3DMC_MAX_PREDICTION_NEIGHBORS) + { + ++nPred; + } + for (unsigned long h = nPred-1; h > j; --h) + { + list[h] = list[h-1]; + } + list[j].m_id = e; + pos = j; + foundOrInserted = true; + break; + } + } + if (!foundOrInserted && nPred < O3DGC_SC3DMC_MAX_PREDICTION_NEIGHBORS) + { + pos = nPred; + list[nPred++].m_id = e; + } + return pos; + } + template + inline void SphereToCube(const T x, const T y, const T z, + T & a, T & b, char & index) + { + T ax = absolute(x); + T ay = absolute(y); + T az = absolute(z); + if (az >= ax && az >= ay) + { + if (z >= (T)(0)) + { + index = 0; + a = x; + b = y; + } + else + { + index = 1; + a = -x; + b = -y; + } + } + else if (ay >= ax && ay >= az) + { + if (y >= (T)(0)) + { + index = 2; + a = z; + b = x; + } + else + { + index = 3; + a = -z; + b = -x; + } + } + else if (ax >= ay && ax >= az) + { + if (x >= (T)(0)) + { + index = 4; + a = y; + b = z; + } + else + { + index = 5; + a = -y; + b = -z; + } + } + } + inline void CubeToSphere(const Real a, const Real b, const char index, + Real & x, Real & y, Real & z) + { + switch( index ) + { + case 0: + x = a; + y = b; + z = (Real) sqrt(max(0.0, 1.0 - x*x-y*y)); + break; + case 1: + x = -a; + y = -b; + z = -(Real) sqrt(max(0.0, 1.0 - x*x-y*y)); + break; + case 2: + z = a; + x = b; + y = (Real) sqrt(max(0.0, 1.0 - x*x-z*z)); + break; + case 3: + z = -a; + x = -b; + y = -(Real) sqrt(max(0.0, 1.0 - x*x-z*z)); + break; + case 4: + y = a; + z = b; + x = (Real) sqrt(max(0.0, 1.0 - y*y-z*z)); + break; + case 5: + y = -a; + z = -b; + x = -(Real) sqrt(max(0.0, 1.0 - y*y-z*z)); + break; + } + } + inline unsigned long IntToUInt(long value) + { + return (value < 0)?(unsigned long) (-1 - (2 * value)):(unsigned long) (2 * value); + } + inline long UIntToInt(unsigned long uiValue) + { + return (uiValue & 1)?-((long) ((uiValue+1) >> 1)):((long) (uiValue >> 1)); + } + inline void ComputeVectorMinMax(const Real * const tab, + unsigned long size, + unsigned long dim, + unsigned long stride, + Real * minTab, + Real * maxTab, + O3DGCSC3DMCQuantizationMode quantMode) + { + if (size == 0 || dim == 0) + { + return; + } + unsigned long p = 0; + for(unsigned long d = 0; d < dim; ++d) + { + maxTab[d] = minTab[d] = tab[p++]; + } + p = stride; + for(unsigned long i = 1; i < size; ++i) + { + for(unsigned long d = 0; d < dim; ++d) + { + if (maxTab[d] < tab[p+d]) maxTab[d] = tab[p+d]; + if (minTab[d] > tab[p+d]) minTab[d] = tab[p+d]; + } + p += stride; + } + + if (quantMode == O3DGC_SC3DMC_DIAG_BB) + { + Real diag = Real( 0.0 ); + Real r; + for(unsigned long d = 0; d < dim; ++d) + { + r = (maxTab[d] - minTab[d]); + diag += r*r; + } + diag = sqrt(diag); + for(unsigned long d = 0; d < dim; ++d) + { + maxTab[d] = minTab[d] + diag; + } + } + else if (quantMode == O3DGC_SC3DMC_MAX_ALL_DIMS) + { + Real maxr = (maxTab[0] - minTab[0]); + Real r; + for(unsigned long d = 1; d < dim; ++d) + { + r = (maxTab[d] - minTab[d]); + if ( r > maxr) + { + maxr = r; + } + } + for(unsigned long d = 0; d < dim; ++d) + { + maxTab[d] = minTab[d] + maxr; + } + } + } +} +#endif // O3DGC_COMMON_H + diff --git a/contrib/Open3DGC/o3dgcDVEncodeParams.h b/contrib/Open3DGC/o3dgcDVEncodeParams.h new file mode 100644 index 000000000..6f639f678 --- /dev/null +++ b/contrib/Open3DGC/o3dgcDVEncodeParams.h @@ -0,0 +1,62 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + + +#pragma once +#ifndef O3DGC_DV_ENCODE_PARAMS_H +#define O3DGC_DV_ENCODE_PARAMS_H + +#include "o3dgcCommon.h" + +namespace o3dgc +{ + class DVEncodeParams + { + public: + //! Constructor. + DVEncodeParams(void) + { + m_quantBits = 10; + m_streamTypeMode = O3DGC_STREAM_TYPE_ASCII; + m_encodeMode = O3DGC_DYNAMIC_VECTOR_ENCODE_MODE_LIFT; + }; + //! Destructor. + ~DVEncodeParams(void) {}; + + unsigned long GetQuantBits() const { return m_quantBits;} + O3DGCStreamType GetStreamType() const { return m_streamTypeMode;} + O3DGCDVEncodingMode GetEncodeMode() const { return m_encodeMode;} + + void SetQuantBits (unsigned long quantBits ) { m_quantBits = quantBits;} + + void SetStreamType(O3DGCStreamType streamTypeMode) { m_streamTypeMode = streamTypeMode;} + void SetEncodeMode(O3DGCDVEncodingMode encodeMode ) { m_encodeMode = encodeMode ;} + + + private: + unsigned long m_quantBits; + O3DGCStreamType m_streamTypeMode; + O3DGCDVEncodingMode m_encodeMode; + }; +} +#endif // O3DGC_DV_ENCODE_PARAMS_H + diff --git a/contrib/Open3DGC/o3dgcDynamicVector.h b/contrib/Open3DGC/o3dgcDynamicVector.h new file mode 100644 index 000000000..edc97d83c --- /dev/null +++ b/contrib/Open3DGC/o3dgcDynamicVector.h @@ -0,0 +1,84 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + + +#pragma once +#ifndef O3DGC_DYNAMIC_VECTOR_SET_H +#define O3DGC_DYNAMIC_VECTOR_SET_H + +#include "o3dgcCommon.h" + +namespace o3dgc +{ + class DynamicVector + { + public: + //! Constructor. + DynamicVector(void) + { + m_num = 0; + m_dim = 0; + m_stride = 0; + m_max = 0; + m_min = 0; + m_vectors = 0; + }; + //! Destructor. + ~DynamicVector(void) {}; + + unsigned long GetNVector() const { return m_num;} + unsigned long GetDimVector() const { return m_dim;} + unsigned long GetStride() const { return m_stride;} + const Real * const GetMin() const { return m_min;} + const Real * const GetMax() const { return m_max;} + const Real * const GetVectors() const { return m_vectors;} + Real * const GetVectors() { return m_vectors;} + Real GetMin(unsigned long j) const { return m_min[j];} + Real GetMax(unsigned long j) const { return m_max[j];} + + void SetNVector (unsigned long num ) { m_num = num ;} + void SetDimVector (unsigned long dim ) { m_dim = dim ;} + void SetStride (unsigned long stride ) { m_stride = stride ;} + void SetMin (Real * const min ) { m_min = min ;} + void SetMax (Real * const max ) { m_max = max ;} + void SetMin (unsigned long j, Real min) { m_min[j] = min ;} + void SetMax (unsigned long j, Real max) { m_max[j] = max ;} + void SetVectors (Real * const vectors) { m_vectors = vectors ;} + + void ComputeMinMax(O3DGCSC3DMCQuantizationMode quantMode) + { + assert( m_max && m_min && m_vectors && m_stride && m_dim && m_num); + ComputeVectorMinMax(m_vectors, m_num , m_dim, m_stride, m_min , m_max , quantMode); + } + + private: + unsigned long m_num; + unsigned long m_dim; + unsigned long m_stride; + Real * m_max; + Real * m_min; + Real * m_vectors; + }; + +} +#endif // O3DGC_DYNAMIC_VECTOR_SET_H + diff --git a/contrib/Open3DGC/o3dgcDynamicVectorDecoder.cpp b/contrib/Open3DGC/o3dgcDynamicVectorDecoder.cpp new file mode 100644 index 000000000..b92452eb6 --- /dev/null +++ b/contrib/Open3DGC/o3dgcDynamicVectorDecoder.cpp @@ -0,0 +1,278 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ +#include "o3dgcDynamicVectorDecoder.h" +#include "o3dgcArithmeticCodec.h" + + +//#define DEBUG_VERBOSE + +namespace o3dgc +{ +#ifdef DEBUG_VERBOSE + FILE * g_fileDebugDVCDec = NULL; +#endif //DEBUG_VERBOSE + + O3DGCErrorCode IUpdate(long * const data, const long size) + { + assert(size > 1); + const long size1 = size - 1; + long p = 2; + data[0] -= data[1] >> 1; + while(p < size1) + { + data[p] -= (data[p-1] + data[p+1] + 2) >> 2; + p += 2; + } + if ( p == size1) + { + data[p] -= data[p-1]>>1; + } + return O3DGC_OK; + } + O3DGCErrorCode IPredict(long * const data, const long size) + { + assert(size > 1); + const long size1 = size - 1; + long p = 1; + while(p < size1) + { + data[p] += (data[p-1] + data[p+1] + 1) >> 1; + p += 2; + } + if ( p == size1) + { + data[p] += data[p-1]; + } + return O3DGC_OK; + } + O3DGCErrorCode Merge(long * const data, const long size) + { + assert(size > 1); + const long h = (size >> 1) + (size & 1); + long a = h-1; + long b = h; + while (a > 0) + { + for (long i = a; i < b; i += 2) + { + swap(data[i], data[i+1]); + } + --a; + ++b; + } + return O3DGC_OK; + } + inline O3DGCErrorCode ITransform(long * const data, const unsigned long size) + { + unsigned long n = size; + unsigned long even = 0; + unsigned long k = 0; + even += ((n&1) << k++); + while(n > 1) + { + n = (n >> 1) + (n & 1); + even += ((n&1) << k++); + } + for(long i = k-2; i >= 0; --i) + { + n = (n << 1) - ((even>>i) & 1); + Merge (data, n); + IUpdate (data, n); + IPredict(data, n); + } + return O3DGC_OK; + } + DynamicVectorDecoder::DynamicVectorDecoder(void) + { + m_streamSize = 0; + m_maxNumVectors = 0; + m_numVectors = 0; + m_dimVectors = 0; + m_quantVectors = 0; + m_iterator = 0; + m_streamType = O3DGC_STREAM_TYPE_UNKOWN; + } + DynamicVectorDecoder::~DynamicVectorDecoder() + { + delete [] m_quantVectors; + } + O3DGCErrorCode DynamicVectorDecoder::DecodeHeader(DynamicVector & dynamicVector, + const BinaryStream & bstream) + { + unsigned long iterator0 = m_iterator; + unsigned long start_code = bstream.ReadUInt32(m_iterator, O3DGC_STREAM_TYPE_BINARY); + if (start_code != O3DGC_DV_START_CODE) + { + m_iterator = iterator0; + start_code = bstream.ReadUInt32(m_iterator, O3DGC_STREAM_TYPE_ASCII); + if (start_code != O3DGC_DV_START_CODE) + { + return O3DGC_ERROR_CORRUPTED_STREAM; + } + else + { + m_streamType = O3DGC_STREAM_TYPE_ASCII; + } + } + else + { + m_streamType = O3DGC_STREAM_TYPE_BINARY; + } + m_streamSize = bstream.ReadUInt32(m_iterator, m_streamType); + m_params.SetEncodeMode( (O3DGCDVEncodingMode) bstream.ReadUChar(m_iterator, m_streamType)); + dynamicVector.SetNVector ( bstream.ReadUInt32(m_iterator, m_streamType) ); + + if (dynamicVector.GetNVector() > 0) + { + dynamicVector.SetDimVector( bstream.ReadUInt32(m_iterator, m_streamType) ); + m_params.SetQuantBits(bstream.ReadUChar(m_iterator, m_streamType)); + } + return O3DGC_OK; + } + O3DGCErrorCode DynamicVectorDecoder::DecodePlayload(DynamicVector & dynamicVector, + const BinaryStream & bstream) + { + O3DGCErrorCode ret = O3DGC_OK; +#ifdef DEBUG_VERBOSE + g_fileDebugDVCDec = fopen("dv_dec.txt", "w"); +#endif //DEBUG_VERBOSE + unsigned long start = m_iterator; + unsigned long streamSize = bstream.ReadUInt32(m_iterator, m_streamType); // bitsream size + + const unsigned long dim = dynamicVector.GetDimVector(); + const unsigned long num = dynamicVector.GetNVector(); + const unsigned long size = dim * num; + for(unsigned long j=0 ; j < dynamicVector.GetDimVector() ; ++j) + { + dynamicVector.SetMin(j, (Real) bstream.ReadFloat32(m_iterator, m_streamType)); + dynamicVector.SetMax(j, (Real) bstream.ReadFloat32(m_iterator, m_streamType)); + } + Arithmetic_Codec acd; + Static_Bit_Model bModel0; + Adaptive_Bit_Model bModel1; + unsigned char * buffer = 0; + streamSize -= (m_iterator - start); + unsigned int exp_k = 0; + unsigned int M = 0; + if (m_streamType == O3DGC_STREAM_TYPE_BINARY) + { + bstream.GetBuffer(m_iterator, buffer); + m_iterator += streamSize; + acd.set_buffer(streamSize, buffer); + acd.start_decoder(); + exp_k = acd.ExpGolombDecode(0, bModel0, bModel1); + M = acd.ExpGolombDecode(0, bModel0, bModel1); + } + Adaptive_Data_Model mModelValues(M+2); + + if (m_maxNumVectors < size) + { + delete [] m_quantVectors; + m_maxNumVectors = size; + m_quantVectors = new long [size]; + } + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + for(unsigned long v = 0; v < num; ++v) + { + for(unsigned long d = 0; d < dim; ++d) + { + m_quantVectors[d * num + v] = bstream.ReadIntASCII(m_iterator); + } + } + } + else + { + for(unsigned long v = 0; v < num; ++v) + { + for(unsigned long d = 0; d < dim; ++d) + { + m_quantVectors[d * num + v] = DecodeIntACEGC(acd, mModelValues, bModel0, bModel1, exp_k, M); + } + } + } + #ifdef DEBUG_VERBOSE + printf("IntArray (%i, %i)\n", num, dim); + fprintf(g_fileDebugDVCDec, "IntArray (%i, %i)\n", num, dim); + for(unsigned long v = 0; v < num; ++v) + { + for(unsigned long d = 0; d < dim; ++d) + { + printf("%i\t %i \t %i\n", d * num + v, m_quantVectors[d * num + v], IntToUInt(m_quantVectors[d * num + v])); + fprintf(g_fileDebugDVCDec, "%i\t %i \t %i\n", d * num + v, m_quantVectors[d * num + v], IntToUInt(m_quantVectors[d * num + v])); + } + } + fflush(g_fileDebugDVCDec); + #endif //DEBUG_VERBOSE + for(unsigned long d = 0; d < dim; ++d) + { + ITransform(m_quantVectors + d * num, num); + } + IQuantize(dynamicVector.GetVectors(), + num, + dim, + dynamicVector.GetStride(), + dynamicVector.GetMin(), + dynamicVector.GetMax(), + m_params.GetQuantBits()); + +#ifdef DEBUG_VERBOSE + fclose(g_fileDebugDVCDec); +#endif //DEBUG_VERBOSE + return ret; + } + O3DGCErrorCode DynamicVectorDecoder::IQuantize(Real * const floatArray, + unsigned long numFloatArray, + unsigned long dimFloatArray, + unsigned long stride, + const Real * const minFloatArray, + const Real * const maxFloatArray, + unsigned long nQBits) + { + const unsigned long size = numFloatArray * dimFloatArray; + Real r; + if (m_maxNumVectors < size) + { + delete [] m_quantVectors; + m_maxNumVectors = size; + m_quantVectors = new long [m_maxNumVectors]; + } + Real idelta; + for(unsigned long d = 0; d < dimFloatArray; ++d) + { + r = maxFloatArray[d] - minFloatArray[d]; + if (r > 0.0f) + { + idelta = (float)(r) / ((1 << nQBits) - 1); + } + else + { + idelta = 1.0f; + } + for(unsigned long v = 0; v < numFloatArray; ++v) + { + floatArray[v * stride + d] = m_quantVectors[v + d * numFloatArray] * idelta + minFloatArray[d]; + } + } + return O3DGC_OK; + } +} diff --git a/contrib/Open3DGC/o3dgcDynamicVectorDecoder.h b/contrib/Open3DGC/o3dgcDynamicVectorDecoder.h new file mode 100644 index 000000000..6e21b4fa3 --- /dev/null +++ b/contrib/Open3DGC/o3dgcDynamicVectorDecoder.h @@ -0,0 +1,76 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + + +#pragma once +#ifndef O3DGC_DYNAMIC_VECTOR_DECODER_H +#define O3DGC_DYNAMIC_VECTOR_DECODER_H + +#include "o3dgcCommon.h" +#include "o3dgcBinaryStream.h" +#include "o3dgcDVEncodeParams.h" +#include "o3dgcDynamicVector.h" + +namespace o3dgc +{ + //! + class DynamicVectorDecoder + { + public: + //! Constructor. + DynamicVectorDecoder(void); + //! Destructor. + ~DynamicVectorDecoder(void); + //! + //! + O3DGCErrorCode DecodeHeader(DynamicVector & dynamicVector, + const BinaryStream & bstream); + //! + O3DGCErrorCode DecodePlayload(DynamicVector & dynamicVector, + const BinaryStream & bstream); + + O3DGCStreamType GetStreamType() const { return m_streamType; } + void SetStreamType(O3DGCStreamType streamType) { m_streamType = streamType; } + unsigned long GetIterator() const { return m_iterator;} + O3DGCErrorCode SetIterator(unsigned long iterator) { m_iterator = iterator; return O3DGC_OK; } + + private: + O3DGCErrorCode IQuantize(Real * const floatArray, + unsigned long numFloatArray, + unsigned long dimFloatArray, + unsigned long stride, + const Real * const minFloatArray, + const Real * const maxFloatArray, + unsigned long nQBits); + + unsigned long m_streamSize; + unsigned long m_maxNumVectors; + unsigned long m_numVectors; + unsigned long m_dimVectors; + unsigned long m_iterator; + long * m_quantVectors; + DVEncodeParams m_params; + O3DGCStreamType m_streamType; + }; +} +#endif // O3DGC_DYNAMIC_VECTOR_DECODER_H + diff --git a/contrib/Open3DGC/o3dgcDynamicVectorEncoder.cpp b/contrib/Open3DGC/o3dgcDynamicVectorEncoder.cpp new file mode 100644 index 000000000..00ae75e35 --- /dev/null +++ b/contrib/Open3DGC/o3dgcDynamicVectorEncoder.cpp @@ -0,0 +1,295 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ +#include "o3dgcDVEncodeParams.h" +#include "o3dgcDynamicVectorEncoder.h" +#include "o3dgcArithmeticCodec.h" +#include "o3dgcBinaryStream.h" + +//#define DEBUG_VERBOSE + +namespace o3dgc +{ +#ifdef DEBUG_VERBOSE + FILE * g_fileDebugDVEnc = NULL; +#endif //DEBUG_VERBOSE + + inline O3DGCErrorCode Update(long * const data, const long size) + { + assert(size > 1); + const long size1 = size - 1; + long p = 2; + data[0] += data[1] >> 1; + while(p < size1) + { + data[p] += (data[p-1] + data[p+1] + 2) >> 2; + p += 2; + } + if ( p == size1) + { + data[p] += data[p-1]>>1; + } + return O3DGC_OK; + } + inline O3DGCErrorCode Predict(long * const data, const long size) + { + assert(size > 1); + const long size1 = size - 1; + long p = 1; + while(p < size1) + { + data[p] -= (data[p-1] + data[p+1] + 1) >> 1; + p += 2; + } + if ( p == size1) + { + data[p] -= data[p-1]; + } + return O3DGC_OK; + } + inline O3DGCErrorCode Split(long * const data, const long size) + { + assert(size > 1); + long a = 1; + long b = size-1; + while (a < b) + { + for (long i = a; i < b; i += 2) + { + swap(data[i], data[i+1]); + } + ++a; + --b; + } + return O3DGC_OK; + } + inline O3DGCErrorCode Transform(long * const data, const unsigned long size) + { + unsigned long n = size; + while(n > 1) + { + Predict(data, n); + Update (data, n); + Split(data, n); + n = (n >> 1) + (n & 1); + } + return O3DGC_OK; + } + DynamicVectorEncoder::DynamicVectorEncoder(void) + { + m_maxNumVectors = 0; + m_numVectors = 0; + m_dimVectors = 0; + m_quantVectors = 0; + m_sizeBufferAC = 0; + m_bufferAC = 0; + m_posSize = 0; + m_streamType = O3DGC_STREAM_TYPE_UNKOWN; + } + DynamicVectorEncoder::~DynamicVectorEncoder() + { + delete [] m_quantVectors; + delete [] m_bufferAC; + } + O3DGCErrorCode DynamicVectorEncoder::Encode(const DVEncodeParams & params, + const DynamicVector & dynamicVector, + BinaryStream & bstream) + { + assert(params.GetQuantBits() > 0); + assert(dynamicVector.GetNVector() > 0); + assert(dynamicVector.GetDimVector() > 0); + assert(dynamicVector.GetStride() >= dynamicVector.GetDimVector()); + assert(dynamicVector.GetVectors() && dynamicVector.GetMin() && dynamicVector.GetMax()); + assert(m_streamType != O3DGC_STREAM_TYPE_UNKOWN); + // Encode header + unsigned long start = bstream.GetSize(); + EncodeHeader(params, dynamicVector, bstream); + // Encode payload + EncodePayload(params, dynamicVector, bstream); + bstream.WriteUInt32(m_posSize, bstream.GetSize() - start, m_streamType); + return O3DGC_OK; + + } + O3DGCErrorCode DynamicVectorEncoder::EncodeHeader(const DVEncodeParams & params, + const DynamicVector & dynamicVector, + BinaryStream & bstream) + { + m_streamType = params.GetStreamType(); + bstream.WriteUInt32(O3DGC_DV_START_CODE, m_streamType); + m_posSize = bstream.GetSize(); + bstream.WriteUInt32(0, m_streamType); // to be filled later + bstream.WriteUChar((unsigned char) params.GetEncodeMode(), m_streamType); + bstream.WriteUInt32(dynamicVector.GetNVector() , m_streamType); + if (dynamicVector.GetNVector() > 0) + { + bstream.WriteUInt32(dynamicVector.GetDimVector(), m_streamType); + bstream.WriteUChar ((unsigned char) params.GetQuantBits(), m_streamType); + } + return O3DGC_OK; + } + O3DGCErrorCode DynamicVectorEncoder::EncodeAC(unsigned long num, + unsigned long dim, + unsigned long M, + unsigned long & encodedBytes) + { + Arithmetic_Codec ace; + Static_Bit_Model bModel0; + Adaptive_Bit_Model bModel1; + Adaptive_Data_Model mModelValues(M+2); + const unsigned int NMAX = num * dim * 8 + 100; + if ( m_sizeBufferAC < NMAX ) + { + delete [] m_bufferAC; + m_sizeBufferAC = NMAX; + m_bufferAC = new unsigned char [m_sizeBufferAC]; + } + ace.set_buffer(NMAX, m_bufferAC); + ace.start_encoder(); + ace.ExpGolombEncode(0, 0, bModel0, bModel1); + ace.ExpGolombEncode(M, 0, bModel0, bModel1); + for(unsigned long v = 0; v < num; ++v) + { + for(unsigned long d = 0; d < dim; ++d) + { + EncodeIntACEGC(m_quantVectors[d * num + v], ace, mModelValues, bModel0, bModel1, M); + } + } + encodedBytes = ace.stop_encoder(); + return O3DGC_OK; + } + + O3DGCErrorCode DynamicVectorEncoder::EncodePayload(const DVEncodeParams & params, + const DynamicVector & dynamicVector, + BinaryStream & bstream) + { +#ifdef DEBUG_VERBOSE + g_fileDebugDVEnc = fopen("dv_enc.txt", "w"); +#endif //DEBUG_VERBOSE + unsigned long start = bstream.GetSize(); + const unsigned long dim = dynamicVector.GetDimVector(); + const unsigned long num = dynamicVector.GetNVector(); + + bstream.WriteUInt32(0, m_streamType); + + for(unsigned long j=0 ; j bestEncodedBytes) + { + break; + } + bestM = M; + bestEncodedBytes = encodedBytes; + M *= 2; + } + EncodeAC(num, dim, bestM, encodedBytes); + for(unsigned long i = 0; i < encodedBytes; ++i) + { + bstream.WriteUChar8Bin(m_bufferAC[i]); + } + } + bstream.WriteUInt32(start, bstream.GetSize() - start, m_streamType); +#ifdef DEBUG_VERBOSE + fclose(g_fileDebugDVEnc); +#endif //DEBUG_VERBOSE + return O3DGC_OK; + } + O3DGCErrorCode DynamicVectorEncoder::Quantize(const Real * const floatArray, + unsigned long numFloatArray, + unsigned long dimFloatArray, + unsigned long stride, + const Real * const minFloatArray, + const Real * const maxFloatArray, + unsigned long nQBits) + { + const unsigned long size = numFloatArray * dimFloatArray; + Real r; + if (m_maxNumVectors < size) + { + delete [] m_quantVectors; + m_maxNumVectors = size; + m_quantVectors = new long [m_maxNumVectors]; + } + Real delta; + for(unsigned long d = 0; d < dimFloatArray; ++d) + { + r = maxFloatArray[d] - minFloatArray[d]; + if (r > 0.0f) + { + delta = (float)((1 << nQBits) - 1) / r; + } + else + { + delta = 1.0f; + } + for(unsigned long v = 0; v < numFloatArray; ++v) + { + m_quantVectors[v + d * numFloatArray] = (long)((floatArray[v * stride + d]-minFloatArray[d]) * delta + 0.5f); + } + } + return O3DGC_OK; + } +} diff --git a/contrib/Open3DGC/o3dgcDynamicVectorEncoder.h b/contrib/Open3DGC/o3dgcDynamicVectorEncoder.h new file mode 100644 index 000000000..de42a020f --- /dev/null +++ b/contrib/Open3DGC/o3dgcDynamicVectorEncoder.h @@ -0,0 +1,79 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + + +#pragma once +#ifndef O3DGC_DYNAMIC_VECTOR_ENCODER_H +#define O3DGC_DYNAMIC_VECTOR_ENCODER_H + +#include "o3dgcCommon.h" +#include "o3dgcBinaryStream.h" +#include "o3dgcDynamicVector.h" + +namespace o3dgc +{ + //! + class DynamicVectorEncoder + { + public: + //! Constructor. + DynamicVectorEncoder(void); + //! Destructor. + ~DynamicVectorEncoder(void); + //! + O3DGCErrorCode Encode(const DVEncodeParams & params, + const DynamicVector & dynamicVector, + BinaryStream & bstream); + O3DGCStreamType GetStreamType() const { return m_streamType; } + void SetStreamType(O3DGCStreamType streamType) { m_streamType = streamType; } + + private: + O3DGCErrorCode EncodeHeader(const DVEncodeParams & params, + const DynamicVector & dynamicVector, + BinaryStream & bstream); + O3DGCErrorCode EncodePayload(const DVEncodeParams & params, + const DynamicVector & dynamicVector, + BinaryStream & bstream); + O3DGCErrorCode Quantize(const Real * const floatArray, + unsigned long numFloatArray, + unsigned long dimFloatArray, + unsigned long stride, + const Real * const minFloatArray, + const Real * const maxFloatArray, + unsigned long nQBits); + O3DGCErrorCode EncodeAC(unsigned long num, + unsigned long dim, + unsigned long M, + unsigned long & encodedBytes); + + unsigned long m_posSize; + unsigned long m_sizeBufferAC; + unsigned long m_maxNumVectors; + unsigned long m_numVectors; + unsigned long m_dimVectors; + unsigned char * m_bufferAC; + long * m_quantVectors; + O3DGCStreamType m_streamType; + }; +} +#endif // O3DGC_DYNAMIC_VECTOR_ENCODER_H + diff --git a/contrib/Open3DGC/o3dgcFIFO.h b/contrib/Open3DGC/o3dgcFIFO.h new file mode 100644 index 000000000..874c26475 --- /dev/null +++ b/contrib/Open3DGC/o3dgcFIFO.h @@ -0,0 +1,97 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + + +#pragma once +#ifndef O3DGC_FIFO_H +#define O3DGC_FIFO_H + +#include "o3dgcCommon.h" + +namespace o3dgc +{ + //! + template < typename T > class FIFO + { + public: + //! Constructor. + FIFO() + { + m_buffer = 0; + m_allocated = 0; + m_size = 0; + m_start = 0; + m_end = 0; + }; + //! Destructor. + ~FIFO(void) + { + delete [] m_buffer; + }; + O3DGCErrorCode Allocate(unsigned long size) + { + assert(size > 0); + if (size > m_allocated) + { + delete [] m_buffer; + m_allocated = size; + m_buffer = new T [m_allocated]; + } + Clear(); + return O3DGC_OK; + } + const T & PopFirst() + { + assert(m_size > 0); + --m_size; + unsigned long current = m_start++; + if (m_start == m_allocated) + { + m_end = 0; + } + return m_buffer[current]; + }; + void PushBack(const T & value) + { + assert( m_size < m_allocated); + m_buffer[m_end] = value; + ++m_size; + ++m_end; + if (m_end == m_allocated) + { + m_end = 0; + } + } + const unsigned long GetSize() const { return m_size;}; + const unsigned long GetAllocatedSize() const { return m_allocated;}; + void Clear() { m_start = m_end = m_size = 0;}; + + private: + T * m_buffer; + unsigned long m_allocated; + unsigned long m_size; + unsigned long m_start; + unsigned long m_end; + }; +} +#endif // O3DGC_FIFO_H + diff --git a/contrib/Open3DGC/o3dgcIndexedFaceSet.h b/contrib/Open3DGC/o3dgcIndexedFaceSet.h new file mode 100644 index 000000000..4af9de437 --- /dev/null +++ b/contrib/Open3DGC/o3dgcIndexedFaceSet.h @@ -0,0 +1,263 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + + +#pragma once +#ifndef O3DGC_INDEXED_FACE_SET_H +#define O3DGC_INDEXED_FACE_SET_H + +#include "o3dgcCommon.h" + +namespace o3dgc +{ + template + class IndexedFaceSet + { + public: + //! Constructor. + IndexedFaceSet(void) + { + memset(this, 0, sizeof(IndexedFaceSet)); + m_ccw = true; + m_solid = true; + m_convex = true; + m_isTriangularMesh = true; + m_creaseAngle = 30; + }; + //! Destructor. + ~IndexedFaceSet(void) {}; + + unsigned long GetNCoordIndex() const { return m_nCoordIndex ;} + // only coordIndex is supported + unsigned long GetNCoord() const { return m_nCoord ;} + unsigned long GetNNormal() const { return m_nNormal ;} + unsigned long GetNFloatAttribute(unsigned long a) const + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + return m_nFloatAttribute[a]; + } + unsigned long GetNIntAttribute(unsigned long a) const + { + assert(a < O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES); + return m_nIntAttribute[a]; + } + unsigned long GetNumFloatAttributes() const { return m_numFloatAttributes;} + unsigned long GetNumIntAttributes() const { return m_numIntAttributes ;} + const Real * const GetCoordMin () const { return m_coordMin;} + const Real * const GetCoordMax () const { return m_coordMax;} + const Real * const GetNormalMin () const { return m_normalMin;} + const Real * const GetNormalMax () const { return m_normalMax;} + Real GetCoordMin (int j) const { return m_coordMin[j] ;} + Real GetCoordMax (int j) const { return m_coordMax[j] ;} + Real GetNormalMin (int j) const { return m_normalMin[j] ;} + Real GetNormalMax (int j) const { return m_normalMax[j] ;} + + const O3DGCIFSFloatAttributeType GetFloatAttributeType(unsigned long a) const + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + return m_typeFloatAttribute[a]; + } + const O3DGCIFSIntAttributeType GetIntAttributeType(unsigned long a) const + { + assert(a < O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES); + return m_typeIntAttribute[a]; + } + const unsigned long GetFloatAttributeDim(unsigned long a) const + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + return m_dimFloatAttribute[a]; + } + unsigned long GetIntAttributeDim(unsigned long a) const + { + assert(a < O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES); + return m_dimIntAttribute[a]; + } + const Real * const GetFloatAttributeMin(unsigned long a) const + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + return &(m_minFloatAttribute[a * O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES]); + } + const Real * const GetFloatAttributeMax(unsigned long a) const + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + return &(m_maxFloatAttribute[a * O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES]); + } + Real GetFloatAttributeMin(unsigned long a, unsigned long dim) const + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + assert(dim < O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES); + return m_minFloatAttribute[a * O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES + dim]; + } + Real GetFloatAttributeMax(unsigned long a, unsigned long dim) const + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + assert(dim < O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES); + return m_maxFloatAttribute[a * O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES + dim]; + } + Real GetCreaseAngle() const { return m_creaseAngle ;} + bool GetCCW() const { return m_ccw ;} + bool GetSolid() const { return m_solid ;} + bool GetConvex() const { return m_convex ;} + bool GetIsTriangularMesh() const { return m_isTriangularMesh;} + const unsigned long * const GetIndexBufferID() const { return m_indexBufferID ;} + const T * const GetCoordIndex() const { return m_coordIndex;} + T * const GetCoordIndex() { return m_coordIndex;} + Real * const GetCoord() const { return m_coord ;} + Real * const GetNormal() const { return m_normal ;} + Real * const GetFloatAttribute(unsigned long a) const + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + return m_floatAttribute[a]; + } + long * const GetIntAttribute(unsigned long a) const + { + assert(a < O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES); + return m_intAttribute[a] ; + } + // only coordIndex is supported + void SetNNormalIndex(unsigned long) {} + void SetNTexCoordIndex(unsigned long) {} + void SetNFloatAttributeIndex(int, unsigned long) {} + void SetNIntAttributeIndex (int, unsigned long) {} + // per triangle attributes not supported + void SetNormalPerVertex(bool) {} + void SetColorPerVertex(bool) {} + void SetFloatAttributePerVertex(int, bool){} + void SetIntAttributePerVertex (int, bool){} + void SetNCoordIndex (unsigned long nCoordIndex) { m_nCoordIndex = nCoordIndex;} + void SetNCoord (unsigned long nCoord) { m_nCoord = nCoord ;} + void SetNNormal (unsigned long nNormal) { m_nNormal = nNormal ;} + void SetNumFloatAttributes(unsigned long numFloatAttributes) + { + assert(numFloatAttributes < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + m_numFloatAttributes = numFloatAttributes; + } + void SetNumIntAttributes (unsigned long numIntAttributes) + { + assert(numIntAttributes < O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES); + m_numIntAttributes = numIntAttributes; + } + void SetCreaseAngle (Real creaseAngle) { m_creaseAngle = creaseAngle ;} + void SetCCW (bool ccw) { m_ccw = ccw ;} + void SetSolid (bool solid) { m_solid = solid ;} + void SetConvex (bool convex) { m_convex = convex ;} + void SetIsTriangularMesh (bool isTriangularMesh) { m_isTriangularMesh = isTriangularMesh;} + void SetCoordMin (int j, Real min) { m_coordMin[j] = min;} + void SetCoordMax (int j, Real max) { m_coordMax[j] = max;} + void SetNormalMin (int j, Real min) { m_normalMin[j] = min;} + void SetNormalMax (int j, Real max) { m_normalMax[j] = max;} + void SetNFloatAttribute(unsigned long a, unsigned long nFloatAttribute) + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + m_nFloatAttribute[a] = nFloatAttribute; + } + void SetNIntAttribute(unsigned long a, unsigned long nIntAttribute) + { + assert(a < O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES); + m_nIntAttribute[a] = nIntAttribute; + } + void SetFloatAttributeDim(unsigned long a, unsigned long d) + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + m_dimFloatAttribute[a] = d; + } + void SetIntAttributeDim(unsigned long a, unsigned long d) + { + assert(a < O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES); + m_dimIntAttribute[a] = d; + } + void SetFloatAttributeType(unsigned long a, O3DGCIFSFloatAttributeType t) + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + m_typeFloatAttribute[a] = t; + } + void SetIntAttributeType(unsigned long a, O3DGCIFSIntAttributeType t) + { + assert(a < O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES); + m_typeIntAttribute[a] = t; + } + void SetFloatAttributeMin(unsigned long a, unsigned long dim, Real min) + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + assert(dim < O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES); + m_minFloatAttribute[a * O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES + dim] = min; + } + void SetFloatAttributeMax(unsigned long a, unsigned long dim, Real max) + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + assert(dim < O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES); + m_maxFloatAttribute[a * O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES + dim] = max; + } + void SetIndexBufferID (unsigned long * const indexBufferID) { m_indexBufferID = indexBufferID;} + void SetCoordIndex (T * const coordIndex) { m_coordIndex = coordIndex;} + void SetCoord (Real * const coord ) { m_coord = coord ;} + void SetNormal (Real * const normal ) { m_normal = normal ;} + void SetFloatAttribute (unsigned long a, Real * const floatAttribute) + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + m_floatAttribute[a] = floatAttribute; + } + void SetIntAttribute (unsigned long a, long * const intAttribute) + { + assert(a < O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES); + m_intAttribute[a] = intAttribute ; + } + void ComputeMinMax(O3DGCSC3DMCQuantizationMode quantMode); + + private: + // triangles list + unsigned long m_nCoordIndex; + T * m_coordIndex; + unsigned long * m_indexBufferID; + // coord, normals, texcoord and color + unsigned long m_nCoord; + unsigned long m_nNormal; + Real m_coordMin [3]; + Real m_coordMax [3]; + Real m_normalMin [3]; + Real m_normalMax [3]; + Real * m_coord; + Real * m_normal; + // other attributes + unsigned long m_numFloatAttributes; + unsigned long m_numIntAttributes; + O3DGCIFSFloatAttributeType m_typeFloatAttribute [O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES]; + O3DGCIFSIntAttributeType m_typeIntAttribute [O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES ]; + unsigned long m_nFloatAttribute [O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES]; + unsigned long m_nIntAttribute [O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES ]; + unsigned long m_dimFloatAttribute [O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES]; + unsigned long m_dimIntAttribute [O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES ]; + Real m_minFloatAttribute [O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES * O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES]; + Real m_maxFloatAttribute [O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES * O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES]; + Real * m_floatAttribute [O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES]; + long * m_intAttribute [O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES]; + // mesh info + Real m_creaseAngle; + bool m_ccw; + bool m_solid; + bool m_convex; + bool m_isTriangularMesh; + }; +} +#include "o3dgcIndexedFaceSet.inl" // template implementation +#endif // O3DGC_INDEXED_FACE_SET_H + diff --git a/contrib/Open3DGC/o3dgcIndexedFaceSet.inl b/contrib/Open3DGC/o3dgcIndexedFaceSet.inl new file mode 100644 index 000000000..ddac26d76 --- /dev/null +++ b/contrib/Open3DGC/o3dgcIndexedFaceSet.inl @@ -0,0 +1,47 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + +#pragma once +#ifndef O3DGC_INDEXED_FACE_SET_INL +#define O3DGC_INDEXED_FACE_SET_INL + +#include +namespace o3dgc +{ + template + void IndexedFaceSet::ComputeMinMax(O3DGCSC3DMCQuantizationMode quantMode) + { + ComputeVectorMinMax(m_coord , m_nCoord , 3, 3, m_coordMin , m_coordMax , quantMode); + ComputeVectorMinMax(m_normal , m_nNormal , 3, 3, m_normalMin , m_normalMax , quantMode); + unsigned long numFloatAttributes = GetNumFloatAttributes(); + for(unsigned long a = 0; a < numFloatAttributes; ++a) + { + ComputeVectorMinMax(m_floatAttribute[a], + m_nFloatAttribute[a], + m_dimFloatAttribute[a], + m_dimFloatAttribute[a], // stride + m_minFloatAttribute + (a * O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES), + m_maxFloatAttribute + (a * O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES), quantMode); + } + } +} +#endif // O3DGC_INDEXED_FACE_SET_INL diff --git a/contrib/Open3DGC/o3dgcSC3DMCDecoder.h b/contrib/Open3DGC/o3dgcSC3DMCDecoder.h new file mode 100644 index 000000000..f3f1617c4 --- /dev/null +++ b/contrib/Open3DGC/o3dgcSC3DMCDecoder.h @@ -0,0 +1,111 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + + +#pragma once +#ifndef O3DGC_SC3DMC_DECODER_H +#define O3DGC_SC3DMC_DECODER_H + +#include "o3dgcCommon.h" +#include "o3dgcBinaryStream.h" +#include "o3dgcIndexedFaceSet.h" +#include "o3dgcSC3DMCEncodeParams.h" +#include "o3dgcTriangleListDecoder.h" + +namespace o3dgc +{ + //! + template + class SC3DMCDecoder + { + public: + //! Constructor. + SC3DMCDecoder(void) + { + m_iterator = 0; + m_streamSize = 0; + m_quantFloatArray = 0; + m_quantFloatArraySize = 0; + m_normals = 0; + m_normalsSize = 0; + m_streamType = O3DGC_STREAM_TYPE_UNKOWN; + }; + //! Destructor. + ~SC3DMCDecoder(void) + { + delete [] m_normals; + delete [] m_quantFloatArray; + } + //! + O3DGCErrorCode DecodeHeader(IndexedFaceSet & ifs, + const BinaryStream & bstream); + //! + O3DGCErrorCode DecodePayload(IndexedFaceSet & ifs, + const BinaryStream & bstream); + const SC3DMCStats & GetStats() const { return m_stats;} + unsigned long GetIterator() const { return m_iterator;} + O3DGCErrorCode SetIterator(unsigned long iterator) { m_iterator = iterator; return O3DGC_OK; } + + + private: + O3DGCErrorCode DecodeFloatArray(Real * const floatArray, + unsigned long numfloatArraySize, + unsigned long dimfloatArraySize, + unsigned long stride, + const Real * const minfloatArray, + const Real * const maxfloatArray, + unsigned long nQBits, + const IndexedFaceSet & ifs, + O3DGCSC3DMCPredictionMode & predMode, + const BinaryStream & bstream); + O3DGCErrorCode IQuantizeFloatArray(Real * const floatArray, + unsigned long numfloatArraySize, + unsigned long dimfloatArraySize, + unsigned long stride, + const Real * const minfloatArray, + const Real * const maxfloatArray, + unsigned long nQBits); + O3DGCErrorCode DecodeIntArray(long * const intArray, + unsigned long numIntArraySize, + unsigned long dimIntArraySize, + unsigned long stride, + const IndexedFaceSet & ifs, + O3DGCSC3DMCPredictionMode & predMode, + const BinaryStream & bstream); + O3DGCErrorCode ProcessNormals(const IndexedFaceSet & ifs); + + unsigned long m_iterator; + unsigned long m_streamSize; + SC3DMCEncodeParams m_params; + TriangleListDecoder m_triangleListDecoder; + long * m_quantFloatArray; + unsigned long m_quantFloatArraySize; + Vector m_orientation; + Real * m_normals; + unsigned long m_normalsSize; + SC3DMCStats m_stats; + O3DGCStreamType m_streamType; + }; +} +#include "o3dgcSC3DMCDecoder.inl" // template implementation +#endif // O3DGC_SC3DMC_DECODER_H + diff --git a/contrib/Open3DGC/o3dgcSC3DMCDecoder.inl b/contrib/Open3DGC/o3dgcSC3DMCDecoder.inl new file mode 100644 index 000000000..d36b62f2b --- /dev/null +++ b/contrib/Open3DGC/o3dgcSC3DMCDecoder.inl @@ -0,0 +1,850 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + +#pragma once +#ifndef O3DGC_SC3DMC_DECODER_INL +#define O3DGC_SC3DMC_DECODER_INL + +#include "o3dgcArithmeticCodec.h" +#include "o3dgcTimer.h" + +//#define DEBUG_VERBOSE + +namespace o3dgc +{ +#ifdef DEBUG_VERBOSE + FILE * g_fileDebugSC3DMCDec = NULL; +#endif //DEBUG_VERBOSE + + template + O3DGCErrorCode SC3DMCDecoder::DecodeHeader(IndexedFaceSet & ifs, + const BinaryStream & bstream) + { + unsigned long iterator0 = m_iterator; + unsigned long start_code = bstream.ReadUInt32(m_iterator, O3DGC_STREAM_TYPE_BINARY); + if (start_code != O3DGC_SC3DMC_START_CODE) + { + m_iterator = iterator0; + start_code = bstream.ReadUInt32(m_iterator, O3DGC_STREAM_TYPE_ASCII); + if (start_code != O3DGC_SC3DMC_START_CODE) + { + return O3DGC_ERROR_CORRUPTED_STREAM; + } + else + { + m_streamType = O3DGC_STREAM_TYPE_ASCII; + } + } + else + { + m_streamType = O3DGC_STREAM_TYPE_BINARY; + } + + m_streamSize = bstream.ReadUInt32(m_iterator, m_streamType); + m_params.SetEncodeMode( (O3DGCSC3DMCEncodingMode) bstream.ReadUChar(m_iterator, m_streamType)); + + ifs.SetCreaseAngle((Real) bstream.ReadFloat32(m_iterator, m_streamType)); + + unsigned char mask = bstream.ReadUChar(m_iterator, m_streamType); + + ifs.SetCCW ((mask & 1) == 1); + ifs.SetSolid ((mask & 2) == 1); + ifs.SetConvex ((mask & 4) == 1); + ifs.SetIsTriangularMesh((mask & 8) == 1); + //bool markerBit0 = (mask & 16 ) == 1; + //bool markerBit1 = (mask & 32 ) == 1; + //bool markerBit2 = (mask & 64 ) == 1; + //bool markerBit3 = (mask & 128) == 1; + + ifs.SetNCoord (bstream.ReadUInt32(m_iterator, m_streamType)); + ifs.SetNNormal (bstream.ReadUInt32(m_iterator, m_streamType)); + + + ifs.SetNumFloatAttributes(bstream.ReadUInt32(m_iterator, m_streamType)); + ifs.SetNumIntAttributes (bstream.ReadUInt32(m_iterator, m_streamType)); + + if (ifs.GetNCoord() > 0) + { + ifs.SetNCoordIndex(bstream.ReadUInt32(m_iterator, m_streamType)); + for(int j=0 ; j<3 ; ++j) + { + ifs.SetCoordMin(j, (Real) bstream.ReadFloat32(m_iterator, m_streamType)); + ifs.SetCoordMax(j, (Real) bstream.ReadFloat32(m_iterator, m_streamType)); + } + m_params.SetCoordQuantBits( bstream.ReadUChar(m_iterator, m_streamType) ); + } + if (ifs.GetNNormal() > 0) + { + ifs.SetNNormalIndex(bstream.ReadUInt32(m_iterator, m_streamType)); + for(int j=0 ; j<3 ; ++j) + { + ifs.SetNormalMin(j, (Real) bstream.ReadFloat32(m_iterator, m_streamType)); + ifs.SetNormalMax(j, (Real) bstream.ReadFloat32(m_iterator, m_streamType)); + } + ifs.SetNormalPerVertex(bstream.ReadUChar(m_iterator, m_streamType) == 1); + m_params.SetNormalQuantBits(bstream.ReadUChar(m_iterator, m_streamType)); + } + + for(unsigned long a = 0; a < ifs.GetNumFloatAttributes(); ++a) + { + ifs.SetNFloatAttribute(a, bstream.ReadUInt32(m_iterator, m_streamType)); + if (ifs.GetNFloatAttribute(a) > 0) + { + ifs.SetNFloatAttributeIndex(a, bstream.ReadUInt32(m_iterator, m_streamType)); + unsigned char d = bstream.ReadUChar(m_iterator, m_streamType); + ifs.SetFloatAttributeDim(a, d); + for(unsigned char j = 0 ; j < d ; ++j) + { + ifs.SetFloatAttributeMin(a, j, (Real) bstream.ReadFloat32(m_iterator, m_streamType)); + ifs.SetFloatAttributeMax(a, j, (Real) bstream.ReadFloat32(m_iterator, m_streamType)); + } + ifs.SetFloatAttributePerVertex(a, bstream.ReadUChar(m_iterator, m_streamType) == 1); + ifs.SetFloatAttributeType(a, (O3DGCIFSFloatAttributeType) bstream.ReadUChar(m_iterator, m_streamType)); + m_params.SetFloatAttributeQuantBits(a, bstream.ReadUChar(m_iterator, m_streamType)); + } + } + for(unsigned long a = 0; a < ifs.GetNumIntAttributes(); ++a) + { + ifs.SetNIntAttribute(a, bstream.ReadUInt32(m_iterator, m_streamType)); + if (ifs.GetNIntAttribute(a) > 0) + { + ifs.SetNIntAttributeIndex(a, bstream.ReadUInt32(m_iterator, m_streamType)); + ifs.SetIntAttributeDim(a, bstream.ReadUChar(m_iterator, m_streamType)); + ifs.SetIntAttributePerVertex(a, bstream.ReadUChar(m_iterator, m_streamType) == 1); + ifs.SetIntAttributeType(a, (O3DGCIFSIntAttributeType) bstream.ReadUChar(m_iterator, m_streamType)); + } + } + return O3DGC_OK; + } + template + O3DGCErrorCode SC3DMCDecoder::DecodePayload(IndexedFaceSet & ifs, + const BinaryStream & bstream) + { + O3DGCErrorCode ret = O3DGC_OK; +#ifdef DEBUG_VERBOSE + g_fileDebugSC3DMCDec = fopen("tfans_dec_main.txt", "w"); +#endif //DEBUG_VERBOSE + + m_triangleListDecoder.SetStreamType(m_streamType); + m_stats.m_streamSizeCoordIndex = m_iterator; + Timer timer; + timer.Tic(); + m_triangleListDecoder.Decode(ifs.GetCoordIndex(), ifs.GetNCoordIndex(), ifs.GetNCoord(), bstream, m_iterator); + timer.Toc(); + m_stats.m_timeCoordIndex = timer.GetElapsedTime(); + m_stats.m_streamSizeCoordIndex = m_iterator - m_stats.m_streamSizeCoordIndex; + + // decode coord + m_stats.m_streamSizeCoord = m_iterator; + timer.Tic(); + if (ifs.GetNCoord() > 0) + { + ret = DecodeFloatArray(ifs.GetCoord(), ifs.GetNCoord(), 3, 3, ifs.GetCoordMin(), ifs.GetCoordMax(), + m_params.GetCoordQuantBits(), ifs, m_params.GetCoordPredMode(), bstream); + } + if (ret != O3DGC_OK) + { + return ret; + } + timer.Toc(); + m_stats.m_timeCoord = timer.GetElapsedTime(); + m_stats.m_streamSizeCoord = m_iterator - m_stats.m_streamSizeCoord; + + // decode Normal + m_stats.m_streamSizeNormal = m_iterator; + timer.Tic(); + if (ifs.GetNNormal() > 0) + { + DecodeFloatArray(ifs.GetNormal(), ifs.GetNNormal(), 3, 3, ifs.GetNormalMin(), ifs.GetNormalMax(), + m_params.GetNormalQuantBits(), ifs, m_params.GetNormalPredMode(), bstream); + } + if (ret != O3DGC_OK) + { + return ret; + } + timer.Toc(); + m_stats.m_timeNormal = timer.GetElapsedTime(); + m_stats.m_streamSizeNormal = m_iterator - m_stats.m_streamSizeNormal; + + // decode FloatAttributes + for(unsigned long a = 0; a < ifs.GetNumFloatAttributes(); ++a) + { + m_stats.m_streamSizeFloatAttribute[a] = m_iterator; + timer.Tic(); + DecodeFloatArray(ifs.GetFloatAttribute(a), ifs.GetNFloatAttribute(a), ifs.GetFloatAttributeDim(a), ifs.GetFloatAttributeDim(a), + ifs.GetFloatAttributeMin(a), ifs.GetFloatAttributeMax(a), + m_params.GetFloatAttributeQuantBits(a), ifs, m_params.GetFloatAttributePredMode(a), bstream); + timer.Toc(); + m_stats.m_timeFloatAttribute[a] = timer.GetElapsedTime(); + m_stats.m_streamSizeFloatAttribute[a] = m_iterator - m_stats.m_streamSizeFloatAttribute[a]; + } + if (ret != O3DGC_OK) + { + return ret; + } + + // decode IntAttributes + for(unsigned long a = 0; a < ifs.GetNumIntAttributes(); ++a) + { + m_stats.m_streamSizeIntAttribute[a] = m_iterator; + timer.Tic(); + DecodeIntArray(ifs.GetIntAttribute(a), ifs.GetNIntAttribute(a), ifs.GetIntAttributeDim(a), ifs.GetIntAttributeDim(a), + ifs, m_params.GetIntAttributePredMode(a), bstream); + timer.Toc(); + m_stats.m_timeIntAttribute[a] = timer.GetElapsedTime(); + m_stats.m_streamSizeIntAttribute[a] = m_iterator - m_stats.m_streamSizeIntAttribute[a]; + } + if (ret != O3DGC_OK) + { + return ret; + } + + timer.Tic(); + m_triangleListDecoder.Reorder(); + timer.Toc(); + m_stats.m_timeReorder = timer.GetElapsedTime(); + +#ifdef DEBUG_VERBOSE + fclose(g_fileDebugSC3DMCDec); +#endif //DEBUG_VERBOSE + return ret; + } + template + O3DGCErrorCode SC3DMCDecoder::DecodeIntArray(long * const intArray, + unsigned long numIntArray, + unsigned long dimIntArray, + unsigned long stride, + const IndexedFaceSet & ifs, + O3DGCSC3DMCPredictionMode & predMode, + const BinaryStream & bstream) + { + assert(dimIntArray < O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES); + long predResidual; + SC3DMCPredictor m_neighbors [O3DGC_SC3DMC_MAX_PREDICTION_NEIGHBORS]; + Arithmetic_Codec acd; + Static_Bit_Model bModel0; + Adaptive_Bit_Model bModel1; + Adaptive_Data_Model mModelPreds(O3DGC_SC3DMC_MAX_PREDICTION_NEIGHBORS+1); + unsigned long nPred; + + const AdjacencyInfo & v2T = m_triangleListDecoder.GetVertexToTriangle(); + const T * const triangles = ifs.GetCoordIndex(); + const long nvert = (long) numIntArray; + unsigned char * buffer = 0; + unsigned long start = m_iterator; + unsigned long streamSize = bstream.ReadUInt32(m_iterator, m_streamType); // bitsream size + unsigned char mask = bstream.ReadUChar(m_iterator, m_streamType); + O3DGCSC3DMCBinarization binarization = (O3DGCSC3DMCBinarization)((mask >> 4) & 7); + predMode = (O3DGCSC3DMCPredictionMode)(mask & 7); + streamSize -= (m_iterator - start); + unsigned long iteratorPred = m_iterator + streamSize; + unsigned int exp_k = 0; + unsigned int M = 0; + if (m_streamType != O3DGC_STREAM_TYPE_ASCII) + { + if (binarization != O3DGC_SC3DMC_BINARIZATION_AC_EGC) + { + return O3DGC_ERROR_CORRUPTED_STREAM; + } + bstream.GetBuffer(m_iterator, buffer); + m_iterator += streamSize; + acd.set_buffer(streamSize, buffer); + acd.start_decoder(); + exp_k = acd.ExpGolombDecode(0, bModel0, bModel1); + M = acd.ExpGolombDecode(0, bModel0, bModel1); + } + else + { + if (binarization != O3DGC_SC3DMC_BINARIZATION_ASCII) + { + return O3DGC_ERROR_CORRUPTED_STREAM; + } + bstream.ReadUInt32(iteratorPred, m_streamType); // predictors bitsream size + } + Adaptive_Data_Model mModelValues(M+2); + +#ifdef DEBUG_VERBOSE + printf("IntArray (%i, %i)\n", numIntArray, dimIntArray); + fprintf(g_fileDebugSC3DMCDec, "IntArray (%i, %i)\n", numIntArray, dimIntArray); +#endif //DEBUG_VERBOSE + + for (long v=0; v < nvert; ++v) + { + nPred = 0; + if ( v2T.GetNumNeighbors(v) > 0 && + predMode != O3DGC_SC3DMC_NO_PREDICTION) + { + int u0 = v2T.Begin(v); + int u1 = v2T.End(v); + for (long u = u0; u < u1; u++) + { + long ta = v2T.GetNeighbor(u); + if (ta < 0) + { + break; + } + for(long k = 0; k < 3; ++k) + { + long w = triangles[ta*3 + k]; + if ( w < v ) + { + SC3DMCTriplet id = {-1, -1, w}; + unsigned long p = Insert(id, nPred, m_neighbors); + if (p != 0xFFFFFFFF) + { + for (unsigned long i = 0; i < dimIntArray; i++) + { + m_neighbors[p].m_pred[i] = intArray[w*stride+i]; + } + } + } + } + } + } + if (nPred > 1) + { +#ifdef DEBUG_VERBOSE1 + printf("\t\t vm %i\n", v); + fprintf(g_fileDebugSC3DMCDec, "\t\t vm %i\n", v); + for (unsigned long p = 0; p < nPred; ++p) + { + printf("\t\t pred a = %i b = %i c = %i \n", m_neighbors[p].m_id.m_a, m_neighbors[p].m_id.m_b, m_neighbors[p].m_id.m_c); + fprintf(g_fileDebugSC3DMCDec, "\t\t pred a = %i b = %i c = %i \n", m_neighbors[p].m_id.m_a, m_neighbors[p].m_id.m_b, m_neighbors[p].m_id.m_c); + for (unsigned long i = 0; i < dimIntArray; ++i) + { + printf("\t\t\t %i\n", m_neighbors[p].m_pred[i]); + fprintf(g_fileDebugSC3DMCDec, "\t\t\t %i\n", m_neighbors[p].m_pred[i]); + } + } +#endif //DEBUG_VERBOSE + unsigned long bestPred; + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + bestPred = bstream.ReadUCharASCII(iteratorPred); + } + else + { + bestPred = acd.decode(mModelPreds); + } +#ifdef DEBUG_VERBOSE1 + printf("best (%i, %i, %i) \t pos %i\n", m_neighbors[bestPred].m_id.m_a, m_neighbors[bestPred].m_id.m_b, m_neighbors[bestPred].m_id.m_c, bestPred); + fprintf(g_fileDebugSC3DMCDec, "best (%i, %i, %i) \t pos %i\n", m_neighbors[bestPred].m_id.m_a, m_neighbors[bestPred].m_id.m_b, m_neighbors[bestPred].m_id.m_c, bestPred); +#endif //DEBUG_VERBOSE + for (unsigned long i = 0; i < dimIntArray; i++) + { + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + predResidual = bstream.ReadIntASCII(m_iterator); + } + else + { + predResidual = DecodeIntACEGC(acd, mModelValues, bModel0, bModel1, exp_k, M); + } + intArray[v*stride+i] = predResidual + m_neighbors[bestPred].m_pred[i]; +#ifdef DEBUG_VERBOSE + printf("%i \t %i \t [%i]\n", v*dimIntArray+i, predResidual, m_neighbors[bestPred].m_pred[i]); + fprintf(g_fileDebugSC3DMCDec, "%i \t %i \t [%i]\n", v*dimIntArray+i, predResidual, m_neighbors[bestPred].m_pred[i]); +#endif //DEBUG_VERBOSE + } + } + else if (v > 0 && predMode != O3DGC_SC3DMC_NO_PREDICTION) + { + for (unsigned long i = 0; i < dimIntArray; i++) + { + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + predResidual = bstream.ReadIntASCII(m_iterator); + } + else + { + predResidual = DecodeIntACEGC(acd, mModelValues, bModel0, bModel1, exp_k, M); + } + intArray[v*stride+i] = predResidual + intArray[(v-1)*stride+i]; +#ifdef DEBUG_VERBOSE + printf("%i \t %i\n", v*dimIntArray+i, predResidual); + fprintf(g_fileDebugSC3DMCDec, "%i \t %i\n", v*dimIntArray+i, predResidual); +#endif //DEBUG_VERBOSE + } + } + else + { + for (unsigned long i = 0; i < dimIntArray; i++) + { + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + predResidual = bstream.ReadUIntASCII(m_iterator); + } + else + { + predResidual = DecodeUIntACEGC(acd, mModelValues, bModel0, bModel1, exp_k, M); + } + intArray[v*stride+i] = predResidual; +#ifdef DEBUG_VERBOSE + printf("%i \t %i\n", v*dimIntArray+i, predResidual); + fprintf(g_fileDebugSC3DMCDec, "%i \t %i\n", v*dimIntArray+i, predResidual); +#endif //DEBUG_VERBOSE + } + } + } + m_iterator = iteratorPred; +#ifdef DEBUG_VERBOSE + fflush(g_fileDebugSC3DMCDec); +#endif //DEBUG_VERBOSE + return O3DGC_OK; + } + template + O3DGCErrorCode SC3DMCDecoder::ProcessNormals(const IndexedFaceSet & ifs) + { + const long nvert = (long) ifs.GetNNormal(); + const unsigned long normalSize = ifs.GetNNormal() * 2; + if (m_normalsSize < normalSize) + { + delete [] m_normals; + m_normalsSize = normalSize; + m_normals = new Real [normalSize]; + } + const AdjacencyInfo & v2T = m_triangleListDecoder.GetVertexToTriangle(); + const T * const triangles = ifs.GetCoordIndex(); + Vec3 p1, p2, p3, n0, nt; + long na0, nb0; + Real rna0, rnb0, norm0; + char ni0 = 0, ni1 = 0; + long a, b, c; + for (long v=0; v < nvert; ++v) + { + n0.X() = 0; + n0.Y() = 0; + n0.Z() = 0; + int u0 = v2T.Begin(v); + int u1 = v2T.End(v); + for (long u = u0; u < u1; u++) + { + long ta = v2T.GetNeighbor(u); + if (ta == -1) + { + break; + } + a = triangles[ta*3 + 0]; + b = triangles[ta*3 + 1]; + c = triangles[ta*3 + 2]; + p1.X() = m_quantFloatArray[3*a]; + p1.Y() = m_quantFloatArray[3*a+1]; + p1.Z() = m_quantFloatArray[3*a+2]; + p2.X() = m_quantFloatArray[3*b]; + p2.Y() = m_quantFloatArray[3*b+1]; + p2.Z() = m_quantFloatArray[3*b+2]; + p3.X() = m_quantFloatArray[3*c]; + p3.Y() = m_quantFloatArray[3*c+1]; + p3.Z() = m_quantFloatArray[3*c+2]; + nt = (p2-p1)^(p3-p1); + n0 += nt; + } + norm0 = (Real) n0.GetNorm(); + if (norm0 == 0.0) + { + norm0 = 1.0; + } + SphereToCube(n0.X(), n0.Y(), n0.Z(), na0, nb0, ni0); + + + rna0 = na0 / norm0; + rnb0 = nb0 / norm0; + ni1 = ni0 + m_orientation[v]; + m_orientation[v] = ni1; + if ( (ni1 >> 1) != (ni0 >> 1) ) + { + rna0 = Real(0.0); + rnb0 = Real(0.0); + } + m_normals[2*v] = rna0; + m_normals[2*v+1] = rnb0; + +#ifdef DEBUG_VERBOSE1 + printf("n0 \t %i \t %i \t %i \t %i (%f, %f)\n", v, n0.X(), n0.Y(), n0.Z(), rna0, rnb0); + fprintf(g_fileDebugSC3DMCDec, "n0 \t %i \t %i \t %i \t %i (%f, %f)\n", v, n0.X(), n0.Y(), n0.Z(), rna0, rnb0); +#endif //DEBUG_VERBOSE + + } + return O3DGC_OK; + } + template + O3DGCErrorCode SC3DMCDecoder::DecodeFloatArray(Real * const floatArray, + unsigned long numFloatArray, + unsigned long dimFloatArray, + unsigned long stride, + const Real * const minFloatArray, + const Real * const maxFloatArray, + unsigned long nQBits, + const IndexedFaceSet & ifs, + O3DGCSC3DMCPredictionMode & predMode, + const BinaryStream & bstream) + { + assert(dimFloatArray < O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES); + long predResidual; + SC3DMCPredictor m_neighbors [O3DGC_SC3DMC_MAX_PREDICTION_NEIGHBORS]; + Arithmetic_Codec acd; + Static_Bit_Model bModel0; + Adaptive_Bit_Model bModel1; + Adaptive_Data_Model mModelPreds(O3DGC_SC3DMC_MAX_PREDICTION_NEIGHBORS+1); + unsigned long nPred; + + const AdjacencyInfo & v2T = m_triangleListDecoder.GetVertexToTriangle(); + const T * const triangles = ifs.GetCoordIndex(); + const long nvert = (long) numFloatArray; + const unsigned long size = numFloatArray * dimFloatArray; + unsigned char * buffer = 0; + unsigned long start = m_iterator; + unsigned long streamSize = bstream.ReadUInt32(m_iterator, m_streamType); // bitsream size + unsigned char mask = bstream.ReadUChar(m_iterator, m_streamType); + O3DGCSC3DMCBinarization binarization = (O3DGCSC3DMCBinarization)((mask >> 4) & 7); + predMode = (O3DGCSC3DMCPredictionMode)(mask & 7); + streamSize -= (m_iterator - start); + unsigned long iteratorPred = m_iterator + streamSize; + unsigned int exp_k = 0; + unsigned int M = 0; + if (m_streamType != O3DGC_STREAM_TYPE_ASCII) + { + if (binarization != O3DGC_SC3DMC_BINARIZATION_AC_EGC) + { + return O3DGC_ERROR_CORRUPTED_STREAM; + } + bstream.GetBuffer(m_iterator, buffer); + m_iterator += streamSize; + acd.set_buffer(streamSize, buffer); + acd.start_decoder(); + exp_k = acd.ExpGolombDecode(0, bModel0, bModel1); + M = acd.ExpGolombDecode(0, bModel0, bModel1); + } + else + { + if (binarization != O3DGC_SC3DMC_BINARIZATION_ASCII) + { + return O3DGC_ERROR_CORRUPTED_STREAM; + } + bstream.ReadUInt32(iteratorPred, m_streamType); // predictors bitsream size + } + Adaptive_Data_Model mModelValues(M+2); + + + if (predMode == O3DGC_SC3DMC_SURF_NORMALS_PREDICTION) + { + m_orientation.Allocate(size); + m_orientation.Clear(); + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + for(unsigned long i = 0; i < numFloatArray; ++i) + { + m_orientation.PushBack((unsigned char) bstream.ReadIntASCII(m_iterator)); + } + } + else + { + Adaptive_Data_Model dModel(12); + for(unsigned long i = 0; i < numFloatArray; ++i) + { + m_orientation.PushBack((unsigned char) UIntToInt(acd.decode(dModel))); + } + } + ProcessNormals(ifs); + dimFloatArray = 2; + } +#ifdef DEBUG_VERBOSE + printf("FloatArray (%i, %i)\n", numFloatArray, dimFloatArray); + fprintf(g_fileDebugSC3DMCDec, "FloatArray (%i, %i)\n", numFloatArray, dimFloatArray); +#endif //DEBUG_VERBOSE + + if (m_quantFloatArraySize < size) + { + delete [] m_quantFloatArray; + m_quantFloatArraySize = size; + m_quantFloatArray = new long [size]; + } + for (long v=0; v < nvert; ++v) + { + nPred = 0; + if ( v2T.GetNumNeighbors(v) > 0 && + predMode != O3DGC_SC3DMC_NO_PREDICTION) + { + int u0 = v2T.Begin(v); + int u1 = v2T.End(v); + for (long u = u0; u < u1; u++) + { + long ta = v2T.GetNeighbor(u); + if (ta < 0) + { + break; + } + if (predMode == O3DGC_SC3DMC_PARALLELOGRAM_PREDICTION) + { + long a,b; + if ((long) triangles[ta*3] == v) + { + a = triangles[ta*3 + 1]; + b = triangles[ta*3 + 2]; + } + else if ((long)triangles[ta*3 + 1] == v) + { + a = triangles[ta*3 + 0]; + b = triangles[ta*3 + 2]; + } + else + { + a = triangles[ta*3 + 0]; + b = triangles[ta*3 + 1]; + } + if ( a < v && b < v) + { + int u0 = v2T.Begin(a); + int u1 = v2T.End(a); + for (long u = u0; u < u1; u++) + { + long tb = v2T.GetNeighbor(u); + if (tb < 0) + { + break; + } + long c = -1; + bool foundB = false; + for(long k = 0; k < 3; ++k) + { + long x = triangles[tb*3 + k]; + if (x == b) + { + foundB = true; + } + if (x < v && x != a && x != b) + { + c = x; + } + } + if (c != -1 && foundB) + { + SC3DMCTriplet id = {min(a, b), max(a, b), -c-1}; + unsigned long p = Insert(id, nPred, m_neighbors); + if (p != 0xFFFFFFFF) + { + for (unsigned long i = 0; i < dimFloatArray; i++) + { + m_neighbors[p].m_pred[i] = m_quantFloatArray[a*stride+i] + + m_quantFloatArray[b*stride+i] - + m_quantFloatArray[c*stride+i]; + } + } + } + } + } + } + if ( predMode == O3DGC_SC3DMC_SURF_NORMALS_PREDICTION || + predMode == O3DGC_SC3DMC_PARALLELOGRAM_PREDICTION || + predMode == O3DGC_SC3DMC_DIFFERENTIAL_PREDICTION ) + { + for(long k = 0; k < 3; ++k) + { + long w = triangles[ta*3 + k]; + if ( w < v ) + { + SC3DMCTriplet id = {-1, -1, w}; + unsigned long p = Insert(id, nPred, m_neighbors); + if (p != 0xFFFFFFFF) + { + for (unsigned long i = 0; i < dimFloatArray; i++) + { + m_neighbors[p].m_pred[i] = m_quantFloatArray[w*stride+i]; + } + } + } + } + } + } + } + if (nPred > 1) + { +#ifdef DEBUG_VERBOSE1 + printf("\t\t vm %i\n", v); + fprintf(g_fileDebugSC3DMCDec, "\t\t vm %i\n", v); + for (unsigned long p = 0; p < nPred; ++p) + { + printf("\t\t pred a = %i b = %i c = %i \n", m_neighbors[p].m_id.m_a, m_neighbors[p].m_id.m_b, m_neighbors[p].m_id.m_c); + fprintf(g_fileDebugSC3DMCDec, "\t\t pred a = %i b = %i c = %i \n", m_neighbors[p].m_id.m_a, m_neighbors[p].m_id.m_b, m_neighbors[p].m_id.m_c); + for (unsigned long i = 0; i < dimFloatArray; ++i) + { + printf("\t\t\t %i\n", m_neighbors[p].m_pred[i]); + fprintf(g_fileDebugSC3DMCDec, "\t\t\t %i\n", m_neighbors[p].m_pred[i]); + } + } +#endif //DEBUG_VERBOSE + unsigned long bestPred; + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + bestPred = bstream.ReadUCharASCII(iteratorPred); + } + else + { + bestPred = acd.decode(mModelPreds); + } +#ifdef DEBUG_VERBOSE1 + printf("best (%i, %i, %i) \t pos %i\n", m_neighbors[bestPred].m_id.m_a, m_neighbors[bestPred].m_id.m_b, m_neighbors[bestPred].m_id.m_c, bestPred); + fprintf(g_fileDebugSC3DMCDec, "best (%i, %i, %i) \t pos %i\n", m_neighbors[bestPred].m_id.m_a, m_neighbors[bestPred].m_id.m_b, m_neighbors[bestPred].m_id.m_c, bestPred); +#endif //DEBUG_VERBOSE + for (unsigned long i = 0; i < dimFloatArray; i++) + { + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + predResidual = bstream.ReadIntASCII(m_iterator); + } + else + { + predResidual = DecodeIntACEGC(acd, mModelValues, bModel0, bModel1, exp_k, M); + } + m_quantFloatArray[v*stride+i] = predResidual + m_neighbors[bestPred].m_pred[i]; +#ifdef DEBUG_VERBOSE + printf("%i \t %i \t [%i]\n", v*dimFloatArray+i, predResidual, m_neighbors[bestPred].m_pred[i]); + fprintf(g_fileDebugSC3DMCDec, "%i \t %i \t [%i]\n", v*dimFloatArray+i, predResidual, m_neighbors[bestPred].m_pred[i]); +#endif //DEBUG_VERBOSE + } + } + else if (v > 0 && predMode != O3DGC_SC3DMC_NO_PREDICTION) + { + for (unsigned long i = 0; i < dimFloatArray; i++) + { + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + predResidual = bstream.ReadIntASCII(m_iterator); + } + else + { + predResidual = DecodeIntACEGC(acd, mModelValues, bModel0, bModel1, exp_k, M); + } + m_quantFloatArray[v*stride+i] = predResidual + m_quantFloatArray[(v-1)*stride+i]; +#ifdef DEBUG_VERBOSE + printf("%i \t %i\n", v*dimFloatArray+i, predResidual); + fprintf(g_fileDebugSC3DMCDec, "%i \t %i\n", v*dimFloatArray+i, predResidual); +#endif //DEBUG_VERBOSE + } + } + else + { + for (unsigned long i = 0; i < dimFloatArray; i++) + { + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + predResidual = bstream.ReadUIntASCII(m_iterator); + } + else + { + predResidual = DecodeUIntACEGC(acd, mModelValues, bModel0, bModel1, exp_k, M); + } + m_quantFloatArray[v*stride+i] = predResidual; +#ifdef DEBUG_VERBOSE + printf("%i \t %i\n", v*dimFloatArray+i, predResidual); + fprintf(g_fileDebugSC3DMCDec, "%i \t %i\n", v*dimFloatArray+i, predResidual); +#endif //DEBUG_VERBOSE + } + } + } + m_iterator = iteratorPred; + if (predMode == O3DGC_SC3DMC_SURF_NORMALS_PREDICTION) + { + const Real minNormal[2] = {(Real)(-2),(Real)(-2)}; + const Real maxNormal[2] = {(Real)(2),(Real)(2)}; + Real na1, nb1; + Real na0, nb0; + char ni1; + IQuantizeFloatArray(floatArray, numFloatArray, dimFloatArray, stride, minNormal, maxNormal, nQBits+1); + for (long v=0; v < nvert; ++v) + { + na0 = m_normals[2*v]; + nb0 = m_normals[2*v+1]; + na1 = floatArray[stride*v] + na0; + nb1 = floatArray[stride*v+1] + nb0; + ni1 = m_orientation[v]; + + CubeToSphere(na1, nb1, ni1, + floatArray[stride*v], + floatArray[stride*v+1], + floatArray[stride*v+2]); + +#ifdef DEBUG_VERBOSE1 + printf("normal \t %i \t %f \t %f \t %f \t (%i, %f, %f) \t (%f, %f)\n", + v, + floatArray[stride*v], + floatArray[stride*v+1], + floatArray[stride*v+2], + ni1, na1, nb1, + na0, nb0); + fprintf(g_fileDebugSC3DMCDec, "normal \t %i \t %f \t %f \t %f \t (%i, %f, %f) \t (%f, %f)\n", + v, + floatArray[stride*v], + floatArray[stride*v+1], + floatArray[stride*v+2], + ni1, na1, nb1, + na0, nb0); +#endif //DEBUG_VERBOSE + } + } + else + { + IQuantizeFloatArray(floatArray, numFloatArray, dimFloatArray, stride, minFloatArray, maxFloatArray, nQBits); + } +#ifdef DEBUG_VERBOSE + fflush(g_fileDebugSC3DMCDec); +#endif //DEBUG_VERBOSE + return O3DGC_OK; + } + template + O3DGCErrorCode SC3DMCDecoder::IQuantizeFloatArray(Real * const floatArray, + unsigned long numFloatArray, + unsigned long dimFloatArray, + unsigned long stride, + const Real * const minFloatArray, + const Real * const maxFloatArray, + unsigned long nQBits) + { + + Real idelta[O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES]; + Real r; + for(unsigned long d = 0; d < dimFloatArray; d++) + { + r = maxFloatArray[d] - minFloatArray[d]; + if (r > 0.0f) + { + idelta[d] = r/(float)((1 << nQBits) - 1); + } + else + { + idelta[d] = 1.0f; + } + } + for(unsigned long v = 0; v < numFloatArray; ++v) + { + for(unsigned long d = 0; d < dimFloatArray; ++d) + { +// floatArray[v * stride + d] = m_quantFloatArray[v * stride + d]; + floatArray[v * stride + d] = m_quantFloatArray[v * stride + d] * idelta[d] + minFloatArray[d]; + } + } + return O3DGC_OK; + } +} +#endif // O3DGC_SC3DMC_DECODER_INL + + diff --git a/contrib/Open3DGC/o3dgcSC3DMCEncodeParams.h b/contrib/Open3DGC/o3dgcSC3DMCEncodeParams.h new file mode 100644 index 000000000..5f3db969c --- /dev/null +++ b/contrib/Open3DGC/o3dgcSC3DMCEncodeParams.h @@ -0,0 +1,140 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + + +#pragma once +#ifndef O3DGC_SC3DMC_ENCODE_PARAMS_H +#define O3DGC_SC3DMC_ENCODE_PARAMS_H + +#include "o3dgcCommon.h" + +namespace o3dgc +{ + class SC3DMCEncodeParams + { + public: + //! Constructor. + SC3DMCEncodeParams(void) + { + memset(this, 0, sizeof(SC3DMCEncodeParams)); + m_encodeMode = O3DGC_SC3DMC_ENCODE_MODE_TFAN; + m_streamTypeMode = O3DGC_STREAM_TYPE_ASCII; + m_coordQuantBits = 14; + m_normalQuantBits = 8; + m_coordPredMode = O3DGC_SC3DMC_PARALLELOGRAM_PREDICTION; + m_normalPredMode = O3DGC_SC3DMC_SURF_NORMALS_PREDICTION; + for(unsigned long a = 0; a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES; ++a) + { + m_floatAttributePredMode[a] = O3DGC_SC3DMC_DIFFERENTIAL_PREDICTION; + } + for(unsigned long a = 0; a < O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES; ++a) + { + m_intAttributePredMode[a] = O3DGC_SC3DMC_NO_PREDICTION; + } + }; + //! Destructor. + ~SC3DMCEncodeParams(void) {}; + + O3DGCStreamType GetStreamType() const { return m_streamTypeMode;} + O3DGCSC3DMCEncodingMode GetEncodeMode() const { return m_encodeMode;} + + unsigned long GetNumFloatAttributes() const { return m_numFloatAttributes;} + unsigned long GetNumIntAttributes() const { return m_numIntAttributes;} + unsigned long GetCoordQuantBits() const { return m_coordQuantBits;} + unsigned long GetNormalQuantBits() const { return m_normalQuantBits;} + unsigned long GetFloatAttributeQuantBits(unsigned long a) const + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + return m_floatAttributeQuantBits[a]; + } + O3DGCSC3DMCPredictionMode GetCoordPredMode() const { return m_coordPredMode; } + O3DGCSC3DMCPredictionMode GetNormalPredMode() const { return m_normalPredMode; } + O3DGCSC3DMCPredictionMode GetFloatAttributePredMode(unsigned long a) const + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + return m_floatAttributePredMode[a]; + } + O3DGCSC3DMCPredictionMode GetIntAttributePredMode(unsigned long a) const + { + assert(a < O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES); + return m_intAttributePredMode[a]; + } + O3DGCSC3DMCPredictionMode & GetCoordPredMode() { return m_coordPredMode; } + O3DGCSC3DMCPredictionMode & GetNormalPredMode() { return m_normalPredMode; } + O3DGCSC3DMCPredictionMode & GetFloatAttributePredMode(unsigned long a) + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + return m_floatAttributePredMode[a]; + } + O3DGCSC3DMCPredictionMode & GetIntAttributePredMode(unsigned long a) + { + assert(a < O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES); + return m_intAttributePredMode[a]; + } + void SetStreamType(O3DGCStreamType streamTypeMode) { m_streamTypeMode = streamTypeMode;} + void SetEncodeMode(O3DGCSC3DMCEncodingMode encodeMode) { m_encodeMode = encodeMode;} + void SetNumFloatAttributes(unsigned long numFloatAttributes) + { + assert(numFloatAttributes < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + m_numFloatAttributes = numFloatAttributes; + } + void SetNumIntAttributes (unsigned long numIntAttributes) + { + assert(numIntAttributes < O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES); + m_numIntAttributes = numIntAttributes; + } + void SetCoordQuantBits (unsigned int coordQuantBits ) { m_coordQuantBits = coordQuantBits ; } + void SetNormalQuantBits (unsigned int normalQuantBits ) { m_normalQuantBits = normalQuantBits ; } + void SetFloatAttributeQuantBits(unsigned long a, unsigned long q) + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + m_floatAttributeQuantBits[a] = q; + } + void SetCoordPredMode (O3DGCSC3DMCPredictionMode coordPredMode ) { m_coordPredMode = coordPredMode ; } + void SetNormalPredMode (O3DGCSC3DMCPredictionMode normalPredMode ) { m_normalPredMode = normalPredMode ; } + void SetFloatAttributePredMode(unsigned long a, O3DGCSC3DMCPredictionMode p) + { + assert(a < O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES); + m_floatAttributePredMode[a] = p; + } + void SetIntAttributePredMode(unsigned long a, O3DGCSC3DMCPredictionMode p) + { + assert(a < O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES); + m_intAttributePredMode[a] = p; + } + private: + unsigned long m_numFloatAttributes; + unsigned long m_numIntAttributes; + unsigned long m_coordQuantBits; + unsigned long m_normalQuantBits; + unsigned long m_floatAttributeQuantBits[O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES]; + + O3DGCSC3DMCPredictionMode m_coordPredMode; + O3DGCSC3DMCPredictionMode m_normalPredMode; + O3DGCSC3DMCPredictionMode m_floatAttributePredMode[O3DGC_SC3DMC_MAX_NUM_FLOAT_ATTRIBUTES]; + O3DGCSC3DMCPredictionMode m_intAttributePredMode [O3DGC_SC3DMC_MAX_NUM_INT_ATTRIBUTES]; + O3DGCStreamType m_streamTypeMode; + O3DGCSC3DMCEncodingMode m_encodeMode; + }; +} +#endif // O3DGC_SC3DMC_ENCODE_PARAMS_H + diff --git a/contrib/Open3DGC/o3dgcSC3DMCEncoder.h b/contrib/Open3DGC/o3dgcSC3DMCEncoder.h new file mode 100644 index 000000000..9c4e95026 --- /dev/null +++ b/contrib/Open3DGC/o3dgcSC3DMCEncoder.h @@ -0,0 +1,116 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + + +#pragma once +#ifndef O3DGC_SC3DMC_ENCODER_H +#define O3DGC_SC3DMC_ENCODER_H + +#include "o3dgcCommon.h" +#include "o3dgcBinaryStream.h" +#include "o3dgcIndexedFaceSet.h" +#include "o3dgcSC3DMCEncodeParams.h" +#include "o3dgcTriangleListEncoder.h" + +namespace o3dgc +{ + //! + template + class SC3DMCEncoder + { + public: + //! Constructor. + SC3DMCEncoder(void) + { + m_posSize = 0; + m_quantFloatArray = 0; + m_quantFloatArraySize = 0; + m_sizeBufferAC = 0; + m_bufferAC = 0; + m_normals = 0; + m_normalsSize = 0; + m_streamType = O3DGC_STREAM_TYPE_UNKOWN; + }; + //! Destructor. + ~SC3DMCEncoder(void) + { + delete [] m_normals; + delete [] m_quantFloatArray; + delete [] m_bufferAC; + } + //! + O3DGCErrorCode Encode(const SC3DMCEncodeParams & params, + const IndexedFaceSet & ifs, + BinaryStream & bstream); + const SC3DMCStats & GetStats() const { return m_stats;} + + private: + O3DGCErrorCode EncodeHeader(const SC3DMCEncodeParams & params, + const IndexedFaceSet & ifs, + BinaryStream & bstream); + O3DGCErrorCode EncodePayload(const SC3DMCEncodeParams & params, + const IndexedFaceSet & ifs, + BinaryStream & bstream); + O3DGCErrorCode EncodeFloatArray(const Real * const floatArray, + unsigned long numfloatArray, + unsigned long dimfloatArray, + unsigned long stride, + const Real * const minfloatArray, + const Real * const maxfloatArray, + unsigned long nQBits, + const IndexedFaceSet & ifs, + O3DGCSC3DMCPredictionMode predMode, + BinaryStream & bstream); + O3DGCErrorCode QuantizeFloatArray(const Real * const floatArray, + unsigned long numFloatArray, + unsigned long dimFloatArray, + unsigned long stride, + const Real * const minfloatArray, + const Real * const maxfloatArray, + unsigned long nQBits); + O3DGCErrorCode EncodeIntArray(const long * const intArray, + unsigned long numIntArray, + unsigned long dimIntArray, + unsigned long stride, + const IndexedFaceSet & ifs, + O3DGCSC3DMCPredictionMode predMode, + BinaryStream & bstream); + O3DGCErrorCode ProcessNormals(const IndexedFaceSet & ifs); + TriangleListEncoder m_triangleListEncoder; + long * m_quantFloatArray; + unsigned long m_posSize; + unsigned long m_quantFloatArraySize; + unsigned char * m_bufferAC; + unsigned long m_sizeBufferAC; + SC3DMCPredictor m_neighbors [O3DGC_SC3DMC_MAX_PREDICTION_NEIGHBORS]; + unsigned long m_freqSymbols[O3DGC_SC3DMC_MAX_PREDICTION_SYMBOLS]; + unsigned long m_freqPreds [O3DGC_SC3DMC_MAX_PREDICTION_NEIGHBORS]; + Vector m_predictors; + Real * m_normals; + unsigned long m_normalsSize; + SC3DMCStats m_stats; + O3DGCStreamType m_streamType; + }; +} +#include "o3dgcSC3DMCEncoder.inl" // template implementation +#endif // O3DGC_SC3DMC_ENCODER_H + diff --git a/contrib/Open3DGC/o3dgcSC3DMCEncoder.inl b/contrib/Open3DGC/o3dgcSC3DMCEncoder.inl new file mode 100644 index 000000000..b2c438814 --- /dev/null +++ b/contrib/Open3DGC/o3dgcSC3DMCEncoder.inl @@ -0,0 +1,927 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + +#pragma once +#ifndef O3DGC_SC3DMC_ENCODER_INL +#define O3DGC_SC3DMC_ENCODER_INL + + +#include "o3dgcArithmeticCodec.h" +#include "o3dgcTimer.h" +#include "o3dgcVector.h" +#include "o3dgcBinaryStream.h" +#include "o3dgcCommon.h" + +//#define DEBUG_VERBOSE + +namespace o3dgc +{ +#ifdef DEBUG_VERBOSE + FILE * g_fileDebugSC3DMCEnc = NULL; +#endif //DEBUG_VERBOSE + + template + O3DGCErrorCode SC3DMCEncoder::Encode(const SC3DMCEncodeParams & params, + const IndexedFaceSet & ifs, + BinaryStream & bstream) + { + // Encode header + unsigned long start = bstream.GetSize(); + EncodeHeader(params, ifs, bstream); + // Encode payload + EncodePayload(params, ifs, bstream); + bstream.WriteUInt32(m_posSize, bstream.GetSize() - start, m_streamType); + return O3DGC_OK; + } + template + O3DGCErrorCode SC3DMCEncoder::EncodeHeader(const SC3DMCEncodeParams & params, + const IndexedFaceSet & ifs, + BinaryStream & bstream) + { + m_streamType = params.GetStreamType(); + bstream.WriteUInt32(O3DGC_SC3DMC_START_CODE, m_streamType); + m_posSize = bstream.GetSize(); + bstream.WriteUInt32(0, m_streamType); // to be filled later + + bstream.WriteUChar(O3DGC_SC3DMC_ENCODE_MODE_TFAN, m_streamType); + bstream.WriteFloat32((float)ifs.GetCreaseAngle(), m_streamType); + + unsigned char mask = 0; + bool markerBit0 = false; + bool markerBit1 = false; + bool markerBit2 = false; + bool markerBit3 = false; + + mask += (ifs.GetCCW() ); + mask += (ifs.GetSolid() << 1); + mask += (ifs.GetConvex() << 2); + mask += (ifs.GetIsTriangularMesh() << 3); + mask += (markerBit0 << 4); + mask += (markerBit1 << 5); + mask += (markerBit2 << 6); + mask += (markerBit3 << 7); + + bstream.WriteUChar(mask, m_streamType); + + bstream.WriteUInt32(ifs.GetNCoord(), m_streamType); + bstream.WriteUInt32(ifs.GetNNormal(), m_streamType); + bstream.WriteUInt32(ifs.GetNumFloatAttributes(), m_streamType); + bstream.WriteUInt32(ifs.GetNumIntAttributes(), m_streamType); + + if (ifs.GetNCoord() > 0) + { + bstream.WriteUInt32(ifs.GetNCoordIndex(), m_streamType); + for(int j=0 ; j<3 ; ++j) + { + bstream.WriteFloat32((float) ifs.GetCoordMin(j), m_streamType); + bstream.WriteFloat32((float) ifs.GetCoordMax(j), m_streamType); + } + bstream.WriteUChar((unsigned char) params.GetCoordQuantBits(), m_streamType); + } + if (ifs.GetNNormal() > 0) + { + bstream.WriteUInt32(0, m_streamType); + for(int j=0 ; j<3 ; ++j) + { + bstream.WriteFloat32((float) ifs.GetNormalMin(j), m_streamType); + bstream.WriteFloat32((float) ifs.GetNormalMax(j), m_streamType); + } + bstream.WriteUChar(true, m_streamType); //(unsigned char) ifs.GetNormalPerVertex() + bstream.WriteUChar((unsigned char) params.GetNormalQuantBits(), m_streamType); + } + for(unsigned long a = 0; a < ifs.GetNumFloatAttributes(); ++a) + { + bstream.WriteUInt32(ifs.GetNFloatAttribute(a), m_streamType); + if (ifs.GetNFloatAttribute(a) > 0) + { + assert(ifs.GetFloatAttributeDim(a) < (unsigned long) O3DGC_MAX_UCHAR8); + bstream.WriteUInt32(0, m_streamType); + unsigned char d = (unsigned char) ifs.GetFloatAttributeDim(a); + bstream.WriteUChar(d, m_streamType); + for(unsigned char j = 0 ; j < d ; ++j) + { + bstream.WriteFloat32((float) ifs.GetFloatAttributeMin(a, j), m_streamType); + bstream.WriteFloat32((float) ifs.GetFloatAttributeMax(a, j), m_streamType); + } + bstream.WriteUChar(true, m_streamType); //(unsigned char) ifs.GetFloatAttributePerVertex(a) + bstream.WriteUChar((unsigned char) ifs.GetFloatAttributeType(a), m_streamType); + bstream.WriteUChar((unsigned char) params.GetFloatAttributeQuantBits(a), m_streamType); + } + } + for(unsigned long a = 0; a < ifs.GetNumIntAttributes(); ++a) + { + bstream.WriteUInt32(ifs.GetNIntAttribute(a), m_streamType); + if (ifs.GetNIntAttribute(a) > 0) + { + assert(ifs.GetFloatAttributeDim(a) < (unsigned long) O3DGC_MAX_UCHAR8); + bstream.WriteUInt32(0, m_streamType); + bstream.WriteUChar((unsigned char) ifs.GetIntAttributeDim(a), m_streamType); + bstream.WriteUChar(true, m_streamType); // (unsigned char) ifs.GetIntAttributePerVertex(a) + bstream.WriteUChar((unsigned char) ifs.GetIntAttributeType(a), m_streamType); + } + } + return O3DGC_OK; + } + template + O3DGCErrorCode SC3DMCEncoder::QuantizeFloatArray(const Real * const floatArray, + unsigned long numFloatArray, + unsigned long dimFloatArray, + unsigned long stride, + const Real * const minFloatArray, + const Real * const maxFloatArray, + unsigned long nQBits) + { + const unsigned long size = numFloatArray * dimFloatArray; + Real delta[O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES]; + Real r; + for(unsigned long d = 0; d < dimFloatArray; d++) + { + r = maxFloatArray[d] - minFloatArray[d]; + if (r > 0.0f) + { + delta[d] = (float)((1 << nQBits) - 1) / r; + } + else + { + delta[d] = 1.0f; + } + } + if (m_quantFloatArraySize < size) + { + delete [] m_quantFloatArray; + m_quantFloatArraySize = size; + m_quantFloatArray = new long [size]; + } + for(unsigned long v = 0; v < numFloatArray; ++v) + { + for(unsigned long d = 0; d < dimFloatArray; ++d) + { + m_quantFloatArray[v * stride + d] = (long)((floatArray[v * stride + d]-minFloatArray[d]) * delta[d] + 0.5f); + } + } + return O3DGC_OK; + } + template + O3DGCErrorCode SC3DMCEncoder::EncodeFloatArray(const Real * const floatArray, + unsigned long numFloatArray, + unsigned long dimFloatArray, + unsigned long stride, + const Real * const minFloatArray, + const Real * const maxFloatArray, + unsigned long nQBits, + const IndexedFaceSet & ifs, + O3DGCSC3DMCPredictionMode predMode, + BinaryStream & bstream) + { + assert(dimFloatArray < O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES); + long predResidual, v, uPredResidual; + unsigned long nPred; + Arithmetic_Codec ace; + Static_Bit_Model bModel0; + Adaptive_Bit_Model bModel1; + + const AdjacencyInfo & v2T = m_triangleListEncoder.GetVertexToTriangle(); + const long * const vmap = m_triangleListEncoder.GetVMap(); + const long * const invVMap = m_triangleListEncoder.GetInvVMap(); + const T * const triangles = ifs.GetCoordIndex(); + const long nvert = (long) numFloatArray; + unsigned long start = bstream.GetSize(); + unsigned char mask = predMode & 7; + const unsigned long M = O3DGC_SC3DMC_MAX_PREDICTION_SYMBOLS - 1; + unsigned long nSymbols = O3DGC_SC3DMC_MAX_PREDICTION_SYMBOLS; + unsigned long nPredictors = O3DGC_SC3DMC_MAX_PREDICTION_NEIGHBORS; + + + Adaptive_Data_Model mModelValues(M+2); + Adaptive_Data_Model mModelPreds(O3DGC_SC3DMC_MAX_PREDICTION_NEIGHBORS+1); + + memset(m_freqSymbols, 0, sizeof(unsigned long) * O3DGC_SC3DMC_MAX_PREDICTION_SYMBOLS); + memset(m_freqPreds , 0, sizeof(unsigned long) * O3DGC_SC3DMC_MAX_PREDICTION_NEIGHBORS); + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + mask += (O3DGC_SC3DMC_BINARIZATION_ASCII & 7)<<4; + m_predictors.Allocate(nvert); + m_predictors.Clear(); + } + else + { + mask += (O3DGC_SC3DMC_BINARIZATION_AC_EGC & 7)<<4; + const unsigned int NMAX = numFloatArray * dimFloatArray * 8 + 100; + if ( m_sizeBufferAC < NMAX ) + { + delete [] m_bufferAC; + m_sizeBufferAC = NMAX; + m_bufferAC = new unsigned char [m_sizeBufferAC]; + } + ace.set_buffer(NMAX, m_bufferAC); + ace.start_encoder(); + ace.ExpGolombEncode(0, 0, bModel0, bModel1); + ace.ExpGolombEncode(M, 0, bModel0, bModel1); + } + bstream.WriteUInt32(0, m_streamType); + bstream.WriteUChar(mask, m_streamType); + +#ifdef DEBUG_VERBOSE + printf("FloatArray (%i, %i)\n", numFloatArray, dimFloatArray); + fprintf(g_fileDebugSC3DMCEnc, "FloatArray (%i, %i)\n", numFloatArray, dimFloatArray); +#endif //DEBUG_VERBOSE + + if (predMode == O3DGC_SC3DMC_SURF_NORMALS_PREDICTION) + { + const Real minFloatArray[2] = {(Real)(-2.0),(Real)(-2.0)}; + const Real maxFloatArray[2] = {(Real)(2.0),(Real)(2.0)}; + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + for(unsigned long i = 0; i < numFloatArray; ++i) + { + bstream.WriteIntASCII(m_predictors[i]); + } + } + else + { + Adaptive_Data_Model dModel(12); + for(unsigned long i = 0; i < numFloatArray; ++i) + { + ace.encode(IntToUInt(m_predictors[i]), dModel); + } + } + QuantizeFloatArray(floatArray, numFloatArray, dimFloatArray, stride, minFloatArray, maxFloatArray, nQBits+1); + } + else + { + QuantizeFloatArray(floatArray, numFloatArray, dimFloatArray, stride, minFloatArray, maxFloatArray, nQBits); + } + + for (long vm=0; vm < nvert; ++vm) + { + nPred = 0; + v = invVMap[vm]; + assert( v >= 0 && v < nvert); + if ( v2T.GetNumNeighbors(v) > 0 && + predMode != O3DGC_SC3DMC_NO_PREDICTION) + { + int u0 = v2T.Begin(v); + int u1 = v2T.End(v); + for (long u = u0; u < u1; u++) + { + long ta = v2T.GetNeighbor(u); + if ( predMode == O3DGC_SC3DMC_PARALLELOGRAM_PREDICTION ) + { + long a,b; + if ((long) triangles[ta*3] == v) + { + a = triangles[ta*3 + 1]; + b = triangles[ta*3 + 2]; + } + else if ((long) triangles[ta*3 + 1] == v) + { + a = triangles[ta*3 + 0]; + b = triangles[ta*3 + 2]; + } + else + { + a = triangles[ta*3 + 0]; + b = triangles[ta*3 + 1]; + } + if ( vmap[a] < vm && vmap[b] < vm) + { + int u0 = v2T.Begin(a); + int u1 = v2T.End(a); + for (long u = u0; u < u1; u++) + { + long tb = v2T.GetNeighbor(u); + long c = -1; + bool foundB = false; + for(long k = 0; k < 3; ++k) + { + long x = triangles[tb*3 + k]; + if (x == b) + { + foundB = true; + } + if (vmap[x] < vm && x != a && x != b) + { + c = x; + } + } + if (c != -1 && foundB) + { + SC3DMCTriplet id = {min(vmap[a], vmap[b]), max(vmap[a], vmap[b]), -vmap[c]-1}; + unsigned long p = Insert(id, nPred, m_neighbors); + if (p != 0xFFFFFFFF) + { + for (unsigned long i = 0; i < dimFloatArray; i++) + { + m_neighbors[p].m_pred[i] = m_quantFloatArray[a*stride+i] + + m_quantFloatArray[b*stride+i] - + m_quantFloatArray[c*stride+i]; + } + } + } + } + } + } + if ( predMode == O3DGC_SC3DMC_SURF_NORMALS_PREDICTION || + predMode == O3DGC_SC3DMC_PARALLELOGRAM_PREDICTION || + predMode == O3DGC_SC3DMC_DIFFERENTIAL_PREDICTION ) + { + for(long k = 0; k < 3; ++k) + { + long w = triangles[ta*3 + k]; + if ( vmap[w] < vm ) + { + SC3DMCTriplet id = {-1, -1, vmap[w]}; + unsigned long p = Insert(id, nPred, m_neighbors); + if (p != 0xFFFFFFFF) + { + for (unsigned long i = 0; i < dimFloatArray; i++) + { + m_neighbors[p].m_pred[i] = m_quantFloatArray[w*stride+i]; + } + } + } + } + } + } + } + if (nPred > 1) + { + // find best predictor + unsigned long bestPred = 0xFFFFFFFF; + double bestCost = O3DGC_MAX_DOUBLE; + double cost; +#ifdef DEBUG_VERBOSE1 + printf("\t\t vm %i\n", vm); + fprintf(g_fileDebugSC3DMCEnc, "\t\t vm %i\n", vm); +#endif //DEBUG_VERBOSE + + for (unsigned long p = 0; p < nPred; ++p) + { +#ifdef DEBUG_VERBOSE1 + printf("\t\t pred a = %i b = %i c = %i \n", m_neighbors[p].m_id.m_a, m_neighbors[p].m_id.m_b, m_neighbors[p].m_id.m_c); + fprintf(g_fileDebugSC3DMCEnc, "\t\t pred a = %i b = %i c = %i \n", m_neighbors[p].m_id.m_a, m_neighbors[p].m_id.m_b, m_neighbors[p].m_id.m_c); +#endif //DEBUG_VERBOSE + cost = -log2((m_freqPreds[p]+1.0) / nPredictors ); + for (unsigned long i = 0; i < dimFloatArray; ++i) + { +#ifdef DEBUG_VERBOSE1 + printf("\t\t\t %i\n", m_neighbors[p].m_pred[i]); + fprintf(g_fileDebugSC3DMCEnc, "\t\t\t %i\n", m_neighbors[p].m_pred[i]); +#endif //DEBUG_VERBOSE + + predResidual = (long) IntToUInt(m_quantFloatArray[v*stride+i] - m_neighbors[p].m_pred[i]); + if (predResidual < (long) M) + { + cost += -log2((m_freqSymbols[predResidual]+1.0) / nSymbols ); + } + else + { + cost += -log2((m_freqSymbols[M] + 1.0) / nSymbols ) + log2((double) (predResidual-M)); + } + } + if (cost < bestCost) + { + bestCost = cost; + bestPred = p; + } + } + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + m_predictors.PushBack((unsigned char) bestPred); + } + else + { + ace.encode(bestPred, mModelPreds); + } +#ifdef DEBUG_VERBOSE1 + printf("best (%i, %i, %i) \t pos %i\n", m_neighbors[bestPred].m_id.m_a, m_neighbors[bestPred].m_id.m_b, m_neighbors[bestPred].m_id.m_c, bestPred); + fprintf(g_fileDebugSC3DMCEnc, "best (%i, %i, %i) \t pos %i\n", m_neighbors[bestPred].m_id.m_a, m_neighbors[bestPred].m_id.m_b, m_neighbors[bestPred].m_id.m_c, bestPred); +#endif //DEBUG_VERBOSE + // use best predictor + for (unsigned long i = 0; i < dimFloatArray; ++i) + { + predResidual = m_quantFloatArray[v*stride+i] - m_neighbors[bestPred].m_pred[i]; + uPredResidual = IntToUInt(predResidual); + ++m_freqSymbols[(uPredResidual < (long) M)? uPredResidual : M]; + +#ifdef DEBUG_VERBOSE + printf("%i \t %i \t [%i]\n", vm*dimFloatArray+i, predResidual, m_neighbors[bestPred].m_pred[i]); + fprintf(g_fileDebugSC3DMCEnc, "%i \t %i \t [%i]\n", vm*dimFloatArray+i, predResidual, m_neighbors[bestPred].m_pred[i]); +#endif //DEBUG_VERBOSE + + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + bstream.WriteIntASCII(predResidual); + } + else + { + EncodeIntACEGC(predResidual, ace, mModelValues, bModel0, bModel1, M); + } + } + ++m_freqPreds[bestPred]; + nSymbols += dimFloatArray; + ++nPredictors; + } + else if ( vm > 0 && predMode != O3DGC_SC3DMC_NO_PREDICTION) + { + long prev = invVMap[vm-1]; + for (unsigned long i = 0; i < dimFloatArray; i++) + { + predResidual = m_quantFloatArray[v*stride+i] - m_quantFloatArray[prev*stride+i]; + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + bstream.WriteIntASCII(predResidual); + } + else + { + EncodeIntACEGC(predResidual, ace, mModelValues, bModel0, bModel1, M); + } +#ifdef DEBUG_VERBOSE + printf("%i \t %i\n", vm*dimFloatArray+i, predResidual); + fprintf(g_fileDebugSC3DMCEnc, "%i \t %i\n", vm*dimFloatArray+i, predResidual); +#endif //DEBUG_VERBOSE + } + } + else + { + for (unsigned long i = 0; i < dimFloatArray; i++) + { + predResidual = m_quantFloatArray[v*stride+i]; + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + bstream.WriteUIntASCII(predResidual); + } + else + { + EncodeUIntACEGC(predResidual, ace, mModelValues, bModel0, bModel1, M); + } +#ifdef DEBUG_VERBOSE + printf("%i \t %i\n", vm*dimFloatArray+i, predResidual); + fprintf(g_fileDebugSC3DMCEnc, "%i \t %i\n", vm*dimFloatArray+i, predResidual); +#endif //DEBUG_VERBOSE + } + } + } + if (m_streamType != O3DGC_STREAM_TYPE_ASCII) + { + unsigned long encodedBytes = ace.stop_encoder(); + for(unsigned long i = 0; i < encodedBytes; ++i) + { + bstream.WriteUChar8Bin(m_bufferAC[i]); + } + } + bstream.WriteUInt32(start, bstream.GetSize() - start, m_streamType); + + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + unsigned long start = bstream.GetSize(); + bstream.WriteUInt32ASCII(0); + const unsigned long size = m_predictors.GetSize(); + for(unsigned long i = 0; i < size; ++i) + { + bstream.WriteUCharASCII((unsigned char) m_predictors[i]); + } + bstream.WriteUInt32ASCII(start, bstream.GetSize() - start); + } +#ifdef DEBUG_VERBOSE + fflush(g_fileDebugSC3DMCEnc); +#endif //DEBUG_VERBOSE + return O3DGC_OK; + } + + template + O3DGCErrorCode SC3DMCEncoder::EncodeIntArray(const long * const intArray, + unsigned long numIntArray, + unsigned long dimIntArray, + unsigned long stride, + const IndexedFaceSet & ifs, + O3DGCSC3DMCPredictionMode predMode, + BinaryStream & bstream) + { + assert(dimIntArray < O3DGC_SC3DMC_MAX_DIM_ATTRIBUTES); + long predResidual, v, uPredResidual; + unsigned long nPred; + Arithmetic_Codec ace; + Static_Bit_Model bModel0; + Adaptive_Bit_Model bModel1; + + const AdjacencyInfo & v2T = m_triangleListEncoder.GetVertexToTriangle(); + const long * const vmap = m_triangleListEncoder.GetVMap(); + const long * const invVMap = m_triangleListEncoder.GetInvVMap(); + const T * const triangles = ifs.GetCoordIndex(); + const long nvert = (long) numIntArray; + unsigned long start = bstream.GetSize(); + unsigned char mask = predMode & 7; + const unsigned long M = O3DGC_SC3DMC_MAX_PREDICTION_SYMBOLS - 1; + unsigned long nSymbols = O3DGC_SC3DMC_MAX_PREDICTION_SYMBOLS; + unsigned long nPredictors = O3DGC_SC3DMC_MAX_PREDICTION_NEIGHBORS; + + + Adaptive_Data_Model mModelValues(M+2); + Adaptive_Data_Model mModelPreds(O3DGC_SC3DMC_MAX_PREDICTION_NEIGHBORS+1); + + memset(m_freqSymbols, 0, sizeof(unsigned long) * O3DGC_SC3DMC_MAX_PREDICTION_SYMBOLS); + memset(m_freqPreds , 0, sizeof(unsigned long) * O3DGC_SC3DMC_MAX_PREDICTION_NEIGHBORS); + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + mask += (O3DGC_SC3DMC_BINARIZATION_ASCII & 7)<<4; + m_predictors.Allocate(nvert); + m_predictors.Clear(); + } + else + { + mask += (O3DGC_SC3DMC_BINARIZATION_AC_EGC & 7)<<4; + const unsigned int NMAX = numIntArray * dimIntArray * 8 + 100; + if ( m_sizeBufferAC < NMAX ) + { + delete [] m_bufferAC; + m_sizeBufferAC = NMAX; + m_bufferAC = new unsigned char [m_sizeBufferAC]; + } + ace.set_buffer(NMAX, m_bufferAC); + ace.start_encoder(); + ace.ExpGolombEncode(0, 0, bModel0, bModel1); + ace.ExpGolombEncode(M, 0, bModel0, bModel1); + } + bstream.WriteUInt32(0, m_streamType); + bstream.WriteUChar(mask, m_streamType); + +#ifdef DEBUG_VERBOSE + printf("IntArray (%i, %i)\n", numIntArray, dimIntArray); + fprintf(g_fileDebugSC3DMCEnc, "IntArray (%i, %i)\n", numIntArray, dimIntArray); +#endif //DEBUG_VERBOSE + + for (long vm=0; vm < nvert; ++vm) + { + nPred = 0; + v = invVMap[vm]; + assert( v >= 0 && v < nvert); + if ( v2T.GetNumNeighbors(v) > 0 && + predMode != O3DGC_SC3DMC_NO_PREDICTION) + { + int u0 = v2T.Begin(v); + int u1 = v2T.End(v); + for (long u = u0; u < u1; u++) + { + long ta = v2T.GetNeighbor(u); + for(long k = 0; k < 3; ++k) + { + long w = triangles[ta*3 + k]; + if ( vmap[w] < vm ) + { + SC3DMCTriplet id = {-1, -1, vmap[w]}; + unsigned long p = Insert(id, nPred, m_neighbors); + if (p != 0xFFFFFFFF) + { + for (unsigned long i = 0; i < dimIntArray; i++) + { + m_neighbors[p].m_pred[i] = intArray[w*stride+i]; + } + } + } + } + } + } + if (nPred > 1) + { + // find best predictor + unsigned long bestPred = 0xFFFFFFFF; + double bestCost = O3DGC_MAX_DOUBLE; + double cost; +#ifdef DEBUG_VERBOSE1 + printf("\t\t vm %i\n", vm); + fprintf(g_fileDebugSC3DMCEnc, "\t\t vm %i\n", vm); +#endif //DEBUG_VERBOSE + + for (unsigned long p = 0; p < nPred; ++p) + { +#ifdef DEBUG_VERBOSE1 + printf("\t\t pred a = %i b = %i c = %i \n", m_neighbors[p].m_id.m_a, m_neighbors[p].m_id.m_b, m_neighbors[p].m_id.m_c); + fprintf(g_fileDebugSC3DMCEnc, "\t\t pred a = %i b = %i c = %i \n", m_neighbors[p].m_id.m_a, m_neighbors[p].m_id.m_b, m_neighbors[p].m_id.m_c); +#endif //DEBUG_VERBOSE + cost = -log2((m_freqPreds[p]+1.0) / nPredictors ); + for (unsigned long i = 0; i < dimIntArray; ++i) + { +#ifdef DEBUG_VERBOSE1 + printf("\t\t\t %i\n", m_neighbors[p].m_pred[i]); + fprintf(g_fileDebugSC3DMCEnc, "\t\t\t %i\n", m_neighbors[p].m_pred[i]); +#endif //DEBUG_VERBOSE + + predResidual = (long) IntToUInt(intArray[v*stride+i] - m_neighbors[p].m_pred[i]); + if (predResidual < (long) M) + { + cost += -log2((m_freqSymbols[predResidual]+1.0) / nSymbols ); + } + else + { + cost += -log2((m_freqSymbols[M] + 1.0) / nSymbols ) + log2((double) (predResidual-M)); + } + } + if (cost < bestCost) + { + bestCost = cost; + bestPred = p; + } + } + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + m_predictors.PushBack((unsigned char) bestPred); + } + else + { + ace.encode(bestPred, mModelPreds); + } +#ifdef DEBUG_VERBOSE1 + printf("best (%i, %i, %i) \t pos %i\n", m_neighbors[bestPred].m_id.m_a, m_neighbors[bestPred].m_id.m_b, m_neighbors[bestPred].m_id.m_c, bestPred); + fprintf(g_fileDebugSC3DMCEnc, "best (%i, %i, %i) \t pos %i\n", m_neighbors[bestPred].m_id.m_a, m_neighbors[bestPred].m_id.m_b, m_neighbors[bestPred].m_id.m_c, bestPred); +#endif //DEBUG_VERBOSE + // use best predictor + for (unsigned long i = 0; i < dimIntArray; ++i) + { + predResidual = intArray[v*stride+i] - m_neighbors[bestPred].m_pred[i]; + uPredResidual = IntToUInt(predResidual); + ++m_freqSymbols[(uPredResidual < (long) M)? uPredResidual : M]; + +#ifdef DEBUG_VERBOSE + printf("%i \t %i \t [%i]\n", vm*dimIntArray+i, predResidual, m_neighbors[bestPred].m_pred[i]); + fprintf(g_fileDebugSC3DMCEnc, "%i \t %i \t [%i]\n", vm*dimIntArray+i, predResidual, m_neighbors[bestPred].m_pred[i]); +#endif //DEBUG_VERBOSE + + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + bstream.WriteIntASCII(predResidual); + } + else + { + EncodeIntACEGC(predResidual, ace, mModelValues, bModel0, bModel1, M); + } + } + ++m_freqPreds[bestPred]; + nSymbols += dimIntArray; + ++nPredictors; + } + else if ( vm > 0 && predMode != O3DGC_SC3DMC_NO_PREDICTION) + { + long prev = invVMap[vm-1]; + for (unsigned long i = 0; i < dimIntArray; i++) + { + predResidual = intArray[v*stride+i] - intArray[prev*stride+i]; + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + bstream.WriteIntASCII(predResidual); + } + else + { + EncodeIntACEGC(predResidual, ace, mModelValues, bModel0, bModel1, M); + } +#ifdef DEBUG_VERBOSE + printf("%i \t %i\n", vm*dimIntArray+i, predResidual); + fprintf(g_fileDebugSC3DMCEnc, "%i \t %i\n", vm*dimIntArray+i, predResidual); +#endif //DEBUG_VERBOSE + } + } + else + { + for (unsigned long i = 0; i < dimIntArray; i++) + { + predResidual = intArray[v*stride+i]; + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + bstream.WriteUIntASCII(predResidual); + } + else + { + EncodeUIntACEGC(predResidual, ace, mModelValues, bModel0, bModel1, M); + } +#ifdef DEBUG_VERBOSE + printf("%i \t %i\n", vm*dimIntArray+i, predResidual); + fprintf(g_fileDebugSC3DMCEnc, "%i \t %i\n", vm*dimIntArray+i, predResidual); +#endif //DEBUG_VERBOSE + } + } + } + if (m_streamType != O3DGC_STREAM_TYPE_ASCII) + { + unsigned long encodedBytes = ace.stop_encoder(); + for(unsigned long i = 0; i < encodedBytes; ++i) + { + bstream.WriteUChar8Bin(m_bufferAC[i]); + } + } + bstream.WriteUInt32(start, bstream.GetSize() - start, m_streamType); + + if (m_streamType == O3DGC_STREAM_TYPE_ASCII) + { + unsigned long start = bstream.GetSize(); + bstream.WriteUInt32ASCII(0); + const unsigned long size = m_predictors.GetSize(); + for(unsigned long i = 0; i < size; ++i) + { + bstream.WriteUCharASCII((unsigned char) m_predictors[i]); + } + bstream.WriteUInt32ASCII(start, bstream.GetSize() - start); + } +#ifdef DEBUG_VERBOSE + fflush(g_fileDebugSC3DMCEnc); +#endif //DEBUG_VERBOSE + return O3DGC_OK; + } + template + O3DGCErrorCode SC3DMCEncoder::ProcessNormals(const IndexedFaceSet & ifs) + { + const long nvert = (long) ifs.GetNNormal(); + const unsigned long normalSize = ifs.GetNNormal() * 2; + if (m_normalsSize < normalSize) + { + delete [] m_normals; + m_normalsSize = normalSize; + m_normals = new Real [normalSize]; + } + const AdjacencyInfo & v2T = m_triangleListEncoder.GetVertexToTriangle(); + const long * const invVMap = m_triangleListEncoder.GetInvVMap(); + const T * const triangles = ifs.GetCoordIndex(); + const Real * const originalNormals = ifs.GetNormal(); + Vec3 p1, p2, p3, n0, nt; + Vec3 n1; + long na0, nb0; + Real rna0, rnb0, na1, nb1, norm0, norm1; + char ni0 = 0, ni1 = 0; + long a, b, c, v; + m_predictors.Clear(); + for (long i=0; i < nvert; ++i) + { + v = invVMap[i]; + n0.X() = 0; + n0.Y() = 0; + n0.Z() = 0; + int u0 = v2T.Begin(v); + int u1 = v2T.End(v); + for (long u = u0; u < u1; u++) + { + long ta = v2T.GetNeighbor(u); + a = triangles[ta*3 + 0]; + b = triangles[ta*3 + 1]; + c = triangles[ta*3 + 2]; + p1.X() = m_quantFloatArray[3*a]; + p1.Y() = m_quantFloatArray[3*a+1]; + p1.Z() = m_quantFloatArray[3*a+2]; + p2.X() = m_quantFloatArray[3*b]; + p2.Y() = m_quantFloatArray[3*b+1]; + p2.Z() = m_quantFloatArray[3*b+2]; + p3.X() = m_quantFloatArray[3*c]; + p3.Y() = m_quantFloatArray[3*c+1]; + p3.Z() = m_quantFloatArray[3*c+2]; + nt = (p2-p1)^(p3-p1); + n0 += nt; + } + norm0 = (Real) n0.GetNorm(); + if (norm0 == 0.0) + { + norm0 = 1.0; + } + SphereToCube(n0.X(), n0.Y(), n0.Z(), na0, nb0, ni0); + rna0 = na0 / norm0; + rnb0 = nb0 / norm0; + + n1.X() = originalNormals[3*v]; + n1.Y() = originalNormals[3*v+1]; + n1.Z() = originalNormals[3*v+2]; + norm1 = (Real) n1.GetNorm(); + if (norm1 != 0.0) + { + n1.X() /= norm1; + n1.Y() /= norm1; + n1.Z() /= norm1; + } + SphereToCube(n1.X(), n1.Y(), n1.Z(), na1, nb1, ni1); + m_predictors.PushBack(ni1 - ni0); + if ( (ni1 >> 1) != (ni0 >> 1) ) + { + rna0 = (Real)0.0; + rnb0 = (Real)0.0; + } + m_normals[2*v] = na1 - rna0; + m_normals[2*v+1] = nb1 - rnb0; + +#ifdef DEBUG_VERBOSE1 + printf("n0 \t %i \t %i \t %i \t %i (%f, %f)\n", i, n0.X(), n0.Y(), n0.Z(), rna0, rnb0); + fprintf(g_fileDebugSC3DMCEnc,"n0 \t %i \t %i \t %i \t %i (%f, %f)\n", i, n0.X(), n0.Y(), n0.Z(), rna0, rnb0); +#endif //DEBUG_VERBOSE + +#ifdef DEBUG_VERBOSE1 + printf("normal \t %i \t %f \t %f \t %f \t (%i, %f, %f) \t (%f, %f)\n", i, n1.X(), n1.Y(), n1.Z(), ni1, na1, nb1, rna0, rnb0); + fprintf(g_fileDebugSC3DMCEnc, "normal \t %i \t %f \t %f \t %f \t (%i, %f, %f) \t (%f, %f)\n", i, n1.X(), n1.Y(), n1.Z(), ni1, na1, nb1, rna0, rnb0); +#endif //DEBUG_VERBOSE + + } + return O3DGC_OK; + } + + template + O3DGCErrorCode SC3DMCEncoder::EncodePayload(const SC3DMCEncodeParams & params, + const IndexedFaceSet & ifs, + BinaryStream & bstream) + { +#ifdef DEBUG_VERBOSE + g_fileDebugSC3DMCEnc = fopen("tfans_enc_main.txt", "w"); +#endif //DEBUG_VERBOSE + + // encode triangle list + m_triangleListEncoder.SetStreamType(params.GetStreamType()); + m_stats.m_streamSizeCoordIndex = bstream.GetSize(); + Timer timer; + timer.Tic(); + m_triangleListEncoder.Encode(ifs.GetCoordIndex(), ifs.GetIndexBufferID(), ifs.GetNCoordIndex(), ifs.GetNCoord(), bstream); + timer.Toc(); + m_stats.m_timeCoordIndex = timer.GetElapsedTime(); + m_stats.m_streamSizeCoordIndex = bstream.GetSize() - m_stats.m_streamSizeCoordIndex; + + // encode coord + m_stats.m_streamSizeCoord = bstream.GetSize(); + timer.Tic(); + if (ifs.GetNCoord() > 0) + { + EncodeFloatArray(ifs.GetCoord(), ifs.GetNCoord(), 3, 3, ifs.GetCoordMin(), ifs.GetCoordMax(), + params.GetCoordQuantBits(), ifs, params.GetCoordPredMode(), bstream); + } + timer.Toc(); + m_stats.m_timeCoord = timer.GetElapsedTime(); + m_stats.m_streamSizeCoord = bstream.GetSize() - m_stats.m_streamSizeCoord; + + + // encode Normal + m_stats.m_streamSizeNormal = bstream.GetSize(); + timer.Tic(); + if (ifs.GetNNormal() > 0) + { + if (params.GetNormalPredMode() == O3DGC_SC3DMC_SURF_NORMALS_PREDICTION) + { + ProcessNormals(ifs); + EncodeFloatArray(m_normals, ifs.GetNNormal(), 2, 2, ifs.GetNormalMin(), ifs.GetNormalMax(), + params.GetNormalQuantBits(), ifs, params.GetNormalPredMode(), bstream); + } + else + { + EncodeFloatArray(ifs.GetNormal(), ifs.GetNNormal(), 3, 3, ifs.GetNormalMin(), ifs.GetNormalMax(), + params.GetNormalQuantBits(), ifs, params.GetNormalPredMode(), bstream); + } + } + timer.Toc(); + m_stats.m_timeNormal = timer.GetElapsedTime(); + m_stats.m_streamSizeNormal = bstream.GetSize() - m_stats.m_streamSizeNormal; + + + // encode FloatAttribute + for(unsigned long a = 0; a < ifs.GetNumFloatAttributes(); ++a) + { + m_stats.m_streamSizeFloatAttribute[a] = bstream.GetSize(); + timer.Tic(); + EncodeFloatArray(ifs.GetFloatAttribute(a), ifs.GetNFloatAttribute(a), + ifs.GetFloatAttributeDim(a), ifs.GetFloatAttributeDim(a), + ifs.GetFloatAttributeMin(a), ifs.GetFloatAttributeMax(a), + params.GetFloatAttributeQuantBits(a), ifs, + params.GetFloatAttributePredMode(a), bstream); + timer.Toc(); + m_stats.m_timeFloatAttribute[a] = timer.GetElapsedTime(); + m_stats.m_streamSizeFloatAttribute[a] = bstream.GetSize() - m_stats.m_streamSizeFloatAttribute[a]; + } + + // encode IntAttribute + for(unsigned long a = 0; a < ifs.GetNumIntAttributes(); ++a) + { + m_stats.m_streamSizeIntAttribute[a] = bstream.GetSize(); + timer.Tic(); + EncodeIntArray(ifs.GetIntAttribute(a), ifs.GetNIntAttribute(a), ifs.GetIntAttributeDim(a), + ifs.GetIntAttributeDim(a), ifs, params.GetIntAttributePredMode(a), bstream); + timer.Toc(); + m_stats.m_timeIntAttribute[a] = timer.GetElapsedTime(); + m_stats.m_streamSizeIntAttribute[a] = bstream.GetSize() - m_stats.m_streamSizeIntAttribute[a]; + } +#ifdef DEBUG_VERBOSE + fclose(g_fileDebugSC3DMCEnc); +#endif //DEBUG_VERBOSE + return O3DGC_OK; + } +} +#endif // O3DGC_SC3DMC_ENCODER_INL + + diff --git a/contrib/Open3DGC/o3dgcTimer.h b/contrib/Open3DGC/o3dgcTimer.h new file mode 100644 index 000000000..00fe5b653 --- /dev/null +++ b/contrib/Open3DGC/o3dgcTimer.h @@ -0,0 +1,134 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + +#pragma once +#ifndef O3DGC_TIMER_H +#define O3DGC_TIMER_H + +#include "o3dgcCommon.h" + +#ifdef _WIN32 +/* Thank you, Microsoft, for file WinDef.h with min/max redefinition. */ +#define NOMINMAX +#include +#elif __MACH__ +#include +#include +#else +#include +#include +#endif + + + +namespace o3dgc +{ +#ifdef _WIN32 + class Timer + { + public: + Timer(void) + { + m_start.QuadPart = 0; + m_stop.QuadPart = 0; + QueryPerformanceFrequency( &m_freq ) ; + }; + ~Timer(void){}; + void Tic() + { + QueryPerformanceCounter(&m_start) ; + } + void Toc() + { + QueryPerformanceCounter(&m_stop); + } + double GetElapsedTime() // in ms + { + LARGE_INTEGER delta; + delta.QuadPart = m_stop.QuadPart - m_start.QuadPart; + return (1000.0 * delta.QuadPart) / (double)m_freq.QuadPart; + } + private: + LARGE_INTEGER m_start; + LARGE_INTEGER m_stop; + LARGE_INTEGER m_freq; + + }; +#elif __MACH__ + class Timer + { + public: + Timer(void) + { + memset(this, 0, sizeof(Timer)); + host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, & m_cclock); + }; + ~Timer(void) + { + mach_port_deallocate(mach_task_self(), m_cclock); + }; + void Tic() + { + clock_get_time( m_cclock, &m_start); + } + void Toc() + { + clock_get_time( m_cclock, &m_stop); + } + double GetElapsedTime() // in ms + { + return 1000.0 * (m_stop.tv_sec - m_start.tv_sec + (1.0E-9) * (m_stop.tv_nsec - m_start.tv_nsec)); + } + private: + clock_serv_t m_cclock; + mach_timespec_t m_start; + mach_timespec_t m_stop; + }; +#else + class Timer + { + public: + Timer(void) + { + memset(this, 0, sizeof(Timer)); + }; + ~Timer(void){}; + void Tic() + { + clock_gettime(CLOCK_REALTIME, &m_start); + } + void Toc() + { + clock_gettime(CLOCK_REALTIME, &m_stop); + } + double GetElapsedTime() // in ms + { + return 1000.0 * (m_stop.tv_sec - m_start.tv_sec + (1.0E-9) * (m_stop.tv_nsec - m_start.tv_nsec)); + } + private: + struct timespec m_start; + struct timespec m_stop; + }; +#endif + +} +#endif // O3DGC_TIMER_H diff --git a/contrib/Open3DGC/o3dgcTools.cpp b/contrib/Open3DGC/o3dgcTools.cpp new file mode 100644 index 000000000..52b552304 --- /dev/null +++ b/contrib/Open3DGC/o3dgcTools.cpp @@ -0,0 +1,22 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + diff --git a/contrib/Open3DGC/o3dgcTriangleFans.cpp b/contrib/Open3DGC/o3dgcTriangleFans.cpp new file mode 100644 index 000000000..078ed16e6 --- /dev/null +++ b/contrib/Open3DGC/o3dgcTriangleFans.cpp @@ -0,0 +1,475 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + +#include "o3dgcTriangleFans.h" +#include "o3dgcArithmeticCodec.h" + +//#define DEBUG_VERBOSE + +namespace o3dgc +{ +#ifdef DEBUG_VERBOSE + FILE* g_fileDebugTF = NULL; +#endif //DEBUG_VERBOSE + + O3DGCErrorCode SaveUIntData(const Vector & data, + BinaryStream & bstream) + { + unsigned long start = bstream.GetSize(); + bstream.WriteUInt32ASCII(0); + const unsigned long size = data.GetSize(); + bstream.WriteUInt32ASCII(size); + for(unsigned long i = 0; i < size; ++i) + { + bstream.WriteUIntASCII(data[i]); + } + bstream.WriteUInt32ASCII(start, bstream.GetSize() - start); + return O3DGC_OK; + } + O3DGCErrorCode SaveIntData(const Vector & data, + BinaryStream & bstream) + { + unsigned long start = bstream.GetSize(); + bstream.WriteUInt32ASCII(0); + const unsigned long size = data.GetSize(); + bstream.WriteUInt32ASCII(size); + for(unsigned long i = 0; i < size; ++i) + { + bstream.WriteIntASCII(data[i]); + } + bstream.WriteUInt32ASCII(start, bstream.GetSize() - start); + return O3DGC_OK; + } + O3DGCErrorCode SaveBinData(const Vector & data, + BinaryStream & bstream) + { + unsigned long start = bstream.GetSize(); + bstream.WriteUInt32ASCII(0); + const unsigned long size = data.GetSize(); + long symbol; + bstream.WriteUInt32ASCII(size); + for(unsigned long i = 0; i < size; ) + { + symbol = 0; + for(unsigned long h = 0; h < O3DGC_BINARY_STREAM_BITS_PER_SYMBOL0 && i < size; ++h) + { + symbol += (data[i] << h); + ++i; + } + bstream.WriteUCharASCII((unsigned char) symbol); + } + bstream.WriteUInt32ASCII(start, bstream.GetSize() - start); + return O3DGC_OK; + } + O3DGCErrorCode CompressedTriangleFans::SaveUIntAC(const Vector & data, + const unsigned long M, + BinaryStream & bstream) + { + unsigned long start = bstream.GetSize(); + const unsigned int NMAX = data.GetSize() * 8 + 100; + const unsigned long size = data.GetSize(); + long minValue = O3DGC_MAX_LONG; + bstream.WriteUInt32Bin(0); + bstream.WriteUInt32Bin(size); + if (size > 0) + { + #ifdef DEBUG_VERBOSE + printf("-----------\nsize %i, start %i\n", size, start); + fprintf(g_fileDebugTF, "-----------\nsize %i, start %i\n", size, start); + #endif //DEBUG_VERBOSE + + for(unsigned long i = 0; i < size; ++i) + { + if (minValue > data[i]) + { + minValue = data[i]; + } + #ifdef DEBUG_VERBOSE + printf("%i\t%i\n", i, data[i]); + fprintf(g_fileDebugTF, "%i\t%i\n", i, data[i]); + #endif //DEBUG_VERBOSE + } + bstream.WriteUInt32Bin(minValue); + if ( m_sizeBufferAC < NMAX ) + { + delete [] m_bufferAC; + m_sizeBufferAC = NMAX; + m_bufferAC = new unsigned char [m_sizeBufferAC]; + } + Arithmetic_Codec ace; + ace.set_buffer(NMAX, m_bufferAC); + ace.start_encoder(); + Adaptive_Data_Model mModelValues(M+1); + for(unsigned long i = 0; i < size; ++i) + { + ace.encode(data[i]-minValue, mModelValues); + } + unsigned long encodedBytes = ace.stop_encoder(); + for(unsigned long i = 0; i < encodedBytes; ++i) + { + bstream.WriteUChar8Bin(m_bufferAC[i]); + } + } + bstream.WriteUInt32Bin(start, bstream.GetSize() - start); + return O3DGC_OK; + } + O3DGCErrorCode CompressedTriangleFans::SaveBinAC(const Vector & data, + BinaryStream & bstream) + { + unsigned long start = bstream.GetSize(); + const unsigned int NMAX = data.GetSize() * 8 + 100; + const unsigned long size = data.GetSize(); + bstream.WriteUInt32Bin(0); + bstream.WriteUInt32Bin(size); + if (size > 0) + { + if ( m_sizeBufferAC < NMAX ) + { + delete [] m_bufferAC; + m_sizeBufferAC = NMAX; + m_bufferAC = new unsigned char [m_sizeBufferAC]; + } + Arithmetic_Codec ace; + ace.set_buffer(NMAX, m_bufferAC); + ace.start_encoder(); + Adaptive_Bit_Model bModel; + #ifdef DEBUG_VERBOSE + printf("-----------\nsize %i, start %i\n", size, start); + fprintf(g_fileDebugTF, "-----------\nsize %i, start %i\n", size, start); + #endif //DEBUG_VERBOSE + for(unsigned long i = 0; i < size; ++i) + { + ace.encode(data[i], bModel); + #ifdef DEBUG_VERBOSE + printf("%i\t%i\n", i, data[i]); + fprintf(g_fileDebugTF, "%i\t%i\n", i, data[i]); + #endif //DEBUG_VERBOSE + } + unsigned long encodedBytes = ace.stop_encoder(); + for(unsigned long i = 0; i < encodedBytes; ++i) + { + bstream.WriteUChar8Bin(m_bufferAC[i]); + } + } + bstream.WriteUInt32Bin(start, bstream.GetSize() - start); + return O3DGC_OK; + } + + O3DGCErrorCode CompressedTriangleFans::SaveIntACEGC(const Vector & data, + const unsigned long M, + BinaryStream & bstream) + { + unsigned long start = bstream.GetSize(); + const unsigned int NMAX = data.GetSize() * 8 + 100; + const unsigned long size = data.GetSize(); + long minValue = 0; + bstream.WriteUInt32Bin(0); + bstream.WriteUInt32Bin(size); + if (size > 0) + { +#ifdef DEBUG_VERBOSE + printf("-----------\nsize %i, start %i\n", size, start); + fprintf(g_fileDebugTF, "-----------\nsize %i, start %i\n", size, start); +#endif //DEBUG_VERBOSE + for(unsigned long i = 0; i < size; ++i) + { + if (minValue > data[i]) + { + minValue = data[i]; + } +#ifdef DEBUG_VERBOSE + printf("%i\t%i\n", i, data[i]); + fprintf(g_fileDebugTF, "%i\t%i\n", i, data[i]); +#endif //DEBUG_VERBOSE + } + bstream.WriteUInt32Bin(minValue + O3DGC_MAX_LONG); + if ( m_sizeBufferAC < NMAX ) + { + delete [] m_bufferAC; + m_sizeBufferAC = NMAX; + m_bufferAC = new unsigned char [m_sizeBufferAC]; + } + Arithmetic_Codec ace; + ace.set_buffer(NMAX, m_bufferAC); + ace.start_encoder(); + Adaptive_Data_Model mModelValues(M+2); + Static_Bit_Model bModel0; + Adaptive_Bit_Model bModel1; + unsigned long value; + for(unsigned long i = 0; i < size; ++i) + { + value = data[i]-minValue; + if (value < M) + { + ace.encode(value, mModelValues); + } + else + { + ace.encode(M, mModelValues); + ace.ExpGolombEncode(value-M, 0, bModel0, bModel1); + } + } + unsigned long encodedBytes = ace.stop_encoder(); + for(unsigned long i = 0; i < encodedBytes; ++i) + { + bstream.WriteUChar8Bin(m_bufferAC[i]); + } + } + bstream.WriteUInt32Bin(start, bstream.GetSize() - start); + return O3DGC_OK; + } + O3DGCErrorCode CompressedTriangleFans::Save(BinaryStream & bstream, bool encodeTrianglesOrder, O3DGCStreamType streamType) + { +#ifdef DEBUG_VERBOSE + g_fileDebugTF = fopen("SaveIntACEGC_new.txt", "w"); +#endif //DEBUG_VERBOSE + + if (streamType == O3DGC_STREAM_TYPE_ASCII) + { + SaveUIntData(m_numTFANs , bstream); + SaveUIntData(m_degrees , bstream); + SaveUIntData(m_configs , bstream); + SaveBinData (m_operations, bstream); + SaveIntData (m_indices , bstream); + if (encodeTrianglesOrder) + { + SaveUIntData(m_trianglesOrder, bstream); + } + } + else + { + SaveIntACEGC(m_numTFANs , 4 , bstream); + SaveIntACEGC(m_degrees , 16, bstream); + SaveUIntAC (m_configs , 10, bstream); + SaveBinAC (m_operations, bstream); + SaveIntACEGC(m_indices , 8 , bstream); + if (encodeTrianglesOrder) + { + SaveIntACEGC(m_trianglesOrder , 16, bstream); + } + } +#ifdef DEBUG_VERBOSE + fclose(g_fileDebugTF); +#endif //DEBUG_VERBOSE + return O3DGC_OK; + } + O3DGCErrorCode LoadUIntData(Vector & data, + const BinaryStream & bstream, + unsigned long & iterator) + { + bstream.ReadUInt32ASCII(iterator); + const unsigned long size = bstream.ReadUInt32ASCII(iterator); + data.Allocate(size); + data.Clear(); + for(unsigned long i = 0; i < size; ++i) + { + data.PushBack(bstream.ReadUIntASCII(iterator)); + } + return O3DGC_OK; + } + O3DGCErrorCode LoadIntData(Vector & data, + const BinaryStream & bstream, + unsigned long & iterator) + { + bstream.ReadUInt32ASCII(iterator); + const unsigned long size = bstream.ReadUInt32ASCII(iterator); + data.Allocate(size); + data.Clear(); + for(unsigned long i = 0; i < size; ++i) + { + data.PushBack(bstream.ReadIntASCII(iterator)); + } + return O3DGC_OK; + } + O3DGCErrorCode LoadBinData(Vector & data, + const BinaryStream & bstream, + unsigned long & iterator) + { + bstream.ReadUInt32ASCII(iterator); + const unsigned long size = bstream.ReadUInt32ASCII(iterator); + long symbol; + data.Allocate(size * O3DGC_BINARY_STREAM_BITS_PER_SYMBOL0); + data.Clear(); + for(unsigned long i = 0; i < size;) + { + symbol = bstream.ReadUCharASCII(iterator); + for(unsigned long h = 0; h < O3DGC_BINARY_STREAM_BITS_PER_SYMBOL0; ++h) + { + data.PushBack(symbol & 1); + symbol >>= 1; + ++i; + } + } + return O3DGC_OK; + } + O3DGCErrorCode LoadUIntAC(Vector & data, + const unsigned long M, + const BinaryStream & bstream, + unsigned long & iterator) + { + unsigned long sizeSize = bstream.ReadUInt32Bin(iterator) - 12; + unsigned long size = bstream.ReadUInt32Bin(iterator); + if (size == 0) + { + return O3DGC_OK; + } + long minValue = bstream.ReadUInt32Bin(iterator); + unsigned char * buffer = 0; + bstream.GetBuffer(iterator, buffer); + iterator += sizeSize; + data.Allocate(size); + Arithmetic_Codec acd; + acd.set_buffer(sizeSize, buffer); + acd.start_decoder(); + Adaptive_Data_Model mModelValues(M+1); +#ifdef DEBUG_VERBOSE + printf("-----------\nsize %i\n", size); + fprintf(g_fileDebugTF, "size %i\n", size); +#endif //DEBUG_VERBOSE + for(unsigned long i = 0; i < size; ++i) + { + data.PushBack(acd.decode(mModelValues)+minValue); +#ifdef DEBUG_VERBOSE + printf("%i\t%i\n", i, data[i]); + fprintf(g_fileDebugTF, "%i\t%i\n", i, data[i]); +#endif //DEBUG_VERBOSE + } + return O3DGC_OK; + } + O3DGCErrorCode LoadIntACEGC(Vector & data, + const unsigned long M, + const BinaryStream & bstream, + unsigned long & iterator) + { + unsigned long sizeSize = bstream.ReadUInt32Bin(iterator) - 12; + unsigned long size = bstream.ReadUInt32Bin(iterator); + if (size == 0) + { + return O3DGC_OK; + } + long minValue = bstream.ReadUInt32Bin(iterator) - O3DGC_MAX_LONG; + unsigned char * buffer = 0; + bstream.GetBuffer(iterator, buffer); + iterator += sizeSize; + data.Allocate(size); + Arithmetic_Codec acd; + acd.set_buffer(sizeSize, buffer); + acd.start_decoder(); + Adaptive_Data_Model mModelValues(M+2); + Static_Bit_Model bModel0; + Adaptive_Bit_Model bModel1; + unsigned long value; + +#ifdef DEBUG_VERBOSE + printf("-----------\nsize %i\n", size); + fprintf(g_fileDebugTF, "size %i\n", size); +#endif //DEBUG_VERBOSE + for(unsigned long i = 0; i < size; ++i) + { + value = acd.decode(mModelValues); + if ( value == M) + { + value += acd.ExpGolombDecode(0, bModel0, bModel1); + } + data.PushBack(value + minValue); +#ifdef DEBUG_VERBOSE + printf("%i\t%i\n", i, data[i]); + fprintf(g_fileDebugTF, "%i\t%i\n", i, data[i]); +#endif //DEBUG_VERBOSE + } +#ifdef DEBUG_VERBOSE + fflush(g_fileDebugTF); +#endif //DEBUG_VERBOSE + return O3DGC_OK; + } + O3DGCErrorCode LoadBinAC(Vector & data, + const BinaryStream & bstream, + unsigned long & iterator) + { + unsigned long sizeSize = bstream.ReadUInt32Bin(iterator) - 8; + unsigned long size = bstream.ReadUInt32Bin(iterator); + if (size == 0) + { + return O3DGC_OK; + } + unsigned char * buffer = 0; + bstream.GetBuffer(iterator, buffer); + iterator += sizeSize; + data.Allocate(size); + Arithmetic_Codec acd; + acd.set_buffer(sizeSize, buffer); + acd.start_decoder(); + Adaptive_Bit_Model bModel; +#ifdef DEBUG_VERBOSE + printf("-----------\nsize %i\n", size); + fprintf(g_fileDebugTF, "size %i\n", size); +#endif //DEBUG_VERBOSE + for(unsigned long i = 0; i < size; ++i) + { + data.PushBack(acd.decode(bModel)); +#ifdef DEBUG_VERBOSE + printf("%i\t%i\n", i, data[i]); + fprintf(g_fileDebugTF, "%i\t%i\n", i, data[i]); +#endif //DEBUG_VERBOSE + } + return O3DGC_OK; + } + O3DGCErrorCode CompressedTriangleFans::Load(const BinaryStream & bstream, + unsigned long & iterator, + bool decodeTrianglesOrder, + O3DGCStreamType streamType) + { +#ifdef DEBUG_VERBOSE + g_fileDebugTF = fopen("Load_new.txt", "w"); +#endif //DEBUG_VERBOSE + if (streamType == O3DGC_STREAM_TYPE_ASCII) + { + LoadUIntData(m_numTFANs , bstream, iterator); + LoadUIntData(m_degrees , bstream, iterator); + LoadUIntData(m_configs , bstream, iterator); + LoadBinData (m_operations, bstream, iterator); + LoadIntData (m_indices , bstream, iterator); + if (decodeTrianglesOrder) + { + LoadUIntData(m_trianglesOrder , bstream, iterator); + } + } + else + { + LoadIntACEGC(m_numTFANs , 4 , bstream, iterator); + LoadIntACEGC(m_degrees , 16, bstream, iterator); + LoadUIntAC (m_configs , 10, bstream, iterator); + LoadBinAC (m_operations, bstream, iterator); + LoadIntACEGC(m_indices , 8 , bstream, iterator); + if (decodeTrianglesOrder) + { + LoadIntACEGC(m_trianglesOrder , 16, bstream, iterator); + } + } + +#ifdef DEBUG_VERBOSE + fclose(g_fileDebugTF); +#endif //DEBUG_VERBOSE + return O3DGC_OK; + } +} + diff --git a/contrib/Open3DGC/o3dgcTriangleFans.h b/contrib/Open3DGC/o3dgcTriangleFans.h new file mode 100644 index 000000000..861836428 --- /dev/null +++ b/contrib/Open3DGC/o3dgcTriangleFans.h @@ -0,0 +1,291 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + + +#pragma once +#ifndef O3DGC_TRIANGLE_FANS_H +#define O3DGC_TRIANGLE_FANS_H + +#include "o3dgcCommon.h" +#include "o3dgcVector.h" +#include "o3dgcBinaryStream.h" + + +namespace o3dgc +{ + const long O3DGC_TFANS_MIN_SIZE_ALLOCATED_VERTICES_BUFFER = 128; + const long O3DGC_TFANS_MIN_SIZE_TFAN_SIZE_BUFFER = 8; + + class CompressedTriangleFans + { + public: + //! Constructor. + CompressedTriangleFans(void) + { + m_streamType = O3DGC_STREAM_TYPE_UNKOWN; + m_bufferAC = 0; + m_sizeBufferAC = 0; + }; + //! Destructor. + ~CompressedTriangleFans(void) + { + delete [] m_bufferAC; + }; + O3DGCStreamType GetStreamType() const { return m_streamType; } + void SetStreamType(O3DGCStreamType streamType) { m_streamType = streamType; } + + O3DGCErrorCode Allocate(long numVertices, long numTriangles) + { + assert(numVertices > 0); + m_numTFANs.Allocate(numVertices); + m_degrees.Allocate(2*numVertices); + m_configs.Allocate(2*numVertices); + m_operations.Allocate(2*numVertices); + m_indices.Allocate(2*numVertices); + m_trianglesOrder.Allocate(numTriangles); + Clear(); + return O3DGC_OK; + } + O3DGCErrorCode PushNumTFans(long numTFans) + { + m_numTFANs.PushBack(numTFans); + return O3DGC_OK; + } + long ReadNumTFans(unsigned long & iterator) const + { + assert(iterator < m_numTFANs.GetSize()); + return m_numTFANs[iterator++]; + } + O3DGCErrorCode PushDegree(long degree) + { + m_degrees.PushBack(degree); + return O3DGC_OK; + } + long ReadDegree(unsigned long & iterator) const + { + assert(iterator < m_degrees.GetSize()); + return m_degrees[iterator++]; + } + O3DGCErrorCode PushConfig(long config) + { + m_configs.PushBack(config); + return O3DGC_OK; + } + long ReadConfig(unsigned long & iterator) const + { + assert(iterator < m_configs.GetSize()); + return m_configs[iterator++]; + } + O3DGCErrorCode PushOperation(long op) + { + m_operations.PushBack(op); + return O3DGC_OK; + } + long ReadOperation(unsigned long & iterator) const + { + assert(iterator < m_operations.GetSize()); + return m_operations[iterator++]; + } + O3DGCErrorCode PushIndex(long index) + { + m_indices.PushBack(index); + return O3DGC_OK; + } + long ReadIndex(unsigned long & iterator) const + { + assert(iterator < m_indices.GetSize()); + return m_indices[iterator++]; + } + O3DGCErrorCode PushTriangleIndex(long index) + { + m_trianglesOrder.PushBack(IntToUInt(index)); + return O3DGC_OK; + } + long ReadTriangleIndex(unsigned long & iterator) const + { + assert(iterator < m_trianglesOrder.GetSize()); + return UIntToInt(m_trianglesOrder[iterator++]); + } + O3DGCErrorCode Clear() + { + m_numTFANs.Clear(); + m_degrees.Clear(); + m_configs.Clear(); + m_operations.Clear(); + m_indices.Clear(); + return O3DGC_OK; + } + O3DGCErrorCode Save(BinaryStream & bstream, + bool encodeTrianglesOrder, + O3DGCStreamType streamType); + O3DGCErrorCode Load(const BinaryStream & bstream, + unsigned long & iterator, + bool decodeTrianglesOrder, + O3DGCStreamType streamType); + + private: + O3DGCErrorCode SaveBinAC(const Vector & data, + BinaryStream & bstream); + O3DGCErrorCode SaveUIntAC(const Vector & data, + const unsigned long M, + BinaryStream & bstream); + O3DGCErrorCode SaveIntACEGC(const Vector & data, + const unsigned long M, + BinaryStream & bstream); + + Vector m_numTFANs; + Vector m_degrees; + Vector m_configs; + Vector m_operations; + Vector m_indices; + Vector m_trianglesOrder; + unsigned char * m_bufferAC; + unsigned long m_sizeBufferAC; + O3DGCStreamType m_streamType; + }; + + //! + class TriangleFans + { + public: + //! Constructor. + TriangleFans(long sizeTFAN = O3DGC_TFANS_MIN_SIZE_TFAN_SIZE_BUFFER, + long verticesSize = O3DGC_TFANS_MIN_SIZE_ALLOCATED_VERTICES_BUFFER) + { + assert(sizeTFAN > 0); + assert(verticesSize > 0); + m_numTFANs = 0; + m_numVertices = 0; + m_verticesAllocatedSize = verticesSize; + m_sizeTFANAllocatedSize = sizeTFAN; + m_sizeTFAN = new long [m_sizeTFANAllocatedSize]; + m_vertices = new long [m_verticesAllocatedSize]; + }; + //! Destructor. + ~TriangleFans(void) + { + delete [] m_vertices; + delete [] m_sizeTFAN; + }; + + O3DGCErrorCode Allocate(long sizeTFAN, long verticesSize) + { + assert(sizeTFAN > 0); + assert(verticesSize > 0); + m_numTFANs = 0; + m_numVertices = 0; + if (m_verticesAllocatedSize < verticesSize) + { + delete [] m_vertices; + m_verticesAllocatedSize = verticesSize; + m_vertices = new long [m_verticesAllocatedSize]; + } + if (m_sizeTFANAllocatedSize < sizeTFAN) + { + delete [] m_sizeTFAN; + m_sizeTFANAllocatedSize = sizeTFAN; + m_sizeTFAN = new long [m_sizeTFANAllocatedSize]; + } + return O3DGC_OK; + }; + O3DGCErrorCode Clear() + { + m_numTFANs = 0; + m_numVertices = 0; + return O3DGC_OK; + } + O3DGCErrorCode AddVertex(long vertex) + { + assert(m_numTFANs >= 0); + assert(m_numTFANs < m_sizeTFANAllocatedSize); + assert(m_numVertices >= 0); + ++m_numVertices; + if (m_numVertices == m_verticesAllocatedSize) + { + m_verticesAllocatedSize *= 2; + long * tmp = m_vertices; + m_vertices = new long [m_verticesAllocatedSize]; + memcpy(m_vertices, tmp, sizeof(long) * m_numVertices); + delete [] tmp; + } + m_vertices[m_numVertices-1] = vertex; + ++m_sizeTFAN[m_numTFANs-1]; + return O3DGC_OK; + } + O3DGCErrorCode AddTFAN() + { + assert(m_numTFANs >= 0); + ++m_numTFANs; + if (m_numTFANs == m_sizeTFANAllocatedSize) + { + m_sizeTFANAllocatedSize *= 2; + long * tmp = m_sizeTFAN; + m_sizeTFAN = new long [m_sizeTFANAllocatedSize]; + memcpy(m_sizeTFAN, tmp, sizeof(long) * m_numTFANs); + delete [] tmp; + } + m_sizeTFAN[m_numTFANs-1] = (m_numTFANs > 1) ? m_sizeTFAN[m_numTFANs-2] : 0; + return O3DGC_OK; + } + long Begin(long tfan) const + { + assert(tfan < m_numTFANs); + assert(tfan >= 0); + return (tfan>0)?m_sizeTFAN[tfan-1]:0; + } + long End(long tfan) const + { + assert(tfan < m_numTFANs); + assert(tfan >= 0); + return m_sizeTFAN[tfan]; + } + long GetVertex(long vertex) const + { + assert(vertex < m_numVertices); + assert(vertex >= 0); + return m_vertices[vertex]; + } + long GetTFANSize(long tfan) const + { + return End(tfan) - Begin(tfan); + } + long GetNumTFANs() const + { + return m_numTFANs; + } + long GetNumVertices() const + { + return m_numVertices; + } + + private: + long m_verticesAllocatedSize; + long m_sizeTFANAllocatedSize; + long m_numTFANs; + long m_numVertices; + long * m_vertices; + long * m_sizeTFAN; + + }; +} +#endif // O3DGC_TRIANGLE_FANS_H + diff --git a/contrib/Open3DGC/o3dgcTriangleListDecoder.h b/contrib/Open3DGC/o3dgcTriangleListDecoder.h new file mode 100644 index 000000000..65df526d1 --- /dev/null +++ b/contrib/Open3DGC/o3dgcTriangleListDecoder.h @@ -0,0 +1,133 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + +#pragma once +#ifndef O3DGC_TRIANGLE_LIST_DECODER_H +#define O3DGC_TRIANGLE_LIST_DECODER_H + +#include "o3dgcCommon.h" +#include "o3dgcTriangleFans.h" +#include "o3dgcBinaryStream.h" +#include "o3dgcAdjacencyInfo.h" + +namespace o3dgc +{ + + //! + template + class TriangleListDecoder + { + public: + //! Constructor. + TriangleListDecoder(void) + { + m_vertexCount = 0; + m_triangleCount = 0; + m_numTriangles = 0; + m_numVertices = 0; + m_triangles = 0; + m_numConqueredTriangles = 0; + m_numVisitedVertices = 0; + m_visitedVertices = 0; + m_visitedVerticesValence = 0; + m_maxNumVertices = 0; + m_maxNumTriangles = 0; + m_itNumTFans = 0; + m_itDegree = 0; + m_itConfig = 0; + m_itOperation = 0; + m_itIndex = 0; + m_tempTriangles = 0; + m_tempTrianglesSize = 0; + m_decodeTrianglesOrder = false; + m_decodeVerticesOrder = false; + }; + //! Destructor. + ~TriangleListDecoder(void) + { + delete [] m_tempTriangles; + }; + + O3DGCStreamType GetStreamType() const { return m_streamType; } + bool GetReorderTriangles() const { return m_decodeTrianglesOrder; } + bool GetReorderVertices() const { return m_decodeVerticesOrder; } + void SetStreamType(O3DGCStreamType streamType) { m_streamType = streamType; } + const AdjacencyInfo & GetVertexToTriangle() const { return m_vertexToTriangle;} + O3DGCErrorCode Decode(T * const triangles, + const long numTriangles, + const long numVertices, + const BinaryStream & bstream, + unsigned long & iterator) + { + unsigned char compressionMask = bstream.ReadUChar(iterator, m_streamType); + m_decodeTrianglesOrder = ( (compressionMask&2) != 0); + m_decodeVerticesOrder = ( (compressionMask&1) != 0); + if (m_decodeVerticesOrder) // vertices reordering not supported + { + return O3DGC_ERROR_NON_SUPPORTED_FEATURE; + } + unsigned long maxSizeV2T = bstream.ReadUInt32(iterator, m_streamType); + Init(triangles, numTriangles, numVertices, maxSizeV2T); + m_ctfans.Load(bstream, iterator, m_decodeTrianglesOrder, m_streamType); + Decompress(); + return O3DGC_OK; + } + O3DGCErrorCode Reorder(); + + private: + O3DGCErrorCode Init(T * const triangles, + const long numTriangles, + const long numVertices, + const long maxSizeV2T); + O3DGCErrorCode Decompress(); + O3DGCErrorCode CompueLocalConnectivityInfo(const long focusVertex); + O3DGCErrorCode DecompressTFAN(const long focusVertex); + + unsigned long m_itNumTFans; + unsigned long m_itDegree; + unsigned long m_itConfig; + unsigned long m_itOperation; + unsigned long m_itIndex; + long m_maxNumVertices; + long m_maxNumTriangles; + long m_numTriangles; + long m_numVertices; + long m_tempTrianglesSize; + T * m_triangles; + T * m_tempTriangles; + long m_vertexCount; + long m_triangleCount; + long m_numConqueredTriangles; + long m_numVisitedVertices; + long * m_visitedVertices; + long * m_visitedVerticesValence; + AdjacencyInfo m_vertexToTriangle; + CompressedTriangleFans m_ctfans; + TriangleFans m_tfans; + O3DGCStreamType m_streamType; + bool m_decodeTrianglesOrder; + bool m_decodeVerticesOrder; + }; +} +#include "o3dgcTriangleListDecoder.inl" // template implementation +#endif // O3DGC_TRIANGLE_LIST_DECODER_H + diff --git a/contrib/Open3DGC/o3dgcTriangleListDecoder.inl b/contrib/Open3DGC/o3dgcTriangleListDecoder.inl new file mode 100644 index 000000000..dd3af4aa7 --- /dev/null +++ b/contrib/Open3DGC/o3dgcTriangleListDecoder.inl @@ -0,0 +1,364 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + +#pragma once +#ifndef O3DGC_TRIANGLE_LIST_DECODER_INL +#define O3DGC_TRIANGLE_LIST_DECODER_INL + +namespace o3dgc +{ + template + O3DGCErrorCode TriangleListDecoder::Init(T * const triangles, + const long numTriangles, + const long numVertices, + const long maxSizeV2T) + { + assert(numVertices > 0); + assert(numTriangles > 0); + m_numTriangles = numTriangles; + m_numVertices = numVertices; + m_triangles = triangles; + m_vertexCount = 0; + m_triangleCount = 0; + m_itNumTFans = 0; + m_itDegree = 0; + m_itConfig = 0; + m_itOperation = 0; + m_itIndex = 0; + if (m_numVertices > m_maxNumVertices) + { + m_maxNumVertices = m_numVertices; + delete [] m_visitedVerticesValence; + delete [] m_visitedVertices; + m_visitedVerticesValence = new long [m_numVertices]; + m_visitedVertices = new long [m_numVertices]; + } + + if (m_decodeTrianglesOrder && m_tempTrianglesSize < m_numTriangles) + { + delete [] m_tempTriangles; + m_tempTrianglesSize = m_numTriangles; + m_tempTriangles = new T [3*m_tempTrianglesSize]; + } + + m_ctfans.SetStreamType(m_streamType); + m_ctfans.Allocate(m_numVertices, m_numTriangles); + m_tfans.Allocate(2 * m_numVertices, 8 * m_numVertices); + + // compute vertex-to-triangle adjacency information + m_vertexToTriangle.AllocateNumNeighborsArray(numVertices); + long * numNeighbors = m_vertexToTriangle.GetNumNeighborsBuffer(); + for(long i = 0; i < numVertices; ++i) + { + numNeighbors[i] = maxSizeV2T; + } + m_vertexToTriangle.AllocateNeighborsArray(); + m_vertexToTriangle.ClearNeighborsArray(); + return O3DGC_OK; + } + template + O3DGCErrorCode TriangleListDecoder::Decompress() + { + for(long focusVertex = 0; focusVertex < m_numVertices; ++focusVertex) + { + if (focusVertex == m_vertexCount) + { + m_vertexCount++; // insert focusVertex + } + CompueLocalConnectivityInfo(focusVertex); + DecompressTFAN(focusVertex); + } + return O3DGC_OK; + } + template + O3DGCErrorCode TriangleListDecoder::Reorder() + { + if (m_decodeTrianglesOrder) + { + unsigned long itTriangleIndex = 0; + long prevTriangleIndex = 0; + long t; + memcpy(m_tempTriangles, m_triangles, m_numTriangles * 3 * sizeof(T)); + for(long i = 0; i < m_numTriangles; ++i) + { + t = m_ctfans.ReadTriangleIndex(itTriangleIndex) + prevTriangleIndex; + assert( t >= 0 && t < m_numTriangles); + memcpy(m_triangles + 3 * t, m_tempTriangles + 3 * i, sizeof(T) * 3); + prevTriangleIndex = t + 1; + } + } + return O3DGC_OK; + } + template + O3DGCErrorCode TriangleListDecoder::CompueLocalConnectivityInfo(const long focusVertex) + { + long t = 0; + long p, v; + m_numConqueredTriangles = 0; + m_numVisitedVertices = 0; + for(long i = m_vertexToTriangle.Begin(focusVertex); (t >= 0) && (i < m_vertexToTriangle.End(focusVertex)); ++i) + { + t = m_vertexToTriangle.GetNeighbor(i); + if ( t >= 0) + { + ++m_numConqueredTriangles; + p = 3*t; + // extract visited vertices + for(long k = 0; k < 3; ++k) + { + v = m_triangles[p+k]; + if (v > focusVertex) // vertices are insertices by increasing traversal order + { + bool foundOrInserted = false; + for (long j = 0; j < m_numVisitedVertices; ++j) + { + if (v == m_visitedVertices[j]) + { + m_visitedVerticesValence[j]++; + foundOrInserted = true; + break; + } + else if (v < m_visitedVertices[j]) + { + ++m_numVisitedVertices; + for (long h = m_numVisitedVertices-1; h > j; --h) + { + m_visitedVertices[h] = m_visitedVertices[h-1]; + m_visitedVerticesValence[h] = m_visitedVerticesValence[h-1]; + } + m_visitedVertices[j] = v; + m_visitedVerticesValence[j] = 1; + foundOrInserted = true; + break; + } + } + if (!foundOrInserted) + { + m_visitedVertices[m_numVisitedVertices] = v; + m_visitedVerticesValence[m_numVisitedVertices] = 1; + m_numVisitedVertices++; + } + } + } + } + } + // re-order visited vertices by taking into account their valence (i.e., # of conquered triangles incident to each vertex) + // in order to avoid config. 9 + if (m_numVisitedVertices > 2) + { + long y; + for(long x = 1; x < m_numVisitedVertices; ++x) + { + + if (m_visitedVerticesValence[x] == 1) + { + y = x; + while( (y > 0) && (m_visitedVerticesValence[y] < m_visitedVerticesValence[y-1]) ) + { + swap(m_visitedVerticesValence[y], m_visitedVerticesValence[y-1]); + swap(m_visitedVertices[y], m_visitedVertices[y-1]); + --y; + } + } + } + } + return O3DGC_OK; + } + template + O3DGCErrorCode TriangleListDecoder::DecompressTFAN(const long focusVertex) + { + long ntfans; + long degree, config; + long op; + long index; + long k0, k1; + long b, c, t; + + ntfans = m_ctfans.ReadNumTFans(m_itNumTFans); + if (ntfans > 0) + { + for(long f = 0; f != ntfans; f++) + { + m_tfans.AddTFAN(); + degree = m_ctfans.ReadDegree(m_itDegree) +2 - m_numConqueredTriangles; + config = m_ctfans.ReadConfig(m_itConfig); + k0 = m_tfans.GetNumVertices(); + m_tfans.AddVertex(focusVertex); + switch(config) + { + case 0:// ops: 1000001 vertices: -1 -2 + m_tfans.AddVertex(m_visitedVertices[0]); + for(long u = 1; u < degree-1; u++) + { + m_visitedVertices[m_numVisitedVertices++] = m_vertexCount; + m_tfans.AddVertex(m_vertexCount++); + } + m_tfans.AddVertex(m_visitedVertices[1]); + break; + case 1: // ops: 1xxxxxx1 vertices: -1 x x x x x -2 + m_tfans.AddVertex(m_visitedVertices[0]); + for(long u = 1; u < degree-1; u++) + { + op = m_ctfans.ReadOperation(m_itOperation); + if (op == 1) + { + index = m_ctfans.ReadIndex(m_itIndex); + if ( index < 0) + { + m_tfans.AddVertex(m_visitedVertices[-index-1]); + } + else + { + m_tfans.AddVertex(index + focusVertex); + } + } + else + { + m_visitedVertices[m_numVisitedVertices++] = m_vertexCount; + m_tfans.AddVertex(m_vertexCount++); + } + } + m_tfans.AddVertex(m_visitedVertices[1]); + break; + case 2: // ops: 00000001 vertices: -1 + for(long u = 0; u < degree-1; u++) + { + m_visitedVertices[m_numVisitedVertices++] = m_vertexCount; + m_tfans.AddVertex(m_vertexCount++); + } + m_tfans.AddVertex(m_visitedVertices[0]); + break; + case 3: // ops: 00000001 vertices: -2 + for(long u=0; u < degree-1; u++) + { + m_visitedVertices[m_numVisitedVertices++] = m_vertexCount; + m_tfans.AddVertex(m_vertexCount++); + } + m_tfans.AddVertex(m_visitedVertices[1]); + break; + case 4: // ops: 10000000 vertices: -1 + m_tfans.AddVertex(m_visitedVertices[0]); + for(long u = 1; u < degree; u++) + { + m_visitedVertices[m_numVisitedVertices++] = m_vertexCount; + m_tfans.AddVertex(m_vertexCount++); + } + break; + case 5: // ops: 10000000 vertices: -2 + m_tfans.AddVertex(m_visitedVertices[1]); + for(long u = 1; u < degree; u++) + { + m_visitedVertices[m_numVisitedVertices++] = m_vertexCount; + m_tfans.AddVertex(m_vertexCount++); + } + break; + case 6:// ops: 00000000 vertices: + for(long u = 0; u < degree; u++) + { + m_visitedVertices[m_numVisitedVertices++] = m_vertexCount; + m_tfans.AddVertex(m_vertexCount++); + } + break; + case 7: // ops: 1000001 vertices: -2 -1 + m_tfans.AddVertex(m_visitedVertices[1]); + for(long u = 1; u < degree-1; u++) + { + m_visitedVertices[m_numVisitedVertices++] = m_vertexCount; + m_tfans.AddVertex(m_vertexCount++); + } + m_tfans.AddVertex(m_visitedVertices[0]); + break; + case 8: // ops: 1xxxxxx1 vertices: -2 x x x x x -1 + m_tfans.AddVertex(m_visitedVertices[1]); + for(long u = 1; u < degree-1; u++) + { + op = m_ctfans.ReadOperation(m_itOperation); + if (op == 1) + { + index = m_ctfans.ReadIndex(m_itIndex); + if ( index < 0) + { + m_tfans.AddVertex(m_visitedVertices[-index-1]); + } + else + { + m_tfans.AddVertex(index + focusVertex); + } + } + else + { + m_visitedVertices[m_numVisitedVertices++] = m_vertexCount; + m_tfans.AddVertex(m_vertexCount++); + } + } + m_tfans.AddVertex(m_visitedVertices[0]); + break; + case 9: // general case + for(long u = 0; u < degree; u++) + { + op = m_ctfans.ReadOperation(m_itOperation); + if (op == 1) + { + index = m_ctfans.ReadIndex(m_itIndex); + if ( index < 0) + { + m_tfans.AddVertex(m_visitedVertices[-index-1]); + } + else + { + m_tfans.AddVertex(index + focusVertex); + } + } + else + { + m_visitedVertices[m_numVisitedVertices++] = m_vertexCount; + m_tfans.AddVertex(m_vertexCount++); + } + } + break; + + } + //logger.write_2_log("\t degree=%i \t cas = %i\n", degree, cas); + k1 = m_tfans.GetNumVertices(); + b = m_tfans.GetVertex(k0+1); + for (long k = k0+2; k < k1; k++) + { + c = m_tfans.GetVertex(k); + t = m_triangleCount*3; + + m_triangles[t++] = (T) focusVertex; + m_triangles[t++] = (T) b; + m_triangles[t ] = (T) c; + + m_vertexToTriangle.AddNeighbor(focusVertex, m_triangleCount); + m_vertexToTriangle.AddNeighbor(b , m_triangleCount); + m_vertexToTriangle.AddNeighbor(c , m_triangleCount); + b=c; + m_triangleCount++; + } + } + } + return O3DGC_OK; + } +} +#endif //O3DGC_TRIANGLE_LIST_DECODER_INL + diff --git a/contrib/Open3DGC/o3dgcTriangleListEncoder.h b/contrib/Open3DGC/o3dgcTriangleListEncoder.h new file mode 100644 index 000000000..cf790ecc3 --- /dev/null +++ b/contrib/Open3DGC/o3dgcTriangleListEncoder.h @@ -0,0 +1,101 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + + +#pragma once +#ifndef O3DGC_TRIANGLE_LIST_ENCODER_H +#define O3DGC_TRIANGLE_LIST_ENCODER_H + +#include "o3dgcCommon.h" +#include "o3dgcAdjacencyInfo.h" +#include "o3dgcBinaryStream.h" +#include "o3dgcFIFO.h" +#include "o3dgcTriangleFans.h" + +namespace o3dgc +{ + //! + template + class TriangleListEncoder + { + public: + //! Constructor. + TriangleListEncoder(void); + //! Destructor. + ~TriangleListEncoder(void); + //! + O3DGCErrorCode Encode(const T * const triangles, + const unsigned long * const indexBufferIDs, + const long numTriangles, + const long numVertices, + BinaryStream & bstream); + O3DGCStreamType GetStreamType() const { return m_streamType; } + void SetStreamType(O3DGCStreamType streamType) { m_streamType = streamType; } + const long * const GetInvVMap() const { return m_invVMap;} + const long * const GetInvTMap() const { return m_invTMap;} + const long * const GetVMap() const { return m_vmap;} + const long * const GetTMap() const { return m_tmap;} + const AdjacencyInfo & GetVertexToTriangle() const { return m_vertexToTriangle;} + + private: + O3DGCErrorCode Init(const T * const triangles, + long numTriangles, + long numVertices); + O3DGCErrorCode CompueLocalConnectivityInfo(const long focusVertex); + O3DGCErrorCode ProcessVertex( long focusVertex); + O3DGCErrorCode ComputeTFANDecomposition(const long focusVertex); + O3DGCErrorCode CompressTFAN(const long focusVertex); + + long m_vertexCount; + long m_triangleCount; + long m_maxNumVertices; + long m_maxNumTriangles; + long m_numNonConqueredTriangles; + long m_numConqueredTriangles; + long m_numVisitedVertices; + long m_numTriangles; + long m_numVertices; + long m_maxSizeVertexToTriangle; + T const * m_triangles; + long * m_vtags; + long * m_ttags; + long * m_vmap; + long * m_invVMap; + long * m_tmap; + long * m_invTMap; + long * m_count; + long * m_nonConqueredTriangles; + long * m_nonConqueredEdges; + long * m_visitedVertices; + long * m_visitedVerticesValence; + FIFO m_vfifo; + AdjacencyInfo m_vertexToTriangle; + AdjacencyInfo m_triangleToTriangle; + AdjacencyInfo m_triangleToTriangleInv; + TriangleFans m_tfans; + CompressedTriangleFans m_ctfans; + O3DGCStreamType m_streamType; + }; +} +#include "o3dgcTriangleListEncoder.inl" // template implementation +#endif // O3DGC_TRIANGLE_LIST_ENCODER_H + diff --git a/contrib/Open3DGC/o3dgcTriangleListEncoder.inl b/contrib/Open3DGC/o3dgcTriangleListEncoder.inl new file mode 100644 index 000000000..d499f6dc9 --- /dev/null +++ b/contrib/Open3DGC/o3dgcTriangleListEncoder.inl @@ -0,0 +1,719 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + +#pragma once +#ifndef O3DGC_TRIANGLE_LIST_ENCODER_INL +#define O3DGC_TRIANGLE_LIST_ENCODER_INL + +namespace o3dgc +{ + // extract opposite edge + template + inline void CompueOppositeEdge(const long focusVertex, + const T * triangle, + long & a, long & b) + { + if ((long) triangle[0] == focusVertex) + { + a = triangle[1]; + b = triangle[2]; + } + else if ((long) triangle[1] == focusVertex) + { + a = triangle[2]; + b = triangle[0]; + } + else + { + a = triangle[0]; + b = triangle[1]; + } + } + inline bool IsCase0(long degree, long numIndices, const long * const ops, const long * const indices) + { + // ops: 1000001 vertices: -1 -2 + if ((numIndices != 2) || (degree < 2)) { + return false; + } + if ((indices[0] != -1) ||(indices[1] != -2) || + (ops[0] != 1) ||(ops[degree-1] != 1) ) return false; + for (long u = 1; u < degree-1; u++) { + if (ops[u] != 0) return false; + } + return true; + } + inline bool IsCase1(long degree, long numIndices, const long * const ops, const long * const indices) + { + // ops: 1xxxxxx1 indices: -1 x x x x x -2 + if ((degree < 2) || (numIndices < 1)) + { + return false; + } + if ((indices[0] != -1) ||(indices[numIndices-1] != -2) || + (ops[0] != 1) ||(ops[degree-1] != 1) ) return false; + return true; + } + inline bool IsCase2(long degree, long numIndices, const long * const ops, const long * const indices) + { + // ops: 00000001 indices: -1 + if ((degree < 2) || (numIndices!= 1)) + { + return false; + } + if ((indices[0] != -1) || (ops[degree-1] != 1) ) return false; + for (long u = 0; u < degree-1; u++) { + if (ops[u] != 0) return false; + } + return true; + } + inline bool IsCase3(long degree, long numIndices, const long * const ops, const long * const indices) + { + // ops: 00000001 indices: -2 + if ((degree < 2) || (numIndices!= 1)) + { + return false; + } + if ((indices[0] != -2) || (ops[degree-1] != 1) ) return false; + for (long u = 0; u < degree-1; u++) { + if (ops[u] != 0) return false; + } + return true; + } + inline bool IsCase4(long degree, long numIndices, const long * const ops, const long * const indices) + { + // ops: 10000000 indices: -1 + if ((degree < 2) || (numIndices!= 1)) + { + return false; + } + if ((indices[0] != -1) || (ops[0] != 1) ) return false; + for (long u = 1; u < degree; u++) + { + if (ops[u] != 0) return false; + } + return true; + } + inline bool IsCase5(long degree, long numIndices, const long * const ops, const long * const indices) + { + // ops: 10000000 indices: -2 + if ((degree < 2) || (numIndices!= 1)) + { + return false; + } + if ((indices[0] != -2) || (ops[0] != 1) ) return false; + for (long u = 1; u < degree; u++) { + if (ops[u] != 0) return false; + } + return true; + } + inline bool IsCase6(long degree, long numIndices, const long * const ops, const long * const indices) + { + // ops: 0000000 indices: + if (numIndices!= 0) + { + return false; + } + for (long u = 0; u < degree; u++) + { + if (ops[u] != 0) return false; + } + return true; + } + inline bool IsCase7(long degree, long numIndices, const long * const ops, const long * const indices) + { + // ops: 1000001 indices: -2 -1 + if ((numIndices!= 2) || (degree < 2)) + { + return false; + } + if ((indices[0] != -2) ||(indices[1] != -1) || + (ops[0] != 1) ||(ops[degree-1] != 1) ) return false; + for (long u = 1; u < degree-1; u++) + { + if (ops[u] != 0) return false; + } + return true; + } + inline bool IsCase8(long degree, long numIndices, const long * const ops, const long * const indices) + { + // ops: 1xxxxxx1 indices: -1 x x x x x -2 + if ((degree < 2) || (numIndices < 1)) + { + return false; + } + if ((indices[0] != -2) ||(indices[numIndices-1] != -1) || + (ops[0] != 1) ||(ops[degree-1] != 1) ) return false; + return true; + } + template + TriangleListEncoder::TriangleListEncoder(void) + { + m_vtags = 0; + m_ttags = 0; + m_tmap = 0; + m_vmap = 0; + m_count = 0; + m_invVMap = 0; + m_invTMap = 0; + m_nonConqueredTriangles = 0; + m_nonConqueredEdges = 0; + m_visitedVertices = 0; + m_visitedVerticesValence = 0; + m_vertexCount = 0; + m_triangleCount = 0; + m_maxNumVertices = 0; + m_maxNumTriangles = 0; + m_numTriangles = 0; + m_numVertices = 0; + m_triangles = 0; + m_maxSizeVertexToTriangle = 0; + m_streamType = O3DGC_STREAM_TYPE_UNKOWN; + } + template + TriangleListEncoder::~TriangleListEncoder() + { + delete [] m_vtags; + delete [] m_vmap; + delete [] m_invVMap; + delete [] m_invTMap; + delete [] m_visitedVerticesValence; + delete [] m_visitedVertices; + delete [] m_ttags; + delete [] m_tmap; + delete [] m_count; + delete [] m_nonConqueredTriangles; + delete [] m_nonConqueredEdges; + } + template + O3DGCErrorCode TriangleListEncoder::Init(const T * const triangles, + long numTriangles, + long numVertices) + { + assert(numVertices > 0); + assert(numTriangles > 0); + + m_numTriangles = numTriangles; + m_numVertices = numVertices; + m_triangles = triangles; + m_vertexCount = 0; + m_triangleCount = 0; + + if (m_numVertices > m_maxNumVertices) + { + delete [] m_vtags; + delete [] m_vmap; + delete [] m_invVMap; + delete [] m_visitedVerticesValence; + delete [] m_visitedVertices; + m_maxNumVertices = m_numVertices; + m_vtags = new long [m_numVertices]; + m_vmap = new long [m_numVertices]; + m_invVMap = new long [m_numVertices]; + m_visitedVerticesValence = new long [m_numVertices]; + m_visitedVertices = new long [m_numVertices]; + } + + if (m_numTriangles > m_maxNumTriangles) + { + delete [] m_ttags; + delete [] m_tmap; + delete [] m_invTMap; + delete [] m_nonConqueredTriangles; + delete [] m_nonConqueredEdges; + delete [] m_count; + m_maxNumTriangles = m_numTriangles; + m_ttags = new long [m_numTriangles]; + m_tmap = new long [m_numTriangles]; + m_invTMap = new long [m_numTriangles]; + m_count = new long [m_numTriangles+1]; + m_nonConqueredTriangles = new long [m_numTriangles]; + m_nonConqueredEdges = new long [2*m_numTriangles]; + } + + memset(m_vtags , 0x00, sizeof(long) * m_numVertices ); + memset(m_vmap , 0xFF, sizeof(long) * m_numVertices ); + memset(m_invVMap, 0xFF, sizeof(long) * m_numVertices ); + memset(m_ttags , 0x00, sizeof(long) * m_numTriangles); + memset(m_tmap , 0xFF, sizeof(long) * m_numTriangles); + memset(m_invTMap, 0xFF, sizeof(long) * m_numTriangles); + memset(m_count , 0x00, sizeof(long) * (m_numTriangles+1)); + + m_vfifo.Allocate(m_numVertices); + m_ctfans.SetStreamType(m_streamType); + m_ctfans.Allocate(m_numVertices, m_numTriangles); + + // compute vertex-to-triangle adjacency information + m_vertexToTriangle.AllocateNumNeighborsArray(numVertices); + m_vertexToTriangle.ClearNumNeighborsArray(); + long * numNeighbors = m_vertexToTriangle.GetNumNeighborsBuffer(); + for(long i = 0, t = 0; i < m_numTriangles; ++i, t+=3) + { + ++numNeighbors[ triangles[t ] ]; + ++numNeighbors[ triangles[t+1] ]; + ++numNeighbors[ triangles[t+2] ]; + } + m_maxSizeVertexToTriangle = 0; + for(long i = 0; i < numVertices; ++i) + { + if (m_maxSizeVertexToTriangle < numNeighbors[i]) + { + m_maxSizeVertexToTriangle = numNeighbors[i]; + } + } + m_vertexToTriangle.AllocateNeighborsArray(); + m_vertexToTriangle.ClearNeighborsArray(); + for(long i = 0, t = 0; i < m_numTriangles; ++i, t+=3) + { + m_vertexToTriangle.AddNeighbor(triangles[t ], i); + m_vertexToTriangle.AddNeighbor(triangles[t+1], i); + m_vertexToTriangle.AddNeighbor(triangles[t+2], i); + } + return O3DGC_OK; + } + template + O3DGCErrorCode TriangleListEncoder::Encode(const T * const triangles, + const unsigned long * const indexBufferIDs, + const long numTriangles, + const long numVertices, + BinaryStream & bstream) + { + assert(numVertices > 0); + assert(numTriangles > 0); + + Init(triangles, numTriangles, numVertices); + unsigned char mask = 0; + bool encodeTrianglesOrder = (indexBufferIDs != 0); + + + if (encodeTrianglesOrder) + { + long numBufferIDs = 0; + for (long t = 0; t < numTriangles; t++) + { + if (numBufferIDs <= (long) indexBufferIDs[t]) + { + ++numBufferIDs; + assert(numBufferIDs <= numTriangles); + } + ++m_count[indexBufferIDs[t]+1]; + } + for (long i = 2; i <= numBufferIDs; i++) + { + m_count[i] += m_count[i-1]; + } + mask += 2; // preserved triangles order + } + bstream.WriteUChar(mask, m_streamType); + bstream.WriteUInt32(m_maxSizeVertexToTriangle, m_streamType); + + long v0; + for (long v = 0; v < m_numVertices; v++) + { + if (!m_vtags[v]) + { + m_vfifo.PushBack(v); + m_vtags[v] = 1; + m_vmap[v] = m_vertexCount++; + m_invVMap[m_vmap[v]] = v; + while (m_vfifo.GetSize() > 0 ) + { + v0 = m_vfifo.PopFirst(); + ProcessVertex(v0); + } + } + } + if (encodeTrianglesOrder) + { + long t, prev = 0; + long pred; + for (long i = 0; i < numTriangles; ++i) + { + t = m_invTMap[i]; + m_tmap[t] = m_count[ indexBufferIDs[t] ]++; + pred = m_tmap[t] - prev; + m_ctfans.PushTriangleIndex(pred); + prev = m_tmap[t] + 1; + } + for (long t = 0; t < numTriangles; ++t) + { + m_invTMap[m_tmap[t]] = t; + } + } + m_ctfans.Save(bstream, encodeTrianglesOrder, m_streamType); + return O3DGC_OK; + } + template + O3DGCErrorCode TriangleListEncoder::CompueLocalConnectivityInfo(const long focusVertex) + { + long t, v, p; + m_numNonConqueredTriangles = 0; + m_numConqueredTriangles = 0; + m_numVisitedVertices = 0; + for(long i = m_vertexToTriangle.Begin(focusVertex); i < m_vertexToTriangle.End(focusVertex); ++i) + { + t = m_vertexToTriangle.GetNeighbor(i); + + if ( m_ttags[t] == 0) // non-processed triangle + { + m_nonConqueredTriangles[m_numNonConqueredTriangles] = t; + CompueOppositeEdge( focusVertex, + m_triangles + (3*t), + m_nonConqueredEdges[m_numNonConqueredTriangles*2], + m_nonConqueredEdges[m_numNonConqueredTriangles*2+1]); + ++m_numNonConqueredTriangles; + } + else // triangle already processed + { + m_numConqueredTriangles++; + p = 3*t; + // extract visited vertices + for(long k = 0; k < 3; ++k) + { + v = m_triangles[p+k]; + if (m_vmap[v] > m_vmap[focusVertex]) // vertices are insertices by increasing traversal order + { + bool foundOrInserted = false; + for (long j = 0; j < m_numVisitedVertices; ++j) + { + + if (m_vmap[v] == m_visitedVertices[j]) + { + m_visitedVerticesValence[j]++; + foundOrInserted = true; + break; + } + else if (m_vmap[v] < m_visitedVertices[j]) + { + ++m_numVisitedVertices; + for (long h = m_numVisitedVertices-1; h > j; --h) + { + m_visitedVertices[h] = m_visitedVertices[h-1]; + m_visitedVerticesValence[h] = m_visitedVerticesValence[h-1]; + } + m_visitedVertices[j] = m_vmap[v]; + m_visitedVerticesValence[j] = 1; + foundOrInserted = true; + break; + } + } + if (!foundOrInserted) + { + m_visitedVertices[m_numVisitedVertices] = m_vmap[v]; + m_visitedVerticesValence[m_numVisitedVertices] = 1; + m_numVisitedVertices++; + } + } + } + } + } + // re-order visited vertices by taking into account their valence (i.e., # of conquered triangles incident to each vertex) + // in order to avoid config. 9 + if (m_numVisitedVertices > 2) + { + long y; + for(long x = 1; x < m_numVisitedVertices; ++x) + { + + if (m_visitedVerticesValence[x] == 1) + { + y = x; + while( (y > 0) && (m_visitedVerticesValence[y] < m_visitedVerticesValence[y-1]) ) + { + swap(m_visitedVerticesValence[y], m_visitedVerticesValence[y-1]); + swap(m_visitedVertices[y], m_visitedVertices[y-1]); + --y; + } + } + } + } + if (m_numNonConqueredTriangles > 0) + { + // compute triangle-to-triangle adjacency information + m_triangleToTriangle.AllocateNumNeighborsArray(m_numNonConqueredTriangles); + m_triangleToTriangle.ClearNumNeighborsArray(); + m_triangleToTriangleInv.AllocateNumNeighborsArray(m_numNonConqueredTriangles); + m_triangleToTriangleInv.ClearNumNeighborsArray(); + long * const numNeighbors = m_triangleToTriangle.GetNumNeighborsBuffer(); + long * const invNumNeighbors = m_triangleToTriangleInv.GetNumNeighborsBuffer(); + for(long i = 0; i < m_numNonConqueredTriangles; ++i) + { + for(long j = i+1; j < m_numNonConqueredTriangles; ++j) + { + if (m_nonConqueredEdges[2*i+1] == m_nonConqueredEdges[2*j]) // edge i is connected to edge j + { + ++numNeighbors[i]; + ++invNumNeighbors[j]; + } + if (m_nonConqueredEdges[2*i] == m_nonConqueredEdges[2*j+1]) // edge i is connected to edge j + { + ++numNeighbors[j]; + ++invNumNeighbors[i]; + } + } + } + m_triangleToTriangle.AllocateNeighborsArray(); + m_triangleToTriangle.ClearNeighborsArray(); + m_triangleToTriangleInv.AllocateNeighborsArray(); + m_triangleToTriangleInv.ClearNeighborsArray(); + for(long i = 0; i < m_numNonConqueredTriangles; ++i) + { + for(long j = 1; j < m_numNonConqueredTriangles; ++j) + { + if (m_nonConqueredEdges[2*i+1] == m_nonConqueredEdges[2*j]) // edge i is connected to edge j + { + m_triangleToTriangle.AddNeighbor(i, j); + m_triangleToTriangleInv.AddNeighbor(j, i); + } + if (m_nonConqueredEdges[2*i] == m_nonConqueredEdges[2*j+1]) // edge i is connected to edge j + { + m_triangleToTriangle.AddNeighbor(j, i); + m_triangleToTriangleInv.AddNeighbor(i, j); + } + } + } + } + return O3DGC_OK; + } + template + O3DGCErrorCode TriangleListEncoder::ComputeTFANDecomposition(const long focusVertex) + { + long processedTriangles = 0; + long minNumInputEdges; + long numInputEdges; + long indexSeedTriangle; + long seedTriangle; + long currentIndex; + long currentTriangle; + long i0, i1, index; + + m_tfans.Clear(); + while (processedTriangles != m_numNonConqueredTriangles) + { + // find non processed triangle with lowest number of inputs + minNumInputEdges = m_numTriangles; + indexSeedTriangle = -1; + for(long i = 0; i < m_numNonConqueredTriangles; ++i) + { + numInputEdges = m_triangleToTriangleInv.GetNumNeighbors(i); + if ( !m_ttags[m_nonConqueredTriangles[i]] && + numInputEdges < minNumInputEdges ) + { + minNumInputEdges = numInputEdges; + indexSeedTriangle = i; + if (minNumInputEdges == 0) // found boundary triangle + { + break; + } + } + } + assert(indexSeedTriangle >= 0); + seedTriangle = m_nonConqueredTriangles[indexSeedTriangle]; + m_tfans.AddTFAN(); + m_tfans.AddVertex( focusVertex ); + m_tfans.AddVertex( m_nonConqueredEdges[indexSeedTriangle*2] ); + m_tfans.AddVertex( m_nonConqueredEdges[indexSeedTriangle*2 + 1] ); + m_ttags[ seedTriangle ] = 1; // mark triangle as processed + m_tmap[seedTriangle] = m_triangleCount++; + m_invTMap[m_tmap[seedTriangle]] = seedTriangle; + ++processedTriangles; + currentIndex = indexSeedTriangle; + currentTriangle = seedTriangle; + do + { + // find next triangle + i0 = m_triangleToTriangle.Begin(currentIndex); + i1 = m_triangleToTriangle.End(currentIndex); + currentIndex = -1; + for(long i = i0; i < i1; ++i) + { + index = m_triangleToTriangle.GetNeighbor(i); + currentTriangle = m_nonConqueredTriangles[index]; + if ( !m_ttags[currentTriangle] ) + { + currentIndex = index; + m_tfans.AddVertex( m_nonConqueredEdges[currentIndex*2+1] ); + m_ttags[currentTriangle] = 1; // mark triangle as processed + m_tmap [currentTriangle] = m_triangleCount++; + m_invTMap[m_tmap [currentTriangle]] = currentTriangle; + ++processedTriangles; + break; + } + } + } while (currentIndex != -1); + } + + return O3DGC_OK; + } + template + O3DGCErrorCode TriangleListEncoder::CompressTFAN(const long focusVertex) + { + m_ctfans.PushNumTFans(m_tfans.GetNumTFANs()); + + const long ntfans = m_tfans.GetNumTFANs(); + long degree; + long k0, k1; + long v0; + long ops[O3DGC_MAX_TFAN_SIZE]; + long indices[O3DGC_MAX_TFAN_SIZE]; + + long numOps; + long numIndices; + long pos; + long found; + + if (m_tfans.GetNumTFANs() > 0) + { + for(long f = 0; f != ntfans; f++) + { + degree = m_tfans.GetTFANSize(f) - 1; + m_ctfans.PushDegree(degree-2+ m_numConqueredTriangles); + numOps = 0; + numIndices = 0; + k0 = 1 + m_tfans.Begin(f); + k1 = m_tfans.End(f); + for(long k = k0; k < k1; k++) + { + v0 = m_tfans.GetVertex(k); + if (m_vtags[v0] == 0) + { + ops[numOps++] = 0; + m_vtags[v0] = 1; + m_vmap[v0] = m_vertexCount++; + m_invVMap[m_vmap[v0]] = v0; + m_vfifo.PushBack(v0); + m_visitedVertices[m_numVisitedVertices++] = m_vmap[v0]; + } + else + { + ops[numOps++] = 1; + pos = 0; + found = 0; + for(long u=0; u < m_numVisitedVertices; ++u) + { + pos++; + if (m_visitedVertices[u] == m_vmap[v0]) + { + found = 1; + break; + } + } + if (found == 1) + { + indices[numIndices++] = -pos; + } + else + { + indices[numIndices++] = m_vmap[v0] - m_vmap[focusVertex]; + } + } + } + //----------------------------------------------- + if (IsCase0(degree, numIndices, ops, indices)) + { + // ops: 1000001 vertices: -1 -2 + m_ctfans.PushConfig(0); + } + else if (IsCase1(degree, numIndices, ops, indices)) + { + // ops: 1xxxxxx1 vertices: -1 x x x x x -2 + long u = 1; + for(u = 1; u < degree-1; u++) + { + m_ctfans.PushOperation(ops[u]); + } + for(u =1; u < numIndices-1; u++) + { + m_ctfans.PushIndex(indices[u]); + } + m_ctfans.PushConfig(1); + } + else if (IsCase2(degree, numIndices, ops, indices)) + { + // ops: 00000001 vertices: -1 + m_ctfans.PushConfig(2); + } + else if (IsCase3(degree, numIndices, ops, indices)) + { + // ops: 00000001 vertices: -2 + m_ctfans.PushConfig(3); + } + else if (IsCase4(degree, numIndices, ops, indices)) + { + // ops: 10000000 vertices: -1 + m_ctfans.PushConfig(4); + } + else if (IsCase5(degree, numIndices, ops, indices)) + { + // ops: 10000000 vertices: -2 + m_ctfans.PushConfig(5); + } + else if (IsCase6(degree, numIndices, ops, indices)) + { + // ops: 00000000 vertices: + m_ctfans.PushConfig(6); + } + else if (IsCase7(degree, numIndices, ops, indices)) + { + // ops: 1000001 vertices: -1 -2 + m_ctfans.PushConfig(7); + } + else if (IsCase8(degree, numIndices, ops, indices)) + { + // ops: 1xxxxxx1 vertices: -2 x x x x x -1 + long u = 1; + for(u =1; u < degree-1; u++) + { + m_ctfans.PushOperation(ops[u]); + } + for(u =1; u < numIndices-1; u++) + { + m_ctfans.PushIndex(indices[u]); + } + m_ctfans.PushConfig(8); + } + else + { + long u = 0; + for(u =0; u < degree; u++) + { + m_ctfans.PushOperation(ops[u]); + } + for(u =0; u < numIndices; u++) + { + m_ctfans.PushIndex(indices[u]); + } + m_ctfans.PushConfig(9); + } + } + } + return O3DGC_OK; + } + template + O3DGCErrorCode TriangleListEncoder::ProcessVertex(const long focusVertex) + { + CompueLocalConnectivityInfo(focusVertex); + ComputeTFANDecomposition(focusVertex); + CompressTFAN(focusVertex); + return O3DGC_OK; + } +} +#endif //O3DGC_TRIANGLE_LIST_ENCODER_INL diff --git a/contrib/Open3DGC/o3dgcVector.h b/contrib/Open3DGC/o3dgcVector.h new file mode 100644 index 000000000..e766e2b7f --- /dev/null +++ b/contrib/Open3DGC/o3dgcVector.h @@ -0,0 +1,184 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + +#pragma once +#ifndef O3DGC_VECTOR_H +#define O3DGC_VECTOR_H + +#include "o3dgcCommon.h" + +namespace o3dgc +{ + const unsigned long O3DGC_DEFAULT_VECTOR_SIZE = 32; + + //! + template < typename T > class Vector + { + public: + //! Constructor. + Vector() + { + m_allocated = 0; + m_size = 0; + m_buffer = 0; + }; + //! Destructor. + ~Vector(void) + { + delete [] m_buffer; + }; + T & operator[](unsigned long i) + { + return m_buffer[i]; + } + const T & operator[](unsigned long i) const + { + return m_buffer[i]; + } + void Allocate(unsigned long size) + { + if (size > m_allocated) + { + m_allocated = size; + T * tmp = new T [m_allocated]; + if (m_size > 0) + { + memcpy(tmp, m_buffer, m_size * sizeof(T) ); + delete [] m_buffer; + } + m_buffer = tmp; + } + }; + void PushBack(const T & value) + { + if (m_size == m_allocated) + { + m_allocated *= 2; + if (m_allocated < O3DGC_DEFAULT_VECTOR_SIZE) + { + m_allocated = O3DGC_DEFAULT_VECTOR_SIZE; + } + T * tmp = new T [m_allocated]; + if (m_size > 0) + { + memcpy(tmp, m_buffer, m_size * sizeof(T) ); + delete [] m_buffer; + } + m_buffer = tmp; + } + assert(m_size < m_allocated); + m_buffer[m_size++] = value; + } + const T * const GetBuffer() const { return m_buffer;}; + T * const GetBuffer() { return m_buffer;}; + unsigned long GetSize() const { return m_size;}; + void SetSize(unsigned long size) + { + assert(size <= m_allocated); + m_size = size; + }; + unsigned long GetAllocatedSize() const { return m_allocated;}; + void Clear(){ m_size = 0;}; + + private: + T * m_buffer; + unsigned long m_allocated; + unsigned long m_size; + }; + + + + + //! Vector dim 3. + template < typename T > class Vec3 + { + public: + T & operator[](unsigned long i) { return m_data[i];} + const T & operator[](unsigned long i) const { return m_data[i];} + T & X(); + T & Y(); + T & Z(); + const T & X() const; + const T & Y() const; + const T & Z() const; + double GetNorm() const; + void operator= (const Vec3 & rhs); + void operator+=(const Vec3 & rhs); + void operator-=(const Vec3 & rhs); + void operator-=(T a); + void operator+=(T a); + void operator/=(T a); + void operator*=(T a); + Vec3 operator^ (const Vec3 & rhs) const; + T operator* (const Vec3 & rhs) const; + Vec3 operator+ (const Vec3 & rhs) const; + Vec3 operator- (const Vec3 & rhs) const; + Vec3 operator- () const; + Vec3 operator* (T rhs) const; + Vec3 operator/ (T rhs) const; + Vec3(); + Vec3(T a); + Vec3(T x, T y, T z); + Vec3(const Vec3 & rhs); + ~Vec3(void); + + private: + T m_data[3]; + }; + //! Vector dim 2. + template < typename T > class Vec2 + { + public: + T & operator[](unsigned long i) { return m_data[i];} + const T & operator[](unsigned long i) const { return m_data[i];} + T & X(); + T & Y(); + const T & X() const; + const T & Y() const; + double GetNorm() const; + void operator= (const Vec2 & rhs); + void operator+=(const Vec2 & rhs); + void operator-=(const Vec2 & rhs); + void operator-=(T a); + void operator+=(T a); + void operator/=(T a); + void operator*=(T a); + T operator^ (const Vec2 & rhs) const; + T operator* (const Vec2 & rhs) const; + Vec2 operator+ (const Vec2 & rhs) const; + Vec2 operator- (const Vec2 & rhs) const; + Vec2 operator- () const; + Vec2 operator* (T rhs) const; + Vec2 operator/ (T rhs) const; + Vec2(); + Vec2(T a); + Vec2(T x, T y); + Vec2(const Vec2 & rhs); + ~Vec2(void); + + private: + T m_data[2]; + }; +} +#include "o3dgcVector.inl" // template implementation +#endif // O3DGC_VECTOR_H + diff --git a/contrib/Open3DGC/o3dgcVector.inl b/contrib/Open3DGC/o3dgcVector.inl new file mode 100644 index 000000000..5549b00ce --- /dev/null +++ b/contrib/Open3DGC/o3dgcVector.inl @@ -0,0 +1,317 @@ +/* +Copyright (c) 2013 Khaled Mammou - Advanced Micro Devices, Inc. + +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. +*/ + +#pragma once +#ifndef O3DGC_VECTOR_INL +#define O3DGC_VECTOR_INL +namespace o3dgc +{ + template + inline Vec3 operator*(T lhs, const Vec3 & rhs) + { + return Vec3(lhs * rhs.X(), lhs * rhs.Y(), lhs * rhs.Z()); + } + template + inline T & Vec3::X() + { + return m_data[0]; + } + template + inline T & Vec3::Y() + { + return m_data[1]; + } + template + inline T & Vec3::Z() + { + return m_data[2]; + } + template + inline const T & Vec3::X() const + { + return m_data[0]; + } + template + inline const T & Vec3::Y() const + { + return m_data[1]; + } + template + inline const T & Vec3::Z() const + { + return m_data[2]; + } + template + inline double Vec3::GetNorm() const + { + double a = (double) (m_data[0]); + double b = (double) (m_data[1]); + double c = (double) (m_data[2]); + return sqrt(a*a+b*b+c*c); + } + template + inline void Vec3::operator= (const Vec3 & rhs) + { + this->m_data[0] = rhs.m_data[0]; + this->m_data[1] = rhs.m_data[1]; + this->m_data[2] = rhs.m_data[2]; + } + template + inline void Vec3::operator+=(const Vec3 & rhs) + { + this->m_data[0] += rhs.m_data[0]; + this->m_data[1] += rhs.m_data[1]; + this->m_data[2] += rhs.m_data[2]; + } + template + inline void Vec3::operator-=(const Vec3 & rhs) + { + this->m_data[0] -= rhs.m_data[0]; + this->m_data[1] -= rhs.m_data[1]; + this->m_data[2] -= rhs.m_data[2]; + } + template + inline void Vec3::operator-=(T a) + { + this->m_data[0] -= a; + this->m_data[1] -= a; + this->m_data[2] -= a; + } + template + inline void Vec3::operator+=(T a) + { + this->m_data[0] += a; + this->m_data[1] += a; + this->m_data[2] += a; + } + template + inline void Vec3::operator/=(T a) + { + this->m_data[0] /= a; + this->m_data[1] /= a; + this->m_data[2] /= a; + } + template + inline void Vec3::operator*=(T a) + { + this->m_data[0] *= a; + this->m_data[1] *= a; + this->m_data[2] *= a; + } + template + inline Vec3 Vec3::operator^ (const Vec3 & rhs) const + { + return Vec3(m_data[1] * rhs.m_data[2] - m_data[2] * rhs.m_data[1], + m_data[2] * rhs.m_data[0] - m_data[0] * rhs.m_data[2], + m_data[0] * rhs.m_data[1] - m_data[1] * rhs.m_data[0]); + } + template + inline T Vec3::operator*(const Vec3 & rhs) const + { + return (m_data[0] * rhs.m_data[0] + m_data[1] * rhs.m_data[1] + m_data[2] * rhs.m_data[2]); + } + template + inline Vec3 Vec3::operator+(const Vec3 & rhs) const + { + return Vec3(m_data[0] + rhs.m_data[0],m_data[1] + rhs.m_data[1],m_data[2] + rhs.m_data[2]); + } + template + inline Vec3 Vec3::operator-(const Vec3 & rhs) const + { + return Vec3(m_data[0] - rhs.m_data[0],m_data[1] - rhs.m_data[1],m_data[2] - rhs.m_data[2]); + } + template + inline Vec3 Vec3::operator-() const + { + return Vec3(-m_data[0],-m_data[1],-m_data[2]); + } + + template + inline Vec3 Vec3::operator*(T rhs) const + { + return Vec3(rhs * this->m_data[0], rhs * this->m_data[1], rhs * this->m_data[2]); + } + template + inline Vec3 Vec3::operator/ (T rhs) const + { + return Vec3(m_data[0] / rhs, m_data[1] / rhs, m_data[2] / rhs); + } + template + inline Vec3::Vec3(T a) + { + m_data[0] = m_data[1] = m_data[2] = a; + } + template + inline Vec3::Vec3(T x, T y, T z) + { + m_data[0] = x; + m_data[1] = y; + m_data[2] = z; + } + template + inline Vec3::Vec3(const Vec3 & rhs) + { + m_data[0] = rhs.m_data[0]; + m_data[1] = rhs.m_data[1]; + m_data[2] = rhs.m_data[2]; + } + template + inline Vec3::~Vec3(void){}; + + template + inline Vec3::Vec3() {} + + template + inline Vec2 operator*(T lhs, const Vec2 & rhs) + { + return Vec2(lhs * rhs.X(), lhs * rhs.Y()); + } + template + inline T & Vec2::X() + { + return m_data[0]; + } + template + inline T & Vec2::Y() + { + return m_data[1]; + } + template + inline const T & Vec2::X() const + { + return m_data[0]; + } + template + inline const T & Vec2::Y() const + { + return m_data[1]; + } + template + inline double Vec2::GetNorm() const + { + double a = (double) (m_data[0]); + double b = (double) (m_data[1]); + return sqrt(a*a+b*b); + } + template + inline void Vec2::operator= (const Vec2 & rhs) + { + this->m_data[0] = rhs.m_data[0]; + this->m_data[1] = rhs.m_data[1]; + } + template + inline void Vec2::operator+=(const Vec2 & rhs) + { + this->m_data[0] += rhs.m_data[0]; + this->m_data[1] += rhs.m_data[1]; + } + template + inline void Vec2::operator-=(const Vec2 & rhs) + { + this->m_data[0] -= rhs.m_data[0]; + this->m_data[1] -= rhs.m_data[1]; + } + template + inline void Vec2::operator-=(T a) + { + this->m_data[0] -= a; + this->m_data[1] -= a; + } + template + inline void Vec2::operator+=(T a) + { + this->m_data[0] += a; + this->m_data[1] += a; + } + template + inline void Vec2::operator/=(T a) + { + this->m_data[0] /= a; + this->m_data[1] /= a; + } + template + inline void Vec2::operator*=(T a) + { + this->m_data[0] *= a; + this->m_data[1] *= a; + } + template + inline T Vec2::operator^ (const Vec2 & rhs) const + { + return m_data[0] * rhs.m_data[1] - m_data[1] * rhs.m_data[0]; + } + template + inline T Vec2::operator*(const Vec2 & rhs) const + { + return (m_data[0] * rhs.m_data[0] + m_data[1] * rhs.m_data[1]); + } + template + inline Vec2 Vec2::operator+(const Vec2 & rhs) const + { + return Vec2(m_data[0] + rhs.m_data[0],m_data[1] + rhs.m_data[1]); + } + template + inline Vec2 Vec2::operator-(const Vec2 & rhs) const + { + return Vec2(m_data[0] - rhs.m_data[0],m_data[1] - rhs.m_data[1]); + } + template + inline Vec2 Vec2::operator-() const + { + return Vec2(-m_data[0],-m_data[1]) ; + } + + template + inline Vec2 Vec2::operator*(T rhs) const + { + return Vec2(rhs * this->m_data[0], rhs * this->m_data[1]); + } + template + inline Vec2 Vec2::operator/ (T rhs) const + { + return Vec2(m_data[0] / rhs, m_data[1] / rhs); + } + template + inline Vec2::Vec2(T a) + { + m_data[0] = m_data[1] = a; + } + template + inline Vec2::Vec2(T x, T y) + { + m_data[0] = x; + m_data[1] = y; + } + template + inline Vec2::Vec2(const Vec2 & rhs) + { + m_data[0] = rhs.m_data[0]; + m_data[1] = rhs.m_data[1]; + } + template + inline Vec2::~Vec2(void){}; + + template + inline Vec2::Vec2() {} +} +#endif //O3DGC_VECTOR_INL + diff --git a/doc/architecture/Assimp_Arch_Import.class.violet.html b/doc/architecture/Assimp_Arch_Import.class.violet.html new file mode 100644 index 000000000..a7ed8c6ce --- /dev/null +++ b/doc/architecture/Assimp_Arch_Import.class.violet.html @@ -0,0 +1,656 @@ + + + + + + + + + This file was generated with Violet UML Editor 2.1.0. +   ( View Source / Download Violet ) +
+
+ +
+
+ embedded diagram image + + \ No newline at end of file diff --git a/doc/architecture/assimp.object.violet.html b/doc/architecture/assimp.object.violet.html new file mode 100644 index 000000000..1d82fa05f --- /dev/null +++ b/doc/architecture/assimp.object.violet.html @@ -0,0 +1,107 @@ + + + + + + + + + This file was generated with Violet UML Editor 2.1.0. +   ( View Source / Download Violet ) +
+
+ +
+
+ embedded diagram image + + \ No newline at end of file diff --git a/include/assimp/Compiler/pushpack1.h b/include/assimp/Compiler/pushpack1.h index 73973c50d..94ee1e474 100644 --- a/include/assimp/Compiler/pushpack1.h +++ b/include/assimp/Compiler/pushpack1.h @@ -36,11 +36,8 @@ #endif #if defined(_MSC_VER) - // C4103: Packing was changed after the inclusion of the header, probably missing #pragma pop # pragma warning (disable : 4103) #endif #define AI_PUSHPACK_IS_DEFINED - - diff --git a/include/assimp/IOSystem.hpp b/include/assimp/IOSystem.hpp index 9a5876edf..83d927453 100644 --- a/include/assimp/IOSystem.hpp +++ b/include/assimp/IOSystem.hpp @@ -67,7 +67,8 @@ class IOStream; * to the importer library. If you implement this interface, you also want to * supply a custom implementation for IOStream. * - * @see Importer::SetIOHandler() */ + * @see Importer::SetIOHandler() + */ class ASSIMP_API IOSystem #ifndef SWIG : public Intern::AllocateFromAssimpHeap diff --git a/include/assimp/anim.h b/include/assimp/anim.h index e2961a67c..6380b4650 100644 --- a/include/assimp/anim.h +++ b/include/assimp/anim.h @@ -255,7 +255,6 @@ struct aiNodeAnim * scaling and one position key. */ C_STRUCT aiQuatKey* mRotationKeys; - /** The number of scaling keys */ unsigned int mNumScalingKeys; @@ -266,7 +265,6 @@ struct aiNodeAnim * position and one rotation key.*/ C_STRUCT aiVectorKey* mScalingKeys; - /** Defines how the animation behaves before the first * key is encountered. * diff --git a/include/assimp/cfileio.h b/include/assimp/cfileio.h index f9f121207..5f46f7c4c 100644 --- a/include/assimp/cfileio.h +++ b/include/assimp/cfileio.h @@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_FILEIO_H_INC #define AI_FILEIO_H_INC -#include "types.h" +#include #ifdef __cplusplus extern "C" { #endif @@ -54,15 +54,15 @@ struct aiFileIO; struct aiFile; // aiFile callbacks -typedef size_t (*aiFileWriteProc) (C_STRUCT aiFile*, const char*, size_t, size_t); -typedef size_t (*aiFileReadProc) (C_STRUCT aiFile*, char*, size_t,size_t); -typedef size_t (*aiFileTellProc) (C_STRUCT aiFile*); -typedef void (*aiFileFlushProc) (C_STRUCT aiFile*); -typedef aiReturn (*aiFileSeek)(C_STRUCT aiFile*, size_t, aiOrigin); +typedef size_t (*aiFileWriteProc) (C_STRUCT aiFile*, const char*, size_t, size_t); +typedef size_t (*aiFileReadProc) (C_STRUCT aiFile*, char*, size_t,size_t); +typedef size_t (*aiFileTellProc) (C_STRUCT aiFile*); +typedef void (*aiFileFlushProc) (C_STRUCT aiFile*); +typedef C_ENUM aiReturn (*aiFileSeek) (C_STRUCT aiFile*, size_t, C_ENUM aiOrigin); // aiFileIO callbacks -typedef aiFile* (*aiFileOpenProc) (C_STRUCT aiFileIO*, const char*, const char*); -typedef void (*aiFileCloseProc) (C_STRUCT aiFileIO*, C_STRUCT aiFile*); +typedef C_STRUCT aiFile* (*aiFileOpenProc) (C_STRUCT aiFileIO*, const char*, const char*); +typedef void (*aiFileCloseProc) (C_STRUCT aiFileIO*, C_STRUCT aiFile*); // Represents user-defined data typedef char* aiUserData; diff --git a/include/assimp/cimport.h b/include/assimp/cimport.h index 231230ca8..6d3fa4aea 100644 --- a/include/assimp/cimport.h +++ b/include/assimp/cimport.h @@ -337,7 +337,7 @@ ASSIMP_API void aiReleaseImport( * import process. NULL if there was no error. There can't be an error if you * got a non-NULL #aiScene from #aiImportFile/#aiImportFileEx/#aiApplyPostProcessing. */ -ASSIMP_API const char* aiGetErrorString(); +ASSIMP_API const char* aiGetErrorString(void); // -------------------------------------------------------------------------------- /** Returns whether a given file extension is supported by ASSIMP diff --git a/include/assimp/material.h b/include/assimp/material.h index 1f97096b2..23a45878e 100644 --- a/include/assimp/material.h +++ b/include/assimp/material.h @@ -413,7 +413,7 @@ enum aiTextureFlags * SourceColor * SourceBlend + DestColor * DestBlend * @endcode * where DestColor is the previous color in the framebuffer at this - * position and SourceColor is the material colro before the transparency + * position and SourceColor is the material color before the transparency * calculation.
* This corresponds to the #AI_MATKEY_BLEND_FUNC property. */ diff --git a/include/assimp/matrix4x4.h b/include/assimp/matrix4x4.h index b32ac7376..3f7eb3adf 100644 --- a/include/assimp/matrix4x4.h +++ b/include/assimp/matrix4x4.h @@ -93,7 +93,15 @@ public: public: // array access operators + /** @fn TReal* operator[] (unsigned int p_iIndex) + * @param [in] p_iIndex - index of the row. + * @return pointer to pointed row. + */ TReal* operator[] (unsigned int p_iIndex); + + /** @fn const TReal* operator[] (unsigned int p_iIndex) const + * @overload TReal* operator[] (unsigned int p_iIndex) + */ const TReal* operator[] (unsigned int p_iIndex) const; // comparison operators @@ -140,6 +148,27 @@ public: void Decompose (aiVector3t& scaling, aiQuaterniont& rotation, aiVector3t& position) const; + // ------------------------------------------------------------------- + /** @fn void Decompose(aiVector3t& pScaling, aiVector3t& pRotation, aiVector3t& pPosition) const + * @brief Decompose a trafo matrix into its original components. + * Thx to good FAQ at http://www.gamedev.ru/code/articles/faq_matrix_quat + * @param [out] pScaling - Receives the output scaling for the x,y,z axes. + * @param [out] pRotation - Receives the output rotation as a Euler angles. + * @param [out] pPosition - Receives the output position for the x,y,z axes. + */ + void Decompose(aiVector3t& pScaling, aiVector3t& pRotation, aiVector3t& pPosition) const; + + // ------------------------------------------------------------------- + /** @fn void Decompose(aiVector3t& pScaling, aiVector3t& pRotationAxis, TReal& pRotationAngle, aiVector3t& pPosition) const + * @brief Decompose a trafo matrix into its original components + * Thx to good FAQ at http://www.gamedev.ru/code/articles/faq_matrix_quat + * @param [out] pScaling - Receives the output scaling for the x,y,z axes. + * @param [out] pRotationAxis - Receives the output rotation axis. + * @param [out] pRotationAngle - Receives the output rotation angle for @ref pRotationAxis. + * @param [out] pPosition - Receives the output position for the x,y,z axes. + */ + void Decompose(aiVector3t& pScaling, aiVector3t& pRotationAxis, TReal& pRotationAngle, aiVector3t& pPosition) const; + // ------------------------------------------------------------------- /** @brief Decompose a trafo matrix with no scaling into its * original components diff --git a/include/assimp/matrix4x4.inl b/include/assimp/matrix4x4.inl index 2ccd557d8..a7977cd2c 100644 --- a/include/assimp/matrix4x4.inl +++ b/include/assimp/matrix4x4.inl @@ -299,57 +299,126 @@ inline bool aiMatrix4x4t::Equal(const aiMatrix4x4t& m, TReal epsil } // ---------------------------------------------------------------------------------------- + +#define ASSIMP_MATRIX4_4_DECOMPOSE_PART \ + const aiMatrix4x4t& _this = *this;/* Create alias for conveniance. */ \ + \ + /* extract translation */ \ + pPosition.x = _this[0][3]; \ + pPosition.y = _this[1][3]; \ + pPosition.z = _this[2][3]; \ + \ + /* extract the columns of the matrix. */ \ + aiVector3t vCols[3] = { \ + aiVector3t(_this[0][0],_this[1][0],_this[2][0]), \ + aiVector3t(_this[0][1],_this[1][1],_this[2][1]), \ + aiVector3t(_this[0][2],_this[1][2],_this[2][2]) \ + }; \ + \ + /* extract the scaling factors */ \ + pScaling.x = vCols[0].Length(); \ + pScaling.y = vCols[1].Length(); \ + pScaling.z = vCols[2].Length(); \ + \ + /* and the sign of the scaling */ \ + if (Determinant() < 0) pScaling = -pScaling; \ + \ + /* and remove all scaling from the matrix */ \ + if(pScaling.x) vCols[0] /= pScaling.x; \ + if(pScaling.y) vCols[1] /= pScaling.y; \ + if(pScaling.z) vCols[2] /= pScaling.z; \ + \ + do {} while(false) + + + + template -inline void aiMatrix4x4t::Decompose (aiVector3t& scaling, aiQuaterniont& rotation, - aiVector3t& position) const +inline void aiMatrix4x4t::Decompose (aiVector3t& pScaling, aiQuaterniont& pRotation, + aiVector3t& pPosition) const { - const aiMatrix4x4t& _this = *this; - - // extract translation - position.x = _this[0][3]; - position.y = _this[1][3]; - position.z = _this[2][3]; - - // extract the rows of the matrix - aiVector3t vRows[3] = { - aiVector3t(_this[0][0],_this[1][0],_this[2][0]), - aiVector3t(_this[0][1],_this[1][1],_this[2][1]), - aiVector3t(_this[0][2],_this[1][2],_this[2][2]) - }; - - // extract the scaling factors - scaling.x = vRows[0].Length(); - scaling.y = vRows[1].Length(); - scaling.z = vRows[2].Length(); - - // and the sign of the scaling - if (Determinant() < 0) { - scaling.x = -scaling.x; - scaling.y = -scaling.y; - scaling.z = -scaling.z; - } - - // and remove all scaling from the matrix - if(scaling.x) - { - vRows[0] /= scaling.x; - } - if(scaling.y) - { - vRows[1] /= scaling.y; - } - if(scaling.z) - { - vRows[2] /= scaling.z; - } + ASSIMP_MATRIX4_4_DECOMPOSE_PART; // build a 3x3 rotation matrix - aiMatrix3x3t m(vRows[0].x,vRows[1].x,vRows[2].x, - vRows[0].y,vRows[1].y,vRows[2].y, - vRows[0].z,vRows[1].z,vRows[2].z); + aiMatrix3x3t m(vCols[0].x,vCols[1].x,vCols[2].x, + vCols[0].y,vCols[1].y,vCols[2].y, + vCols[0].z,vCols[1].z,vCols[2].z); // and generate the rotation quaternion from it - rotation = aiQuaterniont(m); + pRotation = aiQuaterniont(m); +} + +template +inline void aiMatrix4x4t::Decompose(aiVector3t& pScaling, aiVector3t& pRotation, aiVector3t& pPosition) const +{ + ASSIMP_MATRIX4_4_DECOMPOSE_PART; + + /* + | CE -CF D 0 | + M = | BDE+AF -BDF+AE -BC 0 | + | -ADE+BF -ADF+BE AC 0 | + | 0 0 0 1 | + + A = cos(angle_x), B = sin(angle_x); + C = cos(angle_y), D = sin(angle_y); + E = cos(angle_z), F = sin(angle_z); + */ + + // Use a small epsilon to solve floating-point inaccuracies + const TReal epsilon = 10e-3f; + + pRotation.y = std::asin(vCols[2].x);// D. Angle around oY. + + TReal C = std::cos(pRotation.y); + + if(std::fabs(C) > epsilon) + { + // Finding angle around oX. + TReal tan_x = vCols[2].z / C;// A + TReal tan_y = -vCols[2].y / C;// B + + pRotation.x = std::atan2(tan_y, tan_x); + // Finding angle around oZ. + tan_x = vCols[0].x / C;// E + tan_y = -vCols[1].x / C;// F + pRotation.z = std::atan2(tan_y, tan_x); + } + else + {// oY is fixed. + pRotation.x = 0;// Set angle around oX to 0. => A == 1, B == 0, C == 0, D == 1. + + // And finding angle around oZ. + TReal tan_x = vCols[1].y;// -BDF+AE => E + TReal tan_y = vCols[0].y;// BDE+AF => F + + pRotation.z = std::atan2(tan_y, tan_x); + } +} + +#undef ASSIMP_MATRIX4_4_DECOMPOSE_PART + +template +inline void aiMatrix4x4t::Decompose(aiVector3t& pScaling, aiVector3t& pRotationAxis, TReal& pRotationAngle, + aiVector3t& pPosition) const +{ +aiQuaterniont pRotation; + + Decompose(pScaling, pRotation, pPosition); + pRotation.Normalize(); + + TReal angle_cos = pRotation.w; + TReal angle_sin = std::sqrt(1.0f - angle_cos * angle_cos); + + pRotationAngle = std::acos(angle_cos) * 2; + + // Use a small epsilon to solve floating-point inaccuracies + const TReal epsilon = 10e-3f; + + if(std::fabs(angle_sin) < epsilon) angle_sin = 1; + + pRotationAxis.x = pRotation.x / angle_sin; + pRotationAxis.y = pRotation.y / angle_sin; + pRotationAxis.z = pRotation.z / angle_sin; } // ---------------------------------------------------------------------------------------- diff --git a/include/assimp/metadata.h b/include/assimp/metadata.h index 258bf329c..da9d4578e 100644 --- a/include/assimp/metadata.h +++ b/include/assimp/metadata.h @@ -64,12 +64,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ------------------------------------------------------------------------------- typedef enum aiMetadataType { - AI_BOOL = 0, - AI_INT = 1, - AI_UINT64 = 2, - AI_FLOAT = 3, - AI_DOUBLE = 4, - AI_AISTRING = 5, + AI_BOOL = 0, + AI_INT32 = 1, + AI_UINT64 = 2, + AI_FLOAT = 3, + AI_DOUBLE = 4, + AI_AISTRING = 5, AI_AIVECTOR3D = 6, #ifndef SWIG @@ -92,32 +92,24 @@ struct aiMetadataEntry void* mData; }; - - #ifdef __cplusplus #include - - // ------------------------------------------------------------------------------- /** * Helper functions to get the aiType enum entry for a type */ // ------------------------------------------------------------------------------- inline aiMetadataType GetAiType( bool ) { return AI_BOOL; } -inline aiMetadataType GetAiType( int ) { return AI_INT; } +inline aiMetadataType GetAiType( int32_t ) { return AI_INT32; } inline aiMetadataType GetAiType( uint64_t ) { return AI_UINT64; } inline aiMetadataType GetAiType( float ) { return AI_FLOAT; } inline aiMetadataType GetAiType( double ) { return AI_DOUBLE; } inline aiMetadataType GetAiType( aiString ) { return AI_AISTRING; } inline aiMetadataType GetAiType( aiVector3D ) { return AI_AIVECTOR3D; } - - -#endif - - +#endif // __cplusplus // ------------------------------------------------------------------------------- /** @@ -165,8 +157,8 @@ struct aiMetadata case AI_BOOL: delete static_cast(data); break; - case AI_INT: - delete static_cast(data); + case AI_INT32: + delete static_cast(data); break; case AI_UINT64: delete static_cast(data); @@ -248,6 +240,22 @@ struct aiMetadata return Get(aiString(key), value); } + /// \fn inline bool Get(size_t pIndex, const aiString*& pKey, const aiMetadataEntry*& pEntry) + /// Return metadata entry for analyzing it by user. + /// \param [in] pIndex - index of the entry. + /// \param [out] pKey - pointer to the key value. + /// \param [out] pEntry - pointer to the entry: type and value. + /// \return false - if pIndex is out of range, else - true. + inline bool Get(size_t pIndex, const aiString*& pKey, const aiMetadataEntry*& pEntry) + { + if(pIndex >= mNumProperties) return false; + + pKey = &mKeys[pIndex]; + pEntry = &mValues[pIndex]; + + return true; + } + #endif // __cplusplus }; diff --git a/include/assimp/scene.h b/include/assimp/scene.h index 31bb8b6a1..d9799db99 100644 --- a/include/assimp/scene.h +++ b/include/assimp/scene.h @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- @@ -38,7 +38,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------- */ -#pragma once /** @file scene.h * @brief Defines the data structures in which the imported scene is returned. @@ -60,9 +59,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. extern "C" { #endif - // ------------------------------------------------------------------------------- -/** A node in the imported hierarchy. +/** + * A node in the imported hierarchy. * * Each node has name, a parent node (except for the root node), * a transformation relative to its parent and possibly several child nodes. @@ -266,6 +265,13 @@ struct aiNode */ #define AI_SCENE_FLAGS_TERRAIN 0x10 + /** + * Specifies that the scene data can be shared between structures. For example: + * one vertex in few faces. \ref AI_SCENE_FLAGS_NON_VERBOSE_FORMAT can not be + * used for this because \ref AI_SCENE_FLAGS_NON_VERBOSE_FORMAT has internal + * meaning about postprocessing steps. + */ +#define AI_SCENE_FLAGS_ALLOW_SHARED 0x20 // ------------------------------------------------------------------------------- /** The root structure of the imported data. @@ -278,7 +284,6 @@ struct aiNode // ------------------------------------------------------------------------------- struct aiScene { - /** Any combination of the AI_SCENE_FLAGS_XXX flags. By default * this value is 0, no flags are set. Most applications will * want to reject all scenes with the AI_SCENE_FLAGS_INCOMPLETE @@ -286,7 +291,6 @@ struct aiScene */ unsigned int mFlags; - /** The root node of the hierarchy. * * There will always be at least the root node if the import @@ -296,8 +300,6 @@ struct aiScene */ C_STRUCT aiNode* mRootNode; - - /** The number of meshes in the scene. */ unsigned int mNumMeshes; @@ -310,8 +312,6 @@ struct aiScene */ C_STRUCT aiMesh** mMeshes; - - /** The number of materials in the scene. */ unsigned int mNumMaterials; @@ -324,8 +324,6 @@ struct aiScene */ C_STRUCT aiMaterial** mMaterials; - - /** The number of animations in the scene. */ unsigned int mNumAnimations; @@ -336,8 +334,6 @@ struct aiScene */ C_STRUCT aiAnimation** mAnimations; - - /** The number of textures embedded into the file */ unsigned int mNumTextures; @@ -349,7 +345,6 @@ struct aiScene */ C_STRUCT aiTexture** mTextures; - /** The number of light sources in the scene. Light sources * are fully optional, in most cases this attribute will be 0 */ @@ -362,7 +357,6 @@ struct aiScene */ C_STRUCT aiLight** mLights; - /** The number of cameras in the scene. Cameras * are fully optional, in most cases this attribute will be 0 */ @@ -387,33 +381,38 @@ struct aiScene //! Check whether the scene contains meshes //! Unless no special scene flags are set this will always be true. - inline bool HasMeshes() const - { return mMeshes != NULL && mNumMeshes > 0; } + inline bool HasMeshes() const { + return mMeshes != NULL && mNumMeshes > 0; + } //! Check whether the scene contains materials //! Unless no special scene flags are set this will always be true. - inline bool HasMaterials() const - { return mMaterials != NULL && mNumMaterials > 0; } + inline bool HasMaterials() const { + return mMaterials != NULL && mNumMaterials > 0; + } //! Check whether the scene contains lights - inline bool HasLights() const - { return mLights != NULL && mNumLights > 0; } + inline bool HasLights() const { + return mLights != NULL && mNumLights > 0; + } //! Check whether the scene contains textures - inline bool HasTextures() const - { return mTextures != NULL && mNumTextures > 0; } + inline bool HasTextures() const { + return mTextures != NULL && mNumTextures > 0; + } //! Check whether the scene contains cameras - inline bool HasCameras() const - { return mCameras != NULL && mNumCameras > 0; } + inline bool HasCameras() const { + return mCameras != NULL && mNumCameras > 0; + } //! Check whether the scene contains animations - inline bool HasAnimations() const - { return mAnimations != NULL && mNumAnimations > 0; } + inline bool HasAnimations() const { + return mAnimations != NULL && mNumAnimations > 0; + } #endif // __cplusplus - /** Internal data, do not touch */ #ifdef __cplusplus void* mPrivate; diff --git a/include/assimp/texture.h b/include/assimp/texture.h index b0fe695d4..ab52c79a2 100644 --- a/include/assimp/texture.h +++ b/include/assimp/texture.h @@ -59,6 +59,14 @@ extern "C" { // -------------------------------------------------------------------------------- + +/** \def AI_EMBEDDED_TEXNAME_PREFIX + * \ref AI_MAKE_EMBEDDED_TEXNAME + */ +#ifndef AI_EMBEDDED_TEXNAME_PREFIX +# define AI_EMBEDDED_TEXNAME_PREFIX "*" +#endif + /** @def AI_MAKE_EMBEDDED_TEXNAME * Used to build the reserved path name used by the material system to * reference textures that are embedded into their corresponding @@ -66,7 +74,7 @@ extern "C" { * (zero-based, in the aiScene::mTextures array) */ #if (!defined AI_MAKE_EMBEDDED_TEXNAME) -# define AI_MAKE_EMBEDDED_TEXNAME(_n_) "*" # _n_ +# define AI_MAKE_EMBEDDED_TEXNAME(_n_) AI_EMBEDDED_TEXNAME_PREFIX # _n_ #endif @@ -139,10 +147,17 @@ struct aiTexture unsigned int mHeight; /** A hint from the loader to make it easier for applications - * to determine the type of embedded compressed textures. + * to determine the type of embedded textures. * - * If mHeight != 0 this member is undefined. Otherwise it - * is set set to '\\0\\0\\0\\0' if the loader has no additional + * If mHeight != 0 this member is show how data is packed. Hint will consist of + * two parts: channel order and channel bitness (count of the bits for every + * color channel). For simple parsing by the viewer it's better to not omit + * absent color channel and just use 0 for bitness. For example: + * 1. Image contain RGBA and 8 bit per channel, achFormatHint == "rgba8888"; + * 2. Image contain ARGB and 8 bit per channel, achFormatHint == "argb8888"; + * 3. Image contain RGB and 5 bit for R and B channels and 6 bit for G channel, achFormatHint == "rgba5650"; + * 4. One color image with B channel and 1 bit for it, achFormatHint == "rgba0010"; + * If mHeight == 0 then achFormatHint is set set to '\\0\\0\\0\\0' if the loader has no additional * information about the texture file format used OR the * file extension of the format without a trailing dot. If there * are multiple file extensions for a format, the shortest @@ -150,7 +165,7 @@ struct aiTexture * E.g. 'dds\\0', 'pcx\\0', 'jpg\\0'. All characters are lower-case. * The fourth character will always be '\\0'. */ - char achFormatHint[4]; + char achFormatHint[9];// 8 for string + 1 for terminator. /** Data of the texture. * @@ -172,7 +187,7 @@ struct aiTexture //! @return true if the given string matches the format hint bool CheckFormat(const char* s) const { - return (0 == ::strncmp(achFormatHint,s,3)); + return (0 == ::strncmp(achFormatHint, s, sizeof(achFormatHint))); } // Construction diff --git a/include/assimp/types.h b/include/assimp/types.h index 465638675..d28a93b52 100644 --- a/include/assimp/types.h +++ b/include/assimp/types.h @@ -48,7 +48,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Some runtime headers #include -#include #include #include #include @@ -177,11 +176,7 @@ struct aiColor3D /** Component-wise comparison */ // TODO: add epsilon? bool operator < (const aiColor3D& other) const { - return r < other.r || ( - r == other.r && (g < other.g || - (g == other.g && b < other.b) - ) - ); + return r < other.r || ( r == other.r && (g < other.g || (g == other.g && b < other.b ) ) ); } /** Component-wise addition */ @@ -211,7 +206,14 @@ struct aiColor3D /** Access a specific color component */ ai_real& operator[](unsigned int i) { - return *(&r + i); + if ( 0 == i ) { + return r; + } else if ( 1 == i ) { + return g; + } else if ( 2 == i ) { + return b; + } + return r; } /** Check whether a color is black */ @@ -224,7 +226,7 @@ struct aiColor3D //! Red, green and blue color values ai_real r, g, b; -} PACK_STRUCT; // !struct aiColor3D +} /*PACK_STRUCT*/; // !struct aiColor3D #include "./Compiler/poppack1.h" // ---------------------------------------------------------------------------------- diff --git a/include/assimp/vector3.h b/include/assimp/vector3.h index e3a3179f7..891beb28c 100644 --- a/include/assimp/vector3.h +++ b/include/assimp/vector3.h @@ -98,7 +98,6 @@ public: operator aiVector3t () const; public: - /** @brief Set the components of a vector * @param pX X component * @param pY Y component @@ -109,7 +108,6 @@ public: * @return Square length */ TReal SquareLength() const; - /** @brief Get the length of the vector * @return length */ TReal Length() const; diff --git a/packaging/windows-innosetup/script.iss b/packaging/windows-innosetup/script.iss index a4bc0bf78..d8e0d082a 100644 --- a/packaging/windows-innosetup/script.iss +++ b/packaging/windows-innosetup/script.iss @@ -2,7 +2,7 @@ [Setup] AppName=Open Asset Import Library - SDK -AppVerName=Open Asset Import Library - SDK (v2.0) +AppVerName=Open Asset Import Library - SDK (v3.3.1) DefaultDirName={pf}\Assimp DefaultGroupName=Assimp UninstallDisplayIcon={app}\bin\x86\assimp.exe @@ -12,9 +12,9 @@ SetupIconFile=..\..\tools\shared\assimp_tools_icon.ico WizardImageFile=compiler:WizModernImage-IS.BMP WizardSmallImageFile=compiler:WizModernSmallImage-IS.BMP LicenseFile=License.rtf -OutputBaseFileName=assimp-sdk-2.0-setup -VersionInfoVersion=2.0.0.0 -VersionInfoTextVersion=2.0 +OutputBaseFileName=assimp-sdk-3.3.1-setup +VersionInfoVersion=3.3.1.0 +VersionInfoTextVersion=3.3.1 VersionInfoCompany=Assimp Development Team ArchitecturesInstallIn64BitMode=x64 @@ -38,8 +38,8 @@ Name: "assimp_net"; Description: "C#/.NET Bindings"; Types: full ;Name: "vc9"; Description: "VC9 project files"; Types: full [Run] -Filename: "{app}\stub\vcredist_x86.exe"; Parameters: "/qb"; StatusMsg: "Installing VS2008 SP1 redistributable package (32 Bit)"; Check: not IsWin64 -Filename: "{app}\stub\vcredist_x64.exe"; Parameters: "/qb"; StatusMsg: "Installing VS2008 SP1 redistributable package (64 Bit)"; Check: IsWin64 +Filename: "{app}\stub\vcredist_x86.exe"; Parameters: "/qb"; StatusMsg: "Installing VS2012 SP1 redistributable package (32 Bit)"; Check: not IsWin64 +Filename: "{app}\stub\vcredist_x64.exe"; Parameters: "/qb"; StatusMsg: "Installing VS2012 SP1 redistributable package (64 Bit)"; Check: IsWin64 [Files] diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 10ff86460..e227e2124 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -55,7 +55,9 @@ SOURCE_GROUP( unit FILES ) SET( TEST_SRCS + unit/TestIOSystem.h unit/AssimpAPITest.cpp + unit/utBatchLoader.cpp unit/utBlenderIntermediate.cpp unit/utBlendImportAreaLight.cpp unit/utBlendImportMaterials.cpp @@ -70,12 +72,16 @@ SET( TEST_SRCS unit/utImporter.cpp unit/utImproveCacheLocality.cpp unit/utIOSystem.cpp + unit/utIOStreamBuffer.cpp unit/utIssues.cpp unit/utJoinVertices.cpp unit/utLimitBoneWeights.cpp unit/utMaterialSystem.cpp unit/utMatrix3x3.cpp unit/utMatrix4x4.cpp + unit/SceneDiffer.h + unit/SceneDiffer.cpp + unit/utObjImportExport.cpp unit/utPretransformVertices.cpp unit/utRemoveComments.cpp unit/utRemoveComponent.cpp @@ -88,6 +94,7 @@ SET( TEST_SRCS unit/utTargetAnimation.cpp unit/utTextureTransform.cpp unit/utTriangulate.cpp + unit/utTypes.cpp unit/utVertexTriangleAdjacency.cpp unit/utVersion.cpp ) @@ -96,7 +103,7 @@ SOURCE_GROUP( tests FILES ${TEST_SRCS} ) add_executable( unit ../contrib/gtest/src/gtest-all.cc - unit/CCompilerTest.c + unit/CCompilerTest.c unit/Main.cpp ../code/Version.cpp ${TEST_SRCS} @@ -115,3 +122,15 @@ ENDIF( WIN32 ) target_link_libraries( unit assimp ${platform_libs} ) add_subdirectory(headercheck) +#if (ASSIMP_COVERALLS) +# include(Coveralls) +# +# set(COVERAGE_SRCS ${assimp_src} ${TEST_SRCS} ) +# +# # Create the coveralls target. +# coveralls_setup( +# "${COVERAGE_SRCS}" # The source files. +# ON # If we should upload. +# "${PROJECT_SOURCE_DIR}/cmake-modules/") # (Optional) Alternate project cmake module path. +#endif() + diff --git a/test/models-nonbsd/AMF/3_bananas.amf.7z b/test/models-nonbsd/AMF/3_bananas.amf.7z new file mode 100644 index 000000000..c2b6785a3 Binary files /dev/null and b/test/models-nonbsd/AMF/3_bananas.amf.7z differ diff --git a/test/models-nonbsd/AMF/screenshot_3_bananas.jpeg b/test/models-nonbsd/AMF/screenshot_3_bananas.jpeg new file mode 100644 index 000000000..976fcb03b Binary files /dev/null and b/test/models-nonbsd/AMF/screenshot_3_bananas.jpeg differ diff --git a/test/models-nonbsd/X3D/Chevy/ChevyTahoe.x3d b/test/models-nonbsd/X3D/Chevy/ChevyTahoe.x3d new file mode 100644 index 000000000..61f23d580 --- /dev/null +++ b/test/models-nonbsd/X3D/Chevy/ChevyTahoe.x3d @@ -0,0 +1,367 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/models-nonbsd/X3D/Chevy/textures/ChevyTahoeTexture.jpg b/test/models-nonbsd/X3D/Chevy/textures/ChevyTahoeTexture.jpg new file mode 100644 index 000000000..830cfcdcd Binary files /dev/null and b/test/models-nonbsd/X3D/Chevy/textures/ChevyTahoeTexture.jpg differ diff --git a/test/models-nonbsd/X3D/Chevy/textures/ChevyTahoeTires.jpg b/test/models-nonbsd/X3D/Chevy/textures/ChevyTahoeTires.jpg new file mode 100644 index 000000000..8e55f28d1 Binary files /dev/null and b/test/models-nonbsd/X3D/Chevy/textures/ChevyTahoeTires.jpg differ diff --git a/test/models/AMF/README b/test/models/AMF/README new file mode 100644 index 000000000..a64a8508e --- /dev/null +++ b/test/models/AMF/README @@ -0,0 +1 @@ +Simple models for testing importer. No desription because models are simple and created by hands. diff --git a/test/models/AMF/test1.amf b/test/models/AMF/test1.amf new file mode 100644 index 000000000..88f4d7496 --- /dev/null +++ b/test/models/AMF/test1.amf @@ -0,0 +1,59 @@ + + + + + + + + -0.5 + -0.5 + 0 + + + + + -0.5 + 0.5 + 0 + + + + + 1 + 0 + 0 + + + + + 0 + 0 + 4 + + + + + + 0 + 1 + 2 + + + 0 + 3 + 1 + + + 1 + 3 + 2 + + + 0 + 2 + 3 + + + + + diff --git a/test/models/AMF/test2.amf b/test/models/AMF/test2.amf new file mode 100644 index 000000000..c30a68aa5 --- /dev/null +++ b/test/models/AMF/test2.amf @@ -0,0 +1,65 @@ + + + + + 0.1 + 0.6 + 0.1 + 1 + + + + + + -0.5 + -0.5 + 0 + + + + + -0.5 + 0.5 + 0 + + + + + 1 + 0 + 0 + + + + + 0 + 0 + 4 + + + + + + 0 + 1 + 2 + + + 0 + 3 + 1 + + + 1 + 3 + 2 + + + 0 + 2 + 3 + + + + + diff --git a/test/models/AMF/test3.amf b/test/models/AMF/test3.amf new file mode 100644 index 000000000..348a916a2 --- /dev/null +++ b/test/models/AMF/test3.amf @@ -0,0 +1,71 @@ + + + + + 0.1 + 0.6 + 0.1 + 1 + + + + + + -0.5 + -0.5 + 0 + + + + + -0.5 + 0.5 + 0 + + + + + 1 + 0 + 0 + + + + + 0 + 0 + 4 + + + + + + 0.6 + 0.1 + 0.1 + 1 + + + 0 + 1 + 2 + + + 0 + 3 + 1 + + + 1 + 3 + 2 + + + 0 + 2 + 3 + + + + + diff --git a/test/models/AMF/test4.amf b/test/models/AMF/test4.amf new file mode 100644 index 000000000..139609233 --- /dev/null +++ b/test/models/AMF/test4.amf @@ -0,0 +1,77 @@ + + + + + 0.1 + 0.6 + 0.1 + 1 + + + + + + -0.5 + -0.5 + 0 + + + + + -0.5 + 0.5 + 0 + + + + + 1 + 0 + 0 + + + + + 0 + 0 + 4 + + + + + + 0.6 + 0.1 + 0.1 + 1 + + + + 0.0 + 0.0 + 1 + 1 + + 0 + 1 + 2 + + + 0 + 3 + 1 + + + 1 + 3 + 2 + + + 0 + 2 + 3 + + + + + diff --git a/test/models/AMF/test5.amf b/test/models/AMF/test5.amf new file mode 100644 index 000000000..3e422d8be --- /dev/null +++ b/test/models/AMF/test5.amf @@ -0,0 +1,95 @@ + + + + + 0.1 + 0.6 + 0.1 + 1 + + + + + + 0.5 + 0.5 + 0 + 1 + + + -0.5 + -0.5 + 0 + + + + + 0.5 + 0.5 + 0.2 + 1 + + + -0.5 + 0.5 + 0 + + + + + 0.5 + 0.5 + 0.4 + 1 + + + 1 + 0 + 0 + + + + + 0.5 + 0.5 + 0.8 + 1 + + + 0 + 0 + 4 + + + + + + 0.6 + 0.1 + 0.1 + 1 + + + 0 + 1 + 2 + + + 0 + 3 + 1 + + + 1 + 3 + 2 + + + 0 + 2 + 3 + + + + + diff --git a/test/models/AMF/test5a.amf b/test/models/AMF/test5a.amf new file mode 100644 index 000000000..a8b6e01e3 --- /dev/null +++ b/test/models/AMF/test5a.amf @@ -0,0 +1,77 @@ + + + + + 0.1 + 0.6 + 0.1 + 1 + + + + + + 0.5 + 0.5 + 0 + 1 + + + -0.5 + -0.5 + 0 + + + + + -0.5 + 0.5 + 0 + + + + + 1 + 0 + 0 + + + + + 0 + 0 + 4 + + + + + + 0.6 + 0.1 + 0.1 + 1 + + + 0 + 1 + 2 + + + 0 + 3 + 1 + + + 1 + 3 + 2 + + + 0 + 2 + 3 + + + + + diff --git a/test/models/AMF/test6.amf b/test/models/AMF/test6.amf new file mode 100644 index 000000000..5469b39ba --- /dev/null +++ b/test/models/AMF/test6.amf @@ -0,0 +1,83 @@ + + + + + 0.1 + 0.6 + 0.1 + 1 + + + + + + 0.5 + 0.5 + 0 + 1 + + + -0.5 + -0.5 + 0 + + + + + -0.5 + 0.5 + 0 + + + + + 1 + 0 + 0 + + + + + 0 + 0 + 4 + + + + + + 0.6 + 0.1 + 0.1 + 1 + + + + 0.0 + 0.0 + 1 + 1 + + 0 + 1 + 2 + + + 0 + 3 + 1 + + + 1 + 3 + 2 + + + 0 + 2 + 3 + + + + + diff --git a/test/models/AMF/test7.amf b/test/models/AMF/test7.amf new file mode 100644 index 000000000..62bde92ca --- /dev/null +++ b/test/models/AMF/test7.amf @@ -0,0 +1,112 @@ + + + + + 0.1 + 0.6 + 0.1 + 1 + + + + + + 0.5 + 0.5 + 0 + 1 + + + -0.5 + -0.5 + 0 + + + + + -0.5 + 0.5 + 0 + + + + + 1 + 0 + 0 + + + + + 0 + 0 + 4 + + + + + 0 + 0 + -4 + + + + + + 0.6 + 0.1 + 0.1 + 1 + + + + 0.0 + 0.0 + 1 + 1 + + 0 + 1 + 2 + + + 0 + 3 + 1 + + + 1 + 3 + 2 + + + 0 + 2 + 3 + + + + + 0 + 2 + 1 + + + 0 + 4 + 2 + + + 1 + 2 + 4 + + + 0 + 1 + 4 + + + + + diff --git a/test/models/AMF/test8.amf b/test/models/AMF/test8.amf new file mode 100644 index 000000000..05bc3bf0d --- /dev/null +++ b/test/models/AMF/test8.amf @@ -0,0 +1,130 @@ + + + + + 0.1 + 0.6 + 0.1 + 1 + + + + + + 0.5 + 0.5 + 0 + 1 + + + -0.5 + -0.5 + 0 + + + + + -0.5 + 0.5 + 0 + + + + + 1 + 0 + 0 + + + + + 0 + 0 + 4 + + + + + 0 + 0 + -4 + + + + + + 0.6 + 0.1 + 0.1 + 1 + + + + 0.0 + 0.0 + 1 + 1 + + 0 + 1 + 2 + + + 0 + 3 + 1 + + + 1 + 3 + 2 + + + 0 + 2 + 3 + + + + + 0 + 2 + 1 + + + 0 + 4 + 2 + + + 1 + 2 + 4 + + + 0 + 1 + 4 + + + + + + + -5 + 0 + 0 + -45 + 0 + 0 + + + 5 + 0 + 0 + 45 + 0 + 0 + + + diff --git a/test/models/AMF/test9.amf b/test/models/AMF/test9.amf new file mode 100644 index 000000000..af33b1747 --- /dev/null +++ b/test/models/AMF/test9.amf @@ -0,0 +1,180 @@ + + + + + 0.1 + 0.6 + 0.1 + 1 + + + + + + 0.5 + 0.5 + 0 + 1 + + + -0.5 + -0.5 + 0 + + + + + -0.5 + 0.5 + 0 + + + + + 1 + 0 + 0 + + + + + 0 + 0 + 4 + + + + + 0 + 0 + -4 + + + + + + 0.6 + 0.1 + 0.1 + 1 + + + + 0.0 + 0.0 + 1 + 1 + + 0 + 1 + 2 + + + 0 + 3 + 1 + + + 1 + 3 + 2 + + + 0 + 2 + 3 + + + + + 0 + 2 + 1 + + + 0 + 4 + 2 + + + 1 + 2 + 4 + + + 0 + 1 + 4 + + + + + + + -5 + 0 + 0 + -45 + 0 + 0 + + + 5 + 0 + 0 + 45 + 0 + 0 + + + 0 + -5 + 0 + 0 + -45 + 0 + + + 0 + 5 + 0 + 0 + 45 + 0 + + + 0 + 0 + -5 + 0 + 0 + -45 + + + 0 + 0 + 5 + 0 + 0 + 45 + + + + + -20 + 0 + 0 + -20 + 0 + 0 + + + 20 + 0 + 0 + 20 + 0 + 0 + + + diff --git a/test/models/OpenGEX/animated.ogex b/test/models/OpenGEX/animated.ogex deleted file mode 100644 index de52666a7..000000000 --- a/test/models/OpenGEX/animated.ogex +++ /dev/null @@ -1,5044 +0,0 @@ -Metric (key = "distance") {float {1.0}} -Metric (key = "angle") {float {1.0}} -Metric (key = "time") {float {1.0}} -Metric (key = "up") {string {"z"}} - -Node $node1 -{ - Name {string {"Box001"}} - - Transform - { - float[16] - { - {1.0, 5.235987998730707e-08, 0.0, 0.0, - -5.235987998730707e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node2 - { - Name {string {"Box001-Pivot"}} - ObjectRef {ref {$geometry1}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.1859470009803772, 0.0, 0.0, 1.0} - } - } - } - - Node $node3 - { - Name {string {"Box002"}} - - Transform - { - float[16] - { - {1.0, 5.235987998730707e-08, 0.0, 0.0, - -5.235987998730707e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node4 - { - Name {string {"Box002-Pivot"}} - ObjectRef {ref {$geometry2}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.1859470009803772, 1.8918230533599854, 0.0, 1.0} - } - } - } - - Node $node5 - { - Name {string {"Box003"}} - - Transform - { - float[16] - { - {1.0, 5.235987998730707e-08, 0.0, 0.0, - -5.235987998730707e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node6 - { - Name {string {"Box003-Pivot"}} - ObjectRef {ref {$geometry3}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.1859460026025772, 3.783642053604126, 0.0, 1.0} - } - } - } - - Node $node7 - { - Name {string {"Box004"}} - - Transform - { - float[16] - { - {1.0, 5.235987998730707e-08, 0.0, 0.0, - -5.235987998730707e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node8 - { - Name {string {"Box004-Pivot"}} - ObjectRef {ref {$geometry4}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18594400584697723, 5.6754608154296875, 0.0, 1.0} - } - } - } - - Node $node9 - { - Name {string {"Box005"}} - - Transform - { - float[16] - { - {1.0, 5.235989419816178e-08, 0.0, 0.0, - -5.235989419816178e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node10 - { - Name {string {"Box005-Pivot"}} - ObjectRef {ref {$geometry5}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18594199419021606, 7.567279815673828, 0.0, 1.0} - } - } - } - - Node $node11 - { - Name {string {"Box006"}} - - Transform - { - float[16] - { - {1.0, 5.235989419816178e-08, 0.0, 0.0, - -5.235989419816178e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node12 - { - Name {string {"Box006-Pivot"}} - ObjectRef {ref {$geometry6}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.1859389990568161, 9.459098815917969, 0.0, 1.0} - } - } - } - - Node $node13 - { - Name {string {"Box007"}} - - Transform - { - float[16] - { - {1.0, 5.235989419816178e-08, 0.0, 0.0, - -5.235989419816178e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node14 - { - Name {string {"Box007-Pivot"}} - ObjectRef {ref {$geometry7}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18593500554561615, 11.35091781616211, 0.0, 1.0} - } - } - } - - Node $node15 - { - Name {string {"Box008"}} - - Transform - { - float[16] - { - {1.0, 5.235989419816178e-08, 0.0, 0.0, - -5.235989419816178e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node16 - { - Name {string {"Box008-Pivot"}} - ObjectRef {ref {$geometry8}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.185930997133255, 13.24273681640625, 0.0, 1.0} - } - } - } - - Node $node17 - { - Name {string {"Box009"}} - - Transform - { - float[16] - { - {1.0, 5.235989419816178e-08, 0.0, 0.0, - -5.235989419816178e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node18 - { - Name {string {"Box009-Pivot"}} - ObjectRef {ref {$geometry9}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18592700362205505, 15.13455581665039, 0.0, 1.0} - } - } - } - - Node $node19 - { - Name {string {"Box010"}} - - Transform - { - float[16] - { - {1.0, 5.235989419816178e-08, 0.0, 0.0, - -5.235989419816178e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node20 - { - Name {string {"Box010-Pivot"}} - ObjectRef {ref {$geometry10}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18592199683189392, 17.026376724243164, 0.0, 1.0} - } - } - } - - Node $node21 - { - Name {string {"Box011"}} - - Transform - { - float[16] - { - {1.0, 5.235989419816178e-08, 0.0, 0.0, - -5.235989419816178e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node22 - { - Name {string {"Box011-Pivot"}} - ObjectRef {ref {$geometry11}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.185916006565094, 18.918193817138672, 0.0, 1.0} - } - } - } - - Node $node23 - { - Name {string {"Box012"}} - - Transform - { - float[16] - { - {1.0, 5.235989419816178e-08, 0.0, 0.0, - -5.235989419816178e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node24 - { - Name {string {"Box012-Pivot"}} - ObjectRef {ref {$geometry12}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18591000139713287, 20.810012817382812, 0.0, 1.0} - } - } - } - - Node $node25 - { - Name {string {"Box013"}} - - Transform - { - float[16] - { - {1.0, 5.235989419816178e-08, 0.0, 0.0, - -5.235989419816178e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node26 - { - Name {string {"Box013-Pivot"}} - ObjectRef {ref {$geometry13}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18590299785137177, 22.701831817626953, 0.0, 1.0} - } - } - } - - Node $node27 - { - Name {string {"Box014"}} - - Transform - { - float[16] - { - {1.0, 5.235989419816178e-08, 0.0, 0.0, - -5.235989419816178e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node28 - { - Name {string {"Box014-Pivot"}} - ObjectRef {ref {$geometry14}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18589499592781067, 24.593652725219727, 0.0, 1.0} - } - } - } - - Node $node29 - { - Name {string {"Box015"}} - - Transform - { - float[16] - { - {1.0, 5.235989419816178e-08, 0.0, 0.0, - -5.235989419816178e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node30 - { - Name {string {"Box015-Pivot"}} - ObjectRef {ref {$geometry15}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18588699400424957, 26.485469818115234, 0.0, 1.0} - } - } - } - - Node $node31 - { - Name {string {"Box016"}} - - Transform - { - float[16] - { - {1.0, 5.235989419816178e-08, 0.0, 0.0, - -5.235989419816178e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node32 - { - Name {string {"Box016-Pivot"}} - ObjectRef {ref {$geometry16}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18587899208068848, 28.377288818359375, 0.0, 1.0} - } - } - } - - Node $node33 - { - Name {string {"Box017"}} - - Transform - { - float[16] - { - {1.0, 5.235989419816178e-08, 0.0, 0.0, - -5.235989419816178e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node34 - { - Name {string {"Box017-Pivot"}} - ObjectRef {ref {$geometry17}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.1858700066804886, 30.269107818603516, 0.0, 1.0} - } - } - } - - Node $node35 - { - Name {string {"Box018"}} - - Transform - { - float[16] - { - {1.0, 5.235989419816178e-08, 0.0, 0.0, - -5.235989419816178e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node36 - { - Name {string {"Box018-Pivot"}} - ObjectRef {ref {$geometry18}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18585999310016632, 32.160926818847656, 0.0, 1.0} - } - } - } - - Node $node37 - { - Name {string {"Box019"}} - - Transform - { - float[16] - { - {1.0, 5.235989419816178e-08, 0.0, 0.0, - -5.235989419816178e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node38 - { - Name {string {"Box019-Pivot"}} - ObjectRef {ref {$geometry19}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18584999442100525, 34.0527458190918, 0.0, 1.0} - } - } - } - - Node $node39 - { - Name {string {"Box020"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node40 - { - Name {string {"Box020-Pivot"}} - ObjectRef {ref {$geometry20}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.1858389973640442, 35.94456481933594, 0.0, 1.0} - } - } - } - - Node $node41 - { - Name {string {"Box021"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node42 - { - Name {string {"Box021-Pivot"}} - ObjectRef {ref {$geometry21}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18582700192928314, 37.83638381958008, 0.0, 1.0} - } - } - } - - Node $node43 - { - Name {string {"Box022"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node44 - { - Name {string {"Box022-Pivot"}} - ObjectRef {ref {$geometry22}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.1858150064945221, 39.72820281982422, 0.0, 1.0} - } - } - } - - Node $node45 - { - Name {string {"Box023"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node46 - { - Name {string {"Box023-Pivot"}} - ObjectRef {ref {$geometry23}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18580299615859985, 41.620025634765625, 0.0, 1.0} - } - } - } - - Node $node47 - { - Name {string {"Box024"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node48 - { - Name {string {"Box024-Pivot"}} - ObjectRef {ref {$geometry24}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18579000234603882, 43.5118408203125, 0.0, 1.0} - } - } - } - - Node $node49 - { - Name {string {"Box025"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node50 - { - Name {string {"Box025-Pivot"}} - ObjectRef {ref {$geometry25}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.1857759952545166, 45.40365982055664, 0.0, 1.0} - } - } - } - - Node $node51 - { - Name {string {"Box026"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node52 - { - Name {string {"Box026-Pivot"}} - ObjectRef {ref {$geometry26}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18576200306415558, 47.29547882080078, 0.0, 1.0} - } - } - } - - Node $node53 - { - Name {string {"Box027"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node54 - { - Name {string {"Box027-Pivot"}} - ObjectRef {ref {$geometry27}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18574699759483337, 49.18730545043945, 0.0, 1.0} - } - } - } - - Node $node55 - { - Name {string {"Box028"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node56 - { - Name {string {"Box028-Pivot"}} - ObjectRef {ref {$geometry28}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18573099374771118, 51.07911682128906, 0.0, 1.0} - } - } - } - - Node $node57 - { - Name {string {"Box029"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node58 - { - Name {string {"Box029-Pivot"}} - ObjectRef {ref {$geometry29}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18571500480175018, 52.97093963623047, 0.0, 1.0} - } - } - } - - Node $node59 - { - Name {string {"Box030"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node60 - { - Name {string {"Box030-Pivot"}} - ObjectRef {ref {$geometry30}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.185699000954628, 54.862754821777344, 0.0, 1.0} - } - } - } - - Node $node61 - { - Name {string {"Box031"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node62 - { - Name {string {"Box031-Pivot"}} - ObjectRef {ref {$geometry31}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.1856819987297058, 56.75457763671875, 0.0, 1.0} - } - } - } - - Node $node63 - { - Name {string {"Box032"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node64 - { - Name {string {"Box032-Pivot"}} - ObjectRef {ref {$geometry32}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18566399812698364, 58.646392822265625, 0.0, 1.0} - } - } - } - - Node $node65 - { - Name {string {"Box033"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node66 - { - Name {string {"Box033-Pivot"}} - ObjectRef {ref {$geometry33}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18564599752426147, 60.53821563720703, 0.0, 1.0} - } - } - } - - Node $node67 - { - Name {string {"Box034"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node68 - { - Name {string {"Box034-Pivot"}} - ObjectRef {ref {$geometry34}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18562699854373932, 62.430030822753906, 0.0, 1.0} - } - } - } - - Node $node69 - { - Name {string {"Box035"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node70 - { - Name {string {"Box035-Pivot"}} - ObjectRef {ref {$geometry35}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18560700118541718, 64.32185363769531, 0.0, 1.0} - } - } - } - - Node $node71 - { - Name {string {"Box036"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node72 - { - Name {string {"Box036-Pivot"}} - ObjectRef {ref {$geometry36}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18558700382709503, 66.21366882324219, 0.0, 1.0} - } - } - } - - Node $node73 - { - Name {string {"Box037"}} - - Transform - { - float[16] - { - {1.0, 5.2359951041580644e-08, 0.0, 0.0, - -5.2359951041580644e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node74 - { - Name {string {"Box037-Pivot"}} - ObjectRef {ref {$geometry37}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.1855670064687729, 68.1054916381836, 0.0, 1.0} - } - } - } - - Node $node75 - { - Name {string {"Box038"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node76 - { - Name {string {"Box038-Pivot"}} - ObjectRef {ref {$geometry38}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18554599583148956, 69.99730682373047, 0.0, 1.0} - } - } - } - - Node $node77 - { - Name {string {"Box039"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node78 - { - Name {string {"Box039-Pivot"}} - ObjectRef {ref {$geometry39}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18552400171756744, 71.88912200927734, 0.0, 1.0} - } - } - } - - Node $node79 - { - Name {string {"Box040"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node80 - { - Name {string {"Box040-Pivot"}} - ObjectRef {ref {$geometry40}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18550199270248413, 73.78095245361328, 0.0, 1.0} - } - } - } - - Node $node81 - { - Name {string {"Box041"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node82 - { - Name {string {"Box041-Pivot"}} - ObjectRef {ref {$geometry41}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18547900021076202, 75.67276763916016, 0.0, 1.0} - } - } - } - - Node $node83 - { - Name {string {"Box042"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node84 - { - Name {string {"Box042-Pivot"}} - ObjectRef {ref {$geometry42}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18545599281787872, 77.56458282470703, 0.0, 1.0} - } - } - } - - Node $node85 - { - Name {string {"Box043"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node86 - { - Name {string {"Box043-Pivot"}} - ObjectRef {ref {$geometry43}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18543200194835663, 79.4563980102539, 0.0, 1.0} - } - } - } - - Node $node87 - { - Name {string {"Box044"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node88 - { - Name {string {"Box044-Pivot"}} - ObjectRef {ref {$geometry44}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18540699779987335, 81.34822082519531, 0.0, 1.0} - } - } - } - - Node $node89 - { - Name {string {"Box045"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node90 - { - Name {string {"Box045-Pivot"}} - ObjectRef {ref {$geometry45}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18538199365139008, 83.24005126953125, 0.0, 1.0} - } - } - } - - Node $node91 - { - Name {string {"Box046"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node92 - { - Name {string {"Box046-Pivot"}} - ObjectRef {ref {$geometry46}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.185356006026268, 85.1318588256836, 0.0, 1.0} - } - } - } - - Node $node93 - { - Name {string {"Box047"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node94 - { - Name {string {"Box047-Pivot"}} - ObjectRef {ref {$geometry47}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18533000349998474, 87.02367401123047, 0.0, 1.0} - } - } - } - - Node $node95 - { - Name {string {"Box048"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node96 - { - Name {string {"Box048-Pivot"}} - ObjectRef {ref {$geometry48}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.1853030025959015, 88.9155044555664, 0.0, 1.0} - } - } - } - - Node $node97 - { - Name {string {"Box049"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node98 - { - Name {string {"Box049-Pivot"}} - ObjectRef {ref {$geometry49}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18527600169181824, 90.80731964111328, 0.0, 1.0} - } - } - } - - Node $node99 - { - Name {string {"Box050"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node100 - { - Name {string {"Box050-Pivot"}} - ObjectRef {ref {$geometry50}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.185248002409935, 92.69913482666016, 0.0, 1.0} - } - } - } - - Node $node101 - { - Name {string {"Box051"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node102 - { - Name {string {"Box051-Pivot"}} - ObjectRef {ref {$geometry51}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18521900475025177, 94.59095001220703, 0.0, 1.0} - } - } - } - - Node $node103 - { - Name {string {"Box052"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node104 - { - Name {string {"Box052-Pivot"}} - ObjectRef {ref {$geometry52}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18518999218940735, 96.48278045654297, 0.0, 1.0} - } - } - } - - Node $node105 - { - Name {string {"Box053"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node106 - { - Name {string {"Box053-Pivot"}} - ObjectRef {ref {$geometry53}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18515999615192413, 98.37458801269531, 0.0, 1.0} - } - } - } - - Node $node107 - { - Name {string {"Box054"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node108 - { - Name {string {"Box054-Pivot"}} - ObjectRef {ref {$geometry54}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18513000011444092, 100.26640319824219, 0.0, 1.0} - } - } - } - - Node $node109 - { - Name {string {"Box055"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node110 - { - Name {string {"Box055-Pivot"}} - ObjectRef {ref {$geometry55}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18509900569915771, 102.15821838378906, 0.0, 1.0} - } - } - } - - Node $node111 - { - Name {string {"Box056"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node112 - { - Name {string {"Box056-Pivot"}} - ObjectRef {ref {$geometry56}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18506799638271332, 104.05003356933594, 0.0, 1.0} - } - } - } - - Node $node113 - { - Name {string {"Box057"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node114 - { - Name {string {"Box057-Pivot"}} - ObjectRef {ref {$geometry57}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18503600358963013, 105.94184875488281, 0.0, 1.0} - } - } - } - - Node $node115 - { - Name {string {"Box058"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node116 - { - Name {string {"Box058-Pivot"}} - ObjectRef {ref {$geometry58}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18500299751758575, 107.83366394042969, 0.0, 1.0} - } - } - } - - Node $node117 - { - Name {string {"Box059"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node118 - { - Name {string {"Box059-Pivot"}} - ObjectRef {ref {$geometry59}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18497000634670258, 109.72547912597656, 0.0, 1.0} - } - } - } - - Node $node119 - { - Name {string {"Box060"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node120 - { - Name {string {"Box060-Pivot"}} - ObjectRef {ref {$geometry60}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18493600189685822, 111.61729431152344, 0.0, 1.0} - } - } - } - - Node $node121 - { - Name {string {"Box061"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node122 - { - Name {string {"Box061-Pivot"}} - ObjectRef {ref {$geometry61}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18490199744701385, 113.50910949707031, 0.0, 1.0} - } - } - } - - Node $node123 - { - Name {string {"Box062"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node124 - { - Name {string {"Box062-Pivot"}} - ObjectRef {ref {$geometry62}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.1848669946193695, 115.40092468261719, 0.0, 1.0} - } - } - } - - Node $node125 - { - Name {string {"Box063"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node126 - { - Name {string {"Box063-Pivot"}} - ObjectRef {ref {$geometry63}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18483200669288635, 117.29273223876953, 0.0, 1.0} - } - } - } - - Node $node127 - { - Name {string {"Box064"}} - - Transform - { - float[16] - { - {1.0, 5.235983735474292e-08, 0.0, 0.0, - -5.235983735474292e-08, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } - - GeometryNode $node128 - { - Name {string {"Box064-Pivot"}} - ObjectRef {ref {$geometry64}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.18479600548744202, 119.18455505371094, 0.0, 1.0} - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } -} - -GeometryNode $node129 -{ - Name {string {"Cube"}} - ObjectRef {ref {$geometry65}} - MaterialRef (index = 0) {ref {$material1}} - - Transform - { - float[16] - { - {1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0} - } - } -} - -LightNode $node130 -{ - Name {string {"Lamp"}} - ObjectRef {ref {$light1}} - - Transform - { - float[16] - { - {-0.29086464643478394, 0.9551711678504944, -0.05518905818462372, 0.0, - -0.7711008191108704, -0.1998833566904068, 0.6045247316360474, 0.0, - 0.5663931965827942, 0.21839119493961334, 0.7946722507476807, 0.0, - 4.076245307922363, 1.0054539442062378, 5.903861999511719, 1.0} - } - } -} - -CameraNode $node131 -{ - Name {string {"Camera"}} - ObjectRef {ref {$camera1}} - - Transform - { - float[16] - { - {0.6858805418014526, 0.7276337742805481, -0.010816780850291252, 0.0, - -0.31737011671066284, 0.31246861815452576, 0.8953432440757751, 0.0, - 0.6548618674278259, -0.6106656193733215, 0.4452453553676605, 0.0, - 7.481131553649902, -6.5076398849487305, 5.34366512298584, 1.0} - } - } -} - -GeometryObject $geometry11 // Box011-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry65 // Cube -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {1.0, 0.9999999403953552, -1.0}, {1.0, -1.0, -1.0}, {-1.0000001192092896, -0.9999998211860657, -1.0}, {-0.9999996423721313, 1.0000003576278687, -1.0}, {1.0000004768371582, 0.999999463558197, 1.0}, {-0.9999999403953552, 1.0, 1.0}, {-1.0000003576278687, -0.9999996423721313, 1.0}, {0.9999993443489075, -1.0000005960464478, 1.0}, - {1.0, 0.9999999403953552, -1.0}, {1.0000004768371582, 0.999999463558197, 1.0}, {0.9999993443489075, -1.0000005960464478, 1.0}, {1.0, -1.0, -1.0}, {1.0, -1.0, -1.0}, {0.9999993443489075, -1.0000005960464478, 1.0}, {-1.0000003576278687, -0.9999996423721313, 1.0}, {-1.0000001192092896, -0.9999998211860657, -1.0}, - {-1.0000001192092896, -0.9999998211860657, -1.0}, {-1.0000003576278687, -0.9999996423721313, 1.0}, {-0.9999999403953552, 1.0, 1.0}, {-0.9999996423721313, 1.0000003576278687, -1.0}, {1.0000004768371582, 0.999999463558197, 1.0}, {1.0, 0.9999999403953552, -1.0}, {-0.9999996423721313, 1.0000003576278687, -1.0}, {-0.9999999403953552, 1.0, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {0.0, 0.0, -1.0}, {0.0, 0.0, -1.0}, {0.0, 0.0, -1.0}, {0.0, 0.0, -1.0}, {0.0, -0.0, 1.0}, {0.0, -0.0, 1.0}, {0.0, -0.0, 1.0}, {0.0, -0.0, 1.0}, - {1.0, -2.8312206268310547e-07, 4.470341252726939e-08}, {1.0, -2.8312206268310547e-07, 4.470341252726939e-08}, {1.0, -2.8312206268310547e-07, 4.470341252726939e-08}, {1.0, -2.8312206268310547e-07, 4.470341252726939e-08}, {-2.8312206268310547e-07, -1.0, -1.0430819230577981e-07}, {-2.8312206268310547e-07, -1.0, -1.0430819230577981e-07}, {-2.8312206268310547e-07, -1.0, -1.0430819230577981e-07}, {-2.8312206268310547e-07, -1.0, -1.0430819230577981e-07}, - {-1.0, 2.2351744632942427e-07, -1.341104365337742e-07}, {-1.0, 2.2351744632942427e-07, -1.341104365337742e-07}, {-1.0, 2.2351744632942427e-07, -1.341104365337742e-07}, {-1.0, 2.2351744632942427e-07, -1.341104365337742e-07}, {2.384185791015625e-07, 1.0, 2.086162567138672e-07}, {2.384185791015625e-07, 1.0, 2.086162567138672e-07}, {2.384185791015625e-07, 1.0, 2.086162567138672e-07}, {2.384185791015625e-07, 1.0, 2.086162567138672e-07} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry16 // Box016-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry29 // Box029-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry34 // Box034-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry57 // Box057-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry44 // Box044-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry33 // Box033-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry21 // Box021-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry56 // Box056-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry8 // Box008-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry5 // Box005-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry20 // Box020-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry51 // Box051-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry17 // Box017-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry12 // Box012-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry25 // Box025-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry39 // Box039-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry35 // Box035-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry43 // Box043-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry31 // Box031-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry55 // Box055-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry3 // Box003-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry53 // Box053-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry15 // Box015-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry28 // Box028-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry23 // Box023-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry60 // Box060-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry1 // Box001-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry4 // Box004-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry42 // Box042-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry24 // Box024-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry22 // Box022-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry62 // Box062-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry59 // Box059-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry10 // Box010-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry46 // Box046-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry19 // Box019-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry58 // Box058-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry14 // Box014-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry6 // Box006-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry36 // Box036-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry32 // Box032-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry50 // Box050-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry49 // Box049-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry47 // Box047-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry30 // Box030-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry38 // Box038-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry48 // Box048-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry61 // Box061-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry63 // Box063-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry64 // Box064-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry26 // Box026-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry18 // Box018-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry37 // Box037-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry9 // Box009-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry7 // Box007-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry54 // Box054-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry13 // Box013-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry2 // Box002-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry41 // Box041-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry27 // Box027-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry40 // Box040-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry45 // Box045-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -GeometryObject $geometry52 // Box052-Pivot -{ - Mesh (primitive = "triangles") - { - VertexArray (attrib = "position") - { - float[3] // 24 - { - {-0.5, -0.5, 0.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 1.0}, - {-0.5, -0.5, 0.0}, {0.5, -0.5, 0.0}, {0.5, -0.5, 1.0}, {-0.5, -0.5, 1.0}, {0.5, -0.5, 0.0}, {0.5, 0.5, 0.0}, {0.5, 0.5, 1.0}, {0.5, -0.5, 1.0}, - {0.5, 0.5, 0.0}, {-0.5, 0.5, 0.0}, {-0.5, 0.5, 1.0}, {0.5, 0.5, 1.0}, {-0.5, 0.5, 0.0}, {-0.5, -0.5, 0.0}, {-0.5, -0.5, 1.0}, {-0.5, 0.5, 1.0} - } - } - - VertexArray (attrib = "normal") - { - float[3] // 24 - { - {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {-0.0, 0.0, -1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, - {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {0.0, -1.0, -0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0}, {-1.0, 0.0, -0.0} - } - } - - VertexArray (attrib = "texcoord") - { - float[2] // 24 - { - {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, - {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}, {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0} - } - } - - IndexArray - { - unsigned_int32[3] // 12 - { - {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} - } - } - } -} - -LightObject $light1 (type = "point") // Lamp -{ - Color (attrib = "light") {float[3] {{1.0, 1.0, 1.0}}} - - Atten (curve = "inverse_square") - { - Param (attrib = "scale") {float {5.47722400800463}} - } -} - -CameraObject $camera1 // Camera -{ - Param (attrib = "fov") {float {0.8575560450553894}} - Param (attrib = "near") {float {0.10000000149011612}} - Param (attrib = "far") {float {100.0}} -} - -Material $material1 -{ - Name {string {"Material"}} - - Color (attrib = "diffuse") {float[3] {{0.6400000190734865, 0.6400000190734865, 0.6400000190734865}}} - Color (attrib = "specular") {float[3] {{0.5, 0.5, 0.5}}} - Param (attrib = "specular_power") {float {50}} -} diff --git a/test/models/OpenGEX/animation_example.ogex b/test/models/OpenGEX/animation_example.ogex new file mode 100644 index 000000000..bdce0bb31 --- /dev/null +++ b/test/models/OpenGEX/animation_example.ogex @@ -0,0 +1,1749 @@ +Metric (key = "distance") {float {1.0}} +Metric (key = "angle") {float {1.0}} +Metric (key = "time") {float {1.0}} +Metric (key = "up") {string {"z"}} + +Node $node1 +{ + Name {string {"Armature"}} + + Transform %transform + { + float[16] + { + {1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0} + } + } + + BoneNode $node2 + { + Name {string {"Bone"}} + + Transform %transform + { + float[16] + { + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, + 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, + 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, + 0.0, 0.0, -1.0, 1.0} + } + } + + Animation + { + Track (target = %transform) + { + Time + { + Key {float {0.0, 0.041666666666666664, 0.08333333333333333, 0.125, 0.16666666666666666, 0.20833333333333331, 0.25, 0.29166666666666663, 0.3333333333333333, 0.375, 0.41666666666666663, 0.4583333333333333, 0.5, 0.5416666666666666, 0.5833333333333333, 0.625, 0.6666666666666666, 0.7083333333333333, 0.75, 0.7916666666666666, 0.8333333333333333, 0.875, 0.9166666666666666, 0.9583333333333333, 1.0, 1.0416666666666665, 1.0833333333333333, 1.125, 1.1666666666666665, 1.2083333333333333, 1.25, 1.2916666666666665, 1.3333333333333333, 1.375, 1.4166666666666665, 1.4583333333333333, 1.5, 1.5416666666666665, 1.5833333333333333, 1.625, 1.6666666666666665, 1.7083333333333333, 1.75, 1.7916666666666665, 1.8333333333333333, 1.875, 1.9166666666666665, 1.9583333333333333, 2.0, 2.0416666666666665, 2.083333333333333, 2.125, 2.1666666666666665, 2.208333333333333, 2.25, 2.2916666666666665, 2.333333333333333, 2.375, 2.4166666666666665, 2.458333333333333, 2.5, 2.5416666666666665, 2.583333333333333, 2.625, 2.6666666666666665, 2.708333333333333, 2.75, 2.7916666666666665, 2.833333333333333, 2.875, 2.9166666666666665, 2.958333333333333, 3.0, 3.0416666666666665, 3.083333333333333, 3.125, 3.1666666666666665, 3.208333333333333, 3.25, 3.2916666666666665, 3.333333333333333, 3.375, 3.4166666666666665, 3.458333333333333, 3.5, 3.5416666666666665, 3.583333333333333, 3.625, 3.6666666666666665, 3.708333333333333, 3.75, 3.7916666666666665, 3.833333333333333, 3.875, 3.9166666666666665, 3.958333333333333, 4.0, 4.041666666666666, 4.083333333333333, 4.125, 4.166666666666666, 4.208333333333333, 4.25, 4.291666666666666, 4.333333333333333, 4.375, 4.416666666666666, 4.458333333333333, 4.5, 4.541666666666666, 4.583333333333333, 4.625, 4.666666666666666, 4.708333333333333, 4.75, 4.791666666666666, 4.833333333333333, 4.875, 4.916666666666666, 4.958333333333333, 5.0, 5.041666666666666, 5.083333333333333, 5.125, 5.166666666666666, 5.208333333333333, 5.25, 5.291666666666666, 5.333333333333333, 5.375, 5.416666666666666, 5.458333333333333, 5.5, 5.541666666666666, 5.583333333333333, 5.625, 5.666666666666666, 5.708333333333333, 5.75, 5.791666666666666, 5.833333333333333, 5.875, 5.916666666666666, 5.958333333333333, 6.0, 6.041666666666666, 6.083333333333333, 6.125, 6.166666666666666, 6.208333333333333, 6.25, 6.291666666666666, 6.333333333333333, 6.375, 6.416666666666666, 6.458333333333333, 6.5, 6.541666666666666, 6.583333333333333, 6.625, 6.666666666666666, 6.708333333333333, 6.75, 6.791666666666666, 6.833333333333333, 6.875, 6.916666666666666, 6.958333333333333, 7.0, 7.041666666666666, 7.083333333333333, 7.125, 7.166666666666666, 7.208333333333333, 7.25, 7.291666666666666, 7.333333333333333, 7.375, 7.416666666666666, 7.458333333333333, 7.5, 7.541666666666666, 7.583333333333333, 7.625, 7.666666666666666, 7.708333333333333, 7.75, 7.791666666666666, 7.833333333333333, 7.875, 7.916666666666666, 7.958333333333333, 8.0, 8.041666666666666, 8.083333333333332, 8.125, 8.166666666666666, 8.208333333333332, 8.25, 8.291666666666666, 8.333333333333332, 8.375, 8.416666666666666, 8.458333333333332, 8.5, 8.541666666666666, 8.583333333333332, 8.625, 8.666666666666666, 8.708333333333332, 8.75, 8.791666666666666, 8.833333333333332, 8.875, 8.916666666666666, 8.958333333333332, 9.0, 9.041666666666666, 9.083333333333332, 9.125, 9.166666666666666, 9.208333333333332, 9.25, 9.291666666666666, 9.333333333333332, 9.375, 9.416666666666666, 9.458333333333332, 9.5, 9.541666666666666, 9.583333333333332, 9.625, 9.666666666666666, 9.708333333333332, 9.75, 9.791666666666666, 9.833333333333332, 9.875, 9.916666666666666, 9.958333333333332, 10.0, 10.041666666666666, 10.083333333333332, 10.125, 10.166666666666666, 10.208333333333332, 10.25, 10.291666666666666, 10.333333333333332, 10.416666666666666}} + } + + Value + { + Key + { + float[16] + { + {1.0, 0.0, 0.0, 0.0, 0.0, 7.549790126404332e-08, 1.0, 0.0, 0.0, -1.0, 1.1920928955078125e-07, 0.0, 0.0, -1.7763568394002505e-15, -0.9340413808822632, 1.0}, + {1.0, 0.0, 0.0, 0.0, 0.0, 7.549790126404332e-08, 1.0, 0.0, 0.0, -1.0, 1.1920928955078125e-07, 0.0, 0.0, -5.329070518200751e-15, -0.6646065711975098, 1.0}, + {1.0, 0.0, 0.0, 0.0, 0.0, 7.549790126404332e-08, 1.0, 0.0, 0.0, -1.0, 1.1920928955078125e-07, 0.0, 0.0, -1.0658141036401503e-14, -0.3219858407974243, 1.0}, + {1.0, 0.0, 0.0, 0.0, 0.0, 7.549790126404332e-08, 1.0, 0.0, 0.0, -1.0, 1.1920928955078125e-07, 0.0, 0.0, -7.105427357601002e-15, 0.03573417663574219, 1.0}, + {1.0, 0.0, 0.0, 0.0, 0.0, 7.549790126404332e-08, 1.0, 0.0, 0.0, -1.0, 1.1920928955078125e-07, 0.0, 0.0, -2.1316282072803006e-14, 0.4143662452697754, 1.0}, + {1.0, 0.0, 0.0, 0.0, 0.0, 7.549790126404332e-08, 1.0, 0.0, 0.0, -1.0, 1.1920928955078125e-07, 0.0, 0.0, -2.842170943040401e-14, 0.783106803894043, 1.0}, + {1.0, 0.0, 0.0, 0.0, 0.0, 7.549790126404332e-08, 1.0, 0.0, 0.0, -1.0, 1.1920928955078125e-07, 0.0, 0.0, -4.263256414560601e-14, 1.107043743133545, 1.0}, + {1.0, 0.0, 0.0, 0.0, 0.0, 7.549790126404332e-08, 1.0, 0.0, 0.0, -1.0, 1.1920928955078125e-07, 0.0, 0.0, 0.0, 1.336852788925171, 1.0}, + {1.0, 0.0, 0.0, 0.0, 0.0, 7.549790126404332e-08, 1.0, 0.0, 0.0, -1.0, 1.1920928955078125e-07, 0.0, 0.0, 0.0, 1.4077997207641602, 1.0}, + {0.9968345165252686, 0.004770307336002588, -0.07936043292284012, 0.0, 0.07932798564434052, 0.0066454727202653885, 0.9968264102935791, 0.0, 0.005282556638121605, -0.999966561794281, 0.006246061529964209, 0.0, 0.0, -1.5018031263025478e-10, 1.193772792816162, 1.0}, + {0.9586331844329834, 0.014647734351456165, -0.2842673063278198, 0.0, 0.2838432490825653, 0.02568591758608818, 0.958526611328125, 0.0, 0.021341906860470772, -0.999562680721283, 0.020465753972530365, 0.0, 0.0, -5.793054924652097e-10, 0.6453161239624023, 1.0}, + {0.8506482243537903, 0.021145351231098175, -0.5253098607063293, 0.0, 0.5237787961959839, 0.05203593522310257, 0.8502635359764099, 0.0, 0.045314110815525055, -0.998421311378479, 0.0331888347864151, 0.0, 0.0, -1.820744444103184e-09, -0.03725719451904297, 1.0}, + {0.6941250562667847, 0.020735321566462517, -0.7195556163787842, 0.0, 0.7164199948310852, 0.07762672752141953, 0.6933372616767883, 0.0, 0.07023332267999649, -0.9967668652534485, 0.03902750834822655, 0.0, 0.0, 1.1254535081661743e-09, -0.6890351176261902, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0}, + {0.60616135597229, 0.018376996740698814, -0.7951292991638184, 0.0, 0.7910918593406677, 0.0892796441912651, 0.6051468849182129, 0.0, 0.08210964500904083, -0.9958370327949524, 0.03958002105355263, 0.0, 0.0, 0.0, -1.0, 1.0} + } + } + } + } + } + + BoneNode $node3 + { + Name {string {"Bone.001"}} + + Transform %transform + { + float[16] + { + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, + 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, + 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, + -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0} + } + } + + Animation + { + Track (target = %transform) + { + Time + { + Key {float {0.0, 0.041666666666666664, 0.08333333333333333, 0.125, 0.16666666666666666, 0.20833333333333331, 0.25, 0.29166666666666663, 0.3333333333333333, 0.375, 0.41666666666666663, 0.4583333333333333, 0.5, 0.5416666666666666, 0.5833333333333333, 0.625, 0.6666666666666666, 0.7083333333333333, 0.75, 0.7916666666666666, 0.8333333333333333, 0.875, 0.9166666666666666, 0.9583333333333333, 1.0, 1.0416666666666665, 1.0833333333333333, 1.125, 1.1666666666666665, 1.2083333333333333, 1.25, 1.2916666666666665, 1.3333333333333333, 1.375, 1.4166666666666665, 1.4583333333333333, 1.5, 1.5416666666666665, 1.5833333333333333, 1.625, 1.6666666666666665, 1.7083333333333333, 1.75, 1.7916666666666665, 1.8333333333333333, 1.875, 1.9166666666666665, 1.9583333333333333, 2.0, 2.0416666666666665, 2.083333333333333, 2.125, 2.1666666666666665, 2.208333333333333, 2.25, 2.2916666666666665, 2.333333333333333, 2.375, 2.4166666666666665, 2.458333333333333, 2.5, 2.5416666666666665, 2.583333333333333, 2.625, 2.6666666666666665, 2.708333333333333, 2.75, 2.7916666666666665, 2.833333333333333, 2.875, 2.9166666666666665, 2.958333333333333, 3.0, 3.0416666666666665, 3.083333333333333, 3.125, 3.1666666666666665, 3.208333333333333, 3.25, 3.2916666666666665, 3.333333333333333, 3.375, 3.4166666666666665, 3.458333333333333, 3.5, 3.5416666666666665, 3.583333333333333, 3.625, 3.6666666666666665, 3.708333333333333, 3.75, 3.7916666666666665, 3.833333333333333, 3.875, 3.9166666666666665, 3.958333333333333, 4.0, 4.041666666666666, 4.083333333333333, 4.125, 4.166666666666666, 4.208333333333333, 4.25, 4.291666666666666, 4.333333333333333, 4.375, 4.416666666666666, 4.458333333333333, 4.5, 4.541666666666666, 4.583333333333333, 4.625, 4.666666666666666, 4.708333333333333, 4.75, 4.791666666666666, 4.833333333333333, 4.875, 4.916666666666666, 4.958333333333333, 5.0, 5.041666666666666, 5.083333333333333, 5.125, 5.166666666666666, 5.208333333333333, 5.25, 5.291666666666666, 5.333333333333333, 5.375, 5.416666666666666, 5.458333333333333, 5.5, 5.541666666666666, 5.583333333333333, 5.625, 5.666666666666666, 5.708333333333333, 5.75, 5.791666666666666, 5.833333333333333, 5.875, 5.916666666666666, 5.958333333333333, 6.0, 6.041666666666666, 6.083333333333333, 6.125, 6.166666666666666, 6.208333333333333, 6.25, 6.291666666666666, 6.333333333333333, 6.375, 6.416666666666666, 6.458333333333333, 6.5, 6.541666666666666, 6.583333333333333, 6.625, 6.666666666666666, 6.708333333333333, 6.75, 6.791666666666666, 6.833333333333333, 6.875, 6.916666666666666, 6.958333333333333, 7.0, 7.041666666666666, 7.083333333333333, 7.125, 7.166666666666666, 7.208333333333333, 7.25, 7.291666666666666, 7.333333333333333, 7.375, 7.416666666666666, 7.458333333333333, 7.5, 7.541666666666666, 7.583333333333333, 7.625, 7.666666666666666, 7.708333333333333, 7.75, 7.791666666666666, 7.833333333333333, 7.875, 7.916666666666666, 7.958333333333333, 8.0, 8.041666666666666, 8.083333333333332, 8.125, 8.166666666666666, 8.208333333333332, 8.25, 8.291666666666666, 8.333333333333332, 8.375, 8.416666666666666, 8.458333333333332, 8.5, 8.541666666666666, 8.583333333333332, 8.625, 8.666666666666666, 8.708333333333332, 8.75, 8.791666666666666, 8.833333333333332, 8.875, 8.916666666666666, 8.958333333333332, 9.0, 9.041666666666666, 9.083333333333332, 9.125, 9.166666666666666, 9.208333333333332, 9.25, 9.291666666666666, 9.333333333333332, 9.375, 9.416666666666666, 9.458333333333332, 9.5, 9.541666666666666, 9.583333333333332, 9.625, 9.666666666666666, 9.708333333333332, 9.75, 9.791666666666666, 9.833333333333332, 9.875, 9.916666666666666, 9.958333333333332, 10.0, 10.041666666666666, 10.083333333333332, 10.125, 10.166666666666666, 10.208333333333332, 10.25, 10.291666666666666, 10.333333333333332, 10.416666666666666}} + } + + Value + { + Key + { + float[16] + { + {0.99998539686203, -0.005406782031059265, -1.390114690025257e-10, 0.0, 0.005406782031059265, 0.99998539686203, -5.684341886080802e-14, 0.0, 1.3900973427904972e-10, -6.963318810448982e-13, 1.0, 0.0, 0.0, 2.0, 0.0, 1.0}, + {0.9996087551116943, -0.02796982228755951, -7.536060664392608e-10, 0.0, 0.02796982228755951, 0.9996087551116943, -1.9895196601282805e-12, 0.0, 7.533667578663028e-10, -1.9092283309873892e-11, 1.0, 0.0, 0.0, 2.0, -7.105427357601002e-15, 1.0}, + {0.998104453086853, -0.06154263764619827, -1.7958701192810622e-09, 0.0, 0.06154263764619827, 0.998104453086853, -1.3848477919964353e-11, 0.0, 1.7933182716589613e-09, -9.670486633694964e-11, 1.0, 0.0, 0.0, 2.0, 0.0, 1.0}, + {0.9950809478759766, -0.09906430542469025, -3.277446314342569e-09, 0.0, 0.09906430542469025, 0.9950809478759766, -5.496758603840135e-11, 0.0, 3.2667701876931687e-09, -2.6998492330676527e-10, 1.0, 0.0, 0.0, 2.0, 1.1546319456101628e-14, 1.0}, + {0.9903477430343628, -0.1386050283908844, -5.431212812823105e-09, 0.0, 0.1386050283908844, 0.9903477430343628, -1.6623857845843304e-10, 0.0, 5.4018305384317955e-09, -5.881588549527805e-10, 1.0, 0.0, 0.0, 2.0, -1.4210854715202004e-14, 1.0}, + {0.9839622378349304, -0.1783764809370041, -8.292688313815688e-09, 0.0, 0.1783764809370041, 0.9839622378349304, -3.922409064216481e-10, 0.0, 8.229660508618508e-09, -1.0932694749499205e-09, 1.0, 0.0, 0.0, 2.0, 3.552713678800501e-15, 1.0}, + {0.9762129187583923, -0.21681402623653412, -1.2188721143502335e-08, 0.0, 0.21681402623653412, 0.9762129187583923, -8.111058491522272e-10, 0.0, 1.207464617181131e-08, -1.8508714560994122e-09, 1.0, 0.0, 0.0, 2.0, 0.0, 1.0}, + {0.9676145911216736, -0.2524321675300598, -1.801474169838002e-08, 0.0, 0.2524321675300598, 0.9676145911216736, -1.5917152040856308e-09, 0.0, 1.783312697511974e-08, -3.0073294965404784e-09, 1.0, 0.0, 0.0, 2.0, -1.4210854715202004e-14, 1.0}, + {0.9592233300209045, -0.28264933824539185, -2.764549833500496e-08, 0.0, 0.28264933824539185, 0.9592233300209045, -3.078554300373071e-09, 0.0, 2.7388358248003897e-08, -4.86095785845464e-09, 1.0, 0.0, 0.0, 2.0, 0.0, 1.0}, + {0.950993537902832, -0.3092105984687805, -0.0003345899749547243, 0.0, 0.3092101812362671, 0.9509932398796082, -0.0008838314097374678, 0.0, 0.0005914823850616813, 0.0007370596285909414, 0.9999995827674866, 0.0, -1.0026269592344761e-08, 2.0, 2.3283064365386963e-10, 1.0}, + {0.9428225159645081, -0.3332933187484741, -0.0011517913080751896, 0.0, 0.333288311958313, 0.9428197741508484, -0.0031636878848075867, 0.0, 0.0021403636783361435, 0.002598921302706003, 0.9999943375587463, 0.0, -4.3248292058706284e-08, 2.0, 4.6566128730773926e-09, 1.0}, + {0.9348952174186707, -0.3549171984195709, -0.002113759983330965, 0.0, 0.35489967465400696, 0.9348850250244141, -0.006020858883857727, 0.0, 0.0041130222380161285, 0.004878699779510498, 0.999979555606842, 0.0, 9.313225746154785e-10, 2.0, 2.444721758365631e-09, 1.0}, + {0.9280364513397217, -0.372477263212204, -0.0029847286641597748, 0.0, 0.37244024872779846, 0.9280146956443787, -0.00876521598547697, 0.0, 0.006034722551703453, 0.007022816687822342, 0.9999570846557617, 0.0, 8.381903171539307e-09, 2.0, 1.862645149230957e-09, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0}, + {0.9249670505523682, -0.38003239035606384, -0.00338633731007576, 0.0, 0.3799836337566376, 0.9249383211135864, -0.01007908396422863, 0.0, 0.006962524726986885, 0.008036062121391296, 0.9999434947967529, 0.0, -9.66247171163559e-08, 2.000000238418579, 0.0, 1.0} + } + } + } + } + } + + BoneNode $node4 + { + Name {string {"Bone.002"}} + + Transform %transform + { + float[16] + { + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, + 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, + 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, + -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0} + } + } + + Animation + { + Track (target = %transform) + { + Time + { + Key {float {0.0, 0.041666666666666664, 0.08333333333333333, 0.125, 0.16666666666666666, 0.20833333333333331, 0.25, 0.29166666666666663, 0.3333333333333333, 0.375, 0.41666666666666663, 0.4583333333333333, 0.5, 0.5416666666666666, 0.5833333333333333, 0.625, 0.6666666666666666, 0.7083333333333333, 0.75, 0.7916666666666666, 0.8333333333333333, 0.875, 0.9166666666666666, 0.9583333333333333, 1.0, 1.0416666666666665, 1.0833333333333333, 1.125, 1.1666666666666665, 1.2083333333333333, 1.25, 1.2916666666666665, 1.3333333333333333, 1.375, 1.4166666666666665, 1.4583333333333333, 1.5, 1.5416666666666665, 1.5833333333333333, 1.625, 1.6666666666666665, 1.7083333333333333, 1.75, 1.7916666666666665, 1.8333333333333333, 1.875, 1.9166666666666665, 1.9583333333333333, 2.0, 2.0416666666666665, 2.083333333333333, 2.125, 2.1666666666666665, 2.208333333333333, 2.25, 2.2916666666666665, 2.333333333333333, 2.375, 2.4166666666666665, 2.458333333333333, 2.5, 2.5416666666666665, 2.583333333333333, 2.625, 2.6666666666666665, 2.708333333333333, 2.75, 2.7916666666666665, 2.833333333333333, 2.875, 2.9166666666666665, 2.958333333333333, 3.0, 3.0416666666666665, 3.083333333333333, 3.125, 3.1666666666666665, 3.208333333333333, 3.25, 3.2916666666666665, 3.333333333333333, 3.375, 3.4166666666666665, 3.458333333333333, 3.5, 3.5416666666666665, 3.583333333333333, 3.625, 3.6666666666666665, 3.708333333333333, 3.75, 3.7916666666666665, 3.833333333333333, 3.875, 3.9166666666666665, 3.958333333333333, 4.0, 4.041666666666666, 4.083333333333333, 4.125, 4.166666666666666, 4.208333333333333, 4.25, 4.291666666666666, 4.333333333333333, 4.375, 4.416666666666666, 4.458333333333333, 4.5, 4.541666666666666, 4.583333333333333, 4.625, 4.666666666666666, 4.708333333333333, 4.75, 4.791666666666666, 4.833333333333333, 4.875, 4.916666666666666, 4.958333333333333, 5.0, 5.041666666666666, 5.083333333333333, 5.125, 5.166666666666666, 5.208333333333333, 5.25, 5.291666666666666, 5.333333333333333, 5.375, 5.416666666666666, 5.458333333333333, 5.5, 5.541666666666666, 5.583333333333333, 5.625, 5.666666666666666, 5.708333333333333, 5.75, 5.791666666666666, 5.833333333333333, 5.875, 5.916666666666666, 5.958333333333333, 6.0, 6.041666666666666, 6.083333333333333, 6.125, 6.166666666666666, 6.208333333333333, 6.25, 6.291666666666666, 6.333333333333333, 6.375, 6.416666666666666, 6.458333333333333, 6.5, 6.541666666666666, 6.583333333333333, 6.625, 6.666666666666666, 6.708333333333333, 6.75, 6.791666666666666, 6.833333333333333, 6.875, 6.916666666666666, 6.958333333333333, 7.0, 7.041666666666666, 7.083333333333333, 7.125, 7.166666666666666, 7.208333333333333, 7.25, 7.291666666666666, 7.333333333333333, 7.375, 7.416666666666666, 7.458333333333333, 7.5, 7.541666666666666, 7.583333333333333, 7.625, 7.666666666666666, 7.708333333333333, 7.75, 7.791666666666666, 7.833333333333333, 7.875, 7.916666666666666, 7.958333333333333, 8.0, 8.041666666666666, 8.083333333333332, 8.125, 8.166666666666666, 8.208333333333332, 8.25, 8.291666666666666, 8.333333333333332, 8.375, 8.416666666666666, 8.458333333333332, 8.5, 8.541666666666666, 8.583333333333332, 8.625, 8.666666666666666, 8.708333333333332, 8.75, 8.791666666666666, 8.833333333333332, 8.875, 8.916666666666666, 8.958333333333332, 9.0, 9.041666666666666, 9.083333333333332, 9.125, 9.166666666666666, 9.208333333333332, 9.25, 9.291666666666666, 9.333333333333332, 9.375, 9.416666666666666, 9.458333333333332, 9.5, 9.541666666666666, 9.583333333333332, 9.625, 9.666666666666666, 9.708333333333332, 9.75, 9.791666666666666, 9.833333333333332, 9.875, 9.916666666666666, 9.958333333333332, 10.0, 10.041666666666666, 10.083333333333332, 10.125, 10.166666666666666, 10.208333333333332, 10.25, 10.291666666666666, 10.333333333333332, 10.416666666666666}} + } + + Value + { + Key + { + float[16] + { + {0.9998303651809692, -0.018419725820422173, -8.603757123637479e-06, 0.0, 0.01841968111693859, 0.9998287558555603, -0.0017633307725191116, 0.0, 4.108235953026451e-05, 0.0017628733767196536, 0.9999984502792358, 0.0, -1.5265566588595902e-16, 2.0, -3.1594735508400085e-15, 1.0}, + {0.99556964635849, -0.09402582794427872, 0.0002559016866143793, 0.0, 0.09402431547641754, 0.9955291152000427, -0.009012938477098942, 0.0, 0.0005926914745941758, 0.008997070603072643, 0.9999593496322632, 0.0, -7.771561172376096e-16, 2.0, -6.3178628995075314e-15, 1.0}, + {0.9817260503768921, -0.19029591977596283, 0.001218294259160757, 0.0, 0.19028609991073608, 0.9815584421157837, -0.018280792981386185, 0.0, 0.002282932633534074, 0.018178554251790047, 0.9998321533203125, 0.0, 1.4901159417490817e-08, 1.9999998807907104, 2.4022450695326825e-14, 1.0}, + {0.957146942615509, -0.28958943486213684, 0.0027998839505016804, 0.0, 0.2895524501800537, 0.9567543268203735, -0.027937568724155426, 0.0, 0.005411623045802116, 0.027551067993044853, 0.9996057748794556, 0.0, -2.581268532253489e-15, 1.9999996423721313, -1.1823875212257917e-14, 1.0}, + {0.9201236367225647, -0.39159780740737915, 0.0048621357418596745, 0.0, 0.3914887011051178, 0.9193943738937378, -0.0380869060754776, 0.0, 0.010444524697959423, 0.03694813326001167, 0.9992625713348389, 0.0, -3.3306690738754696e-15, 1.9999996423721313, -5.662137425588298e-15, 1.0}, + {0.8738107681274414, -0.48621493577957153, 0.007058457005769014, 0.0, 0.4859645962715149, 0.8726657032966614, -0.04788554832339287, 0.0, 0.017122996971011162, 0.0452730692923069, 0.9988277554512024, 0.0, -2.980232594040899e-08, 2.0, 2.90878432451791e-14, 1.0}, + {0.8255133628845215, -0.5643212199211121, 0.008321394212543964, 0.0, 0.5638235807418823, 0.8239501118659973, -0.05665008723735809, 0.0, 0.025112425908446312, 0.05145720764994621, 0.9983594417572021, 0.0, -4.107825191113079e-15, 2.000000238418579, 4.39648317751562e-14, 1.0}, + {0.7873581647872925, -0.6164620518684387, 0.006453604903072119, 0.0, 0.6155420541763306, 0.7855148911476135, -0.06383142620325089, 0.0, 0.03428024426102638, 0.05423066392540932, 0.9979398250579834, 0.0, -2.980232594040899e-08, 1.999999761581421, 3.8191672047105385e-14, 1.0}, + {0.7748236656188965, -0.6321731805801392, -0.0023209843784570694, 0.0, 0.6305439472198486, 0.7730801701545715, -0.06900372356176376, 0.0, 0.045416608452796936, 0.05200223624706268, 0.9976137280464172, 0.0, -5.960464477539063e-08, 2.0, 1.7763568394002505e-14, 1.0}, + {0.8074691891670227, -0.5886243581771851, -0.03892109543085098, 0.0, 0.5863680243492126, 0.808091402053833, -0.05621962621808052, 0.0, 0.06454404443502426, 0.022573530673980713, 0.99765944480896, 0.0, 6.487971404567361e-08, 1.9999991655349731, 2.3283064365386963e-09, 1.0}, + {0.8808358907699585, -0.4640212655067444, -0.09387394785881042, 0.0, 0.46567919850349426, 0.8849409818649292, -0.004735782742500305, 0.0, 0.08527040481567383, -0.03954368457198143, 0.9955728054046631, 0.0, 3.054155968129635e-07, 1.9999998807907104, -3.725290298461914e-09, 1.0}, + {0.9460473656654358, -0.2901986837387085, -0.14414870738983154, 0.0, 0.30241769552230835, 0.950512170791626, 0.07120470702648163, 0.0, 0.11635158210992813, -0.11095614731311798, 0.9869906306266785, 0.0, -4.976755008101463e-08, 2.0, -9.313225746154785e-09, 1.0}, + {0.9779366850852966, -0.11382757872343063, -0.17516571283340454, 0.0, 0.14079923927783966, 0.9785844683647156, 0.15015996992588043, 0.0, 0.15432210266590118, -0.17151014506816864, 0.9730204939842224, 0.0, 7.636845111846924e-08, 2.0, -4.377216100692749e-08, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0}, + {0.9825077652931213, -0.029007740318775177, -0.1839495450258255, 0.0, 0.06423753499984741, 0.9799563884735107, 0.1885710209608078, 0.0, 0.17479248344898224, -0.19708889722824097, 0.9646778702735901, 0.0, -5.9138983488082886e-08, 2.0, 1.862645149230957e-09, 1.0} + } + } + } + } + } + + BoneNode $node5 + { + Name {string {"Bone.003"}} + + Transform %transform + { + float[16] + { + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, + -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, + 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, + 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0} + } + } + + Animation + { + Track (target = %transform) + { + Time + { + Key {float {0.0, 0.041666666666666664, 0.08333333333333333, 0.125, 0.16666666666666666, 0.20833333333333331, 0.25, 0.29166666666666663, 0.3333333333333333, 0.375, 0.41666666666666663, 0.4583333333333333, 0.5, 0.5416666666666666, 0.5833333333333333, 0.625, 0.6666666666666666, 0.7083333333333333, 0.75, 0.7916666666666666, 0.8333333333333333, 0.875, 0.9166666666666666, 0.9583333333333333, 1.0, 1.0416666666666665, 1.0833333333333333, 1.125, 1.1666666666666665, 1.2083333333333333, 1.25, 1.2916666666666665, 1.3333333333333333, 1.375, 1.4166666666666665, 1.4583333333333333, 1.5, 1.5416666666666665, 1.5833333333333333, 1.625, 1.6666666666666665, 1.7083333333333333, 1.75, 1.7916666666666665, 1.8333333333333333, 1.875, 1.9166666666666665, 1.9583333333333333, 2.0, 2.0416666666666665, 2.083333333333333, 2.125, 2.1666666666666665, 2.208333333333333, 2.25, 2.2916666666666665, 2.333333333333333, 2.375, 2.4166666666666665, 2.458333333333333, 2.5, 2.5416666666666665, 2.583333333333333, 2.625, 2.6666666666666665, 2.708333333333333, 2.75, 2.7916666666666665, 2.833333333333333, 2.875, 2.9166666666666665, 2.958333333333333, 3.0, 3.0416666666666665, 3.083333333333333, 3.125, 3.1666666666666665, 3.208333333333333, 3.25, 3.2916666666666665, 3.333333333333333, 3.375, 3.4166666666666665, 3.458333333333333, 3.5, 3.5416666666666665, 3.583333333333333, 3.625, 3.6666666666666665, 3.708333333333333, 3.75, 3.7916666666666665, 3.833333333333333, 3.875, 3.9166666666666665, 3.958333333333333, 4.0, 4.041666666666666, 4.083333333333333, 4.125, 4.166666666666666, 4.208333333333333, 4.25, 4.291666666666666, 4.333333333333333, 4.375, 4.416666666666666, 4.458333333333333, 4.5, 4.541666666666666, 4.583333333333333, 4.625, 4.666666666666666, 4.708333333333333, 4.75, 4.791666666666666, 4.833333333333333, 4.875, 4.916666666666666, 4.958333333333333, 5.0, 5.041666666666666, 5.083333333333333, 5.125, 5.166666666666666, 5.208333333333333, 5.25, 5.291666666666666, 5.333333333333333, 5.375, 5.416666666666666, 5.458333333333333, 5.5, 5.541666666666666, 5.583333333333333, 5.625, 5.666666666666666, 5.708333333333333, 5.75, 5.791666666666666, 5.833333333333333, 5.875, 5.916666666666666, 5.958333333333333, 6.0, 6.041666666666666, 6.083333333333333, 6.125, 6.166666666666666, 6.208333333333333, 6.25, 6.291666666666666, 6.333333333333333, 6.375, 6.416666666666666, 6.458333333333333, 6.5, 6.541666666666666, 6.583333333333333, 6.625, 6.666666666666666, 6.708333333333333, 6.75, 6.791666666666666, 6.833333333333333, 6.875, 6.916666666666666, 6.958333333333333, 7.0, 7.041666666666666, 7.083333333333333, 7.125, 7.166666666666666, 7.208333333333333, 7.25, 7.291666666666666, 7.333333333333333, 7.375, 7.416666666666666, 7.458333333333333, 7.5, 7.541666666666666, 7.583333333333333, 7.625, 7.666666666666666, 7.708333333333333, 7.75, 7.791666666666666, 7.833333333333333, 7.875, 7.916666666666666, 7.958333333333333, 8.0, 8.041666666666666, 8.083333333333332, 8.125, 8.166666666666666, 8.208333333333332, 8.25, 8.291666666666666, 8.333333333333332, 8.375, 8.416666666666666, 8.458333333333332, 8.5, 8.541666666666666, 8.583333333333332, 8.625, 8.666666666666666, 8.708333333333332, 8.75, 8.791666666666666, 8.833333333333332, 8.875, 8.916666666666666, 8.958333333333332, 9.0, 9.041666666666666, 9.083333333333332, 9.125, 9.166666666666666, 9.208333333333332, 9.25, 9.291666666666666, 9.333333333333332, 9.375, 9.416666666666666, 9.458333333333332, 9.5, 9.541666666666666, 9.583333333333332, 9.625, 9.666666666666666, 9.708333333333332, 9.75, 9.791666666666666, 9.833333333333332, 9.875, 9.916666666666666, 9.958333333333332, 10.0, 10.041666666666666, 10.083333333333332, 10.125, 10.166666666666666, 10.208333333333332, 10.25, 10.291666666666666, 10.333333333333332, 10.416666666666666}} + } + + Value + { + Key + { + float[16] + { + {0.9998535513877869, -0.0171112809330225, -0.0003685634001158178, 0.0, 0.017110655084252357, 0.999852180480957, -0.0016415215795859694, 0.0, 0.0003965974901802838, 0.00163497484754771, 0.9999985694885254, 0.0, 7.985168082313976e-09, 1.9999998807907104, 1.4172201190376654e-09, 1.0}, + {0.99617999792099, -0.08730863034725189, -0.0016472802963107824, 0.0, 0.08729174733161926, 0.9961469769477844, -0.008450078777968884, 0.0, 0.002378697507083416, 0.00827400479465723, 0.9999628663063049, 0.0, -5.346146281226538e-08, 2.000000238418579, 1.076841726899147e-09, 1.0}, + {0.9842608571052551, -0.17669367790222168, -0.003115090075880289, 0.0, 0.17661485075950623, 0.984127402305603, -0.017335984855890274, 0.0, 0.006128805223852396, 0.01651296392083168, 0.9998448491096497, 0.0, 3.9919541450217366e-08, 2.000000238418579, -1.6298145055770874e-09, 1.0}, + {0.9631130695343018, -0.2690659165382385, -0.004057837650179863, 0.0, 0.2688665986061096, 0.9628039598464966, -0.026811201125383377, 0.0, 0.011120885610580444, 0.02473120391368866, 0.9996322989463806, 0.0, 4.3197360355407e-07, 1.9999985694885254, -9.313225746154785e-10, 1.0}, + {0.9312379956245422, -0.36438873410224915, -0.004076903685927391, 0.0, 0.3640033006668091, 0.9306660890579224, -0.03690888732671738, 0.0, 0.017243413254618645, 0.032886963337659836, 0.9993102550506592, 0.0, 1.2869713827967644e-07, 2.0, 1.4901161193847656e-08, 1.0}, + {0.8912753462791443, -0.4534505009651184, -0.0032811351120471954, 0.0, 0.45282161235809326, 0.8903771042823792, -0.04670386016368866, 0.0, 0.024099336937069893, 0.04014022275805473, 0.9989033341407776, 0.0, -2.0809238776564598e-07, 1.9999998807907104, 2.2351741790771484e-08, 1.0}, + {0.8494575023651123, -0.5276526212692261, -0.002196116838604212, 0.0, 0.5267446041107178, 0.8482257723808289, -0.0552581287920475, 0.0, 0.031019892543554306, 0.04578263685107231, 0.9984696507453918, 0.0, 8.325441740453243e-07, 1.9999996423721313, 2.9802322387695312e-08, 1.0}, + {0.8163166642189026, -0.5776014924049377, -0.0018760396633297205, 0.0, 0.5764156579971313, 0.8148403763771057, -0.06148165091872215, 0.0, 0.03704055771231651, 0.04910712316632271, 0.9981062412261963, 0.0, -6.396439857780933e-07, 1.9999998807907104, 6.705522537231445e-08, 1.0}, + {0.8055055141448975, -0.5925763249397278, -0.003763732500374317, 0.0, 0.5911692380905151, 0.8039997220039368, -0.06406132876873016, 0.0, 0.040987275540828705, 0.04937676712870598, 0.9979390501976013, 0.0, 3.447930794209242e-07, 2.000000476837158, 0.0, 1.0}, + {0.8542895317077637, -0.5196048021316528, -0.014153274707496166, 0.0, 0.5183572173118591, 0.8536322116851807, -0.051167406141757965, 0.0, 0.03866852447390556, 0.03637533634901047, 0.9985898733139038, 0.0, 3.762543201446533e-07, 2.0000007152557373, 2.0489096641540527e-08, 1.0}, + {0.9508073925971985, -0.3083057403564453, -0.030209437012672424, 0.0, 0.30806994438171387, 0.9512842297554016, -0.012287444435060024, 0.0, 0.03252605348825455, 0.0023763813078403473, 0.9994679689407349, 0.0, -5.103647708892822e-07, 1.9999998807907104, 4.470348358154297e-08, 1.0}, + {0.9992246627807617, -0.016185127198696136, -0.03589220345020294, 0.0, 0.017647428438067436, 0.999011218547821, 0.04080595448613167, 0.0, 0.03519627824425697, -0.04140771925449371, 0.9985222816467285, 0.0, 3.427267074584961e-07, 1.9999995231628418, 0.0, 1.0}, + {0.9651547074317932, 0.26034310460090637, -0.02642226219177246, 0.0, -0.25707417726516724, 0.9621812701225281, 0.0901108905673027, 0.0, 0.04888272285461426, -0.08017844706773758, 0.995581328868866, 0.0, 2.384185791015625e-07, 2.0000007152557373, 3.725290298461914e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0}, + {0.9240012168884277, 0.38199254870414734, -0.01741916313767433, 0.0, -0.3778752088546753, 0.9191241264343262, 0.11145023256540298, 0.0, 0.05858350172638893, -0.09639788419008255, 0.9936173558235168, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -5.960464477539063e-08, 1.0} + } + } + } + } + } + } + + BoneNode $node6 + { + Name {string {"Bone.004"}} + + Transform %transform + { + float[16] + { + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, + 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, + 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, + 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0} + } + } + + Animation + { + Track (target = %transform) + { + Time + { + Key {float {0.0, 0.041666666666666664, 0.08333333333333333, 0.125, 0.16666666666666666, 0.20833333333333331, 0.25, 0.29166666666666663, 0.3333333333333333, 0.375, 0.41666666666666663, 0.4583333333333333, 0.5, 0.5416666666666666, 0.5833333333333333, 0.625, 0.6666666666666666, 0.7083333333333333, 0.75, 0.7916666666666666, 0.8333333333333333, 0.875, 0.9166666666666666, 0.9583333333333333, 1.0, 1.0416666666666665, 1.0833333333333333, 1.125, 1.1666666666666665, 1.2083333333333333, 1.25, 1.2916666666666665, 1.3333333333333333, 1.375, 1.4166666666666665, 1.4583333333333333, 1.5, 1.5416666666666665, 1.5833333333333333, 1.625, 1.6666666666666665, 1.7083333333333333, 1.75, 1.7916666666666665, 1.8333333333333333, 1.875, 1.9166666666666665, 1.9583333333333333, 2.0, 2.0416666666666665, 2.083333333333333, 2.125, 2.1666666666666665, 2.208333333333333, 2.25, 2.2916666666666665, 2.333333333333333, 2.375, 2.4166666666666665, 2.458333333333333, 2.5, 2.5416666666666665, 2.583333333333333, 2.625, 2.6666666666666665, 2.708333333333333, 2.75, 2.7916666666666665, 2.833333333333333, 2.875, 2.9166666666666665, 2.958333333333333, 3.0, 3.0416666666666665, 3.083333333333333, 3.125, 3.1666666666666665, 3.208333333333333, 3.25, 3.2916666666666665, 3.333333333333333, 3.375, 3.4166666666666665, 3.458333333333333, 3.5, 3.5416666666666665, 3.583333333333333, 3.625, 3.6666666666666665, 3.708333333333333, 3.75, 3.7916666666666665, 3.833333333333333, 3.875, 3.9166666666666665, 3.958333333333333, 4.0, 4.041666666666666, 4.083333333333333, 4.125, 4.166666666666666, 4.208333333333333, 4.25, 4.291666666666666, 4.333333333333333, 4.375, 4.416666666666666, 4.458333333333333, 4.5, 4.541666666666666, 4.583333333333333, 4.625, 4.666666666666666, 4.708333333333333, 4.75, 4.791666666666666, 4.833333333333333, 4.875, 4.916666666666666, 4.958333333333333, 5.0, 5.041666666666666, 5.083333333333333, 5.125, 5.166666666666666, 5.208333333333333, 5.25, 5.291666666666666, 5.333333333333333, 5.375, 5.416666666666666, 5.458333333333333, 5.5, 5.541666666666666, 5.583333333333333, 5.625, 5.666666666666666, 5.708333333333333, 5.75, 5.791666666666666, 5.833333333333333, 5.875, 5.916666666666666, 5.958333333333333, 6.0, 6.041666666666666, 6.083333333333333, 6.125, 6.166666666666666, 6.208333333333333, 6.25, 6.291666666666666, 6.333333333333333, 6.375, 6.416666666666666, 6.458333333333333, 6.5, 6.541666666666666, 6.583333333333333, 6.625, 6.666666666666666, 6.708333333333333, 6.75, 6.791666666666666, 6.833333333333333, 6.875, 6.916666666666666, 6.958333333333333, 7.0, 7.041666666666666, 7.083333333333333, 7.125, 7.166666666666666, 7.208333333333333, 7.25, 7.291666666666666, 7.333333333333333, 7.375, 7.416666666666666, 7.458333333333333, 7.5, 7.541666666666666, 7.583333333333333, 7.625, 7.666666666666666, 7.708333333333333, 7.75, 7.791666666666666, 7.833333333333333, 7.875, 7.916666666666666, 7.958333333333333, 8.0, 8.041666666666666, 8.083333333333332, 8.125, 8.166666666666666, 8.208333333333332, 8.25, 8.291666666666666, 8.333333333333332, 8.375, 8.416666666666666, 8.458333333333332, 8.5, 8.541666666666666, 8.583333333333332, 8.625, 8.666666666666666, 8.708333333333332, 8.75, 8.791666666666666, 8.833333333333332, 8.875, 8.916666666666666, 8.958333333333332, 9.0, 9.041666666666666, 9.083333333333332, 9.125, 9.166666666666666, 9.208333333333332, 9.25, 9.291666666666666, 9.333333333333332, 9.375, 9.416666666666666, 9.458333333333332, 9.5, 9.541666666666666, 9.583333333333332, 9.625, 9.666666666666666, 9.708333333333332, 9.75, 9.791666666666666, 9.833333333333332, 9.875, 9.916666666666666, 9.958333333333332, 10.0, 10.041666666666666, 10.083333333333332, 10.125, 10.166666666666666, 10.208333333333332, 10.25, 10.291666666666666, 10.333333333333332, 10.416666666666666}} + } + + Value + { + Key + { + float[16] + { + {1.0, -2.1269785932531704e-09, 3.019822543137707e-07, 0.0, 3.0198953027138487e-07, 1.1932138477277476e-07, -0.9999999403953552, 0.0, 2.6497204430597776e-10, 1.0, 1.1948907285841415e-07, 0.0, 4.259881336565741e-09, 1.9999998807907104, 9.51331458054483e-10, 1.0}, + {1.0, -7.0238002081168815e-09, 3.0183582566678524e-07, 0.0, 3.01864929497242e-07, 1.201988197863102e-07, -1.0, 0.0, -4.310095391701907e-09, 1.0, 1.201988197863102e-07, 0.0, -5.346055331756361e-08, 2.000000238418579, 4.802132025361061e-09, 1.0}, + {1.0, -1.5019395505078137e-08, 3.022141754627228e-07, 0.0, 3.016320988535881e-07, 1.198495738208294e-07, -1.0, 0.0, 5.387846613302827e-09, 1.000000238418579, 1.2130476534366608e-07, 0.0, 3.9919541450217366e-08, 2.000000238418579, -1.6298145055770874e-09, 1.0}, + {0.9999999403953552, -3.0144292395561934e-08, 3.0244700610637665e-07, 0.0, 3.033783286809921e-07, 1.19674950838089e-07, -0.9999999403953552, 0.0, 8.098140824586153e-09, 0.9999999403953552, 1.1920928955078125e-07, 0.0, 3.7232530303299427e-07, 1.9999985694885254, -1.6763806343078613e-08, 1.0}, + {1.0, -5.296897143125534e-09, 3.012828528881073e-07, 0.0, 3.03611159324646e-07, 1.2200325727462769e-07, -0.9999999403953552, 0.0, -2.380693331360817e-08, 1.0, 1.2014061212539673e-07, 0.0, 1.286680344492197e-07, 2.0, 7.450580596923828e-09, 1.0}, + {1.0, 3.245077095925808e-08, 3.0174851417541504e-07, 0.0, 3.022141754627228e-07, 1.1920928955078125e-07, -0.9999999403953552, 0.0, 1.6938429325819016e-08, 0.9999998807907104, 1.1175870895385742e-07, 0.0, -2.0826701074838638e-07, 1.9999998807907104, 0.0, 1.0}, + {1.0, -1.501757651567459e-08, 3.026798367500305e-07, 0.0, 3.0081719160079956e-07, 1.1175870895385742e-07, -1.0, 0.0, 1.1350493878126144e-09, 1.0000001192092896, 1.1734664440155029e-07, 0.0, 8.325441740453243e-07, 1.9999996423721313, 2.9802322387695312e-08, 1.0}, + {0.9999999403953552, -3.777677193284035e-08, 2.9569491744041443e-07, 0.0, 3.045424818992615e-07, 1.1920928955078125e-07, -0.9999998807907104, 0.0, 9.633367881178856e-09, 0.9999998807907104, 1.210719347000122e-07, 0.0, -6.399350240826607e-07, 1.9999998807907104, 2.2351741790771484e-08, 1.0}, + {1.0, 5.326000973582268e-09, 2.9848888516426086e-07, 0.0, 2.919696271419525e-07, 1.1175870895385742e-07, -1.000000238418579, 0.0, 2.278829924762249e-08, 1.0, 1.0617077350616455e-07, 0.0, 3.448221832513809e-07, 2.000000476837158, -1.4901161193847656e-08, 1.0}, + {1.0, 4.6566128730773926e-09, 3.003515303134918e-07, 0.0, 3.0151568353176117e-07, 1.1618249118328094e-07, -1.000000238418579, 0.0, -1.30385160446167e-08, 1.000000238418579, 1.1955853551626205e-07, 0.0, 3.7671998143196106e-07, 2.0000007152557373, 5.587935447692871e-09, 1.0}, + {0.9999999403953552, -6.28642737865448e-09, 2.980232238769531e-07, 0.0, 3.0919909477233887e-07, 1.3224780559539795e-07, -1.0, 0.0, -3.818422555923462e-08, 0.9999999403953552, 1.2479722499847412e-07, 0.0, -5.103647708892822e-07, 1.9999998807907104, 4.470348358154297e-08, 1.0}, + {1.0, -3.527384251356125e-08, 3.026798367500305e-07, 0.0, 2.989545464515686e-07, 1.2200325727462769e-07, -0.9999999403953552, 0.0, 6.542541086673737e-08, 0.9999999403953552, 1.2014061212539673e-07, 0.0, 3.427267074584961e-07, 1.9999995231628418, 0.0, 1.0}, + {0.9999999403953552, 9.313225746154785e-10, 2.9848888516426086e-07, 0.0, 3.059394657611847e-07, 1.1548399925231934e-07, -1.0, 0.0, 4.6566128730773926e-09, 0.9999999403953552, 1.2479722499847412e-07, 0.0, 2.3469328880310059e-07, 2.0000007152557373, 5.21540641784668e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0}, + {1.0, 3.725290298461914e-09, 2.942979335784912e-07, 0.0, 2.952292561531067e-07, 1.2293457984924316e-07, -1.0, 0.0, 2.3283064365386963e-08, 1.0, 1.2293457984924316e-07, 0.0, 1.2293457984924316e-07, 2.0000007152557373, -4.470348358154297e-08, 1.0} + } + } + } + } + } + } + } + } + } + + GeometryNode $node7 + { + Name {string {"Cube.001"}} + ObjectRef {ref {$geometry1}} + MaterialRef (index = 0) {ref {$material1}} + + Transform + { + float[16] + { + {1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0} + } + } + } +} + +GeometryNode $node8 +{ + Name {string {"Cube"}} + ObjectRef {ref {$geometry2}} + MaterialRef (index = 0) {ref {$material2}} + + Transform + { + float[16] + { + {1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0} + } + } +} + +LightNode $node9 +{ + Name {string {"Lamp"}} + ObjectRef {ref {$light1}} + + Transform + { + float[16] + { + {-0.29086464643478394, 0.9551711678504944, -0.05518905818462372, 0.0, + -0.7711008191108704, -0.1998833566904068, 0.6045247316360474, 0.0, + 0.5663931965827942, 0.21839119493961334, 0.7946722507476807, 0.0, + 4.076245307922363, 1.0054539442062378, 5.903861999511719, 1.0} + } + } +} + +CameraNode $node10 +{ + Name {string {"Camera"}} + ObjectRef {ref {$camera1}} + + Transform + { + float[16] + { + {0.6858805418014526, 0.7276337742805481, -0.010816780850291252, 0.0, + -0.31737011671066284, 0.31246861815452576, 0.8953432440757751, 0.0, + 0.6548618674278259, -0.6106656193733215, 0.4452453553676605, 0.0, + 7.481131553649902, -6.5076398849487305, 5.34366512298584, 1.0} + } + } +} + +GeometryObject $geometry2 // Cube +{ + Mesh (primitive = "triangles") + { + VertexArray (attrib = "position") + { + float[3] // 24 + { + {1.0, 0.9999999403953552, -1.0}, {1.0, -1.0, -1.0}, {-1.0000001192092896, -0.9999998211860657, -1.0}, {-0.9999996423721313, 1.0000003576278687, -1.0}, {1.0000004768371582, 0.999999463558197, 1.0}, {-0.9999999403953552, 1.0, 1.0}, {-1.0000003576278687, -0.9999996423721313, 1.0}, {0.9999993443489075, -1.0000005960464478, 1.0}, + {1.0, 0.9999999403953552, -1.0}, {1.0000004768371582, 0.999999463558197, 1.0}, {0.9999993443489075, -1.0000005960464478, 1.0}, {1.0, -1.0, -1.0}, {1.0, -1.0, -1.0}, {0.9999993443489075, -1.0000005960464478, 1.0}, {-1.0000003576278687, -0.9999996423721313, 1.0}, {-1.0000001192092896, -0.9999998211860657, -1.0}, + {-1.0000001192092896, -0.9999998211860657, -1.0}, {-1.0000003576278687, -0.9999996423721313, 1.0}, {-0.9999999403953552, 1.0, 1.0}, {-0.9999996423721313, 1.0000003576278687, -1.0}, {1.0000004768371582, 0.999999463558197, 1.0}, {1.0, 0.9999999403953552, -1.0}, {-0.9999996423721313, 1.0000003576278687, -1.0}, {-0.9999999403953552, 1.0, 1.0} + } + } + + VertexArray (attrib = "normal") + { + float[3] // 24 + { + {0.0, 0.0, -1.0}, {0.0, 0.0, -1.0}, {0.0, 0.0, -1.0}, {0.0, 0.0, -1.0}, {0.0, -0.0, 1.0}, {0.0, -0.0, 1.0}, {0.0, -0.0, 1.0}, {0.0, -0.0, 1.0}, + {1.0, -2.8312206268310547e-07, 4.470341252726939e-08}, {1.0, -2.8312206268310547e-07, 4.470341252726939e-08}, {1.0, -2.8312206268310547e-07, 4.470341252726939e-08}, {1.0, -2.8312206268310547e-07, 4.470341252726939e-08}, {-2.8312206268310547e-07, -1.0, -1.0430819230577981e-07}, {-2.8312206268310547e-07, -1.0, -1.0430819230577981e-07}, {-2.8312206268310547e-07, -1.0, -1.0430819230577981e-07}, {-2.8312206268310547e-07, -1.0, -1.0430819230577981e-07}, + {-1.0, 2.2351744632942427e-07, -1.341104365337742e-07}, {-1.0, 2.2351744632942427e-07, -1.341104365337742e-07}, {-1.0, 2.2351744632942427e-07, -1.341104365337742e-07}, {-1.0, 2.2351744632942427e-07, -1.341104365337742e-07}, {2.384185791015625e-07, 1.0, 2.086162567138672e-07}, {2.384185791015625e-07, 1.0, 2.086162567138672e-07}, {2.384185791015625e-07, 1.0, 2.086162567138672e-07}, {2.384185791015625e-07, 1.0, 2.086162567138672e-07} + } + } + + IndexArray + { + unsigned_int32[3] // 12 + { + {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23} + } + } + } +} + +GeometryObject $geometry1 // Cube.001 +{ + Mesh (primitive = "triangles") + { + VertexArray (attrib = "position") + { + float[3] // 80 + { + {1.0, 0.9999999403953552, -1.0}, {1.0, -1.0, -1.0}, {-1.0000001192092896, -0.9999998211860657, -1.0}, {-0.9999996423721313, 1.0000003576278687, -1.0}, {-0.9999999403953552, 1.0, 1.0}, {-1.0000003576278687, -0.9999996423721313, 1.0}, {-1.0000003576278687, -0.9999996423721313, 3.0}, {-0.9999999403953552, 1.0, 3.0}, + {1.0, 0.9999999403953552, -1.0}, {1.0000004768371582, 0.999999463558197, 1.0}, {0.9999994039535522, -1.0000005960464478, 1.0}, {1.0, -1.0, -1.0}, {1.0, -1.0, -1.0}, {0.9999994039535522, -1.0000005960464478, 1.0}, {-1.0000003576278687, -0.9999996423721313, 1.0}, {-1.0000001192092896, -0.9999998211860657, -1.0}, + {-1.0000001192092896, -0.9999998211860657, -1.0}, {-1.0000003576278687, -0.9999996423721313, 1.0}, {-0.9999999403953552, 1.0, 1.0}, {-0.9999996423721313, 1.0000003576278687, -1.0}, {1.0000004768371582, 0.999999463558197, 1.0}, {1.0, 0.9999999403953552, -1.0}, {-0.9999996423721313, 1.0000003576278687, -1.0}, {-0.9999999403953552, 1.0, 1.0}, + {-0.9545343518257141, -0.9545336365699768, 4.598935604095459}, {-0.9545339345932007, 0.9545340538024902, 4.598935604095459}, {-1.0000003576278687, -0.9999996423721313, 1.0}, {0.9999994039535522, -1.0000005960464478, 1.0}, {0.9999994039535522, -1.0000005960464478, 3.0}, {-1.0000003576278687, -0.9999996423721313, 3.0}, {1.0000004768371582, 0.999999463558197, 1.0}, {-0.9999999403953552, 1.0, 1.0}, + {-0.9999999403953552, 1.0, 3.0}, {1.0000004768371582, 0.999999463558197, 3.0}, {0.9999994039535522, -1.0000005960464478, 1.0}, {1.0000004768371582, 0.999999463558197, 1.0}, {1.0000004768371582, 0.999999463558197, 3.0}, {0.9999994039535522, -1.0000005960464478, 3.0}, {-0.9025039672851562, 0.9025040864944458, 6.0}, {-0.9025043845176697, -0.9025037288665771, 6.0}, + {-0.8504744172096252, -0.8504738211631775, 7.0}, {-0.8504740595817566, 0.8504741191864014, 7.0}, {0.9545332789421082, -0.954534649848938, 4.598935604095459}, {-0.9545343518257141, -0.9545336365699768, 4.598935604095459}, {-0.9545339345932007, 0.9545340538024902, 4.598935604095459}, {0.9545344710350037, 0.9545335173606873, 4.598935604095459}, {0.9545344710350037, 0.9545335173606873, 4.598935604095459}, {0.9545332789421082, -0.954534649848938, 4.598935604095459}, + {0.8504745960235596, 0.8504736423492432, 7.0}, {-0.8504740595817566, 0.8504741191864014, 7.0}, {-0.8504744172096252, -0.8504738211631775, 7.0}, {0.8504735231399536, -0.8504747152328491, 7.0}, {-0.9025043845176697, -0.9025037288665771, 6.0}, {0.9025034308433533, -0.9025047421455383, 6.0}, {0.8504735231399536, -0.8504747152328491, 7.0}, {-0.8504744172096252, -0.8504738211631775, 7.0}, + {0.9025045037269592, 0.9025035500526428, 6.0}, {-0.9025039672851562, 0.9025040864944458, 6.0}, {-0.8504740595817566, 0.8504741191864014, 7.0}, {0.8504745960235596, 0.8504736423492432, 7.0}, {0.9025034308433533, -0.9025047421455383, 6.0}, {0.9025045037269592, 0.9025035500526428, 6.0}, {0.8504745960235596, 0.8504736423492432, 7.0}, {0.8504735231399536, -0.8504747152328491, 7.0}, + {-0.9025039672851562, 0.9025040864944458, 6.0}, {0.9025045037269592, 0.9025035500526428, 6.0}, {0.9025050401687622, 2.9289722442626953, 6.009448051452637}, {-0.9025034308433533, 2.9289727210998535, 6.009448051452637}, {0.9545350074768066, 2.925309658050537, 4.607422351837158}, {-0.9545332789421082, 2.9253101348876953, 4.607422351837158}, {-0.9025034308433533, 2.9289727210998535, 6.009448051452637}, {0.9025050401687622, 2.9289722442626953, 6.009448051452637}, + {-0.9025034308433533, 2.9289727210998535, 6.009448051452637}, {-0.9545332789421082, 2.9253101348876953, 4.607422351837158}, {0.9545344710350037, 0.9545335173606873, 4.598935604095459}, {-0.9545339345932007, 0.9545340538024902, 4.598935604095459}, {-0.9545332789421082, 2.9253101348876953, 4.607422351837158}, {0.9545350074768066, 2.925309658050537, 4.607422351837158}, {0.9545350074768066, 2.925309658050537, 4.607422351837158}, {0.9025050401687622, 2.9289722442626953, 6.009448051452637} + } + } + + VertexArray (attrib = "normal") + { + float[3] // 80 + { + {0.0, 0.0, -1.0}, {0.0, 0.0, -1.0}, {0.0, 0.0, -1.0}, {0.0, 0.0, -1.0}, {-0.999969482421875, 0.0, 0.0}, {-1.0, 0.0, 0.0}, {-0.9998779296875, 0.0, 0.014069032855331898}, {-0.9998779296875, 0.0, 0.014069032855331898}, + {1.0, -2.682209014892578e-07, 2.9802265544276452e-08}, {1.0, -2.682209014892578e-07, 2.9802265544276452e-08}, {1.0, -2.682209014892578e-07, 2.9802265544276452e-08}, {1.0, -2.682209014892578e-07, 2.9802265544276452e-08}, {-2.8312206268310547e-07, -1.0, -1.0430819230577981e-07}, {-2.8312206268310547e-07, -1.0, -1.0430819230577981e-07}, {-2.8312206268310547e-07, -1.0, -1.0430819230577981e-07}, {-2.8312206268310547e-07, -1.0, -1.0430819230577981e-07}, + {-1.0, 2.2351744632942427e-07, -1.341104365337742e-07}, {-1.0, 2.2351744632942427e-07, -1.341104365337742e-07}, {-1.0, 2.2351744632942427e-07, -1.341104365337742e-07}, {-1.0, 2.2351744632942427e-07, -1.341104365337742e-07}, {2.384185791015625e-07, 1.0, 2.086162567138672e-07}, {2.384185791015625e-07, 1.0, 2.086162567138672e-07}, {2.384185791015625e-07, 1.0, 2.086162567138672e-07}, {2.384185791015625e-07, 1.0, 2.086162567138672e-07}, + {-0.99945068359375, 0.0, 0.03265480697154999}, {-0.9993896484375, -3.0518509447574615e-05, 0.03415021300315857}, {0.0, -1.0, 0.0}, {0.0, -0.999969482421875, 0.0}, {0.0, -0.9998779296875, 0.014069032855331898}, {0.0, -0.9998779296875, 0.014069032855331898}, {0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, + {0.0, 0.9998779296875, 0.014069032855331898}, {0.0, 0.9998779296875, 0.014069032855331898}, {1.0, 0.0, 0.0}, {0.999969482421875, 0.0, 0.0}, {0.9998779296875, 0.0, 0.014069032855331898}, {0.9998779296875, 0.0, 0.014069032855331898}, {-0.999114990234375, -3.0518509447574615e-05, 0.04193243384361267}, {-0.9989928603172302, 0.0, 0.04431287571787834}, + {-0.9986266493797302, 0.0, 0.051942504942417145}, {-0.9986266493797302, 0.0, 0.051942504942417145}, {0.0, -0.99945068359375, 0.03265480697154999}, {0.0, -0.99945068359375, 0.03265480697154999}, {0.0, 0.99957275390625, 0.02841273322701454}, {0.0, 0.99957275390625, 0.02841273322701454}, {0.9993896484375, -3.0518509447574615e-05, 0.03415021300315857}, {0.99945068359375, 0.0, 0.03265480697154999}, + {0.0, -0.0, 1.0}, {0.0, -0.0, 1.0}, {0.0, -0.0, 1.0}, {0.0, -0.0, 1.0}, {0.0, -0.9989928603172302, 0.04431287571787834}, {0.0, -0.9989928603172302, 0.04431287571787834}, {0.0, -0.9986266493797302, 0.051942504942417145}, {0.0, -0.9986266493797302, 0.051942504942417145}, + {2.886259267143032e-07, 0.9986491203308105, 0.051959652453660965}, {2.886259267143032e-07, 0.9986491203308105, 0.051959652453660965}, {2.886259267143032e-07, 0.9986491203308105, 0.051959652453660965}, {2.886259267143032e-07, 0.9986491203308105, 0.051959652453660965}, {0.9989928603172302, 0.0, 0.04431287571787834}, {0.999114990234375, -3.0518509447574615e-05, 0.04193243384361267}, {0.9986266493797302, 0.0, 0.051942504942417145}, {0.9986266493797302, 0.0, 0.051942504942417145}, + {-1.2730523302195706e-09, -0.0046622720547020435, 0.9999891519546509}, {-1.2730523302195706e-09, -0.0046622720547020435, 0.9999891519546509}, {-1.2730523302195706e-09, -0.0046622720547020435, 0.9999891519546509}, {-1.2730523302195706e-09, -0.0046622720547020435, 0.9999891519546509}, {2.567408614595479e-07, 0.9999966025352478, -0.002612344454973936}, {2.567408614595479e-07, 0.9999966025352478, -0.002612344454973936}, {2.567408614595479e-07, 0.9999966025352478, -0.002612344454973936}, {2.567408614595479e-07, 0.9999966025352478, -0.002612344454973936}, + {-0.999298095703125, -0.00015259254723787308, 0.03707998991012573}, {-0.999298095703125, -0.00015259254723787308, 0.03707998991012573}, {1.2376770719413344e-09, 0.004306257236748934, -0.999990701675415}, {1.2376770719413344e-09, 0.004306257236748934, -0.999990701675415}, {1.2376770719413344e-09, 0.004306257236748934, -0.999990701675415}, {1.2376770719413344e-09, 0.004306257236748934, -0.999990701675415}, {0.999298095703125, -0.00015259254723787308, 0.03707998991012573}, {0.999298095703125, -0.00015259254723787308, 0.03707998991012573} + } + } + + VertexArray (attrib = "color") + { + float[3] // 80 + { + {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, {1.0, 1.0, 1.0} + } + } + + VertexArray (attrib = "texcoord") + { + float[2] // 80 + { + {0.853708028793335, 0.1462918519973755}, {0.853708028793335, 0.00016813237743917853}, {0.9998317956924438, 0.00016813237743917853}, {0.9998317956924438, 0.1462918221950531}, {0.41687875986099243, 0.15038259327411652}, {0.5629438161849976, 0.14623311161994934}, {0.5670932531356812, 0.29229798913002014}, {0.42102837562561035, 0.29644766449928284}, + {0.1580430120229721, 0.005586784332990646}, {0.15262427926063538, 0.1516100913286209}, {0.0066010053269565105, 0.14619146287441254}, {0.012019664980471134, 0.00016813237743917853}, {0.7135531306266785, 0.00016813237743917853}, {0.7135541439056396, 0.14629174768924713}, {0.5674304962158203, 0.1462927609682083}, {0.5674294829368591, 0.00016910122940316796}, + {0.5587943196296692, 0.00016813237743917853}, {0.5629438161849976, 0.14623311161994934}, {0.41687875986099243, 0.15038259327411652}, {0.412729412317276, 0.004317543003708124}, {0.853708028793335, 0.2924155592918396}, {0.853708028793335, 0.1462918519973755}, {0.9998317956924438, 0.1462918221950531}, {0.9998319149017334, 0.2924154996871948}, + {0.5670915842056274, 0.4092135429382324}, {0.4276678264141083, 0.41317465901374817}, {0.5674304962158203, 0.1462927609682083}, {0.7135541439056396, 0.14629174768924713}, {0.7135551571846008, 0.2924153804779053}, {0.5674314498901367, 0.29241642355918884}, {0.853708028793335, 0.2924155592918396}, {0.9998319149017334, 0.2924154996871948}, + {0.9998319149017334, 0.43853920698165894}, {0.8537081480026245, 0.4385392665863037}, {0.0066010053269565105, 0.14619146287441254}, {0.15262427926063538, 0.1516100913286209}, {0.14720562100410461, 0.29763343930244446}, {0.0011823981767520308, 0.29221469163894653}, {0.43437695503234863, 0.5154602527618408}, {0.5662007331848145, 0.5117148756980896}, + {0.5644786357879639, 0.5849537253379822}, {0.44025471806526184, 0.5884833335876465}, {0.7102342247962952, 0.4092837870121002}, {0.5707541108131409, 0.4092848598957062}, {0.9965101480484009, 0.555407702922821}, {0.8570300936698914, 0.555407702922821}, {0.13955222070217133, 0.414298415184021}, {0.00016813237743917853, 0.40912577509880066}, + {0.7214940786361694, 0.46781307458877563}, {0.8457685708999634, 0.46781307458877563}, {0.8457684516906738, 0.5920873880386353}, {0.7214942574501038, 0.5920873880386353}, {0.5745562314987183, 0.5117197632789612}, {0.7064335942268372, 0.51171875}, {0.7026327252388, 0.5848795175552368}, {0.5783581733703613, 0.584880530834198}, + {0.7176926732063293, 0.39465245604515076}, {0.8495699167251587, 0.39465245604515076}, {0.8457685708999634, 0.46781307458877563}, {0.7214940786361694, 0.46781307458877563}, {0.00016824003250803798, 0.5116311311721802}, {0.13195458054542542, 0.5165219306945801}, {0.12544254958629608, 0.5894912481307983}, {0.0012538435403257608, 0.5848821997642517}, + {0.8495699167251587, 0.39465245604515076}, {0.7176926732063293, 0.39465245604515076}, {0.7176927328109741, 0.24659332633018494}, {0.8495699763298035, 0.24659346044063568}, {0.7138913869857788, 0.1441582441329956}, {0.8533715605735779, 0.14415842294692993}, {0.8495699763298035, 0.24659346044063568}, {0.7176927328109741, 0.24659332633018494}, + {0.28639882802963257, 0.520354688167572}, {0.2837550938129425, 0.4178834557533264}, {0.7138914465904236, 0.00016813237743917853}, {0.8533717393875122, 0.00016831178800202906}, {0.8533715605735779, 0.14415842294692993}, {0.7138913869857788, 0.1441582441329956}, {0.28341880440711975, 0.4202575087547302}, {0.2798847556114197, 0.5227020382881165} + } + } + + IndexArray + { + unsigned_int32[3] // 52 + { + {0, 1, 2}, {0, 2, 3}, {4, 5, 6}, {4, 6, 7}, {8, 9, 10}, {8, 10, 11}, {12, 13, 14}, {12, 14, 15}, {16, 17, 18}, {16, 18, 19}, {20, 21, 22}, {20, 22, 23}, {7, 6, 24}, {7, 24, 25}, {26, 27, 28}, {26, 28, 29}, + {30, 31, 32}, {30, 32, 33}, {34, 35, 36}, {34, 36, 37}, {38, 39, 40}, {38, 40, 41}, {29, 28, 42}, {29, 42, 43}, {33, 32, 44}, {33, 44, 45}, {37, 36, 46}, {37, 46, 47}, {48, 49, 50}, {48, 50, 51}, {52, 53, 54}, {52, 54, 55}, + {56, 57, 58}, {56, 58, 59}, {60, 61, 62}, {60, 62, 63}, {25, 24, 39}, {25, 39, 38}, {43, 42, 53}, {43, 53, 52}, {64, 65, 66}, {64, 66, 67}, {47, 46, 61}, {47, 61, 60}, {68, 69, 70}, {68, 70, 71}, {25, 38, 72}, {25, 72, 73}, + {74, 75, 76}, {74, 76, 77}, {61, 46, 78}, {61, 78, 79} + } + } + + Skin + { + Transform + { + float[16] + { + {1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0} + } + } + + Skeleton + { + BoneRefArray + { + ref // 5 + { + $node2, $node3, $node4, $node5, $node6 + } + } + + Transform + { + float[16] // 5 + { + {1.0, 0.0, 0.0, 0.0, 0.0, 7.549790126404332e-08, 1.0, 0.0, 0.0, -1.0, 1.1920928955078125e-07, 0.0, 0.0, 0.0, -1.0, 1.0}, + {1.0, 0.0, 0.0, 0.0, 0.0, 7.549790126404332e-08, 1.0, 0.0, 0.0, -1.0, 1.1920928955078125e-07, 0.0, 0.0, 1.5099580252808664e-07, 1.0, 1.0}, + {1.0, 3.019916050561733e-07, -1.3200469770003817e-14, 0.0, -2.2799733224976824e-14, 7.549789415861596e-08, 1.0, 0.0, 3.019916050561733e-07, -1.0, 1.1920928244535389e-07, 0.0, 0.0, 3.019916050561733e-07, 3.0, 1.0}, + {1.0, 0.0, 0.0, 0.0, 6.778502781801978e-22, 7.549793679118011e-08, 1.0, 0.0, 0.0, -1.0, 1.192093321833454e-07, 0.0, -4.559946306182186e-14, 4.529873933734052e-07, 5.0, 1.0}, + {1.0, 0.0, -5.621950794438765e-15, 0.0, 0.0, 1.0, 0.0, 0.0, 1.3200439276817716e-14, -4.371130302160964e-08, 1.0, 0.0, -4.559946644995365e-14, 4.529873933734052e-07, 5.0, 1.0} + } + } + } + + BoneCountArray + { + unsigned_int16 // 80 + { + 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 + } + } + + BoneIndexArray + { + unsigned_int16 // 120 + { + 0, 0, 0, 0, 1, 1, 1, 2, 1, 2, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 2, 3, 2, 3, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, + 2, 3, 3, 3, 3, 3, 3, 2, 3, 2, 3, 3, 2, 3, 2, 3, 3, 3, 3, 2, 2, 3, 3, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3 + } + } + + BoneWeightArray + { + float // 120 + { + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 0.5, 0.49954946340473105, 0.500450536595269, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 0.5, 0.5, 0.5, 1.0, 1.0, + 0.5, 0.5, 0.5, 0.5, 1.0, 1.0, 0.49954946340473105, 0.500450536595269, 0.5, 0.5, 1.0, 1.0, 0.5, 0.5, 0.5, 0.5, + 0.3333333333333333, 0.6666666666666666, 0.6666666666666666, 0.3333333333333333, 1.0, 1.0, 0.49999995529651775, 0.5000000447034822, 0.5, 0.5, 0.5, 0.5, 0.4998149424625882, 0.5001850575374118, 0.4998149424625882, 0.5001850575374118, + 0.49999995529651775, 0.5000000447034822, 0.9999999999999999, 1.0, 1.0, 1.0, 0.6666666666666666, 0.3333333333333333, 0.6666667262713096, 0.3333332737286903, 1.0, 1.0, 0.3331714669815143, 0.6668285330184857, 0.3333333333333333, 0.6666666666666666, + 1.0, 0.9999999999999999, 0.6666667262713096, 0.3333332737286903, 0.3331714669815143, 0.6668285330184857, 0.9999999999999999, 1.0, 0.3333333333333333, 0.6666666666666666, 0.3331714669815143, 0.6668285330184857, 0.3331714669815143, 0.6668285330184857, 0.3333333333333333, 0.6666666666666666, + 0.49981485306664863, 0.5001851469333514, 0.5, 0.5, 0.3333333333333333, 0.6666666666666666, 0.3331714669815143, 0.6668285330184857, 0.3333333333333333, 0.6666666666666666, 0.5, 0.5, 0.4998149424625882, 0.5001850575374118, 0.5, 0.5, + 0.5, 0.5, 0.49981485306664863, 0.5001851469333514, 0.49981485306664863, 0.5001851469333514, 0.3331714669815143, 0.6668285330184857 + } + } + } + } +} + +LightObject $light1 (type = "point") // Lamp +{ + Color (attrib = "light") {float[3] {{1.0, 1.0, 1.0}}} + + Atten (curve = "inverse_square") + { + Param (attrib = "scale") {float {5.47722400800463}} + } +} + +CameraObject $camera1 // Camera +{ + Param (attrib = "fov") {float {0.8575560450553894}} + Param (attrib = "near") {float {0.10000000149011612}} + Param (attrib = "far") {float {100.0}} +} + +Material $material2 +{ + Name {string {"Material"}} + + Color (attrib = "diffuse") {float[3] {{0.6400000190734865, 0.6400000190734865, 0.6400000190734865}}} + Color (attrib = "specular") {float[3] {{0.5, 0.5, 0.5}}} + Param (attrib = "specular_power") {float {50}} +} + +Material $material1 +{ + Name {string {"Material.001"}} + + Color (attrib = "diffuse") {float[3] {{0.6399999713897699, 0.6399999713897699, 0.6399999713897699}}} + Color (attrib = "specular") {float[3] {{25.0, 25.0, 25.0}}} + Param (attrib = "specular_power") {float {50}} +} diff --git a/test/unit/SceneDiffer.cpp b/test/unit/SceneDiffer.cpp new file mode 100644 index 000000000..395ab77ce --- /dev/null +++ b/test/unit/SceneDiffer.cpp @@ -0,0 +1,369 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +#include "SceneDiffer.h" +#include +#include +#include +#include + +using namespace Assimp; + +SceneDiffer::SceneDiffer() { + // empty +} + +SceneDiffer::~SceneDiffer() { + // empty +} + +bool SceneDiffer::isEqual( const aiScene *expected, const aiScene *toCompare ) { + if ( expected == toCompare ) { + return true; + } + + if ( nullptr == expected ) { + return false; + } + + if ( nullptr == toCompare ) { + return false; + } + + // meshes + if ( expected->mNumMeshes != toCompare->mNumMeshes ) { + std::stringstream stream; + stream << "Number of meshes not equal ( expected: " << expected->mNumMeshes << ", found : " << toCompare->mNumMeshes << " )\n"; + addDiff( stream.str() ); + return false; + } + + for ( unsigned int i = 0; i < expected->mNumMeshes; i++ ) { + aiMesh *expMesh( expected->mMeshes[ i ] ); + aiMesh *toCompMesh( toCompare->mMeshes[ i ] ); + if ( !compareMesh( expMesh, toCompMesh ) ) { + std::stringstream stream; + stream << "Meshes are not equal, index : " << i << "\n"; + addDiff( stream.str() ); + } + } + + // ToDo! + return true; + // materials + if ( expected->mNumMaterials != toCompare->mNumMaterials ) { + std::stringstream stream; + stream << "Number of materials not equal ( expected: " << expected->mNumMaterials << ", found : " << toCompare->mNumMaterials << " )\n"; + addDiff( stream.str() ); + return false; + } + + if ( expected->mNumMaterials > 0 ) { + if ( nullptr == expected->mMaterials || nullptr == toCompare->mMaterials ) { + addDiff( "Number of materials > 0 and mat pointer is nullptr" ); + return false; + } + } + + for ( unsigned int i = 0; i < expected->mNumMaterials; i++ ) { + aiMaterial *expectedMat( expected->mMaterials[ i ] ); + aiMaterial *toCompareMat( expected->mMaterials[ i ] ); + if ( !compareMaterial( expectedMat, toCompareMat ) ) { + std::stringstream stream; + stream << "Materials are not equal, index : " << i << "\n"; + addDiff( stream.str() ); + } + } + + return true; +} + +void SceneDiffer::showReport() { + if ( m_diffs.empty() ) { + return; + } + + for ( std::vector::iterator it = m_diffs.begin(); it != m_diffs.end(); it++ ) { + std::cout << *it << "\n"; + } + + std::cout << std::endl; +} + +void SceneDiffer::reset() { + m_diffs.resize( 0 ); +} + +void SceneDiffer::addDiff( const std::string &diff ) { + if ( diff.empty() ) { + return; + } + m_diffs.push_back( diff ); +} + +static std::string dumpVector3( const aiVector3D &toDump ) { + std::stringstream stream; + stream << "( " << toDump.x << ", " << toDump.y << ", " << toDump.z << ")"; + return stream.str(); +} + +static std::string dumpColor4D( const aiColor4D &toDump ) { + std::stringstream stream; + stream << "( " << toDump.r << ", " << toDump.g << ", " << toDump.b << ", " << toDump.a << ")"; + return stream.str(); +} + +static std::string dumpFace( const aiFace &face ) { + std::stringstream stream; + for ( unsigned int i = 0; i < face.mNumIndices; i++ ) { + stream << face.mIndices[ i ]; + if ( i < face.mNumIndices - 1 ) { + stream << ", "; + } else { + stream << "\n"; + } + } + return stream.str(); +} + +bool SceneDiffer::compareMesh( aiMesh *expected, aiMesh *toCompare ) { + if ( expected == toCompare ) { + return true; + } + + if ( nullptr == expected || nullptr == toCompare ) { + return false; + } + + if ( expected->mName != toCompare->mName ) { + std::stringstream stream; + stream << "Mesh name not equal ( expected: " << expected->mName.C_Str() << ", found : " << toCompare->mName.C_Str() << " )\n"; + addDiff( stream.str() ); + } + + if ( expected->mNumVertices != toCompare->mNumVertices ) { + std::stringstream stream; + stream << "Number of vertices not equal ( expected: " << expected->mNumVertices << ", found : " << toCompare->mNumVertices << " )\n"; + addDiff( stream.str() ); + return false; + } + + // positions + if ( expected->HasPositions() != toCompare->HasPositions() ) { + addDiff( "Expected are vertices, toCompare does not have any." ); + return false; + } + + bool vertEqual( true ); + for ( unsigned int i = 0; i < expected->mNumVertices; i++ ) { + aiVector3D &expVert( expected->mVertices[ i ] ); + aiVector3D &toCompVert( toCompare->mVertices[ i ] ); + if ( !expVert.Equal( toCompVert ) ) { + std::cout << "index = " << i << dumpVector3( toCompVert ) << "\n"; + std::stringstream stream; + stream << "Vertex not equal ( expected: " << dumpVector3( toCompVert ) << ", found: " << dumpVector3( toCompVert ) << "\n"; + addDiff( stream.str() ); + vertEqual = false; + } + } + if ( !vertEqual ) { + return false; + } + + // normals + if ( expected->HasNormals() != toCompare->HasNormals() ) { + addDiff( "Expected are normals, toCompare does not have any." ); + return false; + } + +// return true; + + //ToDo! + bool normalEqual( true ); +/* for ( unsigned int i = 0; i < expected->mNumVertices; i++ ) { + aiVector3D &expNormal( expected->mNormals[ i ] ); + aiVector3D &toCompNormal( toCompare->mNormals[ i ] ); + if ( expNormal.Equal( toCompNormal ) ) { + std::stringstream stream; + stream << "Normal not equal ( expected: " << dumpVector3( expNormal ) << ", found: " << dumpVector3( toCompNormal ) << "\n"; + addDiff( stream.str() ); + normalEqual = false; + } + } + if ( !normalEqual ) { + return false; + } + + // vertex colors + bool vertColEqual( true ); + for ( unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; a++ ) { + if ( expected->HasVertexColors(a) != toCompare->HasVertexColors(a) ) { + addDiff( "Expected are normals, toCompare does not have any." ); + return false; + } + for ( unsigned int i = 0; i < expected->mNumVertices; i++ ) { + aiColor4D &expColor4D( expected->mColors[ a ][ i ] ); + aiColor4D &toCompColor4D( toCompare->mColors[ a ][ i ] ); + if ( expColor4D != toCompColor4D ) { + std::stringstream stream; + stream << "Color4D not equal ( expected: " << dumpColor4D( expColor4D ) << ", found: " << dumpColor4D( toCompColor4D ) << "\n"; + addDiff( stream.str() ); + vertColEqual = false; + } + } + if ( !vertColEqual ) { + return false; + } + } + + // texture coords + bool texCoordsEqual( true ); + for ( unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++ ) { + if ( expected->HasTextureCoords( a ) != toCompare->HasTextureCoords( a ) ) { + addDiff( "Expected are texture coords, toCompare does not have any." ); + return false; + } + for ( unsigned int i = 0; i < expected->mNumVertices; i++ ) { + aiVector3D &expTexCoord( expected->mTextureCoords[ a ][ i ] ); + aiVector3D &toCompTexCoord( toCompare->mTextureCoords[ a ][ i ] ); + if ( expTexCoord.Equal( toCompTexCoord ) ) { + std::stringstream stream; + stream << "Texture coords not equal ( expected: " << dumpVector3( expTexCoord ) << ", found: " << dumpVector3( toCompTexCoord ) << "\n"; + addDiff( stream.str() ); + vertColEqual = false; + } + } + if ( !vertColEqual ) { + return false; + } + } + + // tangents and bi-tangents + if ( expected->HasTangentsAndBitangents() != toCompare->HasTangentsAndBitangents() ) { + addDiff( "Expected are tangents and bi-tangents, toCompare does not have any." ); + return false; + } + bool tangentsEqual( true ); + for ( unsigned int i = 0; i < expected->mNumVertices; i++ ) { + aiVector3D &expTangents( expected->mTangents[ i ] ); + aiVector3D &toCompTangents( toCompare->mTangents[ i ] ); + if ( expTangents.Equal( toCompTangents ) ) { + std::stringstream stream; + stream << "Tangents not equal ( expected: " << dumpVector3( expTangents ) << ", found: " << dumpVector3( toCompTangents ) << "\n"; + addDiff( stream.str() ); + tangentsEqual = false; + } + + aiVector3D &expBiTangents( expected->mBitangents[ i ] ); + aiVector3D &toCompBiTangents( toCompare->mBitangents[ i ] ); + if ( expBiTangents.Equal( toCompBiTangents ) ) { + std::stringstream stream; + stream << "Tangents not equal ( expected: " << dumpVector3( expBiTangents ) << ", found: " << dumpVector3( toCompBiTangents ) << " )\n"; + addDiff( stream.str() ); + tangentsEqual = false; + } + } + if ( !tangentsEqual ) { + return false; + }*/ + + // faces + if ( expected->mNumFaces != toCompare->mNumFaces ) { + std::stringstream stream; + stream << "Number of faces are not equal, ( expected: " << expected->mNumFaces << ", found: " << toCompare->mNumFaces << ")\n"; + addDiff( stream.str() ); + return false; + } + bool facesEqual( true ); + for ( unsigned int i = 0; i < expected->mNumFaces; i++ ) { + aiFace &expFace( expected->mFaces[ i ] ); + aiFace &toCompareFace( toCompare->mFaces[ i ] ); + if ( !compareFace( &expFace, &toCompareFace ) ) { + addDiff( "Faces are not equal\n" ); + addDiff( dumpFace( expFace ) ); + addDiff( dumpFace( toCompareFace ) ); + facesEqual = false; + } + } + if ( !facesEqual ) { + return false; + } + + return true; +} + +bool SceneDiffer::compareFace( aiFace *expected, aiFace *toCompare ) { + if ( nullptr == expected ) { + return false; + } + if ( nullptr == toCompare ) { + return false; + } + + // same instance + if ( expected == toCompare ) { + return true; + } + + // using compare operator + if ( *expected == *toCompare ) { + return true; + } + + return false; +} + +bool SceneDiffer::compareMaterial( aiMaterial *expected, aiMaterial *toCompare ) { + if ( nullptr == expected ) { + return false; + } + if ( nullptr == toCompare ) { + return false; + } + + // same instance + if ( expected == toCompare ) { + return true; + } + + // todo! + + return true; +} diff --git a/test/unit/SceneDiffer.h b/test/unit/SceneDiffer.h new file mode 100644 index 000000000..7dc5973ff --- /dev/null +++ b/test/unit/SceneDiffer.h @@ -0,0 +1,69 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +#pragma once + +#include "UnitTestPCH.h" +#include +#include +#include + +struct aiScene; +struct aiMesh; +struct aiMaterial; +struct aiFace; + +class SceneDiffer { +public: + SceneDiffer(); + ~SceneDiffer(); + bool isEqual( const aiScene *expected, const aiScene *toCompare ); + void showReport(); + void reset(); + +protected: + void addDiff( const std::string &diff ); + bool compareMesh( aiMesh *expected, aiMesh *toCompare ); + bool compareFace( aiFace *expected, aiFace *toCompare ); + bool compareMaterial( aiMaterial *expected, aiMaterial *toCompare ); + +private: + std::vector m_diffs; +}; diff --git a/test/unit/TestIOStream.h b/test/unit/TestIOStream.h new file mode 100644 index 000000000..a979caec8 --- /dev/null +++ b/test/unit/TestIOStream.h @@ -0,0 +1,62 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +#pragma once + +#include "DefaultIOStream.h" + +using namespace ::Assimp; + +class TestDefaultIOStream : public DefaultIOStream { +public: + TestDefaultIOStream() + : DefaultIOStream() { + // empty + } + + TestDefaultIOStream( FILE* pFile, const std::string &strFilename ) + : DefaultIOStream( pFile, strFilename ) { + // empty + } + + virtual ~TestDefaultIOStream() { + // empty + } +}; + diff --git a/test/unit/TestIOSystem.h b/test/unit/TestIOSystem.h new file mode 100644 index 000000000..cf7962f98 --- /dev/null +++ b/test/unit/TestIOSystem.h @@ -0,0 +1,29 @@ +#pragma once + +#include "UnitTestPCH.h" + +#include + +using namespace std; +using namespace Assimp; + +static const string Sep = "/"; +class TestIOSystem : public IOSystem { +public: + TestIOSystem() : IOSystem() {} + virtual ~TestIOSystem() {} + virtual bool Exists( const char* ) const { + return true; + } + virtual char getOsSeparator() const { + return Sep[ 0 ]; + } + + virtual IOStream* Open( const char* pFile, const char* pMode = "rb" ) { + return NULL; + } + + virtual void Close( IOStream* pFile ) { + // empty + } +}; diff --git a/test/unit/utBatchLoader.cpp b/test/unit/utBatchLoader.cpp new file mode 100644 index 000000000..b3d74a0aa --- /dev/null +++ b/test/unit/utBatchLoader.cpp @@ -0,0 +1,78 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +#include "UnitTestPCH.h" +#include "Importer.h" +#include "TestIOSystem.h" + +using namespace ::Assimp; + +class BatchLoaderTest : public ::testing::Test { +public: + virtual void SetUp() { + m_io = new TestIOSystem(); + } + + virtual void TearDown() { + delete m_io; + } + +protected: + TestIOSystem* m_io; +}; + +TEST_F( BatchLoaderTest, createTest ) { + bool ok( true ); + try { + BatchLoader loader( m_io ); + } catch ( ... ) { + ok = false; + } +} + +TEST_F( BatchLoaderTest, validateAccessTest ) { + BatchLoader loader1( m_io ); + EXPECT_FALSE( loader1.getValidation() ); + loader1.setValidation( true ); + EXPECT_TRUE( loader1.getValidation() ); + + BatchLoader loader2( m_io, true ); + EXPECT_TRUE( loader2.getValidation() ); +} diff --git a/test/unit/utDefaultIOStream.cpp b/test/unit/utDefaultIOStream.cpp index 7d3c07f20..50a15437c 100644 --- a/test/unit/utDefaultIOStream.cpp +++ b/test/unit/utDefaultIOStream.cpp @@ -37,7 +37,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------*/ #include -#include "DefaultIOStream.h" +#include "TestIOStream.h" using namespace ::Assimp; @@ -45,23 +45,6 @@ class utDefaultIOStream : public ::testing::Test { // empty }; -class TestDefaultIOStream : public DefaultIOStream { -public: - TestDefaultIOStream() - : DefaultIOStream() { - // empty - } - - TestDefaultIOStream( FILE* pFile, const std::string &strFilename ) - : DefaultIOStream( pFile, strFilename ) { - // empty - } - - virtual ~TestDefaultIOStream() { - // empty - } -}; - TEST_F( utDefaultIOStream, FileSizeTest ) { char buffer[ L_tmpnam ]; tmpnam( buffer ); diff --git a/test/unit/utIOStreamBuffer.cpp b/test/unit/utIOStreamBuffer.cpp new file mode 100644 index 000000000..ded6c0eb7 --- /dev/null +++ b/test/unit/utIOStreamBuffer.cpp @@ -0,0 +1,112 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +#include "UnitTestPCH.h" +#include "IOStreamBuffer.h" +#include "TestIOStream.h" + +class IOStreamBufferTest : public ::testing::Test { + // empty +}; + +using namespace Assimp; + +TEST_F( IOStreamBufferTest, creationTest ) { + bool ok( true ); + try { + IOStreamBuffer myBuffer; + } catch ( ... ) { + ok = false; + } + EXPECT_TRUE( ok ); +} + +TEST_F( IOStreamBufferTest, accessCacheSizeTest ) { + IOStreamBuffer myBuffer1; + EXPECT_NE( 0, myBuffer1.cacheSize() ); + + IOStreamBuffer myBuffer2( 100 ); + EXPECT_EQ( 100, myBuffer2.cacheSize() ); +} + +TEST_F( IOStreamBufferTest, open_close_Test ) { + IOStreamBuffer myBuffer; + + EXPECT_FALSE( myBuffer.open( nullptr ) ); + EXPECT_FALSE( myBuffer.close() ); + + char buffer[ L_tmpnam ]; + tmpnam( buffer ); + std::FILE *fs( std::fopen( buffer, "w+" ) ); + size_t written( std::fwrite( buffer, 1, sizeof( char ) * L_tmpnam, fs ) ); + std::fflush( fs ); + + TestDefaultIOStream myStream( fs, buffer ); + + EXPECT_TRUE( myBuffer.open( &myStream ) ); + EXPECT_FALSE( myBuffer.open( &myStream ) ); + EXPECT_TRUE( myBuffer.close() ); +} + +TEST_F( IOStreamBufferTest, readlineTest ) { + char buffer[ L_tmpnam ]; + tmpnam( buffer ); + std::FILE *fs( std::fopen( buffer, "w+" ) ); + size_t written( std::fwrite( buffer, 1, sizeof( char ) * L_tmpnam, fs ) ); + std::fflush( fs ); + + IOStreamBuffer myBuffer( 26 ); + EXPECT_EQ( 26, myBuffer.cacheSize() ); + + TestDefaultIOStream myStream( fs, buffer ); + size_t size( myStream.FileSize() ); + size_t numBlocks( size / myBuffer.cacheSize() ); + if ( size % myBuffer.cacheSize() > 0 ) { + numBlocks++; + } + EXPECT_TRUE( myBuffer.open( &myStream ) ); + EXPECT_EQ( numBlocks, myBuffer.getNumBlocks() ); + EXPECT_TRUE( myBuffer.close() ); +} + +TEST_F( IOStreamBufferTest, accessBlockIndexTest ) { + +} diff --git a/test/unit/utIOSystem.cpp b/test/unit/utIOSystem.cpp index b091e8c36..dfae55320 100644 --- a/test/unit/utIOSystem.cpp +++ b/test/unit/utIOSystem.cpp @@ -39,37 +39,22 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------- */ #include "UnitTestPCH.h" +#include "TestIOSystem.h" #include using namespace std; using namespace Assimp; -static const string Sep = "/"; -class TestIOSystem : public IOSystem { -public: - TestIOSystem() : IOSystem() {} - virtual ~TestIOSystem() {} - virtual bool Exists( const char* ) const { - return true; - } - virtual char getOsSeparator() const { - return Sep[ 0 ]; - } - - virtual IOStream* Open(const char* pFile, const char* pMode = "rb") { - return NULL; - } - - virtual void Close( IOStream* pFile) { - // empty - } -}; - class IOSystemTest : public ::testing::Test { public: - virtual void SetUp() { pImp = new TestIOSystem(); } - virtual void TearDown() { delete pImp; } + virtual void SetUp() { + pImp = new TestIOSystem(); + } + + virtual void TearDown() { + delete pImp; + } protected: TestIOSystem* pImp; diff --git a/test/unit/utImporter.cpp b/test/unit/utImporter.cpp index db71f8206..6e2d03a63 100644 --- a/test/unit/utImporter.cpp +++ b/test/unit/utImporter.cpp @@ -270,3 +270,5 @@ TEST_F(ImporterTest, testMultipleReads) EXPECT_TRUE(pImp->ReadFile(ASSIMP_TEST_MODELS_DIR "/X/BCN_Epileptic.X",flags)); //EXPECT_TRUE(pImp->ReadFile(ASSIMP_TEST_MODELS_DIR "/X/dwarf.x",flags)); # is in nonbsd } + +// ------------------------------------------------------------------------------------------------ diff --git a/test/unit/utObjImportExport.cpp b/test/unit/utObjImportExport.cpp new file mode 100644 index 000000000..44b0a6e11 --- /dev/null +++ b/test/unit/utObjImportExport.cpp @@ -0,0 +1,189 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +#include "UnitTestPCH.h" +#include "SceneDiffer.h" + +#include +#include + +using namespace Assimp; + +static const float VertComponents[ 24 * 3 ] = { + -0.500000, 0.500000, 0.500000, + -0.500000, 0.500000, -0.500000, + -0.500000, -0.500000, -0.500000, + -0.500000, -0.500000, 0.500000, + -0.500000, -0.500000, -0.500000, + 0.500000, -0.500000, -0.500000, + 0.500000, -0.500000, 0.500000, + -0.500000, -0.500000, 0.500000, + -0.500000, 0.500000, -0.500000, + 0.500000, 0.500000, -0.500000, + 0.500000, -0.500000, -0.500000, + -0.500000, -0.500000, -0.500000, + 0.500000, 0.500000, 0.500000, + 0.500000, 0.500000, -0.500000, + -0.500000, 0.500000, -0.500000, + -0.500000, 0.500000, 0.500000, + 0.500000, -0.500000, 0.500000, + 0.500000, 0.500000, 0.500000, + -0.500000, 0.500000, 0.500000, + -0.500000, -0.500000, 0.500000, + 0.500000, -0.500000, -0.500000, + 0.500000, 0.500000, -0.500000, + 0.500000, 0.500000, 0.500000f, + 0.500000, -0.500000, 0.500000f +}; + +static const std::string ObjModel = + "o 1\n" + "\n" + "# Vertex list\n" + "\n" + "v -0.5 -0.5 0.5\n" + "v -0.5 -0.5 -0.5\n" + "v -0.5 0.5 -0.5\n" + "v -0.5 0.5 0.5\n" + "v 0.5 -0.5 0.5\n" + "v 0.5 -0.5 -0.5\n" + "v 0.5 0.5 -0.5\n" + "v 0.5 0.5 0.5\n" + "\n" + "# Point / Line / Face list\n" + "\n" + "usemtl Default\n" + "f 4 3 2 1\n" + "f 2 6 5 1\n" + "f 3 7 6 2\n" + "f 8 7 3 4\n" + "f 5 8 4 1\n" + "f 6 7 8 5\n" + "\n" + "# End of file\n"; + +class utObjImportExport : public ::testing::Test { +protected: + virtual void SetUp() { + m_im = new Assimp::Importer; + } + + virtual void TearDown() { + delete m_im; + m_im = nullptr; + } + + aiScene *createScene() { + aiScene *expScene = new aiScene; + expScene->mNumMeshes = 1; + expScene->mMeshes = new aiMesh*[ 1 ]; + aiMesh *mesh = new aiMesh; + mesh->mName.Set( "1" ); + mesh->mNumVertices = 24; + mesh->mVertices = new aiVector3D[ 24 ]; + ::memcpy( &mesh->mVertices->x, &VertComponents[ 0 ], sizeof( float ) * 24 * 3 ); + mesh->mNumFaces = 6; + mesh->mFaces = new aiFace[ mesh->mNumFaces ]; + + mesh->mFaces[ 0 ].mNumIndices = 4; + mesh->mFaces[ 0 ].mIndices = new unsigned int[ mesh->mFaces[ 0 ].mNumIndices ]; + mesh->mFaces[ 0 ].mIndices[ 0 ] = 0; + mesh->mFaces[ 0 ].mIndices[ 1 ] = 1; + mesh->mFaces[ 0 ].mIndices[ 2 ] = 2; + mesh->mFaces[ 0 ].mIndices[ 3 ] = 3; + + mesh->mFaces[ 1 ].mNumIndices = 4; + mesh->mFaces[ 1 ].mIndices = new unsigned int[ mesh->mFaces[ 0 ].mNumIndices ]; + mesh->mFaces[ 1 ].mIndices[ 0 ] = 4; + mesh->mFaces[ 1 ].mIndices[ 1 ] = 5; + mesh->mFaces[ 1 ].mIndices[ 2 ] = 6; + mesh->mFaces[ 1 ].mIndices[ 3 ] = 7; + + mesh->mFaces[ 2 ].mNumIndices = 4; + mesh->mFaces[ 2 ].mIndices = new unsigned int[ mesh->mFaces[ 0 ].mNumIndices ]; + mesh->mFaces[ 2 ].mIndices[ 0 ] = 8; + mesh->mFaces[ 2 ].mIndices[ 1 ] = 9; + mesh->mFaces[ 2 ].mIndices[ 2 ] = 10; + mesh->mFaces[ 2 ].mIndices[ 3 ] = 11; + + mesh->mFaces[ 3 ].mNumIndices = 4; + mesh->mFaces[ 3 ].mIndices = new unsigned int[ mesh->mFaces[ 0 ].mNumIndices ]; + mesh->mFaces[ 3 ].mIndices[ 0 ] = 12; + mesh->mFaces[ 3 ].mIndices[ 1 ] = 13; + mesh->mFaces[ 3 ].mIndices[ 2 ] = 14; + mesh->mFaces[ 3 ].mIndices[ 3 ] = 15; + + mesh->mFaces[ 4 ].mNumIndices = 4; + mesh->mFaces[ 4 ].mIndices = new unsigned int[ mesh->mFaces[ 0 ].mNumIndices ]; + mesh->mFaces[ 4 ].mIndices[ 0 ] = 16; + mesh->mFaces[ 4 ].mIndices[ 1 ] = 17; + mesh->mFaces[ 4 ].mIndices[ 2 ] = 18; + mesh->mFaces[ 4 ].mIndices[ 3 ] = 19; + + mesh->mFaces[ 5 ].mNumIndices = 4; + mesh->mFaces[ 5 ].mIndices = new unsigned int[ mesh->mFaces[ 0 ].mNumIndices ]; + mesh->mFaces[ 5 ].mIndices[ 0 ] = 20; + mesh->mFaces[ 5 ].mIndices[ 1 ] = 21; + mesh->mFaces[ 5 ].mIndices[ 2 ] = 22; + mesh->mFaces[ 5 ].mIndices[ 3 ] = 23; + + expScene->mMeshes[ 0 ] = mesh; + + expScene->mNumMaterials = 1; + expScene->mMaterials = new aiMaterial*[ expScene->mNumMaterials ]; + + return expScene; + } + +protected: + Assimp::Importer *m_im; + aiScene *m_expectedScene; +}; + +TEST_F( utObjImportExport, obj_import_test ) { + const aiScene *scene = m_im->ReadFileFromMemory( (void*) ObjModel.c_str(), ObjModel.size(), 0 ); + aiScene *expected = createScene(); + EXPECT_NE( nullptr, scene ); + + SceneDiffer differ; + EXPECT_TRUE( differ.isEqual( expected, scene ) ); + differ.showReport(); +} diff --git a/test/unit/utTriangulate.cpp b/test/unit/utTriangulate.cpp index 96f7ef1d8..e9677d3e4 100644 --- a/test/unit/utTriangulate.cpp +++ b/test/unit/utTriangulate.cpp @@ -47,21 +47,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace std; using namespace Assimp; -class TriangulateProcessTest : public ::testing::Test -{ +class TriangulateProcessTest : public ::testing::Test { public: - virtual void SetUp(); virtual void TearDown(); protected: - aiMesh* pcMesh; TriangulateProcess* piProcess; }; -void TriangulateProcessTest::SetUp() -{ +void TriangulateProcessTest::SetUp() { piProcess = new TriangulateProcess(); pcMesh = new aiMesh(); @@ -72,24 +68,21 @@ void TriangulateProcessTest::SetUp() pcMesh->mPrimitiveTypes = aiPrimitiveType_POINT | aiPrimitiveType_LINE | aiPrimitiveType_LINE | aiPrimitiveType_POLYGON; - for (unsigned int m = 0, t = 0, q = 4; m < 1000; ++m) - { + for (unsigned int m = 0, t = 0, q = 4; m < 1000; ++m) { ++t; aiFace& face = pcMesh->mFaces[m]; face.mNumIndices = t; - if (4 == t) - { + if (4 == t) { face.mNumIndices = q++; t = 0; if (10 == q)q = 4; } face.mIndices = new unsigned int[face.mNumIndices]; - for (unsigned int p = 0; p < face.mNumIndices; ++p) - { - face.mIndices[p] = pcMesh->mNumVertices; + for (unsigned int p = 0; p < face.mNumIndices; ++p) { + face.mIndices[ p ] = pcMesh->mNumVertices; - // construct fully convex input data in ccw winding, xy plane + // construct fully convex input data in ccw winding, xy plane aiVector3D& v = pcMesh->mVertices[pcMesh->mNumVertices++]; v.z = 0.f; v.x = cos (p * (float)(AI_MATH_TWO_PI)/face.mNumIndices); @@ -98,51 +91,43 @@ void TriangulateProcessTest::SetUp() } } -void TriangulateProcessTest::TearDown() -{ +void TriangulateProcessTest::TearDown() { delete piProcess; delete pcMesh; } -TEST_F(TriangulateProcessTest, testTriangulation) -{ +TEST_F(TriangulateProcessTest, testTriangulation) { piProcess->TriangulateMesh(pcMesh); - for (unsigned int m = 0, t = 0, q = 4, max = 1000, idx = 0; m < max;++m) - { + for (unsigned int m = 0, t = 0, q = 4, max = 1000, idx = 0; m < max;++m) { ++t; aiFace& face = pcMesh->mFaces[m]; - if (4 == t) - { + if (4 == t) { t = 0; max += q-3; std::vector ait(q,false); - for (unsigned int i = 0, tt = q-2; i < tt; ++i,++m) - { + for (unsigned int i = 0, tt = q-2; i < tt; ++i,++m) { aiFace& face = pcMesh->mFaces[m]; EXPECT_EQ(3U, face.mNumIndices); - for (unsigned int qqq = 0; qqq < face.mNumIndices; ++qqq) - { + for (unsigned int qqq = 0; qqq < face.mNumIndices; ++qqq) { ait[face.mIndices[qqq]-idx] = true; } } - for (std::vector::const_iterator it = ait.begin(); it != ait.end(); ++it) - { + for (std::vector::const_iterator it = ait.begin(); it != ait.end(); ++it) { EXPECT_TRUE(*it); } --m; idx+=q; - if(++q == 10)q = 4; - } - else - { + if ( ++q == 10 ) { + q = 4; + } + } else { EXPECT_EQ(t, face.mNumIndices); - for (unsigned int i = 0; i < face.mNumIndices; ++i,++idx) - { + for (unsigned int i = 0; i < face.mNumIndices; ++i,++idx) { EXPECT_EQ(idx, face.mIndices[i]); } } diff --git a/test/unit/utTypes.cpp b/test/unit/utTypes.cpp new file mode 100644 index 000000000..875f66240 --- /dev/null +++ b/test/unit/utTypes.cpp @@ -0,0 +1,75 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2016, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +#include "UnitTestPCH.h" + +#include + +using namespace Assimp; + +class utTypes : public ::testing::Test { + // empty +}; + +TEST_F( utTypes, Color3dCpmpareOpTest ) { + aiColor3D col1( 1, 2, 3 ); + aiColor3D col2( 4, 5, 6 ); + aiColor3D col3( col1 ); + + EXPECT_FALSE( col1 == col2 ); + EXPECT_FALSE( col2 == col3 ); + EXPECT_TRUE( col1 == col3 ); + + EXPECT_TRUE( col1 != col2 ); + EXPECT_TRUE( col2 != col3 ); + EXPECT_FALSE( col1 != col3 ); +} + +TEST_F( utTypes, Color3dIndexOpTest ) { + aiColor3D col( 1, 2, 3 ); + const ai_real r = col[ 0 ]; + EXPECT_FLOAT_EQ( 1, r ); + + const ai_real g = col[ 1 ]; + EXPECT_FLOAT_EQ( 2, g ); + + const ai_real b = col[ 2 ]; + EXPECT_FLOAT_EQ( 3, b ); +} diff --git a/tools/assimp_qt_viewer/CMakeLists.txt b/tools/assimp_qt_viewer/CMakeLists.txt index 26f43c156..2985d6e30 100644 --- a/tools/assimp_qt_viewer/CMakeLists.txt +++ b/tools/assimp_qt_viewer/CMakeLists.txt @@ -3,12 +3,12 @@ set(PROJECT_VERSION "") cmake_minimum_required(VERSION 2.6) -find_package(Qt4 REQUIRED) +find_package(Qt5Widgets REQUIRED) find_package(DevIL REQUIRED) find_package(OpenGL REQUIRED) include_directories( - ${QT_INCLUDES} + ${Qt5Widgets_INCLUDES} ${Assimp_SOURCE_DIR}/include ${Assimp_SOURCE_DIR}/code ${CMAKE_CURRENT_BINARY_DIR} @@ -21,15 +21,16 @@ link_directories(${Assimp_BINARY_DIR}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pedantic -Wall") set(assimp_qt_viewer_SRCS main.cpp loggerview.cpp glview.cpp mainwindow.cpp) -qt4_wrap_ui(UISrcs mainwindow.ui) -qt4_wrap_cpp(MOCrcs mainwindow.hpp glview.hpp) +qt5_wrap_ui(UISrcs mainwindow.ui) +qt5_wrap_cpp(MOCrcs mainwindow.hpp glview.hpp) add_executable(${PROJECT_NAME} ${assimp_qt_viewer_SRCS} ${UISrcs} ${MOCrcs}) target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${IL_LIBRARIES} ${OPENGL_LIBRARIES} assimp) +qt5_use_modules(${PROJECT_NAME} Widgets OpenGL) if(WIN32) # Check if we are on Windows if(MSVC) # Check if we are using the Visual Studio compiler - set_target_properties(TestProject PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS") + #set_target_properties(TestProject PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS") elseif(CMAKE_COMPILER_IS_GNUCXX) # SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mwindows") # Not tested else() diff --git a/tools/assimp_qt_viewer/glview.cpp b/tools/assimp_qt_viewer/glview.cpp index e4a2d7662..2d1e07a98 100644 --- a/tools/assimp_qt_viewer/glview.cpp +++ b/tools/assimp_qt_viewer/glview.cpp @@ -9,7 +9,7 @@ #include // Header files, DevIL. -#include +#include // Header files, Assimp. #include @@ -56,15 +56,15 @@ void CGLView::SHelper_Camera::SetDefault() void CGLView::Material_Apply(const aiMaterial* pMaterial) { -GLfloat tcol[4]; -aiColor4D taicol; -unsigned int max; -int ret1, ret2; -int texture_index = 0; -aiString texture_path; + GLfloat tcol[4]; + aiColor4D taicol; + unsigned int max; + int ret1, ret2; + int texture_index = 0; + aiString texture_path; -auto set_float4 = [](float f[4], float a, float b, float c, float d) { f[0] = a, f[1] = b, f[2] = c, f[3] = d; }; -auto color4_to_float4 = [](const aiColor4D *c, float f[4]) { f[0] = c->r, f[1] = c->g, f[2] = c->b, f[3] = c->a; }; + auto set_float4 = [](float f[4], float a, float b, float c, float d) { f[0] = a, f[1] = b, f[2] = c, f[3] = d; }; + auto color4_to_float4 = [](const aiColor4D *c, float f[4]) { f[0] = c->r, f[1] = c->g, f[2] = c->b, f[3] = c->a; }; ///TODO: cache materials // Disable color material because glMaterial is used. @@ -158,13 +158,127 @@ std::list mat_list; } while(node_cur != nullptr); } - // multiplicate all matrices in reverse order - for(std::list::reverse_iterator rit = mat_list.rbegin(); rit != mat_list.rend(); rit++) pOutMatrix = pOutMatrix * (*rit); + // multiply all matrices in reverse order + for ( std::list::reverse_iterator rit = mat_list.rbegin(); rit != mat_list.rend(); rit++) + { + pOutMatrix = pOutMatrix * (*rit); + } } void CGLView::ImportTextures(const QString& pScenePath) { -ILboolean success; + auto LoadTexture = [&](const QString& pFileName) -> bool ///TODO: IME texture mode, operation. + { + ILboolean success; + GLuint id_ogl_texture;// OpenGL texture ID. + + if(!pFileName.startsWith(AI_EMBEDDED_TEXNAME_PREFIX)) + { + ILuint id_image;// DevIL image ID. + QString basepath = pScenePath.left(pScenePath.lastIndexOf('/') + 1);// path with '/' at the end. + QString fileloc = (basepath + pFileName); + + fileloc.replace('\\', "/"); + ilGenImages(1, &id_image);// Generate DevIL image ID. + ilBindImage(id_image); + success = ilLoadImage(fileloc.toLocal8Bit()); + if(!success) + { + LogError(QString("Couldn't load Image: %1").arg(fileloc)); + + return false; + } + + // Convert every colour component into unsigned byte. If your image contains alpha channel you can replace IL_RGB with IL_RGBA. + success = ilConvertImage(IL_RGBA, IL_UNSIGNED_BYTE); + if(!success) + { + LogError("Couldn't convert image."); + + return false; + } + + glGenTextures(1, &id_ogl_texture);// Texture ID generation. + mTexture_IDMap[pFileName] = id_ogl_texture;// save texture ID for filename in map + glBindTexture(GL_TEXTURE_2D, id_ogl_texture);// Binding of texture ID. + // Redefine standard texture values + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);// We will use linear interpolation for magnification filter. + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);// We will use linear interpolation for minifying filter. + glTexImage2D(GL_TEXTURE_2D, 0, ilGetInteger(IL_IMAGE_BPP), ilGetInteger(IL_IMAGE_WIDTH), ilGetInteger(IL_IMAGE_HEIGHT), 0, + ilGetInteger(IL_IMAGE_FORMAT), GL_UNSIGNED_BYTE, ilGetData());// Texture specification. + + //Cleanup + ilDeleteImages(1, &id_image);// Because we have already copied image data into texture data we can release memory used by image. + } + else + { + struct SPixel_Description + { + const char* FormatHint; + const GLint Image_InternalFormat; + const GLint Pixel_Format; + }; + + constexpr SPixel_Description Pixel_Description[] = { + {"rgba8880", GL_RGB, GL_RGB}, + {"rgba8888", GL_RGBA, GL_RGBA} + }; + + constexpr size_t Pixel_Description_Count = sizeof(Pixel_Description) / sizeof(SPixel_Description); + + size_t idx_description; + // Get texture index. + bool ok; + size_t idx_texture = pFileName.right(strlen(AI_EMBEDDED_TEXNAME_PREFIX)).toULong(&ok); + + if(!ok) + { + LogError("Can not get index of the embedded texture from path in material."); + + return false; + } + + // Create alias for conveniance. + const aiTexture& als = *mScene->mTextures[idx_texture]; + + if(als.mHeight == 0)// Compressed texture. + { + LogError("IME: compressed embedded textures are not implemented."); + } + else + { + ok = false; + for(size_t idx = 0; idx < Pixel_Description_Count; idx++) + { + if(als.CheckFormat(Pixel_Description[idx].FormatHint)) + { + idx_description = idx; + ok = true; + break; + } + } + + if(!ok) + { + LogError(QString("Unsupported format hint for embedded texture: [%1]").arg(als.achFormatHint)); + + return false; + } + + glGenTextures(1, &id_ogl_texture);// Texture ID generation. + mTexture_IDMap[pFileName] = id_ogl_texture;// save texture ID for filename in map + glBindTexture(GL_TEXTURE_2D, id_ogl_texture);// Binding of texture ID. + // Redefine standard texture values + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);// We will use linear interpolation for magnification filter. + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);// We will use linear interpolation for minifying filter. + // Texture specification. + glTexImage2D(GL_TEXTURE_2D, 0, Pixel_Description[idx_description].Image_InternalFormat, als.mWidth, als.mHeight, 0, + Pixel_Description[idx_description].Pixel_Format, GL_UNSIGNED_BYTE, (uint8_t*)als.pcData); + }// if(als.mHeight == 0) else + }// if(!filename.startsWith(AI_EMBEDDED_TEXNAME_PREFIX)) else + + return true; + };// auto LoadTexture = [&](const aiString& pPath) if(mScene == nullptr) { @@ -183,12 +297,7 @@ ILboolean success; ilInit();// Initialization of DevIL. // - // Load embedded textures - // - if(mScene->HasTextures()) LogError("Support for meshes with embedded textures is not implemented."); - - // - // Load textures from external files. + // Load textures. // // Get textures file names and number of textures. for(size_t idx_material = 0; idx_material < mScene->mNumMaterials; idx_material++) @@ -200,10 +309,10 @@ ILboolean success; { if(mScene->mMaterials[idx_material]->GetTexture(aiTextureType_DIFFUSE, idx_texture, &path) != AI_SUCCESS) break; - mTexture_IDMap[path.data] = 0;// Fill map with invalid ID's. + LoadTexture(QString(path.C_Str())); idx_texture++; } while(true); - }// for(size_t idx_mat = 0; idx_mat < scene->mNumMaterials; idx_mat++) + }// for(size_t idx_material = 0; idx_material < mScene->mNumMaterials; idx_material++) // Textures list is empty, exit. if(mTexture_IDMap.size() == 0) @@ -212,76 +321,11 @@ ILboolean success; return; } - - size_t num_textures = mTexture_IDMap.size(); - - - ILuint* id_images = nullptr;// Array with DevIL image ID's. - GLuint* id_textures = nullptr;// Array with OpenGL textures ID's. - - // Generate DevIL image IDs. - id_images = new ILuint[num_textures]; - ilGenImages(num_textures, id_images);// Generation of 'num_textures' image names. - // Create and fill array with OpenGL texture ID's. - id_textures = new GLuint[num_textures]; - ///TODO: if can not load textures then will stay orphande texture ID's in OpenGL. Generate OpenGL ID's after successfull loading of image. - glGenTextures(num_textures, id_textures);// Texture ID's generation. - - QMap::iterator map_it = mTexture_IDMap.begin();// Get iterator - QString basepath = pScenePath.left(pScenePath.lastIndexOf('/') + 1);// path with '/' at the end. - - for(size_t idx_texture = 0; idx_texture < num_textures; idx_texture++) - { - //save IL image ID - QString filename = map_it.key();// get filename - - mTexture_IDMap[filename] = id_textures[idx_texture];// save texture ID for filename in map - map_it++;// next texture - ilBindImage(id_images[idx_texture]);// Binding of DevIL image name. - - QString fileloc = basepath + filename; /* Loading of image */ - - fileloc.replace('\\', "/"); - success = ilLoadImage(fileloc.toLocal8Bit()); - if(!success) - { - LogError(QString("Couldn't load Image: %1").arg(fileloc)); - goto it_for_err; - } - - // Convert every colour component into unsigned byte. If your image contains alpha channel you can replace IL_RGB with IL_RGBA. - success = ilConvertImage(IL_RGBA, IL_UNSIGNED_BYTE); - if(!success) - { - LogError("Couldn't convert image."); - goto it_for_err; - } - - glBindTexture(GL_TEXTURE_2D, id_textures[idx_texture]);// Binding of texture ID. - // Redefine standard texture values - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);// We will use linear interpolation for magnification filter. - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);// We will use linear interpolation for minifying filter. - glTexImage2D(GL_TEXTURE_2D, 0, ilGetInteger(IL_IMAGE_BPP), ilGetInteger(IL_IMAGE_WIDTH), ilGetInteger(IL_IMAGE_HEIGHT), 0, - ilGetInteger(IL_IMAGE_FORMAT), GL_UNSIGNED_BYTE, ilGetData());// Texture specification. - continue; - -it_for_err: - - LogError(QString("DevIL error: %1, [%2]").arg(ilGetError()).arg(ilGetString(ilGetError()))); - mTexture_IDMap.remove(filename); - }// for(size_t idx_texture = 0; idx_texture < num_textures; i++) - - // Because we have already copied image data into texture data we can release memory used by image. - ilDeleteImages(num_textures, id_images); - - //Cleanup - delete [] id_images; - delete [] id_textures; } void CGLView::BBox_GetForNode(const aiNode& pNode, const aiMatrix4x4& pParent_TransformationMatrix, SBBox& pNodeBBox, bool& pFirstAssign) { -aiMatrix4x4 mat_trans = pParent_TransformationMatrix * pNode.mTransformation; + aiMatrix4x4 mat_trans = pParent_TransformationMatrix * pNode.mTransformation; // Check if node has meshes for(size_t idx_idx_mesh = 0; idx_idx_mesh < pNode.mNumMeshes; idx_idx_mesh++) @@ -393,7 +437,7 @@ void CGLView::LogError(const QString& pMessage) void CGLView::Draw_Node(const aiNode* pNode) { -aiMatrix4x4 mat_node = pNode->mTransformation; + aiMatrix4x4 mat_node = pNode->mTransformation; // Apply node transformation matrix. mat_node.Transpose(); @@ -472,7 +516,7 @@ void CGLView::Draw_Mesh(const size_t pMesh_Index) void CGLView::Draw_BBox(const SBBox& pBBox) { -aiVector3D vertex[8]; + aiVector3D vertex[8]; BBox_GetVertices(pBBox, vertex); // Draw @@ -546,9 +590,27 @@ void CGLView::resizeGL(int pWidth, int pHeight) gluPerspective(mCamera_FOVY, mCamera_Viewport_AspectRatio, 1.0, 100000.0);///TODO: znear/zfar depend on scene size. } +void CGLView::drawCoordSystem() { + glBindTexture(GL_TEXTURE_1D, 0); + glBindTexture(GL_TEXTURE_2D, 0); + glBindTexture(GL_TEXTURE_3D, 0); + glEnable(GL_COLOR_MATERIAL); + glBegin(GL_LINES); + // X, -X + qglColor(QColor(Qt::red)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(100000.0, 0.0, 0.0); + qglColor(QColor(Qt::cyan)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(-100000.0, 0.0, 0.0); + // Y, -Y + qglColor(QColor(Qt::green)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(0.0, 100000.0, 0.0); + qglColor(QColor(Qt::magenta)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(0.0, -100000.0, 0.0); + // Z, -Z + qglColor(QColor(Qt::blue)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(0.0, 0.0, 100000.0); + qglColor(QColor(Qt::yellow)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(0.0, 0.0, -100000.0); + glEnd(); +} + void CGLView::paintGL() { -QTime time_paintbegin; + QTime time_paintbegin; time_paintbegin = QTime::currentTime(); @@ -560,23 +622,11 @@ QTime time_paintbegin; glTranslatef(-mHelper_Camera.Translation_ToScene.x, -mHelper_Camera.Translation_ToScene.y, -mHelper_Camera.Translation_ToScene.z); glMultMatrixf((GLfloat*)&mHelper_Camera.Rotation_Scene); // Coordinate system - if(mLightingEnabled) glDisable(GL_LIGHTING);///TODO: display list + if ( mLightingEnabled ) { + glDisable( GL_LIGHTING );///TODO: display list + } + drawCoordSystem(); - glBindTexture(GL_TEXTURE_1D, 0); - glBindTexture(GL_TEXTURE_2D, 0); - glBindTexture(GL_TEXTURE_3D, 0); - glEnable(GL_COLOR_MATERIAL); - glBegin(GL_LINES); - // X, -X - qglColor(QColor(Qt::red)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(100000.0, 0.0, 0.0); - qglColor(QColor(Qt::cyan)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(-100000.0, 0.0, 0.0); - // Y, -Y - qglColor(QColor(Qt::green)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(0.0, 100000.0, 0.0); - qglColor(QColor(Qt::magenta)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(0.0, -100000.0, 0.0); - // Z, -Z - qglColor(QColor(Qt::blue)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(0.0, 0.0, 100000.0); - qglColor(QColor(Qt::yellow)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(0.0, 0.0, -100000.0); - glEnd(); glDisable(GL_COLOR_MATERIAL); if(mLightingEnabled) glEnable(GL_LIGHTING); @@ -971,8 +1021,8 @@ void CGLView::Lighting_DisableSource(const size_t pLightNumber) void CGLView::Camera_Set(const size_t pCameraNumber) { -SHelper_Camera& hcam = mHelper_Camera;// reference with short name for conveniance. -aiVector3D up; + SHelper_Camera& hcam = mHelper_Camera;// reference with short name for conveniance. + aiVector3D up; if(mCamera_DefaultAdded || (pCameraNumber >= mScene->mNumCameras))// If default camera used then 'pCameraNumber' doesn't matter. { diff --git a/tools/assimp_qt_viewer/glview.hpp b/tools/assimp_qt_viewer/glview.hpp index 25c340565..49207a7ed 100644 --- a/tools/assimp_qt_viewer/glview.hpp +++ b/tools/assimp_qt_viewer/glview.hpp @@ -156,6 +156,8 @@ private: // Lighting bool mLightingEnabled = false;///< If true then OpenGL lighting is enabled (glEnable(GL_LIGHTING)), if false - disabled. // Textures + ///TODO: map is goooood, but not for case when one image can be used in different materials with difference in: texture transformation, targeting of the + /// texture (ambient or emission, or even height map), texture properties. QMap mTexture_IDMap;///< Map image filenames to textures ID's. /**********************************/ @@ -251,7 +253,7 @@ private: /********************************************************************/ protected: - + void drawCoordSystem(); /// \fn void initializeGL() override /// Overrided function for initialise OpenGL. void initializeGL() override; diff --git a/tools/assimp_qt_viewer/mainwindow.cpp b/tools/assimp_qt_viewer/mainwindow.cpp index ea4a6efe7..cb4c4a67e 100644 --- a/tools/assimp_qt_viewer/mainwindow.cpp +++ b/tools/assimp_qt_viewer/mainwindow.cpp @@ -325,7 +325,7 @@ bool selected = ui->lstLight->isItemSelected(ui->lstLight->currentItem()); mGLView->updateGL(); } -void MainWindow::on_lstCamera_clicked(__unused const QModelIndex &index) +void MainWindow::on_lstCamera_clicked( const QModelIndex &) { mGLView->Camera_Set(ui->lstLight->currentRow()); mGLView->updateGL(); diff --git a/tools/assimp_qt_viewer/mainwindow.hpp b/tools/assimp_qt_viewer/mainwindow.hpp index f51e023ec..940840aee 100644 --- a/tools/assimp_qt_viewer/mainwindow.hpp +++ b/tools/assimp_qt_viewer/mainwindow.hpp @@ -6,7 +6,7 @@ #pragma once // Header files, Qt. -#include +#include // Header files, project. #include "glview.hpp"