diff --git a/adm/scripts/android_build.bat b/adm/scripts/android_build.bat index e5eda22268..65466d437e 100644 --- a/adm/scripts/android_build.bat +++ b/adm/scripts/android_build.bat @@ -13,6 +13,7 @@ rem Paths to 3rd-party tools and libraries set "anNdkPath=" set "aFreeType=" set "aRapidJson=" +set "aDraco=" rem Build stages to perform set "toCMake=1" @@ -34,7 +35,9 @@ set "BUILD_ApplicationFramework=ON" set "BUILD_DataExchange=ON" rem Optional 3rd-party libraries to enable +set "USE_FREETYPE=ON" set "USE_RAPIDJSON=OFF" +set "USE_DRACO=OFF" rem Archive tool set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on" @@ -162,6 +165,7 @@ if ["%toCMake%"] == ["1"] ( -D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^ -D BUILD_MODULE_Draw:BOOL="OFF" ^ -D BUILD_DOC_Overview:BOOL="OFF" ^ + -D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^ -D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^ -D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^ -D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^ @@ -170,6 +174,11 @@ if ["%toCMake%"] == ["1"] ( -D USE_RAPIDJSON:BOOL="%USE_RAPIDJSON%" ^ -D 3RDPARTY_RAPIDJSON_DIR:PATH="%aRapidJson%" ^ -D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="%aRapidJson%/include" ^ + -D USE_DRACO:BOOL="%USE_DRACO%" ^ + -D 3RDPARTY_DRACO_DIR:PATH="%aDraco%" ^ + -D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="%aDraco%/include" ^ + -D 3RDPARTY_DRACO_LIBRARY_DIR:PATH="%aDraco%/libs/%anAbi%" ^ + -D 3RDPARTY_DRACO_LIBRARY:FILEPATH="%aDraco%/libs/%anAbi%/libfreetype.so" ^ "%aCasSrc%" if errorlevel 1 ( diff --git a/adm/scripts/android_custom.bat.template b/adm/scripts/android_custom.bat.template index 87fb401ca9..45881c6d40 100644 --- a/adm/scripts/android_custom.bat.template +++ b/adm/scripts/android_custom.bat.template @@ -6,6 +6,7 @@ rem set "PATH=c:\CMake\bin;%PATH%" rem set "anNdkPath=c:/android-ndk-r12" rem set "aFreeType=c:/freetype-2.7.1-android" rem set "aRapidJson=c:/rapidjson-1.1.0" +rem set "aDraco=c:/draco-1.4.1-android" rem Uncomment to customize building steps rem set "aBuildRoot=%~dp0..\..\work" @@ -28,4 +29,5 @@ rem set "BUILD_ApplicationFramework=ON" rem set "BUILD_DataExchange=ON" rem Optional 3rd-party libraries to enable -rem set USE_RAPIDJSON=ON +rem set "USE_RAPIDJSON=ON" +rem set "USE_DRACO=ON" diff --git a/adm/scripts/cmake_custom.bat.template b/adm/scripts/cmake_custom.bat.template index 38bf6e044f..51813eaa09 100644 --- a/adm/scripts/cmake_custom.bat.template +++ b/adm/scripts/cmake_custom.bat.template @@ -42,5 +42,6 @@ rem set USE_FFMPEG=OFF rem set USE_FREEIMAGE=OFF rem set USE_GLES2=OFF rem set USE_RAPIDJSON=OFF +rem set USE_DRACO=OFF rem set USE_TBB=OFF rem set USE_VTK=OFF diff --git a/adm/scripts/cmake_custom.sh.template b/adm/scripts/cmake_custom.sh.template index e7a37f19dc..6ed63c7f13 100644 --- a/adm/scripts/cmake_custom.sh.template +++ b/adm/scripts/cmake_custom.sh.template @@ -35,6 +35,7 @@ FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1" #USE_FREEIMAGE=OFF #USE_GLES2=OFF #USE_RAPIDJSON=OFF +#USE_DRACO=OFF #USE_TBB=OFF #USE_VTK=OFF diff --git a/adm/scripts/cmake_gen.bat b/adm/scripts/cmake_gen.bat index 428107902b..38c6918305 100644 --- a/adm/scripts/cmake_gen.bat +++ b/adm/scripts/cmake_gen.bat @@ -37,6 +37,7 @@ set USE_FFMPEG=OFF set USE_FREEIMAGE=OFF set USE_GLES2=OFF set USE_RAPIDJSON=OFF +set USE_DRACO=OFF set USE_TBB=OFF set USE_VTK=OFF @@ -76,6 +77,7 @@ cmake -G "%arch_compile%" ^ -D USE_FREEIMAGE:BOOL=%USE_FREEIMAGE% ^ -D USE_GLES2:BOOL=%USE_GLES2% ^ -D USE_RAPIDJSON:BOOL=%USE_RAPIDJSON% ^ + -D USE_DRACO:BOOL=%USE_DRACO% ^ -D USE_TBB:BOOL=%USE_TBB% ^ -D USE_VTK:BOOL=%USE_VTK% ^ "%SrcRoot%" diff --git a/adm/scripts/cmake_gen.sh b/adm/scripts/cmake_gen.sh index 4150f21ab0..9c088715d2 100755 --- a/adm/scripts/cmake_gen.sh +++ b/adm/scripts/cmake_gen.sh @@ -40,6 +40,7 @@ USE_FFMPEG=OFF USE_FREEIMAGE=OFF USE_GLES2=OFF USE_RAPIDJSON=OFF +USE_DRACO=OFF USE_TBB=OFF USE_VTK=OFF AUX_ARGS= @@ -79,6 +80,7 @@ cmake -G "Unix Makefiles" \ -D USE_FREEIMAGE:BOOL=$USE_FREEIMAGE \ -D USE_GLES2:BOOL=$USE_GLES2 \ -D USE_RAPIDJSON:BOOL=$USE_RAPIDJSON \ + -D USE_DRACO:BOOL=$USE_DRACO \ -D USE_TBB:BOOL=$USE_TBB \ -D USE_VTK:BOOL=$USE_VTK \ $AUX_ARGS "$SrcRoot" diff --git a/adm/scripts/ios_build.sh b/adm/scripts/ios_build.sh index 7de7c13d79..959e6d7b49 100755 --- a/adm/scripts/ios_build.sh +++ b/adm/scripts/ios_build.sh @@ -17,6 +17,7 @@ export aBuildRoot=work export aFreeType= export aFreeImage= export aRapidJson= +export aDraco= # build stages to perform export toSimulator=0 @@ -34,8 +35,10 @@ export BUILD_Visualization=ON export BUILD_ApplicationFramework=ON export BUILD_DataExchange=ON +export USE_FREETYPE=ON export USE_FREEIMAGE=OFF export USE_RAPIDJSON=OFF +export USE_DRACO=OFF export IPHONEOS_DEPLOYMENT_TARGET=8.0 export anAbi=arm64 @@ -117,13 +120,18 @@ if [[ $toCMake == 1 ]]; then -D INSTALL_DIR_LIB:STRING="lib" \ -D INSTALL_DIR_RESOURCE:STRING="src" \ -D INSTALL_NAME_DIR:STRING="@executable_path/../Frameworks" \ + -D USE_FREETYPE:BOOL="$USE_FREETYPE" \ -D 3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \ -D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \ -D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \ -D 3RDPARTY_FREETYPE_LIBRARY_DIR:PATH="$aFreeType/lib" \ - -D USE_RAPIDJSON:BOOL="ON" \ + -D USE_RAPIDJSON:BOOL="$USE_RAPIDJSON" \ -D 3RDPARTY_RAPIDJSON_DIR:PATH="$aRapidJson" \ -D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="$aRapidJson/include" \ + -D USE_DRACO:BOOL="$USE_DRACO" \ + -D 3RDPARTY_DRACO_DIR:PATH="$aDraco" \ + -D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="$aDraco/include" \ + -D 3RDPARTY_DRACO_LIBRARY_DIR:PATH="$aDraco/lib" \ -D USE_FREEIMAGE:BOOL="$USE_FREEIMAGE" \ -D 3RDPARTY_FREEIMAGE_DIR:PATH="$aFreeImage" \ -D 3RDPARTY_FREEIMAGE_INCLUDE_DIR:FILEPATH="$aFreeImage/include" \ diff --git a/adm/scripts/ios_custom.sh.template b/adm/scripts/ios_custom.sh.template index f5f93b9a41..52f15eb8b0 100644 --- a/adm/scripts/ios_custom.sh.template +++ b/adm/scripts/ios_custom.sh.template @@ -3,6 +3,7 @@ export PATH=/Applications/CMake.app/Contents/bin:$PATH export aFreeType="$aSrcRoot/../3rdparty/freetype-2.10.4-ios" export aFreeImage="$aSrcRoot/../3rdparty/freeimage-3.18-ios" export aRapidJson="$aSrcRoot/../3rdparty/rapidjson-1.1.0" +export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-ios" # Uncomment to customize building steps #export toSimulator=0 @@ -21,6 +22,7 @@ export aRapidJson="$aSrcRoot/../3rdparty/rapidjson-1.1.0" #export BUILD_DataExchange=ON #export USE_RAPIDJSON=ON +#export USE_DRACO=ON #export USE_FREEIMAGE=ON #export IPHONEOS_DEPLOYMENT_TARGET=8.0 diff --git a/adm/scripts/macos_build.sh b/adm/scripts/macos_build.sh index 57b7b3a7ef..e5fbe96c7f 100755 --- a/adm/scripts/macos_build.sh +++ b/adm/scripts/macos_build.sh @@ -17,6 +17,7 @@ export aBuildRoot=work export aFreeType= export aFreeImage= export aRapidJson= +export aDraco= # build stages to perform export toCMake=1 @@ -35,6 +36,7 @@ export BUILD_Draw=ON export USE_FREEIMAGE=ON export USE_RAPIDJSON=OFF +export USE_DRACO=OFF export MACOSX_DEPLOYMENT_TARGET=10.10 #export anAbi=arm64 @@ -106,6 +108,10 @@ if [[ $toCMake == 1 ]]; then -D USE_RAPIDJSON:BOOL="$USE_RAPIDJSON" \ -D 3RDPARTY_RAPIDJSON_DIR:PATH="$aRapidJson" \ -D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="$aRapidJson/include" \ + -D USE_DRACO:BOOL="$USE_DRACO" \ + -D 3RDPARTY_DRACO_DIR:PATH="$aDraco" \ + -D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="$aDraco/include" \ + -D 3RDPARTY_DRACO_LIBRARY_DIR:PATH="$aDraco/lib" \ -D USE_FREEIMAGE:BOOL="$USE_FREEIMAGE" \ -D 3RDPARTY_FREEIMAGE_DIR:PATH="$aFreeImage" \ -D 3RDPARTY_FREEIMAGE_INCLUDE_DIR:FILEPATH="$aFreeImage/include" \ diff --git a/adm/scripts/macos_custom.sh.template b/adm/scripts/macos_custom.sh.template index 54bc482925..c56a72fa06 100644 --- a/adm/scripts/macos_custom.sh.template +++ b/adm/scripts/macos_custom.sh.template @@ -3,6 +3,7 @@ export PATH=/Applications/CMake.app/Contents/bin:$PATH export aFreeType="$aSrcRoot/../3rdparty/freetype-2.10.4-macos" export aFreeImage="$aSrcRoot/../3rdparty/freeimage-3.18-macos" export aRapidJson="$aSrcRoot/../3rdparty/rapidjson-1.1.0" +export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-macos" # Uncomment to customize building steps #export aBuildRoot=work @@ -20,6 +21,7 @@ export aRapidJson="$aSrcRoot/../3rdparty/rapidjson-1.1.0" #export BUILD_Draw=ON #export USE_RAPIDJSON=ON +#export USE_DRACO=ON #export USE_FREEIMAGE=ON #export MACOSX_DEPLOYMENT_TARGET=10.10 diff --git a/adm/scripts/mingw_build.bat b/adm/scripts/mingw_build.bat index 69a289285c..d66d339e5e 100644 --- a/adm/scripts/mingw_build.bat +++ b/adm/scripts/mingw_build.bat @@ -14,6 +14,7 @@ set "aMingwVars=" set "aFreeType=" set "aFreeImage=" set "aRapidJson=" +set "aDraco=" set "aTclTk=" rem Build stages to perform @@ -34,7 +35,9 @@ set "BUILD_DataExchange=ON" set "BUILD_Draw=ON" rem Optional 3rd-party libraries to enable +set "USE_FREETYPE=ON" set "USE_RAPIDJSON=OFF" +set "USE_DRACO=OFF" set "USE_FREEIMAGE=ON" rem Archive tool @@ -162,7 +165,7 @@ if ["%toCMake%"] == ["1"] ( -D 3RDPARTY_TK_LIBRARY_DIR:PATH="%aTclTk%/lib" ^ -D 3RDPARTY_TK_DLL_DIR:PATH="%aTclTk%/bin" ^ -D USE_D3D:BOOL="ON" ^ - -D USE_FREETYPE:BOOL="ON" ^ + -D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^ -D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^ -D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^ -D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^ @@ -174,6 +177,10 @@ if ["%toCMake%"] == ["1"] ( -D USE_RAPIDJSON:BOOL="%USE_RAPIDJSON%" ^ -D 3RDPARTY_RAPIDJSON_DIR:PATH="%aRapidJson%" ^ -D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="%aRapidJson%/include" ^ + -D USE_DRACO:BOOL="%USE_DRACO%" ^ + -D 3RDPARTY_DRACO_DIR:PATH="%aDraco%" ^ + -D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="%aDraco%/include" ^ + -D 3RDPARTY_DRACO_LIBRARY_DIR:PATH="%aDraco%/lib" ^ "%aCasSrc%" if errorlevel 1 ( diff --git a/adm/scripts/mingw_custom.bat.template b/adm/scripts/mingw_custom.bat.template index 8870a53ec9..0a7f6c6750 100644 --- a/adm/scripts/mingw_custom.bat.template +++ b/adm/scripts/mingw_custom.bat.template @@ -4,6 +4,7 @@ set "aFreeType=%aCasSrc%/../3rdparty/freetype-2.6.3-mingw-64" set "aTclTk=%aCasSrc%/../3rdparty/tcltk-8.6.4-mingw-64" set "aFreeImage=%aCasSrc%/../3rdparty/freeimage-3.17-0-mingw-64" set "aRapidJson=%aCasSrc%/../3rdparty/rapidjson-1.1.0" +set "aDraco=%aCasSrc%/../3rdparty/draco-1.4-1-mingw-64" set "aMingwVars=c:\mingw-8.3.0-msys2\mingwvars.bat" @@ -24,4 +25,5 @@ rem set "BUILD_DataExchange=ON" rem set "BUILD_Draw=ON" rem set "USE_RAPIDJSON=ON" +rem set "USE_DRACO=ON" rem set "USE_FREEIMAGE=ON" diff --git a/adm/scripts/wasm_build.bat b/adm/scripts/wasm_build.bat index 4e892b5305..ba664da14f 100644 --- a/adm/scripts/wasm_build.bat +++ b/adm/scripts/wasm_build.bat @@ -13,6 +13,7 @@ rem Paths to 3rd-party tools and libraries set "aCmakeBin=" set "aFreeType=" set "aRapidJson=" +set "aDraco=" set "aTcl=" rem Build stages to perform @@ -34,7 +35,9 @@ set "BUILD_DataExchange=ON" set "BUILD_Draw=OFF" rem Optional 3rd-party libraries to enable +set "USE_FREETYPE=ON" set "USE_RAPIDJSON=OFF" +set "USE_DRACO=OFF" rem Archive tool set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on" @@ -159,9 +162,6 @@ if ["%toCMake%"] == ["1"] ( -D INSTALL_DIR:PATH="%aDestDir%" ^ -D INSTALL_DIR_INCLUDE:STRING="inc" ^ -D INSTALL_DIR_RESOURCE:STRING="src" ^ - -D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^ - -D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^ - -D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^ -D BUILD_MODULE_FoundationClasses:BOOL="ON" ^ -D BUILD_MODULE_ModelingData:BOOL="%BUILD_ModelingData%" ^ -D BUILD_MODULE_ModelingAlgorithms:BOOL="%BUILD_ModelingAlgorithms%" ^ @@ -170,14 +170,23 @@ if ["%toCMake%"] == ["1"] ( -D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^ -D BUILD_MODULE_Draw:BOOL="%BUILD_Draw%" ^ -D BUILD_DOC_Overview:BOOL="OFF" ^ + -D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^ + -D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^ + -D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^ + -D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^ -D USE_RAPIDJSON:BOOL="%USE_RAPIDJSON%" ^ -D 3RDPARTY_RAPIDJSON_DIR:PATH="%aRapidJson%" ^ -D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="%aRapidJson%/include" ^ + -D USE_DRACO:BOOL="%USE_DRACO%" ^ + -D 3RDPARTY_DRACO_DIR:PATH="%aDraco%" ^ + -D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="%aDraco%/include" ^ + -D 3RDPARTY_DRACO_LIBRARY_DIR:PATH="%aDraco%/lib" ^ + -D 3RDPARTY_DRACO_LIBRARY:FILEPATH="%aDraco%/lib/libdraco.a" ^ + -D USE_TK:BOOL="OFF" ^ -D 3RDPARTY_TCL_DIR:PATH="%aTcl%" ^ -D 3RDPARTY_TCL_INCLUDE_DIR:PATH="%aTcl%/include" ^ -D 3RDPARTY_TCL_LIBRARY_DIR:PATH="%aTcl%/lib" ^ -D 3RDPARTY_TCL_LIBRARY:FILEPATH="%aTcl%/lib/libtcl.a" ^ - -D USE_TK:BOOL="OFF" ^ "%aCasSrc%" if errorlevel 1 ( diff --git a/adm/scripts/wasm_custom.bat.template b/adm/scripts/wasm_custom.bat.template index 1b07aa7144..caeaf09938 100644 --- a/adm/scripts/wasm_custom.bat.template +++ b/adm/scripts/wasm_custom.bat.template @@ -1,7 +1,8 @@ rem Environment configuration template for wasm_build.bat (to be renamed as wasm_custom.bat) set "EMSDK_ROOT=%aCasSrc%\..\emsdk" -set "aFreeType=%aCasSrc%\..\3rdparty\freetype-2.7.1-wasm" +set "aFreeType=%aCasSrc%\..\3rdparty\freetype-2.7.1-wasm32" rem set "aRapidJson=%aCasSrc%\..\3rdparty\rapidjson-1.1.0" +rem set "aDraco=%aCasSrc%\..\3rdparty\draco-1.4.1-wasm32" rem set "aCmakeBin=%ProgramW6432%\CMake\bin" rem Uncomment to customize building steps @@ -24,3 +25,4 @@ rem set "BUILD_ApplicationFramework=ON" rem set "BUILD_DataExchange=ON" rem set "USE_RAPIDJSON=OFF" +rem set "USE_DRACO=ON" diff --git a/src/DRAWEXE/EXTERNLIB_STATIC b/src/DRAWEXE/EXTERNLIB_STATIC index 59b8d83f41..f99e4d4449 100644 --- a/src/DRAWEXE/EXTERNLIB_STATIC +++ b/src/DRAWEXE/EXTERNLIB_STATIC @@ -60,6 +60,7 @@ CSF_OpenGlesLibs CSF_FFmpeg CSF_FreeImagePlus CSF_FREETYPE +CSF_Draco CSF_user32 CSF_advapi32 CSF_XwLibs diff --git a/src/RWGltf/RWGltf_TriangulationReader.cxx b/src/RWGltf/RWGltf_TriangulationReader.cxx index d4dff574bc..7d57656680 100644 --- a/src/RWGltf/RWGltf_TriangulationReader.cxx +++ b/src/RWGltf/RWGltf_TriangulationReader.cxx @@ -22,7 +22,9 @@ #include #ifdef HAVE_DRACO + #include #include + #include #endif namespace