From e4c8422a8a5209c37348135bee5f7863a82abee5 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:11:21 -0400 Subject: [PATCH 01/71] Separate the actual project listings into their own file --- CMakeLists.txt | 309 +++------------------------------------------ TODO | 2 +- dependencies.cmake | 295 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 311 insertions(+), 295 deletions(-) create mode 100644 dependencies.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index a2dba7d0..1ec083e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -442,298 +442,19 @@ if (USE_OSPRAY) find_program(M4_EXECUTABLE m4 REQUIRED) endif (USE_OSPRAY) - -############################################################################### -# Applying patch files cross platform is a challenging problem due to the -# shortage of portable tools and issues with LF vs CRLF files - see -# https://gitlab.kitware.com/cmake/cmake/-/issues/16854 for more background on -# this. We need to address the patch build tool first thing, since any of the -# other ExternalProject_Add builds that follow may depend on it. -############################################################################### -add_project(patch) - ############################################################################### -# Although we have bundled flex and bison programs, they can be problematic to -# build - they require working Autotools tool chains (except on Windows where -# we have winflexbison). We therefore attempt these builds only if we need to. -# This check must come after the patch subdirectory, since if we DO add_project -# the flexbison directory it will need the patch executable. +# There are a lot of individual projects, and their ordering is important. We +# store them as a separate file. ############################################################################### -if (USE_APPLESEED OR USE_OSPRAY) - - find_package(FLEX) - - if (NOT FLEX_FOUND) - set(ENABLE_FLEX ON) - endif (NOT FLEX_FOUND) - find_package(BISON) +include("${CMAKE_SOURCE_DIR}/dependencies.cmake") - if (NOT BISON_FOUND) - set(ENABLE_BISON ON) - endif (NOT BISON_FOUND) - - if (ENABLE_FLEX OR ENABLE_BISON) - add_project(flexbison GROUPS "APPLESEED;OSPRAY") - endif (ENABLE_FLEX OR ENABLE_BISON) - - # Whether or not we actually added the subdirectories, let subsequent targets - # know we have handled the FLEX and BISON dependencies. Some will list these - # as potential build targets, since we may try to compile them, but as the - # default orientation for these is "build only if we have to" the find - # process itself needs to satisfy the check. - set(FLEX_ADDED 1) - set(BISON_ADDED 1) - -endif (USE_APPLESEED OR USE_OSPRAY) - -############################################################################### -# Build tools are used during compilation, but are not bundled or distributed -# with binary packages. We group these tools here for convenience. Unlike the -# build targets intended for distribution, these outputs are all -# targeted to the noinstall subdirectory. -############################################################################### -add_project(astyle GROUPS "BRLCAD") -add_project(lemon GROUPS "BRLCAD") -add_project(re2c GROUPS "BRLCAD") -add_project(perplex GROUPS "BRLCAD") -add_project(strclear GROUPS "BRLCAD") -add_project(xmltools GROUPS "BRLCAD_EXTRA") # Used for Docbook building - -# RPATH editing - LIEF has the core capabilities, and plief exposes them via -# a command line utility with patchelf compatible options, so we can drop -# either patchelf or plief into our upstream workflows. -add_project(lief GROUPS "BRLCAD") -add_project(plief GROUPS "BRLCAD") - -# Keeping this set up for easy turn-on until we're confident plief+LIEF has -# all of our use cases covered - plief is preferred, but we've already hit -# one case where a bug in LIEF had to be fixed. -#add_project(patchelf GROUPS "BRLCAD") +# Now that we have the dependencies specified, finish the dependencies DOT file +file(APPEND "${CMAKE_BINARY_DIR}/bext.dot" "\n}\n") ############################################################################### -# Build logic is broken out per-library, but the ordering is important. Some -# libraries will depend on others listed here (for example, we want openNURBS -# to use our bundled zlib if it is enabled.) Developers adding, reordering or -# removing dependencies here need to make sure they are aware of impact they -# may be having on other external projects in other files. +# Warn the user if the settings changed in a way the indicate there is a risk +# of now-disabled build products in the output directory ############################################################################### - -# zlib compression/decompression library -# https://zlib.net -add_project(zlib GROUPS "APPLESEED;BRLCAD;OSPRAY") - -# zstd - fast lossless compression library -# https://github.com/facebook/zstd -add_project(zstd GROUPS "APPLESEED;OSPRAY") - -# minizip-ng - zip manipulation library written in C -# https://github.com/zlib-ng/minizip-ng -add_project(minizip-ng GROUPS "APPLESEED") - -# LZ4 - lossless compression algorithm -# https://github.com/lz4/lz4 -add_project(lz4 GROUPS "APPLESEED") - -# libdeflate fast, whole-buffer DEFLATE-based compression -# https://github.com/ebiggers/libdeflate -add_project(deflate GROUPS "APPLESEED") - -# fmt - formatting library providing an alternative to C++ iostreams -# https://github.com/fmtlib/fmt -add_project(fmt GROUPS "APPLESEED") - -# yaml-cpp - YAML parser and emitter in C++ matching the YAML 1.2 spec -# https://github.com/jbeder/yaml-cpp -add_project(yaml-cpp GROUPS "APPLESEED") - -# pystring - collection of C++ functions which match the interface and behavior -# of python's string class methods -# https://github.com/imageworks/pystring -add_project(pystring GROUPS "APPLESEED") - -# Henry Spencer's regular expression matching library -# https://github.com/BRL-CAD/regex -add_project(regex GROUPS "BRLCAD") - -# expat - library for parsing XML 1.0 Fourth Edition -# https://github.com/libexpat/libexpat -add_project(expat GROUPS "APPLESEED") - -# International Components for Unicode -# https://github.com/unicode-org/icu -add_project(icu GROUPS "APPLESEED") - -# Xerces-C++ - a validating XML parser -# https://xerces.apache.org/xerces-c/ -add_project(xerces-c GROUPS "APPLESEED") - -# Boost - C++ libraries -# https://www.boost.org -# https://github.com/boostorg/boost -add_project(boost GROUPS "APPLESEED") - -# netpbm library - support for pnm,ppm,pbm, etc. image files -# http://netpbm.sourceforge.net/ -add_project(netpbm GROUPS "BRLCAD") - -# libjpeg-turbo - JPEG image codec -# https://github.com/libjpeg-turbo/libjpeg-turbo -add_project(jpeg GROUPS "APPLESEED;GDAL") - -# libpng - Portable Network Graphics image file support -# http://www.libpng.org/pub/png/libpng.html -add_project(png GROUPS "APPLESEED;BRLCAD") - -# libtiff - Tag Image File Format (TIFF) support -# https://libtiff.gitlab.io/libtiff/ -# https://gitlab.com/libtiff/libtiff -add_project(tiff GROUPS "APPLESEED;GDAL") - -# OpenEXR - EXR image storage format -# https://openexr.com/ -# https://github.com/AcademySoftwareFoundation/openexr -add_project(openexr GROUPS "APPLESEED") - -# UtahRLE - Raster Image library -# https://github.com/BRL-CAD/utahrle -add_project(utahrle GROUPS "BRLCAD") - -# OpenColorIO - color management -# https://opencolorio.org -# https://github.com/AcademySoftwareFoundation/OpenColorIO -# Note - the VFX Reference Platform (https://vfxplatform.com/) -# is a useful reference for what versions to expect elements -# of the rendering pipeline software stack to use/require -add_project(opencolorio GROUPS "APPLESEED") - -# OpenImageIO - reading and writing images, aimed at VFX studios -# https://github.com/OpenImageIO/oiio -add_project(openimageio GROUPS "APPLESEED") - -# ncurses - text-based user interfaces library -# https://invisible-island.net/ncurses/ -add_project(ncurses GROUPS "OSPRAY") - -# Linenoise - line editing library -# https://github.com/msteveb/linenoise -add_project(linenoise GROUPS "BRLCAD") - -# Lightning Memory-Mapped Database -# https://github.com/LMDB/lmdb -add_project(lmdb GROUPS "BRLCAD") - -# Eigen - linear algebra library -# https://eigen.tuxfamily.org -add_project(eigen GROUPS "BRLCAD;APPLESEED") - -# oneTBB - Threading Building Blocks -# https://github.com/oneapi-src/oneTBB -add_project(onetbb GROUPS "APPLESEED;OSPRAY") - -# rkcommon - C++ infrastructure and CMake utilities -# https://github.com/ospray/rkcommon -add_project(rkcommon GROUPS "OSPRAY") - -# LLVM - code generation support -# https://llvm.org/ -add_project(llvm GROUPS "APPLESEED;OSPRAY") - -# ISPC - Implicit SPMD Program Compiler -# https://ispc.github.io -# https://github.com/ispc/ispc -add_project(ispc GROUPS "OSPRAY") - -# STEPcode - support for reading and writing STEP files -# https://github.com/stepcode/stepcode -add_project(stepcode GROUPS "BRLCAD_EXTRA") - -# SQLITE3 - embeddable database -# https://www.sqlite.org -add_project(sqlite3 GROUPS "GDAL") - -# PROJ - generic coordinate transformation -# https://proj.org -add_project(proj GROUPS "GDAL") - -# GDAL - translator library for raster and vector geospatial data formats -# https://gdal.org -add_project(gdal GROUPS "GDAL") - -# pugixml - a light-weight C++ XML processing library -# https://pugixml.org/ -add_project(pugixml GROUPS "BRLCAD;APPLESEED") - -# Open Asset Import Library - library for supporting I/O for a number of -# Geometry file formats -# https://github.com/assimp/assimp -add_project(assetimport GROUPS "BRLCAD") - -# OpenCV - Open Source Computer Vision Library -# http://opencv.org -add_project(opencv GROUPS "BRLCAD_EXTRA") - -# OpenMesh Library - library for representing and manipulating polygonal meshes -# https://www.graphics.rwth-aachen.de/software/openmesh/ -add_project(openmesh GROUPS "BRLCAD_EXTRA") - -# Manifold Library - used for performing boolean ops on meshes -# https://github.com/elalish/manifold -add_project(manifold GROUPS "BRLCAD") - -# openNURBS - Non-Uniform Rational BSpline library -# https://github.com/mcneel/opennurbs -add_project(opennurbs GROUPS "BRLCAD") - -# OSMesa - Off Screen Mesa Rendering Library -# https://github.com/starseeker/osmesa -add_project(osmesa GROUPS "BRLCAD") - -# Poly2Tri - constrained Delaunay triangulation -# https://github.com/jhasse/poly2tri -add_project(poly2tri GROUPS "BRLCAD") - -# Geogram - a programming library with geometric algorithms -# https://github.com/BrunoLevy/geogram -add_project(geogram GROUPS "BRLCAD_EXTRA") - -# Open Shading Language (OSL) - language for programmable shading -# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage -# -# TODO - need to check if https://github.com/lexxmark/winflexbison will -# work for Windows for OSL's usage of flex/bison... -add_project(osl GROUPS "APPLESEED") - -# Embree raytracing kernel -# https://github.com/embree/embree -add_project(embree GROUPS "APPLESEED;OSPRAY") - -# TCL - scripting language. For Tcl/Tk builds we want -# static lib building on so we get the stub libraries. -# https://www.tcl.tk -set(TCL_ENABLE_TK ON CACHE BOOL "enable tk") -add_project(tcl GROUPS "TCL") -add_project(tk GROUPS "TCL") -add_project(itcl GROUPS "TCL") -add_project(itk GROUPS "TCL") -add_project(iwidgets GROUPS "TCL") -add_project(tkhtml GROUPS "TCL") -add_project(tktable GROUPS "TCL") - -# Qt - cross-platform user interface/application development toolkit -# https://download.qt.io/archive/qt -add_project(qt GROUPS "QT") - -# Appleseed - global illumination rendering engine -# https://github.com/appleseedhq/appleseed -add_project(appleseed GROUPS "APPLESEED") - -# OSPRay - ray tracing engine -# https://github.com/ospray/OSPRay -add_project(ospray GROUPS "OSPRAY") - - -# Warn the user if the settings changed in a way the indicate there is -# a risk of now-disabled build products in the output directory if (EXISTS "${CMAKE_BUNDLE_INSTALL_PREFIX}" AND STALE_INSTALL_WARN) file(GLOB OFILES_BIN LIST_DIRECTORIES TRUE ${CMAKE_BUNDLE_INSTALL_PREFIX}/bin/* ) file(GLOB OFILES_LIB LIST_DIRECTORIES TRUE ${CMAKE_BUNDLE_INSTALL_PREFIX}/lib/* ) @@ -742,17 +463,17 @@ if (EXISTS "${CMAKE_BUNDLE_INSTALL_PREFIX}" AND STALE_INSTALL_WARN) endif (OFILES_BIN OR OFILES_LIB) endif (EXISTS "${CMAKE_BUNDLE_INSTALL_PREFIX}" AND STALE_INSTALL_WARN) -# Close out dependencies DOT file -file(APPEND "${CMAKE_BINARY_DIR}/bext.dot" "\n}\n") - -message("Output directory: ${CMAKE_INSTALL_PREFIX}/${BEXT_ROOT}") - -#--------------------------------------------------------------------- -# On Windows, if we get dlls built for the wrong configuration it can -# cause problems. Define a utility target to check +############################################################################### +# On Windows, if we get dlls built for the wrong configuration it can cause +# problems. Define a utility target to check +############################################################################### add_custom_target(dllcheck COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=\"$\" -DDLL_DIR=\"${CMAKE_INSTALL_PREFIX}/bext_output/install/bin\" -P ${CMAKE_SOURCE_DIR}/CMake/DllTypeCheck.cmake) +############################################################################### +# Report where we will be putting our output +############################################################################### +message("Output directory: ${CMAKE_INSTALL_PREFIX}/${BEXT_ROOT}") # Local Variables: # tab-width: 8 diff --git a/TODO b/TODO index ad0a9104..911023e6 100644 --- a/TODO +++ b/TODO @@ -8,6 +8,6 @@ valid if one of their dependencies changes. We need to: 2. remove old build directory contents for those projects that have had a dependency change status, so their compiles end up detecting - and linking to the correct versions. We can't depend on thrid + and linking to the correct versions. We can't depend on third party build systems to reset everything correctly, so we need to start clean. diff --git a/dependencies.cmake b/dependencies.cmake new file mode 100644 index 00000000..59a53f73 --- /dev/null +++ b/dependencies.cmake @@ -0,0 +1,295 @@ +############################################################################### +# Applying patch files cross platform is a challenging problem due to the +# shortage of portable tools and issues with LF vs CRLF files - see +# https://gitlab.kitware.com/cmake/cmake/-/issues/16854 for more background on +# this. We need to address the patch build tool first thing, since any of the +# other ExternalProject_Add builds that follow may depend on it. +############################################################################### +add_project(patch) + +############################################################################### +# Although we have bundled flex and bison programs, they can be problematic to +# build - they require working Autotools tool chains (except on Windows where +# we have winflexbison). We therefore attempt these builds only if we need to. +# This check must come after the patch subdirectory, since if we DO add_project +# the flexbison directory it will need the patch executable. +############################################################################### +if (USE_APPLESEED OR USE_OSPRAY) + + find_package(FLEX) + + if (NOT FLEX_FOUND) + set(ENABLE_FLEX ON) + endif (NOT FLEX_FOUND) + find_package(BISON) + + if (NOT BISON_FOUND) + set(ENABLE_BISON ON) + endif (NOT BISON_FOUND) + + if (ENABLE_FLEX OR ENABLE_BISON) + add_project(flexbison GROUPS "APPLESEED;OSPRAY") + endif (ENABLE_FLEX OR ENABLE_BISON) + + # Whether or not we actually added the subdirectories, let subsequent targets + # know we have handled the FLEX and BISON dependencies. Some will list these + # as potential build targets, since we may try to compile them, but as the + # default orientation for these is "build only if we have to" the find + # process itself needs to satisfy the check. + set(FLEX_ADDED 1) + set(BISON_ADDED 1) + +endif (USE_APPLESEED OR USE_OSPRAY) + +############################################################################### +# Build tools are used during compilation, but are not bundled or distributed +# with binary packages. We group these tools here for convenience. Unlike the +# build targets intended for distribution, these outputs are all +# targeted to the noinstall subdirectory. +############################################################################### +add_project(astyle GROUPS "BRLCAD") +add_project(lemon GROUPS "BRLCAD") +add_project(re2c GROUPS "BRLCAD") +add_project(perplex GROUPS "BRLCAD") +add_project(strclear GROUPS "BRLCAD") +add_project(xmltools GROUPS "BRLCAD_EXTRA") # Used for Docbook building + +# RPATH editing - LIEF has the core capabilities, and plief exposes them via +# a command line utility with patchelf compatible options, so we can drop +# either patchelf or plief into our upstream workflows. +add_project(lief GROUPS "BRLCAD") +add_project(plief GROUPS "BRLCAD") + +# Keeping this set up for easy turn-on until we're confident plief+LIEF has +# all of our use cases covered - plief is preferred, but we've already hit +# one case where a bug in LIEF had to be fixed. +#add_project(patchelf GROUPS "BRLCAD") + +############################################################################### +# Build logic is broken out per-library, but the ordering is important. Some +# libraries will depend on others listed here (for example, we want openNURBS +# to use our bundled zlib if it is enabled.) Developers adding, reordering or +# removing dependencies here need to make sure they are aware of impact they +# may be having on other external projects in other files. +############################################################################### + +# zlib compression/decompression library +# https://zlib.net +add_project(zlib GROUPS "APPLESEED;BRLCAD;OSPRAY") + +# zstd - fast lossless compression library +# https://github.com/facebook/zstd +add_project(zstd GROUPS "APPLESEED;OSPRAY") + +# minizip-ng - zip manipulation library written in C +# https://github.com/zlib-ng/minizip-ng +add_project(minizip-ng GROUPS "APPLESEED") + +# LZ4 - lossless compression algorithm +# https://github.com/lz4/lz4 +add_project(lz4 GROUPS "APPLESEED") + +# libdeflate fast, whole-buffer DEFLATE-based compression +# https://github.com/ebiggers/libdeflate +add_project(deflate GROUPS "APPLESEED") + +# fmt - formatting library providing an alternative to C++ iostreams +# https://github.com/fmtlib/fmt +add_project(fmt GROUPS "APPLESEED") + +# yaml-cpp - YAML parser and emitter in C++ matching the YAML 1.2 spec +# https://github.com/jbeder/yaml-cpp +add_project(yaml-cpp GROUPS "APPLESEED") + +# pystring - collection of C++ functions which match the interface and behavior +# of python's string class methods +# https://github.com/imageworks/pystring +add_project(pystring GROUPS "APPLESEED") + +# Henry Spencer's regular expression matching library +# https://github.com/BRL-CAD/regex +add_project(regex GROUPS "BRLCAD") + +# expat - library for parsing XML 1.0 Fourth Edition +# https://github.com/libexpat/libexpat +add_project(expat GROUPS "APPLESEED") + +# International Components for Unicode +# https://github.com/unicode-org/icu +add_project(icu GROUPS "APPLESEED") + +# Xerces-C++ - a validating XML parser +# https://xerces.apache.org/xerces-c/ +add_project(xerces-c GROUPS "APPLESEED") + +# Boost - C++ libraries +# https://www.boost.org +# https://github.com/boostorg/boost +add_project(boost GROUPS "APPLESEED") + +# netpbm library - support for pnm,ppm,pbm, etc. image files +# http://netpbm.sourceforge.net/ +add_project(netpbm GROUPS "BRLCAD") + +# libjpeg-turbo - JPEG image codec +# https://github.com/libjpeg-turbo/libjpeg-turbo +add_project(jpeg GROUPS "APPLESEED;GDAL") + +# libpng - Portable Network Graphics image file support +# http://www.libpng.org/pub/png/libpng.html +add_project(png GROUPS "APPLESEED;BRLCAD") + +# libtiff - Tag Image File Format (TIFF) support +# https://libtiff.gitlab.io/libtiff/ +# https://gitlab.com/libtiff/libtiff +add_project(tiff GROUPS "APPLESEED;GDAL") + +# OpenEXR - EXR image storage format +# https://openexr.com/ +# https://github.com/AcademySoftwareFoundation/openexr +add_project(openexr GROUPS "APPLESEED") + +# UtahRLE - Raster Image library +# https://github.com/BRL-CAD/utahrle +add_project(utahrle GROUPS "BRLCAD") + +# OpenColorIO - color management +# https://opencolorio.org +# https://github.com/AcademySoftwareFoundation/OpenColorIO +# Note - the VFX Reference Platform (https://vfxplatform.com/) +# is a useful reference for what versions to expect elements +# of the rendering pipeline software stack to use/require +add_project(opencolorio GROUPS "APPLESEED") + +# OpenImageIO - reading and writing images, aimed at VFX studios +# https://github.com/OpenImageIO/oiio +add_project(openimageio GROUPS "APPLESEED") + +# ncurses - text-based user interfaces library +# https://invisible-island.net/ncurses/ +add_project(ncurses GROUPS "OSPRAY") + +# Linenoise - line editing library +# https://github.com/msteveb/linenoise +add_project(linenoise GROUPS "BRLCAD") + +# Lightning Memory-Mapped Database +# https://github.com/LMDB/lmdb +add_project(lmdb GROUPS "BRLCAD") + +# Eigen - linear algebra library +# https://eigen.tuxfamily.org +add_project(eigen GROUPS "BRLCAD;APPLESEED") + +# oneTBB - Threading Building Blocks +# https://github.com/oneapi-src/oneTBB +add_project(onetbb GROUPS "APPLESEED;OSPRAY") + +# rkcommon - C++ infrastructure and CMake utilities +# https://github.com/ospray/rkcommon +add_project(rkcommon GROUPS "OSPRAY") + +# LLVM - code generation support +# https://llvm.org/ +add_project(llvm GROUPS "APPLESEED;OSPRAY") + +# ISPC - Implicit SPMD Program Compiler +# https://ispc.github.io +# https://github.com/ispc/ispc +add_project(ispc GROUPS "OSPRAY") + +# STEPcode - support for reading and writing STEP files +# https://github.com/stepcode/stepcode +add_project(stepcode GROUPS "BRLCAD_EXTRA") + +# SQLITE3 - embeddable database +# https://www.sqlite.org +add_project(sqlite3 GROUPS "GDAL") + +# PROJ - generic coordinate transformation +# https://proj.org +add_project(proj GROUPS "GDAL") + +# GDAL - translator library for raster and vector geospatial data formats +# https://gdal.org +add_project(gdal GROUPS "GDAL") + +# pugixml - a light-weight C++ XML processing library +# https://pugixml.org/ +add_project(pugixml GROUPS "BRLCAD;APPLESEED") + +# Open Asset Import Library - library for supporting I/O for a number of +# Geometry file formats +# https://github.com/assimp/assimp +add_project(assetimport GROUPS "BRLCAD") + +# OpenCV - Open Source Computer Vision Library +# http://opencv.org +add_project(opencv GROUPS "BRLCAD_EXTRA") + +# OpenMesh Library - library for representing and manipulating polygonal meshes +# https://www.graphics.rwth-aachen.de/software/openmesh/ +add_project(openmesh GROUPS "BRLCAD_EXTRA") + +# Manifold Library - used for performing boolean ops on meshes +# https://github.com/elalish/manifold +add_project(manifold GROUPS "BRLCAD") + +# openNURBS - Non-Uniform Rational BSpline library +# https://github.com/mcneel/opennurbs +add_project(opennurbs GROUPS "BRLCAD") + +# OSMesa - Off Screen Mesa Rendering Library +# https://github.com/starseeker/osmesa +add_project(osmesa GROUPS "BRLCAD") + +# Poly2Tri - constrained Delaunay triangulation +# https://github.com/jhasse/poly2tri +add_project(poly2tri GROUPS "BRLCAD") + +# Geogram - a programming library with geometric algorithms +# https://github.com/BrunoLevy/geogram +add_project(geogram GROUPS "BRLCAD_EXTRA") + +# Open Shading Language (OSL) - language for programmable shading +# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage +# +# TODO - need to check if https://github.com/lexxmark/winflexbison will +# work for Windows for OSL's usage of flex/bison... +add_project(osl GROUPS "APPLESEED") + +# Embree raytracing kernel +# https://github.com/embree/embree +add_project(embree GROUPS "APPLESEED;OSPRAY") + +# TCL - scripting language. For Tcl/Tk builds we want +# static lib building on so we get the stub libraries. +# https://www.tcl.tk +set(TCL_ENABLE_TK ON CACHE BOOL "enable tk") +add_project(tcl GROUPS "TCL") +add_project(tk GROUPS "TCL") +add_project(itcl GROUPS "TCL") +add_project(itk GROUPS "TCL") +add_project(iwidgets GROUPS "TCL") +add_project(tkhtml GROUPS "TCL") +add_project(tktable GROUPS "TCL") + +# Qt - cross-platform user interface/application development toolkit +# https://download.qt.io/archive/qt +add_project(qt GROUPS "QT") + +# Appleseed - global illumination rendering engine +# https://github.com/appleseedhq/appleseed +add_project(appleseed GROUPS "APPLESEED") + +# OSPRay - ray tracing engine +# https://github.com/ospray/OSPRay +add_project(ospray GROUPS "OSPRAY") + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 + From d9a36cfb9706de26804f1a059351bfaad9c8f123 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:21:53 -0400 Subject: [PATCH 02/71] Update sb_patch to 47e1729 --- appleseed/appleseed | 2 +- patch/patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/appleseed/appleseed b/appleseed/appleseed index b5d57a6d..a19d542c 160000 --- a/appleseed/appleseed +++ b/appleseed/appleseed @@ -1 +1 @@ -Subproject commit b5d57a6dacb7b143aaeea991a960b8da44810bfa +Subproject commit a19d542c45f5f53ca2cb4d6799e1617ff5b68e93 diff --git a/patch/patch b/patch/patch index f9e893c6..47e17299 160000 --- a/patch/patch +++ b/patch/patch @@ -1 +1 @@ -Subproject commit f9e893c6c15915a4376e75c24072bd620d0661f9 +Subproject commit 47e172997e413a3b53fef9ededfe1a507f24644f From 37d9a2763cf5b3716cf44bb72ceb5fcf6b4b31a9 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:27:31 -0400 Subject: [PATCH 03/71] Note source of winflexbison --- flexbison/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/flexbison/CMakeLists.txt b/flexbison/CMakeLists.txt index 5fad9a07..870d0156 100644 --- a/flexbison/CMakeLists.txt +++ b/flexbison/CMakeLists.txt @@ -16,6 +16,7 @@ if (WIN32 AND ENABLE_FLEX) set(FLEX_DEPENDS PATCH) TargetVars(FLEX_DEPENDS) + # https://github.com/lexxmark/winflexbison ExternalProject_Add(FLEX_BLD URL "${CMAKE_CURRENT_SOURCE_DIR}/winflexbison" BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS} From 46c81075fc193e6c4b317d9ed73999d2d422831e Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:42:58 -0400 Subject: [PATCH 04/71] Update AStyle to v3.5 --- astyle/astyle | 2 +- astyle/astyle.patch | 56 +++++++++++++++++++++++++++------------------ 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/astyle/astyle b/astyle/astyle index f1c64658..c35f91f6 160000 --- a/astyle/astyle +++ b/astyle/astyle @@ -1 +1 @@ -Subproject commit f1c646584bf2a855949da6ec7255b03de4c5a00a +Subproject commit c35f91f650455dc7b9fb16c65bb8f9a94f6a1479 diff --git a/astyle/astyle.patch b/astyle/astyle.patch index 0e55702f..9bf12bd9 100644 --- a/astyle/astyle.patch +++ b/astyle/astyle.patch @@ -1,18 +1,36 @@ -diff -Naurw astyle-3.4/build/cmake/InstallOptions.cmake astyle/build/cmake/InstallOptions.cmake ---- astyle-3.4/build/cmake/InstallOptions.cmake 2023-06-16 15:43:05.000000000 -0400 -+++ astyle/build/cmake/InstallOptions.cmake 2023-08-21 19:03:48.881505278 -0400 -@@ -1,32 +1,10 @@ +diff -Naur astyle/build/cmake/InstallOptions.cmake ASTYLE_BLD/build/cmake/InstallOptions.cmake +--- astyle/build/cmake/InstallOptions.cmake 2024-06-24 11:35:23.444068225 -0400 ++++ ASTYLE_BLD/build/cmake/InstallOptions.cmake 2024-06-24 11:36:14.697228521 -0400 +@@ -1,45 +1,10 @@ -# Define install directories -# To uninstall 'xargs rm < install_manifest.txt' -# Default linux install prefix is /usr/local" -# This may be modified by -DCMAKE_INSTALL_PREFIX= -# Default Win32 install prefix is not used (C:/Program Files (x86)) ++install(TARGETS astyle ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ RUNTIME DESTINATION bin ++ ) ++install(FILES ${DOCS} DESTINATION share/doc/astyle/html) ++if (MAN) ++ INSTALL(FILES ${MAN} DESTINATION man/man1) ++endif (MAN) + +-option(INSTALL_DOC ON) +- -if(BUILD_SHARED_LIBS OR BUILD_STATIC_LIBS) - if(NOT WIN32) - install(TARGETS astyle DESTINATION lib) - endif() -else() -- if(WIN32) +- if(SKBUILD) +- install(TARGETS astyle DESTINATION "${SKBUILD_SCRIPTS_DIR}") +- if(INSTALL_DOC) +- install(FILES ${DOCS} DESTINATION "${SKBUILD_DATA_DIR}/share/doc/astyle/html") +- install(FILES ${MAN} DESTINATION "${SKBUILD_DATA_DIR}/share/man/man1") +- endif() +- elseif(WIN32) - set(pf86 "PROGRAMFILES(x86)") - set(prog_files $ENV{${pf86}}) - if(NOT ${prog_files}) @@ -23,31 +41,25 @@ diff -Naurw astyle-3.4/build/cmake/InstallOptions.cmake astyle/build/cmake/Insta - elseif(APPLE) - # install to the default /usr/local/bin because of SIP restrictions - install(TARGETS astyle DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") -- install(FILES ${DOCS} DESTINATION "${CMAKE_INSTALL_PREFIX}/share/doc/astyle/html") +- if(INSTALL_DOC) +- install(FILES ${DOCS} DESTINATION "${CMAKE_INSTALL_PREFIX}/share/doc/astyle/html") +- endif() - else() - # change default to /usr/bin, the same as package installs - if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "/usr") - endif() - install(TARGETS astyle DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") -- install(FILES ${DOCS} DESTINATION "${CMAKE_INSTALL_PREFIX}/share/doc/astyle/html") -- INSTALL(FILES ${MAN} DESTINATION "${CMAKE_INSTALL_PREFIX}/man/man1") +- if(INSTALL_DOC) +- install(FILES ${DOCS} DESTINATION "${CMAKE_INSTALL_PREFIX}/share/doc/astyle/html") +- install(FILES ${MAN} DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1") +- endif() - endif() -endif() -+install(TARGETS astyle -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib -+ RUNTIME DESTINATION bin -+ ) -+install(FILES ${DOCS} DESTINATION share/doc/astyle/html) -+if (MAN) -+ INSTALL(FILES ${MAN} DESTINATION man/man1) -+endif (MAN) -+ -diff -Naurw astyle-3.4/CMakeLists.txt astyle/CMakeLists.txt ---- astyle-3.4/CMakeLists.txt 2023-06-16 15:43:05.000000000 -0400 -+++ astyle/CMakeLists.txt 2023-08-21 19:09:03.156094017 -0400 -@@ -4,7 +4,7 @@ +diff -Naur astyle/CMakeLists.txt ASTYLE_BLD/CMakeLists.txt +--- astyle/CMakeLists.txt 2024-06-24 11:35:23.448068159 -0400 ++++ ASTYLE_BLD/CMakeLists.txt 2024-06-24 11:34:01.154415093 -0400 +@@ -8,7 +8,7 @@ include( build/cmake/Options.cmake REQUIRED ) include( build/cmake/CompilerOptions.cmake REQUIRED ) From 53cd231363959d9a112e768d8003ab8466b965c6 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:54:57 -0400 Subject: [PATCH 05/71] Update LIEF to 2b68ae5 --- lief/LIEF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lief/LIEF b/lief/LIEF index a900afb2..2b68ae53 160000 --- a/lief/LIEF +++ b/lief/LIEF @@ -1 +1 @@ -Subproject commit a900afb238c6eab98591e49702eddb562f99bff5 +Subproject commit 2b68ae538316f9ded03f9e3661d63551ab755cb0 From 7cbaac4a287ef4215ab190ec4813b95acd5469cd Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 12:16:56 -0400 Subject: [PATCH 06/71] Apply patch for uint64_t type --- lief/CMakeLists.txt | 2 +- lief/lief.patch | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 lief/lief.patch diff --git a/lief/CMakeLists.txt b/lief/CMakeLists.txt index 0b88ba3f..84910558 100644 --- a/lief/CMakeLists.txt +++ b/lief/CMakeLists.txt @@ -16,7 +16,7 @@ if (NOT MSVC AND NOT APPLE) ExternalProject_Add(LIEF_BLD URL "${CMAKE_CURRENT_SOURCE_DIR}/LIEF" BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS} - #PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/lief.patch + PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/lief.patch CMAKE_ARGS ${BUILD_TYPE_SPECIFIER} -DBIN_DIR=${BIN_DIR} diff --git a/lief/lief.patch b/lief/lief.patch new file mode 100644 index 00000000..9b1306f4 --- /dev/null +++ b/lief/lief.patch @@ -0,0 +1,11 @@ +diff -Naur lief/include/LIEF/Abstract/Header.hpp LIEF_BLD/include/LIEF/Abstract/Header.hpp +--- lief/include/LIEF/Abstract/Header.hpp 2024-06-24 12:13:56.338364944 -0400 ++++ LIEF_BLD/include/LIEF/Abstract/Header.hpp 2024-06-24 12:14:18.278008978 -0400 +@@ -16,6 +16,7 @@ + #ifndef LIEF_ABSTRACT_HEADER_H + #define LIEF_ABSTRACT_HEADER_H + ++#include + #include + #include + From fc2e3c1e079d77532a974c6b3e7095ed2cab03e4 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:16:57 -0400 Subject: [PATCH 07/71] Update plief to work with latest LIEF upstream --- plief/plief | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plief/plief b/plief/plief index f9e21cb4..ff7abbe5 160000 --- a/plief/plief +++ b/plief/plief @@ -1 +1 @@ -Subproject commit f9e21cb45359e005e776d3b4343a95af1a841610 +Subproject commit ff7abbe55676fb89baec666db9a401caf027a1d4 From 5a5e05f5f6606aa1de4df0eb67f56325740ccc18 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 19:24:59 -0400 Subject: [PATCH 08/71] Update zstd to v1.5.6 --- zstd/zstd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zstd/zstd b/zstd/zstd index 63779c79..794ea1b0 160000 --- a/zstd/zstd +++ b/zstd/zstd @@ -1 +1 @@ -Subproject commit 63779c798237346c2b245c546c40b72a5a5913fe +Subproject commit 794ea1b0afca0f020f4e57b6732332231fb23c70 From 86fb7d34a9c9014a9065af4c687bebb085790a3d Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 19:57:22 -0400 Subject: [PATCH 09/71] Update minizip-ng to version 4.0.7 --- minizip-ng/minizip-ng | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minizip-ng/minizip-ng b/minizip-ng/minizip-ng index ef3ef9a4..fe5fedc3 160000 --- a/minizip-ng/minizip-ng +++ b/minizip-ng/minizip-ng @@ -1 +1 @@ -Subproject commit ef3ef9a4b8319b94d174d8911404a8b98d319ac7 +Subproject commit fe5fedc365f7824ada0cf9a84fb79b30d5fc97a8 From 9208181d63f4ef482f3c5e7eed3c7ed2fa664c81 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 20:04:19 -0400 Subject: [PATCH 10/71] Update libdeflate to v1.20 --- deflate/libdeflate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deflate/libdeflate b/deflate/libdeflate index dd12ff2b..275aa514 160000 --- a/deflate/libdeflate +++ b/deflate/libdeflate @@ -1 +1 @@ -Subproject commit dd12ff2b36d603dbb7fa8838fe7e7176fcbd4f6f +Subproject commit 275aa5141db6eda3587214e0f1d3a134768f557d From 16f6b5bf825b85da210940ca6c045b2e958a7a3a Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 20:07:07 -0400 Subject: [PATCH 11/71] Update fmt to v10.2.1 --- fmt/fmt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fmt/fmt b/fmt/fmt index f5e54359..e69e5f97 160000 --- a/fmt/fmt +++ b/fmt/fmt @@ -1 +1 @@ -Subproject commit f5e54359df4c26b6230fc61d38aa294581393084 +Subproject commit e69e5f977d458f2650bb346dadf2ad30c5320281 From d37692aa1ef7256ab47e10b7073922f758100cc0 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 20:08:31 -0400 Subject: [PATCH 12/71] Update fmt LICENSE filename --- fmt/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fmt/CMakeLists.txt b/fmt/CMakeLists.txt index 7a72bf4e..37f63e90 100644 --- a/fmt/CMakeLists.txt +++ b/fmt/CMakeLists.txt @@ -33,7 +33,7 @@ if (ENABLE_FMT) # Copy the license into position in CMAKE_BUNDLE_INSTALL_PREFIX configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/fmt/LICENSE.rst + ${CMAKE_CURRENT_SOURCE_DIR}/fmt/LICENSE ${DOC_LICENSE_DIR}/fmt.txt COPYONLY ) From 32efb3d026846c6e1bae3254b548dfe70448db77 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 20:13:11 -0400 Subject: [PATCH 13/71] Update libexpat to v2.6.2 --- expat/libexpat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/expat/libexpat b/expat/libexpat index 654d2de0..fa75b965 160000 --- a/expat/libexpat +++ b/expat/libexpat @@ -1 +1 @@ -Subproject commit 654d2de0da85662fcc7644a7acd7c2dd2cfb21f0 +Subproject commit fa75b96546c069d17b8f80d91e0f4ef0cde3790d From 4d9afc50bb0c34fad590dfe11165d924adfe4be0 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 20:16:05 -0400 Subject: [PATCH 14/71] Update expat patch to more precisely match latest sources --- expat/expat.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/expat/expat.patch b/expat/expat.patch index ebb7a7ee..a3ad94fa 100644 --- a/expat/expat.patch +++ b/expat/expat.patch @@ -1,7 +1,7 @@ -diff -Naur expat/expat/CMakeLists.txt EXPAT_BLD/expat/CMakeLists.txt ---- expat/expat/CMakeLists.txt 2024-03-27 23:04:13.509002408 -0400 -+++ EXPAT_BLD/expat/CMakeLists.txt 2024-03-27 23:08:38.936387675 -0400 -@@ -433,7 +433,7 @@ +diff -Naur libexpat/expat/CMakeLists.txt EXPAT_BLD/expat/CMakeLists.txt +--- libexpat/expat/CMakeLists.txt 2024-06-24 20:14:05.745779978 -0400 ++++ EXPAT_BLD/expat/CMakeLists.txt 2024-06-24 20:13:21.062107763 -0400 +@@ -462,7 +462,7 @@ expat_shy_set(EXPAT_${build_type_upper}_POSTFIX "${_POSTFIX_WIDE}${_POSTFIX_DEBUG}${_POSTFIX_CRT}" CACHE STRING "Library filename postfix for build type ${build_type_upper}; yields filenames libexpat.(dll|dylib|lib|so)") mark_as_advanced(EXPAT_${build_type_upper}_POSTFIX) @@ -9,4 +9,4 @@ diff -Naur expat/expat/CMakeLists.txt EXPAT_BLD/expat/CMakeLists.txt + #set_property(TARGET expat PROPERTY ${build_type_upper}_POSTFIX ${EXPAT_${build_type_upper}_POSTFIX}) endforeach() - set(LIBCURRENT 9) # sync + set(LIBCURRENT 10) # sync From 2301c69e6de0995a5f16e4bbe3e99cfadd31ab35 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 20:24:58 -0400 Subject: [PATCH 15/71] Update ICU to v75.1 --- icu/icu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icu/icu b/icu/icu index 96128db4..8b242350 160000 --- a/icu/icu +++ b/icu/icu @@ -1 +1 @@ -Subproject commit 96128db44dc74d10b7f03f85005a967f6168078b +Subproject commit 8b2423504340d14a8ea1032b4a6d7ce4a9b2842f From e69b1fbc76b1f785c737cc662750945e113c43d0 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 20:37:42 -0400 Subject: [PATCH 16/71] Update xerces-c to v3.2.5 --- xerces-c/xerces-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xerces-c/xerces-c b/xerces-c/xerces-c index 5052c90b..53c16411 160000 --- a/xerces-c/xerces-c +++ b/xerces-c/xerces-c @@ -1 +1 @@ -Subproject commit 5052c90b067dcc347d58822b450897d16e2c31e5 +Subproject commit 53c16411466bf90c62617831fe92ed0f41e70882 From 3c561a68243e6e8c8c5a2f12931ba9e0cf62018e Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 20:49:45 -0400 Subject: [PATCH 17/71] Pull in revert of ICU use of auto in template - causing xerces-c build error --- icu/icu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icu/icu b/icu/icu index 8b242350..f60c70ad 160000 --- a/icu/icu +++ b/icu/icu @@ -1 +1 @@ -Subproject commit 8b2423504340d14a8ea1032b4a6d7ce4a9b2842f +Subproject commit f60c70ad335972045c566bf3165cdad3b8485c63 From eb5a34f4614959205b7ba07fa2f63fc0d55cc571 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 20:59:02 -0400 Subject: [PATCH 18/71] Update Boost to v1.85.0 --- boost/boost | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boost/boost b/boost/boost index acbf702d..2d59a4b1 160000 --- a/boost/boost +++ b/boost/boost @@ -1 +1 @@ -Subproject commit acbf702d12cfe9675b9d4c32a6306af5943d9d02 +Subproject commit 2d59a4b188b6f4e9f0e7bb1eb535a0dc6900d401 From 813e093e2866700a7bee9a492e5f015055323c94 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 21:14:23 -0400 Subject: [PATCH 19/71] Update netpbm to 10.86.41 (no change for BRL-CAD subset) --- netpbm/netpbm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netpbm/netpbm b/netpbm/netpbm index 0a52cc1b..3f117241 160000 --- a/netpbm/netpbm +++ b/netpbm/netpbm @@ -1 +1 @@ -Subproject commit 0a52cc1b85d1708b5527e532f98a2bdce5ae0117 +Subproject commit 3f1172417c2453de752839243e9a36fba5b16b70 From b5f00f5a90897c6fe5c7708f6c83aa76bcdf0775 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 21:16:38 -0400 Subject: [PATCH 20/71] Update libjpeg-turbo to v3.0.3 --- jpeg/libjpeg-turbo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jpeg/libjpeg-turbo b/jpeg/libjpeg-turbo index ec32420f..7fa4b5b7 160000 --- a/jpeg/libjpeg-turbo +++ b/jpeg/libjpeg-turbo @@ -1 +1 @@ -Subproject commit ec32420f6b5dfa4e86883d42b209e8371e55aeb5 +Subproject commit 7fa4b5b762c9a99b46b0b7838f5fd55071b92ea5 From 8cb0a1c56d736240230e3cbf9091042b43279cdc Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 21:23:39 -0400 Subject: [PATCH 21/71] Update openexr to v3.2.4 --- openexr/openexr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openexr/openexr b/openexr/openexr index 737b2707..a1a00ffe 160000 --- a/openexr/openexr +++ b/openexr/openexr @@ -1 +1 @@ -Subproject commit 737b2707a001e67f3812d86a639c3d037efe2ea8 +Subproject commit a1a00ffeecf627bbbc010d40700720bee48b2af7 From 7b051c101bc55e16cc1fb40aa7aa136e0ea3b3ee Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 24 Jun 2024 21:28:20 -0400 Subject: [PATCH 22/71] Update OpenColorIO to v2.3.2 --- opencolorio/OpenColorIO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencolorio/OpenColorIO b/opencolorio/OpenColorIO index 92db29b9..fa521922 160000 --- a/opencolorio/OpenColorIO +++ b/opencolorio/OpenColorIO @@ -1 +1 @@ -Subproject commit 92db29b9e7e298c4c2cc67c8a74944c2e7e716e5 +Subproject commit fa521922c96644c375e82ef76a9712229761999c From a712d631c5282c771d7fa032295623cd75e2a97f Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:14:39 -0400 Subject: [PATCH 23/71] Update OpenImageIO to v2.5.12.0 --- openimageio/oiio | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openimageio/oiio b/openimageio/oiio index d188d1e5..cfe3a2bf 160000 --- a/openimageio/oiio +++ b/openimageio/oiio @@ -1 +1 @@ -Subproject commit d188d1e53df3df6bbfec7d641546d8579fbb730d +Subproject commit cfe3a2bfaffccb79ec57912b9ab8ea1cca3f4058 From d00f5b18e113f5ae45f1b3a0e2e6be8f3ffa27dc Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:27:30 -0400 Subject: [PATCH 24/71] We don't want OpenImageIO running the generate step every time, since it repeates the full build. --- openimageio/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/openimageio/CMakeLists.txt b/openimageio/CMakeLists.txt index 615abb4b..43a2ab29 100644 --- a/openimageio/CMakeLists.txt +++ b/openimageio/CMakeLists.txt @@ -26,6 +26,7 @@ if (ENABLE_OPENIMAGEIO) -DPNG_ROOT=$<$:${CMAKE_BUNDLE_INSTALL_PREFIX}> -DTIFF_ROOT=$<$:${CMAKE_BUNDLE_INSTALL_PREFIX}> -DZLIB_ROOT=$<$:${CMAKE_BUNDLE_INSTALL_PREFIX}> + -DINTERNALIZE_FMT=OFF -DBUILD_DOCS=OFF -DOIIO_BUILD_TESTS=OFF -DOIIO_BUILD_TOOLS=ON From 18627d5a8eec68996eea601f902968ea39207762 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:30:20 -0400 Subject: [PATCH 25/71] Update lmdb to upstream ddd0a77 --- lmdb/lmdb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lmdb/lmdb b/lmdb/lmdb index 30288c72..ddd0a773 160000 --- a/lmdb/lmdb +++ b/lmdb/lmdb @@ -1 +1 @@ -Subproject commit 30288c72573ceac719627183f1058cad1dd08b74 +Subproject commit ddd0a773e2f44d38e4e31ec9ed81af81f4e4ccbb From 43842f962cfbf97e9d16612af199f1309e9a422a Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:34:48 -0400 Subject: [PATCH 26/71] Update oneTBB to v2021.12.0 --- onetbb/oneTBB | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onetbb/oneTBB b/onetbb/oneTBB index 8b829acc..9afd759b 160000 --- a/onetbb/oneTBB +++ b/onetbb/oneTBB @@ -1 +1 @@ -Subproject commit 8b829acc65569019edb896c5150d427f288e8aba +Subproject commit 9afd759b72c0c233cd5ea3c3c06b0894c9da9c54 From 0ee1183d847b46e5ba77c7e07083ac3b1ca2b550 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:37:26 -0400 Subject: [PATCH 27/71] Update rkcommon to v1.13.0 --- rkcommon/rkcommon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rkcommon/rkcommon b/rkcommon/rkcommon index f15291d4..7ebfa076 160000 --- a/rkcommon/rkcommon +++ b/rkcommon/rkcommon @@ -1 +1 @@ -Subproject commit f15291d4789a53e5980fd9b3d2639f705d675dd7 +Subproject commit 7ebfa0765ea590767202b328e7da38102c2f5a15 From 86457b6614ab1db97571958a71ec32e7c5e99da7 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:40:27 -0400 Subject: [PATCH 28/71] Update sqlite3 to v3.46.0 --- sqlite3/sqlite3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlite3/sqlite3 b/sqlite3/sqlite3 index 8987704b..e3012e5f 160000 --- a/sqlite3/sqlite3 +++ b/sqlite3/sqlite3 @@ -1 +1 @@ -Subproject commit 8987704b740727f17661fdbe1dcf456430e8b09b +Subproject commit e3012e5fa233146122a08ab41f33f7747d6c821c From c27d75f3fa04ab66389df7a8cc4f9519d24a1fe8 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:45:53 -0400 Subject: [PATCH 29/71] Update PROJ to v9.4.1 --- proj/PROJ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proj/PROJ b/proj/PROJ index 6106b167..47410920 160000 --- a/proj/PROJ +++ b/proj/PROJ @@ -1 +1 @@ -Subproject commit 6106b1670135b8376338c7dbbc265adfb269f1c4 +Subproject commit 47410920e0426d0eccbdbc27ca9dfc494f68a084 From 1baa0805d8d3827d05018c33333606283b44fe27 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:50:48 -0400 Subject: [PATCH 30/71] Update PROJ patch for new version --- proj/proj.patch | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/proj/proj.patch b/proj/proj.patch index 30bfb62f..074ece57 100644 --- a/proj/proj.patch +++ b/proj/proj.patch @@ -96,25 +96,3 @@ diff -Naur PROJ/CMakeLists.txt PROJ_BLD/CMakeLists.txt if(NOT EXE_SQLITE3) message(SEND_ERROR "sqlite3 binary not found!") endif() -diff -Naur PROJ/src/iso19111/operation/coordinateoperationfactory.cpp PROJ_BLD/src/iso19111/operation/coordinateoperationfactory.cpp ---- PROJ/src/iso19111/operation/coordinateoperationfactory.cpp 2024-03-06 12:18:36.945777084 -0500 -+++ PROJ_BLD/src/iso19111/operation/coordinateoperationfactory.cpp 2024-03-06 12:16:17.844130903 -0500 -@@ -5159,18 +5159,6 @@ - - // --------------------------------------------------------------------------- - --static std::string --getBallparkTransformationVertToVert(const crs::CRSNNPtr &sourceCRS, -- const crs::CRSNNPtr &targetCRS) { -- auto name = buildTransfName(sourceCRS->nameStr(), targetCRS->nameStr()); -- name += " ("; -- name += BALLPARK_VERTICAL_TRANSFORMATION; -- name += ')'; -- return name; --} -- --// --------------------------------------------------------------------------- -- - void CoordinateOperationFactory::Private::createOperationsVertToVert( - const crs::CRSNNPtr &sourceCRS, const crs::CRSNNPtr &targetCRS, - Private::Context &context, const crs::VerticalCRS *vertSrc, From 1f3c5b17dfd9832fc1ee15ff892b77b160496a34 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 10:04:53 -0400 Subject: [PATCH 31/71] Update GDAL to v3.9.0 --- gdal/gdal | 2 +- gdal/gdal.patch | 37 +++++++++++++++++++------------------ 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/gdal/gdal b/gdal/gdal index c1d58bf3..eca61600 160000 --- a/gdal/gdal +++ b/gdal/gdal @@ -1 +1 @@ -Subproject commit c1d58bf363dcb3126be69d05e2e9c5a72388881f +Subproject commit eca61600a5dad99ef0a2914130e1a14bda8df5be diff --git a/gdal/gdal.patch b/gdal/gdal.patch index 991f1941..59b83db5 100644 --- a/gdal/gdal.patch +++ b/gdal/gdal.patch @@ -163,16 +163,17 @@ diff -Naurw gdal-3.6.3/cmake/modules/FindPNG.cmake gdal/cmake/modules/FindPNG.cm +find_package_handle_standard_args(PNG + REQUIRED_VARS PNG_LIBRARY PNG_PNG_INCLUDE_DIR + VERSION_VAR PNG_VERSION_STRING) -diff -Naurw gdal-3.6.3/cmake/modules/packages/FindSQLite3.cmake gdal/cmake/modules/packages/FindSQLite3.cmake ---- gdal-3.6.3/cmake/modules/packages/FindSQLite3.cmake 2023-03-07 12:14:55.000000000 -0500 -+++ gdal/cmake/modules/packages/FindSQLite3.cmake 2023-08-17 15:46:10.496245830 -0400 -@@ -58,7 +58,7 @@ - NAMES sqlite3.h - HINTS ${PC_SQLITE3_INCLUDE_DIRS}) - find_library(SQLite3_LIBRARY -- NAMES sqlite3 sqlite3_i -+ NAMES sqlite3 sqlite3_i libsqlite3 libsqlite libsqlite3_i - HINTS ${PC_SQLITE3_LIBRARY_DIRS}) +diff -Naur gdal/cmake/modules/packages/FindSQLite3.cmake GDAL_BLD/cmake/modules/packages/FindSQLite3.cmake +--- gdal/cmake/modules/packages/FindSQLite3.cmake 2024-06-25 09:56:45.835498631 -0400 ++++ GDAL_BLD/cmake/modules/packages/FindSQLite3.cmake 2024-06-25 09:59:46.365399374 -0400 +@@ -57,7 +57,7 @@ + NAMES sqlite3.h + HINTS ${PC_SQLITE3_INCLUDE_DIRS}) + find_library(SQLite3_LIBRARY +- NAMES sqlite3 sqlite3_i ++ NAMES sqlite3 sqlite3_i libsqlite3 libsqlite libsqlite3_i + HINTS ${PC_SQLITE3_LIBRARY_DIRS}) + endif() # Extract version information from the header file diff -Naurw gdal-3.6.3/cmake/modules/packages/FindZLIB.cmake gdal/cmake/modules/packages/FindZLIB.cmake @@ -302,10 +303,10 @@ diff -Naurw gdal-3.6.3/cmake/modules/packages/FindZLIB.cmake gdal/cmake/modules/ + INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}") + endif() +endif() -diff -Naurw gdal-3.6.3/gdal.cmake gdal/gdal.cmake ---- gdal-3.6.3/gdal.cmake 2023-03-07 12:14:56.000000000 -0500 -+++ gdal/gdal.cmake 2023-08-17 10:20:09.926682759 -0400 -@@ -380,12 +380,6 @@ +diff -Naur gdal/gdal.cmake GDAL_BLD/gdal.cmake +--- gdal/gdal.cmake 2024-06-25 09:56:45.660500506 -0400 ++++ GDAL_BLD/gdal.cmake 2024-06-25 09:55:37.834206511 -0400 +@@ -379,12 +379,6 @@ set_property(TARGET ${GDAL_LIB_TARGET_NAME} PROPERTY PLUGIN_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/gdalplugins") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/gdalplugins") @@ -318,10 +319,10 @@ diff -Naurw gdal-3.6.3/gdal.cmake gdal/gdal.cmake if (MINGW AND BUILD_SHARED_LIBS) set_target_properties(${GDAL_LIB_TARGET_NAME} PROPERTIES SUFFIX "-${GDAL_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}") endif () -diff -Naurw gdal-3.6.3/port/cpl_port.h gdal/port/cpl_port.h ---- gdal-3.6.3/port/cpl_port.h 2023-03-07 12:14:56.000000000 -0500 -+++ gdal/port/cpl_port.h 2023-08-17 10:20:09.966682108 -0400 -@@ -1148,7 +1148,7 @@ +diff -Naur gdal/port/cpl_port.h GDAL_BLD/port/cpl_port.h +--- gdal/port/cpl_port.h 2024-06-25 09:56:45.954497348 -0400 ++++ GDAL_BLD/port/cpl_port.h 2024-06-25 09:55:37.836206491 -0400 +@@ -1123,7 +1123,7 @@ #define TRUE 1 #endif From 7073f5e21d6845cb4aee3e9b91a92d03654c9184 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 10:08:00 -0400 Subject: [PATCH 32/71] Update Asset Import Library to v5.4.1 --- assetimport/assimp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assetimport/assimp b/assetimport/assimp index df40ed49..3783459a 160000 --- a/assetimport/assimp +++ b/assetimport/assimp @@ -1 +1 @@ -Subproject commit df40ed4937e4c9a58894237b2f67a142b2c006ad +Subproject commit 3783459a97c67ec9e44fbec8c64aa83ff352dd15 From 0c4efb911f54af1664160cadd9fe477c32e43a5e Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 10:11:53 -0400 Subject: [PATCH 33/71] Update asset import patch for new version --- assetimport/assetimport.patch | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/assetimport/assetimport.patch b/assetimport/assetimport.patch index 7293d970..c2fb612f 100644 --- a/assetimport/assetimport.patch +++ b/assetimport/assetimport.patch @@ -1,6 +1,6 @@ -diff -Naur assimp/cmake-modules/FindZLIB.cmake assimp_BLD/cmake-modules/FindZLIB.cmake ---- assimp/cmake-modules/FindZLIB.cmake 2023-09-20 21:22:27.781576452 -0400 -+++ assimp_BLD/cmake-modules/FindZLIB.cmake 2023-09-23 11:22:52.826020362 -0400 +diff -Naur ASSETIMPORT/cmake-modules/FindZLIB.cmake ASSETIMPORT_BLD/cmake-modules/FindZLIB.cmake +--- ASSETIMPORT/cmake-modules/FindZLIB.cmake 2024-06-25 10:10:10.163683303 -0400 ++++ ASSETIMPORT_BLD/cmake-modules/FindZLIB.cmake 2024-06-25 10:08:14.147412121 -0400 @@ -1,48 +1,123 @@ -#------------------------------------------------------------------- -# This file is part of the CMake build system for OGRE @@ -170,9 +170,9 @@ diff -Naur assimp/cmake-modules/FindZLIB.cmake assimp_BLD/cmake-modules/FindZLIB + INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}") + endif() +endif() -diff -Naur assimp/code/AssetLib/MDL/MDLFileData.h ASSETIMPORT_BLD/code/AssetLib/MDL/MDLFileData.h ---- assimp/code/AssetLib/MDL/MDLFileData.h 2024-03-06 16:18:12.369764492 -0500 -+++ ASSETIMPORT_BLD/code/AssetLib/MDL/MDLFileData.h 2024-03-06 16:18:36.229358252 -0500 +diff -Naur ASSETIMPORT/code/AssetLib/MDL/MDLFileData.h ASSETIMPORT_BLD/code/AssetLib/MDL/MDLFileData.h +--- ASSETIMPORT/code/AssetLib/MDL/MDLFileData.h 2024-06-25 10:10:10.171683183 -0400 ++++ ASSETIMPORT_BLD/code/AssetLib/MDL/MDLFileData.h 2024-06-25 10:08:14.148412106 -0400 @@ -876,7 +876,7 @@ : apcOutBones(), iNum() @@ -182,9 +182,9 @@ diff -Naur assimp/code/AssetLib/MDL/MDLFileData.h ASSETIMPORT_BLD/code/AssetLib/ } //! Destruction: properly delete all allocated resources -diff -Naur assimp/code/CMakeLists.txt ASSETIMPORT_BLD/code/CMakeLists.txt ---- assimp/code/CMakeLists.txt 2024-03-06 16:18:12.377764357 -0500 -+++ ASSETIMPORT_BLD/code/CMakeLists.txt 2024-03-06 16:15:11.452846911 -0500 +diff -Naur ASSETIMPORT/code/CMakeLists.txt ASSETIMPORT_BLD/code/CMakeLists.txt +--- ASSETIMPORT/code/CMakeLists.txt 2024-06-25 10:10:10.175683123 -0400 ++++ ASSETIMPORT_BLD/code/CMakeLists.txt 2024-06-25 10:08:14.149412091 -0400 @@ -906,17 +906,18 @@ SOURCE_GROUP( Extra FILES ${Extra_SRCS}) @@ -215,7 +215,7 @@ diff -Naur assimp/code/CMakeLists.txt ASSETIMPORT_BLD/code/CMakeLists.txt # utf8 IF(ASSIMP_HUNTER_ENABLED) -@@ -1203,6 +1204,10 @@ +@@ -1268,6 +1269,10 @@ $ ) @@ -226,8 +226,8 @@ diff -Naur assimp/code/CMakeLists.txt ASSETIMPORT_BLD/code/CMakeLists.txt IF(ASSIMP_HUNTER_ENABLED) TARGET_LINK_LIBRARIES(assimp PUBLIC -@@ -1224,7 +1229,7 @@ - target_link_libraries(assimp PUBLIC ${draco_LIBRARIES}) +@@ -1289,7 +1294,7 @@ + target_link_libraries(assimp PRIVATE ${draco_LIBRARIES}) endif() ELSE() - TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES}) @@ -235,7 +235,7 @@ diff -Naur assimp/code/CMakeLists.txt ASSETIMPORT_BLD/code/CMakeLists.txt if (ASSIMP_BUILD_DRACO) target_link_libraries(assimp ${draco_LIBRARIES}) endif() -@@ -1242,6 +1243,7 @@ +@@ -1307,6 +1312,7 @@ TARGET_LINK_LIBRARIES(assimp ${C4D_EXTRA_LIBRARIES}) ENDIF () @@ -243,7 +243,7 @@ diff -Naur assimp/code/CMakeLists.txt ASSETIMPORT_BLD/code/CMakeLists.txt if( MSVC ) # in order to prevent DLL hell, each of the DLLs have to be suffixed with the major version and msvc prefix # CMake 3.12 added a variable for this -@@ -1288,11 +1290,12 @@ +@@ -1353,11 +1359,12 @@ target_compile_definitions(assimp PUBLIC WindowsStore) TARGET_LINK_LIBRARIES(assimp advapi32) endif() From 5901c2086e018137581ecee7c6d17bb5377285dd Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 10:17:44 -0400 Subject: [PATCH 34/71] Update OpenCV to v4.10.0 --- opencv/opencv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencv/opencv b/opencv/opencv index 3bfcf084..cc77d31c 160000 --- a/opencv/opencv +++ b/opencv/opencv @@ -1 +1 @@ -Subproject commit 3bfcf084dcb43a3a110bd9a83486dcf161d01d6e +Subproject commit cc77d31ca7d3f22d3adbdf79baba0275dae0a3f8 From 22b322d57efa4140ffebbb9749d7361556daf0ad Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 10:33:05 -0400 Subject: [PATCH 35/71] Update opencv patch for v4.10.0 --- opencv/opencv.patch | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/opencv/opencv.patch b/opencv/opencv.patch index 5682408b..bef4c0fa 100644 --- a/opencv/opencv.patch +++ b/opencv/opencv.patch @@ -346,18 +346,19 @@ diff -Naur opencv/cmake/OpenCVInstallLayout.cmake OPENCV_BLD/cmake/OpenCVInstall ocv_update(OPENCV_INSTALL_BINARIES_SUFFIX "staticlib") else() diff -Naur opencv/CMakeLists.txt OPENCV_BLD/CMakeLists.txt ---- opencv/CMakeLists.txt 2024-03-06 11:15:17.977395348 -0500 -+++ OPENCV_BLD/CMakeLists.txt 2024-03-06 11:14:00.646674429 -0500 -@@ -13,6 +13,7 @@ +--- opencv/CMakeLists.txt 2024-06-25 10:25:05.539691869 -0400 ++++ OPENCV_BLD/CMakeLists.txt 2024-06-25 10:28:39.828624534 -0400 +@@ -13,6 +13,8 @@ ") endif() +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") - ++ include(cmake/OpenCVMinDepVersions.cmake) -@@ -65,6 +66,10 @@ - cmake_policy(SET CMP0068 NEW) # CMake 3.9+: `RPATH` settings on macOS do not affect `install_name`. + if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore) +@@ -68,6 +70,10 @@ + cmake_policy(SET CMP0071 NEW) # CMake 3.10+: Let `AUTOMOC` and `AUTOUIC` process `GENERATED` files. endif() +if (POLICY CMP0074) @@ -367,7 +368,7 @@ diff -Naur opencv/CMakeLists.txt OPENCV_BLD/CMakeLists.txt if(POLICY CMP0075) cmake_policy(SET CMP0075 NEW) # CMake 3.12+: Include file check macros honor `CMAKE_REQUIRED_LIBRARIES` endif() -@@ -1110,7 +1115,7 @@ +@@ -1154,7 +1160,7 @@ if(ANDROID OR NOT UNIX) install(FILES ${OPENCV_LICENSE_FILE} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ From aa5a70078971b15fe5a93302e80e626fa471a644 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 10:36:45 -0400 Subject: [PATCH 36/71] Update OpenMesh to v11.0 --- openmesh/OpenMesh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openmesh/OpenMesh b/openmesh/OpenMesh index 20d74431..aa95c746 160000 --- a/openmesh/OpenMesh +++ b/openmesh/OpenMesh @@ -1 +1 @@ -Subproject commit 20d74431a8d908792fdb497b050dd11a83a21205 +Subproject commit aa95c746143663effdfbfba08edc8020769be0a0 From dbb444ecebaf7930563f8e147de8cf42f01d9f60 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 10:59:50 -0400 Subject: [PATCH 37/71] Update manifold to v2.5.1 --- manifold/manifold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifold/manifold b/manifold/manifold index edb4b25f..9a9f5a21 160000 --- a/manifold/manifold +++ b/manifold/manifold @@ -1 +1 @@ -Subproject commit edb4b25f647e23312d823c8bd6eb662ce9b1c9a8 +Subproject commit 9a9f5a21d9ed29547a30d9f52006e0cc4c4a50c6 From 6e75eb24ab6a40c11b736b416637be4029595b23 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 15:02:26 -0400 Subject: [PATCH 38/71] Update OpenNURBS to v8.8 --- opennurbs/opennurbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opennurbs/opennurbs b/opennurbs/opennurbs index 048ac533..6dce0c19 160000 --- a/opennurbs/opennurbs +++ b/opennurbs/opennurbs @@ -1 +1 @@ -Subproject commit 048ac53376f982867cb1156ecb8619db395e2432 +Subproject commit 6dce0c19e71812a87cc9de189ba5fdbbf7b56e28 From 5fbc05d6753be6088bae6b7f10e4f29e47d29bac Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 16:55:09 -0400 Subject: [PATCH 39/71] Update patches for latest OpenNURBS Also making a stab at trying to get our CMakeLists.txt closer to the upstream file. Still significant differences, but trying to work towards minimizing them for easier updating. --- CMake/FindOPENNURBS.cmake | 6 +- opennurbs/CMakeLists.txt | 6 +- opennurbs/opennurbs_android_uuid.patch | 15 +- opennurbs/opennurbs_brep_cpp.patch | 52 +- opennurbs/opennurbs_brep_h.patch | 36 +- opennurbs/opennurbs_cmake.patch | 1662 ++++--------------- opennurbs/opennurbs_compress.patch | 84 + opennurbs/opennurbs_defines.patch | 72 +- opennurbs/opennurbs_example_brep.patch | 28 +- opennurbs/opennurbs_example_gl.patch | 68 +- opennurbs/opennurbs_file_utilities.patch | 52 +- opennurbs/opennurbs_font.patch | 36 +- opennurbs/opennurbs_locale.patch | 108 +- opennurbs/opennurbs_lock.patch | 11 - opennurbs/opennurbs_lookup.patch | 20 - opennurbs/opennurbs_object_history.patch | 20 +- opennurbs/opennurbs_optimize.patch | 18 +- opennurbs/opennurbs_polyline.patch | 22 +- opennurbs/opennurbs_precompiledheader.patch | 132 +- opennurbs/opennurbs_statics.patch | 20 - opennurbs/opennurbs_string.patch | 64 - opennurbs/opennurbs_string_format.patch | 20 + opennurbs/opennurbs_system.patch | 20 +- opennurbs/opennurbs_system_runtime.patch | 92 +- opennurbs/opennurbs_uuid.patch | 36 +- opennurbs/opennurbs_version_number.patch | 20 +- opennurbs/opennurbs_x.patch | 14 +- opennurbs/opennurbs_zlib.patch | 270 ++- 28 files changed, 927 insertions(+), 2077 deletions(-) create mode 100644 opennurbs/opennurbs_compress.patch delete mode 100644 opennurbs/opennurbs_lock.patch delete mode 100644 opennurbs/opennurbs_lookup.patch delete mode 100644 opennurbs/opennurbs_statics.patch delete mode 100644 opennurbs/opennurbs_string.patch create mode 100644 opennurbs/opennurbs_string_format.patch diff --git a/CMake/FindOPENNURBS.cmake b/CMake/FindOPENNURBS.cmake index 1624167f..bf4dcb3c 100644 --- a/CMake/FindOPENNURBS.cmake +++ b/CMake/FindOPENNURBS.cmake @@ -47,12 +47,12 @@ set(_OPENNURBS_SEARCH_NORMAL unset(_OPENNURBS_x86) list(APPEND _OPENNURBS_SEARCHES _OPENNURBS_SEARCH_NORMAL) -set(OPENNURBS_NAMES openNURBS) +set(OPENNURBS_NAMES openNURBS OpenNURBS) # Try each search configuration. foreach(search ${_OPENNURBS_SEARCHES}) - find_path(OPENNURBS_INCLUDE_DIR NAMES opennurbs.h ${${search}} PATH_SUFFIXES include include/openNURBS openNURBS) - find_path(OPENNURBS_X_INCLUDE_DIR NAMES opennurbs_x.h ${${search}} PATH_SUFFIXES include include/openNURBS openNURBS) + find_path(OPENNURBS_INCLUDE_DIR NAMES opennurbs.h ${${search}} PATH_SUFFIXES include include/openNURBS openNURBS include/OpenNURBS OpenNURBS) + find_path(OPENNURBS_X_INCLUDE_DIR NAMES opennurbs_x.h ${${search}} PATH_SUFFIXES include include/openNURBS openNURBS include/OpenNURBS OpenNURBS) endforeach() # Allow OPENNURBS_LIBRARY to be set manually, as the location of the openNURBS library diff --git a/opennurbs/CMakeLists.txt b/opennurbs/CMakeLists.txt index 44daaa85..c4430158 100644 --- a/opennurbs/CMakeLists.txt +++ b/opennurbs/CMakeLists.txt @@ -21,20 +21,18 @@ if (ENABLE_OPENNURBS) COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_brep_cpp.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_brep_h.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_cmake.patch + COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_compress.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_defines.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_example_brep.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_example_gl.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_file_utilities.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_font.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_locale.patch - #COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_lock.patch - COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_lookup.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_object_history.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_optimize.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_polyline.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_precompiledheader.patch - #COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_statics.patch - COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_string.patch + COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_string_format.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_system.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_system_runtime.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_uuid.patch diff --git a/opennurbs/opennurbs_android_uuid.patch b/opennurbs/opennurbs_android_uuid.patch index 4d9d504f..238d67df 100644 --- a/opennurbs/opennurbs_android_uuid.patch +++ b/opennurbs/opennurbs_android_uuid.patch @@ -1,9 +1,8 @@ -diff -Naur opennurbs/android_uuid/COPYING OPENNURBS_BLD/android_uuid/COPYING ---- opennurbs/android_uuid/COPYING 2023-12-20 11:22:46.198511306 -0500 -+++ OPENNURBS_BLD/android_uuid/COPYING 2023-12-20 10:56:56.954787994 -0500 +--- opennurbs/android_uuid/COPYING 2024-06-25 15:40:38.715532582 -0400 ++++ OPENNURBS_BLD/android_uuid/COPYING 2024-06-25 15:41:49.962365115 -0400 @@ -1,3 +1,5 @@ -+Copyright (C) 1996, 1997, 1998, 1999 Theodore Ts'o. -+ - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: ++Copyright (C) 1996, 1997, 1998, 1999 Theodore Ts'o. ++ + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: diff --git a/opennurbs/opennurbs_brep_cpp.patch b/opennurbs/opennurbs_brep_cpp.patch index 944b191f..81d5ccb8 100644 --- a/opennurbs/opennurbs_brep_cpp.patch +++ b/opennurbs/opennurbs_brep_cpp.patch @@ -1,26 +1,26 @@ ---- opennurbs/opennurbs_brep.cpp 2024-02-16 13:44:43.176776155 -0500 -+++ OPENNURBS_BLD/opennurbs_brep.cpp 2024-02-16 13:49:38.419887610 -0500 -@@ -3578,6 +3578,10 @@ - } - } - -+ // BRL-CAD uses this for a tolerance check below -+ const ON_Surface *surf = loop.Face()->SurfaceOf(); -+ double urange = (surf) ? (surf->Domain(0)[1] - surf->Domain(0)[0]) : DBL_MAX; -+ double vrange = (surf) ? (surf->Domain(1)[1] - surf->Domain(1)[0]) : DBL_MAX; - - // make sure ends of trims jibe - int ci0, ci1, next_lti; -@@ -3606,6 +3610,12 @@ - // didn't get flagged as bad. - double xtol = (fabs(P0.x) + fabs(P1.x))*1.0e-10; - double ytol = (fabs(P0.y) + fabs(P1.y))*1.0e-10; -+ -+ // Oct 12 2009 Rather than using the above check, BRL-CAD uses -+ // relative uv size if it is available -+ xtol = (urange < DBL_MAX) ? urange * trim0.m_tolerance[0] : xtol; -+ ytol = (vrange < DBL_MAX) ? vrange * trim0.m_tolerance[1] : ytol; -+ - if ( xtol < ON_ZERO_TOLERANCE ) - xtol = ON_ZERO_TOLERANCE; - if ( ytol < ON_ZERO_TOLERANCE ) +--- opennurbs/opennurbs_brep.cpp 2024-06-25 15:28:09.117849296 -0400 ++++ OPENNURBS_BLD/opennurbs_brep.cpp 2024-06-25 15:26:59.805993657 -0400 +@@ -3595,6 +3595,10 @@ + } + } + ++ // BRL-CAD uses this for a tolerance check below ++ const ON_Surface *surf = loop.Face()->SurfaceOf(); ++ double urange = (surf) ? (surf->Domain(0)[1] - surf->Domain(0)[0]) : DBL_MAX; ++ double vrange = (surf) ? (surf->Domain(1)[1] - surf->Domain(1)[0]) : DBL_MAX; + + // make sure ends of trims jibe + int ci0, ci1, next_lti; +@@ -3623,6 +3627,12 @@ + // didn't get flagged as bad. + double xtol = (fabs(P0.x) + fabs(P1.x))*1.0e-10; + double ytol = (fabs(P0.y) + fabs(P1.y))*1.0e-10; ++ ++ // Oct 12 2009 Rather than using the above check, BRL-CAD uses ++ // relative uv size if it is available ++ xtol = (urange < DBL_MAX) ? urange * trim0.m_tolerance[0] : xtol; ++ ytol = (vrange < DBL_MAX) ? vrange * trim0.m_tolerance[1] : ytol; ++ + if ( xtol < ON_ZERO_TOLERANCE ) + xtol = ON_ZERO_TOLERANCE; + if ( ytol < ON_ZERO_TOLERANCE ) diff --git a/opennurbs/opennurbs_brep_h.patch b/opennurbs/opennurbs_brep_h.patch index f1f832ef..e9456d9d 100644 --- a/opennurbs/opennurbs_brep_h.patch +++ b/opennurbs/opennurbs_brep_h.patch @@ -1,18 +1,18 @@ ---- opennurbs/opennurbs_brep.h 2024-02-16 13:44:43.176776155 -0500 -+++ OPENNURBS_BLD/opennurbs_brep.h 2024-02-16 14:00:20.173055503 -0500 -@@ -4141,6 +4141,7 @@ - ); - - // helpers for validation checking -+public: - bool IsValidTrim(int trim_index,ON_TextLog* text_log) const; - bool IsValidTrimTopology(int trim_index,ON_TextLog* text_log) const; - bool IsValidTrimGeometry(int trim_index,ON_TextLog* text_log) const; -@@ -4166,6 +4167,7 @@ - bool IsValidVertexGeometry(int vertex_index,ON_TextLog* text_log) const; - bool IsValidVertexTolerancesAndFlags(int vertex_index,ON_TextLog* text_log) const; - -+protected: - void SetTolsFromLegacyValues(); - - // read helpers to support various versions +--- opennurbs/opennurbs_brep.h 2024-06-25 15:28:09.117849296 -0400 ++++ OPENNURBS_BLD/opennurbs_brep.h 2024-06-25 15:26:59.814993508 -0400 +@@ -4152,6 +4152,7 @@ + ); + + // helpers for validation checking ++public: + bool IsValidTrim(int trim_index,ON_TextLog* text_log) const; + bool IsValidTrimTopology(int trim_index,ON_TextLog* text_log) const; + bool IsValidTrimGeometry(int trim_index,ON_TextLog* text_log) const; +@@ -4177,6 +4178,7 @@ + bool IsValidVertexGeometry(int vertex_index,ON_TextLog* text_log) const; + bool IsValidVertexTolerancesAndFlags(int vertex_index,ON_TextLog* text_log) const; + ++protected: + void SetTolsFromLegacyValues(); + + // read helpers to support various versions diff --git a/opennurbs/opennurbs_cmake.patch b/opennurbs/opennurbs_cmake.patch index cb8172de..61ca51b4 100644 --- a/opennurbs/opennurbs_cmake.patch +++ b/opennurbs/opennurbs_cmake.patch @@ -1,1366 +1,326 @@ -diff -Naur opennurbs/CMake/FindZLIB.cmake openNURBS/CMake/FindZLIB.cmake ---- opennurbs/CMake/FindZLIB.cmake 1969-12-31 19:00:00.000000000 -0500 -+++ openNURBS/CMake/FindZLIB.cmake 2023-09-09 14:43:08.576725794 -0400 -@@ -0,0 +1,123 @@ -+#.rst: -+# FindZLIB -+# -------- -+# -+# Find the native ZLIB includes and library. -+# -+# IMPORTED Targets -+# ^^^^^^^^^^^^^^^^ -+# -+# This module defines :prop_tgt:`IMPORTED` target ``ZLIB::ZLIB``, if -+# ZLIB has been found. -+# -+# Result Variables -+# ^^^^^^^^^^^^^^^^ -+# -+# This module defines the following variables: -+# -+# :: -+# -+# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc. -+# ZLIB_LIBRARIES - List of libraries when using zlib. -+# ZLIB_FOUND - True if zlib found. -+# -+# :: -+# -+# ZLIB_VERSION_STRING - The version of zlib found (x.y.z) -+# ZLIB_VERSION_MAJOR - The major version of zlib -+# ZLIB_VERSION_MINOR - The minor version of zlib -+# ZLIB_VERSION_PATCH - The patch version of zlib -+# ZLIB_VERSION_TWEAK - The tweak version of zlib -+# -+# Backward Compatibility -+# ^^^^^^^^^^^^^^^^^^^^^^ -+# -+# The following variable are provided for backward compatibility -+# -+# :: -+# -+# ZLIB_MAJOR_VERSION - The major version of zlib -+# ZLIB_MINOR_VERSION - The minor version of zlib -+# ZLIB_PATCH_VERSION - The patch version of zlib -+# -+# Hints -+# ^^^^^ -+# -+# A user may set ``ZLIB_ROOT`` to a zlib installation root to tell this -+# module where to look. +--- opennurbs/CMakeLists.txt 2024-06-25 16:29:10.288832430 -0400 ++++ OPENNURBS_BLD/CMakeLists.txt 2024-06-25 16:28:29.525527195 -0400 +@@ -2,15 +2,54 @@ + #set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)") + project(opennurbs CXX) + ++# Where to look for CMake modules ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake") + -+#============================================================================= -+# Copyright 2001-2011 Kitware, Inc. -+# -+# Distributed under the OSI-approved BSD License (the "License"); -+# see accompanying file Copyright.txt for details. -+# -+# This software is distributed WITHOUT ANY WARRANTY; without even the -+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -+# See the License for more information. -+#============================================================================= -+# (To distribute this file outside of CMake, substitute the full -+# License text for the above reference.) + # specify the C++ standard ++set(CMAKE_CXX_EXTENSIONS OFF) + set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED True) + ++# Generate position independent code by default (i.e. -fPIC) ++set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) + -+set(_ZLIB_SEARCHES) ++# Define destinations if not already set ++if(NOT DEFINED BIN_DIR) ++ set(BIN_DIR bin) ++endif(NOT DEFINED BIN_DIR) ++if(NOT DEFINED LIB_DIR) ++ set(LIB_DIR lib) ++endif(NOT DEFINED LIB_DIR) + -+# Search ZLIB_ROOT first if it is set. -+if(ZLIB_ROOT) -+ set(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH) -+ list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT) -+endif() ++include(CheckFunctionExists) ++check_function_exists(uuid_generate HAVE_UUID_GENERATE) + -+# Normal search. -+set(_ZLIB_SEARCH_NORMAL -+ PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]" -+ "$ENV{PROGRAMFILES}/zlib" + if (UNIX AND NOT APPLE) + set(LINUX TRUE) + endif() + ++# these are files no longer in upstream openNURBS but retained for reference ++set(OPENNURBS_REF ++ #opennurbs_basic.cpp ++ #opennurbs_brep_changesrf.cpp ++ #opennurbs_brep_kinky.cpp ++ opennurbs_x.cpp + ) -+list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL) -+ -+set(ZLIB_NAMES z_brl z zlib zdll zlib1 zlibd zlibd1) + -+# Try each search configuration. -+foreach(search ${_ZLIB_SEARCHES}) -+ find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include) -+ find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib) -+endforeach() ++set(OPENNURBS_REF_HDRS ++ opennurbs_x.h ++ ) + -+mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR) ++# these are files we turn off because we don't use them and they incur some ++# cost to enable (e.g., they require OpenGL) ++set(OPENNURBS_OFF ++ opennurbs_gl.cpp ++ opennurbs_gl.h ++ opennurbs_zlib_memory.cpp ++ ) + -+if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h") -+ file(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$") + set( OPENNURBS_PUBLIC_HEADERS ++ ${OPENNURBS_REF_HDRS} + opennurbs.h + opennurbs_3dm.h + opennurbs_3dm_attributes.h +@@ -38,6 +77,7 @@ + opennurbs_compstat.h + opennurbs_cone.h + opennurbs_convex_poly.h ++ opennurbs_cpp_base.h + opennurbs_crc.h + opennurbs_curve.h + opennurbs_curveonsurface.h +@@ -183,6 +223,7 @@ + ) + + set( OPENNURBS_PUBLIC_SOURCES ++ ${OPENNURBS_REF} + opennurbs_3dm_attributes.cpp + opennurbs_3dm_properties.cpp + opennurbs_3dm_settings.cpp +@@ -378,6 +419,29 @@ + opennurbs_zlib_memory.cpp + ) + ++if (NOT HAVE_UUID_GENERATE AND NOT MSVC) ++ set(OPENNURBS_PUBLIC_SOURCES ${OPENNURBS_PUBLIC_SOURCES} ++ android_uuid/clear.c ++ android_uuid/compare.c ++ android_uuid/copy.c ++ android_uuid/isnull.c ++ android_uuid/pack.c ++ android_uuid/parse.c ++ android_uuid/unpack.c ++ android_uuid/unparse.c ++ ) ++ if (WIN32) ++ set(OPENNURBS_PUBLIC_SOURCES ${OPENNURBS_PUBLIC_SOURCES} ++ android_uuid/gen_uuid_nt.c ++ ) ++ else () ++ set(OPENNURBS_PUBLIC_SOURCES ${OPENNURBS_PUBLIC_SOURCES} ++ android_uuid/gen_uuid.c ++ android_uuid/uuid_time.c ++ ) ++ endif (WIN32) ++endif (NOT HAVE_UUID_GENERATE AND NOT MSVC) + -+ string(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}") -+ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}") -+ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}") -+ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}") + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_plus.h) + set( OPENNURBS_PLUS_HEADERS + opennurbsRhino.pch +@@ -406,6 +470,10 @@ + opennurbs_plus_x.h + ) + ++if (NOT HAVE_UUID_GENERATE AND NOT MSVC) ++ install(FILES android_uuid/uuid.h DESTINATION include/OpenNURBS/android_uuid) ++endif (NOT HAVE_UUID_GENERATE AND NOT MSVC) + -+ # only append a TWEAK version if it exists: -+ set(ZLIB_VERSION_TWEAK "") -+ if( "${ZLIB_H}" MATCHES "ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)") -+ set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}") -+ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}") -+ endif() + if (BUILD_TESTING) + LIST(APPEND OPENNURBS_PLUS_HEADERS opennurbs_plus_testheader.h) + endif(BUILD_TESTING) +@@ -469,12 +537,57 @@ + ) + endif() #OpenNURBS plus source files + +-if (ANDROID OR LINUX) +- add_subdirectory(android_uuid) +- add_subdirectory(freetype263) ++include(CheckIncludeFiles) ++check_include_files(emmintrin.h HAVE_EMMINTRIN_H) ++check_include_files(ieeefp.h HAVE_IEEEFP_H) ++check_include_files(sys/stat.h HAVE_SYS_STAT_H) ++if(HAVE_EMMINTRIN_H) ++ add_definitions(-DHAVE_EMMINTRIN_H) ++endif(HAVE_EMMINTRIN_H) ++if(HAVE_IEEEFP_H) ++ add_definitions(-DHAVE_IEEEFP_H) ++endif(HAVE_IEEEFP_H) ++if(HAVE_SYS_STAT_H) ++ add_definitions(-DHAVE_SYS_STAT_H) ++endif(HAVE_SYS_STAT_H) + -+ set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}") -+ set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}") -+ set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}") -+endif() ++find_package(ZLIB REQUIRED) ++set(OPENNURBS_LINKLIBRARIES ${ZLIB_LIBRARIES}) + -+# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if -+# all listed variables are TRUE -+include(FindPackageHandleStandardArgs) -+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR -+ VERSION_VAR ZLIB_VERSION_STRING) ++if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") ++ include(CheckCXXCompilerFlag) ++ check_cxx_compiler_flag(-O3 HAVE_O3) ++ if(HAVE_O3) ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") ++ endif(HAVE_O3) ++endif("${CMAKE_BUILD_TYPE}" STREQUAL "Release") + -+if(ZLIB_FOUND) -+ set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) -+ set(ZLIB_LIBRARIES ${ZLIB_LIBRARY}) ++if (MSVC) ++ # opennurbs_brep.cpp requires this flag when compiling with Visual C++ ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") ++ #add_compile_options(\bigobj) ++ add_definitions(-DUNICODE) ++ add_definitions(-D_UNICODE) ++ set(OPENNURBS_LINKLIBRARIES ${OPENNURBS_LINKLIBRARIES} Rpcrt4 Shlwapi Usp10) + endif() + +-add_subdirectory(zlib) ++add_definitions(-DON_CMAKE_BUILD) + -+ if(NOT TARGET ZLIB::ZLIB) -+ add_library(ZLIB::ZLIB UNKNOWN IMPORTED) -+ set_target_properties(ZLIB::ZLIB PROPERTIES -+ IMPORTED_LOCATION "${ZLIB_LIBRARY}" -+ INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}") -+ endif() ++if (MSVC) ++ # warning level 4 and all warnings as errors ++ add_compile_options(/W4) ++else() ++ # These need to be addressed ++ add_compile_options(-Wno-inconsistent-missing-override) ++ add_compile_options(-Wno-defaulted-function-deleted) ++ add_compile_options(-Wno-switch) ++ add_compile_options(-Wno-tautological-pointer-compare) ++ add_compile_options(-Wno-deprecated-declarations) ++ add_compile_options(-Wno-unsequenced) ++ add_compile_options(-Wno-parentheses) ++ add_compile_options(-Wno-writable-strings) ++ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch") ++endif() + + ## opennurbs static library + add_library( opennurbsStatic STATIC +@@ -495,34 +608,7 @@ + opennurbs_dll.cpp + ) + +-if (MSVC) +- # opennurbs_brep.cpp requires this flag when compiling with Visual C++ +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") +- #add_compile_options(\bigobj) +- add_definitions(-DUNICODE) +- add_definitions(-D_UNICODE) +-endif() +- +-add_definitions(-DON_CMAKE_BUILD) +- +-if (ANDROID) +- include_directories("freetype263/include") +-endif() +- + if( APPLE) +- find_library( CORE_GRAPHICS_LIBRARY CoreGraphics) +- message( STATUS "CORE_GRAPHICS_LIBRARY is ${CORE_GRAPHICS_LIBRARY}") +- find_library( CORE_TEXT_LIBRARY CoreText) +- message( STATUS "CORE_TEXT_LIBRARY is ${CORE_TEXT_LIBRARY}") +- find_library( FOUNDATION_LIBRARY Foundation) +- message( STATUS "FOUNDATION_LIBRARY is ${FOUNDATION_LIBRARY}") +- +- set( OPENNURBS_APPLE_DEPENDENCIES +- ${CORE_GRAPHICS_LIBRARY} +- ${CORE_TEXT_LIBRARY} +- ${FOUNDATION_LIBRARY} +- ) +- + set( OPENNURBS_APPLE_DEFINES + ON_COMPILER_CLANG + ON_RUNTIME_APPLE +@@ -531,98 +617,32 @@ + ) + target_compile_definitions(opennurbsStatic PRIVATE ${OPENNURBS_APPLE_DEFINES}) + target_compile_definitions(OpenNURBS PRIVATE ${OPENNURBS_APPLE_DEFINES}) +- +- # xcode properties are the same for both static and shared libs +- set_target_properties( opennurbsStatic OpenNURBS +- PROPERTIES +- XCODE_ATTRIBUTE_SDKROOT "macosx" +- XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS "macosx iphonesimulator iphoneos" +- XCODE_ATTRIBUTE_SYMROOT "build" +- XCODE_ATTRIBUTE_ALLOW_TARGET_PLATFORM_SPECIALIZATION "YES" +- XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf" +- XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET "11.3" +- XCODE_ATTRIBUTE_DYLIB_COMPATIBILITY_VERSION "1" +- XCODE_ATTRIBUTE_DYLIB_CURRENT_VERSION "1" +- XCODE_ATTRIBUTE_INFOPLIST_FILE "opennurbsRhinoInfo.plist" +- XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.mcneel.opennurbs" +- XCODE_ATTRIBUTE_HEADER_SEARCH_PATHS "$(PROJECT_DIR)/freetype263/include" +- XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION "1" +- XCODE_ATTRIBUTE_MARKETING_VERSION "8 Internal" +- XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN "YES" +- XCODE_ATTRIBUTE_GCC_NO_COMMON_BLOCKS "YES" +- XCODE_ATTRIBUTE_GCC_INPUT_FILETYPE "sourcecode.cpp.objcpp" +- XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES" +- XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "$(PROJECT_DIR)/opennurbsRhino.pch" +- XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "YES" +- XCODE_ATTRIBUTE_ENABLE_STRICT_OBJC_MSGSEND "YES" +- ) + endif() + + +-if (MSVC) +- # warning level 4 and all warnings as errors +- add_compile_options(/W4) +-else() +- # These need to be addressed +- add_compile_options(-Wno-inconsistent-missing-override) +- add_compile_options(-Wno-defaulted-function-deleted) +- add_compile_options(-Wno-switch) +- add_compile_options(-Wno-tautological-pointer-compare) +- add_compile_options(-Wno-deprecated-declarations) +- add_compile_options(-Wno-unsequenced) +- add_compile_options(-Wno-parentheses) +- add_compile_options(-Wno-writable-strings) +- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch") +-endif() +- ++target_compile_definitions(opennurbsStatic PRIVATE ON_COMPILING_OPENNURBS) ++target_compile_definitions(OpenNURBS PRIVATE OPENNURBS_EXPORTS ON_COMPILING_OPENNURBS) + +-target_compile_definitions(opennurbsStatic PRIVATE ON_COMPILING_OPENNURBS Z_PREFIX MY_ZCALLOC) +-target_compile_definitions(OpenNURBS PRIVATE OPENNURBS_EXPORTS Z_PREFIX MY_ZCALLOC) +- +-target_include_directories(opennurbsStatic PUBLIC .) +-target_include_directories(OpenNURBS PUBLIC .) ++target_include_directories(opennurbsStatic PUBLIC . ${ZLIB_INCLUDE_DIRS}) ++target_include_directories(OpenNURBS PUBLIC . ${ZLIB_INCLUDE_DIRS}) + + set(PRECOMPILED_HEADERS opennurbs.h) +-if (BUILD_TESTING) +- LIST(APPEND PRECOMPILED_HEADERS opennurbs_plus_testheader.h) +-endif(BUILD_TESTING) +- + target_precompile_headers(opennurbsStatic PRIVATE ${PRECOMPILED_HEADERS}) + target_precompile_headers(OpenNURBS PRIVATE ${PRECOMPILED_HEADERS}) + +-install( TARGETS opennurbsStatic DESTINATION "lib") +-install( FILES ${OPENNURBS_PUBLIC_HEADERS} DESTINATION "include/opennurbsStatic") ++if (OPENNURBS_LINKLIBRARIES) ++ target_link_libraries( OpenNURBS ${OPENNURBS_LINKLIBRARIES}) +endif() - - ---- opennurbs/CMakeLists.txt 2024-03-27 14:02:42.314905288 -0400 -+++ OPENNURBS_BLD/CMakeLists.txt 2024-04-13 17:17:06.861466755 -0400 -@@ -1,609 +1,637 @@ --cmake_minimum_required (VERSION 3.16) --#set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)") --project(opennurbs CXX) -+# Note: License below is for CMake build logic of openNURBS. For license of -+# primary openNURBS source code, see license.txt file -+# -+# Copyright (c) 2010-2016 United States Government as represented by the U.S. -+# Army Research Laboratory. -+# -+# Redistribution and use in source and binary forms, with or without -+# modification, are permitted provided that the following conditions are met: -+# -+# 1. Redistributions of source code must retain the above copyright notice, -+# this list of conditions and the following disclaimer. -+# -+# 2. Redistributions in binary form must reproduce the above copyright notice, -+# this list of conditions and the following disclaimer in the documentation -+# and/or other materials provided with the distribution. -+# -+# 3. The name of the author may not be used to endorse or promote products -+# derived from this software without specific prior written permission. -+# -+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ -+# Minimum required version of CMake -+cmake_minimum_required(VERSION 3.16) - --# specify the C++ standard --set(CMAKE_CXX_STANDARD 17) --set(CMAKE_CXX_STANDARD_REQUIRED True) -+project(OPENNURBS) - --if (UNIX AND NOT APPLE) -- set(LINUX TRUE) --endif() -- --set( OPENNURBS_PUBLIC_HEADERS -- opennurbs.h -- opennurbs_3dm.h -- opennurbs_3dm_attributes.h -- opennurbs_3dm_properties.h -- opennurbs_3dm_settings.h -- opennurbs_annotationbase.h -- opennurbs_apple_nsfont.h -- opennurbs_arc.h -- opennurbs_arccurve.h -- opennurbs_archivable_dictionary.h -- opennurbs_archive.h -- opennurbs_array.h -- opennurbs_array_defs.h -- opennurbs_base32.h -- opennurbs_base64.h -- opennurbs_beam.h -- opennurbs_bezier.h -- opennurbs_bitmap.h -- opennurbs_bounding_box.h -- opennurbs_box.h -- opennurbs_brep.h -- opennurbs_circle.h -- opennurbs_color.h -- opennurbs_compress.h -- opennurbs_compstat.h -- opennurbs_cone.h -- opennurbs_convex_poly.h -- opennurbs_crc.h -- opennurbs_curve.h -- opennurbs_curveonsurface.h -- opennurbs_curveproxy.h -- opennurbs_cylinder.h -- opennurbs_date.h -- opennurbs_decals.h -- opennurbs_defines.h -- opennurbs_detail.h -- opennurbs_dimension.h -- opennurbs_dimensionformat.h -- opennurbs_dimensionstyle.h -- opennurbs_dithering.h -- opennurbs_ellipse.h -- opennurbs_embedded_file.h -- opennurbs_error.h -- opennurbs_evaluate_nurbs.h -- opennurbs_extensions.h -- opennurbs_file_utilities.h -- opennurbs_font.h -- opennurbs_fpoint.h -- opennurbs_freetype.h -- opennurbs_freetype_include.h -- opennurbs_fsp.h -- opennurbs_fsp_defs.h -- opennurbs_function_list.h -- opennurbs_geometry.h -- opennurbs_gl.h -- opennurbs_ground_plane.h -- opennurbs_group.h -- opennurbs_hash_table.h -- opennurbs_hatch.h -- opennurbs_hsort_template.h -- opennurbs_instance.h -- opennurbs_internal_V2_annotation.h -- opennurbs_internal_V5_annotation.h -- opennurbs_internal_V5_dimstyle.h -- opennurbs_internal_defines.h -- opennurbs_internal_glyph.h -- opennurbs_intersect.h -- opennurbs_ipoint.h -- opennurbs_knot.h -- opennurbs_layer.h -- opennurbs_leader.h -- opennurbs_light.h -- opennurbs_line.h -- opennurbs_linear_workflow.h -- opennurbs_linecurve.h -- opennurbs_linestyle.h -- opennurbs_linetype.h -- opennurbs_locale.h -- opennurbs_lock.h -- opennurbs_lookup.h -- opennurbs_mapchan.h -- opennurbs_material.h -- opennurbs_math.h -- opennurbs_matrix.h -- opennurbs_md5.h -- opennurbs_memory.h -- opennurbs_mesh.h -- opennurbs_mesh_modifiers.h -- opennurbs_model_component.h -- opennurbs_model_geometry.h -- opennurbs_nurbscurve.h -- opennurbs_nurbssurface.h -- opennurbs_object.h -- opennurbs_object_history.h -- opennurbs_objref.h -- opennurbs_offsetsurface.h -- opennurbs_optimize.h -- opennurbs_parse.h -- opennurbs_photogrammetry.h -- opennurbs_plane.h -- opennurbs_planesurface.h -- opennurbs_pluginlist.h -- opennurbs_point.h -- opennurbs_pointcloud.h -- opennurbs_pointgeometry.h -- opennurbs_pointgrid.h -- opennurbs_polycurve.h -- opennurbs_polyedgecurve.h -- opennurbs_polyline.h -- opennurbs_polylinecurve.h -- opennurbs_post_effects.h -- opennurbs_private_wrap.h -- opennurbs_private_wrap_defs.h -- opennurbs_progress_reporter.h -- opennurbs_qsort_template.h -- opennurbs_quacksort_template.h -- opennurbs_quaternion.h -- opennurbs_rand.h -- opennurbs_render_channels.h -- opennurbs_render_content.h -- opennurbs_rendering.h -- opennurbs_revsurface.h -- opennurbs_rtree.h -- opennurbs_safe_frame.h -- opennurbs_sectionstyle.h -- opennurbs_sha1.h -- opennurbs_skylight.h -- opennurbs_sleeplock.h -- opennurbs_sphere.h -- opennurbs_std_string.h -- opennurbs_string.h -- opennurbs_string_value.h -- opennurbs_subd.h -- opennurbs_subd_data.h -- opennurbs_sumsurface.h -- opennurbs_sun.h -- opennurbs_surface.h -- opennurbs_surfaceproxy.h -- opennurbs_symmetry.h -- opennurbs_system.h -- opennurbs_system_compiler.h -- opennurbs_system_runtime.h -- #opennurbs_table.h -- opennurbs_terminator.h -- opennurbs_testclass.h -- opennurbs_text.h -- opennurbs_text_style.h -- opennurbs_textcontext.h -- opennurbs_textdraw.h -- opennurbs_textglyph.h -- opennurbs_textiterator.h -- opennurbs_textlog.h -- opennurbs_textobject.h -- opennurbs_textrun.h -- opennurbs_texture.h -- opennurbs_texture_mapping.h -- opennurbs_topology.h -- opennurbs_torus.h -- opennurbs_unicode.h -- opennurbs_userdata.h -- opennurbs_uuid.h -- opennurbs_version.h -- opennurbs_version_number.h -- opennurbs_viewport.h -- opennurbs_wip.h -- opennurbs_workspace.h -- opennurbs_xform.h -- opennurbs_xml.h -- opennurbs_zlib.h -- ) -+# Where to look for CMake modules -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake") - --set( OPENNURBS_PUBLIC_SOURCES -- opennurbs_3dm_attributes.cpp -- opennurbs_3dm_properties.cpp -- opennurbs_3dm_settings.cpp -- opennurbs_annotationbase.cpp -- opennurbs_apple_nsfont.cpp -- opennurbs_arc.cpp -- opennurbs_arccurve.cpp -- opennurbs_archivable_dictionary.cpp -- opennurbs_archive.cpp -- opennurbs_archive_manifest.cpp -- opennurbs_array.cpp -- opennurbs_base32.cpp -- opennurbs_base64.cpp -- opennurbs_beam.cpp -- opennurbs_bezier.cpp -- opennurbs_beziervolume.cpp -- opennurbs_bitmap.cpp -- opennurbs_bounding_box.cpp -- opennurbs_box.cpp -- opennurbs_brep.cpp -- opennurbs_brep_extrude.cpp -- opennurbs_brep_io.cpp -- opennurbs_brep_isvalid.cpp -- opennurbs_brep_region.cpp -- opennurbs_brep_tools.cpp -- opennurbs_brep_v2valid.cpp -- opennurbs_calculator.cpp -- opennurbs_circle.cpp -- opennurbs_color.cpp -- opennurbs_compress.cpp -- opennurbs_compstat.cpp -- opennurbs_cone.cpp -- opennurbs_convex_poly.cpp -- opennurbs_crc.cpp -- opennurbs_curve.cpp -- opennurbs_curveonsurface.cpp -- opennurbs_curveproxy.cpp -- opennurbs_cylinder.cpp -- opennurbs_date.cpp -- opennurbs_decals.cpp -- opennurbs_defines.cpp -- opennurbs_detail.cpp -- opennurbs_dimension.cpp -- opennurbs_dimensionformat.cpp -- opennurbs_dimensionstyle.cpp -- opennurbs_dithering.cpp -- opennurbs_ellipse.cpp -- opennurbs_embedded_file.cpp -- opennurbs_error.cpp -- opennurbs_error_message.cpp -- opennurbs_evaluate_nurbs.cpp -- opennurbs_extensions.cpp -- opennurbs_file_utilities.cpp -- opennurbs_font.cpp -- opennurbs_freetype.cpp -- opennurbs_fsp.cpp -- opennurbs_function_list.cpp -- opennurbs_geometry.cpp -- opennurbs_glyph_outline.cpp -- opennurbs_ground_plane.cpp -- opennurbs_group.cpp -- opennurbs_hash_table.cpp -- opennurbs_hatch.cpp -- opennurbs_instance.cpp -- opennurbs_internal_V2_annotation.cpp -- opennurbs_internal_V5_annotation.cpp -- opennurbs_internal_V5_dimstyle.cpp -- opennurbs_internal_Vx_annotation.cpp -- opennurbs_intersect.cpp -- opennurbs_ipoint.cpp -- opennurbs_knot.cpp -- opennurbs_layer.cpp -- opennurbs_leader.cpp -- opennurbs_light.cpp -- opennurbs_line.cpp -- opennurbs_linear_workflow.cpp -- opennurbs_linecurve.cpp -- opennurbs_linetype.cpp -- opennurbs_locale.cpp -- opennurbs_lock.cpp -- opennurbs_lookup.cpp -- opennurbs_material.cpp -- opennurbs_math.cpp -- opennurbs_matrix.cpp -- opennurbs_md5.cpp -- opennurbs_memory_util.cpp -- opennurbs_mesh.cpp -- opennurbs_mesh_modifiers.cpp -- opennurbs_mesh_ngon.cpp -- opennurbs_mesh_tools.cpp -- opennurbs_mesh_topology.cpp -- opennurbs_model_component.cpp -- opennurbs_model_geometry.cpp -- opennurbs_morph.cpp -- opennurbs_nurbscurve.cpp -- opennurbs_nurbssurface.cpp -- opennurbs_nurbsvolume.cpp -- opennurbs_object.cpp -- opennurbs_object_history.cpp -- opennurbs_objref.cpp -- opennurbs_offsetsurface.cpp -- opennurbs_optimize.cpp -- opennurbs_parse_angle.cpp -- opennurbs_parse_length.cpp -- opennurbs_parse_number.cpp -- opennurbs_parse_point.cpp -- opennurbs_parse_settings.cpp -- opennurbs_photogrammetry.cpp -- opennurbs_plane.cpp -- opennurbs_planesurface.cpp -- opennurbs_pluginlist.cpp -- opennurbs_point.cpp -- opennurbs_pointcloud.cpp -- opennurbs_pointgeometry.cpp -- opennurbs_pointgrid.cpp -- opennurbs_polycurve.cpp -- opennurbs_polyedgecurve.cpp -- opennurbs_polyline.cpp -- opennurbs_polylinecurve.cpp -- opennurbs_post_effects.cpp -- opennurbs_progress_reporter.cpp -- opennurbs_quaternion.cpp -- opennurbs_rand.cpp -- opennurbs_render_channels.cpp -- opennurbs_render_content.cpp -- opennurbs_revsurface.cpp -- opennurbs_rtree.cpp -- opennurbs_safe_frame.cpp -- opennurbs_sectionstyle.cpp -- opennurbs_sha1.cpp -- opennurbs_skylight.cpp -- opennurbs_sleeplock.cpp -- opennurbs_sort.cpp -- opennurbs_sphere.cpp -- opennurbs_statics.cpp -- opennurbs_std_string_format.cpp -- opennurbs_std_string_utf.cpp -- opennurbs_string.cpp -- opennurbs_string_compare.cpp -- opennurbs_string_format.cpp -- opennurbs_string_scan.cpp -- opennurbs_string_values.cpp -- opennurbs_subd.cpp -- opennurbs_subd_archive.cpp -- opennurbs_subd_copy.cpp -- opennurbs_subd_data.cpp -- opennurbs_subd_eval.cpp -- opennurbs_subd_fragment.cpp -- opennurbs_subd_frommesh.cpp -- opennurbs_subd_heap.cpp -- opennurbs_subd_iter.cpp -- opennurbs_subd_limit.cpp -- opennurbs_subd_matrix.cpp -- opennurbs_subd_mesh.cpp -- opennurbs_subd_ref.cpp -- opennurbs_subd_ring.cpp -- opennurbs_subd_sector.cpp -- opennurbs_subd_texture.cpp -- opennurbs_sum.cpp -- opennurbs_sumsurface.cpp -- opennurbs_sun.cpp -- opennurbs_surface.cpp -- opennurbs_surfaceproxy.cpp -- opennurbs_symmetry.cpp -- #opennurbs_table.cpp -- opennurbs_terminator.cpp -- opennurbs_testclass.cpp -- opennurbs_text.cpp -- opennurbs_text_style.cpp -- opennurbs_textcontext.cpp -- opennurbs_textdraw.cpp -- opennurbs_textglyph.cpp -- opennurbs_textiterator.cpp -- opennurbs_textlog.cpp -- opennurbs_textobject.cpp -- opennurbs_textrun.cpp -- opennurbs_topology.cpp -- opennurbs_torus.cpp -- opennurbs_unicode.cpp -- opennurbs_unicode_cpsb.cpp -- opennurbs_units.cpp -- opennurbs_userdata.cpp -- opennurbs_uuid.cpp -- opennurbs_version.cpp -- opennurbs_version_number.cpp -- opennurbs_viewport.cpp -- opennurbs_win_dwrite.cpp -- opennurbs_workspace.cpp -- opennurbs_wstring.cpp -- opennurbs_xform.cpp -- opennurbs_xml.cpp -- opennurbs_zlib.cpp -- opennurbs_zlib_memory.cpp -- ) -+# Latest OpenNURBS requires C++17 -+set(CMAKE_CXX_EXTENSIONS OFF) -+set(CMAKE_CXX_STANDARD 17) -+set(CMAKE_CXX_STANDARD_REQUIRED ON) - --if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/opennurbs_plus.h) --set( OPENNURBS_PLUS_HEADERS -- opennurbsRhino.pch -- opennurbs_plus.h -- opennurbs_plus_crashtest.h -- opennurbs_plus_function.h -- opennurbs_plus_hiddenline.h -- opennurbs_plus_hiddenline_impl.h -- opennurbs_plus_idimage.h -- opennurbs_plus_massprop.h -- opennurbs_plus_mesh_intersection.h -- opennurbs_plus_mesh_marker.h -- opennurbs_plus_meshbooleans_impl.h -- opennurbs_plus_particle.h -- opennurbs_plus_rectpack.h -- opennurbs_plus_rectpack2.h -- opennurbs_plus_registry.h -- opennurbs_plus_sections.h -- opennurbs_plus_sil.h -- opennurbs_plus_sleeplock.h -- opennurbs_plus_squish.h -- opennurbs_plus_subd.h -- opennurbs_plus_trimesh.h -- opennurbs_plus_validate.h -- opennurbs_plus_x.h -- ) -+# Generate position independent code by default (i.e. -fPIC) -+set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) - --set( OPENNURBS_PLUS_SOURCES -- opennurbs_plus_bezier.cpp -- opennurbs_plus_brep.cpp -- opennurbs_plus_brep_changesrf.cpp -- opennurbs_plus_brep_facegroups.cpp -- opennurbs_plus_brep_kinky.cpp -- opennurbs_plus_ctree.cpp -- opennurbs_plus_fontsub.cpp -- opennurbs_plus_fpu.cpp -- opennurbs_plus_function.cpp -- opennurbs_plus_ginfinity.cpp -- opennurbs_plus_hiddenline.cpp -- opennurbs_plus_idimage.cpp -- opennurbs_plus_massprop.cpp -- opennurbs_plus_memory.cpp -- opennurbs_plus_memory_new.cpp -- opennurbs_plus_mesh_clash.cpp -- opennurbs_plus_mesh_intersection.cpp -- opennurbs_plus_mesh_marker.cpp -- opennurbs_plus_mesh_thickness.cpp -- opennurbs_plus_meshbooleans.cpp -- opennurbs_plus_mtree.cpp -- opennurbs_plus_particle.cpp -- opennurbs_plus_rectpack.cpp -- opennurbs_plus_rectpack1.cpp -- opennurbs_plus_rectpack2.cpp -- opennurbs_plus_registry.cpp -- opennurbs_plus_sections.cpp -- opennurbs_plus_sil.cpp -- opennurbs_plus_sleeplock.cpp -- opennurbs_plus_squish.cpp -- opennurbs_plus_stree.cpp -- opennurbs_plus_subd.cpp -- opennurbs_plus_subd_curve.cpp -- opennurbs_plus_subd_eval.cpp -- opennurbs_plus_subd_facegroups.cpp -- opennurbs_plus_subd_fillet.cpp -- opennurbs_plus_subd_limit.cpp -- opennurbs_plus_subd_loft.cpp -- opennurbs_plus_subd_matrix.cpp -- opennurbs_plus_subd_merge.cpp -- opennurbs_plus_subd_mesh.cpp -- opennurbs_plus_subd_symmetry.cpp -- opennurbs_plus_subd_topology.cpp -- opennurbs_plus_subd_weld.cpp -- opennurbs_plus_trimesh.cpp -- opennurbs_plus_validate.cpp -- opennurbs_plus_x.cpp -- opennurbs_plus_xmesh.cpp -- opennurbs_plus_xmeshfast.cpp -- opennurbs_plus_xray.cpp -- ) --else() --set( OPENNURBS_PUBLIC_MEMORY -- opennurbs_public_memory.cpp -- ) --endif() #OpenNURBS plus source files -- --if (ANDROID OR LINUX) -- add_subdirectory(android_uuid) -- add_subdirectory(freetype263) --endif() -- --add_subdirectory(zlib) -- --## opennurbs static library --add_library( opennurbsStatic STATIC -- ${OPENNURBS_PUBLIC_HEADERS} -- ${OPENNURBS_PUBLIC_SOURCES} -- ${OPENNURBS_PUBLIC_MEMORY} -- ${OPENNURBS_PLUS_HEADERS} -- ${OPENNURBS_PLUS_SOURCES} -- ) -- --## opennurbs shared library --add_library( OpenNURBS SHARED -- ${OPENNURBS_PUBLIC_HEADERS} -- ${OPENNURBS_PUBLIC_SOURCES} -- ${OPENNURBS_PUBLIC_MEMORY} -- ${OPENNURBS_PLUS_HEADERS} -- ${OPENNURBS_PLUS_SOURCES} -- opennurbs_dll.cpp -+# If we can, use OBJECT libraries to build both shared and static -+# libraries from the same .o files, saving double compilation -+include(CMakeDependentOption) -+cmake_dependent_option(USE_OBJECT_LIBS "Use OBJECT libraries" ON "NOT MSVC" OFF) -+ -+set(BRLCAD_DEBUG ON) -+if(BRLCAD_DEBUG) -+ add_definitions(${DEBUG_CXX_FLAGS}) -+endif(BRLCAD_DEBUG) -+ -+# build shared libs by default -+if(NOT DEFINED BUILD_SHARED_LIBS) -+ set(BUILD_SHARED_LIBS ON) -+endif(NOT DEFINED BUILD_SHARED_LIBS) -+ -+# build static libs by default -+if(NOT DEFINED BUILD_STATIC_LIBS) -+ set(BUILD_STATIC_LIBS ON) -+endif(NOT DEFINED BUILD_STATIC_LIBS) -+ -+# Define destinations if not already set -+if(NOT DEFINED BIN_DIR) -+ set(BIN_DIR bin) -+endif(NOT DEFINED BIN_DIR) -+if(NOT DEFINED LIB_DIR) -+ set(LIB_DIR lib) -+endif(NOT DEFINED LIB_DIR) -+ -+include(CheckFunctionExists) -+check_function_exists(uuid_generate HAVE_UUID_GENERATE) -+ -+# Passed to OpenNURBS build to turn on/off any extentions/modifications to the base code -+# specific to BRLCAD. Initially used for unwrapping UV points in a closed surface to -+# allowing for trims that extend over a closed seam. -+# It's an expert's setting at the moment. -+option(BRLCAD_ENABLE_OPENNURBS_EXTENSIONS "Enables BRLCAD related extensions to OpenNURBS" ON) -+mark_as_advanced(BRLCAD_ENABLE_OPENNURBS_EXTENSIONS) -+ -+# these are files no longer in upstream openNURBS but retained for reference -+set(OPENNURBS_REF -+ #opennurbs_basic.cpp -+ #opennurbs_brep_changesrf.cpp -+ #opennurbs_brep_kinky.cpp -+ opennurbs_x.cpp -+ ) -+ -+# these are files we turn off because we don't use them and they incur some -+# cost to enable (e.g., they require OpenGL) -+set(OPENNURBS_OFF -+ opennurbs_gl.cpp -+ opennurbs_gl.h -+ opennurbs_precompiledheader.cpp -+ opennurbs_zlib_memory.cpp -+ ) -+ -+set(OPENNURBS_SOURCES -+ ${OPENNURBS_REF} -+ opennurbs_3dm_attributes.cpp -+ opennurbs_3dm_properties.cpp -+ opennurbs_3dm_settings.cpp -+ opennurbs_annotationbase.cpp -+ opennurbs_apple_nsfont.cpp -+ opennurbs_arc.cpp -+ opennurbs_arccurve.cpp -+ opennurbs_archivable_dictionary.cpp -+ opennurbs_archive.cpp -+ opennurbs_archive_manifest.cpp -+ opennurbs_array.cpp -+ opennurbs_base32.cpp -+ opennurbs_base64.cpp -+ opennurbs_beam.cpp -+ opennurbs_bezier.cpp -+ opennurbs_beziervolume.cpp -+ opennurbs_bitmap.cpp -+ opennurbs_bounding_box.cpp -+ opennurbs_box.cpp -+ opennurbs_brep.cpp -+ opennurbs_brep_extrude.cpp -+ opennurbs_brep_io.cpp -+ opennurbs_brep_isvalid.cpp -+ opennurbs_brep_region.cpp -+ opennurbs_brep_tools.cpp -+ opennurbs_brep_v2valid.cpp -+ opennurbs_calculator.cpp -+ opennurbs_circle.cpp -+ opennurbs_color.cpp -+ opennurbs_compress.cpp -+ opennurbs_compstat.cpp -+ opennurbs_cone.cpp -+ opennurbs_convex_poly.cpp -+ opennurbs_crc.cpp -+ opennurbs_curve.cpp -+ opennurbs_curveonsurface.cpp -+ opennurbs_curveproxy.cpp -+ opennurbs_cylinder.cpp -+ opennurbs_date.cpp -+ opennurbs_decals.cpp -+ opennurbs_defines.cpp -+ opennurbs_detail.cpp -+ opennurbs_dimension.cpp -+ opennurbs_dimensionformat.cpp -+ opennurbs_dimensionstyle.cpp -+ opennurbs_dithering.cpp -+ opennurbs_dll.cpp -+ opennurbs_ellipse.cpp -+ opennurbs_embedded_file.cpp -+ opennurbs_error.cpp -+ opennurbs_error_message.cpp -+ opennurbs_evaluate_nurbs.cpp -+ opennurbs_extensions.cpp -+ opennurbs_file_utilities.cpp -+ opennurbs_font.cpp -+ opennurbs_freetype.cpp -+ opennurbs_fsp.cpp -+ opennurbs_function_list.cpp -+ opennurbs_geometry.cpp -+ opennurbs_glyph_outline.cpp -+ opennurbs_ground_plane.cpp -+ opennurbs_group.cpp -+ opennurbs_hash_table.cpp -+ opennurbs_hatch.cpp -+ opennurbs_instance.cpp -+ opennurbs_internal_V2_annotation.cpp -+ opennurbs_internal_V5_annotation.cpp -+ opennurbs_internal_V5_dimstyle.cpp -+ opennurbs_internal_Vx_annotation.cpp -+ opennurbs_intersect.cpp -+ opennurbs_ipoint.cpp -+ opennurbs_knot.cpp -+ opennurbs_layer.cpp -+ opennurbs_leader.cpp -+ opennurbs_light.cpp -+ opennurbs_linear_workflow.cpp -+ opennurbs_line.cpp -+ opennurbs_linecurve.cpp -+ opennurbs_linetype.cpp -+ opennurbs_locale.cpp -+ opennurbs_lock.cpp -+ opennurbs_lookup.cpp -+ opennurbs_material.cpp -+ opennurbs_math.cpp -+ opennurbs_matrix.cpp -+ opennurbs_md5.cpp -+ opennurbs_memory_util.cpp -+ opennurbs_mesh.cpp -+ opennurbs_mesh_modifiers.cpp -+ opennurbs_mesh_ngon.cpp -+ opennurbs_mesh_tools.cpp -+ opennurbs_mesh_topology.cpp -+ opennurbs_model_component.cpp -+ opennurbs_model_geometry.cpp -+ opennurbs_morph.cpp -+ opennurbs_nurbscurve.cpp -+ opennurbs_nurbssurface.cpp -+ opennurbs_nurbsvolume.cpp -+ opennurbs_object.cpp -+ opennurbs_object_history.cpp -+ opennurbs_objref.cpp -+ opennurbs_offsetsurface.cpp -+ opennurbs_optimize.cpp -+ opennurbs_parse_angle.cpp -+ opennurbs_parse_length.cpp -+ opennurbs_parse_number.cpp -+ opennurbs_parse_point.cpp -+ opennurbs_parse_settings.cpp -+ opennurbs_photogrammetry.cpp -+ opennurbs_plane.cpp -+ opennurbs_planesurface.cpp -+ opennurbs_pluginlist.cpp -+ opennurbs_pointcloud.cpp -+ opennurbs_point.cpp -+ opennurbs_pointgeometry.cpp -+ opennurbs_pointgrid.cpp -+ opennurbs_polycurve.cpp -+ opennurbs_polyedgecurve.cpp -+ opennurbs_polyline.cpp -+ opennurbs_polylinecurve.cpp -+ opennurbs_post_effects.cpp -+ opennurbs_progress_reporter.cpp -+ opennurbs_public_memory.cpp -+ opennurbs_quaternion.cpp -+ opennurbs_rand.cpp -+ opennurbs_render_channels.cpp -+ opennurbs_render_content.cpp -+ opennurbs_revsurface.cpp -+ opennurbs_rtree.cpp -+ opennurbs_safe_frame.cpp -+ opennurbs_sectionstyle.cpp -+ opennurbs_sha1.cpp -+ opennurbs_skylight.cpp -+ opennurbs_sleeplock.cpp -+ opennurbs_sort.cpp -+ opennurbs_sphere.cpp -+ opennurbs_statics.cpp -+ opennurbs_std_string_format.cpp -+ opennurbs_std_string_utf.cpp -+ opennurbs_string_compare.cpp -+ opennurbs_string.cpp -+ opennurbs_string_format.cpp -+ opennurbs_string_scan.cpp -+ opennurbs_string_values.cpp -+ opennurbs_subd_archive.cpp -+ opennurbs_subd_copy.cpp -+ opennurbs_subd.cpp -+ opennurbs_subd_data.cpp -+ opennurbs_subd_eval.cpp -+ opennurbs_subd_fragment.cpp -+ opennurbs_subd_frommesh.cpp -+ opennurbs_subd_heap.cpp -+ opennurbs_subd_iter.cpp -+ opennurbs_subd_limit.cpp -+ opennurbs_subd_matrix.cpp -+ opennurbs_subd_mesh.cpp -+ opennurbs_subd_ref.cpp -+ opennurbs_subd_ring.cpp -+ opennurbs_subd_sector.cpp -+ opennurbs_subd_texture.cpp -+ opennurbs_sum.cpp -+ opennurbs_sumsurface.cpp -+ opennurbs_sun.cpp -+ opennurbs_surface.cpp -+ opennurbs_surfaceproxy.cpp -+ opennurbs_symmetry.cpp -+ opennurbs_terminator.cpp -+ opennurbs_testclass.cpp -+ opennurbs_textcontext.cpp -+ opennurbs_text.cpp -+ opennurbs_textdraw.cpp -+ opennurbs_textglyph.cpp -+ opennurbs_textiterator.cpp -+ opennurbs_textlog.cpp -+ opennurbs_textobject.cpp -+ opennurbs_textrun.cpp -+ opennurbs_text_style.cpp -+ opennurbs_topology.cpp -+ opennurbs_torus.cpp -+ #opennurbs_unicode_cp932.cpp -+ #opennurbs_unicode_cp949.cpp -+ opennurbs_unicode.cpp -+ opennurbs_unicode_cpsb.cpp -+ opennurbs_units.cpp -+ opennurbs_userdata.cpp -+ opennurbs_userdata_obsolete.cpp -+ opennurbs_uuid.cpp -+ opennurbs_version.cpp -+ opennurbs_version_number.cpp -+ opennurbs_viewport.cpp -+ opennurbs_win_dwrite.cpp -+ opennurbs_workspace.cpp -+ opennurbs_wstring.cpp -+ opennurbs_xform.cpp -+ opennurbs_xml.cpp -+ opennurbs_zlib.cpp -+ ) -+ -+if (NOT HAVE_UUID_GENERATE AND NOT MSVC) -+ set(OPENNURBS_SOURCES ${OPENNURBS_SOURCES} -+ android_uuid/clear.c -+ android_uuid/compare.c -+ android_uuid/copy.c -+ android_uuid/isnull.c -+ android_uuid/pack.c -+ android_uuid/parse.c -+ android_uuid/unpack.c -+ android_uuid/unparse.c - ) -+ if (WIN32) -+ set(OPENNURBS_SOURCES ${OPENNURBS_SOURCES} -+ android_uuid/gen_uuid_nt.c -+ ) -+ else () -+ set(OPENNURBS_SOURCES ${OPENNURBS_SOURCES} -+ android_uuid/gen_uuid.c -+ android_uuid/uuid_time.c -+ ) -+ endif (WIN32) -+endif (NOT HAVE_UUID_GENERATE AND NOT MSVC) -+ -+set(OPENNURBS_HEADERS -+ opennurbs_3dm_attributes.h -+ opennurbs_3dm.h -+ opennurbs_3dm_properties.h -+ opennurbs_3dm_settings.h -+ opennurbs_annotationbase.h -+ opennurbs_apple_nsfont.h -+ opennurbs_arccurve.h -+ opennurbs_arc.h -+ opennurbs_archivable_dictionary.h -+ opennurbs_archive.h -+ opennurbs_array_defs.h -+ opennurbs_array.h -+ opennurbs_base32.h -+ opennurbs_base64.h -+ opennurbs_beam.h -+ opennurbs_bezier.h -+ opennurbs_bitmap.h -+ opennurbs_bounding_box.h -+ opennurbs_box.h -+ opennurbs_brep.h -+ opennurbs_circle.h -+ opennurbs_color.h -+ opennurbs_compress.h -+ opennurbs_compstat.h -+ opennurbs_cone.h -+ opennurbs_convex_poly.h -+ opennurbs_cpp_base.h -+ opennurbs_crc.h -+ opennurbs_curve.h -+ opennurbs_curveonsurface.h -+ opennurbs_curveproxy.h -+ opennurbs_cylinder.h -+ opennurbs_date.h -+ opennurbs_decals.h -+ opennurbs_defines.h -+ opennurbs_detail.h -+ opennurbs_dimensionformat.h -+ opennurbs_dimension.h -+ opennurbs_dimensionstyle.h -+ opennurbs_dithering.h -+ opennurbs_dll_resource.h -+ opennurbs_ellipse.h -+ opennurbs_embedded_file.h -+ opennurbs_error.h -+ opennurbs_evaluate_nurbs.h -+ opennurbs_extensions.h -+ opennurbs_file_utilities.h -+ opennurbs_font.h -+ opennurbs_fpoint.h -+ opennurbs_freetype.h -+ opennurbs_freetype_include.h -+ opennurbs_fsp_defs.h -+ opennurbs_fsp.h -+ opennurbs_function_list.h -+ opennurbs_geometry.h -+ opennurbs_gl.h -+ opennurbs_ground_plane.h -+ opennurbs_group.h -+ opennurbs.h -+ opennurbs_hash_table.h -+ opennurbs_hatch.h -+ opennurbs_hsort_template.h -+ opennurbs_input_libsdir.h -+ opennurbs_instance.h -+ opennurbs_internal_defines.h -+ opennurbs_internal_glyph.h -+ opennurbs_internal_unicode_cp.h -+ opennurbs_internal_V2_annotation.h -+ opennurbs_internal_V5_annotation.h -+ opennurbs_internal_V5_dimstyle.h -+ opennurbs_intersect.h -+ opennurbs_ipoint.h -+ opennurbs_knot.h -+ opennurbs_layer.h -+ opennurbs_leader.h -+ opennurbs_light.h -+ opennurbs_linear_workflow.h -+ opennurbs_linecurve.h -+ opennurbs_line.h -+ opennurbs_linestyle.h -+ opennurbs_linetype.h -+ opennurbs_locale.h -+ opennurbs_lock.h -+ opennurbs_lookup.h -+ opennurbs_mapchan.h -+ opennurbs_material.h -+ opennurbs_math.h -+ opennurbs_matrix.h -+ opennurbs_md5.h -+ opennurbs_memory.h -+ opennurbs_mesh.h -+ opennurbs_mesh_modifiers.h -+ opennurbs_model_component.h -+ opennurbs_model_geometry.h -+ opennurbs_nurbscurve.h -+ opennurbs_nurbssurface.h -+ opennurbs_object.h -+ opennurbs_object_history.h -+ opennurbs_objref.h -+ opennurbs_offsetsurface.h -+ opennurbs_optimize.h -+ opennurbs_parse.h -+ opennurbs_photogrammetry.h -+ opennurbs_plane.h -+ opennurbs_planesurface.h -+ opennurbs_pluginlist.h -+ opennurbs_pointcloud.h -+ opennurbs_pointgeometry.h -+ opennurbs_pointgrid.h -+ opennurbs_point.h -+ opennurbs_polycurve.h -+ opennurbs_polyedgecurve.h -+ opennurbs_polylinecurve.h -+ opennurbs_polyline.h -+ opennurbs_post_effects.h -+ opennurbs_private_wrap_defs.h -+ opennurbs_private_wrap.h -+ opennurbs_progress_reporter.h -+ opennurbs_public_examples.h -+ opennurbs_public.h -+ opennurbs_public_version.h -+ opennurbs_qsort_template.h -+ opennurbs_quacksort_template.h -+ opennurbs_quaternion.h -+ opennurbs_rand.h -+ opennurbs_render_channels.h -+ opennurbs_render_content.h -+ opennurbs_rendering.h -+ opennurbs_revsurface.h -+ opennurbs_rtree.h -+ opennurbs_safe_frame.h -+ opennurbs_sectionstyle.h -+ opennurbs_sha1.h -+ opennurbs_skylight.h -+ opennurbs_sleeplock.h -+ opennurbs_sphere.h -+ opennurbs_std_string.h -+ opennurbs_string.h -+ opennurbs_string_value.h -+ opennurbs_subd_data.h -+ opennurbs_subd.h -+ opennurbs_sumsurface.h -+ opennurbs_sun.h -+ opennurbs_surface.h -+ opennurbs_surfaceproxy.h -+ opennurbs_symmetry.h -+ opennurbs_system_compiler.h -+ opennurbs_system.h -+ opennurbs_system_runtime.h -+ opennurbs_terminator.h -+ opennurbs_testclass.h -+ opennurbs_textcontext.h -+ opennurbs_textdraw.h -+ opennurbs_textglyph.h -+ opennurbs_text.h -+ opennurbs_textiterator.h -+ opennurbs_textlog.h -+ opennurbs_textobject.h -+ opennurbs_textrun.h -+ opennurbs_text_style.h -+ opennurbs_texture.h -+ opennurbs_texture_mapping.h -+ opennurbs_topology.h -+ opennurbs_torus.h -+ opennurbs_unicode.h -+ opennurbs_userdata.h -+ opennurbs_uuid.h -+ opennurbs_version.h -+ opennurbs_version_number.h -+ opennurbs_viewport.h -+ opennurbs_windows_targetver.h -+ opennurbs_win_dwrite.h -+ opennurbs_wip.h -+ opennurbs_workspace.h -+ opennurbs_x.h -+ opennurbs_xform.h -+ opennurbs_xml.h -+ opennurbs_zlib.h -+ ) -+ -+if (NOT HAVE_UUID_GENERATE AND NOT MSVC) -+ install(FILES android_uuid/uuid.h DESTINATION include/openNURBS/android_uuid) -+endif (NOT HAVE_UUID_GENERATE AND NOT MSVC) -+ -+include(CheckIncludeFiles) -+check_include_files(emmintrin.h HAVE_EMMINTRIN_H) -+check_include_files(ieeefp.h HAVE_IEEEFP_H) -+check_include_files(sys/stat.h HAVE_SYS_STAT_H) -+if(HAVE_EMMINTRIN_H) -+ add_definitions(-DHAVE_EMMINTRIN_H) -+endif(HAVE_EMMINTRIN_H) -+if(HAVE_IEEEFP_H) -+ add_definitions(-DHAVE_IEEEFP_H) -+endif(HAVE_IEEEFP_H) -+if(HAVE_SYS_STAT_H) -+ add_definitions(-DHAVE_SYS_STAT_H) -+endif(HAVE_SYS_STAT_H) -+ -+if(BRLCAD_ENABLE_OPENNURBS_EXTENSIONS) -+ add_definitions(-DBRLCAD_FEATURE_EXTEND_UV_OVER_CLOSED_SEAMS) -+endif(BRLCAD_ENABLE_OPENNURBS_EXTENSIONS) -+ -+find_package(ZLIB REQUIRED) -+ -+set(OPENNURBS_LINKLIBRARIES ${ZLIB_LIBRARIES}) -+ -+# Ideally, we should only need ZLIB here -+include_directories( -+ ${${CMAKE_PROJECT_NAME}_SOURCE_DIR}/include -+ ${ZLIB_INCLUDE_DIRS} -+ ) - -+add_definitions(-DON_COMPILING_OPENNURBS) -+add_definitions(-DON_CMAKE_BUILD) - if (MSVC) -- # opennurbs_brep.cpp requires this flag when compiling with Visual C++ -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") -- #add_compile_options(\bigobj) - add_definitions(-DUNICODE) - add_definitions(-D_UNICODE) --endif() -- --add_definitions(-DON_CMAKE_BUILD) -- --if( APPLE) -- find_library( CORE_GRAPHICS_LIBRARY CoreGraphics) -- message( STATUS "CORE_GRAPHICS_LIBRARY is ${CORE_GRAPHICS_LIBRARY}") -- find_library( CORE_TEXT_LIBRARY CoreText) -- message( STATUS "CORE_TEXT_LIBRARY is ${CORE_TEXT_LIBRARY}") -- find_library( FOUNDATION_LIBRARY Foundation) -- message( STATUS "FOUNDATION_LIBRARY is ${FOUNDATION_LIBRARY}") -- -- set( OPENNURBS_APPLE_DEPENDENCIES -- ${CORE_GRAPHICS_LIBRARY} -- ${CORE_TEXT_LIBRARY} -- ${FOUNDATION_LIBRARY} -- ) -- -- set( OPENNURBS_APPLE_DEFINES -- ON_COMPILER_CLANG -- ON_RUNTIME_APPLE -- RHINO_APPLE=1 -- _GNU_SOURCE -- ) -- target_compile_definitions(opennurbsStatic PRIVATE ${OPENNURBS_APPLE_DEFINES}) -- target_compile_definitions(OpenNURBS PRIVATE ${OPENNURBS_APPLE_DEFINES}) -- -- # xcode properties are the same for both static and shared libs -- set_target_properties( opennurbsStatic OpenNURBS -- PROPERTIES -- XCODE_ATTRIBUTE_SDKROOT "macosx" -- XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS "macosx iphonesimulator iphoneos" -- XCODE_ATTRIBUTE_SYMROOT "build" -- XCODE_ATTRIBUTE_ALLOW_TARGET_PLATFORM_SPECIALIZATION "YES" -- XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf" -- XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET "11.3" -- XCODE_ATTRIBUTE_DYLIB_COMPATIBILITY_VERSION "1" -- XCODE_ATTRIBUTE_DYLIB_CURRENT_VERSION "1" -- XCODE_ATTRIBUTE_INFOPLIST_FILE "opennurbsRhinoInfo.plist" -- XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.mcneel.opennurbs" -- XCODE_ATTRIBUTE_HEADER_SEARCH_PATHS "$(PROJECT_DIR)/freetype263/include" -- XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION "1" -- XCODE_ATTRIBUTE_MARKETING_VERSION "8 Internal" -- XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN "YES" -- XCODE_ATTRIBUTE_GCC_NO_COMMON_BLOCKS "YES" -- XCODE_ATTRIBUTE_GCC_INPUT_FILETYPE "sourcecode.cpp.objcpp" -- XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES" -- XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "$(PROJECT_DIR)/opennurbsRhino.pch" -- XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "YES" -- XCODE_ATTRIBUTE_ENABLE_STRICT_OBJC_MSGSEND "YES" -- ) --endif() -- -- --if (MSVC) -- # warning level 4 and all warnings as errors -- add_compile_options(/W4) --else() -- # These need to be addressed -- add_compile_options(-Wno-inconsistent-missing-override) -- add_compile_options(-Wno-defaulted-function-deleted) -- add_compile_options(-Wno-switch) -- add_compile_options(-Wno-tautological-pointer-compare) -- add_compile_options(-Wno-deprecated-declarations) -- add_compile_options(-Wno-unsequenced) -- add_compile_options(-Wno-parentheses) -- add_compile_options(-Wno-writable-strings) -- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch") --endif() -- -- --target_compile_definitions(opennurbsStatic PRIVATE ON_COMPILING_OPENNURBS Z_PREFIX MY_ZCALLOC) --target_compile_definitions(OpenNURBS PRIVATE OPENNURBS_EXPORTS Z_PREFIX MY_ZCALLOC) -- --target_include_directories(opennurbsStatic PUBLIC .) --target_include_directories(OpenNURBS PUBLIC .) -- --target_precompile_headers(opennurbsStatic PRIVATE opennurbs.h) --target_precompile_headers(OpenNURBS PRIVATE opennurbs.h) -- --install( TARGETS opennurbsStatic DESTINATION "lib") --install( FILES ${OPENNURBS_PUBLIC_HEADERS} DESTINATION "include/opennurbsStatic") -- -- --if (ANDROID OR LINUX) --target_link_libraries( OpenNURBS zlib opennurbs_public_freetype android_uuid) --target_link_libraries( opennurbsStatic zlib opennurbs_public_freetype android_uuid) --endif() -+ set(OPENNURBS_LINKLIBRARIES ${OPENNURBS_LINKLIBRARIES} Rpcrt4 Shlwapi Usp10) -+ # opennurbs_brep.cpp requires this flag when compiling with Visual C++ -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") -+endif(MSVC) - if (APPLE) --target_link_libraries( OpenNURBS ${OPENNURBS_APPLE_DEPENDENCIES} zlib) --target_link_libraries( opennurbsStatic ${OPENNURBS_APPLE_DEPENDENCIES} zlib) --endif() --if (WIN32) --target_link_libraries( OpenNURBS Shlwapi Usp10 zlib) --target_link_libraries( opennurbsStatic Shlwapi Usp10 zlib) --endif() -+ add_definitions(-DON_COMPILER_CLANG) -+ add_definitions(-D_GNU_SOURCE) -+endif (APPLE) -+ -+if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") -+ include(CheckCXXCompilerFlag) -+ check_cxx_compiler_flag(-O3 HAVE_O3) -+ if(HAVE_O3) -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") -+ endif(HAVE_O3) -+endif("${CMAKE_BUILD_TYPE}" STREQUAL "Release") -+ -+# Based on the options, define libraries as either stand-alone builds -+# or dependencies on OBJECT library builds -+if(NOT USE_OBJECT_LIBS) -+ -+ if(BUILD_SHARED_LIBS) -+ add_library(openNURBS SHARED ${OPENNURBS_SOURCES}) -+ if(MSVC) -+ set_property(TARGET openNURBS APPEND PROPERTY COMPILE_DEFINITIONS "OPENNURBS_EXPORTS") -+ endif(MSVC) -+ endif(BUILD_SHARED_LIBS) -+ -+ if(BUILD_STATIC_LIBS) -+ add_library(openNURBS-static STATIC ${OPENNURBS_SOURCES}) -+ if(TARGET zlib_stage) -+ add_dependencies(openNURBS-static zlib_stage) -+ endif(TARGET zlib_stage) -+ endif(BUILD_STATIC_LIBS) -+ -+else(NOT USE_OBJECT_LIBS) -+ -+ add_library(openNURBS-obj OBJECT ${OPENNURBS_SOURCES}) -+ -+ # For build ordering, if we are linking to another build target make sure -+ # the object build depends on that target -+ foreach(DEP ${OPENNURBS_LINKLIBRARIES}) -+ if(TARGET ${DEP}) -+ add_dependencies(openNURBS-obj ${DEP}) -+ endif(TARGET ${DEP}) -+ endforeach(DEP ${OPENNURBS_LINKLIBRARIES}) -+ -+ if(BUILD_SHARED_LIBS) -+ add_library(openNURBS SHARED $) -+ if(MSVC) -+ set_property(TARGET openNURBS APPEND PROPERTY COMPILE_DEFINITIONS "OPENNURBS_EXPORTS") -+ endif(MSVC) -+ endif(BUILD_SHARED_LIBS) -+ if(BUILD_STATIC_LIBS) -+ add_library(openNURBS-static STATIC $) -+ if(TARGET zlib_stage) -+ add_dependencies(openNURBS-static zlib_stage) -+ endif(TARGET zlib_stage) -+ endif(BUILD_STATIC_LIBS) -+endif(NOT USE_OBJECT_LIBS) -+ -+ -+if(BUILD_SHARED_LIBS) -+ if(OPENNURBS_LINKLIBRARIES) -+ target_link_libraries(openNURBS ${OPENNURBS_LINKLIBRARIES}) -+ endif(OPENNURBS_LINKLIBRARIES) -+ set_target_properties(openNURBS PROPERTIES VERSION "2023.12.13") -+ install(TARGETS openNURBS -+ RUNTIME DESTINATION ${BIN_DIR} -+ LIBRARY DESTINATION ${LIB_DIR} -+ ARCHIVE DESTINATION ${LIB_DIR}) -+endif(BUILD_SHARED_LIBS) -+ -+if(BUILD_STATIC_LIBS) -+ if(MSVC) -+ # msvc does not append 'lib' - do it here to have consistent name -+ set_target_properties(openNURBS-static PROPERTIES PREFIX "lib") -+ else(MSVC) -+ set_target_properties(openNURBS-static PROPERTIES OUTPUT_NAME "openNURBS") -+ endif(MSVC) -+ install(TARGETS openNURBS-static -+ RUNTIME DESTINATION ${BIN_DIR} -+ LIBRARY DESTINATION ${LIB_DIR} -+ ARCHIVE DESTINATION ${LIB_DIR}) -+endif(BUILD_STATIC_LIBS) -+ -+install(FILES ${OPENNURBS_HEADERS} DESTINATION include/openNURBS) -+ -+# Local Variables: -+# tab-width: 8 -+# mode: cmake -+# indent-tabs-mode: t -+# End: -+# ex: shiftwidth=2 tabstop=8 - --if (APPLE) -- set_target_properties( OpenNURBS PROPERTIES --FRAMEWORK TRUE --FRAMEWORK_VERSION A --# MACOSX_FRAMEWORK_IDENTIFIER "com.mcneel.OpenNURBS" --# VERSION "8.0.0" --# SOVERSION "8.0.0" --PUBLIC_HEADER "${OPENNURBS_PUBLIC_HEADERS}" --) -- -- install( TARGETS OpenNURBS DESTINATION "Frameworks") --else() -- install( TARGETS OpenNURBS DESTINATION "lib" ) -- install( FILES ${OPENNURBS_PUBLIC_HEADERS} DESTINATION "include/OpenNURBS") --endif() + ++install(TARGETS OpenNURBS ++ RUNTIME DESTINATION ${BIN_DIR} ++ LIBRARY DESTINATION ${LIB_DIR} ++ ARCHIVE DESTINATION ${LIB_DIR}) + +-if (ANDROID) +-target_link_libraries( OpenNURBS zlib opennurbs_public_freetype android_uuid android) +-target_link_libraries( opennurbsStatic zlib opennurbs_public_freetype android_uuid android) +-endif() +-if (LINUX AND NOT ANDROID) +-target_link_libraries( OpenNURBS zlib opennurbs_public_freetype android_uuid) +-target_link_libraries( opennurbsStatic zlib opennurbs_public_freetype android_uuid) +-endif() +-if (APPLE) +-target_link_libraries( OpenNURBS ${OPENNURBS_APPLE_DEPENDENCIES} zlib) +-target_link_libraries( opennurbsStatic ${OPENNURBS_APPLE_DEPENDENCIES} zlib) +-endif() +-if (WIN32) +-target_link_libraries( OpenNURBS Shlwapi Usp10 zlib) +-target_link_libraries( opennurbsStatic Shlwapi Usp10 zlib) +-endif() ++install(TARGETS opennurbsStatic ++ RUNTIME DESTINATION ${BIN_DIR} ++ LIBRARY DESTINATION ${LIB_DIR} ++ ARCHIVE DESTINATION ${LIB_DIR}) + +-if (APPLE) +- set_target_properties( OpenNURBS PROPERTIES +-FRAMEWORK TRUE +-FRAMEWORK_VERSION A +-# MACOSX_FRAMEWORK_IDENTIFIER "com.mcneel.OpenNURBS" +-# VERSION "8.0.0" +-# SOVERSION "8.0.0" +-PUBLIC_HEADER "${OPENNURBS_PUBLIC_HEADERS}" +-) ++install( FILES ${OPENNURBS_PUBLIC_HEADERS} DESTINATION "include/OpenNURBS") + +- install( TARGETS OpenNURBS DESTINATION "Frameworks") +-else() +- install( TARGETS OpenNURBS DESTINATION "lib" ) +- install( FILES ${OPENNURBS_PUBLIC_HEADERS} DESTINATION "include/OpenNURBS") +-endif() diff --git a/opennurbs/opennurbs_compress.patch b/opennurbs/opennurbs_compress.patch new file mode 100644 index 00000000..337b30c6 --- /dev/null +++ b/opennurbs/opennurbs_compress.patch @@ -0,0 +1,84 @@ +--- opennurbs/opennurbs_compress.cpp 2024-06-25 15:44:35.944646355 -0400 ++++ OPENNURBS_BLD/opennurbs_compress.cpp 2024-06-25 15:44:06.155134199 -0400 +@@ -128,7 +128,7 @@ + // compressed output in m_zlib.strm.next_out[], or do both. + + // provide storage for compressed stream output +- strm.next_out = (z_Bytef*)out_buffer; ++ strm.next_out = (Bytef*)out_buffer; + strm.avail_out = sizeof_out_buffer; + + if ( strm.avail_in <= 0 ) +@@ -142,7 +142,7 @@ + ON__UINT64 sz = (size > max_sz) ? max_sz : size; + m_in_size += sz; + m_in_crc = ON_CRC32(m_in_crc,(size_t)sz,uncompressed_buffer); // (size_t) cast is safe because sz <= max_sz = 0x7FFFFFF0 +- strm.next_in = (z_Bytef*)uncompressed_buffer; ++ strm.next_in = (Bytef*)uncompressed_buffer; + strm.avail_in = (ON__UINT32)sz; + uncompressed_buffer = ((const unsigned char*)uncompressed_buffer) + sz; + size -= sz; +@@ -152,7 +152,7 @@ + // calculate compression + ON__UINT32 avail_in0 = strm.avail_in; + ON__UINT32 avail_out0 = strm.avail_out; +- zrc = z_deflate( &strm, Z_NO_FLUSH ); ++ zrc = deflate( &strm, Z_NO_FLUSH ); + if ( zrc < 0 ) + { + // Something went haywire - bail out. +@@ -235,11 +235,11 @@ + // provide storage for compressed stream output + strm.avail_in = 0; + strm.next_in = 0; +- strm.next_out = (z_Bytef*)out_buffer; ++ strm.next_out = (Bytef*)out_buffer; + strm.avail_out = sizeof_out_buffer; + + // finish compression calculation +- zrc = z_deflate( &strm, Z_FINISH ); ++ zrc = deflate( &strm, Z_FINISH ); + if ( zrc < 0 ) + { + // Something went haywire - bail out. +@@ -446,7 +446,7 @@ + // uncompressed output in strm.next_out[], or do both. + + // provide storage for uncompressed stream output +- strm.next_out = (z_Bytef*)out_buffer; ++ strm.next_out = (Bytef*)out_buffer; + strm.avail_out = sizeof_out_buffer; + + if ( strm.avail_in <= 0 ) +@@ -460,7 +460,7 @@ + ON__UINT64 sz = (size > max_sz) ? max_sz : size; + m_in_size += sz; + m_in_crc = ON_CRC32(m_in_crc,(size_t)sz,compressed_buffer); // (size_t) cast is safe because sz <= max_sz = 0x7FFFFFF0 +- strm.next_in = (z_Bytef*)compressed_buffer; ++ strm.next_in = (Bytef*)compressed_buffer; + strm.avail_in = (ON__UINT32)sz; + compressed_buffer = ((const unsigned char*)compressed_buffer) + sz; + size -= sz; +@@ -470,7 +470,7 @@ + // calculate compression + ON__UINT32 avail_in0 = strm.avail_in; + ON__UINT32 avail_out0 = strm.avail_out; +- zrc = z_inflate( &strm, Z_NO_FLUSH ); ++ zrc = inflate( &strm, Z_NO_FLUSH ); + if ( zrc < 0 ) + { + // Something went haywire - bail out. +@@ -553,11 +553,11 @@ + // provide storage for compressed stream output + strm.avail_in = 0; + strm.next_in = 0; +- strm.next_out = (z_Bytef*)out_buffer; ++ strm.next_out = (Bytef*)out_buffer; + strm.avail_out = sizeof_out_buffer; + + // finish compression calculation +- zrc = z_inflate( &strm, Z_FINISH ); ++ zrc = inflate( &strm, Z_FINISH ); + if ( zrc < 0 ) + { + // Something went haywire - bail out. diff --git a/opennurbs/opennurbs_defines.patch b/opennurbs/opennurbs_defines.patch index c8732e4b..d9f4cd06 100644 --- a/opennurbs/opennurbs_defines.patch +++ b/opennurbs/opennurbs_defines.patch @@ -1,44 +1,32 @@ ---- opennurbs/opennurbs_defines.h 2024-02-16 13:44:43.180776089 -0500 -+++ OPENNURBS_BLD/opennurbs_defines.h 2024-02-16 14:09:03.688135229 -0500 +--- opennurbs/opennurbs_defines.h 2024-06-25 15:28:09.119849263 -0400 ++++ OPENNURBS_BLD/opennurbs_defines.h 2024-06-25 15:26:59.823993359 -0400 @@ -102,6 +102,11 @@ - #define ON_EXTERN_DECL __declspec(dllimport) - #define ON_DLL_TEMPLATE extern - -+#elif defined(__GNUC__) -+#define ON_CLASS __attribute__ ((visibility ("default"))) -+#define ON_DECL __attribute__ ((visibility ("default"))) -+#define ON_EXTERN_DECL __attribute__ ((visibility ("default"))) + #define ON_EXTERN_DECL __declspec(dllimport) + #define ON_DLL_TEMPLATE extern + ++#elif defined(__GNUC__) ++#define ON_CLASS __attribute__ ((visibility ("default"))) ++#define ON_DECL __attribute__ ((visibility ("default"))) ++#define ON_EXTERN_DECL __attribute__ ((visibility ("default"))) + - #elif defined(ON_COMPILER_CLANG) - /* using opennurbs as an Apple shared library */ - #define ON_CLASS __attribute__ ((visibility ("default"))) -@@ -2191,7 +2196,7 @@ - // the values. The reason for the gaps between the enum - // values is to leave room for future snaps with prededence - // falling between existing snaps -- enum osnap_mode -+ enum osnap_mode: unsigned int - { - os_none = 0, - os_near = 2, -@@ -2581,7 +2586,7 @@ - // Do not change these values; they are stored in 3dm archives - // and provide a persistent way to identify components of - // complex objects. -- enum TYPE -+ enum TYPE: unsigned int - { - invalid_type = 0, - - ---- opennurbs/opennurbs_defines.cpp 2024-02-16 13:44:43.180776089 -0500 -+++ OPENNURBS_BLD/opennurbs_defines.cpp 2024-02-16 14:09:42.375474772 -0500 -@@ -498,7 +498,7 @@ - #elif defined(ON_RUNTIME_APPLE) || defined(ON_RUNTIME_ANDROID) - //fcloseall is not supported on mac/ios or android - return EOF; --#else -+#elif defined(ON_COMPILER_GNU) && defined(__GLIBC__) - return fcloseall(); - #endif - } + #elif defined(ON_COMPILER_CLANG) + /* using opennurbs as an Apple shared library */ + #define ON_CLASS __attribute__ ((visibility ("default"))) +@@ -2351,7 +2356,7 @@ + // the values. The reason for the gaps between the enum + // values is to leave room for future snaps with prededence + // falling between existing snaps +- enum osnap_mode ++ enum osnap_mode: unsigned int + { + os_none = 0, + os_near = 2, +@@ -2741,7 +2746,7 @@ + // Do not change these values; they are stored in 3dm archives + // and provide a persistent way to identify components of + // complex objects. +- enum TYPE ++ enum TYPE: unsigned int + { + invalid_type = 0, + diff --git a/opennurbs/opennurbs_example_brep.patch b/opennurbs/opennurbs_example_brep.patch index 97d6c304..f3feda3a 100644 --- a/opennurbs/opennurbs_example_brep.patch +++ b/opennurbs/opennurbs_example_brep.patch @@ -1,15 +1,15 @@ ---- opennurbs/example_brep/example_brep.cpp 2024-02-16 13:44:43.200775762 -0500 -+++ OPENNURBS_BLD/example_brep/example_brep.cpp 2024-02-16 14:14:26.914632518 -0500 +--- opennurbs/example_brep/example_brep.cpp 2024-06-25 15:44:35.959646109 -0400 ++++ OPENNURBS_BLD/example_brep/example_brep.cpp 2024-06-25 15:44:06.087135312 -0400 @@ -589,9 +589,9 @@ - brep = NULL; - } - -- //ON_BOOL32 bIsManifold; -- //ON_BOOL32 bHasBoundary; -- //ON_BOOL32 b = brep->IsManifold( &bIsManifold,&bHasBoundary ); -+ //bool bIsManifold; -+ //bool bHasBoundary; -+ //bool b = brep->IsManifold( &bIsManifold,&bHasBoundary ); - - return brep; - } + brep = NULL; + } + +- //ON_BOOL32 bIsManifold; +- //ON_BOOL32 bHasBoundary; +- //ON_BOOL32 b = brep->IsManifold( &bIsManifold,&bHasBoundary ); ++ //bool bIsManifold; ++ //bool bHasBoundary; ++ //bool b = brep->IsManifold( &bIsManifold,&bHasBoundary ); + + return brep; + } diff --git a/opennurbs/opennurbs_example_gl.patch b/opennurbs/opennurbs_example_gl.patch index 608005ef..247596c4 100644 --- a/opennurbs/opennurbs_example_gl.patch +++ b/opennurbs/opennurbs_example_gl.patch @@ -1,38 +1,38 @@ ---- opennurbs/example_gl/example_gl.cpp 2024-02-16 13:44:43.268774649 -0500 -+++ OPENNURBS_BLD/example_gl/example_gl.cpp 2024-02-16 14:16:30.964583700 -0500 +--- opennurbs/example_gl/example_gl.cpp 2024-06-25 15:44:36.012645239 -0400 ++++ OPENNURBS_BLD/example_gl/example_gl.cpp 2024-06-25 15:44:06.091135247 -0400 @@ -184,7 +184,7 @@ - // - ////////////////////////////////////////////////////////////////////// - --ON_BOOL32 myInitGL( const ON_Viewport&, GLUnurbsObj*& ); -+bool myInitGL( const ON_Viewport&, GLUnurbsObj*& ); - - void myBuildDisplayList( - GLuint, // display_list_number, + // + ////////////////////////////////////////////////////////////////////// + +-ON_BOOL32 myInitGL( const ON_Viewport&, GLUnurbsObj*& ); ++bool myInitGL( const ON_Viewport&, GLUnurbsObj*& ); + + void myBuildDisplayList( + GLuint, // display_list_number, @@ -248,7 +248,7 @@ - - ON_TextLog error_log; - -- ON_BOOL32 bOK; -+ bool bOK; - int window_width = 500; - int window_height = 500; - //double port_aspect = ((double)window_width)/((double)window_height); + + ON_TextLog error_log; + +- ON_BOOL32 bOK; ++ bool bOK; + int window_width = 500; + int window_height = 500; + //double port_aspect = ((double)window_width)/((double)window_height); @@ -412,7 +412,7 @@ - ON_GL( viewport, pl, pr, pb, pt ); // updates GL projection matrix - } - --ON_BOOL32 myInitGL( const ON_Viewport& viewport, GLUnurbsObj*& nobj ) -+bool myInitGL( const ON_Viewport& viewport, GLUnurbsObj*& nobj ) - { - // set the model view transform - SetGLModelViewMatrix( viewport ); + ON_GL( viewport, pl, pr, pb, pt ); // updates GL projection matrix + } + +-ON_BOOL32 myInitGL( const ON_Viewport& viewport, GLUnurbsObj*& nobj ) ++bool myInitGL( const ON_Viewport& viewport, GLUnurbsObj*& nobj ) + { + // set the model view transform + SetGLModelViewMatrix( viewport ); @@ -595,7 +595,7 @@ - - static void myGLAUX_MouseEvent( GLint button, const AUX_EVENTREC* event ) - { -- static ON_BOOL32 bMouseActive = false; -+ static bool bMouseActive = false; - static int mx0, my0; - int mx, my; - + + static void myGLAUX_MouseEvent( GLint button, const AUX_EVENTREC* event ) + { +- static ON_BOOL32 bMouseActive = false; ++ static bool bMouseActive = false; + static int mx0, my0; + int mx, my; + diff --git a/opennurbs/opennurbs_file_utilities.patch b/opennurbs/opennurbs_file_utilities.patch index fea12776..71ed4095 100644 --- a/opennurbs/opennurbs_file_utilities.patch +++ b/opennurbs/opennurbs_file_utilities.patch @@ -1,27 +1,27 @@ ---- opennurbs/opennurbs_file_utilities.cpp 2024-02-16 13:44:43.180776089 -0500 -+++ OPENNURBS_BLD/opennurbs_file_utilities.cpp 2024-02-16 14:18:32.470563431 -0500 +--- opennurbs/opennurbs_file_utilities.cpp 2024-06-25 15:28:09.120849246 -0400 ++++ OPENNURBS_BLD/opennurbs_file_utilities.cpp 2024-06-25 15:26:59.837993128 -0400 @@ -35,7 +35,7 @@ - #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE - #include - #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE --#if defined(_M_X64) && defined(WIN32) && defined(WIN64) -+#if (defined(_M_X64) || defined(_M_ARM64)) && defined(WIN32) && defined(WIN64) - // Shlwapi.h, Shlobj.h and perhaps others, unconditionally define WIN32 - #undef WIN32 - #endif -@@ -3300,13 +3300,13 @@ - - const ON_wString content_time - = ( m_content_time <= 0 ) -- ? L"unknown" -+ ? static_cast(L"unknown") - : SecondsSinceJanOne1970UTCToString(m_content_time); - text_log.Print(L"Content last modified time = %ls\n",static_cast(content_time)); - - const ON_wString hash_time - = ( m_hash_time <= 0 ) -- ? L"unknown" -+ ? static_cast(L"unknown") - : SecondsSinceJanOne1970UTCToString(m_hash_time); - text_log.Print(L"Content hash calculated time = %ls\n",static_cast(content_time)); - + #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE + #include + #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE +-#if defined(_M_X64) && defined(WIN32) && defined(WIN64) ++#if (defined(_M_X64) || defined(_M_ARM64)) && defined(WIN32) && defined(WIN64) + // Shlwapi.h, Shlobj.h and perhaps others, unconditionally define WIN32 + #undef WIN32 + #endif +@@ -3382,13 +3382,13 @@ + + const ON_wString content_time + = ( m_content_time <= 0 ) +- ? L"unknown" ++ ? static_cast(L"unknown") + : SecondsSinceJanOne1970UTCToString(m_content_time); + text_log.Print(L"Content last modified time = %ls\n",static_cast(content_time)); + + const ON_wString hash_time + = ( m_hash_time <= 0 ) +- ? L"unknown" ++ ? static_cast(L"unknown") + : SecondsSinceJanOne1970UTCToString(m_hash_time); + text_log.Print(L"Content hash calculated time = %ls\n",static_cast(content_time)); + diff --git a/opennurbs/opennurbs_font.patch b/opennurbs/opennurbs_font.patch index 6446c34d..1b52e6eb 100644 --- a/opennurbs/opennurbs_font.patch +++ b/opennurbs/opennurbs_font.patch @@ -1,20 +1,20 @@ ---- opennurbs/opennurbs_font.cpp 2024-02-16 13:44:43.180776089 -0500 -+++ OPENNURBS_BLD/opennurbs_font.cpp 2024-02-16 14:19:51.793238751 -0500 +--- opennurbs/opennurbs_font.cpp 2024-06-25 15:44:35.946646322 -0400 ++++ OPENNURBS_BLD/opennurbs_font.cpp 2024-06-25 15:44:06.105135017 -0400 @@ -8936,7 +8936,7 @@ - const wchar_t* prev_clean_family_name = nullptr; - for (size_t i = 0; i < installed_count; i++) - { --#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) -+#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - const ON_Font* font = installed_fonts[(int)i]; - #else - const ON_Font* font = installed_fonts[i]; + const wchar_t* prev_clean_family_name = nullptr; + for (size_t i = 0; i < installed_count; i++) + { +-#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) ++#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) + const ON_Font* font = installed_fonts[(int)i]; + #else + const ON_Font* font = installed_fonts[i]; @@ -8999,7 +8999,7 @@ - InternalHashToName candidate; - for (size_t i = 0; i < count0; i++) - { --#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) -+#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - InternalHashToName e = a[(int)i]; - #else - InternalHashToName e = a[i]; + InternalHashToName candidate; + for (size_t i = 0; i < count0; i++) + { +-#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) ++#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) + InternalHashToName e = a[(int)i]; + #else + InternalHashToName e = a[i]; diff --git a/opennurbs/opennurbs_locale.patch b/opennurbs/opennurbs_locale.patch index 62c4592b..4ddcf099 100644 --- a/opennurbs/opennurbs_locale.patch +++ b/opennurbs/opennurbs_locale.patch @@ -1,56 +1,56 @@ ---- opennurbs/opennurbs_locale.cpp 2024-02-16 13:44:43.184776025 -0500 -+++ OPENNURBS_BLD/opennurbs_locale.cpp 2024-02-16 14:21:56.703145243 -0500 +--- opennurbs/opennurbs_locale.cpp 2024-06-25 15:28:09.122849214 -0400 ++++ OPENNURBS_BLD/opennurbs_locale.cpp 2024-06-25 15:26:59.851992897 -0400 @@ -32,7 +32,7 @@ - ON_C_locale = _create_locale(LC_ALL, "C"); - #elif defined(ON_RUNTIME_APPLE) - ON_C_locale = _c_locale; --#elif defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) -+#elif defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - ON_C_locale = 0; - #else - ON_C_locale = _create_locale(category, locale); + ON_C_locale = _create_locale(LC_ALL, "C"); + #elif defined(ON_RUNTIME_APPLE) + ON_C_locale = _c_locale; +-#elif defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) ++#elif defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) + ON_C_locale = 0; + #else + ON_C_locale = _create_locale(category, locale); @@ -101,7 +101,7 @@ - } - } - return newlocale(LC_ALL_MASK, apple_name, ON_CRT_C_locale() ); --#elif defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) -+#elif defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - return 0; - #else - return _create_locale(category, locale); -@@ -1341,7 +1341,7 @@ - static bool Validate_sprintf_l() - { - #if defined(ON_COMPILER_CLANG) || defined(ON_COMPILER_GNU) --#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) -+#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - // Test formatted printing - char buffer[64] = { 0 }; - // Testing C-runtime - do not using ON_String::FormatIntoBuffer -@@ -1366,7 +1366,7 @@ - static bool Validate_sprintf_s_l() - { - #if defined(ON_COMPILER_CLANG) || defined(ON_COMPILER_GNU) --#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) -+#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - // Test formatted printing - char buffer[64] = { 0 }; - size_t buffer_capacity = (sizeof(buffer) / sizeof(buffer[0])) - 1; -@@ -1420,7 +1420,7 @@ - static bool Validate_sscanf_l() - { - #if defined(ON_COMPILER_CLANG) || defined(ON_COMPILER_GNU) --#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) -+#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - // Test formatted scanning - double a = ON_UNSET_VALUE; - // Testing C-runtime - do not using ON_String::Scan -@@ -1445,7 +1445,7 @@ - static bool Validate_sscanf_s_l() - { - #if defined(ON_COMPILER_CLANG) || defined(ON_COMPILER_GNU) --#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) -+#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - // Test formatted scanning - double a = ON_UNSET_VALUE; - // Testing C-runtime - do not using ON_String::Scan + } + } + return newlocale(LC_ALL_MASK, apple_name, ON_CRT_C_locale() ); +-#elif defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) ++#elif defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) + return 0; + #else + return _create_locale(category, locale); +@@ -1345,7 +1345,7 @@ + static bool Validate_sprintf_l() + { + #if defined(ON_COMPILER_CLANG) || defined(ON_COMPILER_GNU) +-#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) ++#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) + // Test formatted printing + char buffer[64] = { 0 }; + // Testing C-runtime - do not using ON_String::FormatIntoBuffer +@@ -1370,7 +1370,7 @@ + static bool Validate_sprintf_s_l() + { + #if defined(ON_COMPILER_CLANG) || defined(ON_COMPILER_GNU) +-#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) ++#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) + // Test formatted printing + char buffer[64] = { 0 }; + size_t buffer_capacity = (sizeof(buffer) / sizeof(buffer[0])) - 1; +@@ -1424,7 +1424,7 @@ + static bool Validate_sscanf_l() + { + #if defined(ON_COMPILER_CLANG) || defined(ON_COMPILER_GNU) +-#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) ++#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) + // Test formatted scanning + double a = ON_UNSET_VALUE; + // Testing C-runtime - do not using ON_String::Scan +@@ -1449,7 +1449,7 @@ + static bool Validate_sscanf_s_l() + { + #if defined(ON_COMPILER_CLANG) || defined(ON_COMPILER_GNU) +-#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) ++#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) + // Test formatted scanning + double a = ON_UNSET_VALUE; + // Testing C-runtime - do not using ON_String::Scan diff --git a/opennurbs/opennurbs_lock.patch b/opennurbs/opennurbs_lock.patch deleted file mode 100644 index 80292eec..00000000 --- a/opennurbs/opennurbs_lock.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- opennurbs/opennurbs_lock.h 2024-02-16 13:44:43.184776025 -0500 -+++ OPENNURBS_BLD/opennurbs_lock.h 2024-02-16 14:23:31.453552042 -0500 -@@ -112,7 +112,7 @@ - // needs to have dll-interface to be used by clients of class 'ON_Lock' - // m_lock_value is private and all code that manages m_lock_value is explicitly implemented in the DLL. - private: --#if defined(ON_COMPILER_CLANG) || defined(ON_RUNTIME_LINUX) -+#if defined(ON_CLANG_CONSTRUCTOR_BUG_INIT) - std::atomic m_lock_value; - #else - std::atomic m_lock_value = ON_Lock::UnlockedValue; diff --git a/opennurbs/opennurbs_lookup.patch b/opennurbs/opennurbs_lookup.patch deleted file mode 100644 index a7aee301..00000000 --- a/opennurbs/opennurbs_lookup.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- opennurbs/opennurbs_lookup.cpp 2024-02-16 13:44:43.184776025 -0500 -+++ OPENNURBS_BLD/opennurbs_lookup.cpp 2024-02-16 14:25:11.759861768 -0500 -@@ -696,6 +696,9 @@ - return m_active_id_count; - } - -+// NOTE - optimization currently disabled for FirstElement due to compiler bug -+// in VS2022 - see https://github.com/microsoft/vcpkg/issues/19561 -+#pragma optimize("", off) - ON_SerialNumberMap::SN_ELEMENT* ON_SerialNumberMap::FirstElement() const - { - SN_ELEMENT* e=nullptr; -@@ -756,6 +759,7 @@ - } - return e; - } -+#pragma optimize("", on) - - struct ON_SerialNumberMap::SN_ELEMENT* ON_SerialNumberMap::LastElement() const - { diff --git a/opennurbs/opennurbs_object_history.patch b/opennurbs/opennurbs_object_history.patch index 0a42e270..b48e19f2 100644 --- a/opennurbs/opennurbs_object_history.patch +++ b/opennurbs/opennurbs_object_history.patch @@ -1,11 +1,11 @@ ---- opennurbs/opennurbs_object_history.cpp 2024-02-16 13:44:43.188775957 -0500 -+++ OPENNURBS_BLD/opennurbs_object_history.cpp 2024-02-16 14:26:16.210773859 -0500 +--- opennurbs/opennurbs_object_history.cpp 2024-06-25 15:44:35.950646257 -0400 ++++ OPENNURBS_BLD/opennurbs_object_history.cpp 2024-06-25 15:44:06.115134853 -0400 @@ -28,7 +28,7 @@ - // The VALUE_TYPE enum values must never be changed - // because the values are used to determine the parameter - // type during file reading. Additions can be made. -- enum VALUE_TYPE -+ enum VALUE_TYPE: unsigned int - { - no_value_type = 0, - + // The VALUE_TYPE enum values must never be changed + // because the values are used to determine the parameter + // type during file reading. Additions can be made. +- enum VALUE_TYPE ++ enum VALUE_TYPE: unsigned int + { + no_value_type = 0, + diff --git a/opennurbs/opennurbs_optimize.patch b/opennurbs/opennurbs_optimize.patch index 90a3f3b8..8413538e 100644 --- a/opennurbs/opennurbs_optimize.patch +++ b/opennurbs/opennurbs_optimize.patch @@ -1,10 +1,10 @@ ---- opennurbs/opennurbs_optimize.h 2024-02-16 13:44:43.188775957 -0500 -+++ OPENNURBS_BLD/opennurbs_optimize.h 2024-02-16 14:27:19.549703573 -0500 +--- opennurbs/opennurbs_optimize.h 2024-06-25 15:44:35.950646257 -0400 ++++ OPENNURBS_BLD/opennurbs_optimize.h 2024-06-25 15:44:06.119134788 -0400 @@ -15,6 +15,7 @@ - #define OPENNURBS_OPTIMIZE_INC_ - - // find a local minimum of a 1 parameter function -+ON_DECL - int ON_FindLocalMinimum( // returns 0 - failed to converge, 1 - success, 2 - failed to converge to requested tolerances - int (*)(void*,double,double*,double*), // f(void*, double t, double* value, double* derivative ); - void*, // passed as the void* argument to the above function + #define OPENNURBS_OPTIMIZE_INC_ + + // find a local minimum of a 1 parameter function ++ON_DECL + int ON_FindLocalMinimum( // returns 0 - failed to converge, 1 - success, 2 - failed to converge to requested tolerances + int (*)(void*,double,double*,double*), // f(void*, double t, double* value, double* derivative ); + void*, // passed as the void* argument to the above function diff --git a/opennurbs/opennurbs_polyline.patch b/opennurbs/opennurbs_polyline.patch index 877281f2..e3244f35 100644 --- a/opennurbs/opennurbs_polyline.patch +++ b/opennurbs/opennurbs_polyline.patch @@ -1,11 +1,11 @@ ---- opennurbs/opennurbs_polyline.cpp 2024-02-16 13:44:43.188775957 -0500 -+++ OPENNURBS_BLD/opennurbs_polyline.cpp 2024-02-16 14:28:31.000495061 -0500 -@@ -450,7 +450,7 @@ - maxN = maxN.UnitVector(); - for (size_t i = 0; i < point_count; ++i) - { --#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) -+#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - double d = maxN * C[(unsigned int)i]; - #else - double d = maxN * C[i]; +--- opennurbs/opennurbs_polyline.cpp 2024-06-25 15:28:09.126849147 -0400 ++++ OPENNURBS_BLD/opennurbs_polyline.cpp 2024-06-25 15:26:59.863992698 -0400 +@@ -455,7 +455,7 @@ + maxN = maxN.UnitVector(); + for (size_t i = 0; i < point_count; ++i) + { +-#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) ++#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) + double d = maxN * C[(unsigned int)i]; + #else + double d = maxN * C[i]; diff --git a/opennurbs/opennurbs_precompiledheader.patch b/opennurbs/opennurbs_precompiledheader.patch index 9b8e3752..940c9977 100644 --- a/opennurbs/opennurbs_precompiledheader.patch +++ b/opennurbs/opennurbs_precompiledheader.patch @@ -1,75 +1,75 @@ ---- opennurbs/opennurbs_precompiledheader.cpp 2024-02-16 13:44:43.188775957 -0500 -+++ OPENNURBS_BLD/opennurbs_precompiledheader.cpp 2024-02-16 14:32:40.056274471 -0500 +--- opennurbs/opennurbs_precompiledheader.cpp 2024-06-25 15:44:35.951646240 -0400 ++++ OPENNURBS_BLD/opennurbs_precompiledheader.cpp 2024-06-25 15:44:06.127134657 -0400 @@ -32,9 +32,9 @@ - #error Incorrect _M_... setting for x64 build - #endif - --#if !defined(_M_X64) -+#if !defined(_M_X64) && !defined(_M_ARM64) - // This should be automatically defined by the compiler --#error _M_X64 should be defined for x64 builds -+#error _M_X64 or _M_ARM64 should be defined for x64 or ARM64 builds - #endif - - // All opennurbs code uses the "offical" _M_X64. Unfortunately, + #error Incorrect _M_... setting for x64 build + #endif + +-#if !defined(_M_X64) ++#if !defined(_M_X64) && !defined(_M_ARM64) + // This should be automatically defined by the compiler +-#error _M_X64 should be defined for x64 builds ++#error _M_X64 or _M_ARM64 should be defined for x64 or ARM64 builds + #endif + + // All opennurbs code uses the "offical" _M_X64. Unfortunately, @@ -43,9 +43,9 @@ - // _M_X64 and _M_AMD64 for the WIN64 platform. If it doesn't, - // then we have a serious problem because some system header - // files will not be correctly preprocessed. --#if !defined(_M_AMD64) -+#if !defined(_M_AMD64) && !defined(_M_ARM64) - // This should be automatically defined by the compiler --#error _M_AMD64 should be defined for x64 builds -+#error _M_AMD64 or _M_ARM64 should be defined for x64 or ARM64 builds - #endif - - #endif + // _M_X64 and _M_AMD64 for the WIN64 platform. If it doesn't, + // then we have a serious problem because some system header + // files will not be correctly preprocessed. +-#if !defined(_M_AMD64) ++#if !defined(_M_AMD64) && !defined(_M_ARM64) + // This should be automatically defined by the compiler +-#error _M_AMD64 should be defined for x64 builds ++#error _M_AMD64 or _M_ARM64 should be defined for x64 or ARM64 builds + #endif + + #endif @@ -57,7 +57,7 @@ - #error Microsoft defines _WIN32 for all Windows builds - #endif - --#if defined(_M_IA64) || defined(_M_X64) || defined(_M_AMD64) -+#if defined(_M_IA64) || defined(_M_X64) || defined(_M_AMD64) || defined(_M_ARM64) - #error Incorrect _M_... setting for 32 bit Windows build. - #endif - + #error Microsoft defines _WIN32 for all Windows builds + #endif + +-#if defined(_M_IA64) || defined(_M_X64) || defined(_M_AMD64) ++#if defined(_M_IA64) || defined(_M_X64) || defined(_M_AMD64) || defined(_M_ARM64) + #error Incorrect _M_... setting for 32 bit Windows build. + #endif + @@ -108,9 +108,9 @@ - #error Incorrect _M_... setting for x64 build - #endif - --#if !defined(_M_X64) -+#if !defined(_M_X64) && !defined(_M_ARM64) - // This should be automatically defined by the compiler --#error _M_X64 should be defined for x64 builds -+#error _M_X64 or _M_ARM64 should be defined for x64 or ARM64 builds - #endif - - // All opennurbs code uses the "offical" _M_X64. Unfortunately, + #error Incorrect _M_... setting for x64 build + #endif + +-#if !defined(_M_X64) ++#if !defined(_M_X64) && !defined(_M_ARM64) + // This should be automatically defined by the compiler +-#error _M_X64 should be defined for x64 builds ++#error _M_X64 or _M_ARM64 should be defined for x64 or ARM64 builds + #endif + + // All opennurbs code uses the "offical" _M_X64. Unfortunately, @@ -119,9 +119,9 @@ - // _M_X64 and _M_AMD64 for the WIN64 platform. If it doesn't, - // then we have a serious problem because some system header - // files will not be correctly preprocessed. --#if !defined(_M_AMD64) -+#if !defined(_M_AMD64) && !defined(_M_ARM64) - // This should be automatically defined by the compiler --#error _M_AMD64 should be defined for x64 builds -+#error _M_AMD64 or _M_ARM64 should be defined for x64 or ARM6 builds - #endif - - #endif + // _M_X64 and _M_AMD64 for the WIN64 platform. If it doesn't, + // then we have a serious problem because some system header + // files will not be correctly preprocessed. +-#if !defined(_M_AMD64) ++#if !defined(_M_AMD64) && !defined(_M_ARM64) + // This should be automatically defined by the compiler +-#error _M_AMD64 should be defined for x64 builds ++#error _M_AMD64 or _M_ARM64 should be defined for x64 or ARM6 builds + #endif + + #endif @@ -133,7 +133,7 @@ - #error Microsoft defines _WIN32 for all Windows builds - #endif - --#if defined(_M_IA64) || defined(_M_X64) || defined(_M_AMD64) -+#if defined(_M_IA64) || defined(_M_X64) || defined(_M_AMD64) || defined(_M_ARM64) - #error Incorrect _M_... setting for 32 bit Windows build. - #endif - + #error Microsoft defines _WIN32 for all Windows builds + #endif + +-#if defined(_M_IA64) || defined(_M_X64) || defined(_M_AMD64) ++#if defined(_M_IA64) || defined(_M_X64) || defined(_M_AMD64) || defined(_M_ARM64) + #error Incorrect _M_... setting for 32 bit Windows build. + #endif + @@ -144,4 +144,4 @@ - - #endif - + + #endif + -#endif \ No newline at end of file -+#endif ++#endif diff --git a/opennurbs/opennurbs_statics.patch b/opennurbs/opennurbs_statics.patch deleted file mode 100644 index 02ee540a..00000000 --- a/opennurbs/opennurbs_statics.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- opennurbs/opennurbs_statics.cpp 2023-09-09 13:52:46.165646304 -0400 -+++ openNURBS/opennurbs_statics.cpp 2023-09-09 13:43:33.724976199 -0400 -@@ -515,7 +515,7 @@ - const ON_SHA1_Hash ON_SHA1_Hash::EmptyContentHash = ON_SHA1_Hash_EmptyContentHash(); - const ON_SHA1_Hash ON_SHA1_Hash::ZeroDigest ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SHA1_Hash); - --const ONX_ModelTest ONX_ModelTest::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ONX_ModelTest); -+const ONX_ModelTest ONX_ModelTest::Unset = ONX_ModelTest(); - - // Works with Microsoft's CL, fails for Apple's CLang - //// const struct ON_UnicodeErrorParameters ON_UnicodeErrorParameters::MaskErrors = { 0, 0xFFFFFFFF, ON_UnicodeCodePoint::ON_ReplacementCharacter }; -@@ -744,7 +744,7 @@ - const ON_LengthValue ON_LengthValue::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_LengthValue); - const ON_LengthValue ON_LengthValue::Zero = ON_LengthValue::Create(0.0, ON::LengthUnitSystem::None, 0, ON_LengthValue::StringFormat::CleanDecimal); - --const ON_AngleValue ON_AngleValue::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_AngleValue); -+const ON_AngleValue ON_AngleValue::Unset = ON_AngleValue(); - const ON_AngleValue ON_AngleValue::Zero = ON_AngleValue::Create(0.0, ON::AngleUnitSystem::None, 0, ON_AngleValue::StringFormat::CleanDecimal ); - - const ON_ScaleValue ON_ScaleValue::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_ScaleValue); diff --git a/opennurbs/opennurbs_string.patch b/opennurbs/opennurbs_string.patch deleted file mode 100644 index 85c23943..00000000 --- a/opennurbs/opennurbs_string.patch +++ /dev/null @@ -1,64 +0,0 @@ ---- opennurbs/opennurbs_string_format.cpp 2024-02-16 13:44:43.192775892 -0500 -+++ OPENNURBS_BLD/opennurbs_string_format.cpp 2024-02-16 14:35:55.680953219 -0500 -@@ -802,7 +802,7 @@ - // CLang modifies args so a copy is required - va_list args_copy; - va_copy (args_copy, args); --#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) -+#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - int len = vsnprintf(buffer, buffer_capacity, format, args_copy); - #else - int len = vsnprintf_l(buffer, buffer_capacity, ON_Locale::Ordinal.NumericLocalePtr(), format, args_copy); -@@ -855,7 +855,7 @@ - va_list args_copy; - va_copy (args_copy, args); - --#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) -+#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - int len = vsnprintf(nullptr, 0, format, args_copy); - #else - int len = vsnprintf_l(nullptr, 0, ON_Locale::Ordinal.NumericLocalePtr(), format, args_copy); ---- opennurbs/opennurbs_string_scan.cpp 2024-02-16 13:44:43.192775892 -0500 -+++ OPENNURBS_BLD/opennurbs_string_scan.cpp 2024-02-16 14:36:54.019962012 -0500 -@@ -82,8 +82,8 @@ - va_list args - ) - { --#if defined(ON_COMPILER_CLANG) || defined(ON_RUNTIME_LINUX) --#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) -+#if defined(ON_COMPILER_CLANG) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) -+#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - if (nullptr == buffer || nullptr == format) - return -1; - return vsscanf(buffer, format, args); -@@ -156,7 +156,7 @@ - if (nullptr == args) - return -1; - return swscanf_l(buffer, _c_locale, format, args); --#elif defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) -+#elif defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - return swscanf(buffer, format, args); - #else - return swscanf(buffer, format, args); -@@ -395,8 +395,8 @@ - local_buffer[local_buffer_count++] = 0; - - double x = value_on_failure; --#if defined(ON_COMPILER_CLANG) || defined(ON_RUNTIME_LINUX) --#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) -+#if defined(ON_COMPILER_CLANG) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) -+#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - if (1 == sscanf(local_buffer, "%lg", &x)) - { - *value = x; -@@ -657,8 +657,8 @@ - local_buffer[local_buffer_count++] = 0; - - double x = value_on_failure; --#if defined(ON_COMPILER_CLANG) || defined(ON_RUNTIME_LINUX) --#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) -+#if defined(ON_COMPILER_CLANG) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) -+#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - if (1 == sscanf(local_buffer, "%lg", &x)) - { - *value = x; diff --git a/opennurbs/opennurbs_string_format.patch b/opennurbs/opennurbs_string_format.patch new file mode 100644 index 00000000..4bc29cf4 --- /dev/null +++ b/opennurbs/opennurbs_string_format.patch @@ -0,0 +1,20 @@ +--- opennurbs/opennurbs_string_format.cpp 2024-06-25 15:44:35.953646208 -0400 ++++ OPENNURBS_BLD/opennurbs_string_format.cpp 2024-06-25 15:44:06.131134592 -0400 +@@ -802,7 +802,7 @@ + // CLang modifies args so a copy is required + va_list args_copy; + va_copy (args_copy, args); +-#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) ++#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) + int len = vsnprintf(buffer, buffer_capacity, format, args_copy); + #else + int len = vsnprintf_l(buffer, buffer_capacity, ON_Locale::Ordinal.NumericLocalePtr(), format, args_copy); +@@ -855,7 +855,7 @@ + va_list args_copy; + va_copy (args_copy, args); + +-#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) ++#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) + int len = vsnprintf(nullptr, 0, format, args_copy); + #else + int len = vsnprintf_l(nullptr, 0, ON_Locale::Ordinal.NumericLocalePtr(), format, args_copy); diff --git a/opennurbs/opennurbs_system.patch b/opennurbs/opennurbs_system.patch index 0c5ac9da..26428330 100644 --- a/opennurbs/opennurbs_system.patch +++ b/opennurbs/opennurbs_system.patch @@ -1,11 +1,11 @@ ---- opennurbs/opennurbs_system.h 2024-02-16 13:44:43.192775892 -0500 -+++ OPENNURBS_BLD/opennurbs_system.h 2024-02-16 14:38:32.266292178 -0500 +--- opennurbs/opennurbs_system.h 2024-06-25 15:44:35.955646175 -0400 ++++ OPENNURBS_BLD/opennurbs_system.h 2024-06-25 15:44:06.135134526 -0400 @@ -494,7 +494,7 @@ - #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE - - #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE --#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) -+#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - #include "android_uuid/uuid.h" - #else - #include + #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE + + #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE +-#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) ++#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) + #include "android_uuid/uuid.h" + #else + #include diff --git a/opennurbs/opennurbs_system_runtime.patch b/opennurbs/opennurbs_system_runtime.patch index 3ce30436..56f40030 100644 --- a/opennurbs/opennurbs_system_runtime.patch +++ b/opennurbs/opennurbs_system_runtime.patch @@ -1,51 +1,51 @@ ---- opennurbs/opennurbs_system_runtime.h 2024-02-16 13:44:43.192775892 -0500 -+++ OPENNURBS_BLD/opennurbs_system_runtime.h 2024-02-16 14:41:07.375654473 -0500 +--- opennurbs/opennurbs_system_runtime.h 2024-06-25 15:44:35.955646175 -0400 ++++ OPENNURBS_BLD/opennurbs_system_runtime.h 2024-06-25 15:44:06.138134477 -0400 @@ -56,6 +56,11 @@ - #define ON_RUNTIME_LINUX - #endif - -+#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__) -+#if !defined(ON_RUNTIME_BSD) -+#define ON_RUNTIME_BSD -+#endif -+ - #endif - /* - // + #define ON_RUNTIME_LINUX + #endif + ++#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__) ++#if !defined(ON_RUNTIME_BSD) ++#define ON_RUNTIME_BSD ++#endif ++ + #endif + /* + // @@ -127,7 +132,7 @@ - #define ON_RUNTIME_WIN_WINOS - #endif - --#if defined(_M_X64) || defined(_WIN64) -+#if defined(_M_X64) || defined(_M_ARM64) || defined(_WIN64) - #define ON_64BIT_RUNTIME - #elif defined(_M_X86) || defined(_WIN32) - #define ON_32BIT_RUNTIME + #define ON_RUNTIME_WIN_WINOS + #endif + +-#if defined(_M_X64) || defined(_WIN64) ++#if defined(_M_X64) || defined(_M_ARM64) || defined(_WIN64) + #define ON_64BIT_RUNTIME + #elif defined(_M_X86) || defined(_WIN32) + #define ON_32BIT_RUNTIME @@ -136,7 +141,7 @@ - #endif - - #if !defined(ON_LITTLE_ENDIAN) --#if (defined(_M_X64) || defined(_M_IX86) || defined (__i386__) || defined( __x86_64__ )) -+#if (defined(_M_X64) || defined(_M_ARM64) || defined(_M_IX86) || defined(__i386__) || defined(__x86_64__) || defined(__x86_64)) - #define ON_LITTLE_ENDIAN - #endif - #endif + #endif + + #if !defined(ON_LITTLE_ENDIAN) +-#if (defined(_M_X64) || defined(_M_IX86) || defined (__i386__) || defined( __x86_64__ )) ++#if (defined(_M_X64) || defined(_M_ARM64) || defined(_M_IX86) || defined(__i386__) || defined(__x86_64__) || defined(__x86_64)) + #define ON_LITTLE_ENDIAN + #endif + #endif @@ -146,7 +151,7 @@ - #define ON_RUNTIME_LINUX - #endif - --#if defined(ON_RUNTIME_LINUX) -+#if defined(ON_RUNTIME_LINUX) || defined (ON_RUNTIME_BSD) - - #if !defined(ON_SIZEOF_WCHAR_T) - #define ON_SIZEOF_WCHAR_T 4 + #define ON_RUNTIME_LINUX + #endif + +-#if defined(ON_RUNTIME_LINUX) ++#if defined(ON_RUNTIME_LINUX) || defined (ON_RUNTIME_BSD) + + #if !defined(ON_SIZEOF_WCHAR_T) + #define ON_SIZEOF_WCHAR_T 4 @@ -159,7 +164,9 @@ - #define ON_32BIT_RUNTIME - #endif - -+#if !defined(ON_RUNTIME_BSD) - #include -+#endif - #if __BYTE_ORDER == __LITTLE_ENDIAN - #define ON_LITTLE_ENDIAN - #else + #define ON_32BIT_RUNTIME + #endif + ++#if !defined(ON_RUNTIME_BSD) + #include ++#endif + #if __BYTE_ORDER == __LITTLE_ENDIAN + #define ON_LITTLE_ENDIAN + #else diff --git a/opennurbs/opennurbs_uuid.patch b/opennurbs/opennurbs_uuid.patch index 1c254944..f4cafea1 100644 --- a/opennurbs/opennurbs_uuid.patch +++ b/opennurbs/opennurbs_uuid.patch @@ -1,20 +1,20 @@ ---- opennurbs/opennurbs_uuid.cpp 2024-02-16 13:44:43.196775827 -0500 -+++ OPENNURBS_BLD/opennurbs_uuid.cpp 2024-02-16 14:42:10.958572844 -0500 +--- opennurbs/opennurbs_uuid.cpp 2024-06-25 15:44:35.957646142 -0400 ++++ OPENNURBS_BLD/opennurbs_uuid.cpp 2024-06-25 15:44:06.142134412 -0400 @@ -12,7 +12,7 @@ - //////////////////////////////////////////////////////////////// - - #include "opennurbs.h" --#if defined(ON_RUNTIME_LINUX) -+#if defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - #include "android_uuid/uuid.h" - #endif - #if !defined(ON_COMPILING_OPENNURBS) + //////////////////////////////////////////////////////////////// + + #include "opennurbs.h" +-#if defined(ON_RUNTIME_LINUX) ++#if defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) + #include "android_uuid/uuid.h" + #endif + #if !defined(ON_COMPILING_OPENNURBS) @@ -221,7 +221,7 @@ - return true; - #else - --#if defined(ON_RUNTIME_LINUX) -+#if defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) - uuid_generate((unsigned char*)&new_uuid); - return true; - #else + return true; + #else + +-#if defined(ON_RUNTIME_LINUX) ++#if defined(ON_RUNTIME_LINUX) || defined(ON_RUNTIME_BSD) + uuid_generate((unsigned char*)&new_uuid); + return true; + #else diff --git a/opennurbs/opennurbs_version_number.patch b/opennurbs/opennurbs_version_number.patch index c727a362..ee4f6e17 100644 --- a/opennurbs/opennurbs_version_number.patch +++ b/opennurbs/opennurbs_version_number.patch @@ -1,11 +1,11 @@ ---- opennurbs/opennurbs_version_number.cpp 2024-02-16 14:43:07.537610278 -0500 -+++ OPENNURBS_BLD/opennurbs_version_number.cpp 2024-02-16 14:37:57.878876713 -0500 +--- opennurbs/opennurbs_version_number.cpp 2024-06-25 15:44:35.957646142 -0400 ++++ OPENNURBS_BLD/opennurbs_version_number.cpp 2024-06-25 15:44:06.146134346 -0400 @@ -375,7 +375,7 @@ - str_version = - (0 != version_number) - ? ON_String::FormatToString("0x%08X", version_number) -- : "0"; -+ : static_cast("0"); - } - - return str_version; + str_version = + (0 != version_number) + ? ON_String::FormatToString("0x%08X", version_number) +- : "0"; ++ : static_cast("0"); + } + + return str_version; diff --git a/opennurbs/opennurbs_x.patch b/opennurbs/opennurbs_x.patch index c197cbdd..3589feae 100644 --- a/opennurbs/opennurbs_x.patch +++ b/opennurbs/opennurbs_x.patch @@ -1659,10 +1659,10 @@ --- opennurbs/opennurbs.h 2024-02-16 13:44:43.176776155 -0500 +++ OPENNURBS_BLD/opennurbs.h 2024-02-16 14:50:15.862555794 -0500 @@ -182,6 +182,7 @@ - #include "opennurbs_extensions.h" - #include "opennurbs_freetype.h" - -+#include "opennurbs_x.h" // intersection events - - #endif - + #include "opennurbs_extensions.h" + #include "opennurbs_freetype.h" + ++#include "opennurbs_x.h" // intersection events + + #endif + diff --git a/opennurbs/opennurbs_zlib.patch b/opennurbs/opennurbs_zlib.patch index a4a06027..e26d6e7c 100644 --- a/opennurbs/opennurbs_zlib.patch +++ b/opennurbs/opennurbs_zlib.patch @@ -1,184 +1,100 @@ ---- opennurbs/opennurbs_compress.cpp 2024-02-16 15:39:23.491884645 -0500 -+++ OPENNURBS_BLD/opennurbs_compress.cpp 2024-02-16 15:23:15.326224509 -0500 -@@ -128,7 +128,7 @@ - // compressed output in m_zlib.strm.next_out[], or do both. - - // provide storage for compressed stream output -- strm.next_out = (z_Bytef*)out_buffer; -+ strm.next_out = (Bytef*)out_buffer; - strm.avail_out = sizeof_out_buffer; - - if ( strm.avail_in <= 0 ) -@@ -142,7 +142,7 @@ - ON__UINT64 sz = (size > max_sz) ? max_sz : size; - m_in_size += sz; - m_in_crc = ON_CRC32(m_in_crc,(size_t)sz,uncompressed_buffer); // (size_t) cast is safe because sz <= max_sz = 0x7FFFFFF0 -- strm.next_in = (z_Bytef*)uncompressed_buffer; -+ strm.next_in = (Bytef*)uncompressed_buffer; - strm.avail_in = (ON__UINT32)sz; - uncompressed_buffer = ((const unsigned char*)uncompressed_buffer) + sz; - size -= sz; -@@ -152,7 +152,7 @@ - // calculate compression - ON__UINT32 avail_in0 = strm.avail_in; - ON__UINT32 avail_out0 = strm.avail_out; -- zrc = z_deflate( &strm, Z_NO_FLUSH ); -+ zrc = deflate( &strm, Z_NO_FLUSH ); - if ( zrc < 0 ) - { - // Something went haywire - bail out. -@@ -235,11 +235,11 @@ - // provide storage for compressed stream output - strm.avail_in = 0; - strm.next_in = 0; -- strm.next_out = (z_Bytef*)out_buffer; -+ strm.next_out = (Bytef*)out_buffer; - strm.avail_out = sizeof_out_buffer; - - // finish compression calculation -- zrc = z_deflate( &strm, Z_FINISH ); -+ zrc = deflate( &strm, Z_FINISH ); - if ( zrc < 0 ) - { - // Something went haywire - bail out. -@@ -446,7 +446,7 @@ - // uncompressed output in strm.next_out[], or do both. - - // provide storage for uncompressed stream output -- strm.next_out = (z_Bytef*)out_buffer; -+ strm.next_out = (Bytef*)out_buffer; - strm.avail_out = sizeof_out_buffer; - - if ( strm.avail_in <= 0 ) -@@ -460,7 +460,7 @@ - ON__UINT64 sz = (size > max_sz) ? max_sz : size; - m_in_size += sz; - m_in_crc = ON_CRC32(m_in_crc,(size_t)sz,compressed_buffer); // (size_t) cast is safe because sz <= max_sz = 0x7FFFFFF0 -- strm.next_in = (z_Bytef*)compressed_buffer; -+ strm.next_in = (Bytef*)compressed_buffer; - strm.avail_in = (ON__UINT32)sz; - compressed_buffer = ((const unsigned char*)compressed_buffer) + sz; - size -= sz; -@@ -470,7 +470,7 @@ - // calculate compression - ON__UINT32 avail_in0 = strm.avail_in; - ON__UINT32 avail_out0 = strm.avail_out; -- zrc = z_inflate( &strm, Z_NO_FLUSH ); -+ zrc = inflate( &strm, Z_NO_FLUSH ); - if ( zrc < 0 ) - { - // Something went haywire - bail out. -@@ -553,11 +553,11 @@ - // provide storage for compressed stream output - strm.avail_in = 0; - strm.next_in = 0; -- strm.next_out = (z_Bytef*)out_buffer; -+ strm.next_out = (Bytef*)out_buffer; - strm.avail_out = sizeof_out_buffer; - - // finish compression calculation -- zrc = z_inflate( &strm, Z_FINISH ); -+ zrc = inflate( &strm, Z_FINISH ); - if ( zrc < 0 ) - { - // Something went haywire - bail out. ---- opennurbs/opennurbs_zlib.cpp 2024-02-16 15:39:23.535883954 -0500 -+++ OPENNURBS_BLD/opennurbs_zlib.cpp 2024-02-16 15:23:15.326224509 -0500 +--- opennurbs/opennurbs_zlib.cpp 2024-06-25 15:44:35.958646126 -0400 ++++ OPENNURBS_BLD/opennurbs_zlib.cpp 2024-06-25 15:44:06.155134199 -0400 @@ -23,6 +23,7 @@ - - #include "opennurbs_zlib.h" - -+#if 0 - #if defined(ON_COMPILER_MSC) && !defined(ON_CMAKE_BUILD) - - #if !defined(OPENNURBS_ZLIB_LIB_DIR) + + #include "opennurbs_zlib.h" + ++#if 0 + #if defined(ON_COMPILER_MSC) && !defined(ON_CMAKE_BUILD) + + #if !defined(OPENNURBS_ZLIB_LIB_DIR) @@ -52,6 +53,8 @@ - - #endif - -+#endif -+ - // compressed buffer I/O uses zlib 1.1.3 inflate()/deflate() - class ON_CompressorImplementation - { + + #endif + ++#endif ++ + // compressed buffer I/O uses zlib 1.1.3 inflate()/deflate() + class ON_CompressorImplementation + { @@ -319,11 +322,11 @@ - // no uncompressed input is left - switch to finish mode - flush = Z_FINISH; - } -- zrc = z_deflate(&m_zlib.m_strm, flush); -+ zrc = deflate(&m_zlib.m_strm, flush); - if ( zrc < 0 ) - { - // Something went haywire - bail out. -- ON_ERROR("ON_BinaryArchive::WriteDeflate - z_deflate failure"); -+ ON_ERROR("ON_BinaryArchive::WriteDeflate - deflate failure"); - rc = false; - break; - } + // no uncompressed input is left - switch to finish mode + flush = Z_FINISH; + } +- zrc = z_deflate(&m_zlib.m_strm, flush); ++ zrc = deflate(&m_zlib.m_strm, flush); + if ( zrc < 0 ) + { + // Something went haywire - bail out. +- ON_ERROR("ON_BinaryArchive::WriteDeflate - z_deflate failure"); ++ ON_ERROR("ON_BinaryArchive::WriteDeflate - deflate failure"); + rc = false; + break; + } @@ -519,11 +522,11 @@ - // no compressed input is left - switch to finish mode - flush = Z_FINISH; - } -- zrc = z_inflate( &m_zlib.m_strm, flush ); -+ zrc = inflate( &m_zlib.m_strm, flush ); - if ( zrc < 0 ) - { - // Something went haywire - bail out. -- ON_ERROR("ON_BinaryArchive::ReadInflate - z_inflate failure"); -+ ON_ERROR("ON_BinaryArchive::ReadInflate - inflate failure"); - rc = false; - break; - } + // no compressed input is left - switch to finish mode + flush = Z_FINISH; + } +- zrc = z_inflate( &m_zlib.m_strm, flush ); ++ zrc = inflate( &m_zlib.m_strm, flush ); + if ( zrc < 0 ) + { + // Something went haywire - bail out. +- ON_ERROR("ON_BinaryArchive::ReadInflate - z_inflate failure"); ++ ON_ERROR("ON_BinaryArchive::ReadInflate - inflate failure"); + rc = false; + break; + } @@ -1200,11 +1203,11 @@ - // no uncompressed input is left - switch to finish mode - flush = Z_FINISH; - } -- zrc = z_deflate( &m_zlib.m_strm, flush ); -+ zrc = deflate( &m_zlib.m_strm, flush ); - if ( zrc < 0 ) - { - // Something went haywire - bail out. -- ON_ERROR("ON_CompressedBuffer::DeflateHelper - z_deflate failure"); -+ ON_ERROR("ON_CompressedBuffer::DeflateHelper - deflate failure"); - rc = false; - break; - } + // no uncompressed input is left - switch to finish mode + flush = Z_FINISH; + } +- zrc = z_deflate( &m_zlib.m_strm, flush ); ++ zrc = deflate( &m_zlib.m_strm, flush ); + if ( zrc < 0 ) + { + // Something went haywire - bail out. +- ON_ERROR("ON_CompressedBuffer::DeflateHelper - z_deflate failure"); ++ ON_ERROR("ON_CompressedBuffer::DeflateHelper - deflate failure"); + rc = false; + break; + } @@ -1333,11 +1336,11 @@ - // no compressed input is left - switch to finish mode - flush = Z_FINISH; - } -- zrc = z_inflate( &m_zlib.m_strm, flush ); -+ zrc = inflate( &m_zlib.m_strm, flush ); - if ( zrc < 0 ) - { - // Something went haywire - bail out. -- ON_ERROR("ON_CompressedBuffer::InflateHelper - z_inflate failure"); -+ ON_ERROR("ON_CompressedBuffer::InflateHelper - inflate failure"); - rc = false; - break; - } ---- opennurbs/opennurbs_zlib.h 2024-02-16 15:39:23.535883954 -0500 -+++ OPENNURBS_BLD/opennurbs_zlib.h 2024-02-16 15:38:23.556824827 -0500 + // no compressed input is left - switch to finish mode + flush = Z_FINISH; + } +- zrc = z_inflate( &m_zlib.m_strm, flush ); ++ zrc = inflate( &m_zlib.m_strm, flush ); + if ( zrc < 0 ) + { + // Something went haywire - bail out. +- ON_ERROR("ON_CompressedBuffer::InflateHelper - z_inflate failure"); ++ ON_ERROR("ON_CompressedBuffer::InflateHelper - inflate failure"); + rc = false; + break; + } +--- opennurbs/opennurbs_zlib.h 2024-06-25 15:44:35.958646126 -0400 ++++ OPENNURBS_BLD/opennurbs_zlib.h 2024-06-25 15:44:06.156134182 -0400 @@ -25,19 +25,19 @@ - // and statically link with the zlib library. All the necessary - // header files are included by opennurbs.h. - -- -+#if 0 - #if !defined(Z_PREFIX) - /* decorates zlib functions with a "z_" prefix to prevent symbol collision. */ - #define Z_PREFIX - #endif -- -+#endif - #if !defined(MY_ZCALLOC) - /* have zlib use oncalloc() and onfree() for memory management*/ - #define MY_ZCALLOC - #endif - - #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE --#include "./zlib/zlib.h" -+#include "zlib.h" - #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE - - ON_BEGIN_EXTERNC + // and statically link with the zlib library. All the necessary + // header files are included by opennurbs.h. + +- ++#if 0 + #if !defined(Z_PREFIX) + /* decorates zlib functions with a "z_" prefix to prevent symbol collision. */ + #define Z_PREFIX + #endif +- ++#endif + #if !defined(MY_ZCALLOC) + /* have zlib use oncalloc() and onfree() for memory management*/ + #define MY_ZCALLOC + #endif + + #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE +-#include "./zlib/zlib.h" ++#include "zlib.h" + #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE + + ON_BEGIN_EXTERNC From 732955ba5ff623954045ea2303ec6c7285000a4a Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 19:40:26 -0400 Subject: [PATCH 40/71] Update geogram to v1.9.0 --- geogram/CMakeLists.txt | 1 - geogram/geogram | 2 +- geogram/geogram_superlu.patch | 48 ----------------------------------- 3 files changed, 1 insertion(+), 50 deletions(-) delete mode 100644 geogram/geogram_superlu.patch diff --git a/geogram/CMakeLists.txt b/geogram/CMakeLists.txt index 0d9e336d..bfb30aa4 100644 --- a/geogram/CMakeLists.txt +++ b/geogram/CMakeLists.txt @@ -15,7 +15,6 @@ if (ENABLE_GEOGRAM) URL "${CMAKE_CURRENT_SOURCE_DIR}/geogram" BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS} PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/geogram_cmake.patch - COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/geogram_superlu.patch COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/geogram_win32.patch CMAKE_ARGS ${BUILD_TYPE_SPECIFIER} diff --git a/geogram/geogram b/geogram/geogram index 4c1a4683..888172e3 160000 --- a/geogram/geogram +++ b/geogram/geogram @@ -1 +1 @@ -Subproject commit 4c1a4683442de27fad7bff3c6e613b060cc59430 +Subproject commit 888172e37ea4729469fa2c5dbbc15ba68b8c234e diff --git a/geogram/geogram_superlu.patch b/geogram/geogram_superlu.patch deleted file mode 100644 index e1257112..00000000 --- a/geogram/geogram_superlu.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff -Naur geogram/src/lib/third_party/numerics/SUPERLU/cutil.c GEOGRAM_BLD/src/lib/third_party/numerics/SUPERLU/cutil.c ---- geogram/src/lib/third_party/numerics/SUPERLU/cutil.c 2024-04-19 17:13:22.947629009 -0400 -+++ GEOGRAM_BLD/src/lib/third_party/numerics/SUPERLU/cutil.c 2024-04-19 17:13:53.726931559 -0400 -@@ -474,7 +474,7 @@ - - - -- -+int - print_complex_vec(char *what, int n, complex *vec) - { - int i; -diff -Naur geogram/src/lib/third_party/numerics/SUPERLU/dutil.c GEOGRAM_BLD/src/lib/third_party/numerics/SUPERLU/dutil.c ---- geogram/src/lib/third_party/numerics/SUPERLU/dutil.c 2024-04-19 17:13:22.947629009 -0400 -+++ GEOGRAM_BLD/src/lib/third_party/numerics/SUPERLU/dutil.c 2024-04-19 17:13:59.518801347 -0400 -@@ -470,7 +470,7 @@ - - - -- -+int - print_double_vec(char *what, int n, double *vec) - { - int i; -diff -Naur geogram/src/lib/third_party/numerics/SUPERLU/sutil.c GEOGRAM_BLD/src/lib/third_party/numerics/SUPERLU/sutil.c ---- geogram/src/lib/third_party/numerics/SUPERLU/sutil.c 2024-04-19 17:13:22.947629009 -0400 -+++ GEOGRAM_BLD/src/lib/third_party/numerics/SUPERLU/sutil.c 2024-04-19 17:14:20.190339229 -0400 -@@ -470,7 +470,7 @@ - - - -- -+int - print_float_vec(char *what, int n, float *vec) - { - int i; -diff -Naur geogram/src/lib/third_party/numerics/SUPERLU/zutil.c GEOGRAM_BLD/src/lib/third_party/numerics/SUPERLU/zutil.c ---- geogram/src/lib/third_party/numerics/SUPERLU/zutil.c 2024-04-19 17:13:22.947629009 -0400 -+++ GEOGRAM_BLD/src/lib/third_party/numerics/SUPERLU/zutil.c 2024-04-19 17:14:27.294181312 -0400 -@@ -474,7 +474,7 @@ - - - -- -+int - print_doublecomplex_vec(char *what, int n, doublecomplex *vec) - { - int i; From 918141c70177552a51c6660435eafe0a70103917 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 19:42:18 -0400 Subject: [PATCH 41/71] Update embree to v4.3.2 --- embree/embree | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/embree/embree b/embree/embree index be0accfd..80079493 160000 --- a/embree/embree +++ b/embree/embree @@ -1 +1 @@ -Subproject commit be0accfd0b246e2b03355b8ee7710a22c1b49240 +Subproject commit 800794931f183a814f744fc5b0eba8ccab1712e4 From fd00536b0d198f71c5bfad536abc773341d9803b Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 19:46:03 -0400 Subject: [PATCH 42/71] Update embree patch for new sources --- embree/embree.patch | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/embree/embree.patch b/embree/embree.patch index b3b03ff1..eb303332 100644 --- a/embree/embree.patch +++ b/embree/embree.patch @@ -1,7 +1,6 @@ -diff -Naur embree/common/cmake/package.cmake EMBREE_BLD/common/cmake/package.cmake ---- embree/common/cmake/package.cmake 2023-09-18 12:26:06.118808150 -0400 -+++ EMBREE_BLD/common/cmake/package.cmake 2023-09-18 12:25:52.347047879 -0400 -@@ -171,13 +171,13 @@ +--- embree/common/cmake/package.cmake 2024-06-25 19:45:03.229489407 -0400 ++++ EMBREE_BLD/common/cmake/package.cmake 2024-06-25 19:42:33.118981564 -0400 +@@ -178,13 +178,13 @@ ELSEIF(APPLE) CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/scripts/install_macosx/embree-vars.sh" embree-vars.sh @ONLY) CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/scripts/install_macosx/embree-vars.csh" embree-vars.csh @ONLY) @@ -18,4 +17,4 @@ diff -Naur embree/common/cmake/package.cmake EMBREE_BLD/common/cmake/package.cma + INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-vars.csh" DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT lib) ENDIF() ENDIF() - + From 9999edf0d2e706de31a99b6bb16e9593948fef8a Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Wed, 26 Jun 2024 10:44:00 -0400 Subject: [PATCH 43/71] Update Qt to v6.7.2 --- qt/README | 2 +- qt/qt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qt/README b/qt/README index acc132a7..e4397914 100644 --- a/qt/README +++ b/qt/README @@ -3,7 +3,7 @@ on a more minimal subset for easier compilation. Sources are from: https://download.qt.io/official_releases/qt/ -Current version present: 6.6.2 +Current version present: 6.7.2 Building on Redhat 8 and derivatives (tested with Rocky Linux 8) diff --git a/qt/qt b/qt/qt index 9f70c379..36ebcf1c 160000 --- a/qt/qt +++ b/qt/qt @@ -1 +1 @@ -Subproject commit 9f70c3790a0b1c9ff4969d96177533f83763a6bb +Subproject commit 36ebcf1c0556b68ff242f1fff26fc2c1c032e4be From b2df8bdb0696f99baea4502a93c76cd22ec91fa1 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Wed, 26 Jun 2024 14:07:23 -0400 Subject: [PATCH 44/71] Update patches for LLVM 18 --- llvm/llvm_no_ast_introspection.patch | 141 +----- llvm/llvm_z_brl.patch | 664 +++++++++++++++++---------- 2 files changed, 434 insertions(+), 371 deletions(-) diff --git a/llvm/llvm_no_ast_introspection.patch b/llvm/llvm_no_ast_introspection.patch index d709b80b..c4c5136b 100644 --- a/llvm/llvm_no_ast_introspection.patch +++ b/llvm/llvm_no_ast_introspection.patch @@ -1,7 +1,7 @@ diff -Naur llvm-project/clang/lib/Tooling/CMakeLists.txt LLVM_BLD/clang/lib/Tooling/CMakeLists.txt ---- llvm-project/clang/lib/Tooling/CMakeLists.txt 2023-09-22 10:24:55.393414859 -0400 -+++ LLVM_BLD/clang/lib/Tooling/CMakeLists.txt 2023-09-22 12:33:27.336811282 -0400 -@@ -23,80 +23,80 @@ +--- llvm-project/clang/lib/Tooling/CMakeLists.txt 2024-06-26 10:58:56.993040845 -0400 ++++ LLVM_BLD/clang/lib/Tooling/CMakeLists.txt 2024-06-26 11:56:09.496630352 -0400 +@@ -24,11 +24,12 @@ string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} ${PATH_LIB_END} -1 PATH_TAIL) string(CONCAT BINARY_INCLUDE_DIR ${PATH_HEAD} "/include/clang/" ${PATH_TAIL}) @@ -10,143 +10,12 @@ diff -Naur llvm-project/clang/lib/Tooling/CMakeLists.txt LLVM_BLD/clang/lib/Tool - OR CMAKE_CROSSCOMPILING - OR GENERATOR_IS_MULTI_CONFIG - OR NOT LLVM_NATIVE_ARCH IN_LIST LLVM_TARGETS_TO_BUILD -- ) +#if (NOT Python3_EXECUTABLE +# OR APPLE +# OR CMAKE_CROSSCOMPILING +# OR GENERATOR_IS_MULTI_CONFIG +# OR NOT LLVM_NATIVE_ARCH IN_LIST LLVM_TARGETS_TO_BUILD -+# ) ++if (1) + ) configure_file( EmptyNodeIntrospection.inc.in - ${BINARY_INCLUDE_DIR}/NodeIntrospection.inc - COPYONLY - ) - set(CLANG_TOOLING_BUILD_AST_INTROSPECTION "OFF" CACHE BOOL "") --else() -- # The generation of ASTNodeAPI.json takes a long time in a -- # Debug build due to parsing AST.h. Disable the processing -- # but setting CLANG_TOOLING_BUILD_AST_INTROSPECTION as an -- # internal hidden setting to override. -- # When the processing is disabled, a trivial/empty JSON -- # file is generated by clang-ast-dump and generate_cxx_src_locs.py -- # generates the same API, but with a trivial implementation. -- option(CLANG_TOOLING_BUILD_AST_INTROSPECTION "Enable AST introspection" TRUE) -- -- set(skip_expensive_processing $,$>>) -- -- set(implicitDirs) -- foreach(implicitDir ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}) -- list(APPEND implicitDirs -I ${implicitDir}) -- endforeach() -- -- add_custom_command( -- COMMENT Generate ASTNodeAPI.json -- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json -- DEPENDS clang-ast-dump clang-resource-headers -- COMMAND -- $ -- # Skip this in debug mode because parsing AST.h is too slow -- --skip-processing=${skip_expensive_processing} -- -I ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include -- -I ${CLANG_SOURCE_DIR}/include -- -I ${LLVM_BINARY_DIR}/tools/clang/include -- -I ${LLVM_BINARY_DIR}/include -- -I ${LLVM_SOURCE_DIR}/include -- ${implicitDirs} -- --json-output-path ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json -- ) -- -- add_custom_target(run-ast-api-dump-tool -- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json -- ) -- -- add_custom_command( -- COMMENT Generate NodeIntrospection.inc -- OUTPUT ${BINARY_INCLUDE_DIR}/NodeIntrospection.inc -- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json -- ${CMAKE_CURRENT_SOURCE_DIR}/DumpTool/generate_cxx_src_locs.py -- ${CMAKE_CURRENT_SOURCE_DIR}/EmptyNodeIntrospection.inc.in -- COMMAND -- ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/DumpTool/generate_cxx_src_locs.py -- --json-input-path ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json -- --output-file NodeIntrospection.inc -- --use-empty-implementation ${skip_expensive_processing} -- --empty-implementation -- "${CMAKE_CURRENT_SOURCE_DIR}/EmptyNodeIntrospection.inc.in" -- COMMAND -- ${CMAKE_COMMAND} -E copy_if_different -- ${CMAKE_CURRENT_BINARY_DIR}/NodeIntrospection.inc -- ${BINARY_INCLUDE_DIR}/NodeIntrospection.inc -- ) -- -- add_custom_target(run-ast-api-generate-tool -- DEPENDS -- ${BINARY_INCLUDE_DIR}/NodeIntrospection.inc -- ) --endif() -+#else() -+# # The generation of ASTNodeAPI.json takes a long time in a -+# # Debug build due to parsing AST.h. Disable the processing -+# # but setting CLANG_TOOLING_BUILD_AST_INTROSPECTION as an -+# # internal hidden setting to override. -+# # When the processing is disabled, a trivial/empty JSON -+# # file is generated by clang-ast-dump and generate_cxx_src_locs.py -+# # generates the same API, but with a trivial implementation. -+# option(CLANG_TOOLING_BUILD_AST_INTROSPECTION "Enable AST introspection" TRUE) -+# -+# set(skip_expensive_processing $,$>>) -+# -+# set(implicitDirs) -+# foreach(implicitDir ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}) -+# list(APPEND implicitDirs -I ${implicitDir}) -+# endforeach() -+# -+# add_custom_command( -+# COMMENT Generate ASTNodeAPI.json -+# OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json -+# DEPENDS clang-ast-dump clang-resource-headers -+# COMMAND -+# $ -+# # Skip this in debug mode because parsing AST.h is too slow -+# --skip-processing=${skip_expensive_processing} -+# -I ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include -+# -I ${CLANG_SOURCE_DIR}/include -+# -I ${LLVM_BINARY_DIR}/tools/clang/include -+# -I ${LLVM_BINARY_DIR}/include -+# -I ${LLVM_SOURCE_DIR}/include -+# ${implicitDirs} -+# --json-output-path ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json -+# ) -+# -+# add_custom_target(run-ast-api-dump-tool -+# DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json -+# ) -+# -+# add_custom_command( -+# COMMENT Generate NodeIntrospection.inc -+# OUTPUT ${BINARY_INCLUDE_DIR}/NodeIntrospection.inc -+# DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json -+# ${CMAKE_CURRENT_SOURCE_DIR}/DumpTool/generate_cxx_src_locs.py -+# ${CMAKE_CURRENT_SOURCE_DIR}/EmptyNodeIntrospection.inc.in -+# COMMAND -+# ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/DumpTool/generate_cxx_src_locs.py -+# --json-input-path ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json -+# --output-file NodeIntrospection.inc -+# --use-empty-implementation ${skip_expensive_processing} -+# --empty-implementation -+# "${CMAKE_CURRENT_SOURCE_DIR}/EmptyNodeIntrospection.inc.in" -+# COMMAND -+# ${CMAKE_COMMAND} -E copy_if_different -+# ${CMAKE_CURRENT_BINARY_DIR}/NodeIntrospection.inc -+# ${BINARY_INCLUDE_DIR}/NodeIntrospection.inc -+# ) -+# -+# add_custom_target(run-ast-api-generate-tool -+# DEPENDS -+# ${BINARY_INCLUDE_DIR}/NodeIntrospection.inc -+# ) -+#endif() - - add_clang_library(clangTooling - AllTUsExecution.cpp diff --git a/llvm/llvm_z_brl.patch b/llvm/llvm_z_brl.patch index 9cc8e329..8cd7f503 100644 --- a/llvm/llvm_z_brl.patch +++ b/llvm/llvm_z_brl.patch @@ -1,45 +1,75 @@ diff -Naur llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp LLVM_BLD/clang/lib/CodeGen/CodeGenFunction.cpp ---- llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp 2023-09-21 13:48:21.449069692 -0400 -+++ LLVM_BLD/clang/lib/CodeGen/CodeGenFunction.cpp 2023-09-21 12:28:58.551653328 -0400 -@@ -844,7 +844,7 @@ +--- llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp 2024-06-26 14:03:00.332946834 -0400 ++++ LLVM_BLD/clang/lib/CodeGen/CodeGenFunction.cpp 2024-06-26 12:24:45.693526308 -0400 +@@ -872,7 +872,7 @@ if (FuncGroups > 1) { - auto FuncName = llvm::makeArrayRef( - CurFn->getName().bytes_begin(), CurFn->getName().bytes_end()); + auto FuncName = llvm::ArrayRef(CurFn->getName().bytes_begin(), + CurFn->getName().bytes_end()); - auto Group = crc32(FuncName) % FuncGroups; + auto Group = brl_crc32(FuncName) % FuncGroups; if (Group != CGM.getCodeGenOpts().XRaySelectedFunctionGroup && !AlwaysXRayAttr) Fn->addFnAttr("function-instrument", "xray-never"); diff -Naur llvm-project/clang/lib/CodeGen/CodeGenModule.cpp LLVM_BLD/clang/lib/CodeGen/CodeGenModule.cpp ---- llvm-project/clang/lib/CodeGen/CodeGenModule.cpp 2023-09-21 13:48:21.449069692 -0400 -+++ LLVM_BLD/clang/lib/CodeGen/CodeGenModule.cpp 2023-09-21 12:28:58.563653124 -0400 -@@ -2927,7 +2927,7 @@ +--- llvm-project/clang/lib/CodeGen/CodeGenModule.cpp 2024-06-26 14:03:00.334946800 -0400 ++++ LLVM_BLD/clang/lib/CodeGen/CodeGenModule.cpp 2024-06-26 12:24:45.696526256 -0400 +@@ -3457,7 +3457,7 @@ auto NumGroups = getCodeGenOpts().ProfileTotalFunctionGroups; if (NumGroups > 1) { - auto Group = llvm::crc32(arrayRefFromStringRef(Fn->getName())) % NumGroups; + auto Group = llvm::brl_crc32(arrayRefFromStringRef(Fn->getName())) % NumGroups; if (Group != getCodeGenOpts().ProfileSelectedFunctionGroup) - return true; + return ProfileList::Skip; } +diff -Naur llvm-project/clang/lib/Driver/OffloadBundler.cpp LLVM_BLD/clang/lib/Driver/OffloadBundler.cpp +--- llvm-project/clang/lib/Driver/OffloadBundler.cpp 2024-06-26 14:03:00.380946011 -0400 ++++ LLVM_BLD/clang/lib/Driver/OffloadBundler.cpp 2024-06-26 12:24:45.697526239 -0400 +@@ -919,7 +919,7 @@ + ClangOffloadBundlerTimerGroup); + if (Verbose) + CompressTimer.startTimer(); +- llvm::compression::compress(CompressionFormat, BufferUint8, CompressedBuffer); ++ llvm::compression::brl_compress(CompressionFormat, BufferUint8, CompressedBuffer); + if (Verbose) + CompressTimer.stopTimer(); + +@@ -1006,7 +1006,7 @@ + + SmallVector DecompressedData; + StringRef CompressedData = Blob.substr(HeaderSize); +- if (llvm::Error DecompressionError = llvm::compression::decompress( ++ if (llvm::Error DecompressionError = llvm::compression::brl_decompress( + CompressionFormat, llvm::arrayRefFromStringRef(CompressedData), + DecompressedData, UncompressedSize)) + return createStringError(inconvertibleErrorCode(), diff -Naur llvm-project/clang/lib/Serialization/ASTReader.cpp LLVM_BLD/clang/lib/Serialization/ASTReader.cpp ---- llvm-project/clang/lib/Serialization/ASTReader.cpp 2023-09-21 13:48:21.601066693 -0400 -+++ LLVM_BLD/clang/lib/Serialization/ASTReader.cpp 2023-09-21 12:28:58.575652914 -0400 -@@ -1493,7 +1493,7 @@ +--- llvm-project/clang/lib/Serialization/ASTReader.cpp 2024-06-26 14:03:00.519943626 -0400 ++++ LLVM_BLD/clang/lib/Serialization/ASTReader.cpp 2024-06-26 12:24:45.702526153 -0400 +@@ -1575,7 +1575,7 @@ return nullptr; } - SmallVector Uncompressed; -- if (llvm::Error E = llvm::compression::zlib::uncompress( -+ if (llvm::Error E = llvm::compression::zlib::brl_uncompress( - llvm::arrayRefFromStringRef(Blob), Uncompressed, Record[0])) { + SmallVector Decompressed; +- if (llvm::Error E = llvm::compression::decompress( ++ if (llvm::Error E = llvm::compression::brl_decompress( + F, llvm::arrayRefFromStringRef(Blob), Decompressed, Record[0])) { Error("could not decompress embedded file contents: " + llvm::toString(std::move(E))); diff -Naur llvm-project/clang/lib/Serialization/ASTWriter.cpp LLVM_BLD/clang/lib/Serialization/ASTWriter.cpp ---- llvm-project/clang/lib/Serialization/ASTWriter.cpp 2023-09-21 13:48:21.605066613 -0400 -+++ LLVM_BLD/clang/lib/Serialization/ASTWriter.cpp 2023-09-21 12:28:58.587652707 -0400 -@@ -2002,7 +2002,7 @@ +--- llvm-project/clang/lib/Serialization/ASTWriter.cpp 2024-06-26 14:03:00.522943575 -0400 ++++ LLVM_BLD/clang/lib/Serialization/ASTWriter.cpp 2024-06-26 13:18:46.687031189 -0400 +@@ -2096,7 +2096,7 @@ // consumers will not want its contents. SmallVector CompressedBuffer; + if (llvm::compression::zstd::isAvailable()) { +- llvm::compression::zstd::compress( ++ llvm::compression::zstd::brl_compress( + llvm::arrayRefFromStringRef(Blob.drop_back(1)), CompressedBuffer, 9); + RecordDataType Record[] = {SM_SLOC_BUFFER_BLOB_COMPRESSED, Blob.size() - 1}; + Stream.EmitRecordWithBlob(SLocBufferBlobCompressedAbbrv, Record, +@@ -2104,7 +2104,7 @@ + return; + } if (llvm::compression::zlib::isAvailable()) { - llvm::compression::zlib::compress( + llvm::compression::zlib::brl_compress( @@ -47,8 +77,8 @@ diff -Naur llvm-project/clang/lib/Serialization/ASTWriter.cpp LLVM_BLD/clang/lib RecordDataType Record[] = {SM_SLOC_BUFFER_BLOB_COMPRESSED, Blob.size() - 1}; Stream.EmitRecordWithBlob(SLocBufferBlobCompressedAbbrv, Record, diff -Naur llvm-project/clang-tools-extra/clangd/index/Serialization.cpp LLVM_BLD/clang-tools-extra/clangd/index/Serialization.cpp ---- llvm-project/clang-tools-extra/clangd/index/Serialization.cpp 2023-09-21 13:48:20.817082157 -0400 -+++ LLVM_BLD/clang-tools-extra/clangd/index/Serialization.cpp 2023-09-21 12:28:58.599652501 -0400 +--- llvm-project/clang-tools-extra/clangd/index/Serialization.cpp 2024-06-26 14:03:06.594839470 -0400 ++++ LLVM_BLD/clang-tools-extra/clangd/index/Serialization.cpp 2024-06-26 12:24:45.706526084 -0400 @@ -192,7 +192,7 @@ } if (llvm::compression::zlib::isAvailable()) { @@ -62,59 +92,14 @@ diff -Naur llvm-project/clang-tools-extra/clangd/index/Serialization.cpp LLVM_BL return error("Bad stri table: uncompress {0} -> {1} bytes is implausible", R.rest().size(), UncompressedSize); -- if (llvm::Error E = llvm::compression::zlib::uncompress( -+ if (llvm::Error E = llvm::compression::zlib::brl_uncompress( +- if (llvm::Error E = llvm::compression::zlib::decompress( ++ if (llvm::Error E = llvm::compression::zlib::brl_decompress( llvm::arrayRefFromStringRef(R.rest()), UncompressedStorage, UncompressedSize)) return std::move(E); -diff -Naur llvm-project/lld/ELF/InputSection.cpp LLVM_BLD/lld/ELF/InputSection.cpp ---- llvm-project/lld/ELF/InputSection.cpp 2023-09-21 13:48:28.608928598 -0400 -+++ LLVM_BLD/lld/ELF/InputSection.cpp 2023-09-21 12:28:58.599652501 -0400 -@@ -118,7 +118,7 @@ - uncompressedBuf = bAlloc().Allocate(size); - } - -- if (Error e = compression::zlib::uncompress(rawData, uncompressedBuf, size)) -+ if (Error e = compression::zlib::brl_uncompress(rawData, uncompressedBuf, size)) - fatal(toString(this) + - ": uncompress failed: " + llvm::toString(std::move(e))); - rawData = makeArrayRef(uncompressedBuf, size); -@@ -1218,7 +1218,7 @@ - // to the buffer. - if (uncompressedSize >= 0) { - size_t size = uncompressedSize; -- if (Error e = compression::zlib::uncompress(rawData, buf, size)) -+ if (Error e = compression::zlib::brl_uncompress(rawData, buf, size)) - fatal(toString(this) + - ": uncompress failed: " + llvm::toString(std::move(e))); - uint8_t *bufEnd = buf + size; -diff -Naur llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp LLVM_BLD/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp ---- llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp 2023-09-21 13:48:29.388913241 -0400 -+++ LLVM_BLD/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp 2023-09-21 12:28:58.603652434 -0400 -@@ -430,7 +430,7 @@ - } - - static uint32_t calc_crc32(uint32_t init, const DataExtractor &data) { -- return llvm::crc32( -+ return llvm::brl_crc32( - init, llvm::makeArrayRef(data.GetDataStart(), data.GetByteSize())); - } - -diff -Naur llvm-project/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp LLVM_BLD/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp ---- llvm-project/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp 2023-09-21 13:48:29.392913165 -0400 -+++ LLVM_BLD/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp 2023-09-21 12:28:58.603652434 -0400 -@@ -166,7 +166,7 @@ - "Calculating module crc32 %s with size %" PRIu64 " KiB", - FileSpec(coff_obj.getFileName()).GetLastPathComponent().AsCString(), - static_cast(raw_data.size()) / 1024); -- gnu_debuglink_crc = llvm::crc32(0, llvm::arrayRefFromStringRef(raw_data)); -+ gnu_debuglink_crc = llvm::brl_crc32(0, llvm::arrayRefFromStringRef(raw_data)); - } - // Use 4 bytes of crc from the .gnu_debuglink section. - llvm::support::ulittle32_t data(gnu_debuglink_crc); -diff -Naur llvm-project/llvm/cmake/modules/FindZLIB.cmake LLVM_BLD/llvm/cmake/modules/FindZLIB.cmake ---- llvm-project/llvm/cmake/modules/FindZLIB.cmake 1969-12-31 19:00:00.000000000 -0500 -+++ LLVM_BLD/llvm/cmake/modules/FindZLIB.cmake 2023-09-21 12:28:58.607652362 -0400 +diff -Naur llvm-project/cmake/Modules/FindZLIB.cmake LLVM_BLD/cmake/Modules/FindZLIB.cmake +--- llvm-project/cmake/Modules/FindZLIB.cmake 1969-12-31 19:00:00.000000000 -0500 ++++ LLVM_BLD/cmake/Modules/FindZLIB.cmake 2024-06-26 12:24:45.706526084 -0400 @@ -0,0 +1,123 @@ +#.rst: +# FindZLIB @@ -239,10 +224,115 @@ diff -Naur llvm-project/llvm/cmake/modules/FindZLIB.cmake LLVM_BLD/llvm/cmake/mo + INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}") + endif() +endif() +diff -Naur llvm-project/compiler-rt/test/fuzzer/CompressedTest.cpp LLVM_BLD/compiler-rt/test/fuzzer/CompressedTest.cpp +--- llvm-project/compiler-rt/test/fuzzer/CompressedTest.cpp 2024-06-26 14:02:57.008003863 -0400 ++++ LLVM_BLD/compiler-rt/test/fuzzer/CompressedTest.cpp 2024-06-26 12:24:45.706526084 -0400 +@@ -8,7 +8,9 @@ + #include + #include + #include +-#include ++#define Z_PREFIX ++#define Z_PREFIX_STR "brl_" ++#include "zlib.h" + + // The fuzz target. + // Uncompress the data, crash on input starting with "FU". +diff -Naur llvm-project/lld/ELF/InputSection.cpp LLVM_BLD/lld/ELF/InputSection.cpp +--- llvm-project/lld/ELF/InputSection.cpp 2024-06-26 14:02:57.170001084 -0400 ++++ LLVM_BLD/lld/ELF/InputSection.cpp 2024-06-26 12:24:45.707526067 -0400 +@@ -114,7 +114,7 @@ + auto compressed = ArrayRef(sec.content_, sec.compressedSize) + .slice(sizeof(typename ELFT::Chdr)); + if (Error e = hdr->ch_type == ELFCOMPRESS_ZLIB +- ? compression::zlib::decompress(compressed, out, size) ++ ? compression::zlib::brl_decompress(compressed, out, size) + : compression::zstd::decompress(compressed, out, size)) + fatal(toString(&sec) + + ": decompress failed: " + llvm::toString(std::move(e))); +@@ -1189,7 +1189,7 @@ + .slice(sizeof(typename ELFT::Chdr)); + size_t size = this->size; + if (Error e = hdr->ch_type == ELFCOMPRESS_ZLIB +- ? compression::zlib::decompress(compressed, buf, size) ++ ? compression::zlib::brl_decompress(compressed, buf, size) + : compression::zstd::decompress(compressed, buf, size)) + fatal(toString(this) + + ": decompress failed: " + llvm::toString(std::move(e))); +diff -Naur llvm-project/lld/ELF/OutputSections.cpp LLVM_BLD/lld/ELF/OutputSections.cpp +--- llvm-project/lld/ELF/OutputSections.cpp 2024-06-26 14:02:57.170001084 -0400 ++++ LLVM_BLD/lld/ELF/OutputSections.cpp 2024-06-26 12:24:45.707526067 -0400 +@@ -24,10 +24,12 @@ + #if LLVM_ENABLE_ZLIB + // Avoid introducing max as a macro from Windows headers. + #define NOMINMAX +-#include ++#define Z_PREFIX ++#define Z_PREFIX_STR "brl_" ++#include "zlib.h" + #endif + #if LLVM_ENABLE_ZSTD +-#include ++#include "zstd.h" + #endif + + using namespace llvm; +diff -Naur llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp LLVM_BLD/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +--- llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp 2024-06-26 14:02:57.325998408 -0400 ++++ LLVM_BLD/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp 2024-06-26 12:24:45.711525998 -0400 +@@ -447,7 +447,7 @@ + } + + static uint32_t calc_crc32(uint32_t init, const DataExtractor &data) { +- return llvm::crc32(init, ++ return llvm::brl_crc32(init, + llvm::ArrayRef(data.GetDataStart(), data.GetByteSize())); + } + +diff -Naur llvm-project/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp LLVM_BLD/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +--- llvm-project/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp 2024-06-26 14:02:57.326998391 -0400 ++++ LLVM_BLD/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp 2024-06-26 12:24:45.716525912 -0400 +@@ -166,7 +166,7 @@ + "Calculating module crc32 %s with size %" PRIu64 " KiB", + FileSpec(coff_obj.getFileName()).GetFilename().AsCString(), + static_cast(raw_data.size()) / 1024); +- gnu_debuglink_crc = llvm::crc32(0, llvm::arrayRefFromStringRef(raw_data)); ++ gnu_debuglink_crc = llvm::brl_crc32(0, llvm::arrayRefFromStringRef(raw_data)); + } + // Use 4 bytes of crc from the .gnu_debuglink section. + llvm::support::ulittle32_t data(gnu_debuglink_crc); +diff -Naur llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp LLVM_BLD/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +--- llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp 2024-06-26 14:02:57.338998185 -0400 ++++ LLVM_BLD/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp 2024-06-26 12:24:45.719525860 -0400 +@@ -48,7 +48,9 @@ + #endif + + #if LLVM_ENABLE_ZLIB +-#include ++#define Z_PREFIX ++#define Z_PREFIX_STR "brl_" ++#include "zlib.h" + #endif + + using namespace lldb; +diff -Naur llvm-project/lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp LLVM_BLD/lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp +--- llvm-project/lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp 2024-06-26 14:02:57.344998083 -0400 ++++ LLVM_BLD/lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp 2024-06-26 12:24:45.722525809 -0400 +@@ -37,7 +37,9 @@ + #include + + #if LLVM_ENABLE_ZLIB +-#include ++#define Z_PREFIX ++#define Z_PREFIX_STR "brl_" ++#include "zlib.h" + #endif + + using namespace llvm; diff -Naur llvm-project/llvm/include/llvm/Support/Compression.h LLVM_BLD/llvm/include/llvm/Support/Compression.h ---- llvm-project/llvm/include/llvm/Support/Compression.h 2023-09-21 13:48:31.428873099 -0400 -+++ LLVM_BLD/llvm/include/llvm/Support/Compression.h 2023-09-21 12:28:58.607652362 -0400 -@@ -30,14 +30,14 @@ +--- llvm-project/llvm/include/llvm/Support/Compression.h 2024-06-26 14:02:57.603993639 -0400 ++++ LLVM_BLD/llvm/include/llvm/Support/Compression.h 2024-06-26 12:29:23.774756065 -0400 +@@ -40,14 +40,14 @@ bool isAvailable(); @@ -251,16 +341,16 @@ diff -Naur llvm-project/llvm/include/llvm/Support/Compression.h LLVM_BLD/llvm/in SmallVectorImpl &CompressedBuffer, int Level = DefaultCompression); --Error uncompress(ArrayRef Input, uint8_t *UncompressedBuffer, -+Error brl_uncompress(ArrayRef Input, uint8_t *UncompressedBuffer, +-Error decompress(ArrayRef Input, uint8_t *Output, ++Error brl_decompress(ArrayRef Input, uint8_t *Output, size_t &UncompressedSize); --Error uncompress(ArrayRef Input, -+Error brl_uncompress(ArrayRef Input, - SmallVectorImpl &UncompressedBuffer, +-Error decompress(ArrayRef Input, SmallVectorImpl &Output, ++Error brl_decompress(ArrayRef Input, SmallVectorImpl &Output, size_t UncompressedSize); -@@ -52,14 +52,14 @@ + } // End of namespace zlib +@@ -61,14 +61,14 @@ bool isAvailable(); @@ -269,18 +359,38 @@ diff -Naur llvm-project/llvm/include/llvm/Support/Compression.h LLVM_BLD/llvm/in SmallVectorImpl &CompressedBuffer, int Level = DefaultCompression); --Error uncompress(ArrayRef Input, uint8_t *UncompressedBuffer, -+Error brl_uncompress(ArrayRef Input, uint8_t *UncompressedBuffer, +-Error decompress(ArrayRef Input, uint8_t *Output, ++Error brl_decompress(ArrayRef Input, uint8_t *Output, size_t &UncompressedSize); --Error uncompress(ArrayRef Input, -+Error brl_uncompress(ArrayRef Input, - SmallVectorImpl &UncompressedBuffer, +-Error decompress(ArrayRef Input, SmallVectorImpl &Output, ++Error brl_decompress(ArrayRef Input, SmallVectorImpl &Output, size_t UncompressedSize); + } // End of namespace zstd +@@ -110,15 +110,15 @@ + + // Compress Input with the specified format P.Format. If Level is -1, use + // *::DefaultCompression for the format. +-void compress(Params P, ArrayRef Input, ++void brl_compress(Params P, ArrayRef Input, + SmallVectorImpl &Output); + + // Decompress Input. The uncompressed size must be available. +-Error decompress(DebugCompressionType T, ArrayRef Input, ++Error brl_decompress(DebugCompressionType T, ArrayRef Input, + uint8_t *Output, size_t UncompressedSize); +-Error decompress(Format F, ArrayRef Input, ++Error brl_decompress(Format F, ArrayRef Input, + SmallVectorImpl &Output, size_t UncompressedSize); +-Error decompress(DebugCompressionType T, ArrayRef Input, ++Error brl_decompress(DebugCompressionType T, ArrayRef Input, + SmallVectorImpl &Output, size_t UncompressedSize); + + } // End of namespace compression diff -Naur llvm-project/llvm/include/llvm/Support/CRC.h LLVM_BLD/llvm/include/llvm/Support/CRC.h ---- llvm-project/llvm/include/llvm/Support/CRC.h 2023-09-21 13:48:31.424873178 -0400 -+++ LLVM_BLD/llvm/include/llvm/Support/CRC.h 2023-09-21 12:28:58.607652362 -0400 +--- llvm-project/llvm/include/llvm/Support/CRC.h 2024-06-26 14:02:57.606993588 -0400 ++++ LLVM_BLD/llvm/include/llvm/Support/CRC.h 2024-06-26 12:24:45.723525792 -0400 @@ -19,11 +19,11 @@ template class ArrayRef; @@ -296,9 +406,9 @@ diff -Naur llvm-project/llvm/include/llvm/Support/CRC.h LLVM_BLD/llvm/include/ll // Class for computing the JamCRC. // diff -Naur llvm-project/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp LLVM_BLD/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp ---- llvm-project/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp 2023-09-21 13:48:31.652868690 -0400 -+++ LLVM_BLD/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp 2023-09-21 12:28:58.611652293 -0400 -@@ -263,7 +263,7 @@ +--- llvm-project/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp 2024-06-26 14:02:57.644992936 -0400 ++++ LLVM_BLD/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp 2024-06-26 12:24:45.725525757 -0400 +@@ -311,7 +311,7 @@ MemoryBuffer::getFileOrSTDIN(Path); if (!MB) return false; @@ -308,21 +418,21 @@ diff -Naur llvm-project/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp LLVM_BLD/llvm bool getGNUDebuglinkContents(const ObjectFile *Obj, std::string &DebugName, diff -Naur llvm-project/llvm/lib/MC/ELFObjectWriter.cpp LLVM_BLD/llvm/lib/MC/ELFObjectWriter.cpp ---- llvm-project/llvm/lib/MC/ELFObjectWriter.cpp 2023-09-21 13:48:31.704867668 -0400 -+++ LLVM_BLD/llvm/lib/MC/ELFObjectWriter.cpp 2023-09-21 12:28:58.611652293 -0400 -@@ -864,7 +864,7 @@ - - SmallVector Compressed; - const uint32_t ChType = ELF::ELFCOMPRESS_ZLIB; -- compression::zlib::compress( -+ compression::zlib::brl_compress( - makeArrayRef(reinterpret_cast(UncompressedData.data()), - UncompressedData.size()), - Compressed); +--- llvm-project/llvm/lib/MC/ELFObjectWriter.cpp 2024-06-26 14:02:57.654992765 -0400 ++++ LLVM_BLD/llvm/lib/MC/ELFObjectWriter.cpp 2024-06-26 12:24:45.727525722 -0400 +@@ -905,7 +905,7 @@ + ChType = ELF::ELFCOMPRESS_ZSTD; + break; + } +- compression::compress(compression::Params(CompressionType), Uncompressed, ++ compression::brl_compress(compression::Params(CompressionType), Uncompressed, + Compressed); + if (!maybeWriteCompression(ChType, UncompressedData.size(), Compressed, + Sec.getAlign())) { diff -Naur llvm-project/llvm/lib/ObjCopy/COFF/COFFObjcopy.cpp LLVM_BLD/llvm/lib/ObjCopy/COFF/COFFObjcopy.cpp ---- llvm-project/llvm/lib/ObjCopy/COFF/COFFObjcopy.cpp 2023-09-21 13:48:31.728867197 -0400 -+++ LLVM_BLD/llvm/lib/ObjCopy/COFF/COFFObjcopy.cpp 2023-09-21 12:28:58.611652293 -0400 -@@ -46,7 +46,7 @@ +--- llvm-project/llvm/lib/ObjCopy/COFF/COFFObjcopy.cpp 2024-06-26 14:02:57.659992679 -0400 ++++ LLVM_BLD/llvm/lib/ObjCopy/COFF/COFFObjcopy.cpp 2024-06-26 12:24:45.728525706 -0400 +@@ -47,7 +47,7 @@ if (!LinkTargetOrErr) return createFileError(File, LinkTargetOrErr.getError()); auto LinkTarget = std::move(*LinkTargetOrErr); @@ -332,53 +442,54 @@ diff -Naur llvm-project/llvm/lib/ObjCopy/COFF/COFFObjcopy.cpp LLVM_BLD/llvm/lib/ StringRef FileName = sys::path::filename(File); size_t CRCPos = alignTo(FileName.size() + 1, 4); diff -Naur llvm-project/llvm/lib/ObjCopy/ELF/ELFObject.cpp LLVM_BLD/llvm/lib/ObjCopy/ELF/ELFObject.cpp ---- llvm-project/llvm/lib/ObjCopy/ELF/ELFObject.cpp 2023-09-21 13:48:31.728867197 -0400 -+++ LLVM_BLD/llvm/lib/ObjCopy/ELF/ELFObject.cpp 2023-09-21 12:28:58.619652156 -0400 -@@ -439,7 +439,7 @@ - ArrayRef Compressed = - Sec.OriginalData.slice(sizeof(Elf_Chdr_Impl)); - SmallVector DecompressedContent; -- if (Error Err = compression::zlib::uncompress(Compressed, DecompressedContent, -+ if (Error Err = compression::zlib::brl_uncompress(Compressed, DecompressedContent, - static_cast(Sec.Size))) +--- llvm-project/llvm/lib/ObjCopy/ELF/ELFObject.cpp 2024-06-26 14:02:57.659992679 -0400 ++++ LLVM_BLD/llvm/lib/ObjCopy/ELF/ELFObject.cpp 2024-06-26 12:24:45.731525654 -0400 +@@ -465,7 +465,7 @@ + return createStringError(errc::invalid_argument, + "failed to decompress section '" + Sec.Name + + "': " + Reason); +- if (Error E = compression::decompress(Type, Compressed, Decompressed, ++ if (Error E = compression::brl_decompress(Type, Compressed, Decompressed, + static_cast(Sec.Size))) return createStringError(errc::invalid_argument, - "'" + Sec.Name + "': " + toString(std::move(Err))); -@@ -512,7 +512,7 @@ - DebugCompressionType CompressionType) + "failed to decompress section '" + Sec.Name + +@@ -543,7 +543,7 @@ + bool Is64Bits) : SectionBase(Sec), CompressionType(CompressionType), DecompressedSize(Sec.OriginalData.size()), DecompressedAlign(Sec.Align) { -- compression::zlib::compress(OriginalData, CompressedData); -+ compression::zlib::brl_compress(OriginalData, CompressedData); +- compression::compress(compression::Params(CompressionType), OriginalData, ++ compression::brl_compress(compression::Params(CompressionType), OriginalData, + CompressedData); - assert(CompressionType != DebugCompressionType::None); Flags |= ELF::SHF_COMPRESSED; diff -Naur llvm-project/llvm/lib/Object/Decompressor.cpp LLVM_BLD/llvm/lib/Object/Decompressor.cpp ---- llvm-project/llvm/lib/Object/Decompressor.cpp 2023-09-21 13:48:31.736867040 -0400 -+++ LLVM_BLD/llvm/lib/Object/Decompressor.cpp 2023-09-21 12:28:58.619652156 -0400 -@@ -57,6 +57,6 @@ - - Error Decompressor::decompress(MutableArrayRef Buffer) { - size_t Size = Buffer.size(); -- return compression::zlib::uncompress(arrayRefFromStringRef(SectionData), -+ return compression::zlib::brl_uncompress(arrayRefFromStringRef(SectionData), - Buffer.data(), Size); +--- llvm-project/llvm/lib/Object/Decompressor.cpp 2024-06-26 14:02:57.660992661 -0400 ++++ LLVM_BLD/llvm/lib/Object/Decompressor.cpp 2024-06-26 12:24:45.731525654 -0400 +@@ -64,7 +64,7 @@ + } + + Error Decompressor::decompress(MutableArrayRef Output) { +- return compression::decompress(CompressionType, ++ return compression::brl_decompress(CompressionType, + arrayRefFromStringRef(SectionData), + Output.data(), Output.size()); } diff -Naur llvm-project/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp LLVM_BLD/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp ---- llvm-project/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp 2023-09-21 13:48:31.752866725 -0400 -+++ LLVM_BLD/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp 2023-09-21 12:28:58.623652089 -0400 -@@ -129,7 +129,7 @@ +--- llvm-project/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp 2024-06-26 14:02:57.663992610 -0400 ++++ LLVM_BLD/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp 2024-06-26 12:24:45.733525620 -0400 +@@ -134,7 +134,7 @@ // Read compressed filenames. StringRef CompressedFilenames = Data.substr(0, CompressedLen); Data = Data.substr(CompressedLen); -- auto Err = compression::zlib::uncompress( -+ auto Err = compression::zlib::brl_uncompress( +- auto Err = compression::zlib::decompress( ++ auto Err = compression::zlib::brl_decompress( arrayRefFromStringRef(CompressedFilenames), StorageBuf, UncompressedLen); if (Err) { diff -Naur llvm-project/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp LLVM_BLD/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp ---- llvm-project/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp 2023-09-21 13:48:31.752866725 -0400 -+++ LLVM_BLD/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp 2023-09-21 12:28:58.623652089 -0400 -@@ -50,7 +50,7 @@ +--- llvm-project/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp 2024-06-26 14:02:57.663992610 -0400 ++++ LLVM_BLD/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp 2024-06-26 12:24:45.733525620 -0400 +@@ -51,7 +51,7 @@ bool doCompression = Compress && compression::zlib::isAvailable() && DoInstrProfNameCompression; if (doCompression) @@ -388,9 +499,18 @@ diff -Naur llvm-project/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp compression::zlib::BestSizeCompression); diff -Naur llvm-project/llvm/lib/ProfileData/InstrProf.cpp LLVM_BLD/llvm/lib/ProfileData/InstrProf.cpp ---- llvm-project/llvm/lib/ProfileData/InstrProf.cpp 2023-09-21 13:48:31.752866725 -0400 -+++ LLVM_BLD/llvm/lib/ProfileData/InstrProf.cpp 2023-09-21 12:28:58.623652089 -0400 -@@ -465,7 +465,7 @@ +--- llvm-project/llvm/lib/ProfileData/InstrProf.cpp 2024-06-26 14:02:57.662992628 -0400 ++++ LLVM_BLD/llvm/lib/ProfileData/InstrProf.cpp 2024-06-26 12:24:45.735525585 -0400 +@@ -486,7 +486,7 @@ + if (!llvm::compression::zlib::isAvailable()) + return make_error(instrprof_error::zlib_unavailable); + +- if (Error E = compression::zlib::decompress(ArrayRef(P, CompressedSize), ++ if (Error E = compression::zlib::brl_decompress(ArrayRef(P, CompressedSize), + UncompressedNameStrings, + UncompressedSize)) { + consumeError(std::move(E)); +@@ -601,7 +601,7 @@ } SmallVector CompressedNameStrings; @@ -399,31 +519,22 @@ diff -Naur llvm-project/llvm/lib/ProfileData/InstrProf.cpp LLVM_BLD/llvm/lib/Pro CompressedNameStrings, compression::zlib::BestSizeCompression); -@@ -506,7 +506,7 @@ - if (!llvm::compression::zlib::isAvailable()) - return make_error(instrprof_error::zlib_unavailable); - -- if (Error E = compression::zlib::uncompress( -+ if (Error E = compression::zlib::brl_uncompress( - makeArrayRef(P, CompressedSize), UncompressedNameStrings, - UncompressedSize)) { - consumeError(std::move(E)); diff -Naur llvm-project/llvm/lib/ProfileData/SampleProfReader.cpp LLVM_BLD/llvm/lib/ProfileData/SampleProfReader.cpp ---- llvm-project/llvm/lib/ProfileData/SampleProfReader.cpp 2023-09-21 13:48:31.752866725 -0400 -+++ LLVM_BLD/llvm/lib/ProfileData/SampleProfReader.cpp 2023-09-21 12:28:58.631651948 -0400 -@@ -882,7 +882,7 @@ +--- llvm-project/llvm/lib/ProfileData/SampleProfReader.cpp 2024-06-26 14:02:57.663992610 -0400 ++++ LLVM_BLD/llvm/lib/ProfileData/SampleProfReader.cpp 2024-06-26 12:24:45.736525568 -0400 +@@ -978,7 +978,7 @@ uint8_t *Buffer = Allocator.Allocate(DecompressBufSize); size_t UCSize = DecompressBufSize; -- llvm::Error E = compression::zlib::uncompress( -+ llvm::Error E = compression::zlib::brl_uncompress( - makeArrayRef(Data, *CompressSize), Buffer, UCSize); +- llvm::Error E = compression::zlib::decompress(ArrayRef(Data, *CompressSize), ++ llvm::Error E = compression::zlib::brl_decompress(ArrayRef(Data, *CompressSize), + Buffer, UCSize); if (E) return sampleprof_error::uncompress_failed; diff -Naur llvm-project/llvm/lib/ProfileData/SampleProfWriter.cpp LLVM_BLD/llvm/lib/ProfileData/SampleProfWriter.cpp ---- llvm-project/llvm/lib/ProfileData/SampleProfWriter.cpp 2023-09-21 13:48:31.752866725 -0400 -+++ LLVM_BLD/llvm/lib/ProfileData/SampleProfWriter.cpp 2023-09-21 12:28:58.631651948 -0400 -@@ -86,7 +86,7 @@ +--- llvm-project/llvm/lib/ProfileData/SampleProfWriter.cpp 2024-06-26 14:02:57.663992610 -0400 ++++ LLVM_BLD/llvm/lib/ProfileData/SampleProfWriter.cpp 2024-06-26 12:24:45.737525550 -0400 +@@ -185,7 +185,7 @@ return sampleprof_error::success; auto &OS = *OutputStream; SmallVector CompressedStrings; @@ -433,9 +544,9 @@ diff -Naur llvm-project/llvm/lib/ProfileData/SampleProfWriter.cpp LLVM_BLD/llvm/ compression::zlib::BestSizeCompression); encodeULEB128(UncompressedStrings.size(), OS); diff -Naur llvm-project/llvm/lib/Support/Compression.cpp LLVM_BLD/llvm/lib/Support/Compression.cpp ---- llvm-project/llvm/lib/Support/Compression.cpp 2023-09-21 13:48:31.768866410 -0400 -+++ LLVM_BLD/llvm/lib/Support/Compression.cpp 2023-09-21 13:47:02.454644841 -0400 -@@ -18,7 +18,9 @@ +--- llvm-project/llvm/lib/Support/Compression.cpp 2024-06-26 14:02:57.664992593 -0400 ++++ LLVM_BLD/llvm/lib/Support/Compression.cpp 2024-06-26 12:28:06.761074395 -0400 +@@ -18,10 +18,12 @@ #include "llvm/Support/Error.h" #include "llvm/Support/ErrorHandling.h" #if LLVM_ENABLE_ZLIB @@ -445,8 +556,69 @@ diff -Naur llvm-project/llvm/lib/Support/Compression.cpp LLVM_BLD/llvm/lib/Suppo +#include "zlib.h" #endif #if LLVM_ENABLE_ZSTD - #include -@@ -47,7 +49,7 @@ +-#include ++#include "zstd.h" + #endif + + using namespace llvm; +@@ -43,45 +45,45 @@ + llvm_unreachable(""); + } + +-void compression::compress(Params P, ArrayRef Input, ++void compression::brl_compress(Params P, ArrayRef Input, + SmallVectorImpl &Output) { + switch (P.format) { + case compression::Format::Zlib: +- zlib::compress(Input, Output, P.level); ++ zlib::brl_compress(Input, Output, P.level); + break; + case compression::Format::Zstd: +- zstd::compress(Input, Output, P.level); ++ zstd::brl_compress(Input, Output, P.level); + break; + } + } + +-Error compression::decompress(DebugCompressionType T, ArrayRef Input, ++Error compression::brl_decompress(DebugCompressionType T, ArrayRef Input, + uint8_t *Output, size_t UncompressedSize) { + switch (formatFor(T)) { + case compression::Format::Zlib: +- return zlib::decompress(Input, Output, UncompressedSize); ++ return zlib::brl_decompress(Input, Output, UncompressedSize); + case compression::Format::Zstd: +- return zstd::decompress(Input, Output, UncompressedSize); ++ return zstd::brl_decompress(Input, Output, UncompressedSize); + } + llvm_unreachable(""); + } + +-Error compression::decompress(compression::Format F, ArrayRef Input, ++Error compression::brl_decompress(compression::Format F, ArrayRef Input, + SmallVectorImpl &Output, + size_t UncompressedSize) { + switch (F) { + case compression::Format::Zlib: +- return zlib::decompress(Input, Output, UncompressedSize); ++ return zlib::brl_decompress(Input, Output, UncompressedSize); + case compression::Format::Zstd: +- return zstd::decompress(Input, Output, UncompressedSize); ++ return zstd::brl_decompress(Input, Output, UncompressedSize); + } + llvm_unreachable(""); + } + +-Error compression::decompress(DebugCompressionType T, ArrayRef Input, ++Error compression::brl_decompress(DebugCompressionType T, ArrayRef Input, + SmallVectorImpl &Output, + size_t UncompressedSize) { +- return decompress(formatFor(T), Input, Output, UncompressedSize); ++ return brl_decompress(formatFor(T), Input, Output, UncompressedSize); + } + + #if LLVM_ENABLE_ZLIB +@@ -104,7 +106,7 @@ bool zlib::isAvailable() { return true; } @@ -455,31 +627,30 @@ diff -Naur llvm-project/llvm/lib/Support/Compression.cpp LLVM_BLD/llvm/lib/Suppo SmallVectorImpl &CompressedBuffer, int Level) { unsigned long CompressedSize = ::compressBound(Input.size()); CompressedBuffer.resize_for_overwrite(CompressedSize); -@@ -63,7 +65,7 @@ +@@ -120,7 +122,7 @@ CompressedBuffer.truncate(CompressedSize); } --Error zlib::uncompress(ArrayRef Input, uint8_t *UncompressedBuffer, -+Error zlib::brl_uncompress(ArrayRef Input, uint8_t *UncompressedBuffer, +-Error zlib::decompress(ArrayRef Input, uint8_t *Output, ++Error zlib::brl_decompress(ArrayRef Input, uint8_t *Output, size_t &UncompressedSize) { - int Res = - ::uncompress((Bytef *)UncompressedBuffer, (uLongf *)&UncompressedSize, -@@ -76,12 +78,12 @@ + int Res = ::uncompress((Bytef *)Output, (uLongf *)&UncompressedSize, + (const Bytef *)Input.data(), Input.size()); +@@ -132,11 +134,11 @@ : Error::success(); } --Error zlib::uncompress(ArrayRef Input, -+Error zlib::brl_uncompress(ArrayRef Input, - SmallVectorImpl &UncompressedBuffer, +-Error zlib::decompress(ArrayRef Input, ++Error zlib::brl_decompress(ArrayRef Input, + SmallVectorImpl &Output, size_t UncompressedSize) { - UncompressedBuffer.resize_for_overwrite(UncompressedSize); - Error E = -- zlib::uncompress(Input, UncompressedBuffer.data(), UncompressedSize); -+ zlib::brl_uncompress(Input, UncompressedBuffer.data(), UncompressedSize); - if (UncompressedSize < UncompressedBuffer.size()) - UncompressedBuffer.truncate(UncompressedSize); + Output.resize_for_overwrite(UncompressedSize); +- Error E = zlib::decompress(Input, Output.data(), UncompressedSize); ++ Error E = zlib::brl_decompress(Input, Output.data(), UncompressedSize); + if (UncompressedSize < Output.size()) + Output.truncate(UncompressedSize); return E; -@@ -89,18 +91,18 @@ +@@ -144,18 +146,18 @@ #else bool zlib::isAvailable() { return false; } @@ -489,22 +660,22 @@ diff -Naur llvm-project/llvm/lib/Support/Compression.cpp LLVM_BLD/llvm/lib/Suppo - llvm_unreachable("zlib::compress is unavailable"); + llvm_unreachable("zlib::brl_compress is unavailable"); } --Error zlib::uncompress(ArrayRef Input, uint8_t *UncompressedBuffer, -+Error zlib::brl_uncompress(ArrayRef Input, uint8_t *UncompressedBuffer, +-Error zlib::decompress(ArrayRef Input, uint8_t *UncompressedBuffer, ++Error zlib::brl_decompress(ArrayRef Input, uint8_t *UncompressedBuffer, size_t &UncompressedSize) { -- llvm_unreachable("zlib::uncompress is unavailable"); -+ llvm_unreachable("zlib::brl_uncompress is unavailable"); +- llvm_unreachable("zlib::decompress is unavailable"); ++ llvm_unreachable("zlib::brl_decompress is unavailable"); } --Error zlib::uncompress(ArrayRef Input, -+Error zlib::brl_uncompress(ArrayRef Input, +-Error zlib::decompress(ArrayRef Input, ++Error zlib::brl_decompress(ArrayRef Input, SmallVectorImpl &UncompressedBuffer, size_t UncompressedSize) { -- llvm_unreachable("zlib::uncompress is unavailable"); -+ llvm_unreachable("zlib::brl_uncompress is unavailable"); +- llvm_unreachable("zlib::decompress is unavailable"); ++ llvm_unreachable("zlib::brl_decompress is unavailable"); } #endif -@@ -108,7 +110,7 @@ +@@ -163,7 +165,7 @@ bool zstd::isAvailable() { return true; } @@ -513,31 +684,30 @@ diff -Naur llvm-project/llvm/lib/Support/Compression.cpp LLVM_BLD/llvm/lib/Suppo SmallVectorImpl &CompressedBuffer, int Level) { unsigned long CompressedBufferSize = ::ZSTD_compressBound(Input.size()); CompressedBuffer.resize_for_overwrite(CompressedBufferSize); -@@ -124,7 +126,7 @@ +@@ -179,7 +181,7 @@ CompressedBuffer.truncate(CompressedSize); } --Error zstd::uncompress(ArrayRef Input, uint8_t *UncompressedBuffer, -+Error zstd::brl_uncompress(ArrayRef Input, uint8_t *UncompressedBuffer, +-Error zstd::decompress(ArrayRef Input, uint8_t *Output, ++Error zstd::brl_decompress(ArrayRef Input, uint8_t *Output, size_t &UncompressedSize) { - const size_t Res = - ::ZSTD_decompress(UncompressedBuffer, UncompressedSize, -@@ -138,12 +140,12 @@ + const size_t Res = ::ZSTD_decompress( + Output, UncompressedSize, (const uint8_t *)Input.data(), Input.size()); +@@ -192,11 +194,11 @@ : Error::success(); } --Error zstd::uncompress(ArrayRef Input, -+Error zstd::brl_uncompress(ArrayRef Input, - SmallVectorImpl &UncompressedBuffer, +-Error zstd::decompress(ArrayRef Input, ++Error zstd::brl_decompress(ArrayRef Input, + SmallVectorImpl &Output, size_t UncompressedSize) { - UncompressedBuffer.resize_for_overwrite(UncompressedSize); - Error E = -- zstd::uncompress(Input, UncompressedBuffer.data(), UncompressedSize); -+ zstd::brl_uncompress(Input, UncompressedBuffer.data(), UncompressedSize); - if (UncompressedSize < UncompressedBuffer.size()) - UncompressedBuffer.truncate(UncompressedSize); + Output.resize_for_overwrite(UncompressedSize); +- Error E = zstd::decompress(Input, Output.data(), UncompressedSize); ++ Error E = zstd::brl_decompress(Input, Output.data(), UncompressedSize); + if (UncompressedSize < Output.size()) + Output.truncate(UncompressedSize); return E; -@@ -151,17 +153,17 @@ +@@ -204,17 +206,17 @@ #else bool zstd::isAvailable() { return false; } @@ -547,23 +717,23 @@ diff -Naur llvm-project/llvm/lib/Support/Compression.cpp LLVM_BLD/llvm/lib/Suppo - llvm_unreachable("zstd::compress is unavailable"); + llvm_unreachable("zstd::brl_compress is unavailable"); } --Error zstd::uncompress(ArrayRef Input, uint8_t *UncompressedBuffer, -+Error zstd::brl_uncompress(ArrayRef Input, uint8_t *UncompressedBuffer, +-Error zstd::decompress(ArrayRef Input, uint8_t *Output, ++Error zstd::brl_decompress(ArrayRef Input, uint8_t *Output, size_t &UncompressedSize) { -- llvm_unreachable("zstd::uncompress is unavailable"); -+ llvm_unreachable("zstd::brl_uncompress is unavailable"); +- llvm_unreachable("zstd::decompress is unavailable"); ++ llvm_unreachable("zstd::brl_decompress is unavailable"); } --Error zstd::uncompress(ArrayRef Input, -+Error zstd::brl_uncompress(ArrayRef Input, - SmallVectorImpl &UncompressedBuffer, +-Error zstd::decompress(ArrayRef Input, ++Error zstd::brl_decompress(ArrayRef Input, + SmallVectorImpl &Output, size_t UncompressedSize) { -- llvm_unreachable("zstd::uncompress is unavailable"); -+ llvm_unreachable("zstd::brl_uncompress is unavailable"); +- llvm_unreachable("zstd::decompress is unavailable"); ++ llvm_unreachable("zstd::brl_decompress is unavailable"); } #endif diff -Naur llvm-project/llvm/lib/Support/CRC.cpp LLVM_BLD/llvm/lib/Support/CRC.cpp ---- llvm-project/llvm/lib/Support/CRC.cpp 2023-09-21 13:48:31.768866410 -0400 -+++ LLVM_BLD/llvm/lib/Support/CRC.cpp 2023-09-21 13:46:16.755572998 -0400 +--- llvm-project/llvm/lib/Support/CRC.cpp 2024-06-26 14:02:57.668992525 -0400 ++++ LLVM_BLD/llvm/lib/Support/CRC.cpp 2024-06-26 12:24:45.738525534 -0400 @@ -72,7 +72,7 @@ 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d}; @@ -573,7 +743,7 @@ diff -Naur llvm-project/llvm/lib/Support/CRC.cpp LLVM_BLD/llvm/lib/Support/CRC.c CRC ^= 0xFFFFFFFFU; for (uint8_t Byte : Data) { int TableIdx = (CRC ^ Byte) & 0xff; -@@ -83,8 +83,10 @@ +@@ -83,14 +83,16 @@ #else @@ -586,12 +756,19 @@ diff -Naur llvm-project/llvm/lib/Support/CRC.cpp LLVM_BLD/llvm/lib/Support/CRC.c // Zlib's crc32() only takes a 32-bit length, so we have to iterate for larger // sizes. One could use crc32_z() instead, but that's a recent (2017) addition // and may not be available on all systems. + do { + ArrayRef Slice = Data.take_front(UINT32_MAX); +- CRC = ::crc32(CRC, (const Bytef *)Slice.data(), (uInt)Slice.size()); ++ CRC = ::brl_crc32(CRC, (const Bytef *)Slice.data(), (uInt)Slice.size()); + Data = Data.drop_front(Slice.size()); + } while (Data.size() > 0); + return CRC; @@ -98,10 +100,10 @@ #endif -uint32_t llvm::crc32(ArrayRef Data) { return crc32(0, Data); } -+uint32_t llvm::brl_crc32(ArrayRef Data) { return brl_crc32(0, Data); } ++uint32_t llvm::brl_crc32(ArrayRef Data) { return crc32(0, Data); } void JamCRC::update(ArrayRef Data) { CRC ^= 0xFFFFFFFFU; // Undo CRC-32 Init. @@ -600,9 +777,9 @@ diff -Naur llvm-project/llvm/lib/Support/CRC.cpp LLVM_BLD/llvm/lib/Support/CRC.c CRC ^= 0xFFFFFFFFU; // Undo CRC-32 XorOut. } diff -Naur llvm-project/llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp LLVM_BLD/llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp ---- llvm-project/llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp 2023-09-21 13:48:40.380697188 -0400 -+++ LLVM_BLD/llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp 2023-09-21 12:28:58.635651880 -0400 -@@ -216,7 +216,7 @@ +--- llvm-project/llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp 2024-06-26 14:02:59.428962338 -0400 ++++ LLVM_BLD/llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp 2024-06-26 12:24:45.739525516 -0400 +@@ -237,7 +237,7 @@ /// See raw_ostream::write_impl. void write_impl(const char *Ptr, size_t Size) override { @@ -612,9 +789,9 @@ diff -Naur llvm-project/llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp LLVM_BLD/ll OS.write(Ptr, Size); } diff -Naur llvm-project/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp LLVM_BLD/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp ---- llvm-project/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp 2023-09-21 13:48:40.412696559 -0400 -+++ LLVM_BLD/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp 2023-09-21 12:28:58.639651811 -0400 -@@ -745,7 +745,7 @@ +--- llvm-project/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp 2024-06-26 14:02:59.433962252 -0400 ++++ LLVM_BLD/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp 2024-06-26 12:24:45.740525499 -0400 +@@ -730,7 +730,7 @@ return createFileError(Config.AddGnuDebugLink, DebugOrErr.getError()); auto Debug = std::move(*DebugOrErr); Config.GnuDebugLinkCRC32 = @@ -624,9 +801,9 @@ diff -Naur llvm-project/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp LLVM_BLD/llvm Config.SplitDWO = InputArgs.getLastArgValue(OBJCOPY_split_dwo); Config.SymbolsPrefix = InputArgs.getLastArgValue(OBJCOPY_prefix_symbols); diff -Naur llvm-project/llvm/unittests/Support/CompressionTest.cpp LLVM_BLD/llvm/unittests/Support/CompressionTest.cpp ---- llvm-project/llvm/unittests/Support/CompressionTest.cpp 2023-09-21 13:48:40.552693812 -0400 -+++ LLVM_BLD/llvm/unittests/Support/CompressionTest.cpp 2023-09-21 12:28:58.643651744 -0400 -@@ -26,16 +26,16 @@ +--- llvm-project/llvm/unittests/Support/CompressionTest.cpp 2024-06-26 14:02:59.457961841 -0400 ++++ LLVM_BLD/llvm/unittests/Support/CompressionTest.cpp 2024-06-26 12:24:45.741525482 -0400 +@@ -26,22 +26,22 @@ static void testZlibCompression(StringRef Input, int Level) { SmallVector Compressed; SmallVector Uncompressed; @@ -634,21 +811,38 @@ diff -Naur llvm-project/llvm/unittests/Support/CompressionTest.cpp LLVM_BLD/llvm + zlib::brl_compress(arrayRefFromStringRef(Input), Compressed, Level); // Check that uncompressed buffer is the same as original. -- Error E = zlib::uncompress(Compressed, Uncompressed, Input.size()); -+ Error E = zlib::brl_uncompress(Compressed, Uncompressed, Input.size()); - consumeError(std::move(E)); +- Error E = zlib::decompress(Compressed, Uncompressed, Input.size()); ++ Error E = zlib::brl_decompress(Compressed, Uncompressed, Input.size()); + EXPECT_FALSE(std::move(E)); + EXPECT_EQ(Input, toStringRef(Uncompressed)); +- // decompress with Z dispatches to zlib::decompress. +- E = compression::decompress(DebugCompressionType::Zlib, Compressed, ++ // decompress with Z dispatches to zlib::brl_decompress. ++ E = compression::brl_decompress(DebugCompressionType::Zlib, Compressed, + Uncompressed, Input.size()); + EXPECT_FALSE(std::move(E)); EXPECT_EQ(Input, toStringRef(Uncompressed)); + if (Input.size() > 0) { - // Uncompression fails if expected length is too short. -- E = zlib::uncompress(Compressed, Uncompressed, Input.size() - 1); -+ E = zlib::brl_uncompress(Compressed, Uncompressed, Input.size() - 1); + // Decompression fails if expected length is too short. +- E = zlib::decompress(Compressed, Uncompressed, Input.size() - 1); ++ E = zlib::brl_decompress(Compressed, Uncompressed, Input.size() - 1); EXPECT_EQ("zlib error: Z_BUF_ERROR", llvm::toString(std::move(E))); } } +@@ -79,7 +79,7 @@ + EXPECT_EQ(Input, toStringRef(Uncompressed)); + + // decompress with Zstd dispatches to zstd::decompress. +- E = compression::decompress(DebugCompressionType::Zstd, Compressed, ++ E = compression::brl_decompress(DebugCompressionType::Zstd, Compressed, + Uncompressed, Input.size()); + EXPECT_FALSE(std::move(E)); + EXPECT_EQ(Input, toStringRef(Uncompressed)); diff -Naur llvm-project/llvm/unittests/Support/CRCTest.cpp LLVM_BLD/llvm/unittests/Support/CRCTest.cpp ---- llvm-project/llvm/unittests/Support/CRCTest.cpp 2023-09-21 13:48:40.552693812 -0400 -+++ LLVM_BLD/llvm/unittests/Support/CRCTest.cpp 2023-09-21 12:28:58.643651744 -0400 +--- llvm-project/llvm/unittests/Support/CRCTest.cpp 2024-06-26 14:02:59.456961857 -0400 ++++ LLVM_BLD/llvm/unittests/Support/CRCTest.cpp 2024-06-26 12:24:45.741525482 -0400 @@ -20,12 +20,12 @@ namespace { @@ -681,8 +875,8 @@ diff -Naur llvm-project/llvm/unittests/Support/CRCTest.cpp LLVM_BLD/llvm/unittes // Test expectation generated with: // $ truncate --size=`echo 2^32-1+42 | bc` /tmp/foo // $ crc32 /tmp/foo -- EXPECT_EQ(0xE46F28FBU, llvm::crc32(makeArrayRef(TestData, TestSize))); -+ EXPECT_EQ(0xE46F28FBU, llvm::brl_crc32(makeArrayRef(TestData, TestSize))); +- EXPECT_EQ(0xE46F28FBU, llvm::crc32(ArrayRef(TestData, TestSize))); ++ EXPECT_EQ(0xE46F28FBU, llvm::brl_crc32(ArrayRef(TestData, TestSize))); free(TestData); } From 25c74f1e328c37d75b3afd84f893efacfed19304 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Wed, 26 Jun 2024 16:22:36 -0400 Subject: [PATCH 45/71] Update patches for OSL v1.13.10.0 --- osl/NOTES | 14 ++++ osl/osl.patch | 188 +++++++++++++++++++++++++++++++++----------------- 2 files changed, 138 insertions(+), 64 deletions(-) create mode 100644 osl/NOTES diff --git a/osl/NOTES b/osl/NOTES new file mode 100644 index 00000000..3d382335 --- /dev/null +++ b/osl/NOTES @@ -0,0 +1,14 @@ +For building OSL to work, it is necessary that the bundled clang (if a bundled +LLVM is in use) also work. Clang on Linux needs gcc headers, and will look in +multiple locations. If a location with an incomplete directory is found, that +will be problematic. + +Observed example: + +libgcc-14-dev directory was present on a system with gcc 13 as the compiler. +Clang reported it was selecting that directory rather than the 13-dev +directory, and subsequent builds were failing due to missing basic C++ headers. + +Solution was to remove the libgcc-14-dev directory (in the case prompting this +note, it apparently got pulled in to support emacs packages) + diff --git a/osl/osl.patch b/osl/osl.patch index 03d1ec66..b4b8cb8d 100644 --- a/osl/osl.patch +++ b/osl/osl.patch @@ -1,19 +1,34 @@ -diff -Naur OpenShadingLanguage/src/cmake/Config.cmake.in OpenShadingLanguage_BLD/src/cmake/Config.cmake.in ---- OpenShadingLanguage/src/cmake/Config.cmake.in 2023-09-20 21:22:54.885148544 -0400 -+++ OpenShadingLanguage_BLD/src/cmake/Config.cmake.in 2023-09-25 21:05:34.672936351 -0400 +diff -Naur OpenShadingLanguage/CMakeLists.txt OSL_BLD/CMakeLists.txt +--- OpenShadingLanguage/CMakeLists.txt 2024-06-26 16:05:10.530665518 -0400 ++++ OSL_BLD/CMakeLists.txt 2024-06-26 16:00:29.386207307 -0400 +@@ -15,6 +15,11 @@ + project (OSL VERSION ${OSL_VERSION} + LANGUAGES CXX C + HOMEPAGE_URL "https://github.com/AcademySoftwareFoundation/OpenShadingLanguage") ++ ++set(CMAKE_CXX_EXTENSIONS OFF) ++set(CMAKE_CXX_STANDARD 17) ++set(CMAKE_CXX_STANDARD_REQUIRED ON) ++ + set (PROJ_NAME ${PROJECT_NAME}) # short name + string (TOLOWER ${PROJ_NAME} PROJ_NAME_LOWER) # short name lower case + string (TOUPPER ${PROJ_NAME} PROJ_NAME_UPPER) # short name upper case +diff -Naur OpenShadingLanguage/src/cmake/Config.cmake.in OSL_BLD/src/cmake/Config.cmake.in +--- OpenShadingLanguage/src/cmake/Config.cmake.in 2024-06-26 16:05:10.532665479 -0400 ++++ OSL_BLD/src/cmake/Config.cmake.in 2024-06-26 16:00:29.386207307 -0400 @@ -8,7 +8,7 @@ # add here all the find_dependency() whenever switching to config based dependencies if (@OpenEXR_VERSION@ VERSION_GREATER_EQUAL 3.0) - find_dependency(Imath @Imath_VERSION@) -+ find_dependency(OpenEXR @OpenEXR_VERSION@) ++ find_dependency(OpenEXR @OpenEXR_VERSION@) elseif (@OpenEXR_VERSION@ VERSION_GREATER_EQUAL 2.4 AND @FOUND_OPENEXR_WITH_CONFIG@) find_dependency(IlmBase @OpenEXR_VERSION@) find_dependency(OpenEXR @OpenEXR_VERSION@) -diff -Naur OpenShadingLanguage/src/cmake/externalpackages.cmake OpenShadingLanguage_BLD/src/cmake/externalpackages.cmake ---- OpenShadingLanguage/src/cmake/externalpackages.cmake 2023-09-20 21:22:54.889148481 -0400 -+++ OpenShadingLanguage_BLD/src/cmake/externalpackages.cmake 2023-09-25 21:05:14.829265011 -0400 -@@ -49,11 +49,6 @@ +diff -Naur OpenShadingLanguage/src/cmake/externalpackages.cmake OSL_BLD/src/cmake/externalpackages.cmake +--- OpenShadingLanguage/src/cmake/externalpackages.cmake 2024-06-26 16:05:10.532665479 -0400 ++++ OSL_BLD/src/cmake/externalpackages.cmake 2024-06-26 16:00:29.387207292 -0400 +@@ -49,13 +49,6 @@ # Boost_VERSION, Boost_INCLUDE_DIRS, Boost_LIBRARY_DIRS, Boost_LIBRARIES. else () set (Boost_COMPONENTS filesystem system thread) @@ -21,13 +36,15 @@ diff -Naur OpenShadingLanguage/src/cmake/externalpackages.cmake OpenShadingLangu - # cmake output (e.g. boost 1.70.0, cmake <= 3.14). Specifically it fails - # to set the expected variables printed below. So until that's fixed - # force FindBoost.cmake to use the original brute force path. -- set (Boost_NO_BOOST_CMAKE ON) +- if (NOT DEFINED Boost_NO_BOOST_CMAKE) +- set (Boost_NO_BOOST_CMAKE ON) +- endif () checked_find_package (Boost REQUIRED VERSION_MIN 1.55 COMPONENTS ${Boost_COMPONENTS} -diff -Naur OpenShadingLanguage/src/cmake/flexbison.cmake OpenShadingLanguage_BLD/src/cmake/flexbison.cmake ---- OpenShadingLanguage/src/cmake/flexbison.cmake 2023-09-20 21:22:54.889148481 -0400 -+++ OpenShadingLanguage_BLD/src/cmake/flexbison.cmake 2023-09-25 21:05:14.829265011 -0400 +diff -Naur OpenShadingLanguage/src/cmake/flexbison.cmake OSL_BLD/src/cmake/flexbison.cmake +--- OpenShadingLanguage/src/cmake/flexbison.cmake 2024-06-26 16:05:10.532665479 -0400 ++++ OSL_BLD/src/cmake/flexbison.cmake 2024-06-26 16:00:29.387207292 -0400 @@ -27,6 +27,11 @@ DOC "path to the bison executable") endif() @@ -40,9 +57,29 @@ diff -Naur OpenShadingLanguage/src/cmake/flexbison.cmake OpenShadingLanguage_BLD checked_find_package (BISON 2.7 REQUIRED PRINT BISON_EXECUTABLE) checked_find_package (FLEX 2.3.35 REQUIRED -diff -Naur OpenShadingLanguage/src/cmake/modules/FindZLIB.cmake OpenShadingLanguage_BLD/src/cmake/modules/FindZLIB.cmake +diff -Naur OpenShadingLanguage/src/cmake/modules/FindLLVM.cmake OSL_BLD/src/cmake/modules/FindLLVM.cmake +--- OpenShadingLanguage/src/cmake/modules/FindLLVM.cmake 2024-06-26 16:05:10.532665479 -0400 ++++ OSL_BLD/src/cmake/modules/FindLLVM.cmake 2024-06-26 16:22:10.337491211 -0400 +@@ -128,7 +128,7 @@ + foreach (COMPONENT clangFrontend clangDriver clangSerialization + clangParse clangSema clangAnalysis clangAST + clangASTMatchers clangBasic clangEdit clangLex +- clangSupport) ++ clangSupport clangAPINotes) + find_library ( _CLANG_${COMPONENT}_LIBRARY + NAMES ${COMPONENT} + PATHS ${LLVM_LIB_DIR}) +@@ -156,6 +156,7 @@ + endif () + endif () + ++set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${CLANG_LIBRARIES}) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args (LLVM +diff -Naur OpenShadingLanguage/src/cmake/modules/FindZLIB.cmake OSL_BLD/src/cmake/modules/FindZLIB.cmake --- OpenShadingLanguage/src/cmake/modules/FindZLIB.cmake 1969-12-31 19:00:00.000000000 -0500 -+++ OpenShadingLanguage_BLD/src/cmake/modules/FindZLIB.cmake 2023-09-27 07:26:38.787393077 -0400 ++++ OSL_BLD/src/cmake/modules/FindZLIB.cmake 2024-06-26 16:00:29.387207292 -0400 @@ -0,0 +1,123 @@ +#.rst: +# FindZLIB @@ -167,102 +204,125 @@ diff -Naur OpenShadingLanguage/src/cmake/modules/FindZLIB.cmake OpenShadingLangu + INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}") + endif() +endif() -diff -Naur OpenShadingLanguage/src/liboslcomp/ast.cpp OpenShadingLanguage_BLD/src/liboslcomp/ast.cpp ---- OpenShadingLanguage/src/liboslcomp/ast.cpp 2023-09-20 21:22:54.897148354 -0400 -+++ OpenShadingLanguage_BLD/src/liboslcomp/ast.cpp 2023-09-25 21:05:14.829265011 -0400 -@@ -46,7 +46,7 @@ - for (int i = 0; i < ASTNode::_last_node; ++i) - if (node_counts[i] > 0) - Strutil::print("ASTNode type {:2}: {:5} (peak {:5})\n", i, -- node_counts[i], node_counts_peak[i]); -+ (int)node_counts[i], (int)node_counts_peak[i]); - }); - } // namespace - #endif +diff -Naur OpenShadingLanguage/src/liboslcomp/CMakeLists.txt OSL_BLD/src/liboslcomp/CMakeLists.txt +--- OpenShadingLanguage/src/liboslcomp/CMakeLists.txt 2024-06-26 16:05:10.536665401 -0400 ++++ OSL_BLD/src/liboslcomp/CMakeLists.txt 2024-06-26 16:00:29.387207292 -0400 +@@ -60,6 +60,7 @@ + SOVERSION ${SOVERSION} + OUTPUT_NAME ${local_lib}${OSL_LIBNAME_SUFFIX} + LINK_FLAGS ${link_flags} ++ CXX_STANDARD 17 + POSITION_INDEPENDENT_CODE ON + ) + diff -Naur OpenShadingLanguage/src/liboslexec/CMakeLists.txt OSL_BLD/src/liboslexec/CMakeLists.txt ---- OpenShadingLanguage/src/liboslexec/CMakeLists.txt 2023-09-27 10:07:27.042600776 -0400 -+++ OSL_BLD/src/liboslexec/CMakeLists.txt 2023-09-27 09:57:04.218992278 -0400 -@@ -553,6 +553,7 @@ +--- OpenShadingLanguage/src/liboslexec/CMakeLists.txt 2024-06-26 16:05:10.537665382 -0400 ++++ OSL_BLD/src/liboslexec/CMakeLists.txt 2024-06-26 16:02:50.189463356 -0400 +@@ -583,6 +583,7 @@ ${Boost_LIBRARIES} ${CMAKE_DL_LIBS} ${CLANG_LIBRARIES} ${LLVM_LIBRARIES} ${LLVM_LDFLAGS} ${LLVM_SYSTEM_LIBRARIES} -+ ${ZLIB_LIBRARIES} ++ ${ZLIB_LIBRARIES} ) target_compile_features (${local_lib} -@@ -583,17 +584,17 @@ +@@ -599,6 +600,7 @@ + VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} + SOVERSION ${SOVERSION} + OUTPUT_NAME ${local_lib}${OSL_LIBNAME_SUFFIX} ++ CXX_STANDARD 17 + LINK_FLAGS ${link_flags} + ) + +@@ -613,17 +615,17 @@ # Unit tests - if (OSL_BUILD_TESTS) + if (OSL_BUILD_TESTS AND BUILD_TESTING) add_executable (accum_test accum_test.cpp) - target_link_libraries (accum_test PRIVATE oslexec ${Boost_LIBRARIES} ${CMAKE_DL_LIBS}) -+ target_link_libraries (accum_test PRIVATE oslexec ${Boost_LIBRARIES} LLVMSupport ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS}) ++ target_link_libraries (accum_test PRIVATE oslexec ${Boost_LIBRARIES} ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS}) set_target_properties (accum_test PROPERTIES FOLDER "Unit Tests") add_test (unit_accum ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/accum_test) add_executable (dual_test dual_test.cpp) - target_link_libraries (dual_test PRIVATE OpenImageIO::OpenImageIO ${ILMBASE_LIBRARIES} ${Boost_LIBRARIES} ${CMAKE_DL_LIBS}) -+ target_link_libraries (dual_test PRIVATE OpenImageIO::OpenImageIO ${ILMBASE_LIBRARIES} ${Boost_LIBRARIES} LLVMSupport ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS}) ++ target_link_libraries (dual_test PRIVATE OpenImageIO::OpenImageIO ${ILMBASE_LIBRARIES} ${Boost_LIBRARIES} ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS}) set_target_properties (dual_test PROPERTIES FOLDER "Unit Tests") add_test (unit_dual ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/dual_test) add_executable (llvmutil_test llvmutil_test.cpp) - target_link_libraries (llvmutil_test PRIVATE oslexec ${Boost_LIBRARIES} ${CMAKE_DL_LIBS}) -+ target_link_libraries (llvmutil_test PRIVATE oslexec ${Boost_LIBRARIES} ${CMAKE_DL_LIBS} LLVMSupport ${ZLIB_LIBRARIES}) ++ target_link_libraries (llvmutil_test PRIVATE oslexec ${Boost_LIBRARIES} ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS}) set_target_properties (llvmutil_test PROPERTIES FOLDER "Unit Tests") add_test (unit_llvmutil ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/llvmutil_test) endif () +diff -Naur OpenShadingLanguage/src/liboslexec/llvm_util.cpp OSL_BLD/src/liboslexec/llvm_util.cpp +--- OpenShadingLanguage/src/liboslexec/llvm_util.cpp 2024-06-26 16:05:10.538665362 -0400 ++++ OSL_BLD/src/liboslexec/llvm_util.cpp 2024-06-26 16:04:03.078993987 -0400 +@@ -3266,12 +3266,6 @@ + } + } + +-bool +-LLVM_Util::is_type_array(llvm::Type* type) +-{ +- return type->isArrayTy(); +-} +- + llvm::Type* + LLVM_Util::type_array(llvm::Type* type, int n) + { diff -Naur OpenShadingLanguage/src/oslc/CMakeLists.txt OSL_BLD/src/oslc/CMakeLists.txt ---- OpenShadingLanguage/src/oslc/CMakeLists.txt 2023-09-27 10:07:27.023600875 -0400 -+++ OSL_BLD/src/oslc/CMakeLists.txt 2023-09-27 09:57:46.671744918 -0400 +--- OpenShadingLanguage/src/oslc/CMakeLists.txt 2024-06-26 16:05:10.542665284 -0400 ++++ OSL_BLD/src/oslc/CMakeLists.txt 2024-06-26 16:00:29.388207276 -0400 @@ -12,5 +12,5 @@ endif () add_executable ( oslc ${oslc_srcs} ) -target_link_libraries ( oslc PRIVATE oslcomp ${Boost_LIBRARIES} ${CMAKE_DL_LIBS}) -+target_link_libraries ( oslc PRIVATE oslcomp ${Boost_LIBRARIES} LLVMSupport ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS}) ++target_link_libraries ( oslc PRIVATE oslcomp ${Boost_LIBRARIES} ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS}) install_targets (oslc) diff -Naur OpenShadingLanguage/src/testrender/CMakeLists.txt OSL_BLD/src/testrender/CMakeLists.txt ---- OpenShadingLanguage/src/testrender/CMakeLists.txt 2023-09-27 10:07:27.074600609 -0400 -+++ OSL_BLD/src/testrender/CMakeLists.txt 2023-09-27 10:06:52.103783118 -0400 -@@ -61,7 +61,10 @@ +--- OpenShadingLanguage/src/testrender/CMakeLists.txt 2024-06-26 16:05:10.542665284 -0400 ++++ OSL_BLD/src/testrender/CMakeLists.txt 2024-06-26 16:00:29.388207276 -0400 +@@ -69,7 +69,10 @@ target_link_libraries (testrender PRIVATE oslexec oslquery - pugixml::pugixml) + pugixml::pugixml -+ LLVMSupport -+ ${ZLIB_LIBRARIES} -+ ) ++ LLVMSupport ++ ${ZLIB_LIBRARIES} ++ ) osl_optix_target (testrender) diff -Naur OpenShadingLanguage/src/testshade/CMakeLists.txt OSL_BLD/src/testshade/CMakeLists.txt ---- OpenShadingLanguage/src/testshade/CMakeLists.txt 2023-09-27 10:07:27.101600468 -0400 -+++ OSL_BLD/src/testshade/CMakeLists.txt 2023-09-27 10:04:10.260627826 -0400 -@@ -68,7 +68,7 @@ +--- OpenShadingLanguage/src/testshade/CMakeLists.txt 2024-06-26 16:05:10.543665265 -0400 ++++ OSL_BLD/src/testshade/CMakeLists.txt 2024-06-26 16:00:29.388207276 -0400 +@@ -79,7 +79,7 @@ target_link_libraries (testshade PRIVATE - oslexec oslquery) -+ oslexec oslquery LLVMSupport ${ZLIB_LIBRARIES}) - ++ oslexec oslquery LLVMSupport ${ZLIB_LIBRARIES}) install (TARGETS testshade RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) -@@ -85,7 +85,7 @@ - target_link_libraries (libtestshade - PRIVATE -- oslexec oslquery) -+ oslexec oslquery LLVMSupport ${ZLIB_LIBRARIES}) - set_target_properties (libtestshade PROPERTIES PREFIX "") +@@ -106,7 +106,7 @@ - install_targets ( libtestshade ) -@@ -95,7 +95,7 @@ - target_link_libraries (testshade_dso - PRIVATE - OpenImageIO::OpenImageIO -- ${Boost_LIBRARIES} ${CMAKE_DL_LIBS} ) -+ ${Boost_LIBRARIES} LLVMSupport ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS} ) - install (TARGETS testshade_dso RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) + target_link_libraries (libtestshade + PRIVATE +- oslexec oslquery) ++ oslexec oslquery LLVMSupport ${ZLIB_LIBRARIES}) + set_target_properties (libtestshade PROPERTIES PREFIX "") - osl_optix_target(testshade) + install_targets ( libtestshade ) +@@ -116,7 +116,7 @@ + target_link_libraries (testshade_dso + PRIVATE + OpenImageIO::OpenImageIO +- ${Boost_LIBRARIES} ${CMAKE_DL_LIBS} ) ++ ${Boost_LIBRARIES} ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS} ) + install (TARGETS testshade_dso RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) + osl_optix_target(libtestshade) + endif () From 0ed488b5ac91dd451d856ac2366d024e45036261 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Wed, 26 Jun 2024 16:36:19 -0400 Subject: [PATCH 46/71] Tweak to help Appleseed find Eigen --- appleseed/CMakeLists.txt | 1 + eigen/CMakeLists.txt | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/appleseed/CMakeLists.txt b/appleseed/CMakeLists.txt index b980be41..c26d56a3 100644 --- a/appleseed/CMakeLists.txt +++ b/appleseed/CMakeLists.txt @@ -19,6 +19,7 @@ if (ENABLE_APPLESEED) $<$:-DZ_PREFIX=ON> $<$:-DZ_PREFIX_STR=${Z_PREFIX_STR}> -DBOOST_ROOT=$<$:${CMAKE_BUNDLE_INSTALL_PREFIX}> + -DEigen3_ROOT=$<$:${CMAKE_NOBUNDLE_INSTALL_PREFIX}> -DEMBREE_ROOT=$<$:${CMAKE_BUNDLE_INSTALL_PREFIX}> -DISPC_ROOT=$<$:${CMAKE_BUNDLE_INSTALL_PREFIX}> -DTBB_ROOT=$<$:${CMAKE_BUNDLE_INSTALL_PREFIX}> diff --git a/eigen/CMakeLists.txt b/eigen/CMakeLists.txt index 0fa70d7a..c972c814 100644 --- a/eigen/CMakeLists.txt +++ b/eigen/CMakeLists.txt @@ -1,6 +1,8 @@ # Decide if we're using Eigen cad_enable(EIGEN "libbg;libbn;librt") +unset(ENGEN_BUNDLED CACHE) + if (NOT ENABLE_EIGEN AND NOT DISABLE_EIGEN) # https://eigen.tuxfamily.org/dox/TopicCMakeGuide.html @@ -49,6 +51,8 @@ if (ENABLE_EIGEN) TargetInstallDeps(EIGEN EIGEN_DEPENDS) + set(EIGEN_BUNDLED TRUE CACHE BOOL "Eigen bundle flag") + endif (ENABLE_EIGEN) # Local Variables: From 033d5e5b2ad00a67da699e1b97b98786fdaa8c01 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Wed, 26 Jun 2024 16:57:03 -0400 Subject: [PATCH 47/71] Add FindZLIB.cmake back into opennurbs CMake patch --- opennurbs/opennurbs_cmake.patch | 129 ++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) diff --git a/opennurbs/opennurbs_cmake.patch b/opennurbs/opennurbs_cmake.patch index 61ca51b4..fe47929a 100644 --- a/opennurbs/opennurbs_cmake.patch +++ b/opennurbs/opennurbs_cmake.patch @@ -1,3 +1,132 @@ +diff -Naur opennurbs/CMake/FindZLIB.cmake openNURBS/CMake/FindZLIB.cmake +--- opennurbs/CMake/FindZLIB.cmake 1969-12-31 19:00:00.000000000 -0500 ++++ openNURBS/CMake/FindZLIB.cmake 2023-09-09 14:43:08.576725794 -0400 +@@ -0,0 +1,123 @@ ++#.rst: ++# FindZLIB ++# -------- ++# ++# Find the native ZLIB includes and library. ++# ++# IMPORTED Targets ++# ^^^^^^^^^^^^^^^^ ++# ++# This module defines :prop_tgt:`IMPORTED` target ``ZLIB::ZLIB``, if ++# ZLIB has been found. ++# ++# Result Variables ++# ^^^^^^^^^^^^^^^^ ++# ++# This module defines the following variables: ++# ++# :: ++# ++# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc. ++# ZLIB_LIBRARIES - List of libraries when using zlib. ++# ZLIB_FOUND - True if zlib found. ++# ++# :: ++# ++# ZLIB_VERSION_STRING - The version of zlib found (x.y.z) ++# ZLIB_VERSION_MAJOR - The major version of zlib ++# ZLIB_VERSION_MINOR - The minor version of zlib ++# ZLIB_VERSION_PATCH - The patch version of zlib ++# ZLIB_VERSION_TWEAK - The tweak version of zlib ++# ++# Backward Compatibility ++# ^^^^^^^^^^^^^^^^^^^^^^ ++# ++# The following variable are provided for backward compatibility ++# ++# :: ++# ++# ZLIB_MAJOR_VERSION - The major version of zlib ++# ZLIB_MINOR_VERSION - The minor version of zlib ++# ZLIB_PATCH_VERSION - The patch version of zlib ++# ++# Hints ++# ^^^^^ ++# ++# A user may set ``ZLIB_ROOT`` to a zlib installation root to tell this ++# module where to look. ++ ++#============================================================================= ++# Copyright 2001-2011 Kitware, Inc. ++# ++# Distributed under the OSI-approved BSD License (the "License"); ++# see accompanying file Copyright.txt for details. ++# ++# This software is distributed WITHOUT ANY WARRANTY; without even the ++# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ++# See the License for more information. ++#============================================================================= ++# (To distribute this file outside of CMake, substitute the full ++# License text for the above reference.) ++ ++set(_ZLIB_SEARCHES) ++ ++# Search ZLIB_ROOT first if it is set. ++if(ZLIB_ROOT) ++ set(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH) ++ list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT) ++endif() ++ ++# Normal search. ++set(_ZLIB_SEARCH_NORMAL ++ PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]" ++ "$ENV{PROGRAMFILES}/zlib" ++ ) ++list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL) ++ ++set(ZLIB_NAMES z_brl z zlib zdll zlib1 zlibd zlibd1) ++ ++# Try each search configuration. ++foreach(search ${_ZLIB_SEARCHES}) ++ find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include) ++ find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib) ++endforeach() ++ ++mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR) ++ ++if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h") ++ file(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$") ++ ++ string(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}") ++ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}") ++ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}") ++ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}") ++ ++ # only append a TWEAK version if it exists: ++ set(ZLIB_VERSION_TWEAK "") ++ if( "${ZLIB_H}" MATCHES "ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)") ++ set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}") ++ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}") ++ endif() ++ ++ set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}") ++ set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}") ++ set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}") ++endif() ++ ++# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if ++# all listed variables are TRUE ++include(FindPackageHandleStandardArgs) ++FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR ++ VERSION_VAR ZLIB_VERSION_STRING) ++ ++if(ZLIB_FOUND) ++ set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) ++ set(ZLIB_LIBRARIES ${ZLIB_LIBRARY}) ++ ++ if(NOT TARGET ZLIB::ZLIB) ++ add_library(ZLIB::ZLIB UNKNOWN IMPORTED) ++ set_target_properties(ZLIB::ZLIB PROPERTIES ++ IMPORTED_LOCATION "${ZLIB_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}") ++ endif() ++endif() + + --- opennurbs/CMakeLists.txt 2024-06-25 16:29:10.288832430 -0400 +++ OPENNURBS_BLD/CMakeLists.txt 2024-06-25 16:28:29.525527195 -0400 @@ -2,15 +2,54 @@ From 896e27bd6e3c1193c511e81a4e002e484afe4df6 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Wed, 26 Jun 2024 17:02:51 -0400 Subject: [PATCH 48/71] Add missing STRCASECMP define to GDAL patch --- gdal/gdal.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gdal/gdal.patch b/gdal/gdal.patch index 59b83db5..88c33c3a 100644 --- a/gdal/gdal.patch +++ b/gdal/gdal.patch @@ -303,6 +303,23 @@ diff -Naurw gdal-3.6.3/cmake/modules/packages/FindZLIB.cmake gdal/cmake/modules/ + INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}") + endif() +endif() +diff -Naur gdal/gcore/gdal_priv.h GDAL_BLD/gcore/gdal_priv.h +--- gdal/gcore/gdal_priv.h 2024-06-26 17:01:06.199711566 -0400 ++++ GDAL_BLD/gcore/gdal_priv.h 2024-06-26 17:00:48.433037793 -0400 +@@ -96,6 +96,13 @@ + /* GDALMultiDomainMetadata */ + /************************************************************************/ + ++#if defined(_WIN32) ++#define STRCASECMP(a, b) (_stricmp(a, b)) ++#else ++/** Alias for strcasecmp() */ ++#define STRCASECMP(a, b) (strcasecmp(a, b)) ++#endif ++ + //! @cond Doxygen_Suppress + class CPL_DLL GDALMultiDomainMetadata + { diff -Naur gdal/gdal.cmake GDAL_BLD/gdal.cmake --- gdal/gdal.cmake 2024-06-25 09:56:45.660500506 -0400 +++ GDAL_BLD/gdal.cmake 2024-06-25 09:55:37.834206511 -0400 From 5d0ba73b59a6a8ac11457397866cd0ce849cad7f Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Wed, 26 Jun 2024 17:11:02 -0400 Subject: [PATCH 49/71] Update LLVM to v18.1.8 --- llvm/llvm-project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/llvm-project b/llvm/llvm-project index 8dfdcc7b..1daf978f 160000 --- a/llvm/llvm-project +++ b/llvm/llvm-project @@ -1 +1 @@ -Subproject commit 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a +Subproject commit 1daf978f2715ae657b852861d13760e9a5936f4c From 3d4f8f1e96c40b22a3d92b7a24eaf3711ad69463 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Wed, 26 Jun 2024 17:11:41 -0400 Subject: [PATCH 50/71] Update OSL to v1.13.10.0 --- osl/OpenShadingLanguage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osl/OpenShadingLanguage b/osl/OpenShadingLanguage index cbb0e281..1cb17d30 160000 --- a/osl/OpenShadingLanguage +++ b/osl/OpenShadingLanguage @@ -1 +1 @@ -Subproject commit cbb0e28159509db58ef7d2058db3acbdb2233703 +Subproject commit 1cb17d30922e68da5885ea4a105d6a282bd7dd16 From 0df2709eec4b144d90e218b8416d53a1b3c4517e Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Wed, 26 Jun 2024 17:11:59 -0400 Subject: [PATCH 51/71] Get latest appleseed changes This combination of LLVM, OSL and Appleseed compiles on Linux, and will build the art binary on Linux. However, art output is incorrect - it produces only a black silhouette with moss.g Going ahead and committing progress thus far since we seem to be relatively close to getting it working. --- appleseed/appleseed | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appleseed/appleseed b/appleseed/appleseed index a19d542c..05e66fd4 160000 --- a/appleseed/appleseed +++ b/appleseed/appleseed @@ -1 +1 @@ -Subproject commit a19d542c45f5f53ca2cb4d6799e1617ff5b68e93 +Subproject commit 05e66fd424c1311c52362247cff92b945ecf2021 From 4277666e7ae15479925b4a8b30f0500569185446 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Wed, 26 Jun 2024 21:09:46 -0400 Subject: [PATCH 52/71] Update ISPC to v1.24.0 and OSPRay to v3.1.0 --- embree/CMakeLists.txt | 4 ++++ ispc/ispc | 2 +- ispc/ispc.patch | 23 ++++++++++++----------- ospray/ospray | 2 +- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/embree/CMakeLists.txt b/embree/CMakeLists.txt index 58acec7f..99fee60f 100644 --- a/embree/CMakeLists.txt +++ b/embree/CMakeLists.txt @@ -39,6 +39,10 @@ if (ENABLE_EMBREE) ) TargetInstallDeps(EMBREE EMBREE_DEPENDS) + # ISPC use is conditional so it's not (currently) part of the deps file + if (USE_OSPRAY AND TARGET ISPC_BLD) + ExternalProject_Add_stepdependencies(EMBREE_BLD configure ISPC_BLD-install) + endif (USE_OSPRAY AND TARGET ISPC_BLD) # Copy the license into position in CMAKE_BUNDLE_INSTALL_PREFIX configure_file( diff --git a/ispc/ispc b/ispc/ispc index bd2c42d4..d394222a 160000 --- a/ispc/ispc +++ b/ispc/ispc @@ -1 +1 @@ -Subproject commit bd2c42d42e0cc3da1baf92160b82d4dc820a02ee +Subproject commit d394222aef59e4759b06e39ec160e4aba6ee5f40 diff --git a/ispc/ispc.patch b/ispc/ispc.patch index 3466c94a..10f0d2f3 100644 --- a/ispc/ispc.patch +++ b/ispc/ispc.patch @@ -126,8 +126,8 @@ diff -Naur ispc/cmake/FindZLIB.cmake ISPC_BLD/cmake/FindZLIB.cmake + endif() +endif() diff -Naur ispc/CMakeLists.txt ISPC_BLD/CMakeLists.txt ---- ispc/CMakeLists.txt 2023-12-21 14:05:10.132040601 -0500 -+++ ISPC_BLD/CMakeLists.txt 2023-12-21 14:06:37.898556691 -0500 +--- ispc/CMakeLists.txt 2024-06-26 20:46:06.003030179 -0400 ++++ ISPC_BLD/CMakeLists.txt 2024-06-26 20:52:51.978011242 -0400 @@ -265,6 +265,7 @@ endif() @@ -136,27 +136,28 @@ diff -Naur ispc/CMakeLists.txt ISPC_BLD/CMakeLists.txt list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/ispcrt/cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FixWindowsPath.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindLLVM.cmake) -@@ -626,6 +627,10 @@ - target_link_libraries(${PROJECT_NAME} "-Wl,--start-group") +@@ -712,6 +713,10 @@ + list(APPEND LINK_LIBRARIES "-Wl,--start-group") endif() +# Link against zlib +find_package(ZLIB) -+target_link_libraries(${PROJECT_NAME} ${ZLIB_LIBRARIES}) ++list(APPEND LINK_LIBRARIES ${ZLIB_LIBRARIES}) + # Link against Clang libraries foreach(clangLib ${CLANG_LIBRARY_LIST}) # Preferred way to build ISPC is to link it with individual clang static -@@ -676,7 +681,11 @@ +@@ -762,7 +767,12 @@ # but it contains both libform.so and libcurses.so. # We need libcurses.so only, so exclude libform.so from the list. list(FILTER CURSES_LIBRARIES EXCLUDE REGEX ".*libform.*") -- target_link_libraries(${PROJECT_NAME} pthread ${CURSES_LIBRARIES}) +- list(APPEND LINK_LIBRARIES pthread ${CURSES_LIBRARIES}) ++ list(APPEND LINK_LIBRARIES pthread) + if (CURSES_NCURSES_LIBRARY) -+ target_link_libraries(${PROJECT_NAME} pthread ${CURSES_NCURSES_LIBRARY}) -+ elseif (CURSES_LIBRARIES) -+ target_link_libraries(${PROJECT_NAME} pthread ${CURSES_LIBRARIES}) -+ endif (CURSES_NCURSES_LIBRARY) ++ list(APPEND LINK_LIBRARIES ${CURSES_NCURSES_LIBRARY}) ++ elseif (CURSES_NCURSES_LIBRARY) ++ list(APPEND LINK_LIBRARIES ${CURSES_LIBRARIES}) ++ endif () endif() endif() diff --git a/ospray/ospray b/ospray/ospray index b34af0bb..f9790e2c 160000 --- a/ospray/ospray +++ b/ospray/ospray @@ -1 +1 @@ -Subproject commit b34af0bbda7371777e5979d5434150b0d5701e70 +Subproject commit f9790e2c241024b71f7b330c461527a3c016d076 From c6ef344ce5a67e1556a223ff1247339c363101bc Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Thu, 27 Jun 2024 14:49:37 -0400 Subject: [PATCH 53/71] Missed a crc32 in the llvm_z_brl patch --- llvm/llvm_z_brl.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/llvm_z_brl.patch b/llvm/llvm_z_brl.patch index 8cd7f503..d59fd5e9 100644 --- a/llvm/llvm_z_brl.patch +++ b/llvm/llvm_z_brl.patch @@ -768,7 +768,7 @@ diff -Naur llvm-project/llvm/lib/Support/CRC.cpp LLVM_BLD/llvm/lib/Support/CRC.c #endif -uint32_t llvm::crc32(ArrayRef Data) { return crc32(0, Data); } -+uint32_t llvm::brl_crc32(ArrayRef Data) { return crc32(0, Data); } ++uint32_t llvm::brl_crc32(ArrayRef Data) { return brl_crc32(0, Data); } void JamCRC::update(ArrayRef Data) { CRC ^= 0xFFFFFFFFU; // Undo CRC-32 Init. From bc9516ba98182c383704295cbc274835d8d34bff Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Wed, 26 Jun 2024 21:11:32 -0400 Subject: [PATCH 54/71] Remove poly2tri - should be superceded in BRL-CAD by detria --- .gitmodules | 5 - dependencies.cmake | 4 - poly2tri/CMakeLists.txt | 51 - poly2tri/README | 23 - poly2tri/poly2tri | 1 - poly2tri/poly2tri.deps | 2 - poly2tri/poly2tri.patch | 5365 --------------------------------------- 7 files changed, 5451 deletions(-) delete mode 100644 poly2tri/CMakeLists.txt delete mode 100644 poly2tri/README delete mode 160000 poly2tri/poly2tri delete mode 100644 poly2tri/poly2tri.deps delete mode 100644 poly2tri/poly2tri.patch diff --git a/.gitmodules b/.gitmodules index d5a3e347..c80d80ba 100644 --- a/.gitmodules +++ b/.gitmodules @@ -116,11 +116,6 @@ path = utahrle/utahrle url = https://github.com/BRL-CAD/utahrle ignore = dirty -[submodule "poly2tri/poly2tri"] - path = poly2tri/poly2tri - url = https://github.com/BRL-CAD/poly2tri - branch = RELEASE - ignore = dirty [submodule "tk/tk"] path = tk/tk url = https://github.com/BRL-CAD/tk diff --git a/dependencies.cmake b/dependencies.cmake index 59a53f73..37e7225e 100644 --- a/dependencies.cmake +++ b/dependencies.cmake @@ -243,10 +243,6 @@ add_project(opennurbs GROUPS "BRLCAD") # https://github.com/starseeker/osmesa add_project(osmesa GROUPS "BRLCAD") -# Poly2Tri - constrained Delaunay triangulation -# https://github.com/jhasse/poly2tri -add_project(poly2tri GROUPS "BRLCAD") - # Geogram - a programming library with geometric algorithms # https://github.com/BrunoLevy/geogram add_project(geogram GROUPS "BRLCAD_EXTRA") diff --git a/poly2tri/CMakeLists.txt b/poly2tri/CMakeLists.txt deleted file mode 100644 index 1bf5f0cc..00000000 --- a/poly2tri/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -cad_enable(POLY2TRI "libbg") - -# System poly2tri versions won't do what we need, -# but we're not set up to functionally test for that -# right now, so just build it. - -if (USE_BRLCAD AND NOT DISABLE_POLY2TRI) - - git_submodule_init(poly2tri CMakeLists.txt) - - TargetDeps(POLY2TRI) - - ExternalProject_Add(POLY2TRI_BLD - URL "${CMAKE_CURRENT_SOURCE_DIR}/poly2tri" - BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS} - PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/poly2tri.patch - CMAKE_ARGS - ${BUILD_TYPE_SPECIFIER} - -DBIN_DIR=${BIN_DIR} - -DLIB_DIR=${LIB_DIR} - -DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS} - -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -DCMAKE_INSTALL_PREFIX=${CMAKE_BUNDLE_INSTALL_PREFIX} - -DCMAKE_INSTALL_LIBDIR:PATH=${LIB_DIR} - -DCMAKE_INSTALL_RPATH=${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR} - LOG_CONFIGURE ${EXT_BUILD_QUIET} - LOG_BUILD ${EXT_BUILD_QUIET} - LOG_INSTALL ${EXT_BUILD_QUIET} - LOG_OUTPUT_ON_FAILURE ${EXT_BUILD_QUIET} - STEP_TARGETS install - ) - - TargetInstallDeps(POLY2TRI POLY2TRI_DEPENDS) - - # Copy the license into position in CMAKE_BUNDLE_INSTALL_PREFIX - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/poly2tri/LICENSE - ${DOC_LICENSE_DIR}/poly2tri.txt - COPYONLY - ) - -endif (USE_BRLCAD AND NOT DISABLE_POLY2TRI) - -# Local Variables: -# tab-width: 8 -# mode: cmake -# indent-tabs-mode: t -# End: -# ex: shiftwidth=2 tabstop=8 - diff --git a/poly2tri/README b/poly2tri/README deleted file mode 100644 index f881c653..00000000 --- a/poly2tri/README +++ /dev/null @@ -1,23 +0,0 @@ -Note: our poly2tri patches deliberately don't use some of the newer logic from -the upstream - observed behavior is that it doesn't do as well with our NURBS -facetizations, although at this time it isn't clear why. - -In many ways this really should be embedded in BRL-CAD as part of libbg - we -need to use a non-vanilla version of poly2tri because it gives better results -when facetizing our BRep faces, but libbg does have an API that this should -be hiding behind. If we can achieve that than we can just embed our custom -poly2tri - however, right now libbrep also uses poly2tri directly for its -fast facetize routine (it skips watertight processing logic, but it is also -MUCH faster and is the default draw -m1 visualization for NURBS.) Because -its use in libbrep is performance critical, any move to migrate the logic there -to use libbg's API instead will have to be done very carefully. - -It's not immediately clear how hard it would be to functionally test for a -poly2tri we can use - the upstream "succeeds" in the sense that it runs, but -its outputs are unsatisfactory. If we didn't need to use us poly2tri as a -library in two places right now this would be a slam-dunk for embedding, -but since we do we're more or less stuck with this as an external until we -can sort out getting it properly under libbg. - -Because a system version is both unsuitable and not (necessarily) trivial to -test for, we simply force this on regardless. diff --git a/poly2tri/poly2tri b/poly2tri/poly2tri deleted file mode 160000 index 81612cb1..00000000 --- a/poly2tri/poly2tri +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 81612cb108b54c14c695808f494f432990b279fd diff --git a/poly2tri/poly2tri.deps b/poly2tri/poly2tri.deps deleted file mode 100644 index ecdeab5f..00000000 --- a/poly2tri/poly2tri.deps +++ /dev/null @@ -1,2 +0,0 @@ -PATCH - diff --git a/poly2tri/poly2tri.patch b/poly2tri/poly2tri.patch deleted file mode 100644 index 29d51960..00000000 --- a/poly2tri/poly2tri.patch +++ /dev/null @@ -1,5365 +0,0 @@ -diff -Naur poly2tri.orig/CMakeLists.txt POLY2TRI_BLD/CMakeLists.txt ---- poly2tri.orig/CMakeLists.txt 2023-09-17 14:48:01.014182570 -0400 -+++ POLY2TRI_BLD/CMakeLists.txt 2023-09-17 14:48:33.341620451 -0400 -@@ -1,28 +1,136 @@ --cmake_minimum_required(VERSION 3.12) -- --project(poly2tri LANGUAGES CXX) --set(CMAKE_CXX_STANDARD 14) -- --option(P2T_BUILD_TESTS "Build tests" OFF) --option(P2T_BUILD_TESTBED "Build the testbed application" OFF) -- --file(GLOB SOURCES poly2tri/common/*.cc poly2tri/sweep/*.cc) --file(GLOB HEADERS poly2tri/*.h poly2tri/common/*.h poly2tri/sweep/*.h) --add_library(poly2tri ${SOURCES} ${HEADERS}) --target_include_directories(poly2tri INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -- --get_target_property(poly2tri_target_type poly2tri TYPE) --if(poly2tri_target_type STREQUAL SHARED_LIBRARY) -- target_compile_definitions(poly2tri PRIVATE P2T_SHARED_EXPORTS) --else() -- target_compile_definitions(poly2tri PUBLIC P2T_STATIC_EXPORTS) --endif() -- --if(P2T_BUILD_TESTS) -- enable_testing() -- add_subdirectory(unittest) --endif() -- --if(P2T_BUILD_TESTBED) -- add_subdirectory(testbed) --endif() -+# C M A K E L I S T S . T X T -+# BRL-CAD -+# -+# Copyright (c) 2020 United States Government as represented by -+# the U.S. Army Research Laboratory. -+# -+# Redistribution and use in source and binary forms, with or without -+# modification, are permitted provided that the following conditions -+# are met: -+# -+# 1. Redistributions of source code must retain the above copyright -+# notice, this list of conditions and the following disclaimer. -+# -+# 2. Redistributions in binary form must reproduce the above -+# copyright notice, this list of conditions and the following -+# disclaimer in the documentation and/or other materials provided -+# with the distribution. -+# -+# 3. The name of the author may not be used to endorse or promote -+# products derived from this software without specific prior written -+# permission. -+# -+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -+# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -+# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+# -+# Build file for poly2tri (above license applies to only this file - -+# poly2tri is convered by its own license.) -+### -+ -+# Minimum required version of CMake -+cmake_minimum_required(VERSION 3.18) -+ -+# Set CMake project name -+project(P2T) -+ -+# Testing option -+option(P2T_TESTS "Build libp2t tests" OFF) -+mark_as_advanced(P2T_TESTS) -+if (P2T_TESTS) -+ include(CTest) -+ enable_testing() -+endif (P2T_TESTS) -+ -+include_directories( -+ ${CMAKE_CURRENT_SOURCE_DIR} -+ ) -+ -+if (NOT DEFINED BIN_DIR) -+ set (BIN_DIR bin) -+endif (NOT DEFINED BIN_DIR) -+ -+if (NOT DEFINED LIB_DIR) -+ set (LIB_DIR lib) -+endif (NOT DEFINED LIB_DIR) -+ -+if (NOT DEFINED INCLUDE_DIR) -+ set (INCLUDE_DIR include) -+endif (NOT DEFINED INCLUDE_DIR) -+ -+if (NOT DEFINED BUILD_SHARED_LIBS) -+ set(BUILD_SHARED_LIBS ON) -+endif (NOT DEFINED BUILD_SHARED_LIBS) -+ -+if (NOT DEFINED BUILD_STATIC_LIBS) -+ set(BUILD_STATIC_LIBS OFF) -+endif (NOT DEFINED BUILD_STATIC_LIBS) -+ -+include(CheckLibraryExists) -+check_library_exists(m cos "" HAVE_M_LIBRARY) -+if (HAVE_M_LIBRARY) -+ set(M_LIBRARY m) -+endif (HAVE_M_LIBRARY) -+ -+set(SWEEP_HDRS -+ poly2tri/sweep/cdt.h -+ poly2tri/sweep/advancing_front.h -+ poly2tri/sweep/sweep.h -+ poly2tri/sweep/sweep_context.h -+ ) -+install(FILES ${SWEEP_HDRS} DESTINATION ${INCLUDE_DIR}/poly2tri/sweep) -+install(FILES poly2tri/poly2tri.h DESTINATION ${INCLUDE_DIR}/poly2tri) -+install(FILES poly2tri/common/shapes.h DESTINATION ${INCLUDE_DIR}/poly2tri/common) -+install(FILES poly2tri/common/dll_symbol.h DESTINATION ${INCLUDE_DIR}/poly2tri/common) -+ -+set(SOURCES -+ poly2tri/common/shapes.cc -+ poly2tri/sweep/advancing_front.cc -+ poly2tri/sweep/cdt.cc -+ poly2tri/sweep/sweep_context.cc -+ poly2tri/sweep/sweep.cc -+ ) -+ -+add_definitions("-DP2T_NO_GLFW") -+ -+if (BUILD_SHARED_LIBS) -+ add_library(poly2tri ${SOURCES}) -+ target_link_libraries(poly2tri ${M_LIBRARY}) -+ if (MSVC) -+ set_target_properties(poly2tri PROPERTIES DEFINE_SYMBOL P2T_BUILD_DLL) -+ set_property(TARGET poly2tri APPEND PROPERTY COMPILE_DEFINITIONS "P2T_DLL_EXPORTS") -+ endif (MSVC) -+ install(TARGETS poly2tri -+ RUNTIME DESTINATION ${BIN_DIR} -+ LIBRARY DESTINATION ${LIB_DIR} -+ ARCHIVE DESTINATION ${LIB_DIR}) -+endif (BUILD_SHARED_LIBS) -+ -+if (BUILD_STATIC_LIBS) -+ add_library(poly2tri-static STATIC ${SOURCES}) -+ if (MSVC) -+ # msvc does not append 'lib' - do it here to have consistent name -+ set_target_properties(poly2tri-static PROPERTIES PREFIX "lib") -+ else(MSVC) -+ set_target_properties(poly2tri-static PROPERTIES OUTPUT_NAME poly2tri) -+ endif (MSVC) -+ install(TARGETS poly2tri-static -+ RUNTIME DESTINATION ${BIN_DIR} -+ LIBRARY DESTINATION ${LIB_DIR} -+ ARCHIVE DESTINATION ${LIB_DIR}) -+endif (BUILD_STATIC_LIBS) -+ -+# Local Variables: -+# tab-width: 8 -+# mode: cmake -+# indent-tabs-mode: t -+# End: -+# ex: shiftwidth=2 tabstop=8 -diff -Naur poly2tri.orig/poly2tri/common/dll_symbol.h POLY2TRI_BLD/poly2tri/common/dll_symbol.h ---- poly2tri.orig/poly2tri/common/dll_symbol.h 2023-09-17 14:48:01.014182570 -0400 -+++ POLY2TRI_BLD/poly2tri/common/dll_symbol.h 2023-09-17 14:48:33.341620451 -0400 -@@ -32,22 +32,21 @@ - #pragma once - - #if defined(_WIN32) --# define P2T_COMPILER_DLLEXPORT __declspec(dllexport) --# define P2T_COMPILER_DLLIMPORT __declspec(dllimport) --#elif defined(__GNUC__) --# define P2T_COMPILER_DLLEXPORT __attribute__ ((visibility ("default"))) --# define P2T_COMPILER_DLLIMPORT __attribute__ ((visibility ("default"))) -+# define COMPILER_DLLEXPORT __declspec(dllexport) -+# define COMPILER_DLLIMPORT __declspec(dllimport) - #else --# define P2T_COMPILER_DLLEXPORT --# define P2T_COMPILER_DLLIMPORT -+# define COMPILER_DLLEXPORT __attribute__ ((visibility ("default"))) -+# define COMPILER_DLLIMPORT __attribute__ ((visibility ("default"))) - #endif - --#ifndef P2T_DLL_SYMBOL --# if defined(P2T_STATIC_EXPORTS) --# define P2T_DLL_SYMBOL --# elif defined(P2T_SHARED_EXPORTS) --# define P2T_DLL_SYMBOL P2T_COMPILER_DLLEXPORT -+#ifndef P2T_EXPORT -+# if defined(P2T_DLL_EXPORTS) && defined(P2T_DLL_IMPORTS) -+# error "Only P2T_DLL_EXPORTS or P2T_DLL_IMPORTS can be defined, not both." -+# elif defined(P2T_DLL_EXPORTS) -+# define P2T_EXPORT COMPILER_DLLEXPORT -+# elif defined(P2T_DLL_IMPORTS) -+# define P2T_EXPORT COMPILER_DLLIMPORT - # else --# define P2T_DLL_SYMBOL P2T_COMPILER_DLLIMPORT -+# define P2T_EXPORT - # endif - #endif -diff -Naur poly2tri.orig/poly2tri/common/shapes.cc POLY2TRI_BLD/poly2tri/common/shapes.cc ---- poly2tri.orig/poly2tri/common/shapes.cc 2023-09-17 14:48:01.014182570 -0400 -+++ POLY2TRI_BLD/poly2tri/common/shapes.cc 2023-09-17 14:48:33.341620451 -0400 -@@ -29,383 +29,347 @@ - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - #include "shapes.h" -- --#include -+#include - #include - - namespace p2t { - --Point::Point(double x, double y) : x(x), y(y) --{ --} -- --std::ostream& operator<<(std::ostream& out, const Point& point) { -- return out << point.x << "," << point.y; --} -- --Triangle::Triangle(Point& a, Point& b, Point& c) --{ -- points_[0] = &a; points_[1] = &b; points_[2] = &c; -- neighbors_[0] = nullptr; neighbors_[1] = nullptr; neighbors_[2] = nullptr; -- constrained_edge[0] = constrained_edge[1] = constrained_edge[2] = false; -- delaunay_edge[0] = delaunay_edge[1] = delaunay_edge[2] = false; -- interior_ = false; --} -- --// Update neighbor pointers --void Triangle::MarkNeighbor(Point* p1, Point* p2, Triangle* t) --{ -- if ((p1 == points_[2] && p2 == points_[1]) || (p1 == points_[1] && p2 == points_[2])) -- neighbors_[0] = t; -- else if ((p1 == points_[0] && p2 == points_[2]) || (p1 == points_[2] && p2 == points_[0])) -- neighbors_[1] = t; -- else if ((p1 == points_[0] && p2 == points_[1]) || (p1 == points_[1] && p2 == points_[0])) -- neighbors_[2] = t; -- else -- assert(0); --} -- --// Exhaustive search to update neighbor pointers --void Triangle::MarkNeighbor(Triangle& t) --{ -- if (t.Contains(points_[1], points_[2])) { -- neighbors_[0] = &t; -- t.MarkNeighbor(points_[1], points_[2], this); -- } else if (t.Contains(points_[0], points_[2])) { -- neighbors_[1] = &t; -- t.MarkNeighbor(points_[0], points_[2], this); -- } else if (t.Contains(points_[0], points_[1])) { -- neighbors_[2] = &t; -- t.MarkNeighbor(points_[0], points_[1], this); -- } --} -- --/** -- * Clears all references to all other triangles and points -- */ --void Triangle::Clear() --{ -- Triangle *t; -- for (auto& neighbor : neighbors_) { -- t = neighbor; -- if (t != nullptr) { -- t->ClearNeighbor(this); -- } -+ Triangle::Triangle(Point& a, Point& b, Point& c) -+ { -+ points_[0] = &a; points_[1] = &b; points_[2] = &c; -+ neighbors_[0] = NULL; neighbors_[1] = NULL; neighbors_[2] = NULL; -+ constrained_edge[0] = constrained_edge[1] = constrained_edge[2] = false; -+ delaunay_edge[0] = delaunay_edge[1] = delaunay_edge[2] = false; -+ interior_ = false; -+ checked_ = false; - } -- ClearNeighbors(); -- points_[0]=points_[1]=points_[2] = nullptr; --} - --void Triangle::ClearNeighbor(const Triangle *triangle ) --{ -- if( neighbors_[0] == triangle ) -+ // Update neighbor pointers -+ void Triangle::MarkNeighbor(Point* p1, Point* p2, Triangle* t) - { -- neighbors_[0] = nullptr; -+ if ((p1 == points_[2] && p2 == points_[1]) || (p1 == points_[1] && p2 == points_[2])) -+ neighbors_[0] = t; -+ else if ((p1 == points_[0] && p2 == points_[2]) || (p1 == points_[2] && p2 == points_[0])) -+ neighbors_[1] = t; -+ else if ((p1 == points_[0] && p2 == points_[1]) || (p1 == points_[1] && p2 == points_[0])) -+ neighbors_[2] = t; -+ else -+ throw std::runtime_error("MarkNeighbor"); - } -- else if( neighbors_[1] == triangle ) -+ -+ // Exhaustive search to update neighbor pointers -+ void Triangle::MarkNeighbor(Triangle& t) - { -- neighbors_[1] = nullptr; -+ if (t.Contains(points_[1], points_[2])) { -+ neighbors_[0] = &t; -+ t.MarkNeighbor(points_[1], points_[2], this); -+ } else if (t.Contains(points_[0], points_[2])) { -+ neighbors_[1] = &t; -+ t.MarkNeighbor(points_[0], points_[2], this); -+ } else if (t.Contains(points_[0], points_[1])) { -+ neighbors_[2] = &t; -+ t.MarkNeighbor(points_[0], points_[1], this); -+ } - } -- else -+ -+ /** -+ * Clears all references to all other triangles and points -+ */ -+ void Triangle::Clear() - { -- neighbors_[2] = nullptr; -+ Triangle *t; -+ for( int i=0; i<3; i++ ) -+ { -+ t = neighbors_[i]; -+ if( t != NULL ) -+ { -+ t->ClearNeighbor( this ); -+ } -+ } -+ ClearNeighbors(); -+ points_[0]=points_[1]=points_[2] = NULL; - } --} - --void Triangle::ClearNeighbors() --{ -- neighbors_[0] = nullptr; -- neighbors_[1] = nullptr; -- neighbors_[2] = nullptr; --} -+ void Triangle::ClearNeighbor(Triangle *triangle ) -+ { -+ if( neighbors_[0] == triangle ) -+ { -+ neighbors_[0] = NULL; -+ } -+ else if( neighbors_[1] == triangle ) -+ { -+ neighbors_[1] = NULL; -+ } -+ else -+ { -+ neighbors_[2] = NULL; -+ } -+ } - --void Triangle::ClearDelunayEdges() --{ -- delaunay_edge[0] = delaunay_edge[1] = delaunay_edge[2] = false; --} -+ void Triangle::ClearNeighbors() -+ { -+ neighbors_[0] = NULL; -+ neighbors_[1] = NULL; -+ neighbors_[2] = NULL; -+ } - --Point* Triangle::OppositePoint(Triangle& t, const Point& p) --{ -- Point *cw = t.PointCW(p); -- return PointCW(*cw); --} -+ void Triangle::ClearDelunayEdges() -+ { -+ delaunay_edge[0] = delaunay_edge[1] = delaunay_edge[2] = false; -+ } - --// Legalized triangle by rotating clockwise around point(0) --void Triangle::Legalize(Point& point) --{ -- points_[1] = points_[0]; -- points_[0] = points_[2]; -- points_[2] = &point; --} -+ Point* Triangle::OppositePoint(Triangle& t, Point& p) -+ { -+ Point *cw = t.PointCW(p); -+ return PointCW(*cw); -+ } - --// Legalize triagnle by rotating clockwise around oPoint --void Triangle::Legalize(Point& opoint, Point& npoint) --{ -- if (&opoint == points_[0]) { -- points_[1] = points_[0]; -- points_[0] = points_[2]; -- points_[2] = &npoint; -- } else if (&opoint == points_[1]) { -- points_[2] = points_[1]; -- points_[1] = points_[0]; -- points_[0] = &npoint; -- } else if (&opoint == points_[2]) { -- points_[0] = points_[2]; -- points_[2] = points_[1]; -- points_[1] = &npoint; -- } else { -- assert(0); -- } --} -+ // Legalized triangle by rotating clockwise around point(0) -+ void Triangle::Legalize(Point& point) -+ { -+ points_[1] = points_[0]; -+ points_[0] = points_[2]; -+ points_[2] = &point; -+ } - --int Triangle::Index(const Point* p) --{ -- if (p == points_[0]) { -- return 0; -- } else if (p == points_[1]) { -- return 1; -- } else if (p == points_[2]) { -- return 2; -- } -- assert(0); -- return -1; --} -+ // Legalize triagnle by rotating clockwise around oPoint -+ void Triangle::Legalize(Point& opoint, Point& npoint) -+ { -+ if (&opoint == points_[0]) { -+ points_[1] = points_[0]; -+ points_[0] = points_[2]; -+ points_[2] = &npoint; -+ } else if (&opoint == points_[1]) { -+ points_[2] = points_[1]; -+ points_[1] = points_[0]; -+ points_[0] = &npoint; -+ } else if (&opoint == points_[2]) { -+ points_[0] = points_[2]; -+ points_[2] = points_[1]; -+ points_[1] = &npoint; -+ } else { -+ throw std::runtime_error("Legalize"); -+ } -+ } - --int Triangle::EdgeIndex(const Point* p1, const Point* p2) --{ -- if (points_[0] == p1) { -- if (points_[1] == p2) { -- return 2; -- } else if (points_[2] == p2) { -- return 1; -- } -- } else if (points_[1] == p1) { -- if (points_[2] == p2) { -- return 0; -- } else if (points_[0] == p2) { -- return 2; -- } -- } else if (points_[2] == p1) { -- if (points_[0] == p2) { -- return 1; -- } else if (points_[1] == p2) { -- return 0; -+ int Triangle::Index(const Point* p) -+ { -+ if (p == points_[0]) { -+ return 0; -+ } else if (p == points_[1]) { -+ return 1; -+ } else if (p == points_[2]) { -+ return 2; -+ } -+ throw std::runtime_error("Index"); - } -- } -- return -1; --} - --void Triangle::MarkConstrainedEdge(int index) --{ -- constrained_edge[index] = true; --} -+ int Triangle::EdgeIndex(const Point* p1, const Point* p2) -+ { -+ if (points_[0] == p1) { -+ if (points_[1] == p2) { -+ return 2; -+ } else if (points_[2] == p2) { -+ return 1; -+ } -+ } else if (points_[1] == p1) { -+ if (points_[2] == p2) { -+ return 0; -+ } else if (points_[0] == p2) { -+ return 2; -+ } -+ } else if (points_[2] == p1) { -+ if (points_[0] == p2) { -+ return 1; -+ } else if (points_[1] == p2) { -+ return 0; -+ } -+ } -+ return -1; -+ } - --void Triangle::MarkConstrainedEdge(Edge& edge) --{ -- MarkConstrainedEdge(edge.p, edge.q); --} -+ void Triangle::MarkConstrainedEdge(const int index) -+ { -+ constrained_edge[index] = true; -+ } - --// Mark edge as constrained --void Triangle::MarkConstrainedEdge(Point* p, Point* q) --{ -- if ((q == points_[0] && p == points_[1]) || (q == points_[1] && p == points_[0])) { -- constrained_edge[2] = true; -- } else if ((q == points_[0] && p == points_[2]) || (q == points_[2] && p == points_[0])) { -- constrained_edge[1] = true; -- } else if ((q == points_[1] && p == points_[2]) || (q == points_[2] && p == points_[1])) { -- constrained_edge[0] = true; -- } --} -+ void Triangle::MarkConstrainedEdge(Edge& edge) -+ { -+ MarkConstrainedEdge(edge.p, edge.q); -+ } - --// The point counter-clockwise to given point --Point* Triangle::PointCW(const Point& point) --{ -- if (&point == points_[0]) { -- return points_[2]; -- } else if (&point == points_[1]) { -- return points_[0]; -- } else if (&point == points_[2]) { -- return points_[1]; -- } -- assert(0); -- return nullptr; --} -+ // Mark edge as constrained -+ void Triangle::MarkConstrainedEdge(Point* p, Point* q) -+ { -+ if ((q == points_[0] && p == points_[1]) || (q == points_[1] && p == points_[0])) { -+ constrained_edge[2] = true; -+ } else if ((q == points_[0] && p == points_[2]) || (q == points_[2] && p == points_[0])) { -+ constrained_edge[1] = true; -+ } else if ((q == points_[1] && p == points_[2]) || (q == points_[2] && p == points_[1])) { -+ constrained_edge[0] = true; -+ } -+ } - --// The point counter-clockwise to given point --Point* Triangle::PointCCW(const Point& point) --{ -- if (&point == points_[0]) { -- return points_[1]; -- } else if (&point == points_[1]) { -- return points_[2]; -- } else if (&point == points_[2]) { -- return points_[0]; -- } -- assert(0); -- return nullptr; --} -+ // The point counter-clockwise to given point -+ Point* Triangle::PointCW(Point& point) -+ { -+ if (&point == points_[0]) { -+ return points_[2]; -+ } else if (&point == points_[1]) { -+ return points_[0]; -+ } else if (&point == points_[2]) { -+ return points_[1]; -+ } -+ throw std::runtime_error("PointCW"); -+ } - --// The neighbor across to given point --Triangle* Triangle::NeighborAcross(const Point& point) --{ -- if (&point == points_[0]) { -- return neighbors_[0]; -- } else if (&point == points_[1]) { -- return neighbors_[1]; -- } -- return neighbors_[2]; --} -+ // The point counter-clockwise to given point -+ Point* Triangle::PointCCW(Point& point) -+ { -+ if (&point == points_[0]) { -+ return points_[1]; -+ } else if (&point == points_[1]) { -+ return points_[2]; -+ } else if (&point == points_[2]) { -+ return points_[0]; -+ } -+ throw std::runtime_error("PointCCW"); -+ } - --// The neighbor clockwise to given point --Triangle* Triangle::NeighborCW(const Point& point) --{ -- if (&point == points_[0]) { -- return neighbors_[1]; -- } else if (&point == points_[1]) { -- return neighbors_[2]; -- } -- return neighbors_[0]; --} -+ // The neighbor clockwise to given point -+ Triangle* Triangle::NeighborCW(Point& point) -+ { -+ if (&point == points_[0]) { -+ return neighbors_[1]; -+ } else if (&point == points_[1]) { -+ return neighbors_[2]; -+ } -+ return neighbors_[0]; -+ } - --// The neighbor counter-clockwise to given point --Triangle* Triangle::NeighborCCW(const Point& point) --{ -- if (&point == points_[0]) { -- return neighbors_[2]; -- } else if (&point == points_[1]) { -- return neighbors_[0]; -- } -- return neighbors_[1]; --} -+ // The neighbor across to given point -+ Triangle* Triangle::NeighborAcross(Point& opoint) -+ { -+ if (&opoint == points_[0]) { -+ return neighbors_[0]; -+ } else if (&opoint == points_[1]) { -+ return neighbors_[1]; -+ } -+ return neighbors_[2]; -+ } - --bool Triangle::GetConstrainedEdgeCCW(const Point& p) --{ -- if (&p == points_[0]) { -- return constrained_edge[2]; -- } else if (&p == points_[1]) { -- return constrained_edge[0]; -- } -- return constrained_edge[1]; --} -+ // The neighbor counter-clockwise to given point -+ Triangle* Triangle::NeighborCCW(Point& point) -+ { -+ if (&point == points_[0]) { -+ return neighbors_[2]; -+ } else if (&point == points_[1]) { -+ return neighbors_[0]; -+ } -+ return neighbors_[1]; -+ } - --bool Triangle::GetConstrainedEdgeCW(const Point& p) --{ -- if (&p == points_[0]) { -- return constrained_edge[1]; -- } else if (&p == points_[1]) { -- return constrained_edge[2]; -- } -- return constrained_edge[0]; --} -+ bool Triangle::GetConstrainedEdgeCCW(Point& p) -+ { -+ if (&p == points_[0]) { -+ return constrained_edge[2]; -+ } else if (&p == points_[1]) { -+ return constrained_edge[0]; -+ } -+ return constrained_edge[1]; -+ } - --void Triangle::SetConstrainedEdgeCCW(const Point& p, bool ce) --{ -- if (&p == points_[0]) { -- constrained_edge[2] = ce; -- } else if (&p == points_[1]) { -- constrained_edge[0] = ce; -- } else { -- constrained_edge[1] = ce; -- } --} -+ bool Triangle::GetConstrainedEdgeCW(Point& p) -+ { -+ if (&p == points_[0]) { -+ return constrained_edge[1]; -+ } else if (&p == points_[1]) { -+ return constrained_edge[2]; -+ } -+ return constrained_edge[0]; -+ } - --void Triangle::SetConstrainedEdgeCW(const Point& p, bool ce) --{ -- if (&p == points_[0]) { -- constrained_edge[1] = ce; -- } else if (&p == points_[1]) { -- constrained_edge[2] = ce; -- } else { -- constrained_edge[0] = ce; -- } --} -+ void Triangle::SetConstrainedEdgeCCW(Point& p, bool ce) -+ { -+ if (&p == points_[0]) { -+ constrained_edge[2] = ce; -+ } else if (&p == points_[1]) { -+ constrained_edge[0] = ce; -+ } else { -+ constrained_edge[1] = ce; -+ } -+ } - --bool Triangle::GetDelunayEdgeCCW(const Point& p) --{ -- if (&p == points_[0]) { -- return delaunay_edge[2]; -- } else if (&p == points_[1]) { -- return delaunay_edge[0]; -- } -- return delaunay_edge[1]; --} -+ void Triangle::SetConstrainedEdgeCW(Point& p, bool ce) -+ { -+ if (&p == points_[0]) { -+ constrained_edge[1] = ce; -+ } else if (&p == points_[1]) { -+ constrained_edge[2] = ce; -+ } else { -+ constrained_edge[0] = ce; -+ } -+ } - --bool Triangle::GetDelunayEdgeCW(const Point& p) --{ -- if (&p == points_[0]) { -- return delaunay_edge[1]; -- } else if (&p == points_[1]) { -- return delaunay_edge[2]; -- } -- return delaunay_edge[0]; --} -+ bool Triangle::GetDelunayEdgeCCW(Point& p) -+ { -+ if (&p == points_[0]) { -+ return delaunay_edge[2]; -+ } else if (&p == points_[1]) { -+ return delaunay_edge[0]; -+ } -+ return delaunay_edge[1]; -+ } - --void Triangle::SetDelunayEdgeCCW(const Point& p, bool e) --{ -- if (&p == points_[0]) { -- delaunay_edge[2] = e; -- } else if (&p == points_[1]) { -- delaunay_edge[0] = e; -- } else { -- delaunay_edge[1] = e; -- } --} -+ bool Triangle::GetDelunayEdgeCW(Point& p) -+ { -+ if (&p == points_[0]) { -+ return delaunay_edge[1]; -+ } else if (&p == points_[1]) { -+ return delaunay_edge[2]; -+ } -+ return delaunay_edge[0]; -+ } - --void Triangle::SetDelunayEdgeCW(const Point& p, bool e) --{ -- if (&p == points_[0]) { -- delaunay_edge[1] = e; -- } else if (&p == points_[1]) { -- delaunay_edge[2] = e; -- } else { -- delaunay_edge[0] = e; -- } --} -+ void Triangle::SetDelunayEdgeCCW(Point& p, bool e) -+ { -+ if (&p == points_[0]) { -+ delaunay_edge[2] = e; -+ } else if (&p == points_[1]) { -+ delaunay_edge[0] = e; -+ } else { -+ delaunay_edge[1] = e; -+ } -+ } - --void Triangle::DebugPrint() --{ -- std::cout << *points_[0] << " " << *points_[1] << " " << *points_[2] << std::endl; --} -+ void Triangle::SetDelunayEdgeCW(Point& p, bool e) -+ { -+ if (&p == points_[0]) { -+ delaunay_edge[1] = e; -+ } else if (&p == points_[1]) { -+ delaunay_edge[2] = e; -+ } else { -+ delaunay_edge[0] = e; -+ } -+ } - --bool Triangle::CircumcicleContains(const Point& point) const --{ -- assert(IsCounterClockwise()); -- const double dx = points_[0]->x - point.x; -- const double dy = points_[0]->y - point.y; -- const double ex = points_[1]->x - point.x; -- const double ey = points_[1]->y - point.y; -- const double fx = points_[2]->x - point.x; -- const double fy = points_[2]->y - point.y; -- -- const double ap = dx * dx + dy * dy; -- const double bp = ex * ex + ey * ey; -- const double cp = fx * fx + fy * fy; -+ void Triangle::DebugPrint() -+ { -+ using namespace std; -+ cout << points_[0]->x << "," << points_[0]->y << " "; -+ cout << points_[1]->x << "," << points_[1]->y << " "; -+ cout << points_[2]->x << "," << points_[2]->y << endl; -+ } - -- return (dx * (fy * bp - cp * ey) - dy * (fx * bp - cp * ex) + ap * (fx * ey - fy * ex)) < 0; - } - --bool Triangle::IsCounterClockwise() const --{ -- return (points_[1]->x - points_[0]->x) * (points_[2]->y - points_[0]->y) - -- (points_[2]->x - points_[0]->x) * (points_[1]->y - points_[0]->y) > -- 0; --} - --bool IsDelaunay(const std::vector& triangles) --{ -- for (const auto triangle : triangles) { -- for (const auto other : triangles) { -- if (triangle == other) { -- continue; -- } -- for (int i = 0; i < 3; ++i) { -- if (triangle->CircumcicleContains(*other->GetPoint(i))) { -- return false; -- } -- } -- } -- } -- return true; --} -+// Local Variables: -+// tab-width: 8 -+// mode: C++ -+// c-basic-offset: 4 -+// indent-tabs-mode: t -+// c-file-style: "stroustrup" -+// End: -+// ex: shiftwidth=4 tabstop=8 - --} // namespace p2t -diff -Naur poly2tri.orig/poly2tri/common/shapes.h POLY2TRI_BLD/poly2tri/common/shapes.h ---- poly2tri.orig/poly2tri/common/shapes.h 2023-09-17 14:48:01.014182570 -0400 -+++ POLY2TRI_BLD/poly2tri/common/shapes.h 2023-09-17 14:48:33.341620451 -0400 -@@ -29,301 +29,327 @@ - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - --#pragma once -+// Include guard -+#ifndef SHAPES_H -+#define SHAPES_H - --#include "dll_symbol.h" -+#include "../common/dll_symbol.h" - --#include -+#include - #include - #include --#include -+#include -+#include -+ -+/* Avoid exact floating point comparison warnings, but this macro -+ * is used in some places where *very* tight equality is needed - -+ * use DBL_MIN */ -+#define EQ(v1, v2) ((v1 - v2 > -DBL_MIN) && (v1 - v2 < DBL_MIN)) - - namespace p2t { - --struct Edge; -+ struct Edge; - --struct P2T_DLL_SYMBOL Point { -+ struct Point { - -- double x, y; -+ double x, y; - -- /// Default constructor does nothing (for performance). -- Point() -- { -- x = 0.0; -- y = 0.0; -- } -- -- /// The edges this point constitutes an upper ending point -- std::vector edge_list; -- -- /// Construct using coordinates. -- Point(double x, double y); -- -- /// Set this point to all zeros. -- void set_zero() -- { -- x = 0.0; -- y = 0.0; -- } -- -- /// Set this point to some specified coordinates. -- void set(double x_, double y_) -- { -- x = x_; -- y = y_; -- } -- -- /// Negate this point. -- Point operator -() const -- { -- Point v; -- v.set(-x, -y); -- return v; -- } -- -- /// Add a point to this point. -- void operator +=(const Point& v) -- { -- x += v.x; -- y += v.y; -- } -- -- /// Subtract a point from this point. -- void operator -=(const Point& v) -- { -- x -= v.x; -- y -= v.y; -- } -- -- /// Multiply this point by a scalar. -- void operator *=(double a) -- { -- x *= a; -- y *= a; -- } -- -- /// Get the length of this point (the norm). -- double Length() const -- { -- return sqrt(x * x + y * y); -- } -- -- /// Convert this point into a unit point. Returns the Length. -- double Normalize() -- { -- const double len = Length(); -- x /= len; -- y /= len; -- return len; -- } -- --}; -- --P2T_DLL_SYMBOL std::ostream& operator<<(std::ostream&, const Point&); -- --// Represents a simple polygon's edge --struct P2T_DLL_SYMBOL Edge { -- -- Point* p, *q; -- -- /// Constructor -- Edge(Point& p1, Point& p2) : p(&p1), q(&p2) -- { -- if (p1.y > p2.y) { -- q = &p1; -- p = &p2; -- } else if (p1.y == p2.y) { -- if (p1.x > p2.x) { -- q = &p1; -- p = &p2; -- } else if (p1.x == p2.x) { -- // Repeat points -- throw std::runtime_error("Edge::Edge: p1 == p2"); -- } -- } -- -- q->edge_list.push_back(this); -- } --}; -- --// Triangle-based data structures are know to have better performance than quad-edge structures --// See: J. Shewchuk, "Triangle: Engineering a 2D Quality Mesh Generator and Delaunay Triangulator" --// "Triangulations in CGAL" --class P2T_DLL_SYMBOL Triangle { --public: -- --/// Constructor --Triangle(Point& a, Point& b, Point& c); -- --/// Flags to determine if an edge is a Constrained edge --bool constrained_edge[3]; --/// Flags to determine if an edge is a Delauney edge --bool delaunay_edge[3]; -- --Point* GetPoint(int index); --Point* PointCW(const Point& point); --Point* PointCCW(const Point& point); --Point* OppositePoint(Triangle& t, const Point& p); -- --Triangle* GetNeighbor(int index); --void MarkNeighbor(Point* p1, Point* p2, Triangle* t); --void MarkNeighbor(Triangle& t); -- --void MarkConstrainedEdge(int index); --void MarkConstrainedEdge(Edge& edge); --void MarkConstrainedEdge(Point* p, Point* q); -- --int Index(const Point* p); --int EdgeIndex(const Point* p1, const Point* p2); -- --Triangle* NeighborAcross(const Point& point); --Triangle* NeighborCW(const Point& point); --Triangle* NeighborCCW(const Point& point); --bool GetConstrainedEdgeCCW(const Point& p); --bool GetConstrainedEdgeCW(const Point& p); --void SetConstrainedEdgeCCW(const Point& p, bool ce); --void SetConstrainedEdgeCW(const Point& p, bool ce); --bool GetDelunayEdgeCCW(const Point& p); --bool GetDelunayEdgeCW(const Point& p); --void SetDelunayEdgeCCW(const Point& p, bool e); --void SetDelunayEdgeCW(const Point& p, bool e); -- --bool Contains(const Point* p); --bool Contains(const Edge& e); --bool Contains(const Point* p, const Point* q); --void Legalize(Point& point); --void Legalize(Point& opoint, Point& npoint); --/** -- * Clears all references to all other triangles and points -- */ --void Clear(); --void ClearNeighbor(const Triangle *triangle); --void ClearNeighbors(); --void ClearDelunayEdges(); -- --inline bool IsInterior(); --inline void IsInterior(bool b); -- --void DebugPrint(); -- --bool CircumcicleContains(const Point&) const; -- --private: -- --bool IsCounterClockwise() const; -- --/// Triangle points --Point* points_[3]; --/// Neighbor list --Triangle* neighbors_[3]; -- --/// Has this triangle been marked as an interior triangle? --bool interior_; --}; -- --inline bool cmp(const Point* a, const Point* b) --{ -- if (a->y < b->y) { -- return true; -- } else if (a->y == b->y) { -- // Make sure q is point with greater x value -- if (a->x < b->x) { -- return true; -+ /// Default constructor does nothing (for performance). -+ P2T_EXPORT Point() -+ { -+ x = 0.0; -+ y = 0.0; -+ } -+ -+ /// The edges this point constitutes an upper ending point -+ std::vector edge_list; -+ -+ /// Construct using coordinates. -+ P2T_EXPORT Point(double x_, double y_) : x(x_), y(y_) {} -+ -+ /// Set this point to all zeros. -+ P2T_EXPORT void set_zero() -+ { -+ x = 0.0; -+ y = 0.0; -+ } -+ -+ /// Set this point to some specified coordinates. -+ P2T_EXPORT void set(double x_, double y_) -+ { -+ x = x_; -+ y = y_; -+ } -+ -+ /// Negate this point. -+ P2T_EXPORT Point operator -() const -+ { -+ Point v; -+ v.set(-x, -y); -+ return v; -+ } -+ -+ /// Add a point to this point. -+ P2T_EXPORT void operator +=(const Point& v) -+ { -+ x += v.x; -+ y += v.y; -+ } -+ -+ /// Subtract a point from this point. -+ P2T_EXPORT void operator -=(const Point& v) -+ { -+ x -= v.x; -+ y -= v.y; -+ } -+ -+ /// Multiply this point by a scalar. -+ P2T_EXPORT void operator *=(double a) -+ { -+ x *= a; -+ y *= a; -+ } -+ -+ /// Get the length of this point (the norm). -+ P2T_EXPORT double Length() const -+ { -+ return sqrt(x * x + y * y); -+ } -+ -+ /// Convert this point into a unit point. Returns the Length. -+ P2T_EXPORT double Normalize() -+ { -+ double len = Length(); -+ x /= len; -+ y /= len; -+ return len; -+ } -+ -+ }; -+ -+ // Represents a simple polygon's edge -+ struct Edge { -+ -+ Point* p, *q; -+ -+ /// Constructor -+ P2T_EXPORT Edge(Point& p1, Point& p2) : p(&p1), q(&p2) -+ { -+ if (p1.y > p2.y) { -+ q = &p1; -+ p = &p2; -+ } else if (EQ(p1.y, p2.y)) { -+ if (p1.x > p2.x) { -+ q = &p1; -+ p = &p2; -+ } else if (EQ(p1.x, p2.x)) { -+ // Repeat points -+ throw std::runtime_error("Repeat points"); -+ } -+ } -+ -+ q->edge_list.push_back(this); -+ } -+ }; -+ -+ // Triangle-based data structures are know to have better performance than quad-edge structures -+ // See: J. Shewchuk, "Triangle: Engineering a 2D Quality Mesh Generator and Delaunay Triangulator" -+ // "Triangulations in CGAL" -+ class Triangle { -+ public: -+ -+ /// Constructor -+ P2T_EXPORT Triangle(Point& a, Point& b, Point& c); -+ -+ /// Flags to determine if an edge is a Constrained edge -+ bool constrained_edge[3]; -+ /// Flags to determine if an edge is a Delauney edge -+ bool delaunay_edge[3]; -+ -+ P2T_EXPORT Point* GetPoint(const int& index); -+ P2T_EXPORT Point* PointCW(Point& point); -+ P2T_EXPORT Point* PointCCW(Point& point); -+ P2T_EXPORT Point* OppositePoint(Triangle& t, Point& p); -+ -+ P2T_EXPORT Triangle* GetNeighbor(const int& index); -+ P2T_EXPORT void MarkNeighbor(Point* p1, Point* p2, Triangle* t); -+ P2T_EXPORT void MarkNeighbor(Triangle& t); -+ -+ P2T_EXPORT void MarkConstrainedEdge(const int index); -+ P2T_EXPORT void MarkConstrainedEdge(Edge& edge); -+ P2T_EXPORT void MarkConstrainedEdge(Point* p, Point* q); -+ -+ P2T_EXPORT int Index(const Point* p); -+ P2T_EXPORT int EdgeIndex(const Point* p1, const Point* p2); -+ -+ P2T_EXPORT Triangle* NeighborCW(Point& point); -+ P2T_EXPORT Triangle* NeighborCCW(Point& point); -+ P2T_EXPORT Triangle* NeighborAcross(Point& opoint); -+ P2T_EXPORT bool GetConstrainedEdgeCCW(Point& p); -+ P2T_EXPORT bool GetConstrainedEdgeCW(Point& p); -+ P2T_EXPORT void SetConstrainedEdgeCCW(Point& p, bool ce); -+ P2T_EXPORT void SetConstrainedEdgeCW(Point& p, bool ce); -+ P2T_EXPORT bool GetDelunayEdgeCCW(Point& p); -+ P2T_EXPORT bool GetDelunayEdgeCW(Point& p); -+ P2T_EXPORT void SetDelunayEdgeCCW(Point& p, bool e); -+ P2T_EXPORT void SetDelunayEdgeCW(Point& p, bool e); -+ -+ P2T_EXPORT bool Contains(Point* p); -+ P2T_EXPORT bool Contains(const Edge& e); -+ P2T_EXPORT bool Contains(Point* p, Point* q); -+ P2T_EXPORT void Legalize(Point& point); -+ P2T_EXPORT void Legalize(Point& opoint, Point& npoint); -+ /** -+ * Clears all references to all other triangles and points -+ */ -+ P2T_EXPORT void Clear(); -+ P2T_EXPORT void ClearNeighbor(Triangle *triangle ); -+ P2T_EXPORT void ClearNeighbors(); -+ P2T_EXPORT void ClearDelunayEdges(); -+ -+ P2T_EXPORT inline bool IsInterior(); -+ P2T_EXPORT inline void IsInterior(bool b); -+ -+ P2T_EXPORT inline bool IsChecked(); -+ P2T_EXPORT inline void IsChecked(bool b); -+ -+ P2T_EXPORT void DebugPrint(); -+ -+ private: -+ -+ /// Triangle points -+ Point* points_[3]; -+ /// Neighbor list -+ Triangle* neighbors_[3]; -+ -+ /// Has this triangle been marked as an interior triangle? -+ bool interior_; -+ /// Has this triangle been checked as an interior triangle? -+ bool checked_; -+ }; -+ -+ inline bool cmp(const Point* a, const Point* b) -+ { -+ if (a->y < b->y) { -+ return true; -+ } else if (EQ(a->y, b->y)) { -+ // Make sure q is point with greater x value -+ if (a->x < b->x) { -+ return true; -+ } -+ } -+ return false; - } -- } -- return false; --} - --/// Add two points_ component-wise. --inline Point operator +(const Point& a, const Point& b) --{ -- return Point(a.x + b.x, a.y + b.y); --} -+ /// Add two points_ component-wise. -+ inline Point operator +(const Point& a, const Point& b) -+ { -+ return Point(a.x + b.x, a.y + b.y); -+ } - --/// Subtract two points_ component-wise. --inline Point operator -(const Point& a, const Point& b) --{ -- return Point(a.x - b.x, a.y - b.y); --} -+ /// Subtract two points_ component-wise. -+ inline Point operator -(const Point& a, const Point& b) -+ { -+ return Point(a.x - b.x, a.y - b.y); -+ } - --/// Multiply point by scalar --inline Point operator *(double s, const Point& a) --{ -- return Point(s * a.x, s * a.y); --} -+ /// Multiply point by scalar -+ inline Point operator *(double s, const Point& a) -+ { -+ return Point(s * a.x, s * a.y); -+ } - --inline bool operator ==(const Point& a, const Point& b) --{ -- return a.x == b.x && a.y == b.y; --} -+ inline bool operator ==(const Point& a, const Point& b) -+ { -+ return EQ(a.x, b.x) && EQ(a.y, b.y); -+ } - --inline bool operator !=(const Point& a, const Point& b) --{ -- return !(a.x == b.x) || !(a.y == b.y); --} -+ inline bool operator !=(const Point& a, const Point& b) -+ { -+ return !(a == b); -+ } - --/// Peform the dot product on two vectors. --inline double Dot(const Point& a, const Point& b) --{ -- return a.x * b.x + a.y * b.y; --} -+ /// Peform the dot product on two vectors. -+ inline double Dot(const Point& a, const Point& b) -+ { -+ return a.x * b.x + a.y * b.y; -+ } - --/// Perform the cross product on two vectors. In 2D this produces a scalar. --inline double Cross(const Point& a, const Point& b) --{ -- return a.x * b.y - a.y * b.x; --} -+ /// Perform the cross product on two vectors. In 2D this produces a scalar. -+ inline double Cross(const Point& a, const Point& b) -+ { -+ return a.x * b.y - a.y * b.x; -+ } - --/// Perform the cross product on a point and a scalar. In 2D this produces --/// a point. --inline Point Cross(const Point& a, double s) --{ -- return Point(s * a.y, -s * a.x); --} -+ /// Perform the cross product on a point and a scalar. In 2D this produces -+ /// a point. -+ inline Point Cross(const Point& a, double s) -+ { -+ return Point(s * a.y, -s * a.x); -+ } - --/// Perform the cross product on a scalar and a point. In 2D this produces --/// a point. --inline Point Cross(double s, const Point& a) --{ -- return Point(-s * a.y, s * a.x); --} -+ /// Perform the cross product on a scalar and a point. In 2D this produces -+ /// a point. -+ inline Point Cross(const double s, const Point& a) -+ { -+ return Point(-s * a.y, s * a.x); -+ } - --inline Point* Triangle::GetPoint(int index) --{ -- return points_[index]; --} -+ inline Point* Triangle::GetPoint(const int& index) -+ { -+ return points_[index]; -+ } - --inline Triangle* Triangle::GetNeighbor(int index) --{ -- return neighbors_[index]; --} -+ inline Triangle* Triangle::GetNeighbor(const int& index) -+ { -+ return neighbors_[index]; -+ } - --inline bool Triangle::Contains(const Point* p) --{ -- return p == points_[0] || p == points_[1] || p == points_[2]; --} -+ inline bool Triangle::Contains(Point* p) -+ { -+ return p == points_[0] || p == points_[1] || p == points_[2]; -+ } - --inline bool Triangle::Contains(const Edge& e) --{ -- return Contains(e.p) && Contains(e.q); --} -+ inline bool Triangle::Contains(const Edge& e) -+ { -+ return Contains(e.p) && Contains(e.q); -+ } - --inline bool Triangle::Contains(const Point* p, const Point* q) --{ -- return Contains(p) && Contains(q); --} -+ inline bool Triangle::Contains(Point* p, Point* q) -+ { -+ return Contains(p) && Contains(q); -+ } - --inline bool Triangle::IsInterior() --{ -- return interior_; --} -+ inline bool Triangle::IsInterior() -+ { -+ return interior_; -+ } - --inline void Triangle::IsInterior(bool b) --{ -- interior_ = b; --} -+ inline void Triangle::IsInterior(bool b) -+ { -+ interior_ = b; -+ } - --/// Is this set a valid delaunay triangulation? --P2T_DLL_SYMBOL bool IsDelaunay(const std::vector&); -+ inline bool Triangle::IsChecked() -+ { -+ return checked_; -+ } -+ -+ inline void Triangle::IsChecked(bool b) -+ { -+ checked_ = b; -+ } - - } -+ -+#endif -+ -+// Local Variables: -+// tab-width: 8 -+// mode: C++ -+// c-basic-offset: 4 -+// indent-tabs-mode: t -+// c-file-style: "stroustrup" -+// End: -+// ex: shiftwidth=4 tabstop=8 -+ -diff -Naur poly2tri.orig/poly2tri/common/utils.h POLY2TRI_BLD/poly2tri/common/utils.h ---- poly2tri.orig/poly2tri/common/utils.h 2023-09-17 14:48:01.014182570 -0400 -+++ POLY2TRI_BLD/poly2tri/common/utils.h 2023-09-17 14:48:33.341620451 -0400 -@@ -29,102 +29,74 @@ - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - --#pragma once -+#ifndef UTILS_H -+#define UTILS_H - --// Otherwise #defines like M_PI are undeclared under Visual Studio --#define _USE_MATH_DEFINES -- --#include "shapes.h" -- --#include - #include -- --// C99 removes M_PI from math.h --#ifndef M_PI --#define M_PI 3.14159265358979323846264338327 -+#ifdef _WIN32 -+// Otherwise #defines like M_PI are undeclared under Visual Studio -+# define _USE_MATH_DEFINES - #endif -+#include -+#include -+#include "shapes.h" -+#include "utils.h" - - namespace p2t { - --const double PI_3div4 = 3 * M_PI / 4; --const double PI_div2 = 1.57079632679489661923; --const double EPSILON = 1e-12; -- --enum Orientation { CW, CCW, COLLINEAR }; -- --/** -- * Forumla to calculate signed area
-- * Positive if CCW
-- * Negative if CW
-- * 0 if collinear
-- *
-- * A[P1,P2,P3]  =  (x1*y2 - y1*x2) + (x2*y3 - y2*x3) + (x3*y1 - y3*x1)
-- *              =  (x1-x3)*(y2-y3) - (y1-y3)*(x2-x3)
-- * 
-- */ --Orientation Orient2d(const Point& pa, const Point& pb, const Point& pc) --{ -- double detleft = (pa.x - pc.x) * (pb.y - pc.y); -- double detright = (pa.y - pc.y) * (pb.x - pc.x); -- double val = detleft - detright; -- --// Using a tolerance here fails on concave-by-subepsilon boundaries --// if (val > -EPSILON && val < EPSILON) { --// Using == on double makes -Wfloat-equal warnings yell at us -- if (std::fpclassify(val) == FP_ZERO) { -- return COLLINEAR; -- } else if (val > 0) { -- return CCW; -- } -- return CW; -+ struct Point; -+ const double PI_3div4 = 3 * M_PI / 4; -+ const double PI_div2 = 1.57079632679489661923; -+ const double EPSILON = DBL_MIN; -+ -+ enum Orientation { CW, CCW, COLLINEAR }; -+ -+ /** -+ * Forumla to calculate signed area
-+ * Positive if CCW
-+ * Negative if CW
-+ * 0 if collinear
-+ *
-+     * A[P1,P2,P3]  =  (x1*y2 - y1*x2) + (x2*y3 - y2*x3) + (x3*y1 - y3*x1)
-+     *              =  (x1-x3)*(y2-y3) - (y1-y3)*(x2-x3)
-+     * 
-+ */ -+ Orientation Orient2d(Point& pa, Point& pb, Point& pc) -+ { -+ double detleft = (pa.x - pc.x) * (pb.y - pc.y); -+ double detright = (pa.y - pc.y) * (pb.x - pc.x); -+ double val = detleft - detright; -+ if (val > -EPSILON && val < EPSILON) { -+ return COLLINEAR; -+ } else if (val > 0) { -+ return CCW; -+ } -+ return CW; -+ } -+ -+ bool InScanArea(Point& pa, Point& pb, Point& pc, Point& pd) -+ { -+ double oadb = (pa.x - pb.x)*(pd.y - pb.y) - (pd.x - pb.x)*(pa.y - pb.y); -+ if (oadb >= -EPSILON) { -+ return false; -+ } -+ -+ double oadc = (pa.x - pc.x)*(pd.y - pc.y) - (pd.x - pc.x)*(pa.y - pc.y); -+ if (oadc <= EPSILON) { -+ return false; -+ } -+ return true; -+ } - } - --/* --bool InScanArea(Point& pa, Point& pb, Point& pc, Point& pd) --{ -- double pdx = pd.x; -- double pdy = pd.y; -- double adx = pa.x - pdx; -- double ady = pa.y - pdy; -- double bdx = pb.x - pdx; -- double bdy = pb.y - pdy; -- -- double adxbdy = adx * bdy; -- double bdxady = bdx * ady; -- double oabd = adxbdy - bdxady; -- -- if (oabd <= EPSILON) { -- return false; -- } -- -- double cdx = pc.x - pdx; -- double cdy = pc.y - pdy; -- -- double cdxady = cdx * ady; -- double adxcdy = adx * cdy; -- double ocad = cdxady - adxcdy; -- -- if (ocad <= EPSILON) { -- return false; -- } -- -- return true; --} -- --*/ -+#endif - --bool InScanArea(const Point& pa, const Point& pb, const Point& pc, const Point& pd) --{ -- double oadb = (pa.x - pb.x)*(pd.y - pb.y) - (pd.x - pb.x)*(pa.y - pb.y); -- if (oadb >= -EPSILON) { -- return false; -- } -- -- double oadc = (pa.x - pc.x)*(pd.y - pc.y) - (pd.x - pc.x)*(pa.y - pc.y); -- if (oadc <= EPSILON) { -- return false; -- } -- return true; --} -+// Local Variables: -+// tab-width: 8 -+// mode: C++ -+// c-basic-offset: 4 -+// indent-tabs-mode: t -+// c-file-style: "stroustrup" -+// End: -+// ex: shiftwidth=4 tabstop=8 - --} -diff -Naur poly2tri.orig/poly2tri/poly2tri.h POLY2TRI_BLD/poly2tri/poly2tri.h ---- poly2tri.orig/poly2tri/poly2tri.h 2023-09-17 14:48:01.014182570 -0400 -+++ POLY2TRI_BLD/poly2tri/poly2tri.h 2023-09-17 14:48:33.341620451 -0400 -@@ -29,7 +29,11 @@ - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - --#pragma once -+#ifndef POLY2TRI_H -+#define POLY2TRI_H - - #include "common/shapes.h" - #include "sweep/cdt.h" -+ -+#endif -+ -diff -Naur poly2tri.orig/poly2tri/sweep/advancing_front.cc POLY2TRI_BLD/poly2tri/sweep/advancing_front.cc ---- poly2tri.orig/poly2tri/sweep/advancing_front.cc 2023-09-17 14:48:01.014182570 -0400 -+++ POLY2TRI_BLD/poly2tri/sweep/advancing_front.cc 2023-09-17 14:48:33.341620451 -0400 -@@ -30,81 +30,90 @@ - */ - #include "advancing_front.h" - --#include -- - namespace p2t { - --AdvancingFront::AdvancingFront(Node& head, Node& tail) --{ -- head_ = &head; -- tail_ = &tail; -- search_node_ = &head; --} -- --Node* AdvancingFront::LocateNode(double x) --{ -- Node* node = search_node_; -- -- if (x < node->value) { -- while ((node = node->prev) != nullptr) { -- if (x >= node->value) { -- search_node_ = node; -- return node; -- } -+ AdvancingFront::AdvancingFront(Node& head, Node& tail) -+ { -+ head_ = &head; -+ tail_ = &tail; -+ search_node_ = &head; - } -- } else { -- while ((node = node->next) != nullptr) { -- if (x < node->value) { -- search_node_ = node->prev; -- return node->prev; -- } -- } -- } -- return nullptr; --} - --Node* AdvancingFront::FindSearchNode(double x) --{ -- (void)x; // suppress compiler warnings "unused parameter 'x'" -- // TODO: implement BST index -- return search_node_; --} -+ Node* AdvancingFront::LocateNode(const double& x) -+ { -+ Node* node = search_node_; -+ -+ if (x < node->value) { -+ while ((node = node->prev) != NULL) { -+ if (x >= node->value) { -+ search_node_ = node; -+ return node; -+ } -+ } -+ } else { -+ while ((node = node->next) != NULL) { -+ if (x < node->value) { -+ search_node_ = node->prev; -+ return node->prev; -+ } -+ } -+ } -+ return NULL; -+ } - --Node* AdvancingFront::LocatePoint(const Point* point) --{ -- const double px = point->x; -- Node* node = FindSearchNode(px); -- const double nx = node->point->x; -- -- if (px == nx) { -- if (point != node->point) { -- // We might have two nodes with same x value for a short time -- if (point == node->prev->point) { -- node = node->prev; -- } else if (point == node->next->point) { -- node = node->next; -- } else { -- assert(0); -- } -+ Node* AdvancingFront::FindSearchNode(const double& x) -+ { -+ (void)x; // suppress compiler warnings "unused parameter 'x'" -+ // TODO: implement BST index -+ return search_node_; - } -- } else if (px < nx) { -- while ((node = node->prev) != nullptr) { -- if (point == node->point) { -- break; -- } -+ -+ Node* AdvancingFront::LocatePoint(const Point* point) -+ { -+ const double px = point->x; -+ Node* node = FindSearchNode(px); -+ const double nx = node->point->x; -+ -+ if (px == nx) { -+ if (point != node->point) { -+ // We might have two nodes with same x value for a short time -+ if (point == node->prev->point) { -+ node = node->prev; -+ } else if (point == node->next->point) { -+ node = node->next; -+ } else { -+ throw std::runtime_error("LocatePoint"); -+ } -+ } -+ } else if (px < nx) { -+ while ((node = node->prev) != NULL) { -+ if (point == node->point) { -+ break; -+ } -+ } -+ } else { -+ while ((node = node->next) != NULL) { -+ if (point == node->point) -+ break; -+ } -+ } -+ if(node) search_node_ = node; -+ return node; - } -- } else { -- while ((node = node->next) != nullptr) { -- if (point == node->point) -- break; -+ -+ AdvancingFront::~AdvancingFront() -+ { - } -- } -- if(node) search_node_ = node; -- return node; --} - --AdvancingFront::~AdvancingFront() --{ - } - --} // namespace p2t -+ -+// Local Variables: -+// tab-width: 8 -+// mode: C++ -+// c-basic-offset: 4 -+// indent-tabs-mode: t -+// c-file-style: "stroustrup" -+// End: -+// ex: shiftwidth=4 tabstop=8 -+ -diff -Naur poly2tri.orig/poly2tri/sweep/advancing_front.h POLY2TRI_BLD/poly2tri/sweep/advancing_front.h ---- poly2tri.orig/poly2tri/sweep/advancing_front.h 2023-09-17 14:48:01.014182570 -0400 -+++ POLY2TRI_BLD/poly2tri/sweep/advancing_front.h 2023-09-17 14:48:33.345620383 -0400 -@@ -29,87 +29,103 @@ - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - --#pragma once -+#ifndef ADVANCED_FRONT_H -+#define ADVANCED_FRONT_H - - #include "../common/shapes.h" - - namespace p2t { - --struct Node; -+ struct Node; - --// Advancing front node --struct Node { -- Point* point; -- Triangle* triangle; -+ // Advancing front node -+ struct Node { -+ Point* point; -+ Triangle* triangle; -+ -+ Node* next; -+ Node* prev; -+ -+ double value; -+ double angle; -+ bool circum; -+ double circumheight; -+ -+ Node(Point& p) : point(&p), triangle(NULL), next(NULL), prev(NULL), value(p.x), circum(false) -+ { -+ } -+ -+ Node(Point& p, Triangle& t) : point(&p), triangle(&t), next(NULL), prev(NULL), value(p.x), circum(false) -+ { -+ } -+ -+ }; -+ -+ // Advancing front -+ class AdvancingFront { -+ public: -+ -+ AdvancingFront(Node& head, Node& tail); -+ // Destructor -+ ~AdvancingFront(); -+ -+ Node* head(); -+ void set_head(Node* node); -+ Node* tail(); -+ void set_tail(Node* node); -+ Node* search(); -+ void set_search(Node* node); -+ -+ /// Locate insertion point along advancing front -+ Node* LocateNode(const double& x); -+ -+ Node* LocatePoint(const Point* point); -+ -+ private: -+ -+ Node* head_, *tail_, *search_node_; -+ -+ Node* FindSearchNode(const double& x); -+ }; -+ -+ inline Node* AdvancingFront::head() -+ { -+ return head_; -+ } -+ inline void AdvancingFront::set_head(Node* node) -+ { -+ head_ = node; -+ } -+ -+ inline Node* AdvancingFront::tail() -+ { -+ return tail_; -+ } -+ inline void AdvancingFront::set_tail(Node* node) -+ { -+ tail_ = node; -+ } -+ -+ inline Node* AdvancingFront::search() -+ { -+ return search_node_; -+ } -+ -+ inline void AdvancingFront::set_search(Node* node) -+ { -+ search_node_ = node; -+ } -+ -+} -+ -+#endif -+ -+// Local Variables: -+// tab-width: 8 -+// mode: C++ -+// c-basic-offset: 4 -+// indent-tabs-mode: t -+// c-file-style: "stroustrup" -+// End: -+// ex: shiftwidth=4 tabstop=8 - -- Node* next; -- Node* prev; -- -- double value; -- -- Node(Point& p) : point(&p), triangle(NULL), next(NULL), prev(NULL), value(p.x) -- { -- } -- -- Node(Point& p, Triangle& t) : point(&p), triangle(&t), next(NULL), prev(NULL), value(p.x) -- { -- } -- --}; -- --// Advancing front --class AdvancingFront { --public: -- --AdvancingFront(Node& head, Node& tail); --// Destructor --~AdvancingFront(); -- --Node* head(); --void set_head(Node* node); --Node* tail(); --void set_tail(Node* node); --Node* search(); --void set_search(Node* node); -- --/// Locate insertion point along advancing front --Node* LocateNode(double x); -- --Node* LocatePoint(const Point* point); -- --private: -- --Node* head_, *tail_, *search_node_; -- --Node* FindSearchNode(double x); --}; -- --inline Node* AdvancingFront::head() --{ -- return head_; --} --inline void AdvancingFront::set_head(Node* node) --{ -- head_ = node; --} -- --inline Node* AdvancingFront::tail() --{ -- return tail_; --} --inline void AdvancingFront::set_tail(Node* node) --{ -- tail_ = node; --} -- --inline Node* AdvancingFront::search() --{ -- return search_node_; --} -- --inline void AdvancingFront::set_search(Node* node) --{ -- search_node_ = node; --} -- --} -diff -Naur poly2tri.orig/poly2tri/sweep/cdt.cc POLY2TRI_BLD/poly2tri/sweep/cdt.cc ---- poly2tri.orig/poly2tri/sweep/cdt.cc 2023-09-17 14:48:01.014182570 -0400 -+++ POLY2TRI_BLD/poly2tri/sweep/cdt.cc 2023-09-17 14:48:33.345620383 -0400 -@@ -32,40 +32,65 @@ - - namespace p2t { - --CDT::CDT(const std::vector& polyline) --{ -- sweep_context_ = new SweepContext(polyline); -- sweep_ = new Sweep; --} -+ CDT::CDT() -+ { -+ sweep_context_ = new SweepContext(); -+ sweep_ = new Sweep; -+ } -+ -+ CDT::CDT(std::vector &polyline) -+ { -+ sweep_context_ = new SweepContext(polyline); -+ sweep_ = new Sweep; -+ } -+ -+ void CDT::AddOuterLoop(std::vector &polyline) -+ { -+ sweep_context_->AddOuterLoop(polyline); -+ } -+ void CDT::AddHole(std::vector &polyline) -+ { -+ sweep_context_->AddHole(polyline); -+ } -+ -+ void CDT::AddPoint(Point* point) { -+ sweep_context_->AddPoint(point); -+ } -+ -+ std::vector& CDT::GetPoints() { -+ return sweep_context_->GetPoints(); -+ } -+ -+ void CDT::Triangulate(bool finalize, int num_points, long maxtime) -+ { -+ sweep_->Triangulate(*sweep_context_, finalize, num_points, maxtime); -+ } -+ -+ std::vector& CDT::GetTriangles() -+ { -+ return sweep_context_->GetTriangles(); -+ } -+ -+ std::list& CDT::GetMap() -+ { -+ return sweep_context_->GetMap(); -+ } -+ -+ CDT::~CDT() -+ { -+ delete sweep_context_; -+ delete sweep_; -+ } - --void CDT::AddHole(const std::vector& polyline) --{ -- sweep_context_->AddHole(polyline); - } - --void CDT::AddPoint(Point* point) { -- sweep_context_->AddPoint(point); --} - --void CDT::Triangulate() --{ -- sweep_->Triangulate(*sweep_context_); --} -- --std::vector CDT::GetTriangles() --{ -- return sweep_context_->GetTriangles(); --} -- --std::list CDT::GetMap() --{ -- return sweep_context_->GetMap(); --} -- --CDT::~CDT() --{ -- delete sweep_context_; -- delete sweep_; --} -+// Local Variables: -+// tab-width: 8 -+// mode: C++ -+// c-basic-offset: 4 -+// indent-tabs-mode: t -+// c-file-style: "stroustrup" -+// End: -+// ex: shiftwidth=4 tabstop=8 - --} // namespace p2t -diff -Naur poly2tri.orig/poly2tri/sweep/cdt.h POLY2TRI_BLD/poly2tri/sweep/cdt.h ---- poly2tri.orig/poly2tri/sweep/cdt.h 2023-09-17 14:48:01.014182570 -0400 -+++ POLY2TRI_BLD/poly2tri/sweep/cdt.h 2023-09-17 14:48:33.345620383 -0400 -@@ -29,14 +29,33 @@ - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - --#pragma once -+#ifndef CDT_H -+#define CDT_H -+ -+#if defined(_WIN32) -+# define COMPILER_DLLEXPORT __declspec(dllexport) -+# define COMPILER_DLLIMPORT __declspec(dllimport) -+#else -+# define COMPILER_DLLEXPORT __attribute__ ((visibility ("default"))) -+# define COMPILER_DLLIMPORT __attribute__ ((visibility ("default"))) -+#endif -+ -+#ifndef P2T_EXPORT -+# if defined(P2T_DLL_EXPORTS) && defined(P2T_DLL_IMPORTS) -+# error "Only P2T_DLL_EXPORTS or P2T_DLL_IMPORTS can be defined, not both." -+# elif defined(P2T_DLL_EXPORTS) -+# define P2T_EXPORT COMPILER_DLLEXPORT -+# elif defined(P2T_DLL_IMPORTS) -+# define P2T_EXPORT COMPILER_DLLIMPORT -+# else -+# define P2T_EXPORT -+# endif -+#endif - - #include "advancing_front.h" - #include "sweep_context.h" - #include "sweep.h" - --#include "../common/dll_symbol.h" -- - /** - * - * @author Mason Green -@@ -45,60 +64,74 @@ - - namespace p2t { - --class P2T_DLL_SYMBOL CDT --{ --public: -- -- /** -- * Constructor - add polyline with non repeating points -- * -- * @param polyline -- */ -- CDT(const std::vector& polyline); -- -- /** -- * Destructor - clean up memory -- */ -- ~CDT(); -- -- /** -- * Add a hole -- * -- * @param polyline -- */ -- void AddHole(const std::vector& polyline); -- -- /** -- * Add a steiner point -- * -- * @param point -- */ -- void AddPoint(Point* point); -- -- /** -- * Triangulate - do this AFTER you've added the polyline, holes, and Steiner points -- */ -- void Triangulate(); -- -- /** -- * Get CDT triangles -- */ -- std::vector GetTriangles(); -- -- /** -- * Get triangle map -- */ -- std::list GetMap(); -- -- private: -- -- /** -- * Internals -- */ -+ class CDT -+ { -+ public: -+ -+ /** -+ * Constructor - add polyline with non repeating points -+ */ -+ P2T_EXPORT CDT(); -+ P2T_EXPORT CDT(std::vector &polyline); -+ -+ /** -+ * Destructor - clean up memory -+ */ -+ P2T_EXPORT ~CDT(); -+ -+ /** -+ * Add outer loop -+ */ -+ P2T_EXPORT void AddOuterLoop(std::vector &polyline); -+ -+ /** -+ * Add a hole -+ */ -+ P2T_EXPORT void AddHole(std::vector &polyline); -+ -+ /** -+ * Add a steiner point -+ */ -+ P2T_EXPORT void AddPoint(Point* point); -+ -+ P2T_EXPORT std::vector& GetPoints(); -+ -+ /** -+ * Triangulate - do this AFTER you've added the polyline, holes, and Steiner points -+ */ -+ P2T_EXPORT void Triangulate(bool finalize = true, int num_points = -1, long maxtime = POLY2TRI_MAXTIME); -+ -+ /** -+ * Get CDT triangles -+ */ -+ P2T_EXPORT std::vector& GetTriangles(); -+ -+ /** -+ * Get triangle map -+ */ -+ P2T_EXPORT std::list& GetMap(); -+ -+ private: -+ -+ /** -+ * Internals -+ */ - -- SweepContext* sweep_context_; -- Sweep* sweep_; -+ SweepContext* sweep_context_; -+ Sweep* sweep_; - --}; -+ }; - - } -+ -+#endif -+ -+// Local Variables: -+// tab-width: 8 -+// mode: C++ -+// c-basic-offset: 4 -+// indent-tabs-mode: t -+// c-file-style: "stroustrup" -+// End: -+// ex: shiftwidth=4 tabstop=8 -+ -diff -Naur poly2tri.orig/poly2tri/sweep/sweep.cc POLY2TRI_BLD/poly2tri/sweep/sweep.cc ---- poly2tri.orig/poly2tri/sweep/sweep.cc 2023-09-17 14:48:01.014182570 -0400 -+++ POLY2TRI_BLD/poly2tri/sweep/sweep.cc 2023-09-17 14:48:33.345620383 -0400 -@@ -28,833 +28,979 @@ - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -+#ifdef _WIN32 -+// Otherwise #defines like M_PI are undeclared under Visual Studio -+# define _USE_MATH_DEFINES -+#endif -+#include -+#include -+#include -+#include -+#include - #include "sweep.h" - #include "sweep_context.h" - #include "advancing_front.h" - #include "../common/utils.h" - --#include --#include -- - namespace p2t { - --// Triangulate simple polygon with holes --void Sweep::Triangulate(SweepContext& tcx) --{ -- tcx.InitTriangulation(); -- tcx.CreateAdvancingFront(); -- // Sweep points; build mesh -- SweepPoints(tcx); -- // Clean up -- FinalizationPolygon(tcx); --} -- --void Sweep::SweepPoints(SweepContext& tcx) --{ -- for (size_t i = 1; i < tcx.point_count(); i++) { -- Point& point = *tcx.GetPoint(i); -- Node* node = &PointEvent(tcx, point); -- for (auto& j : point.edge_list) { -- EdgeEvent(tcx, j, node); -- } -- } --} -- --void Sweep::FinalizationPolygon(SweepContext& tcx) --{ -- // Get an Internal triangle to start with -- Triangle* t = tcx.front()->head()->next->triangle; -- Point* p = tcx.front()->head()->next->point; -- while (t && !t->GetConstrainedEdgeCW(*p)) { -- t = t->NeighborCCW(*p); -- } -- -- // Collect interior triangles constrained by edges -- if (t) { -- tcx.MeshClean(*t); -- } --} -- --Node& Sweep::PointEvent(SweepContext& tcx, Point& point) --{ -- Node* node_ptr = tcx.LocateNode(point); -- if (!node_ptr || !node_ptr->point || !node_ptr->next || !node_ptr->next->point) -- { -- throw std::runtime_error("PointEvent - null node"); -- } -- -- Node& node = *node_ptr; -- Node& new_node = NewFrontTriangle(tcx, point, node); -- -- // Only need to check +epsilon since point never have smaller -- // x value than node due to how we fetch nodes from the front -- if (point.x <= node.point->x + EPSILON) { -- Fill(tcx, node); -- } -- -- //tcx.AddNode(new_node); -- -- FillAdvancingFront(tcx, new_node); -- return new_node; --} -- --void Sweep::EdgeEvent(SweepContext& tcx, Edge* edge, Node* node) --{ -- tcx.edge_event.constrained_edge = edge; -- tcx.edge_event.right = (edge->p->x > edge->q->x); -- -- if (IsEdgeSideOfTriangle(*node->triangle, *edge->p, *edge->q)) { -- return; -- } -- -- // For now we will do all needed filling -- // TODO: integrate with flip process might give some better performance -- // but for now this avoid the issue with cases that needs both flips and fills -- FillEdgeEvent(tcx, edge, node); -- EdgeEvent(tcx, *edge->p, *edge->q, node->triangle, *edge->q); --} -- --void Sweep::EdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* triangle, Point& point) --{ -- if (triangle == nullptr) { -- throw std::runtime_error("EdgeEvent - null triangle"); -- } -- if (IsEdgeSideOfTriangle(*triangle, ep, eq)) { -- return; -- } -- -- Point* p1 = triangle->PointCCW(point); -- Orientation o1 = Orient2d(eq, *p1, ep); -- if (o1 == COLLINEAR) { -- if (triangle->Contains(&eq, p1)) { -- triangle->MarkConstrainedEdge(&eq, p1); -- // We are modifying the constraint maybe it would be better to -- // not change the given constraint and just keep a variable for the new constraint -- tcx.edge_event.constrained_edge->q = p1; -- triangle = triangle->NeighborAcross(point); -- EdgeEvent(tcx, ep, *p1, triangle, *p1); -- } else { -- throw std::runtime_error("EdgeEvent - collinear points not supported"); -- } -- return; -- } -- -- Point* p2 = triangle->PointCW(point); -- Orientation o2 = Orient2d(eq, *p2, ep); -- if (o2 == COLLINEAR) { -- if (triangle->Contains(&eq, p2)) { -- triangle->MarkConstrainedEdge(&eq, p2); -- // We are modifying the constraint maybe it would be better to -- // not change the given constraint and just keep a variable for the new constraint -- tcx.edge_event.constrained_edge->q = p2; -- triangle = triangle->NeighborAcross(point); -- EdgeEvent(tcx, ep, *p2, triangle, *p2); -- } else { -- throw std::runtime_error("EdgeEvent - collinear points not supported"); -- } -- return; -- } -- -- if (o1 == o2) { -- // Need to decide if we are rotating CW or CCW to get to a triangle -- // that will cross edge -- if (o1 == CW) { -- triangle = triangle->NeighborCCW(point); -- } else { -- triangle = triangle->NeighborCW(point); -- } -- EdgeEvent(tcx, ep, eq, triangle, point); -- } else { -- // This triangle crosses constraint so lets flippin start! -- assert(triangle); -- FlipEdgeEvent(tcx, ep, eq, triangle, point); -- } --} -- --bool Sweep::IsEdgeSideOfTriangle(Triangle& triangle, Point& ep, Point& eq) --{ -- const int index = triangle.EdgeIndex(&ep, &eq); -- -- if (index != -1) { -- triangle.MarkConstrainedEdge(index); -- Triangle* t = triangle.GetNeighbor(index); -- if (t) { -- t->MarkConstrainedEdge(&ep, &eq); -- } -- return true; -- } -- return false; --} -- --Node& Sweep::NewFrontTriangle(SweepContext& tcx, Point& point, Node& node) --{ -- Triangle* triangle = new Triangle(point, *node.point, *node.next->point); -- -- triangle->MarkNeighbor(*node.triangle); -- tcx.AddToMap(triangle); -- -- Node* new_node = new Node(point); -- nodes_.push_back(new_node); -- -- new_node->next = node.next; -- new_node->prev = &node; -- node.next->prev = new_node; -- node.next = new_node; -- -- if (!Legalize(tcx, *triangle)) { -- tcx.MapTriangleToNodes(*triangle); -- } -- -- return *new_node; --} -- --void Sweep::Fill(SweepContext& tcx, Node& node) --{ -- Triangle* triangle = new Triangle(*node.prev->point, *node.point, *node.next->point); -- -- // TODO: should copy the constrained_edge value from neighbor triangles -- // for now constrained_edge values are copied during the legalize -- triangle->MarkNeighbor(*node.prev->triangle); -- triangle->MarkNeighbor(*node.triangle); -- -- tcx.AddToMap(triangle); -- -- // Update the advancing front -- node.prev->next = node.next; -- node.next->prev = node.prev; -- -- // If it was legalized the triangle has already been mapped -- if (!Legalize(tcx, *triangle)) { -- tcx.MapTriangleToNodes(*triangle); -- } --} -- --void Sweep::FillAdvancingFront(SweepContext& tcx, Node& n) --{ -- -- // Fill right holes -- Node* node = n.next; -- -- while (node && node->next) { -- // if HoleAngle exceeds 90 degrees then break. -- if (LargeHole_DontFill(node)) break; -- Fill(tcx, *node); -- node = node->next; -- } -- -- // Fill left holes -- node = n.prev; -- -- while (node && node->prev) { -- // if HoleAngle exceeds 90 degrees then break. -- if (LargeHole_DontFill(node)) break; -- Fill(tcx, *node); -- node = node->prev; -- } -- -- // Fill right basins -- if (n.next && n.next->next) { -- const double angle = BasinAngle(n); -- if (angle < PI_3div4) { -- FillBasin(tcx, n); -- } -- } --} -- --// True if HoleAngle exceeds 90 degrees. --// LargeHole_DontFill checks if the advancing front has a large hole. --// A "Large hole" is a triangle formed by a sequence of points in the advancing --// front where three neighbor points form a triangle. --// And angle between left-top, bottom, and right-top points is more than 90 degrees. --// The first part of the algorithm reviews only three neighbor points, e.g. named A, B, C. --// Additional part of this logic reviews a sequence of 5 points - --// additionally reviews one point before and one after the sequence of three (A, B, C), --// e.g. named X and Y. --// In this case, angles are XBC and ABY and this if angles are negative or more --// than 90 degrees LargeHole_DontFill returns true. --// But there is a configuration when ABC has a negative angle but XBC or ABY is less --// than 90 degrees and positive. --// Then function LargeHole_DontFill return false and initiates filling. --// This filling creates a triangle ABC and adds it to the advancing front. --// But in the case when angle ABC is negative this triangle goes inside the advancing front --// and can intersect previously created triangles. --// This triangle leads to making wrong advancing front and problems in triangulation in the future. --// Looks like such a triangle should not be created. --// The simplest way to check and fix it is to check an angle ABC. --// If it is negative LargeHole_DontFill should return true and --// not initiate creating the ABC triangle in the advancing front. --// X______A Y --// \ / --// \ / --// \ B / --// | / --// | / --// |/ --// C --bool Sweep::LargeHole_DontFill(const Node* node) const { -- -- const Node* nextNode = node->next; -- const Node* prevNode = node->prev; -- if (!AngleExceeds90Degrees(node->point, nextNode->point, prevNode->point)) -- return false; -- -- if (AngleIsNegative(node->point, nextNode->point, prevNode->point)) -- return true; -- -- // Check additional points on front. -- const Node* next2Node = nextNode->next; -- // "..Plus.." because only want angles on same side as point being added. -- if ((next2Node != nullptr) && !AngleExceedsPlus90DegreesOrIsNegative(node->point, next2Node->point, prevNode->point)) -- return false; -- -- const Node* prev2Node = prevNode->prev; -- // "..Plus.." because only want angles on same side as point being added. -- if ((prev2Node != nullptr) && !AngleExceedsPlus90DegreesOrIsNegative(node->point, nextNode->point, prev2Node->point)) -- return false; -- -- return true; --} -- --bool Sweep::AngleIsNegative(const Point* origin, const Point* pa, const Point* pb) const { -- const double angle = Angle(origin, pa, pb); -- return angle < 0; --} -- --bool Sweep::AngleExceeds90Degrees(const Point* origin, const Point* pa, const Point* pb) const { -- const double angle = Angle(origin, pa, pb); -- return ((angle > PI_div2) || (angle < -PI_div2)); --} -- --bool Sweep::AngleExceedsPlus90DegreesOrIsNegative(const Point* origin, const Point* pa, const Point* pb) const { -- const double angle = Angle(origin, pa, pb); -- return (angle > PI_div2) || (angle < 0); --} -- --double Sweep::Angle(const Point* origin, const Point* pa, const Point* pb) const { -- /* Complex plane -- * ab = cosA +i*sinA -- * ab = (ax + ay*i)(bx + by*i) = (ax*bx + ay*by) + i(ax*by-ay*bx) -- * atan2(y,x) computes the principal value of the argument function -- * applied to the complex number x+iy -- * Where x = ax*bx + ay*by -- * y = ax*by - ay*bx -- */ -- const double px = origin->x; -- const double py = origin->y; -- const double ax = pa->x - px; -- const double ay = pa->y - py; -- const double bx = pb->x - px; -- const double by = pb->y - py; -- const double x = ax * by - ay * bx; -- const double y = ax * bx + ay * by; -- return atan2(x, y); --} -- --double Sweep::BasinAngle(const Node& node) const --{ -- const double ax = node.point->x - node.next->next->point->x; -- const double ay = node.point->y - node.next->next->point->y; -- return atan2(ay, ax); --} -- --double Sweep::HoleAngle(const Node& node) const --{ -- /* Complex plane -- * ab = cosA +i*sinA -- * ab = (ax + ay*i)(bx + by*i) = (ax*bx + ay*by) + i(ax*by-ay*bx) -- * atan2(y,x) computes the principal value of the argument function -- * applied to the complex number x+iy -- * Where x = ax*bx + ay*by -- * y = ax*by - ay*bx -- */ -- const double ax = node.next->point->x - node.point->x; -- const double ay = node.next->point->y - node.point->y; -- const double bx = node.prev->point->x - node.point->x; -- const double by = node.prev->point->y - node.point->y; -- return atan2(ax * by - ay * bx, ax * bx + ay * by); --} -- --bool Sweep::Legalize(SweepContext& tcx, Triangle& t) --{ -- // To legalize a triangle we start by finding if any of the three edges -- // violate the Delaunay condition -- for (int i = 0; i < 3; i++) { -- if (t.delaunay_edge[i]) -- continue; -- -- Triangle* ot = t.GetNeighbor(i); -- -- if (ot) { -- Point* p = t.GetPoint(i); -- Point* op = ot->OppositePoint(t, *p); -- int oi = ot->Index(op); -- -- // If this is a Constrained Edge or a Delaunay Edge(only during recursive legalization) -- // then we should not try to legalize -- if (ot->constrained_edge[oi] || ot->delaunay_edge[oi]) { -- t.constrained_edge[i] = ot->constrained_edge[oi]; -- continue; -- } -- -- bool inside = Incircle(*p, *t.PointCCW(*p), *t.PointCW(*p), *op); -- -- if (inside) { -- // Lets mark this shared edge as Delaunay -- t.delaunay_edge[i] = true; -- ot->delaunay_edge[oi] = true; -- -- // Lets rotate shared edge one vertex CW to legalize it -- RotateTrianglePair(t, *p, *ot, *op); -- -- // We now got one valid Delaunay Edge shared by two triangles -- // This gives us 4 new edges to check for Delaunay -- -- // Make sure that triangle to node mapping is done only one time for a specific triangle -- bool not_legalized = !Legalize(tcx, t); -- if (not_legalized) { -- tcx.MapTriangleToNodes(t); -- } -- -- not_legalized = !Legalize(tcx, *ot); -- if (not_legalized) -- tcx.MapTriangleToNodes(*ot); -- -- // Reset the Delaunay edges, since they only are valid Delaunay edges -- // until we add a new triangle or point. -- // XXX: need to think about this. Can these edges be tried after we -- // return to previous recursive level? -- t.delaunay_edge[i] = false; -- ot->delaunay_edge[oi] = false; -- -- // If triangle have been legalized no need to check the other edges since -- // the recursive legalization will handles those so we can end here. -- return true; -- } -- } -- } -- return false; --} -- --bool Sweep::Incircle(const Point& pa, const Point& pb, const Point& pc, const Point& pd) const --{ -- const double adx = pa.x - pd.x; -- const double ady = pa.y - pd.y; -- const double bdx = pb.x - pd.x; -- const double bdy = pb.y - pd.y; -- -- const double adxbdy = adx * bdy; -- const double bdxady = bdx * ady; -- const double oabd = adxbdy - bdxady; -- -- if (oabd <= 0) -- return false; -- -- const double cdx = pc.x - pd.x; -- const double cdy = pc.y - pd.y; -- -- const double cdxady = cdx * ady; -- const double adxcdy = adx * cdy; -- const double ocad = cdxady - adxcdy; -- -- if (ocad <= 0) -- return false; -- -- const double bdxcdy = bdx * cdy; -- const double cdxbdy = cdx * bdy; -- -- const double alift = adx * adx + ady * ady; -- const double blift = bdx * bdx + bdy * bdy; -- const double clift = cdx * cdx + cdy * cdy; -- -- const double det = alift * (bdxcdy - cdxbdy) + blift * ocad + clift * oabd; -- -- return det > 0; --} -- --void Sweep::RotateTrianglePair(Triangle& t, Point& p, Triangle& ot, Point& op) const --{ -- Triangle* n1, *n2, *n3, *n4; -- n1 = t.NeighborCCW(p); -- n2 = t.NeighborCW(p); -- n3 = ot.NeighborCCW(op); -- n4 = ot.NeighborCW(op); -- -- bool ce1, ce2, ce3, ce4; -- ce1 = t.GetConstrainedEdgeCCW(p); -- ce2 = t.GetConstrainedEdgeCW(p); -- ce3 = ot.GetConstrainedEdgeCCW(op); -- ce4 = ot.GetConstrainedEdgeCW(op); -- -- bool de1, de2, de3, de4; -- de1 = t.GetDelunayEdgeCCW(p); -- de2 = t.GetDelunayEdgeCW(p); -- de3 = ot.GetDelunayEdgeCCW(op); -- de4 = ot.GetDelunayEdgeCW(op); -- -- t.Legalize(p, op); -- ot.Legalize(op, p); -- -- // Remap delaunay_edge -- ot.SetDelunayEdgeCCW(p, de1); -- t.SetDelunayEdgeCW(p, de2); -- t.SetDelunayEdgeCCW(op, de3); -- ot.SetDelunayEdgeCW(op, de4); -- -- // Remap constrained_edge -- ot.SetConstrainedEdgeCCW(p, ce1); -- t.SetConstrainedEdgeCW(p, ce2); -- t.SetConstrainedEdgeCCW(op, ce3); -- ot.SetConstrainedEdgeCW(op, ce4); -- -- // Remap neighbors -- // XXX: might optimize the markNeighbor by keeping track of -- // what side should be assigned to what neighbor after the -- // rotation. Now mark neighbor does lots of testing to find -- // the right side. -- t.ClearNeighbors(); -- ot.ClearNeighbors(); -- if (n1) ot.MarkNeighbor(*n1); -- if (n2) t.MarkNeighbor(*n2); -- if (n3) t.MarkNeighbor(*n3); -- if (n4) ot.MarkNeighbor(*n4); -- t.MarkNeighbor(ot); --} -- --void Sweep::FillBasin(SweepContext& tcx, Node& node) --{ -- if (Orient2d(*node.point, *node.next->point, *node.next->next->point) == CCW) { -- tcx.basin.left_node = node.next->next; -- } else { -- tcx.basin.left_node = node.next; -- } -- -- // Find the bottom and right node -- tcx.basin.bottom_node = tcx.basin.left_node; -- while (tcx.basin.bottom_node->next -- && tcx.basin.bottom_node->point->y >= tcx.basin.bottom_node->next->point->y) { -- tcx.basin.bottom_node = tcx.basin.bottom_node->next; -- } -- if (tcx.basin.bottom_node == tcx.basin.left_node) { -- // No valid basin -- return; -- } -- -- tcx.basin.right_node = tcx.basin.bottom_node; -- while (tcx.basin.right_node->next -- && tcx.basin.right_node->point->y < tcx.basin.right_node->next->point->y) { -- tcx.basin.right_node = tcx.basin.right_node->next; -- } -- if (tcx.basin.right_node == tcx.basin.bottom_node) { -- // No valid basins -- return; -- } -- -- tcx.basin.width = tcx.basin.right_node->point->x - tcx.basin.left_node->point->x; -- tcx.basin.left_highest = tcx.basin.left_node->point->y > tcx.basin.right_node->point->y; -- -- FillBasinReq(tcx, tcx.basin.bottom_node); --} -- --void Sweep::FillBasinReq(SweepContext& tcx, Node* node) --{ -- // if shallow stop filling -- if (IsShallow(tcx, *node)) { -- return; -- } -- -- Fill(tcx, *node); -- -- if (node->prev == tcx.basin.left_node && node->next == tcx.basin.right_node) { -- return; -- } else if (node->prev == tcx.basin.left_node) { -- Orientation o = Orient2d(*node->point, *node->next->point, *node->next->next->point); -- if (o == CW) { -- return; -- } -- node = node->next; -- } else if (node->next == tcx.basin.right_node) { -- Orientation o = Orient2d(*node->point, *node->prev->point, *node->prev->prev->point); -- if (o == CCW) { -- return; -- } -- node = node->prev; -- } else { -- // Continue with the neighbor node with lowest Y value -- if (node->prev->point->y < node->next->point->y) { -- node = node->prev; -- } else { -- node = node->next; -- } -- } -- -- FillBasinReq(tcx, node); --} -- --bool Sweep::IsShallow(SweepContext& tcx, Node& node) --{ -- double height; -- -- if (tcx.basin.left_highest) { -- height = tcx.basin.left_node->point->y - node.point->y; -- } else { -- height = tcx.basin.right_node->point->y - node.point->y; -- } -- -- // if shallow stop filling -- if (tcx.basin.width > height) { -- return true; -- } -- return false; --} -- --void Sweep::FillEdgeEvent(SweepContext& tcx, Edge* edge, Node* node) --{ -- if (tcx.edge_event.right) { -- FillRightAboveEdgeEvent(tcx, edge, node); -- } else { -- FillLeftAboveEdgeEvent(tcx, edge, node); -- } --} -- --void Sweep::FillRightAboveEdgeEvent(SweepContext& tcx, Edge* edge, Node* node) --{ -- while (node->next->point->x < edge->p->x) { -- // Check if next node is below the edge -- if (Orient2d(*edge->q, *node->next->point, *edge->p) == CCW) { -- FillRightBelowEdgeEvent(tcx, edge, *node); -- } else { -- node = node->next; -- } -- } --} -- --void Sweep::FillRightBelowEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) --{ -- if (node.point->x < edge->p->x) { -- if (Orient2d(*node.point, *node.next->point, *node.next->next->point) == CCW) { -- // Concave -- FillRightConcaveEdgeEvent(tcx, edge, node); -- } else { -- // Convex -- FillRightConvexEdgeEvent(tcx, edge, node); -- // Retry this one -- FillRightBelowEdgeEvent(tcx, edge, node); -- } -- } --} -- --void Sweep::FillRightConcaveEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) --{ -- Fill(tcx, *node.next); -- if (node.next->point != edge->p) { -- // Next above or below edge? -- if (Orient2d(*edge->q, *node.next->point, *edge->p) == CCW) { -- // Below -- if (Orient2d(*node.point, *node.next->point, *node.next->next->point) == CCW) { -- // Next is concave -- FillRightConcaveEdgeEvent(tcx, edge, node); -- } else { -- // Next is convex -- } -- } -- } --} -- --void Sweep::FillRightConvexEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) --{ -- // Next concave or convex? -- if (Orient2d(*node.next->point, *node.next->next->point, *node.next->next->next->point) == CCW) { -- // Concave -- FillRightConcaveEdgeEvent(tcx, edge, *node.next); -- } else { -- // Convex -- // Next above or below edge? -- if (Orient2d(*edge->q, *node.next->next->point, *edge->p) == CCW) { -- // Below -- FillRightConvexEdgeEvent(tcx, edge, *node.next); -- } else { -- // Above -- } -- } --} -- --void Sweep::FillLeftAboveEdgeEvent(SweepContext& tcx, Edge* edge, Node* node) --{ -- while (node->prev->point->x > edge->p->x) { -- // Check if next node is below the edge -- if (Orient2d(*edge->q, *node->prev->point, *edge->p) == CW) { -- FillLeftBelowEdgeEvent(tcx, edge, *node); -- } else { -- node = node->prev; -- } -- } --} -- --void Sweep::FillLeftBelowEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) --{ -- if (node.point->x > edge->p->x) { -- if (Orient2d(*node.point, *node.prev->point, *node.prev->prev->point) == CW) { -- // Concave -- FillLeftConcaveEdgeEvent(tcx, edge, node); -- } else { -- // Convex -- FillLeftConvexEdgeEvent(tcx, edge, node); -- // Retry this one -- FillLeftBelowEdgeEvent(tcx, edge, node); -- } -- } --} -- --void Sweep::FillLeftConvexEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) --{ -- // Next concave or convex? -- if (Orient2d(*node.prev->point, *node.prev->prev->point, *node.prev->prev->prev->point) == CW) { -- // Concave -- FillLeftConcaveEdgeEvent(tcx, edge, *node.prev); -- } else { -- // Convex -- // Next above or below edge? -- if (Orient2d(*edge->q, *node.prev->prev->point, *edge->p) == CW) { -- // Below -- FillLeftConvexEdgeEvent(tcx, edge, *node.prev); -- } else { -- // Above -- } -- } --} -- --void Sweep::FillLeftConcaveEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) --{ -- Fill(tcx, *node.prev); -- if (node.prev->point != edge->p) { -- // Next above or below edge? -- if (Orient2d(*edge->q, *node.prev->point, *edge->p) == CW) { -- // Below -- if (Orient2d(*node.point, *node.prev->point, *node.prev->prev->point) == CW) { -- // Next is concave -- FillLeftConcaveEdgeEvent(tcx, edge, node); -- } else { -- // Next is convex -- } -- } -- } --} -- --void Sweep::FlipEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* t, Point& p) --{ -- assert(t); -- Triangle* ot_ptr = t->NeighborAcross(p); -- if (ot_ptr == nullptr) -- { -- throw std::runtime_error("FlipEdgeEvent - null neighbor across"); -- } -- Triangle& ot = *ot_ptr; -- Point& op = *ot.OppositePoint(*t, p); -- -- if (InScanArea(p, *t->PointCCW(p), *t->PointCW(p), op)) { -- // Lets rotate shared edge one vertex CW -- RotateTrianglePair(*t, p, ot, op); -- tcx.MapTriangleToNodes(*t); -- tcx.MapTriangleToNodes(ot); -- -- if (p == eq && op == ep) { -- if (eq == *tcx.edge_event.constrained_edge->q && ep == *tcx.edge_event.constrained_edge->p) { -- t->MarkConstrainedEdge(&ep, &eq); -- ot.MarkConstrainedEdge(&ep, &eq); -- Legalize(tcx, *t); -- Legalize(tcx, ot); -- } else { -- // XXX: I think one of the triangles should be legalized here? -- } -- } else { -- Orientation o = Orient2d(eq, op, ep); -- t = &NextFlipTriangle(tcx, (int)o, *t, ot, p, op); -- FlipEdgeEvent(tcx, ep, eq, t, p); -- } -- } else { -- Point& newP = NextFlipPoint(ep, eq, ot, op); -- FlipScanEdgeEvent(tcx, ep, eq, *t, ot, newP); -- EdgeEvent(tcx, ep, eq, t, p); -- } --} -- --Triangle& Sweep::NextFlipTriangle(SweepContext& tcx, int o, Triangle& t, Triangle& ot, Point& p, Point& op) --{ -- if (o == CCW) { -- // ot is not crossing edge after flip -- int edge_index = ot.EdgeIndex(&p, &op); -- ot.delaunay_edge[edge_index] = true; -- Legalize(tcx, ot); -- ot.ClearDelunayEdges(); -- return t; -- } -- -- // t is not crossing edge after flip -- int edge_index = t.EdgeIndex(&p, &op); -- -- t.delaunay_edge[edge_index] = true; -- Legalize(tcx, t); -- t.ClearDelunayEdges(); -- return ot; --} -- --Point& Sweep::NextFlipPoint(Point& ep, Point& eq, Triangle& ot, Point& op) --{ -- Orientation o2d = Orient2d(eq, op, ep); -- if (o2d == CW) { -- // Right -- return *ot.PointCCW(op); -- } else if (o2d == CCW) { -- // Left -- return *ot.PointCW(op); -- } -- throw std::runtime_error("[Unsupported] Opposing point on constrained edge"); --} -- --void Sweep::FlipScanEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle& flip_triangle, -- Triangle& t, Point& p) --{ -- Triangle* ot_ptr = t.NeighborAcross(p); -- if (ot_ptr == nullptr) { -- throw std::runtime_error("FlipScanEdgeEvent - null neighbor across"); -- } -- -- Point* op_ptr = ot_ptr->OppositePoint(t, p); -- if (op_ptr == nullptr) { -- throw std::runtime_error("FlipScanEdgeEvent - null opposing point"); -- } -- -- Point* p1 = flip_triangle.PointCCW(eq); -- Point* p2 = flip_triangle.PointCW(eq); -- if (p1 == nullptr || p2 == nullptr) { -- throw std::runtime_error("FlipScanEdgeEvent - null on either of points"); -- } -- -- Triangle& ot = *ot_ptr; -- Point& op = *op_ptr; -- -- if (InScanArea(eq, *p1, *p2, op)) { -- // flip with new edge op->eq -- FlipEdgeEvent(tcx, eq, op, &ot, op); -- // TODO: Actually I just figured out that it should be possible to -- // improve this by getting the next ot and op before the the above -- // flip and continue the flipScanEdgeEvent here -- // set new ot and op here and loop back to inScanArea test -- // also need to set a new flip_triangle first -- // Turns out at first glance that this is somewhat complicated -- // so it will have to wait. -- } else { -- Point& newP = NextFlipPoint(ep, eq, ot, op); -- FlipScanEdgeEvent(tcx, ep, eq, flip_triangle, ot, newP); -- } --} -- --Sweep::~Sweep() { -- -- // Clean up memory -- for (auto& node : nodes_) { -- delete node; -- } --} -+ // Triangulate simple polygon with holes -+ void Sweep::Triangulate(SweepContext& tcx, bool finalize, int num_points, long maxtime) -+ { -+ tri_start_time = std::chrono::steady_clock::now(); -+ timeout = (maxtime > 0) ? maxtime : LONG_MAX; -+ tcx.InitTriangulation(); -+ tcx.CreateAdvancingFront(nodes_); -+ // Sweep points; build mesh -+ SweepPoints(tcx,num_points); -+ // Clean up -+ if (finalize) { -+ FinalizationPolygon(tcx); -+ } -+ -+ curr_time = std::chrono::steady_clock::now(); -+ //std::cout << "triangulation time (microseconds): " << std::chrono::duration_cast(curr_time - tri_start_time).count() << "\n"; -+ } -+ -+ void Sweep::SweepPoints(SweepContext& tcx, int num_points) -+ { -+ double currentheight = tcx.GetPoint(0)->y; -+ for (size_t i = 1; (i < tcx.point_count()) && (i <= num_points); i++) { -+ Point& point = *tcx.GetPoint(i); -+ if (point.y > currentheight) { -+ CheckCircleEvent(tcx,point.y); -+ currentheight = point.y; -+ } -+ Node* node = &PointEvent(tcx, point); -+ for (size_t j = 0; j < point.edge_list.size(); j++) { -+ EdgeEvent(tcx, point.edge_list[j], node); -+ } -+ } -+ } -+ -+ Triangle* Sweep::FindInternalTriangle(Triangle* ext_tri) -+ { -+ Triangle* t = NULL; -+ -+ if (ext_tri != NULL) { -+ if (ext_tri->constrained_edge[0]) { -+ return ext_tri->GetNeighbor(0); -+ } else if (ext_tri->constrained_edge[1]) { -+ return ext_tri->GetNeighbor(1); -+ } else if (ext_tri->constrained_edge[2]) { -+ return ext_tri->GetNeighbor(2); -+ } else { -+ ext_tri->IsChecked(true); -+ for(int i=0; i<3; i++) { -+ Triangle* n = ext_tri->GetNeighbor(i); -+ if ((n != NULL) && (!n->IsChecked())) { -+ t = FindInternalTriangle(n); -+ if (t != NULL) -+ break; -+ } -+ } -+ } -+ } -+ return t; -+ } -+ -+ void Sweep::FinalizationPolygon(SweepContext& tcx) -+ { -+ // Get an Internal triangle to start with -+ Triangle* t = FindInternalTriangle(tcx.af_tail_->triangle); -+ if (!t) return; -+ -+ // Collect interior triangles constrained by edges -+ tcx.MeshClean(*t); -+ } -+ -+ Node& Sweep::PointEvent(SweepContext& tcx, Point& point) -+ { -+ Node& node = tcx.LocateNode(point); -+ Node& new_node = NewFrontTriangle(tcx, point, node); -+ -+ // Only need to check +epsilon since point never have smaller -+ // x value than node due to how we fetch nodes from the front -+ if (point.x <= node.point->x + EPSILON) { -+ Fill(tcx, node); -+ } -+ -+ //tcx.AddNode(new_node); -+ -+ FillAdvancingFront(tcx, new_node); -+ return new_node; -+ } -+ -+ void Sweep::EdgeEvent(SweepContext& tcx, Edge* edge, Node* node) -+ { -+ tcx.edge_event.constrained_edge = edge; -+ tcx.edge_event.right = (edge->p->x > edge->q->x); -+ -+ if (IsEdgeSideOfTriangle(*node->triangle, *edge->p, *edge->q)) { -+ return; -+ } -+ -+ // For now we will do all needed filling -+ // TODO: integrate with flip process might give some better performance -+ // but for now this avoid the issue with cases that needs both flips and fills -+ FillEdgeEvent(tcx, edge, node); -+ EdgeEvent(tcx, *edge->p, *edge->q, node->triangle, *edge->q); -+ } -+ -+ void Sweep::EdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* triangle, Point& point) -+ { -+ if (IsEdgeSideOfTriangle(*triangle, ep, eq)) { -+ return; -+ } -+ -+ Point* p1 = triangle->PointCCW(point); -+ Orientation o1 = Orient2d(eq, *p1, ep); -+ if (o1 == COLLINEAR) { -+ if( triangle->Contains(&eq, p1)) { -+ triangle->MarkConstrainedEdge(&eq, p1 ); -+ // We are modifying the constraint maybe it would be better to -+ // not change the given constraint and just keep a variable for the new constraint -+ tcx.edge_event.constrained_edge->q = p1; -+ triangle = triangle->NeighborAcross(point); -+ EdgeEvent( tcx, ep, *p1, triangle, *p1 ); -+ } else { -+ std::runtime_error("EdgeEvent - collinear points not supported"); -+ } -+ return; -+ } -+ -+ Point* p2 = triangle->PointCW(point); -+ Orientation o2 = Orient2d(eq, *p2, ep); -+ if (o2 == COLLINEAR) { -+ if( triangle->Contains(&eq, p2)) { -+ triangle->MarkConstrainedEdge(&eq, p2 ); -+ // We are modifying the constraint maybe it would be better to -+ // not change the given constraint and just keep a variable for the new constraint -+ tcx.edge_event.constrained_edge->q = p2; -+ triangle = triangle->NeighborAcross(point); -+ EdgeEvent( tcx, ep, *p2, triangle, *p2 ); -+ } else { -+ std::runtime_error("EdgeEvent - collinear points not supported"); -+ } -+ return; -+ } -+ -+ if (o1 == o2) { -+ // Need to decide if we are rotating CW or CCW to get to a triangle -+ // that will cross edge -+ if (o1 == CW) { -+ triangle = triangle->NeighborCCW(point); -+ } else{ -+ triangle = triangle->NeighborCW(point); -+ } -+ EdgeEvent(tcx, ep, eq, triangle, point); -+ } else { -+ // This triangle crosses constraint so lets flippin start! -+ FlipEdgeEvent(tcx, ep, eq, triangle, point); -+ } -+ } -+ -+ bool Sweep::IsEdgeSideOfTriangle(Triangle& triangle, Point& ep, Point& eq) -+ { -+ if (&triangle == NULL) -+ throw std::runtime_error("NULL triangle(?)"); -+ -+ int index = triangle.EdgeIndex(&ep, &eq); -+ -+ if (index != -1) { -+ triangle.MarkConstrainedEdge(index); -+ Triangle* t = triangle.GetNeighbor(index); -+ if (t) { -+ t->MarkConstrainedEdge(&ep, &eq); -+ } -+ return true; -+ } -+ return false; -+ } -+ -+ Node& Sweep::NewFrontTriangle(SweepContext& tcx, Point& point, Node& node) -+ { -+ Triangle* triangle = new Triangle(point, *node.point, *node.next->point); -+ -+ triangle->MarkNeighbor(*node.triangle); -+ tcx.AddToMap(triangle); -+ -+ Node* new_node = new Node(point); -+ nodes_.push_back(new_node); -+ -+ new_node->next = node.next; -+ new_node->prev = &node; -+ node.next->prev = new_node; -+ node.next = new_node; -+ -+ if (new_node->next) -+ UpdateNodeAngleCircum(*new_node->next); -+ -+ UpdateNodeAngleCircum(*new_node); -+ -+ if (new_node->prev) -+ UpdateNodeAngleCircum(*new_node->prev); -+ -+ if (!Legalize(tcx, *triangle)) { -+ tcx.MapTriangleToNodes(*triangle); -+ } -+ -+ return *new_node; -+ } -+ -+ void Sweep::UpdateNodeAngleCircum(Node& n) -+ { -+ if (n.next && n.prev) { -+ Point* nextPoint = n.next->point; -+ Point* prevPoint = n.prev->point; -+ -+ n.angle = Angle(*n.point, *nextPoint, *prevPoint); -+ -+ if ((n.angle > 0) && (n.angle < M_PI)) { -+ Point center; -+ double radius; -+ n.circum = Circumcircle(*n.point, *nextPoint, *prevPoint, center, radius); -+ if (n.circum) { -+ n.circumheight = center.y + radius; -+ } -+ } -+ } -+ } -+ -+ void Sweep::Fill(SweepContext& tcx, Node& node) -+ { -+ Triangle* triangle = new Triangle(*node.prev->point, *node.point, *node.next->point); -+ -+ // TODO: should copy the constrained_edge value from neighbor triangles -+ // for now constrained_edge values are copied during the legalize -+ triangle->MarkNeighbor(*node.prev->triangle); -+ triangle->MarkNeighbor(*node.triangle); -+ -+ tcx.AddToMap(triangle); -+ -+ // Update the advancing front -+ node.prev->next = node.next; -+ node.next->prev = node.prev; -+ if (node.next) -+ UpdateNodeAngleCircum(*node.next); -+ -+ if (node.prev) -+ UpdateNodeAngleCircum(*node.prev); -+ -+ // If it was legalized the triangle has already been mapped -+ if (!Legalize(tcx, *triangle)) { -+ tcx.MapTriangleToNodes(*triangle); -+ } -+ -+ } -+ -+ void Sweep::CheckCircleEvent(SweepContext& tcx, double currentheight) -+ { -+ Node *node = tcx.front()->head(); -+ -+ while (node->next) { -+ // if HoleAngle exceeds 90 degrees then break. -+ if (node->circum && (node->circumheight < currentheight)) { -+ Fill(tcx, *node); -+ node = node->prev; -+ } else { -+ node = node->next; -+ } -+ } -+ } -+ -+ void Sweep::FillAdvancingFront(SweepContext& tcx, Node& n) -+ { -+ -+ curr_time = std::chrono::steady_clock::now(); -+ if (std::chrono::duration_cast(curr_time - tri_start_time).count() > timeout) -+ throw std::runtime_error("Poly2Tri timeout"); -+ -+ // Fill right holes -+ Node* node = n.next; -+ Node* leftboundnode = NULL; -+ -+ while (node->next) { -+ // if HoleAngle exceeds 90 degrees then break. -+ if (LargeHole_DontFill(node)) break; -+ Fill(tcx, *node); -+ node = node->next; -+ } -+ -+ // Fill left holes -+ node = n.prev; -+ -+ while (node->prev) { -+ // if HoleAngle exceeds 90 degrees then break. -+ if (LargeHole_DontFill(node)) break; -+ Fill(tcx, *node); -+ node = node->prev; -+ } -+ -+ node = n.prev; -+ if (node->point->x < n.point->x) { -+ node = node->prev; -+ while (node) { -+ // if HoleAngle exceeds 90 degrees then break. -+ if (node->point->x >= n.point->x) { -+ leftboundnode = node; -+ } -+ node = node->prev; -+ } -+ if (leftboundnode) { -+ node = n.prev; -+ while (node != leftboundnode) { -+ Fill(tcx, *node); -+ node = node->prev; -+ } -+ } -+ } -+ -+ // Fill right basins -+ if (n.next && n.next->next) { -+ double angle = BasinAngle(n); -+ if (angle < PI_3div4) { -+ FillBasin(tcx, n); -+ } -+ } -+ } -+ -+ // True if HoleAngle exceeds 90 degrees. -+ // LargeHole_DontFill checks if the advancing front has a large hole. -+ // A "Large hole" is a triangle formed by a sequence of points in the advancing -+ // front where three neighbor points form a triangle. -+ // And angle between left-top, bottom, and right-top points is more than 90 degrees. -+ // The first part of the algorithm reviews only three neighbor points, e.g. named A, B, C. -+ // Additional part of this logic reviews a sequence of 5 points - -+ // additionally reviews one point before and one after the sequence of three (A, B, C), -+ // e.g. named X and Y. -+ // In this case, angles are XBC and ABY and this if angles are negative or more -+ // than 90 degrees LargeHole_DontFill returns true. -+ // But there is a configuration when ABC has a negative angle but XBC or ABY is less -+ // than 90 degrees and positive. -+ // Then function LargeHole_DontFill return false and initiates filling. -+ // This filling creates a triangle ABC and adds it to the advancing front. -+ // But in the case when angle ABC is negative this triangle goes inside the advancing front -+ // and can intersect previously created triangles. -+ // This triangle leads to making wrong advancing front and problems in triangulation in the future. -+ // Looks like such a triangle should not be created. -+ // The simplest way to check and fix it is to check an angle ABC. -+ // If it is negative LargeHole_DontFill should return true and -+ // not initiate creating the ABC triangle in the advancing front. -+ // X______A Y -+ // \ / -+ // \ / -+ // \ B / -+ // | / -+ // | / -+ // |/ -+ // C -+ bool Sweep::LargeHole_DontFill(const Node* node) const { -+ -+ const Node* nextNode = node->next; -+ const Node* prevNode = node->prev; -+ if (!AngleExceeds90Degrees(node->point, nextNode->point, prevNode->point)) -+ return false; -+ -+ if (AngleIsNegative(node->point, nextNode->point, prevNode->point)) -+ return true; -+ -+ // Check additional points on front. -+ const Node* next2Node = nextNode->next; -+ // "..Plus.." because only want angles on same side as point being added. -+ if ((next2Node != nullptr) && !AngleExceedsPlus90DegreesOrIsNegative(node->point, next2Node->point, prevNode->point)) -+ return false; -+ -+ const Node* prev2Node = prevNode->prev; -+ // "..Plus.." because only want angles on same side as point being added. -+ if ((prev2Node != nullptr) && !AngleExceedsPlus90DegreesOrIsNegative(node->point, nextNode->point, prev2Node->point)) -+ return false; -+ -+ return true; -+ } -+ -+ bool Sweep::AngleIsNegative(const Point* origin, const Point* pa, const Point* pb) const { -+ const double angle = Angle(*origin, *pa, *pb); -+ return angle < 0; -+ } -+ -+ bool Sweep::AngleExceeds90Degrees(const Point* origin, const Point* pa, const Point* pb) const { -+ double angle = Angle(*origin, *pa, *pb); -+ bool exceeds90Degrees = ((angle > PI_div2) || (angle < -PI_div2)); -+ return exceeds90Degrees; -+ } -+ -+ bool Sweep::AngleExceedsPlus90DegreesOrIsNegative(const Point* origin, const Point* pa, const Point* pb) const { -+ double angle = Angle(*origin, *pa, *pb); -+ bool exceedsPlus90DegreesOrIsNegative = (angle > PI_div2) || (angle < 0); -+ return exceedsPlus90DegreesOrIsNegative; -+ } -+ -+ double Sweep::Angle(const Point& origin, const Point& pa, const Point& pb) const { -+ /* Complex plane -+ * ab = cosA +i*sinA -+ * ab = (ax + ay*i)(bx + by*i) = (ax*bx + ay*by) + i(ax*by-ay*bx) -+ * atan2(y,x) computes the principal value of the argument function -+ * applied to the complex number x+iy -+ * Where x = ax*bx + ay*by -+ * y = ax*by - ay*bx -+ */ -+ double px = origin.x; -+ double py = origin.y; -+ double ax = pa.x- px; -+ double ay = pa.y - py; -+ double bx = pb.x - px; -+ double by = pb.y - py; -+ double x = ax * by - ay * bx; -+ double y = ax * bx + ay * by; -+ double angle = atan2(x, y); -+ return angle; -+ } -+ -+ double Sweep::BasinAngle(Node& node) -+ { -+ double ax = node.point->x - node.next->next->point->x; -+ double ay = node.point->y - node.next->next->point->y; -+ return atan2(ay, ax); -+ } -+ -+ double Sweep::HoleAngle(Node& node) -+ { -+ /* Complex plane -+ * ab = cosA +i*sinA -+ * ab = (ax + ay*i)(bx + by*i) = (ax*bx + ay*by) + i(ax*by-ay*bx) -+ * atan2(y,x) computes the principal value of the argument function -+ * applied to the complex number x+iy -+ * Where x = ax*bx + ay*by -+ * y = ax*by - ay*bx -+ */ -+ double ax = node.next->point->x - node.point->x; -+ double ay = node.next->point->y - node.point->y; -+ double bx = node.prev->point->x - node.point->x; -+ double by = node.prev->point->y - node.point->y; -+ return atan2(ax * by - ay * bx, ax * bx + ay * by); -+ } -+ -+ bool Sweep::Legalize(SweepContext& tcx, Triangle& t) -+ { -+ // To legalize a triangle we start by finding if any of the three edges -+ // violate the Delaunay condition -+ for (int i = 0; i < 3; i++) { -+ if (t.delaunay_edge[i]) -+ continue; -+ -+ Triangle* ot = t.GetNeighbor(i); -+ -+ if (ot) { -+ Point* p = t.GetPoint(i); -+ Point* op = ot->OppositePoint(t, *p); -+ int oi = ot->Index(op); -+ if (oi < 0) return false; -+ -+ // If this is a Constrained Edge or a Delaunay Edge(only during recursive legalization) -+ // then we should not try to legalize -+ if (ot->constrained_edge[oi] || ot->delaunay_edge[oi]) { -+ t.constrained_edge[i] = ot->constrained_edge[oi]; -+ continue; -+ } -+ -+ bool inside = Incircle(*p, *t.PointCCW(*p), *t.PointCW(*p), *op); -+ -+ if (inside) { -+ // Lets mark this shared edge as Delaunay -+ t.delaunay_edge[i] = true; -+ ot->delaunay_edge[oi] = true; -+ -+ // Lets rotate shared edge one vertex CW to legalize it -+ RotateTrianglePair(t, *p, *ot, *op); -+ -+ // We now got one valid Delaunay Edge shared by two triangles -+ // This gives us 4 new edges to check for Delaunay -+ -+ // Make sure that triangle to node mapping is done only one time for a specific triangle -+ bool not_legalized = !Legalize(tcx, t); -+ if (not_legalized) { -+ tcx.MapTriangleToNodes(t); -+ } -+ -+ not_legalized = !Legalize(tcx, *ot); -+ if (not_legalized) -+ tcx.MapTriangleToNodes(*ot); -+ -+ // Reset the Delaunay edges, since they only are valid Delaunay edges -+ // until we add a new triangle or point. -+ // XXX: need to think about this. Can these edges be tried after we -+ // return to previous recursive level? -+ t.delaunay_edge[i] = false; -+ ot->delaunay_edge[oi] = false; -+ -+ // If triangle have been legalized no need to check the other edges since -+ // the recursive legalization will handles those so we can end here. -+ return true; -+ } -+ } -+ } -+ return false; -+ } -+ -+ bool Sweep::Circumcircle(const Point& a, const Point& b, const Point& c, Point& center, double &radius) -+ { -+ double cross_product = Cross(a - b,b - c); -+ -+ if (cross_product > DBL_MIN) { -+ double cp2 = cross_product * cross_product; -+ double dotp_a = Dot(a - b,a - c); -+ double dotp_b = Dot(b - a,b - c); -+ double dotp_c = Dot(c - a,c - b); -+ double ablen = (a -b).Length(); -+ double bclen = (b-c).Length(); -+ double calen = (c-a).Length(); -+ -+ radius = ablen * bclen * calen / (2.0 * cross_product); -+ -+ double alpha = bclen * bclen * dotp_a / (2.0 * cp2); -+ double beta = calen * calen * dotp_b / (2.0 * cp2); -+ double gamma = ablen * ablen * dotp_c / (2.0 * cp2); -+ -+ center = alpha * a + beta * b + gamma * c; -+ } else { -+ return false; -+ } -+ return true; -+ } -+ -+ bool Sweep::Incircle(Point& pa, Point& pb, Point& pc, Point& pd) -+ { -+ double adx = pa.x - pd.x; -+ double ady = pa.y - pd.y; -+ double bdx = pb.x - pd.x; -+ double bdy = pb.y - pd.y; -+ -+ double adxbdy = adx * bdy; -+ double bdxady = bdx * ady; -+ double oabd = adxbdy - bdxady; -+ -+ if (oabd <= 0) -+ return false; -+ -+ double cdx = pc.x - pd.x; -+ double cdy = pc.y - pd.y; -+ -+ double cdxady = cdx * ady; -+ double adxcdy = adx * cdy; -+ double ocad = cdxady - adxcdy; -+ -+ if (ocad <= 0) -+ return false; -+ -+ double bdxcdy = bdx * cdy; -+ double cdxbdy = cdx * bdy; -+ -+ double alift = adx * adx + ady * ady; -+ double blift = bdx * bdx + bdy * bdy; -+ double clift = cdx * cdx + cdy * cdy; -+ -+ double det = alift * (bdxcdy - cdxbdy) + blift * ocad + clift * oabd; -+ -+ return det > 0; -+ } -+ -+ void Sweep::RotateTrianglePair(Triangle& t, Point& p, Triangle& ot, Point& op) -+ { -+ Triangle* n1, *n2, *n3, *n4; -+ n1 = t.NeighborCCW(p); -+ n2 = t.NeighborCW(p); -+ n3 = ot.NeighborCCW(op); -+ n4 = ot.NeighborCW(op); -+ -+ bool ce1, ce2, ce3, ce4; -+ ce1 = t.GetConstrainedEdgeCCW(p); -+ ce2 = t.GetConstrainedEdgeCW(p); -+ ce3 = ot.GetConstrainedEdgeCCW(op); -+ ce4 = ot.GetConstrainedEdgeCW(op); -+ -+ bool de1, de2, de3, de4; -+ de1 = t.GetDelunayEdgeCCW(p); -+ de2 = t.GetDelunayEdgeCW(p); -+ de3 = ot.GetDelunayEdgeCCW(op); -+ de4 = ot.GetDelunayEdgeCW(op); -+ -+ t.Legalize(p, op); -+ ot.Legalize(op, p); -+ -+ // Remap delaunay_edge -+ ot.SetDelunayEdgeCCW(p, de1); -+ t.SetDelunayEdgeCW(p, de2); -+ t.SetDelunayEdgeCCW(op, de3); -+ ot.SetDelunayEdgeCW(op, de4); -+ -+ // Remap constrained_edge -+ ot.SetConstrainedEdgeCCW(p, ce1); -+ t.SetConstrainedEdgeCW(p, ce2); -+ t.SetConstrainedEdgeCCW(op, ce3); -+ ot.SetConstrainedEdgeCW(op, ce4); -+ -+ // Remap neighbors -+ // XXX: might optimize the markNeighbor by keeping track of -+ // what side should be assigned to what neighbor after the -+ // rotation. Now mark neighbor does lots of testing to find -+ // the right side. -+ t.ClearNeighbors(); -+ ot.ClearNeighbors(); -+ if (n1) ot.MarkNeighbor(*n1); -+ if (n2) t.MarkNeighbor(*n2); -+ if (n3) t.MarkNeighbor(*n3); -+ if (n4) ot.MarkNeighbor(*n4); -+ t.MarkNeighbor(ot); -+ } -+ -+ void Sweep::FillBasin(SweepContext& tcx, Node& node) -+ { -+ if (Orient2d(*node.point, *node.next->point, *node.next->next->point) == CCW) { -+ tcx.basin.left_node = node.next->next; -+ } else { -+ tcx.basin.left_node = node.next; -+ } -+ -+ // Find the bottom and right node -+ tcx.basin.bottom_node = tcx.basin.left_node; -+ while (tcx.basin.bottom_node->next -+ && tcx.basin.bottom_node->point->y >= tcx.basin.bottom_node->next->point->y) { -+ tcx.basin.bottom_node = tcx.basin.bottom_node->next; -+ } -+ if (tcx.basin.bottom_node == tcx.basin.left_node) { -+ // No valid basin -+ return; -+ } -+ -+ tcx.basin.right_node = tcx.basin.bottom_node; -+ while (tcx.basin.right_node->next -+ && tcx.basin.right_node->point->y < tcx.basin.right_node->next->point->y) { -+ tcx.basin.right_node = tcx.basin.right_node->next; -+ } -+ if (tcx.basin.right_node == tcx.basin.bottom_node) { -+ // No valid basins -+ return; -+ } -+ -+ tcx.basin.width = tcx.basin.right_node->point->x - tcx.basin.left_node->point->x; -+ tcx.basin.left_highest = tcx.basin.left_node->point->y > tcx.basin.right_node->point->y; -+ -+ FillBasinReq(tcx, tcx.basin.bottom_node); -+ } -+ -+ void Sweep::FillBasinReq(SweepContext& tcx, Node* node) -+ { -+ // if shallow stop filling -+ if (IsShallow(tcx, *node)) { -+ return; -+ } -+ -+ Fill(tcx, *node); -+ -+ if (node->prev == tcx.basin.left_node && node->next == tcx.basin.right_node) { -+ return; -+ } else if (node->prev == tcx.basin.left_node) { -+ Orientation o = Orient2d(*node->point, *node->next->point, *node->next->next->point); -+ if (o == CW) { -+ return; -+ } -+ node = node->next; -+ } else if (node->next == tcx.basin.right_node) { -+ Orientation o = Orient2d(*node->point, *node->prev->point, *node->prev->prev->point); -+ if (o == CCW) { -+ return; -+ } -+ node = node->prev; -+ } else { -+ // Continue with the neighbor node with lowest Y value -+ if (node->prev->point->y < node->next->point->y) { -+ node = node->prev; -+ } else { -+ node = node->next; -+ } -+ } -+ -+ FillBasinReq(tcx, node); -+ } -+ -+ bool Sweep::IsShallow(SweepContext& tcx, Node& node) -+ { -+ double height; -+ -+ if (tcx.basin.left_highest) { -+ height = tcx.basin.left_node->point->y - node.point->y; -+ } else { -+ height = tcx.basin.right_node->point->y - node.point->y; -+ } -+ -+ // if shallow stop filling -+ if (tcx.basin.width > height) { -+ return true; -+ } -+ return false; -+ } -+ -+ void Sweep::FillEdgeEvent(SweepContext& tcx, Edge* edge, Node* node) -+ { -+ if (tcx.edge_event.right) { -+ FillRightAboveEdgeEvent(tcx, edge, node); -+ } else { -+ FillLeftAboveEdgeEvent(tcx, edge, node); -+ } -+ } -+ -+ void Sweep::FillRightAboveEdgeEvent(SweepContext& tcx, Edge* edge, Node* node) -+ { -+ while (node->next->point->x < edge->p->x) { -+ // Check if next node is below the edge -+ if (Orient2d(*edge->q, *node->next->point, *edge->p) == CCW) { -+ FillRightBelowEdgeEvent(tcx, edge, *node); -+ } else { -+ node = node->next; -+ } -+ } -+ } -+ -+ void Sweep::FillRightBelowEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) -+ { -+ if (node.point->x < edge->p->x) { -+ if (Orient2d(*node.point, *node.next->point, *node.next->next->point) == CCW) { -+ // Concave -+ FillRightConcaveEdgeEvent(tcx, edge, node); -+ } else{ -+ // Convex -+ FillRightConvexEdgeEvent(tcx, edge, node); -+ // Retry this one -+ FillRightBelowEdgeEvent(tcx, edge, node); -+ } -+ } -+ } -+ -+ void Sweep::FillRightConcaveEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) -+ { -+ Fill(tcx, *node.next); -+ if (node.next->point != edge->p) { -+ // Next above or below edge? -+ if (Orient2d(*edge->q, *node.next->point, *edge->p) == CCW) { -+ // Below -+ if (Orient2d(*node.point, *node.next->point, *node.next->next->point) == CCW) { -+ // Next is concave -+ FillRightConcaveEdgeEvent(tcx, edge, node); -+ } else { -+ // Next is convex -+ } -+ } -+ } -+ -+ } -+ -+ void Sweep::FillRightConvexEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) -+ { -+ // Next concave or convex? -+ if (Orient2d(*node.next->point, *node.next->next->point, *node.next->next->next->point) == CCW) { -+ // Concave -+ FillRightConcaveEdgeEvent(tcx, edge, *node.next); -+ } else{ -+ // Convex -+ // Next above or below edge? -+ if (Orient2d(*edge->q, *node.next->next->point, *edge->p) == CCW) { -+ // Below -+ FillRightConvexEdgeEvent(tcx, edge, *node.next); -+ } else{ -+ // Above -+ } -+ } -+ } -+ -+ void Sweep::FillLeftAboveEdgeEvent(SweepContext& tcx, Edge* edge, Node* node) -+ { -+ while (node->prev->point->x > edge->p->x) { -+ // Check if next node is below the edge -+ if (Orient2d(*edge->q, *node->prev->point, *edge->p) == CW) { -+ FillLeftBelowEdgeEvent(tcx, edge, *node); -+ } else { -+ node = node->prev; -+ } -+ } -+ } -+ -+ void Sweep::FillLeftBelowEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) -+ { -+ if (node.point->x > edge->p->x) { -+ if (Orient2d(*node.point, *node.prev->point, *node.prev->prev->point) == CW) { -+ // Concave -+ FillLeftConcaveEdgeEvent(tcx, edge, node); -+ } else { -+ // Convex -+ FillLeftConvexEdgeEvent(tcx, edge, node); -+ // Retry this one -+ FillLeftBelowEdgeEvent(tcx, edge, node); -+ } -+ } -+ } -+ -+ void Sweep::FillLeftConvexEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) -+ { -+ // Next concave or convex? -+ if (Orient2d(*node.prev->point, *node.prev->prev->point, *node.prev->prev->prev->point) == CW) { -+ // Concave -+ FillLeftConcaveEdgeEvent(tcx, edge, *node.prev); -+ } else{ -+ // Convex -+ // Next above or below edge? -+ if (Orient2d(*edge->q, *node.prev->prev->point, *edge->p) == CW) { -+ // Below -+ FillLeftConvexEdgeEvent(tcx, edge, *node.prev); -+ } else{ -+ // Above -+ } -+ } -+ } -+ -+ void Sweep::FillLeftConcaveEdgeEvent(SweepContext& tcx, Edge* edge, Node& node) -+ { -+ Fill(tcx, *node.prev); -+ if (node.prev->point != edge->p) { -+ // Next above or below edge? -+ if (Orient2d(*edge->q, *node.prev->point, *edge->p) == CW) { -+ // Below -+ if (Orient2d(*node.point, *node.prev->point, *node.prev->prev->point) == CW) { -+ // Next is concave -+ FillLeftConcaveEdgeEvent(tcx, edge, node); -+ } else{ -+ // Next is convex -+ } -+ } -+ } -+ -+ } -+ -+ void Sweep::FlipEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* t, Point& p) -+ { -+ Triangle& ot = *t->NeighborAcross(p); -+ Point& op = *ot.OppositePoint(*t, p); -+ -+ flip_edge_event_cnt++; -+ -+ if (flip_edge_event_cnt > 10000) { -+ throw std::runtime_error("FLIP edge event call stack too deep"); -+ } -+ -+ if (&ot == NULL) { -+ // If we want to integrate the fillEdgeEvent do it here -+ // With current implementation we should never get here -+ throw std::runtime_error( "[BUG:FIXME] FLIP failed due to missing triangle"); -+ } -+ -+ if (InScanArea(p, *t->PointCCW(p), *t->PointCW(p), op)) { -+ // Lets rotate shared edge one vertex CW -+ RotateTrianglePair(*t, p, ot, op); -+ tcx.MapTriangleToNodes(*t); -+ tcx.MapTriangleToNodes(ot); -+ -+ if (p == eq && op == ep) { -+ if (eq == *tcx.edge_event.constrained_edge->q && ep == *tcx.edge_event.constrained_edge->p) { -+ t->MarkConstrainedEdge(&ep, &eq); -+ ot.MarkConstrainedEdge(&ep, &eq); -+ Legalize(tcx, *t); -+ Legalize(tcx, ot); -+ } else { -+ // XXX: I think one of the triangles should be legalized here? -+ } -+ } else { -+ Orientation o = Orient2d(eq, op, ep); -+ t = &NextFlipTriangle(tcx, (int)o, *t, ot, p, op); -+ FlipEdgeEvent(tcx, ep, eq, t, p); -+ } -+ } else { -+ Point& newP = NextFlipPoint(ep, eq, ot, op); -+ FlipScanEdgeEvent(tcx, ep, eq, *t, ot, newP); -+ EdgeEvent(tcx, ep, eq, t, p); -+ } -+ -+ flip_edge_event_cnt--; -+ } -+ -+ Triangle& Sweep::NextFlipTriangle(SweepContext& tcx, int o, Triangle& t, Triangle& ot, Point& p, Point& op) -+ { -+ if (o == CCW) { -+ // ot is not crossing edge after flip -+ int edge_index = ot.EdgeIndex(&p, &op); -+ ot.delaunay_edge[edge_index] = true; -+ Legalize(tcx, ot); -+ ot.ClearDelunayEdges(); -+ return t; -+ } -+ -+ // t is not crossing edge after flip -+ int edge_index = t.EdgeIndex(&p, &op); -+ -+ t.delaunay_edge[edge_index] = true; -+ Legalize(tcx, t); -+ t.ClearDelunayEdges(); -+ return ot; -+ } -+ -+ Point& Sweep::NextFlipPoint(Point& ep, Point& eq, Triangle& ot, Point& op) -+ { -+ Orientation o2d = Orient2d(eq, op, ep); -+ if (o2d == CW) { -+ // Right -+ return *ot.PointCCW(op); -+ } else if (o2d == CCW) { -+ // Left -+ return *ot.PointCW(op); -+ } -+ throw std::runtime_error("[Unsupported] Opposing point on constrained edge"); -+ } -+ -+ void Sweep::FlipScanEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle& flip_triangle, -+ Triangle& t, Point& p) -+ { -+ Triangle& ot = *t.NeighborAcross(p); -+ Point& op = *ot.OppositePoint(t, p); -+ -+ if (t.NeighborAcross(p) == NULL) { -+ // If we want to integrate the fillEdgeEvent do it here -+ // With current implementation we should never get here -+ throw std::runtime_error( "[BUG:FIXME] FLIP failed due to missing triangle"); -+ } -+ -+ if (InScanArea(eq, *flip_triangle.PointCCW(eq), *flip_triangle.PointCW(eq), op)) { -+ // flip with new edge op->eq -+ FlipEdgeEvent(tcx, eq, op, &ot, op); -+ // TODO: Actually I just figured out that it should be possible to -+ // improve this by getting the next ot and op before the the above -+ // flip and continue the flipScanEdgeEvent here -+ // set new ot and op here and loop back to inScanArea test -+ // also need to set a new flip_triangle first -+ // Turns out at first glance that this is somewhat complicated -+ // so it will have to wait. -+ } else{ -+ Point& newP = NextFlipPoint(ep, eq, ot, op); -+ FlipScanEdgeEvent(tcx, ep, eq, flip_triangle, ot, newP); -+ } -+ } -+ -+ Sweep::~Sweep() { -+ -+ // Clean up memory -+ for(size_t i = 0; i < nodes_.size(); i++) { -+ delete nodes_[i]; -+ } -+ -+ } -+ -+} -+ -+ -+// Local Variables: -+// tab-width: 8 -+// mode: C++ -+// c-basic-offset: 4 -+// indent-tabs-mode: t -+// c-file-style: "stroustrup" -+// End: -+// ex: shiftwidth=4 tabstop=8 - --} // namespace p2t -diff -Naur poly2tri.orig/poly2tri/sweep/sweep_context.cc POLY2TRI_BLD/poly2tri/sweep/sweep_context.cc ---- poly2tri.orig/poly2tri/sweep/sweep_context.cc 2023-09-17 14:48:01.014182570 -0400 -+++ POLY2TRI_BLD/poly2tri/sweep/sweep_context.cc 2023-09-17 14:48:33.345620383 -0400 -@@ -30,177 +30,247 @@ - */ - #include "sweep_context.h" - #include -+#include - #include "advancing_front.h" - - namespace p2t { - --SweepContext::SweepContext(std::vector polyline) : points_(std::move(polyline)), -- front_(nullptr), -- head_(nullptr), -- tail_(nullptr), -- af_head_(nullptr), -- af_middle_(nullptr), -- af_tail_(nullptr) --{ -- InitEdges(points_); --} -+ bool SweepContext::lessthanpoint::operator() (const Point* a, const Point* b) const -+ { -+ if (a->y < b->y) { -+ return true; -+ } else if (a->y == b->y) { -+ return (a->x < b->x); -+ } -+ return false; -+ } - --void SweepContext::AddHole(const std::vector& polyline) --{ -- InitEdges(polyline); -- for (auto i : polyline) { -- points_.push_back(i); -- } --} -+ SweepContext::SweepContext() -+ { -+ basin = Basin(); -+ edge_event = EdgeEvent(); -+ } - --void SweepContext::AddPoint(Point* point) { -- points_.push_back(point); --} -+ SweepContext::SweepContext(std::vector &polyline) -+ { -+ std::vector polylineunique; -+ -+ basin = Basin(); -+ edge_event = EdgeEvent(); -+ -+ for(unsigned int i = 0; i < polyline.size(); i++) { -+ Point *p = AddPointCheckForDuplicates(polyline[i]); -+ polylineunique.push_back(p); -+ } -+ InitEdges(polylineunique); - --std::vector &SweepContext::GetTriangles() --{ -- return triangles_; --} -+ } - --std::list &SweepContext::GetMap() --{ -- return map_; --} -+ void SweepContext::AddOuterLoop(std::vector &polyline) -+ { -+ std::vector polylineunique; -+ for(unsigned int i = 0; i < polyline.size(); i++) { -+ Point *p = AddPointCheckForDuplicates(polyline[i]); -+ polylineunique.push_back(p); -+ } -+ InitEdges(polylineunique); - --void SweepContext::InitTriangulation() --{ -- double xmax(points_[0]->x), xmin(points_[0]->x); -- double ymax(points_[0]->y), ymin(points_[0]->y); -- -- // Calculate bounds. -- for (auto& point : points_) { -- Point& p = *point; -- if (p.x > xmax) -- xmax = p.x; -- if (p.x < xmin) -- xmin = p.x; -- if (p.y > ymax) -- ymax = p.y; -- if (p.y < ymin) -- ymin = p.y; -- } -- -- double dx = kAlpha * (xmax - xmin); -- double dy = kAlpha * (ymax - ymin); -- head_ = new Point(xmin - dx, ymin - dy); -- tail_ = new Point(xmax + dx, ymin - dy); -+ } - -- // Sort points along y-axis -- std::sort(points_.begin(), points_.end(), cmp); -+ void SweepContext::AddHole(std::vector &polyline) -+ { -+ std::vector polylineunique; -+ for(unsigned int i = 0; i < polyline.size(); i++) { -+ Point *p = AddPointCheckForDuplicates(polyline[i]); -+ polylineunique.push_back(p); -+ } -+ InitEdges(polylineunique); -+ } - --} -+ void SweepContext::AddPoint(Point* point) { -+ points_.push_back(point); -+ } - --void SweepContext::InitEdges(const std::vector& polyline) --{ -- size_t num_points = polyline.size(); -- for (size_t i = 0; i < num_points; i++) { -- size_t j = i < num_points - 1 ? i + 1 : 0; -- edge_list.push_back(new Edge(*polyline[i], *polyline[j])); -- } --} -+ Point* SweepContext::AddPointCheckForDuplicates(Point* point) { -+ std::pair::iterator,bool> result; - --Point* SweepContext::GetPoint(size_t index) --{ -- return points_[index]; --} -+ result = points_set_.insert(point); -+ if (result.second) { -+ points_.push_back(point); -+ return point; -+ } -+ Point* found_point = *points_set_.find(point); -+ delete point; -+ return found_point; -+ } - --void SweepContext::AddToMap(Triangle* triangle) --{ -- map_.push_back(triangle); --} -+ std::vector& SweepContext::GetTriangles() -+ { -+ return triangles_; -+ } - --Node* SweepContext::LocateNode(const Point& point) --{ -- // TODO implement search tree -- return front_->LocateNode(point.x); --} -+ std::list& SweepContext::GetMap() -+ { -+ return map_; -+ } - --void SweepContext::CreateAdvancingFront() --{ -+ void SweepContext::InitTriangulation() -+ { -+ double xmax(points_[0]->x), xmin(points_[0]->x); -+ double ymax(points_[0]->y), ymin(points_[0]->y); -+ -+ // Calculate bounds. -+ for (unsigned int i = 0; i < points_.size(); i++) { -+ Point& p = *points_[i]; -+ if (p.x > xmax) -+ xmax = p.x; -+ if (p.x < xmin) -+ xmin = p.x; -+ if (p.y > ymax) -+ ymax = p.y; -+ if (p.y < ymin) -+ ymin = p.y; -+ } -+ -+ double dx = kAlpha * (xmax - xmin); -+ double dy = kAlpha * (ymax - ymin); -+ head_ = new Point(xmax + dx, ymin - dy); -+ tail_ = new Point(xmin - dx, ymin - dy); - -- // Initial triangle -- Triangle* triangle = new Triangle(*points_[0], *head_, *tail_); -+ // Sort points along y-axis -+ std::sort(points_.begin(), points_.end(), cmp); - -- map_.push_back(triangle); -+ } - -- af_head_ = new Node(*triangle->GetPoint(1), *triangle); -- af_middle_ = new Node(*triangle->GetPoint(0), *triangle); -- af_tail_ = new Node(*triangle->GetPoint(2)); -- front_ = new AdvancingFront(*af_head_, *af_tail_); -- -- // TODO: More intuitive if head is middles next and not previous? -- // so swap head and tail -- af_head_->next = af_middle_; -- af_middle_->next = af_tail_; -- af_middle_->prev = af_head_; -- af_tail_->prev = af_middle_; --} -+ void SweepContext::InitEdges(std::vector &polyline) -+ { -+ size_t num_points = polyline.size(); -+ for (size_t i = 0; i < num_points; i++) { -+ size_t j = i < num_points - 1 ? i + 1 : 0; -+ if (!(EQ((*polyline[i]).x, (*polyline[j]).x) && EQ((*polyline[i]).y, (*polyline[j]).y))) -+ edge_list.push_back(new Edge(*polyline[i], *polyline[j])); -+ } -+ } - --void SweepContext::RemoveNode(Node* node) --{ -- delete node; --} -+ Point* SweepContext::GetPoint(size_t index) -+ { -+ return points_[index]; -+ } - --void SweepContext::MapTriangleToNodes(Triangle& t) --{ -- for (int i = 0; i < 3; i++) { -- if (!t.GetNeighbor(i)) { -- Node* n = front_->LocatePoint(t.PointCW(*t.GetPoint(i))); -- if (n) -- n->triangle = &t; -+ std::vector& SweepContext::GetPoints() -+ { -+ return points_; - } -- } --} - --void SweepContext::RemoveFromMap(Triangle* triangle) --{ -- map_.remove(triangle); --} -+ void SweepContext::AddToMap(Triangle* triangle) -+ { -+ map_.push_back(triangle); -+ } - --void SweepContext::MeshClean(Triangle& triangle) --{ -- std::vector triangles; -- triangles.push_back(&triangle); -- -- while(!triangles.empty()){ -- Triangle *t = triangles.back(); -- triangles.pop_back(); -- -- if (t != nullptr && !t->IsInterior()) { -- t->IsInterior(true); -- triangles_.push_back(t); -- for (int i = 0; i < 3; i++) { -- if (!t->constrained_edge[i]) -- triangles.push_back(t->GetNeighbor(i)); -- } -+ Node& SweepContext::LocateNode(Point& point) -+ { -+ // TODO implement search tree -+ return *front_->LocateNode(point.x); - } -- } --} - --SweepContext::~SweepContext() --{ -+ void SweepContext::CreateAdvancingFront(std::vector &nodes) -+ { -+ -+ // Initial triangle -+ Triangle* triangle = new Triangle(*points_[0], *tail_, *head_); - -- // Clean up memory -+ map_.push_back(triangle); - -- delete head_; -- delete tail_; -- delete front_; -- delete af_head_; -- delete af_middle_; -- delete af_tail_; -+ af_head_ = new Node(*triangle->GetPoint(1), *triangle); -+ af_middle_ = new Node(*triangle->GetPoint(0), *triangle); -+ af_tail_ = new Node(*triangle->GetPoint(2), *triangle); -+ front_ = new AdvancingFront(*af_head_, *af_tail_); -+ -+ // TODO: More intuitive if head is middles next and not previous? -+ // so swap head and tail -+ af_head_->next = af_middle_; -+ af_middle_->next = af_tail_; -+ af_middle_->prev = af_head_; -+ af_tail_->prev = af_middle_; -+ } -+ -+ void SweepContext::RemoveNode(Node* node) -+ { -+ delete node; -+ } - -- for (auto ptr : map_) { -- delete ptr; -+ void SweepContext::MapTriangleToNodes(Triangle& t) -+ { -+ for (int i = 0; i < 3; i++) { -+ if (!t.GetNeighbor(i)) { -+ Node* n = front_->LocatePoint(t.PointCW(*t.GetPoint(i))); -+ if (n) -+ n->triangle = &t; -+ } -+ } - } - -- for (auto& i : edge_list) { -- delete i; -+ void SweepContext::RemoveFromMap(Triangle* triangle) -+ { -+ map_.remove(triangle); - } -+ -+ void SweepContext::MeshClean(Triangle& triangle) -+ { -+ if (&triangle == NULL) -+ throw std::runtime_error("MeshClean - NULL triangl(?)"); -+ -+ meshclean_call_cnt++; -+ if (meshclean_call_cnt > 20000) -+ throw std::runtime_error("SweepContext MeshClean call stack too deep"); -+ -+ if (!triangle.IsInterior()) { -+ triangle.IsInterior(true); -+ triangles_.push_back(&triangle); -+ for (int i = 0; i < 3; i++) { -+ if (!triangle.constrained_edge[i]) -+ MeshClean(*triangle.GetNeighbor(i)); -+ } -+ } -+ -+ meshclean_call_cnt--; -+ } -+ -+ SweepContext::~SweepContext() -+ { -+ -+ // Clean up memory -+ -+ delete head_; -+ delete tail_; -+ delete front_; -+ delete af_head_; -+ delete af_middle_; -+ delete af_tail_; -+ -+ typedef std::list type_list; -+ -+ for(type_list::iterator iter = map_.begin(); iter != map_.end(); ++iter) { -+ Triangle* ptr = *iter; -+ delete ptr; -+ } -+ -+ for(unsigned int i = 0; i < edge_list.size(); i++) { -+ delete edge_list[i]; -+ } -+ points_.clear(); -+ points_set_.clear(); -+ } -+ - } - --} // namespace p2t -+ -+// Local Variables: -+// tab-width: 8 -+// mode: C++ -+// c-basic-offset: 4 -+// indent-tabs-mode: t -+// c-file-style: "stroustrup" -+// End: -+// ex: shiftwidth=4 tabstop=8 -+ -diff -Naur poly2tri.orig/poly2tri/sweep/sweep_context.h POLY2TRI_BLD/poly2tri/sweep/sweep_context.h ---- poly2tri.orig/poly2tri/sweep/sweep_context.h 2023-09-17 14:48:01.014182570 -0400 -+++ POLY2TRI_BLD/poly2tri/sweep/sweep_context.h 2023-09-17 14:48:33.345620383 -0400 -@@ -29,156 +29,179 @@ - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - --#pragma once -+#ifndef SWEEP_CONTEXT_H -+#define SWEEP_CONTEXT_H - - #include -+#include - #include - #include - - namespace p2t { - --// Inital triangle factor, seed triangle will extend 30% of --// PointSet width to both left and right. --const double kAlpha = 0.3; -+ // Inital triangle factor, seed triangle will extend 30% of -+ // PointSet width to both left and right. -+ const double kAlpha = 0.3; - --struct Point; --class Triangle; --struct Node; --struct Edge; --class AdvancingFront; -+ struct Point; -+ class Triangle; -+ struct Node; -+ struct Edge; -+ class AdvancingFront; - --class SweepContext { --public: -+ class SweepContext { -+ public: - --/// Constructor --explicit SweepContext(std::vector polyline); --/// Destructor --~SweepContext(); -+ /// Constructor -+ SweepContext(); -+ SweepContext(std::vector &polyline); -+ /// Destructor -+ ~SweepContext(); - --void set_head(Point* p1); -+ void set_head(Point* p1); - --Point* head() const; -+ Point* head(); - --void set_tail(Point* p1); -+ void set_tail(Point* p1); - --Point* tail() const; -+ Point* tail(); - --size_t point_count() const; -+ size_t point_count(); - --Node* LocateNode(const Point& point); -+ Node& LocateNode(Point& point); - --void RemoveNode(Node* node); -+ void RemoveNode(Node* node); - --void CreateAdvancingFront(); -+ void CreateAdvancingFront(std::vector &nodes); - --/// Try to map a node to all sides of this triangle that don't have a neighbor --void MapTriangleToNodes(Triangle& t); -+ /// Try to map a node to all sides of this triangle that don't have a neighbor -+ void MapTriangleToNodes(Triangle& t); - --void AddToMap(Triangle* triangle); -+ void AddToMap(Triangle* triangle); - --Point* GetPoint(size_t index); -+ Point* GetPoint(size_t index); - --Point* GetPoints(); -+ std::vector& GetPoints(); - --void RemoveFromMap(Triangle* triangle); -+ void RemoveFromMap(Triangle* triangle); - --void AddHole(const std::vector& polyline); -+ void AddOuterLoop(std::vector &polyline); -+ void AddHole(std::vector &polyline); - --void AddPoint(Point* point); -+ void AddPoint(Point* point); -+ Point* AddPointCheckForDuplicates(Point* point); - --AdvancingFront* front() const; -+ AdvancingFront* front(); - --void MeshClean(Triangle& triangle); -+ void MeshClean(Triangle& triangle); - --std::vector &GetTriangles(); --std::list &GetMap(); -+ std::vector& GetTriangles(); -+ std::list& GetMap(); - --std::vector edge_list; -+ std::vector edge_list; - --struct Basin { -- Node* left_node; -- Node* bottom_node; -- Node* right_node; -- double width; -- bool left_highest; -+ struct Basin { -+ Node* left_node; -+ Node* bottom_node; -+ Node* right_node; -+ double width; -+ bool left_highest; - -- Basin() -- : left_node(nullptr), bottom_node(nullptr), right_node(nullptr), width(0.0), left_highest(false) -- { -- } -+ Basin() : left_node(NULL), bottom_node(NULL), right_node(NULL), width(0.0), left_highest(false) -+ { -+ } - -- void Clear() -- { -- left_node = nullptr; -- bottom_node = nullptr; -- right_node = nullptr; -- width = 0.0; -- left_highest = false; -- } --}; -+ void Clear() -+ { -+ left_node = NULL; -+ bottom_node = NULL; -+ right_node = NULL; -+ width = 0.0; -+ left_highest = false; -+ } -+ }; - --struct EdgeEvent { -- Edge* constrained_edge; -- bool right; -+ struct EdgeEvent { -+ Edge* constrained_edge; -+ bool right; - -- EdgeEvent() : constrained_edge(NULL), right(false) -- { -- } --}; -+ EdgeEvent() : constrained_edge(NULL), right(false) -+ { -+ } -+ }; - --Basin basin; --EdgeEvent edge_event; -+ struct lessthanpoint{ -+ public: -+ bool operator() (const Point* a, const Point* b) const; -+ }; - --private: -+ Basin basin; -+ EdgeEvent edge_event; - --friend class Sweep; -+ private: - --std::vector triangles_; --std::list map_; --std::vector points_; -+ friend class Sweep; - --// Advancing front --AdvancingFront* front_; --// head point used with advancing front --Point* head_; --// tail point used with advancing front --Point* tail_; -+ std::vector triangles_; -+ std::list map_; -+ std::vector points_; -+ std::set points_set_; - --Node *af_head_, *af_middle_, *af_tail_; -+ // Advancing front -+ AdvancingFront* front_; -+ // head point used with advancing front -+ Point* head_; -+ // tail point used with advancing front -+ Point* tail_; - --void InitTriangulation(); --void InitEdges(const std::vector& polyline); -+ Node *af_head_, *af_middle_, *af_tail_; - --}; -+ void InitTriangulation(); -+ void InitEdges(std::vector &polyline); - --inline AdvancingFront* SweepContext::front() const --{ -- return front_; --} -+ int meshclean_call_cnt = 0; -+ }; - --inline size_t SweepContext::point_count() const --{ -- return points_.size(); --} -+ inline AdvancingFront* SweepContext::front() -+ { -+ return front_; -+ } - --inline void SweepContext::set_head(Point* p1) --{ -- head_ = p1; --} -+ inline size_t SweepContext::point_count() -+ { -+ return points_.size(); -+ } - --inline Point* SweepContext::head() const --{ -- return head_; --} -+ inline void SweepContext::set_head(Point* p1) -+ { -+ head_ = p1; -+ } - --inline void SweepContext::set_tail(Point* p1) --{ -- tail_ = p1; --} -+ inline Point* SweepContext::head() -+ { -+ return head_; -+ } - --inline Point* SweepContext::tail() const --{ -- return tail_; --} -+ inline void SweepContext::set_tail(Point* p1) -+ { -+ tail_ = p1; -+ } -+ -+ inline Point* SweepContext::tail() -+ { -+ return tail_; -+ } - - } -+ -+#endif -+ -+// Local Variables: -+// tab-width: 8 -+// mode: C++ -+// c-basic-offset: 4 -+// indent-tabs-mode: t -+// c-file-style: "stroustrup" -+// End: -+// ex: shiftwidth=4 tabstop=8 -+ -diff -Naur poly2tri.orig/poly2tri/sweep/sweep.h POLY2TRI_BLD/poly2tri/sweep/sweep.h ---- poly2tri.orig/poly2tri/sweep/sweep.h 2023-09-17 14:48:01.014182570 -0400 -+++ POLY2TRI_BLD/poly2tri/sweep/sweep.h 2023-09-17 14:48:33.345620383 -0400 -@@ -33,251 +33,241 @@ - * Zalik, B.(2008)'Sweep-line algorithm for constrained Delaunay triangulation', - * International Journal of Geographical Information Science - * -- * "FlipScan" Constrained Edge Algorithm invented by Thomas Åhlén, thahlen@gmail.com -+ * "FlipScan" Constrained Edge Algorithm invented by Thomas ?hl?n, thahlen@gmail.com - */ - --#pragma once -+#ifndef SWEEP_H -+#define SWEEP_H - -+#include - #include - -+#define POLY2TRI_MAXTIME 2e4 // Time limit in microseconds -+ - namespace p2t { - --class SweepContext; --struct Node; --struct Point; --struct Edge; --class Triangle; -- --class Sweep --{ --public: -- -- /** -- * Triangulate -- * -- * @param tcx -- */ -- void Triangulate(SweepContext& tcx); -- -- /** -- * Destructor - clean up memory -- */ -- ~Sweep(); -- --private: -- -- /** -- * Start sweeping the Y-sorted point set from bottom to top -- * -- * @param tcx -- */ -- void SweepPoints(SweepContext& tcx); -- -- /** -- * Find closes node to the left of the new point and -- * create a new triangle. If needed new holes and basins -- * will be filled to. -- * -- * @param tcx -- * @param point -- * @return -- */ -- Node& PointEvent(SweepContext& tcx, Point& point); -- -- /** -- * -- * -- * @param tcx -- * @param edge -- * @param node -- */ -- void EdgeEvent(SweepContext& tcx, Edge* edge, Node* node); -- -- void EdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* triangle, Point& point); -- -- /** -- * Creates a new front triangle and legalize it -- * -- * @param tcx -- * @param point -- * @param node -- * @return -- */ -- Node& NewFrontTriangle(SweepContext& tcx, Point& point, Node& node); -- -- /** -- * Adds a triangle to the advancing front to fill a hole. -- * @param tcx -- * @param node - middle node, that is the bottom of the hole -- */ -- void Fill(SweepContext& tcx, Node& node); -- -- /** -- * Returns true if triangle was legalized -- */ -- bool Legalize(SweepContext& tcx, Triangle& t); -- -- /** -- * Requirement:
-- * 1. a,b and c form a triangle.
-- * 2. a and d is know to be on opposite side of bc
-- *
--   *                a
--   *                +
--   *               / \
--   *              /   \
--   *            b/     \c
--   *            +-------+
--   *           /    d    \
--   *          /           \
--   * 
-- * Fact: d has to be in area B to have a chance to be inside the circle formed by -- * a,b and c
-- * d is outside B if orient2d(a,b,d) or orient2d(c,a,d) is CW
-- * This preknowledge gives us a way to optimize the incircle test -- * @param a - triangle point, opposite d -- * @param b - triangle point -- * @param c - triangle point -- * @param d - point opposite a -- * @return true if d is inside circle, false if on circle edge -- */ -- bool Incircle(const Point& pa, const Point& pb, const Point& pc, const Point& pd) const; -- -- /** -- * Rotates a triangle pair one vertex CW -- *
--   *       n2                    n2
--   *  P +-----+             P +-----+
--   *    | t  /|               |\  t |
--   *    |   / |               | \   |
--   *  n1|  /  |n3           n1|  \  |n3
--   *    | /   |    after CW   |   \ |
--   *    |/ oT |               | oT \|
--   *    +-----+ oP            +-----+
--   *       n4                    n4
--   * 
-- */ -- void RotateTrianglePair(Triangle& t, Point& p, Triangle& ot, Point& op) const; -- -- /** -- * Fills holes in the Advancing Front -- * -- * -- * @param tcx -- * @param n -- */ -- void FillAdvancingFront(SweepContext& tcx, Node& n); -- -- // Decision-making about when to Fill hole. -- // Contributed by ToolmakerSteve2 -- bool LargeHole_DontFill(const Node* node) const; -- bool AngleIsNegative(const Point* origin, const Point* pa, const Point* pb) const; -- bool AngleExceeds90Degrees(const Point* origin, const Point* pa, const Point* pb) const; -- bool AngleExceedsPlus90DegreesOrIsNegative(const Point* origin, const Point* pa, const Point* pb) const; -- double Angle(const Point* origin, const Point* pa, const Point* pb) const; -- -- /** -- * -- * @param node - middle node -- * @return the angle between 3 front nodes -- */ -- double HoleAngle(const Node& node) const; -- -- /** -- * The basin angle is decided against the horizontal line [1,0] -- */ -- double BasinAngle(const Node& node) const; -- -- /** -- * Fills a basin that has formed on the Advancing Front to the right -- * of given node.
-- * First we decide a left,bottom and right node that forms the -- * boundaries of the basin. Then we do a reqursive fill. -- * -- * @param tcx -- * @param node - starting node, this or next node will be left node -- */ -- void FillBasin(SweepContext& tcx, Node& node); -- -- /** -- * Recursive algorithm to fill a Basin with triangles -- * -- * @param tcx -- * @param node - bottom_node -- * @param cnt - counter used to alternate on even and odd numbers -- */ -- void FillBasinReq(SweepContext& tcx, Node* node); -- -- bool IsShallow(SweepContext& tcx, Node& node); -- -- bool IsEdgeSideOfTriangle(Triangle& triangle, Point& ep, Point& eq); -- -- void FillEdgeEvent(SweepContext& tcx, Edge* edge, Node* node); -- -- void FillRightAboveEdgeEvent(SweepContext& tcx, Edge* edge, Node* node); -- -- void FillRightBelowEdgeEvent(SweepContext& tcx, Edge* edge, Node& node); -- -- void FillRightConcaveEdgeEvent(SweepContext& tcx, Edge* edge, Node& node); -- -- void FillRightConvexEdgeEvent(SweepContext& tcx, Edge* edge, Node& node); -- -- void FillLeftAboveEdgeEvent(SweepContext& tcx, Edge* edge, Node* node); -- -- void FillLeftBelowEdgeEvent(SweepContext& tcx, Edge* edge, Node& node); -- -- void FillLeftConcaveEdgeEvent(SweepContext& tcx, Edge* edge, Node& node); -- -- void FillLeftConvexEdgeEvent(SweepContext& tcx, Edge* edge, Node& node); -- -- void FlipEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* t, Point& p); -- -- /** -- * After a flip we have two triangles and know that only one will still be -- * intersecting the edge. So decide which to contiune with and legalize the other -- * -- * @param tcx -- * @param o - should be the result of an orient2d( eq, op, ep ) -- * @param t - triangle 1 -- * @param ot - triangle 2 -- * @param p - a point shared by both triangles -- * @param op - another point shared by both triangles -- * @return returns the triangle still intersecting the edge -- */ -- Triangle& NextFlipTriangle(SweepContext& tcx, int o, Triangle& t, Triangle& ot, Point& p, Point& op); -- -- /** -- * When we need to traverse from one triangle to the next we need -- * the point in current triangle that is the opposite point to the next -- * triangle. -- * -- * @param ep -- * @param eq -- * @param ot -- * @param op -- * @return -- */ -- Point& NextFlipPoint(Point& ep, Point& eq, Triangle& ot, Point& op); -- -- /** -- * Scan part of the FlipScan algorithm
-- * When a triangle pair isn't flippable we will scan for the next -- * point that is inside the flip triangle scan area. When found -- * we generate a new flipEdgeEvent -- * -- * @param tcx -- * @param ep - last point on the edge we are traversing -- * @param eq - first point on the edge we are traversing -- * @param flipTriangle - the current triangle sharing the point eq with edge -- * @param t -- * @param p -- */ -- void FlipScanEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle& flip_triangle, Triangle& t, Point& p); -+ class SweepContext; -+ struct Node; -+ struct Point; -+ struct Edge; -+ class Triangle; -+ -+ class Sweep -+ { -+ public: -+ -+ /** -+ * Triangulate -+ */ -+ void Triangulate(SweepContext& tcx, bool finalize = true, int num_points = -1, long maxtime = POLY2TRI_MAXTIME); -+ -+ /** -+ * Destructor - clean up memory -+ */ -+ ~Sweep(); -+ -+ private: -+ -+ /** -+ * Start sweeping the Y-sorted point set from bottom to top -+ */ -+ void SweepPoints(SweepContext& tcx, int num_points = -1); -+ -+ /** -+ * Find closes node to the left of the new point and -+ * create a new triangle. If needed new holes and basins -+ * will be filled to. -+ * -+ */ -+ Node& PointEvent(SweepContext& tcx, Point& point); -+ -+ void EdgeEvent(SweepContext& tcx, Edge* edge, Node* node); -+ -+ void EdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* triangle, Point& point); -+ -+ /** -+ * Creates a new front triangle and legalize it -+ * -+ */ -+ Node& NewFrontTriangle(SweepContext& tcx, Point& point, Node& node); -+ void UpdateNodeAngleCircum(Node& n); -+ /** -+ * Adds a triangle to the advancing front to fill a hole. -+ * @param tcx - sweep context -+ * @param node - middle node, that is the bottom of the hole -+ */ -+ void Fill(SweepContext& tcx, Node& node); -+ -+ /** -+ * Returns true if triangle was legalized -+ */ -+ bool Legalize(SweepContext& tcx, Triangle& t); -+ -+ /** -+ * Requirement:
-+ * 1. a,b and c form a triangle.
-+ * 2. a and d is know to be on opposite side of bc
-+ *
-+	     *                a
-+	     *                +
-+	     *               / \
-+	     *              /   \
-+	     *            b/     \c
-+	     *            +-------+
-+	     *           /    d    \
-+	     *          /           \
-+	     * 
-+ * Fact: d has to be in area B to have a chance to be inside the circle formed by -+ * a,b and c
-+ * d is outside B if orient2d(a,b,d) or orient2d(c,a,d) is CW
-+ * This preknowledge gives us a way to optimize the incircle test -+ * @param pa - triangle point, opposite d -+ * @param pb - triangle point -+ * @param pc - triangle point -+ * @param pd - point opposite a -+ * @return true if d is inside circle, false if on circle edge -+ */ -+ bool Incircle(Point& pa, Point& pb, Point& pc, Point& pd); -+ bool Circumcircle(const Point& pa, const Point& pb, const Point& pc, Point& center, double& radius); -+ -+ /** -+ * Rotates a triangle pair one vertex CW -+ *
-+	     *       n2                    n2
-+	     *  P +-----+             P +-----+
-+	     *    | t  /|               |\  t |
-+	     *    |   / |               | \   |
-+	     *  n1|  /  |n3           n1|  \  |n3
-+	     *    | /   |    after CW   |   \ |
-+	     *    |/ oT |               | oT \|
-+	     *    +-----+ oP            +-----+
-+	     *       n4                    n4
-+	     * 
-+ */ -+ void RotateTrianglePair(Triangle& t, Point& p, Triangle& ot, Point& op); -+ -+ /** -+ * Fills holes in the Advancing Front -+ */ -+ void CheckCircleEvent(SweepContext& tcx, double currentheight); -+ void FillAdvancingFront(SweepContext& tcx, Node& n); -+ -+ // Decision-making about when to Fill hole. -+ // Contributed by ToolmakerSteve2 -+ bool LargeHole_DontFill(const Node* node) const; -+ bool AngleIsNegative(const Point* origin, const Point* pa, const Point* pb) const; -+ bool AngleExceeds90Degrees(const Point* origin, const Point* pa, const Point* pb) const; -+ bool AngleExceedsPlus90DegreesOrIsNegative(const Point* origin, const Point* pa, const Point* pb) const; -+ double Angle(const Point& origin, const Point& pa, const Point& pb) const; -+ -+ /** -+ * -+ * @param node - middle node -+ * @return the angle between 3 front nodes -+ */ -+ double HoleAngle(Node& node); -+ -+ /** -+ * The basin angle is decided against the horizontal line [1,0] -+ */ -+ double BasinAngle(Node& node); -+ -+ /** -+ * Fills a basin that has formed on the Advancing Front to the right -+ * of given node.
-+ * First we decide a left,bottom and right node that forms the -+ * boundaries of the basin. Then we do a reqursive fill. -+ * -+ * @param node - starting node, this or next node will be left node -+ */ -+ void FillBasin(SweepContext& tcx, Node& node); -+ -+ /** -+ * Recursive algorithm to fill a Basin with triangles -+ * -+ * @param node - bottom_node -+ */ -+ void FillBasinReq(SweepContext& tcx, Node* node); -+ -+ bool IsShallow(SweepContext& tcx, Node& node); -+ -+ bool IsEdgeSideOfTriangle(Triangle& triangle, Point& ep, Point& eq); -+ -+ void FillEdgeEvent(SweepContext& tcx, Edge* edge, Node* node); -+ -+ void FillRightAboveEdgeEvent(SweepContext& tcx, Edge* edge, Node* node); -+ -+ void FillRightBelowEdgeEvent(SweepContext& tcx, Edge* edge, Node& node); -+ -+ void FillRightConcaveEdgeEvent(SweepContext& tcx, Edge* edge, Node& node); -+ -+ void FillRightConvexEdgeEvent(SweepContext& tcx, Edge* edge, Node& node); -+ -+ void FillLeftAboveEdgeEvent(SweepContext& tcx, Edge* edge, Node* node); -+ -+ void FillLeftBelowEdgeEvent(SweepContext& tcx, Edge* edge, Node& node); -+ -+ void FillLeftConcaveEdgeEvent(SweepContext& tcx, Edge* edge, Node& node); -+ -+ void FillLeftConvexEdgeEvent(SweepContext& tcx, Edge* edge, Node& node); -+ -+ void FlipEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* t, Point& p); -+ -+ /** -+ * After a flip we have two triangles and know that only one will still be -+ * intersecting the edge. So decide which to contiune with and legalize the other -+ * -+ * @param o - should be the result of an orient2d( eq, op, ep ) -+ * @param t - triangle 1 -+ * @param ot - triangle 2 -+ * @param p - a point shared by both triangles -+ * @param op - another point shared by both triangles -+ * @return returns the triangle still intersecting the edge -+ */ -+ Triangle& NextFlipTriangle(SweepContext& tcx, int o, Triangle& t, Triangle& ot, Point& p, Point& op); -+ -+ /** -+ * When we need to traverse from one triangle to the next we need -+ * the point in current triangle that is the opposite point to the next -+ * triangle. -+ */ -+ Point& NextFlipPoint(Point& ep, Point& eq, Triangle& ot, Point& op); -+ -+ /** -+ * Scan part of the FlipScan algorithm
-+ * When a triangle pair isn't flippable we will scan for the next -+ * point that is inside the flip triangle scan area. When found -+ * we generate a new flipEdgeEvent -+ * -+ * @param ep - last point on the edge we are traversing -+ * @param eq - first point on the edge we are traversing -+ * @param flip_triangle - the current triangle sharing the point eq with edge -+ */ -+ void FlipScanEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle& flip_triangle, Triangle& t, Point& p); -+ -+ Triangle* FindInternalTriangle(Triangle* ext_tri); -+ -+ void FinalizationPolygon(SweepContext& tcx); -+ -+ std::vector nodes_; -+ -+ int flip_edge_event_cnt = 0; -+ -+ std::chrono::time_point tri_start_time; -+ std::chrono::time_point curr_time; -+ long timeout; -+ }; - -- void FinalizationPolygon(SweepContext& tcx); -+} - -- std::vector nodes_; -+#endif - --}; -+// Local Variables: -+// tab-width: 8 -+// mode: C++ -+// c-basic-offset: 4 -+// indent-tabs-mode: t -+// c-file-style: "stroustrup" -+// End: -+// ex: shiftwidth=4 tabstop=8 - --} -diff -Naur poly2tri.orig/README.md POLY2TRI_BLD/README.md ---- poly2tri.orig/README.md 2023-09-17 14:48:01.014182570 -0400 -+++ POLY2TRI_BLD/README.md 2023-09-17 14:48:33.345620383 -0400 -@@ -1,4 +1,11 @@ --Since there are no Input validation of the data given for triangulation you need -+poly2tri is a C++ library for creating a constrained Delaunay triangulation -+(CDT) of a polygon using a sweep-line algorithm. This specific version of -+poly2tri is a fork off of the github project git://github.com/jhasse/poly2tri.git -+which in turn is a cleaned up version of the google 'poly2tri' project based -+on the paper "Sweep-line algorithm for constrained Delaunay triangulation" by -+V. Domiter and and B. Zalik. -+ -+Since there are no Input validation of the data given for triangulation you need - to think about this. Poly2Tri does not support repeat points within epsilon. - - * If you have a cyclic function that generates random points make sure you don't -@@ -27,44 +34,29 @@ - - * Standard Template Library (STL) - --Unit tests: --* Boost (filesystem, test framework) -- - Testbed: - -+* gcc - * OpenGL - * [GLFW](http://glfw.sf.net) -+* Python - --Build the library ------------------- -+[waf](http://code.google.com/p/waf/) is used to compile the testbed. -+A waf script (86kb) is included in the repositoty. - --With the ninja build system installed: -+Building the Testbed -+-------------------- - -+Posix/MSYS environment: - ``` --mkdir build && cd build --cmake -GNinja .. --cmake --build . -+./waf configure -+./waf build - ``` - --Build and run with unit tests ------------------------------ -- --With the ninja build system: -- -+Windows command line: - ``` --mkdir build && cd build --cmake -GNinja -DP2T_BUILD_TESTS=ON .. --cmake --build . --ctest --output-on-failure --``` -- --Build with the testbed ------------------- -- --``` --mkdir build && cd build --cmake -GNinja -DP2T_BUILD_TESTBED=ON .. --cmake --build . -+python waf configure -+python waf build - ``` - - Running the Examples -@@ -72,30 +64,17 @@ - - Load data points from a file: - ``` --build/testbed/p2t --``` --Load data points from a file and automatically fit the geometry to the window: -+p2t - ``` --build/testbed/p2t -+Random distribution of points inside a consrained box: - ``` --Random distribution of points inside a constrained box: --``` --build/testbed/p2t random -+p2t random - ``` - Examples: - ``` --build/testbed/p2t testbed/data/dude.dat 350 500 3 -- --build/testbed/p2t testbed/data/nazca_monkey.dat -- --build/testbed/p2t random 10 100 5.0 --build/testbed/p2t random 1000 20000 0.025 --``` -- --References --========== -+./p2t dude.dat 300 500 2 -+./p2t nazca_monkey.dat 0 0 9 - --- Domiter V. and Zalik B. (2008) Sweepâ€line algorithm for constrained Delaunay triangulation --- FlipScan by library author Thomas Ã…hlén -+./p2t random 10 100 5.0 -+./p2t random 1000 20000 0.025 - --![FlipScan](doc/FlipScan.png) From 264722d045bde600257dff3ac87c72db27f5ec71 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:36:10 -0400 Subject: [PATCH 55/71] Fix ast patch --- llvm/CMakeLists.txt | 11 +++-------- llvm/llvm_no_ast_introspection.patch | 9 +++++---- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 1c389f5f..68fdb845 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -14,13 +14,8 @@ if (ENABLE_LLVM) set(PATCH_CMD "PATCH_COMMAND") if (TARGET ZLIB_BLD) set(Z_PREFIX_STR "brl_") - set(Z_BRL_PATCH_CMD "${PATCH_CMD};${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/llvm_z_brl.patch") - set(PATCH_CMD "COMMAND") + set(Z_BRL_PATCH_CMD "COMMAND;${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/llvm_z_brl.patch") endif (TARGET ZLIB_BLD) - if (MSVC) - set(Z_NO_AST_INTRO_PATCH_CMD "${PATCH_CMD};${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/llvm_no_ast_introspection.patch") - set(PATCH_CMD "COMMAND") - endif (MSVC) if (WIN32) @@ -39,8 +34,8 @@ if (ENABLE_LLVM) URL "${CMAKE_CURRENT_SOURCE_DIR}/llvm-project" SOURCE_SUBDIR llvm BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS} + PATCH_COMMAND ${PATCH_EXECUTABLE} -E -p1 ${PATCH_OPTIONS} -i "${CMAKE_CURRENT_SOURCE_DIR}/llvm_no_ast_introspection.patch" ${Z_BRL_PATCH_CMD} - ${Z_NO_AST_INTRO_PATCH_CMD} CMAKE_ARGS -C ${CMAKE_CURRENT_SOURCE_DIR}/llvm_targets.cmake ${BUILD_TYPE_SPECIFIER} @@ -80,8 +75,8 @@ if (ENABLE_LLVM) URL "${CMAKE_CURRENT_SOURCE_DIR}/llvm-project" SOURCE_SUBDIR llvm BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS} + PATCH_COMMAND ${PATCH_EXECUTABLE} -E -p1 ${PATCH_OPTIONS} -i "${CMAKE_CURRENT_SOURCE_DIR}/llvm_no_ast_introspection.patch" ${Z_BRL_PATCH_CMD} - ${Z_NO_AST_INTRO_PATCH_CMD} CMAKE_ARGS -C ${CMAKE_CURRENT_SOURCE_DIR}/llvm_targets.cmake -DCMAKE_BUILD_TYPE=Release diff --git a/llvm/llvm_no_ast_introspection.patch b/llvm/llvm_no_ast_introspection.patch index c4c5136b..01bd9ac6 100644 --- a/llvm/llvm_no_ast_introspection.patch +++ b/llvm/llvm_no_ast_introspection.patch @@ -1,7 +1,6 @@ -diff -Naur llvm-project/clang/lib/Tooling/CMakeLists.txt LLVM_BLD/clang/lib/Tooling/CMakeLists.txt --- llvm-project/clang/lib/Tooling/CMakeLists.txt 2024-06-26 10:58:56.993040845 -0400 -+++ LLVM_BLD/clang/lib/Tooling/CMakeLists.txt 2024-06-26 11:56:09.496630352 -0400 -@@ -24,11 +24,12 @@ ++++ LLVM_BLD/clang/lib/Tooling/CMakeLists.txt 2024-06-27 18:30:51.174617217 -0400 +@@ -24,12 +24,13 @@ string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} ${PATH_LIB_END} -1 PATH_TAIL) string(CONCAT BINARY_INCLUDE_DIR ${PATH_HEAD} "/include/clang/" ${PATH_TAIL}) @@ -10,12 +9,14 @@ diff -Naur llvm-project/clang/lib/Tooling/CMakeLists.txt LLVM_BLD/clang/lib/Tool - OR CMAKE_CROSSCOMPILING - OR GENERATOR_IS_MULTI_CONFIG - OR NOT LLVM_NATIVE_ARCH IN_LIST LLVM_TARGETS_TO_BUILD +- ) +#if (NOT Python3_EXECUTABLE +# OR APPLE +# OR CMAKE_CROSSCOMPILING +# OR GENERATOR_IS_MULTI_CONFIG +# OR NOT LLVM_NATIVE_ARCH IN_LIST LLVM_TARGETS_TO_BUILD ++# ) +if (1) - ) configure_file( EmptyNodeIntrospection.inc.in + ${BINARY_INCLUDE_DIR}/NodeIntrospection.inc From 79beea1bc938f2dcb5603260322e26e3088b1e70 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Thu, 27 Jun 2024 22:00:29 -0400 Subject: [PATCH 56/71] Looks like art doesn't need these - try turning off to see if we can avoid the Windows build issue. --- llvm/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 68fdb845..46ec5466 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -49,6 +49,8 @@ if (ENABLE_LLVM) -DLLVM_ENABLE_ZSTD=OFF -DLLVM_PARALLEL_LINK_JOBS=1 # llvm/clang linking is memory hungry -DLLVM_OPTIMIZED_TABLEGEN=ON + -DLLVM_BUILD_LLVM_DYLIB=OFF + -DLLVM_BUILD_LLVM_C_DYLIB=OFF -DBIN_DIR=${BIN_DIR} -DLIB_DIR=${LIB_DIR} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} @@ -90,6 +92,8 @@ if (ENABLE_LLVM) -DLLVM_ENABLE_ZSTD=OFF -DLLVM_PARALLEL_LINK_JOBS=1 # llvm/clang linking is memory hungry -DLLVM_OPTIMIZED_TABLEGEN=ON + -DLLVM_BUILD_LLVM_DYLIB=OFF + -DLLVM_BUILD_LLVM_C_DYLIB=OFF -DBIN_DIR=${BIN_DIR} -DLIB_DIR=${LIB_DIR} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} From 481505e7968ffd4e0d10f2c967d3355989545f71 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 28 Jun 2024 10:10:27 -0400 Subject: [PATCH 57/71] Update to latest osmesa SHA1 --- osmesa/osmesa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osmesa/osmesa b/osmesa/osmesa index feac9fd3..3c0574b0 160000 --- a/osmesa/osmesa +++ b/osmesa/osmesa @@ -1 +1 @@ -Subproject commit feac9fd3e76b525c29fb0c66c27d38b23d79a908 +Subproject commit 3c0574b0e8555fe725c50c30939a84e6ab94b99a From 4167ad7da671f4b84e4ade4f703538a7f59b28bd Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 28 Jun 2024 12:13:44 -0400 Subject: [PATCH 58/71] Make sure AStyle compiles C++17 for string_view --- astyle/astyle.patch | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/astyle/astyle.patch b/astyle/astyle.patch index 9bf12bd9..929591ce 100644 --- a/astyle/astyle.patch +++ b/astyle/astyle.patch @@ -57,10 +57,16 @@ diff -Naur astyle/build/cmake/InstallOptions.cmake ASTYLE_BLD/build/cmake/Instal - endif() -endif() diff -Naur astyle/CMakeLists.txt ASTYLE_BLD/CMakeLists.txt ---- astyle/CMakeLists.txt 2024-06-24 11:35:23.448068159 -0400 -+++ ASTYLE_BLD/CMakeLists.txt 2024-06-24 11:34:01.154415093 -0400 -@@ -8,7 +8,7 @@ +--- astyle/CMakeLists.txt 2024-06-06 01:30:44.000000000 -0400 ++++ ASTYLE_BLD/CMakeLists.txt 2024-06-28 12:11:49.297259511 -0400 +@@ -6,9 +6,13 @@ + project(astyle CXX) + ++set(CMAKE_CXX_EXTENSIONS OFF) ++set(CMAKE_CXX_STANDARD 17) ++set(CMAKE_CXX_STANDARD_REQUIRED ON) ++ include( build/cmake/Options.cmake REQUIRED ) include( build/cmake/CompilerOptions.cmake REQUIRED ) -include( build/cmake/LinkerOptions.cmake REQUIRED ) From cba7f6cd9010d3367595fd7d53e0982eae5732cf Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:02:58 -0400 Subject: [PATCH 59/71] Looks like we may not need the dynamic zstd, disable to try and avoid Windows build issue. --- zstd/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/zstd/CMakeLists.txt b/zstd/CMakeLists.txt index 096a69bc..549fd12e 100644 --- a/zstd/CMakeLists.txt +++ b/zstd/CMakeLists.txt @@ -17,6 +17,7 @@ if (ENABLE_ZSTD) -DZ_PREFIX_STR=${Z_PREFIX_STR} -DBIN_DIR=${BIN_DIR} -DLIB_DIR=${LIB_DIR} + -DZSTD_BUILD_SHARED=OFF -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} From 3258da3917c72740e095acdf19dfa4f9356758af Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 28 Jun 2024 18:44:54 -0400 Subject: [PATCH 60/71] Remove reference to header not present in repository --- opennurbs/opennurbs_system.patch | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/opennurbs/opennurbs_system.patch b/opennurbs/opennurbs_system.patch index 26428330..83f85939 100644 --- a/opennurbs/opennurbs_system.patch +++ b/opennurbs/opennurbs_system.patch @@ -1,6 +1,18 @@ ---- opennurbs/opennurbs_system.h 2024-06-25 15:44:35.955646175 -0400 -+++ OPENNURBS_BLD/opennurbs_system.h 2024-06-25 15:44:06.135134526 -0400 -@@ -494,7 +494,7 @@ +--- opennurbs/opennurbs_system.h 2024-06-25 11:11:12.124747567 -0400 ++++ OPENNURBS_BLD/opennurbs_system.h 2024-06-28 18:43:51.808824736 -0400 +@@ -111,11 +111,6 @@ + + #pragma ON_PRAGMA_WARNING_PUSH + +-/* compiler choice */ +-#if defined(ON_COMPILER_MSC) +-#include "opennurbs_windows_targetver.h" +-#endif +- + #if defined(ON_RUNTIME_APPLE) && defined(__OBJC__) + + // The header file opennurbs_system_runtime.h is included in several +@@ -494,7 +489,7 @@ #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE From bf587007771a65410dcf9485a0fe47351c189f21 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 2 Jul 2024 20:09:55 -0400 Subject: [PATCH 61/71] Update RELEASE to include manifold upstream changes through b817d07 --- manifold/manifold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifold/manifold b/manifold/manifold index 9a9f5a21..ce5d758f 160000 --- a/manifold/manifold +++ b/manifold/manifold @@ -1 +1 @@ -Subproject commit 9a9f5a21d9ed29547a30d9f52006e0cc4c4a50c6 +Subproject commit ce5d758f325a2de4f5ba5fbdfb64efd722cfc4aa From 920ec5dd046beff32763b6eb08acb1c4f55317ab Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 9 Jul 2024 17:08:23 -0400 Subject: [PATCH 62/71] Patch manifold build for OSX --- manifold/CMakeLists.txt | 2 +- manifold/manifold.patch | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 manifold/manifold.patch diff --git a/manifold/CMakeLists.txt b/manifold/CMakeLists.txt index 9dae1d01..b1012a7e 100644 --- a/manifold/CMakeLists.txt +++ b/manifold/CMakeLists.txt @@ -14,7 +14,7 @@ if (ENABLE_MANIFOLD) ExternalProject_Add(MANIFOLD_BLD URL "${CMAKE_CURRENT_SOURCE_DIR}/manifold" BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS} - #PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/manifold.patch + PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/manifold.patch CMAKE_ARGS ${BUILD_TYPE_SPECIFIER} $<$:-DZ_PREFIX=ON> diff --git a/manifold/manifold.patch b/manifold/manifold.patch new file mode 100644 index 00000000..6f42eb5c --- /dev/null +++ b/manifold/manifold.patch @@ -0,0 +1,12 @@ +diff -Naur manifold/src/utilities/include/optional_assert.h MANIFOLD_BLD/src/utilities/include/optional_assert.h +--- manifold/src/utilities/include/optional_assert.h 2024-07-02 20:09:19.078438473 -0400 ++++ MANIFOLD_BLD/src/utilities/include/optional_assert.h 2024-07-09 16:59:17.609083445 -0400 +@@ -15,7 +15,7 @@ + #pragma once + + #include "public.h" +-#if MANIFOLD_EXCEPTIONS ++#ifdef MANIFOLD_EXCEPTIONS + #include + #endif + From ab640fadfe6b10b914bbc09753f63776b1cc1d28 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 9 Jul 2024 20:10:45 -0400 Subject: [PATCH 63/71] vec DECL was changed in recent glm - change the def to match the old expanded version. --- manifold/manifold.patch | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/manifold/manifold.patch b/manifold/manifold.patch index 6f42eb5c..c01a788f 100644 --- a/manifold/manifold.patch +++ b/manifold/manifold.patch @@ -1,6 +1,18 @@ +diff -Naur manifold/src/third_party/glm/glm/detail/setup.hpp MANIFOLD_BLD/src/third_party/glm/glm/detail/setup.hpp +--- manifold/src/third_party/glm/glm/detail/setup.hpp 2024-06-25 10:59:36.219351152 -0400 ++++ MANIFOLD_BLD/src/third_party/glm/glm/detail/setup.hpp 2024-07-09 20:09:07.054278365 -0400 +@@ -493,7 +493,7 @@ + # define GLM_NEVER_INLINE + #endif//defined(GLM_FORCE_INLINE) + +-#define GLM_CTOR_DECL GLM_CUDA_FUNC_DECL GLM_CONSTEXPR ++#define GLM_CTOR_DECL GLM_FUNC_DECL GLM_CONSTEXPR + #define GLM_FUNC_DISCARD_DECL GLM_CUDA_FUNC_DECL + #define GLM_FUNC_DECL GLM_NODISCARD GLM_CUDA_FUNC_DECL + #define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE diff -Naur manifold/src/utilities/include/optional_assert.h MANIFOLD_BLD/src/utilities/include/optional_assert.h --- manifold/src/utilities/include/optional_assert.h 2024-07-02 20:09:19.078438473 -0400 -+++ MANIFOLD_BLD/src/utilities/include/optional_assert.h 2024-07-09 16:59:17.609083445 -0400 ++++ MANIFOLD_BLD/src/utilities/include/optional_assert.h 2024-07-09 17:10:40.601974842 -0400 @@ -15,7 +15,7 @@ #pragma once From 43c3239a4c22794f30efcf8773d2a8bd3f0f5601 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 9 Jul 2024 21:32:47 -0400 Subject: [PATCH 64/71] Whoops, missed a MANIFOLD_EXCEPTIONS check --- manifold/manifold.patch | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/manifold/manifold.patch b/manifold/manifold.patch index c01a788f..6696071f 100644 --- a/manifold/manifold.patch +++ b/manifold/manifold.patch @@ -1,6 +1,6 @@ diff -Naur manifold/src/third_party/glm/glm/detail/setup.hpp MANIFOLD_BLD/src/third_party/glm/glm/detail/setup.hpp --- manifold/src/third_party/glm/glm/detail/setup.hpp 2024-06-25 10:59:36.219351152 -0400 -+++ MANIFOLD_BLD/src/third_party/glm/glm/detail/setup.hpp 2024-07-09 20:09:07.054278365 -0400 ++++ MANIFOLD_BLD/src/third_party/glm/glm/detail/setup.hpp 2024-07-09 21:27:42.922845184 -0400 @@ -493,7 +493,7 @@ # define GLM_NEVER_INLINE #endif//defined(GLM_FORCE_INLINE) @@ -12,7 +12,7 @@ diff -Naur manifold/src/third_party/glm/glm/detail/setup.hpp MANIFOLD_BLD/src/th #define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE diff -Naur manifold/src/utilities/include/optional_assert.h MANIFOLD_BLD/src/utilities/include/optional_assert.h --- manifold/src/utilities/include/optional_assert.h 2024-07-02 20:09:19.078438473 -0400 -+++ MANIFOLD_BLD/src/utilities/include/optional_assert.h 2024-07-09 17:10:40.601974842 -0400 ++++ MANIFOLD_BLD/src/utilities/include/optional_assert.h 2024-07-09 21:32:03.965382198 -0400 @@ -15,7 +15,7 @@ #pragma once @@ -22,3 +22,12 @@ diff -Naur manifold/src/utilities/include/optional_assert.h MANIFOLD_BLD/src/uti #include #endif +@@ -40,7 +40,7 @@ + #define DEBUG_ASSERT(condition, EX, msg) + #endif + +-#if MANIFOLD_EXCEPTIONS ++#ifdef MANIFOLD_EXCEPTIONS + #define ASSERT(condition, EX) \ + if (!(condition)) throw(EX); + #else From 0938d6f4da0164b3dd26cfcb3c0ec53be16c33ea Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 9 Jul 2024 21:45:31 -0400 Subject: [PATCH 65/71] Specify build type for Windows CMake configure --- .github/workflows/check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 9b4ed915..353abe58 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -127,7 +127,7 @@ jobs: shell: cmd run: | call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat" - cmake -S . -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON + cmake -S . -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Release # We do the following in order to help ensure files are "flushed" # to disk before compilation is attempted # https://superuser.com/a/1553374/1286142 @@ -160,7 +160,7 @@ jobs: shell: cmd run: | call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat" - cmake -S . -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON + cmake -S . -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Debug # We do the following in order to help ensure files are "flushed" # to disk before compilation is attempted # https://superuser.com/a/1553374/1286142 From 943d33711e5e8ad8aff26b81293a520d3e7cd033 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Wed, 10 Jul 2024 09:25:41 -0400 Subject: [PATCH 66/71] Try adding an interactive Linux option for bext --- .github/workflows/linux_interactive.yml | 71 +++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/linux_interactive.yml diff --git a/.github/workflows/linux_interactive.yml b/.github/workflows/linux_interactive.yml new file mode 100644 index 00000000..76fd6e78 --- /dev/null +++ b/.github/workflows/linux_interactive.yml @@ -0,0 +1,71 @@ +# The purpose of this particular test definition is to support on-demand +# interactive command shells. We sometimes see problems that occur only in the +# Github Runner environments, and in order to explore what is happening we need +# an interactive prompt (the alternative is hours-per-cycle submit and test +# loops, which doesn't scale at all.) +# +# Unlike the other BRL-CAD tests, this one is started manually from the Github +# website. For more information see https://mxschmitt.github.io/action-tmate/ +# +# The "recommended" way to use this action is for the dev to make a fork of +# the repository, alter the configure and/or build logic below for their +# particular use case (the example below is a libged-only build used to zero +# in on a specific libged behavior) before running. + +name: BRL-CAD Linux Interactive Debugging + +on: + workflow_dispatch: + inputs: + debug_enabled: + type: boolean + description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' + required: false + default: false + +jobs: + + linux: + name: Ubuntu Latest GCC + runs-on: ubuntu-latest + steps: + + - name: Setup - CMake + uses: lukka/get-cmake@latest + + - name: Setup - System + env: + DEBIAN_FRONTEND: noninteractive + run: | + sudo apt-get update + # Install XCB/OpenGL dev pkgs for Qt - see: + # https://wiki.qt.io/Building_Qt_6_from_Git + # https://doc.qt.io/qt-6/linux-requirements.html + sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libx11-xcb-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libxcb-cursor-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-util-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev + sudo apt-get install libgl-dev + sudo apt-get install libinput-dev + sudo apt-get clean + + - name: Checkout + uses: actions/checkout@v4 + + - name: Build Directory setup + run: | + cmake -E make_directory ./build_linux + + - name: Configure + run: | + export PATH=$ENV{GITHUB_WORKSPACE}:$PATH + cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Debug + + - name: Build + run: | + export PATH=$ENV{GITHUB_WORKSPACE}:$PATH + cd build && ninja -j2 -v + + - name: Debugging - tmate session + if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} + uses: mxschmitt/action-tmate@v3 + with: + limit-access-to-actor: true + From 53c65285e1ff4042fa85ac77295cbf7f070b6906 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:46:08 -0400 Subject: [PATCH 67/71] Try to make sure Itk always has the internal Itcl headers --- itk/itk.patch | 2440 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 2432 insertions(+), 8 deletions(-) diff --git a/itk/itk.patch b/itk/itk.patch index 486b0ee9..e97c7e66 100644 --- a/itk/itk.patch +++ b/itk/itk.patch @@ -1,6 +1,6 @@ diff -Naur itk/CMake/FindITCL.cmake ITK_BLD/CMake/FindITCL.cmake --- itk/CMake/FindITCL.cmake 1969-12-31 19:00:00.000000000 -0500 -+++ ITK_BLD/CMake/FindITCL.cmake 2024-02-16 19:10:33.623363134 -0500 ++++ ITK_BLD/CMake/FindITCL.cmake 2024-07-10 10:32:07.733264703 -0400 @@ -0,0 +1,118 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. @@ -122,7 +122,7 @@ diff -Naur itk/CMake/FindITCL.cmake ITK_BLD/CMake/FindITCL.cmake +# ex: shiftwidth=2 tabstop=8 diff -Naur itk/CMake/FindTCL.cmake ITK_BLD/CMake/FindTCL.cmake --- itk/CMake/FindTCL.cmake 1969-12-31 19:00:00.000000000 -0500 -+++ ITK_BLD/CMake/FindTCL.cmake 2024-02-16 19:10:33.623363134 -0500 ++++ ITK_BLD/CMake/FindTCL.cmake 2024-07-10 10:32:07.733264703 -0400 @@ -0,0 +1,496 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. @@ -622,7 +622,7 @@ diff -Naur itk/CMake/FindTCL.cmake ITK_BLD/CMake/FindTCL.cmake +# ex: shiftwidth=2 tabstop=8 diff -Naur itk/CMakeLists.txt ITK_BLD/CMakeLists.txt --- itk/CMakeLists.txt 1969-12-31 19:00:00.000000000 -0500 -+++ ITK_BLD/CMakeLists.txt 2024-02-16 19:10:21.567570239 -0500 ++++ ITK_BLD/CMakeLists.txt 2024-07-10 10:41:52.225087088 -0400 @@ -0,0 +1,280 @@ +# C M A K E L I S T S . T X T +# ITK @@ -850,7 +850,7 @@ diff -Naur itk/CMakeLists.txt ITK_BLD/CMakeLists.txt + ${X11_INCLUDE_DIR} + ${TCL_PRIVATE_HDRS} + # Itcl3 is iffy as a system install - just reference the local copy -+ ${CMAKE_SOURCE_DIR}/itcl3/itcl3/generic ++ ${CMAKE_SOURCE_DIR}/generic/itcl3 + ) + +add_library(itk${ITK_VERSION} SHARED ${ITK_SRCS}) @@ -904,9 +904,2433 @@ diff -Naur itk/CMakeLists.txt ITK_BLD/CMakeLists.txt +# End: +# ex: shiftwidth=2 tabstop=8 + +diff -Naur itk/generic/itcl3/itclDecls.h ITK_BLD/generic/itcl3/itclDecls.h +--- itk/generic/itcl3/itclDecls.h 1969-12-31 19:00:00.000000000 -0500 ++++ ITK_BLD/generic/itcl3/itclDecls.h 2024-07-10 10:40:21.279659891 -0400 +@@ -0,0 +1,332 @@ ++/* ++ * itclDecls.h -- ++ * ++ * Declarations of functions in the platform independent public Itcl API. ++ * ++ * See the file "license.terms" for information on usage and redistribution ++ * of this file, and for a DISCLAIMER OF ALL WARRANTIES. ++ */ ++ ++#ifndef _ITCLDECLS ++#define _ITCLDECLS ++ ++/* ++ * WARNING: This file is automatically generated by the tools/genStubs.tcl ++ * script. Any modifications to the function declarations below should be made ++ * in the itcl/generic/tcl.decls script. ++ */ ++ ++/* !BEGIN!: Do not edit below this line. */ ++ ++/* ++ * Exported function declarations: ++ */ ++ ++#ifndef Itcl_Init_TCL_DECLARED ++#define Itcl_Init_TCL_DECLARED ++/* 0 */ ++TCL_EXTERN(int) Itcl_Init _ANSI_ARGS_((Tcl_Interp * interp)); ++#endif ++#ifndef Itcl_SafeInit_TCL_DECLARED ++#define Itcl_SafeInit_TCL_DECLARED ++/* 1 */ ++TCL_EXTERN(int) Itcl_SafeInit _ANSI_ARGS_((Tcl_Interp * interp)); ++#endif ++#ifndef Itcl_RegisterC_TCL_DECLARED ++#define Itcl_RegisterC_TCL_DECLARED ++/* 2 */ ++TCL_EXTERN(int) Itcl_RegisterC _ANSI_ARGS_((Tcl_Interp * interp, ++ CONST char * name, Tcl_CmdProc * proc, ++ ClientData clientData, ++ Tcl_CmdDeleteProc * deleteProc)); ++#endif ++#ifndef Itcl_RegisterObjC_TCL_DECLARED ++#define Itcl_RegisterObjC_TCL_DECLARED ++/* 3 */ ++TCL_EXTERN(int) Itcl_RegisterObjC _ANSI_ARGS_((Tcl_Interp * interp, ++ CONST char * name, Tcl_ObjCmdProc * proc, ++ ClientData clientData, ++ Tcl_CmdDeleteProc * deleteProc)); ++#endif ++#ifndef Itcl_FindC_TCL_DECLARED ++#define Itcl_FindC_TCL_DECLARED ++/* 4 */ ++TCL_EXTERN(int) Itcl_FindC _ANSI_ARGS_((Tcl_Interp * interp, ++ CONST char * name, Tcl_CmdProc ** argProcPtr, ++ Tcl_ObjCmdProc ** objProcPtr, ++ ClientData * cDataPtr)); ++#endif ++#ifndef Itcl_InitStack_TCL_DECLARED ++#define Itcl_InitStack_TCL_DECLARED ++/* 5 */ ++TCL_EXTERN(void) Itcl_InitStack _ANSI_ARGS_((Itcl_Stack * stack)); ++#endif ++#ifndef Itcl_DeleteStack_TCL_DECLARED ++#define Itcl_DeleteStack_TCL_DECLARED ++/* 6 */ ++TCL_EXTERN(void) Itcl_DeleteStack _ANSI_ARGS_((Itcl_Stack * stack)); ++#endif ++#ifndef Itcl_PushStack_TCL_DECLARED ++#define Itcl_PushStack_TCL_DECLARED ++/* 7 */ ++TCL_EXTERN(void) Itcl_PushStack _ANSI_ARGS_((ClientData cdata, ++ Itcl_Stack * stack)); ++#endif ++#ifndef Itcl_PopStack_TCL_DECLARED ++#define Itcl_PopStack_TCL_DECLARED ++/* 8 */ ++TCL_EXTERN(ClientData) Itcl_PopStack _ANSI_ARGS_((Itcl_Stack * stack)); ++#endif ++#ifndef Itcl_PeekStack_TCL_DECLARED ++#define Itcl_PeekStack_TCL_DECLARED ++/* 9 */ ++TCL_EXTERN(ClientData) Itcl_PeekStack _ANSI_ARGS_((Itcl_Stack * stack)); ++#endif ++#ifndef Itcl_GetStackValue_TCL_DECLARED ++#define Itcl_GetStackValue_TCL_DECLARED ++/* 10 */ ++TCL_EXTERN(ClientData) Itcl_GetStackValue _ANSI_ARGS_((Itcl_Stack * stack, ++ int pos)); ++#endif ++#ifndef Itcl_InitList_TCL_DECLARED ++#define Itcl_InitList_TCL_DECLARED ++/* 11 */ ++TCL_EXTERN(void) Itcl_InitList _ANSI_ARGS_((Itcl_List * listPtr)); ++#endif ++#ifndef Itcl_DeleteList_TCL_DECLARED ++#define Itcl_DeleteList_TCL_DECLARED ++/* 12 */ ++TCL_EXTERN(void) Itcl_DeleteList _ANSI_ARGS_((Itcl_List * listPtr)); ++#endif ++#ifndef Itcl_CreateListElem_TCL_DECLARED ++#define Itcl_CreateListElem_TCL_DECLARED ++/* 13 */ ++TCL_EXTERN(Itcl_ListElem*) Itcl_CreateListElem _ANSI_ARGS_(( ++ Itcl_List * listPtr)); ++#endif ++#ifndef Itcl_DeleteListElem_TCL_DECLARED ++#define Itcl_DeleteListElem_TCL_DECLARED ++/* 14 */ ++TCL_EXTERN(Itcl_ListElem*) Itcl_DeleteListElem _ANSI_ARGS_(( ++ Itcl_ListElem * elemPtr)); ++#endif ++#ifndef Itcl_InsertList_TCL_DECLARED ++#define Itcl_InsertList_TCL_DECLARED ++/* 15 */ ++TCL_EXTERN(Itcl_ListElem*) Itcl_InsertList _ANSI_ARGS_((Itcl_List * listPtr, ++ ClientData val)); ++#endif ++#ifndef Itcl_InsertListElem_TCL_DECLARED ++#define Itcl_InsertListElem_TCL_DECLARED ++/* 16 */ ++TCL_EXTERN(Itcl_ListElem*) Itcl_InsertListElem _ANSI_ARGS_(( ++ Itcl_ListElem * pos, ClientData val)); ++#endif ++#ifndef Itcl_AppendList_TCL_DECLARED ++#define Itcl_AppendList_TCL_DECLARED ++/* 17 */ ++TCL_EXTERN(Itcl_ListElem*) Itcl_AppendList _ANSI_ARGS_((Itcl_List * listPtr, ++ ClientData val)); ++#endif ++#ifndef Itcl_AppendListElem_TCL_DECLARED ++#define Itcl_AppendListElem_TCL_DECLARED ++/* 18 */ ++TCL_EXTERN(Itcl_ListElem*) Itcl_AppendListElem _ANSI_ARGS_(( ++ Itcl_ListElem * pos, ClientData val)); ++#endif ++#ifndef Itcl_SetListValue_TCL_DECLARED ++#define Itcl_SetListValue_TCL_DECLARED ++/* 19 */ ++TCL_EXTERN(void) Itcl_SetListValue _ANSI_ARGS_(( ++ Itcl_ListElem * elemPtr, ClientData val)); ++#endif ++#ifndef Itcl_EventuallyFree_TCL_DECLARED ++#define Itcl_EventuallyFree_TCL_DECLARED ++/* 20 */ ++TCL_EXTERN(void) Itcl_EventuallyFree _ANSI_ARGS_((ClientData cdata, ++ Tcl_FreeProc * fproc)); ++#endif ++#ifndef Itcl_PreserveData_TCL_DECLARED ++#define Itcl_PreserveData_TCL_DECLARED ++/* 21 */ ++TCL_EXTERN(void) Itcl_PreserveData _ANSI_ARGS_((ClientData cdata)); ++#endif ++#ifndef Itcl_ReleaseData_TCL_DECLARED ++#define Itcl_ReleaseData_TCL_DECLARED ++/* 22 */ ++TCL_EXTERN(void) Itcl_ReleaseData _ANSI_ARGS_((ClientData cdata)); ++#endif ++#ifndef Itcl_SaveInterpState_TCL_DECLARED ++#define Itcl_SaveInterpState_TCL_DECLARED ++/* 23 */ ++TCL_EXTERN(Itcl_InterpState) Itcl_SaveInterpState _ANSI_ARGS_(( ++ Tcl_Interp* interp, int status)); ++#endif ++#ifndef Itcl_RestoreInterpState_TCL_DECLARED ++#define Itcl_RestoreInterpState_TCL_DECLARED ++/* 24 */ ++TCL_EXTERN(int) Itcl_RestoreInterpState _ANSI_ARGS_(( ++ Tcl_Interp* interp, Itcl_InterpState state)); ++#endif ++#ifndef Itcl_DiscardInterpState_TCL_DECLARED ++#define Itcl_DiscardInterpState_TCL_DECLARED ++/* 25 */ ++TCL_EXTERN(void) Itcl_DiscardInterpState _ANSI_ARGS_(( ++ Itcl_InterpState state)); ++#endif ++ ++typedef struct ItclStubHooks { ++ struct ItclIntStubs *itclIntStubs; ++} ItclStubHooks; ++ ++typedef struct ItclStubs { ++ int magic; ++ struct ItclStubHooks *hooks; ++ ++ int (*itcl_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 0 */ ++ int (*itcl_SafeInit) _ANSI_ARGS_((Tcl_Interp * interp)); /* 1 */ ++ int (*itcl_RegisterC) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_CmdProc * proc, ClientData clientData, Tcl_CmdDeleteProc * deleteProc)); /* 2 */ ++ int (*itcl_RegisterObjC) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_ObjCmdProc * proc, ClientData clientData, Tcl_CmdDeleteProc * deleteProc)); /* 3 */ ++ int (*itcl_FindC) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_CmdProc ** argProcPtr, Tcl_ObjCmdProc ** objProcPtr, ClientData * cDataPtr)); /* 4 */ ++ void (*itcl_InitStack) _ANSI_ARGS_((Itcl_Stack * stack)); /* 5 */ ++ void (*itcl_DeleteStack) _ANSI_ARGS_((Itcl_Stack * stack)); /* 6 */ ++ void (*itcl_PushStack) _ANSI_ARGS_((ClientData cdata, Itcl_Stack * stack)); /* 7 */ ++ ClientData (*itcl_PopStack) _ANSI_ARGS_((Itcl_Stack * stack)); /* 8 */ ++ ClientData (*itcl_PeekStack) _ANSI_ARGS_((Itcl_Stack * stack)); /* 9 */ ++ ClientData (*itcl_GetStackValue) _ANSI_ARGS_((Itcl_Stack * stack, int pos)); /* 10 */ ++ void (*itcl_InitList) _ANSI_ARGS_((Itcl_List * listPtr)); /* 11 */ ++ void (*itcl_DeleteList) _ANSI_ARGS_((Itcl_List * listPtr)); /* 12 */ ++ Itcl_ListElem* (*itcl_CreateListElem) _ANSI_ARGS_((Itcl_List * listPtr)); /* 13 */ ++ Itcl_ListElem* (*itcl_DeleteListElem) _ANSI_ARGS_((Itcl_ListElem * elemPtr)); /* 14 */ ++ Itcl_ListElem* (*itcl_InsertList) _ANSI_ARGS_((Itcl_List * listPtr, ClientData val)); /* 15 */ ++ Itcl_ListElem* (*itcl_InsertListElem) _ANSI_ARGS_((Itcl_ListElem * pos, ClientData val)); /* 16 */ ++ Itcl_ListElem* (*itcl_AppendList) _ANSI_ARGS_((Itcl_List * listPtr, ClientData val)); /* 17 */ ++ Itcl_ListElem* (*itcl_AppendListElem) _ANSI_ARGS_((Itcl_ListElem * pos, ClientData val)); /* 18 */ ++ void (*itcl_SetListValue) _ANSI_ARGS_((Itcl_ListElem * elemPtr, ClientData val)); /* 19 */ ++ void (*itcl_EventuallyFree) _ANSI_ARGS_((ClientData cdata, Tcl_FreeProc * fproc)); /* 20 */ ++ void (*itcl_PreserveData) _ANSI_ARGS_((ClientData cdata)); /* 21 */ ++ void (*itcl_ReleaseData) _ANSI_ARGS_((ClientData cdata)); /* 22 */ ++ Itcl_InterpState (*itcl_SaveInterpState) _ANSI_ARGS_((Tcl_Interp* interp, int status)); /* 23 */ ++ int (*itcl_RestoreInterpState) _ANSI_ARGS_((Tcl_Interp* interp, Itcl_InterpState state)); /* 24 */ ++ void (*itcl_DiscardInterpState) _ANSI_ARGS_((Itcl_InterpState state)); /* 25 */ ++} ItclStubs; ++ ++TCL_EXTERNC ItclStubs *itclStubsPtr; ++ ++#if defined(USE_ITCL_STUBS) && !defined(USE_ITCL_STUB_PROCS) ++ ++/* ++ * Inline function declarations: ++ */ ++ ++#ifndef Itcl_Init ++#define Itcl_Init \ ++ (itclStubsPtr->itcl_Init) /* 0 */ ++#endif ++#ifndef Itcl_SafeInit ++#define Itcl_SafeInit \ ++ (itclStubsPtr->itcl_SafeInit) /* 1 */ ++#endif ++#ifndef Itcl_RegisterC ++#define Itcl_RegisterC \ ++ (itclStubsPtr->itcl_RegisterC) /* 2 */ ++#endif ++#ifndef Itcl_RegisterObjC ++#define Itcl_RegisterObjC \ ++ (itclStubsPtr->itcl_RegisterObjC) /* 3 */ ++#endif ++#ifndef Itcl_FindC ++#define Itcl_FindC \ ++ (itclStubsPtr->itcl_FindC) /* 4 */ ++#endif ++#ifndef Itcl_InitStack ++#define Itcl_InitStack \ ++ (itclStubsPtr->itcl_InitStack) /* 5 */ ++#endif ++#ifndef Itcl_DeleteStack ++#define Itcl_DeleteStack \ ++ (itclStubsPtr->itcl_DeleteStack) /* 6 */ ++#endif ++#ifndef Itcl_PushStack ++#define Itcl_PushStack \ ++ (itclStubsPtr->itcl_PushStack) /* 7 */ ++#endif ++#ifndef Itcl_PopStack ++#define Itcl_PopStack \ ++ (itclStubsPtr->itcl_PopStack) /* 8 */ ++#endif ++#ifndef Itcl_PeekStack ++#define Itcl_PeekStack \ ++ (itclStubsPtr->itcl_PeekStack) /* 9 */ ++#endif ++#ifndef Itcl_GetStackValue ++#define Itcl_GetStackValue \ ++ (itclStubsPtr->itcl_GetStackValue) /* 10 */ ++#endif ++#ifndef Itcl_InitList ++#define Itcl_InitList \ ++ (itclStubsPtr->itcl_InitList) /* 11 */ ++#endif ++#ifndef Itcl_DeleteList ++#define Itcl_DeleteList \ ++ (itclStubsPtr->itcl_DeleteList) /* 12 */ ++#endif ++#ifndef Itcl_CreateListElem ++#define Itcl_CreateListElem \ ++ (itclStubsPtr->itcl_CreateListElem) /* 13 */ ++#endif ++#ifndef Itcl_DeleteListElem ++#define Itcl_DeleteListElem \ ++ (itclStubsPtr->itcl_DeleteListElem) /* 14 */ ++#endif ++#ifndef Itcl_InsertList ++#define Itcl_InsertList \ ++ (itclStubsPtr->itcl_InsertList) /* 15 */ ++#endif ++#ifndef Itcl_InsertListElem ++#define Itcl_InsertListElem \ ++ (itclStubsPtr->itcl_InsertListElem) /* 16 */ ++#endif ++#ifndef Itcl_AppendList ++#define Itcl_AppendList \ ++ (itclStubsPtr->itcl_AppendList) /* 17 */ ++#endif ++#ifndef Itcl_AppendListElem ++#define Itcl_AppendListElem \ ++ (itclStubsPtr->itcl_AppendListElem) /* 18 */ ++#endif ++#ifndef Itcl_SetListValue ++#define Itcl_SetListValue \ ++ (itclStubsPtr->itcl_SetListValue) /* 19 */ ++#endif ++#ifndef Itcl_EventuallyFree ++#define Itcl_EventuallyFree \ ++ (itclStubsPtr->itcl_EventuallyFree) /* 20 */ ++#endif ++#ifndef Itcl_PreserveData ++#define Itcl_PreserveData \ ++ (itclStubsPtr->itcl_PreserveData) /* 21 */ ++#endif ++#ifndef Itcl_ReleaseData ++#define Itcl_ReleaseData \ ++ (itclStubsPtr->itcl_ReleaseData) /* 22 */ ++#endif ++#ifndef Itcl_SaveInterpState ++#define Itcl_SaveInterpState \ ++ (itclStubsPtr->itcl_SaveInterpState) /* 23 */ ++#endif ++#ifndef Itcl_RestoreInterpState ++#define Itcl_RestoreInterpState \ ++ (itclStubsPtr->itcl_RestoreInterpState) /* 24 */ ++#endif ++#ifndef Itcl_DiscardInterpState ++#define Itcl_DiscardInterpState \ ++ (itclStubsPtr->itcl_DiscardInterpState) /* 25 */ ++#endif ++ ++#endif /* defined(USE_ITCL_STUBS) && !defined(USE_ITCL_STUB_PROCS) */ ++ ++/* !END!: Do not edit above this line. */ ++ ++#endif /* _ITCLDECLS */ ++ +diff -Naur itk/generic/itcl3/itcl.h ITK_BLD/generic/itcl3/itcl.h +--- itk/generic/itcl3/itcl.h 1969-12-31 19:00:00.000000000 -0500 ++++ ITK_BLD/generic/itcl3/itcl.h 2024-07-10 10:40:21.279659891 -0400 +@@ -0,0 +1,217 @@ ++/* ++ * ------------------------------------------------------------------------ ++ * PACKAGE: [incr Tcl] ++ * DESCRIPTION: Object-Oriented Extensions to Tcl ++ * ++ * [incr Tcl] provides object-oriented extensions to Tcl, much as ++ * C++ provides object-oriented extensions to C. It provides a means ++ * of encapsulating related procedures together with their shared data ++ * in a local namespace that is hidden from the outside world. It ++ * promotes code re-use through inheritance. More than anything else, ++ * it encourages better organization of Tcl applications through the ++ * object-oriented paradigm, leading to code that is easier to ++ * understand and maintain. ++ * ++ * ADDING [incr Tcl] TO A Tcl-BASED APPLICATION: ++ * ++ * To add [incr Tcl] facilities to a Tcl application, modify the ++ * Tcl_AppInit() routine as follows: ++ * ++ * 1) Include this header file near the top of the file containing ++ * Tcl_AppInit(): ++ * ++ * #include "itcl.h" ++ * ++ * 2) Within the body of Tcl_AppInit(), add the following lines: ++ * ++ * if (Itcl_Init(interp) == TCL_ERROR) { ++ * return TCL_ERROR; ++ * } ++ * ++ * 3) Link your application with libitcl.a ++ * ++ * NOTE: An example file "tclAppInit.c" containing the changes shown ++ * above is included in this distribution. ++ * ++ * ======================================================================== ++ * AUTHOR: Michael J. McLennan ++ * Bell Labs Innovations for Lucent Technologies ++ * mmclennan@lucent.com ++ * http://www.tcltk.com/itcl ++ * ======================================================================== ++ * Copyright (c) 1993-1998 Lucent Technologies, Inc. ++ * ------------------------------------------------------------------------ ++ * See the file "license.terms" for information on usage and redistribution ++ * of this file, and for a DISCLAIMER OF ALL WARRANTIES. ++ */ ++#ifndef ITCL_H ++#define ITCL_H ++ ++#include "tcl.h" ++ ++#ifndef TCL_ALPHA_RELEASE ++# define TCL_ALPHA_RELEASE 0 ++#endif ++#ifndef TCL_BETA_RELEASE ++# define TCL_BETA_RELEASE 1 ++#endif ++#ifndef TCL_FINAL_RELEASE ++# define TCL_FINAL_RELEASE 2 ++#endif ++ ++ ++#define ITCL_MAJOR_VERSION 3 ++#define ITCL_MINOR_VERSION 4 ++#define ITCL_RELEASE_LEVEL TCL_FINAL_RELEASE ++#define ITCL_RELEASE_SERIAL 3 ++ ++#define ITCL_VERSION "3.4" ++#define ITCL_PATCH_LEVEL "3.4.3" ++ ++/* ++ * A special definition used to allow this header file to be included ++ * in resource files so that they can get obtain version information from ++ * this file. Resource compilers don't like all the C stuff, like typedefs ++ * and procedure declarations, that occur below. ++ */ ++ ++#ifndef RC_INVOKED ++ ++#undef TCL_STORAGE_CLASS ++#ifdef BUILD_itcl ++# define TCL_STORAGE_CLASS DLLEXPORT ++#else ++# ifdef USE_ITCL_STUBS ++# define TCL_STORAGE_CLASS ++# else ++# define TCL_STORAGE_CLASS DLLIMPORT ++# endif ++#endif ++ ++/* ++ * Fix the Borland bug that's in the EXTERN macro from tcl.h. ++ */ ++#ifndef TCL_EXTERN ++# undef DLLIMPORT ++# undef DLLEXPORT ++# ifdef __cplusplus ++# define TCL_EXTERNC extern "C" ++# else ++# define TCL_EXTERNC extern ++# endif ++# if defined(STATIC_BUILD) ++# define DLLIMPORT ++# define DLLEXPORT ++# define TCL_EXTERN(RTYPE) TCL_EXTERNC RTYPE ++# elif (defined(__WIN32__) && ( \ ++ defined(_MSC_VER) || (__BORLANDC__ >= 0x0550) || \ ++ defined(__LCC__) || defined(__WATCOMC__) || \ ++ (defined(__GNUC__) && defined(__declspec)) \ ++ )) || (defined(MAC_TCL) && FUNCTION_DECLSPEC) ++# define DLLIMPORT __declspec(dllimport) ++# define DLLEXPORT __declspec(dllexport) ++# define TCL_EXTERN(RTYPE) TCL_EXTERNC TCL_STORAGE_CLASS RTYPE ++# elif defined(__BORLANDC__) ++# define DLLIMPORT __import ++# define DLLEXPORT __export ++ /* Pre-5.5 Borland requires the attributes be placed after the */ ++ /* return type instead. */ ++# define TCL_EXTERN(RTYPE) TCL_EXTERNC RTYPE TCL_STORAGE_CLASS ++# else ++# define DLLIMPORT ++# define DLLEXPORT ++# define TCL_EXTERN(RTYPE) TCL_EXTERNC TCL_STORAGE_CLASS RTYPE ++# endif ++#endif ++ ++/* ++ * Protection levels: ++ * ++ * ITCL_PUBLIC - accessible from any namespace ++ * ITCL_PROTECTED - accessible from namespace that imports in "protected" mode ++ * ITCL_PRIVATE - accessible only within the namespace that contains it ++ */ ++#define ITCL_PUBLIC 1 ++#define ITCL_PROTECTED 2 ++#define ITCL_PRIVATE 3 ++#define ITCL_DEFAULT_PROTECT 4 ++ ++ ++/* ++ * Generic stack. ++ */ ++typedef struct Itcl_Stack { ++ ClientData *values; /* values on stack */ ++ int len; /* number of values on stack */ ++ int max; /* maximum size of stack */ ++ ClientData space[5]; /* initial space for stack data */ ++} Itcl_Stack; ++ ++#define Itcl_GetStackSize(stackPtr) ((stackPtr)->len) ++ ++/* ++ * Generic linked list. ++ */ ++struct Itcl_List; ++typedef struct Itcl_ListElem { ++ struct Itcl_List* owner; /* list containing this element */ ++ ClientData value; /* value associated with this element */ ++ struct Itcl_ListElem *prev; /* previous element in linked list */ ++ struct Itcl_ListElem *next; /* next element in linked list */ ++} Itcl_ListElem; ++ ++typedef struct Itcl_List { ++ int validate; /* validation stamp */ ++ int num; /* number of elements */ ++ struct Itcl_ListElem *head; /* previous element in linked list */ ++ struct Itcl_ListElem *tail; /* next element in linked list */ ++} Itcl_List; ++ ++#define Itcl_FirstListElem(listPtr) ((listPtr)->head) ++#define Itcl_LastListElem(listPtr) ((listPtr)->tail) ++#define Itcl_NextListElem(elemPtr) ((elemPtr)->next) ++#define Itcl_PrevListElem(elemPtr) ((elemPtr)->prev) ++#define Itcl_GetListLength(listPtr) ((listPtr)->num) ++#define Itcl_GetListValue(elemPtr) ((elemPtr)->value) ++ ++/* ++ * Token representing the state of an interpreter. ++ */ ++typedef struct Itcl_InterpState_ *Itcl_InterpState; ++ ++ ++/* ++ * Include the public function declarations that are accessible via ++ * the stubs table. ++ */ ++ ++#include "itclDecls.h" ++ ++ ++/* ++ * Itcl_InitStubs is used by extensions like Itk that can be linked ++ * against the itcl stubs library. If we are not using stubs ++ * then this reduces to package require. ++ */ ++ ++#ifdef USE_ITCL_STUBS ++ ++TCL_EXTERNC CONST char * ++ Itcl_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, ++ CONST char *version, int exact)); ++#else ++#define Itcl_InitStubs(interp, version, exact) \ ++ Tcl_PkgRequire(interp, "Itcl", version, exact) ++#endif ++ ++/* ++ * Public functions that are not accessible via the stubs table. ++ */ ++ ++ ++#endif /* RC_INVOKED */ ++ ++#undef TCL_STORAGE_CLASS ++#define TCL_STORAGE_CLASS DLLIMPORT ++ ++#endif /* ITCL_H */ +diff -Naur itk/generic/itcl3/itclIntDecls.h ITK_BLD/generic/itcl3/itclIntDecls.h +--- itk/generic/itcl3/itclIntDecls.h 1969-12-31 19:00:00.000000000 -0500 ++++ ITK_BLD/generic/itcl3/itclIntDecls.h 2024-07-10 10:40:21.279659891 -0400 +@@ -0,0 +1,1391 @@ ++/* ++ * itclIntDecls.h -- ++ * ++ * This file contains the declarations for all unsupported ++ * functions that are exported by the Tcl library. These ++ * interfaces are not guaranteed to remain the same between ++ * versions. Use at your own risk. ++ * ++ * See the file "license.terms" for information on usage and redistribution ++ * of this file, and for a DISCLAIMER OF ALL WARRANTIES. ++ */ ++ ++#ifndef _ITCLINTDECLS ++#define _ITCLINTDECLS ++ ++/* ++ * WARNING: This file is automatically generated by the tools/genStubs.tcl ++ * script. Any modifications to the function declarations below should be made ++ * in the itcl/generic/tclInt.decls script. ++ */ ++ ++/* !BEGIN!: Do not edit below this line. */ ++ ++/* ++ * Exported function declarations: ++ */ ++ ++#ifndef Itcl_IsClassNamespace_TCL_DECLARED ++#define Itcl_IsClassNamespace_TCL_DECLARED ++/* 0 */ ++TCL_EXTERN(int) Itcl_IsClassNamespace _ANSI_ARGS_(( ++ Tcl_Namespace * namesp)); ++#endif ++#ifndef Itcl_IsClass_TCL_DECLARED ++#define Itcl_IsClass_TCL_DECLARED ++/* 1 */ ++TCL_EXTERN(int) Itcl_IsClass _ANSI_ARGS_((Tcl_Command cmd)); ++#endif ++#ifndef Itcl_FindClass_TCL_DECLARED ++#define Itcl_FindClass_TCL_DECLARED ++/* 2 */ ++TCL_EXTERN(ItclClass*) Itcl_FindClass _ANSI_ARGS_((Tcl_Interp* interp, ++ CONST char* path, int autoload)); ++#endif ++#ifndef Itcl_FindObject_TCL_DECLARED ++#define Itcl_FindObject_TCL_DECLARED ++/* 3 */ ++TCL_EXTERN(int) Itcl_FindObject _ANSI_ARGS_((Tcl_Interp * interp, ++ CONST char * name, ItclObject ** roPtr)); ++#endif ++#ifndef Itcl_IsObject_TCL_DECLARED ++#define Itcl_IsObject_TCL_DECLARED ++/* 4 */ ++TCL_EXTERN(int) Itcl_IsObject _ANSI_ARGS_((Tcl_Command cmd)); ++#endif ++#ifndef Itcl_ObjectIsa_TCL_DECLARED ++#define Itcl_ObjectIsa_TCL_DECLARED ++/* 5 */ ++TCL_EXTERN(int) Itcl_ObjectIsa _ANSI_ARGS_((ItclObject * contextObj, ++ ItclClass * cdefn)); ++#endif ++#ifndef Itcl_Protection_TCL_DECLARED ++#define Itcl_Protection_TCL_DECLARED ++/* 6 */ ++TCL_EXTERN(int) Itcl_Protection _ANSI_ARGS_((Tcl_Interp * interp, ++ int newLevel)); ++#endif ++#ifndef Itcl_ProtectionStr_TCL_DECLARED ++#define Itcl_ProtectionStr_TCL_DECLARED ++/* 7 */ ++TCL_EXTERN(char*) Itcl_ProtectionStr _ANSI_ARGS_((int pLevel)); ++#endif ++#ifndef Itcl_CanAccess_TCL_DECLARED ++#define Itcl_CanAccess_TCL_DECLARED ++/* 8 */ ++TCL_EXTERN(int) Itcl_CanAccess _ANSI_ARGS_((ItclMember* memberPtr, ++ Tcl_Namespace* fromNsPtr)); ++#endif ++#ifndef Itcl_CanAccessFunc_TCL_DECLARED ++#define Itcl_CanAccessFunc_TCL_DECLARED ++/* 9 */ ++TCL_EXTERN(int) Itcl_CanAccessFunc _ANSI_ARGS_(( ++ ItclMemberFunc* mfunc, ++ Tcl_Namespace* fromNsPtr)); ++#endif ++#ifndef Itcl_GetTrueNamespace_TCL_DECLARED ++#define Itcl_GetTrueNamespace_TCL_DECLARED ++/* 10 */ ++TCL_EXTERN(Tcl_Namespace*) Itcl_GetTrueNamespace _ANSI_ARGS_(( ++ Tcl_Interp * interp, ItclObjectInfo * info)); ++#endif ++#ifndef Itcl_ParseNamespPath_TCL_DECLARED ++#define Itcl_ParseNamespPath_TCL_DECLARED ++/* 11 */ ++TCL_EXTERN(void) Itcl_ParseNamespPath _ANSI_ARGS_((CONST char * name, ++ Tcl_DString * buffer, char ** head, ++ char ** tail)); ++#endif ++#ifndef Itcl_DecodeScopedCommand_TCL_DECLARED ++#define Itcl_DecodeScopedCommand_TCL_DECLARED ++/* 12 */ ++TCL_EXTERN(int) Itcl_DecodeScopedCommand _ANSI_ARGS_(( ++ Tcl_Interp * interp, CONST char * name, ++ Tcl_Namespace ** rNsPtr, char ** rCmdPtr)); ++#endif ++#ifndef Itcl_EvalArgs_TCL_DECLARED ++#define Itcl_EvalArgs_TCL_DECLARED ++/* 13 */ ++TCL_EXTERN(int) Itcl_EvalArgs _ANSI_ARGS_((Tcl_Interp * interp, ++ int objc, Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_CreateArgs_TCL_DECLARED ++#define Itcl_CreateArgs_TCL_DECLARED ++/* 14 */ ++TCL_EXTERN(Tcl_Obj*) Itcl_CreateArgs _ANSI_ARGS_((Tcl_Interp * interp, ++ CONST char * string, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_PushContext_TCL_DECLARED ++#define Itcl_PushContext_TCL_DECLARED ++/* 15 */ ++TCL_EXTERN(int) Itcl_PushContext _ANSI_ARGS_((Tcl_Interp * interp, ++ ItclMember * member, ++ ItclClass * contextClass, ++ ItclObject * contextObj, ++ ItclContext * contextPtr)); ++#endif ++#ifndef Itcl_PopContext_TCL_DECLARED ++#define Itcl_PopContext_TCL_DECLARED ++/* 16 */ ++TCL_EXTERN(void) Itcl_PopContext _ANSI_ARGS_((Tcl_Interp * interp, ++ ItclContext * contextPtr)); ++#endif ++#ifndef Itcl_GetContext_TCL_DECLARED ++#define Itcl_GetContext_TCL_DECLARED ++/* 17 */ ++TCL_EXTERN(int) Itcl_GetContext _ANSI_ARGS_((Tcl_Interp * interp, ++ ItclClass ** cdefnPtr, ++ ItclObject ** odefnPtr)); ++#endif ++#ifndef Itcl_InitHierIter_TCL_DECLARED ++#define Itcl_InitHierIter_TCL_DECLARED ++/* 18 */ ++TCL_EXTERN(void) Itcl_InitHierIter _ANSI_ARGS_((ItclHierIter * iter, ++ ItclClass * cdefn)); ++#endif ++#ifndef Itcl_DeleteHierIter_TCL_DECLARED ++#define Itcl_DeleteHierIter_TCL_DECLARED ++/* 19 */ ++TCL_EXTERN(void) Itcl_DeleteHierIter _ANSI_ARGS_((ItclHierIter * iter)); ++#endif ++#ifndef Itcl_AdvanceHierIter_TCL_DECLARED ++#define Itcl_AdvanceHierIter_TCL_DECLARED ++/* 20 */ ++TCL_EXTERN(ItclClass*) Itcl_AdvanceHierIter _ANSI_ARGS_(( ++ ItclHierIter * iter)); ++#endif ++#ifndef Itcl_FindClassesCmd_TCL_DECLARED ++#define Itcl_FindClassesCmd_TCL_DECLARED ++/* 21 */ ++TCL_EXTERN(int) Itcl_FindClassesCmd _ANSI_ARGS_(( ++ ClientData clientData, Tcl_Interp * interp, ++ int objc, Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_FindObjectsCmd_TCL_DECLARED ++#define Itcl_FindObjectsCmd_TCL_DECLARED ++/* 22 */ ++TCL_EXTERN(int) Itcl_FindObjectsCmd _ANSI_ARGS_(( ++ ClientData clientData, Tcl_Interp * interp, ++ int objc, Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_ProtectionCmd_TCL_DECLARED ++#define Itcl_ProtectionCmd_TCL_DECLARED ++/* 23 */ ++TCL_EXTERN(int) Itcl_ProtectionCmd _ANSI_ARGS_(( ++ ClientData clientData, Tcl_Interp * interp, ++ int objc, Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_DelClassCmd_TCL_DECLARED ++#define Itcl_DelClassCmd_TCL_DECLARED ++/* 24 */ ++TCL_EXTERN(int) Itcl_DelClassCmd _ANSI_ARGS_((ClientData clientData, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_DelObjectCmd_TCL_DECLARED ++#define Itcl_DelObjectCmd_TCL_DECLARED ++/* 25 */ ++TCL_EXTERN(int) Itcl_DelObjectCmd _ANSI_ARGS_((ClientData clientData, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_ScopeCmd_TCL_DECLARED ++#define Itcl_ScopeCmd_TCL_DECLARED ++/* 26 */ ++TCL_EXTERN(int) Itcl_ScopeCmd _ANSI_ARGS_((ClientData clientData, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_CodeCmd_TCL_DECLARED ++#define Itcl_CodeCmd_TCL_DECLARED ++/* 27 */ ++TCL_EXTERN(int) Itcl_CodeCmd _ANSI_ARGS_((ClientData clientData, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_StubCreateCmd_TCL_DECLARED ++#define Itcl_StubCreateCmd_TCL_DECLARED ++/* 28 */ ++TCL_EXTERN(int) Itcl_StubCreateCmd _ANSI_ARGS_(( ++ ClientData clientData, Tcl_Interp * interp, ++ int objc, Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_StubExistsCmd_TCL_DECLARED ++#define Itcl_StubExistsCmd_TCL_DECLARED ++/* 29 */ ++TCL_EXTERN(int) Itcl_StubExistsCmd _ANSI_ARGS_(( ++ ClientData clientData, Tcl_Interp * interp, ++ int objc, Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_IsStub_TCL_DECLARED ++#define Itcl_IsStub_TCL_DECLARED ++/* 30 */ ++TCL_EXTERN(int) Itcl_IsStub _ANSI_ARGS_((Tcl_Command cmd)); ++#endif ++#ifndef Itcl_CreateClass_TCL_DECLARED ++#define Itcl_CreateClass_TCL_DECLARED ++/* 31 */ ++TCL_EXTERN(int) Itcl_CreateClass _ANSI_ARGS_((Tcl_Interp* interp, ++ CONST char* path, ItclObjectInfo * info, ++ ItclClass ** rPtr)); ++#endif ++#ifndef Itcl_DeleteClass_TCL_DECLARED ++#define Itcl_DeleteClass_TCL_DECLARED ++/* 32 */ ++TCL_EXTERN(int) Itcl_DeleteClass _ANSI_ARGS_((Tcl_Interp * interp, ++ ItclClass * cdefnPtr)); ++#endif ++#ifndef Itcl_FindClassNamespace_TCL_DECLARED ++#define Itcl_FindClassNamespace_TCL_DECLARED ++/* 33 */ ++TCL_EXTERN(Tcl_Namespace*) Itcl_FindClassNamespace _ANSI_ARGS_(( ++ Tcl_Interp* interp, CONST char* path)); ++#endif ++#ifndef Itcl_HandleClass_TCL_DECLARED ++#define Itcl_HandleClass_TCL_DECLARED ++/* 34 */ ++TCL_EXTERN(int) Itcl_HandleClass _ANSI_ARGS_((ClientData clientData, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_ClassCmdResolver_TCL_DECLARED ++#define Itcl_ClassCmdResolver_TCL_DECLARED ++/* 35 */ ++TCL_EXTERN(int) Itcl_ClassCmdResolver _ANSI_ARGS_(( ++ Tcl_Interp * interp, CONST char* name, ++ Tcl_Namespace * context, int flags, ++ Tcl_Command * rPtr)); ++#endif ++#ifndef Itcl_ClassVarResolver_TCL_DECLARED ++#define Itcl_ClassVarResolver_TCL_DECLARED ++/* 36 */ ++TCL_EXTERN(int) Itcl_ClassVarResolver _ANSI_ARGS_(( ++ Tcl_Interp * interp, CONST char* name, ++ Tcl_Namespace * context, int flags, ++ Tcl_Var * rPtr)); ++#endif ++#ifndef Itcl_ClassCompiledVarResolver_TCL_DECLARED ++#define Itcl_ClassCompiledVarResolver_TCL_DECLARED ++/* 37 */ ++TCL_EXTERN(int) Itcl_ClassCompiledVarResolver _ANSI_ARGS_(( ++ Tcl_Interp * interp, CONST char* name, ++ int length, Tcl_Namespace * context, ++ Tcl_ResolvedVarInfo ** rPtr)); ++#endif ++#ifndef Itcl_BuildVirtualTables_TCL_DECLARED ++#define Itcl_BuildVirtualTables_TCL_DECLARED ++/* 38 */ ++TCL_EXTERN(void) Itcl_BuildVirtualTables _ANSI_ARGS_(( ++ ItclClass* cdefnPtr)); ++#endif ++#ifndef Itcl_CreateVarDefn_TCL_DECLARED ++#define Itcl_CreateVarDefn_TCL_DECLARED ++/* 39 */ ++TCL_EXTERN(int) Itcl_CreateVarDefn _ANSI_ARGS_((Tcl_Interp * interp, ++ ItclClass* cdefn, char* name, char* init, ++ char* config, ItclVarDefn** vdefnPtr)); ++#endif ++#ifndef Itcl_DeleteVarDefn_TCL_DECLARED ++#define Itcl_DeleteVarDefn_TCL_DECLARED ++/* 40 */ ++TCL_EXTERN(void) Itcl_DeleteVarDefn _ANSI_ARGS_((ItclVarDefn * vdefn)); ++#endif ++#ifndef Itcl_GetCommonVar_TCL_DECLARED ++#define Itcl_GetCommonVar_TCL_DECLARED ++/* 41 */ ++TCL_EXTERN(CONST char*) Itcl_GetCommonVar _ANSI_ARGS_((Tcl_Interp * interp, ++ CONST char * name, ItclClass * contextClass)); ++#endif ++#ifndef Itcl_CreateMember_TCL_DECLARED ++#define Itcl_CreateMember_TCL_DECLARED ++/* 42 */ ++TCL_EXTERN(ItclMember*) Itcl_CreateMember _ANSI_ARGS_((Tcl_Interp* interp, ++ ItclClass * cdefn, CONST char* name)); ++#endif ++#ifndef Itcl_DeleteMember_TCL_DECLARED ++#define Itcl_DeleteMember_TCL_DECLARED ++/* 43 */ ++TCL_EXTERN(void) Itcl_DeleteMember _ANSI_ARGS_((ItclMember * memPtr)); ++#endif ++#ifndef Itcl_CreateObject_TCL_DECLARED ++#define Itcl_CreateObject_TCL_DECLARED ++/* 44 */ ++TCL_EXTERN(int) Itcl_CreateObject _ANSI_ARGS_((Tcl_Interp * interp, ++ CONST char* name, ItclClass * cdefn, ++ int objc, Tcl_Obj *CONST objv[], ++ ItclObject ** roPtr)); ++#endif ++#ifndef Itcl_DeleteObject_TCL_DECLARED ++#define Itcl_DeleteObject_TCL_DECLARED ++/* 45 */ ++TCL_EXTERN(int) Itcl_DeleteObject _ANSI_ARGS_((Tcl_Interp * interp, ++ ItclObject * contextObj)); ++#endif ++#ifndef Itcl_DestructObject_TCL_DECLARED ++#define Itcl_DestructObject_TCL_DECLARED ++/* 46 */ ++TCL_EXTERN(int) Itcl_DestructObject _ANSI_ARGS_((Tcl_Interp * interp, ++ ItclObject * contextObj, int flags)); ++#endif ++#ifndef Itcl_HandleInstance_TCL_DECLARED ++#define Itcl_HandleInstance_TCL_DECLARED ++/* 47 */ ++TCL_EXTERN(int) Itcl_HandleInstance _ANSI_ARGS_(( ++ ClientData clientData, Tcl_Interp * interp, ++ int objc, Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_GetInstanceVar_TCL_DECLARED ++#define Itcl_GetInstanceVar_TCL_DECLARED ++/* 48 */ ++TCL_EXTERN(CONST char*) Itcl_GetInstanceVar _ANSI_ARGS_(( ++ Tcl_Interp * interp, CONST char * name, ++ ItclObject * contextObj, ++ ItclClass * contextClass)); ++#endif ++#ifndef Itcl_ScopedVarResolver_TCL_DECLARED ++#define Itcl_ScopedVarResolver_TCL_DECLARED ++/* 49 */ ++TCL_EXTERN(int) Itcl_ScopedVarResolver _ANSI_ARGS_(( ++ Tcl_Interp * interp, CONST char * name, ++ Tcl_Namespace * contextNs, int flags, ++ Tcl_Var * rPtr)); ++#endif ++#ifndef Itcl_BodyCmd_TCL_DECLARED ++#define Itcl_BodyCmd_TCL_DECLARED ++/* 50 */ ++TCL_EXTERN(int) Itcl_BodyCmd _ANSI_ARGS_((ClientData dummy, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_ConfigBodyCmd_TCL_DECLARED ++#define Itcl_ConfigBodyCmd_TCL_DECLARED ++/* 51 */ ++TCL_EXTERN(int) Itcl_ConfigBodyCmd _ANSI_ARGS_((ClientData dummy, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_CreateMethod_TCL_DECLARED ++#define Itcl_CreateMethod_TCL_DECLARED ++/* 52 */ ++TCL_EXTERN(int) Itcl_CreateMethod _ANSI_ARGS_((Tcl_Interp* interp, ++ ItclClass * cdefn, CONST char* name, ++ CONST char* arglist, CONST char* body)); ++#endif ++#ifndef Itcl_CreateProc_TCL_DECLARED ++#define Itcl_CreateProc_TCL_DECLARED ++/* 53 */ ++TCL_EXTERN(int) Itcl_CreateProc _ANSI_ARGS_((Tcl_Interp* interp, ++ ItclClass * cdefn, CONST char* name, ++ CONST char* arglist, CONST char* body)); ++#endif ++#ifndef Itcl_CreateMemberFunc_TCL_DECLARED ++#define Itcl_CreateMemberFunc_TCL_DECLARED ++/* 54 */ ++TCL_EXTERN(int) Itcl_CreateMemberFunc _ANSI_ARGS_(( ++ Tcl_Interp* interp, ItclClass * cdefn, ++ CONST char* name, CONST char* arglist, ++ CONST char* body, ItclMemberFunc** mfuncPtr)); ++#endif ++#ifndef Itcl_ChangeMemberFunc_TCL_DECLARED ++#define Itcl_ChangeMemberFunc_TCL_DECLARED ++/* 55 */ ++TCL_EXTERN(int) Itcl_ChangeMemberFunc _ANSI_ARGS_(( ++ Tcl_Interp* interp, ItclMemberFunc* mfunc, ++ CONST char* arglist, CONST char* body)); ++#endif ++#ifndef Itcl_DeleteMemberFunc_TCL_DECLARED ++#define Itcl_DeleteMemberFunc_TCL_DECLARED ++/* 56 */ ++TCL_EXTERN(void) Itcl_DeleteMemberFunc _ANSI_ARGS_((CONST char* cdata)); ++#endif ++#ifndef Itcl_CreateMemberCode_TCL_DECLARED ++#define Itcl_CreateMemberCode_TCL_DECLARED ++/* 57 */ ++TCL_EXTERN(int) Itcl_CreateMemberCode _ANSI_ARGS_(( ++ Tcl_Interp* interp, ItclClass * cdefn, ++ CONST char* arglist, CONST char* body, ++ ItclMemberCode** mcodePtr)); ++#endif ++#ifndef Itcl_DeleteMemberCode_TCL_DECLARED ++#define Itcl_DeleteMemberCode_TCL_DECLARED ++/* 58 */ ++TCL_EXTERN(void) Itcl_DeleteMemberCode _ANSI_ARGS_((char* cdata)); ++#endif ++#ifndef Itcl_GetMemberCode_TCL_DECLARED ++#define Itcl_GetMemberCode_TCL_DECLARED ++/* 59 */ ++TCL_EXTERN(int) Itcl_GetMemberCode _ANSI_ARGS_((Tcl_Interp* interp, ++ ItclMember* member)); ++#endif ++/* Slot 60 is reserved */ ++#ifndef Itcl_EvalMemberCode_TCL_DECLARED ++#define Itcl_EvalMemberCode_TCL_DECLARED ++/* 61 */ ++TCL_EXTERN(int) Itcl_EvalMemberCode _ANSI_ARGS_((Tcl_Interp * interp, ++ ItclMemberFunc * mfunc, ItclMember * member, ++ ItclObject * contextObj, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_CreateArgList_TCL_DECLARED ++#define Itcl_CreateArgList_TCL_DECLARED ++/* 62 */ ++TCL_EXTERN(int) Itcl_CreateArgList _ANSI_ARGS_((Tcl_Interp* interp, ++ CONST char* decl, int* argcPtr, ++ CompiledLocal** argPtr)); ++#endif ++#ifndef Itcl_CreateArg_TCL_DECLARED ++#define Itcl_CreateArg_TCL_DECLARED ++/* 63 */ ++TCL_EXTERN(CompiledLocal*) Itcl_CreateArg _ANSI_ARGS_((CONST char* name, ++ CONST char* init)); ++#endif ++#ifndef Itcl_DeleteArgList_TCL_DECLARED ++#define Itcl_DeleteArgList_TCL_DECLARED ++/* 64 */ ++TCL_EXTERN(void) Itcl_DeleteArgList _ANSI_ARGS_(( ++ CompiledLocal * arglist)); ++#endif ++#ifndef Itcl_ArgList_TCL_DECLARED ++#define Itcl_ArgList_TCL_DECLARED ++/* 65 */ ++TCL_EXTERN(Tcl_Obj*) Itcl_ArgList _ANSI_ARGS_((int argc, ++ CompiledLocal* arglist)); ++#endif ++#ifndef Itcl_EquivArgLists_TCL_DECLARED ++#define Itcl_EquivArgLists_TCL_DECLARED ++/* 66 */ ++TCL_EXTERN(int) Itcl_EquivArgLists _ANSI_ARGS_((CompiledLocal* arg1, ++ int arg1c, CompiledLocal* arg2, int arg2c)); ++#endif ++#ifndef Itcl_GetMemberFuncUsage_TCL_DECLARED ++#define Itcl_GetMemberFuncUsage_TCL_DECLARED ++/* 67 */ ++TCL_EXTERN(void) Itcl_GetMemberFuncUsage _ANSI_ARGS_(( ++ ItclMemberFunc * mfunc, ++ ItclObject * contextObj, Tcl_Obj * objPtr)); ++#endif ++#ifndef Itcl_ExecMethod_TCL_DECLARED ++#define Itcl_ExecMethod_TCL_DECLARED ++/* 68 */ ++TCL_EXTERN(int) Itcl_ExecMethod _ANSI_ARGS_((ClientData clientData, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_ExecProc_TCL_DECLARED ++#define Itcl_ExecProc_TCL_DECLARED ++/* 69 */ ++TCL_EXTERN(int) Itcl_ExecProc _ANSI_ARGS_((ClientData clientData, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_AssignArgs_TCL_DECLARED ++#define Itcl_AssignArgs_TCL_DECLARED ++/* 70 */ ++TCL_EXTERN(int) Itcl_AssignArgs _ANSI_ARGS_((Tcl_Interp * interp, ++ int objc, Tcl_Obj *CONST objv[], ++ ItclMemberFunc * mfunc)); ++#endif ++#ifndef Itcl_ConstructBase_TCL_DECLARED ++#define Itcl_ConstructBase_TCL_DECLARED ++/* 71 */ ++TCL_EXTERN(int) Itcl_ConstructBase _ANSI_ARGS_((Tcl_Interp * interp, ++ ItclObject * contextObj, ++ ItclClass * contextClass)); ++#endif ++#ifndef Itcl_InvokeMethodIfExists_TCL_DECLARED ++#define Itcl_InvokeMethodIfExists_TCL_DECLARED ++/* 72 */ ++TCL_EXTERN(int) Itcl_InvokeMethodIfExists _ANSI_ARGS_(( ++ Tcl_Interp * interp, CONST char * name, ++ ItclClass * contextClass, ++ ItclObject * contextObj, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++/* Slot 73 is reserved */ ++#ifndef Itcl_ReportFuncErrors_TCL_DECLARED ++#define Itcl_ReportFuncErrors_TCL_DECLARED ++/* 74 */ ++TCL_EXTERN(int) Itcl_ReportFuncErrors _ANSI_ARGS_(( ++ Tcl_Interp* interp, ItclMemberFunc * mfunc, ++ ItclObject * contextObj, int result)); ++#endif ++#ifndef Itcl_ParseInit_TCL_DECLARED ++#define Itcl_ParseInit_TCL_DECLARED ++/* 75 */ ++TCL_EXTERN(int) Itcl_ParseInit _ANSI_ARGS_((Tcl_Interp * interp, ++ ItclObjectInfo * info)); ++#endif ++#ifndef Itcl_ClassCmd_TCL_DECLARED ++#define Itcl_ClassCmd_TCL_DECLARED ++/* 76 */ ++TCL_EXTERN(int) Itcl_ClassCmd _ANSI_ARGS_((ClientData clientData, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_ClassInheritCmd_TCL_DECLARED ++#define Itcl_ClassInheritCmd_TCL_DECLARED ++/* 77 */ ++TCL_EXTERN(int) Itcl_ClassInheritCmd _ANSI_ARGS_(( ++ ClientData clientData, Tcl_Interp * interp, ++ int objc, Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_ClassProtectionCmd_TCL_DECLARED ++#define Itcl_ClassProtectionCmd_TCL_DECLARED ++/* 78 */ ++TCL_EXTERN(int) Itcl_ClassProtectionCmd _ANSI_ARGS_(( ++ ClientData clientData, Tcl_Interp * interp, ++ int objc, Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_ClassConstructorCmd_TCL_DECLARED ++#define Itcl_ClassConstructorCmd_TCL_DECLARED ++/* 79 */ ++TCL_EXTERN(int) Itcl_ClassConstructorCmd _ANSI_ARGS_(( ++ ClientData clientData, Tcl_Interp * interp, ++ int objc, Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_ClassDestructorCmd_TCL_DECLARED ++#define Itcl_ClassDestructorCmd_TCL_DECLARED ++/* 80 */ ++TCL_EXTERN(int) Itcl_ClassDestructorCmd _ANSI_ARGS_(( ++ ClientData clientData, Tcl_Interp * interp, ++ int objc, Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_ClassMethodCmd_TCL_DECLARED ++#define Itcl_ClassMethodCmd_TCL_DECLARED ++/* 81 */ ++TCL_EXTERN(int) Itcl_ClassMethodCmd _ANSI_ARGS_(( ++ ClientData clientData, Tcl_Interp * interp, ++ int objc, Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_ClassProcCmd_TCL_DECLARED ++#define Itcl_ClassProcCmd_TCL_DECLARED ++/* 82 */ ++TCL_EXTERN(int) Itcl_ClassProcCmd _ANSI_ARGS_((ClientData clientData, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_ClassVariableCmd_TCL_DECLARED ++#define Itcl_ClassVariableCmd_TCL_DECLARED ++/* 83 */ ++TCL_EXTERN(int) Itcl_ClassVariableCmd _ANSI_ARGS_(( ++ ClientData clientData, Tcl_Interp * interp, ++ int objc, Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_ClassCommonCmd_TCL_DECLARED ++#define Itcl_ClassCommonCmd_TCL_DECLARED ++/* 84 */ ++TCL_EXTERN(int) Itcl_ClassCommonCmd _ANSI_ARGS_(( ++ ClientData clientData, Tcl_Interp * interp, ++ int objc, Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_ParseVarResolver_TCL_DECLARED ++#define Itcl_ParseVarResolver_TCL_DECLARED ++/* 85 */ ++TCL_EXTERN(int) Itcl_ParseVarResolver _ANSI_ARGS_(( ++ Tcl_Interp * interp, CONST char* name, ++ Tcl_Namespace * contextNs, int flags, ++ Tcl_Var* rPtr)); ++#endif ++#ifndef Itcl_BiInit_TCL_DECLARED ++#define Itcl_BiInit_TCL_DECLARED ++/* 86 */ ++TCL_EXTERN(int) Itcl_BiInit _ANSI_ARGS_((Tcl_Interp * interp)); ++#endif ++#ifndef Itcl_InstallBiMethods_TCL_DECLARED ++#define Itcl_InstallBiMethods_TCL_DECLARED ++/* 87 */ ++TCL_EXTERN(int) Itcl_InstallBiMethods _ANSI_ARGS_(( ++ Tcl_Interp * interp, ItclClass * cdefn)); ++#endif ++#ifndef Itcl_BiIsaCmd_TCL_DECLARED ++#define Itcl_BiIsaCmd_TCL_DECLARED ++/* 88 */ ++TCL_EXTERN(int) Itcl_BiIsaCmd _ANSI_ARGS_((ClientData clientData, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_BiConfigureCmd_TCL_DECLARED ++#define Itcl_BiConfigureCmd_TCL_DECLARED ++/* 89 */ ++TCL_EXTERN(int) Itcl_BiConfigureCmd _ANSI_ARGS_(( ++ ClientData clientData, Tcl_Interp * interp, ++ int objc, Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_BiCgetCmd_TCL_DECLARED ++#define Itcl_BiCgetCmd_TCL_DECLARED ++/* 90 */ ++TCL_EXTERN(int) Itcl_BiCgetCmd _ANSI_ARGS_((ClientData clientData, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_BiChainCmd_TCL_DECLARED ++#define Itcl_BiChainCmd_TCL_DECLARED ++/* 91 */ ++TCL_EXTERN(int) Itcl_BiChainCmd _ANSI_ARGS_((ClientData dummy, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_BiInfoClassCmd_TCL_DECLARED ++#define Itcl_BiInfoClassCmd_TCL_DECLARED ++/* 92 */ ++TCL_EXTERN(int) Itcl_BiInfoClassCmd _ANSI_ARGS_((ClientData dummy, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_BiInfoInheritCmd_TCL_DECLARED ++#define Itcl_BiInfoInheritCmd_TCL_DECLARED ++/* 93 */ ++TCL_EXTERN(int) Itcl_BiInfoInheritCmd _ANSI_ARGS_((ClientData dummy, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_BiInfoHeritageCmd_TCL_DECLARED ++#define Itcl_BiInfoHeritageCmd_TCL_DECLARED ++/* 94 */ ++TCL_EXTERN(int) Itcl_BiInfoHeritageCmd _ANSI_ARGS_((ClientData dummy, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_BiInfoFunctionCmd_TCL_DECLARED ++#define Itcl_BiInfoFunctionCmd_TCL_DECLARED ++/* 95 */ ++TCL_EXTERN(int) Itcl_BiInfoFunctionCmd _ANSI_ARGS_((ClientData dummy, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_BiInfoVariableCmd_TCL_DECLARED ++#define Itcl_BiInfoVariableCmd_TCL_DECLARED ++/* 96 */ ++TCL_EXTERN(int) Itcl_BiInfoVariableCmd _ANSI_ARGS_((ClientData dummy, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_BiInfoBodyCmd_TCL_DECLARED ++#define Itcl_BiInfoBodyCmd_TCL_DECLARED ++/* 97 */ ++TCL_EXTERN(int) Itcl_BiInfoBodyCmd _ANSI_ARGS_((ClientData dummy, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_BiInfoArgsCmd_TCL_DECLARED ++#define Itcl_BiInfoArgsCmd_TCL_DECLARED ++/* 98 */ ++TCL_EXTERN(int) Itcl_BiInfoArgsCmd _ANSI_ARGS_((ClientData dummy, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_DefaultInfoCmd_TCL_DECLARED ++#define Itcl_DefaultInfoCmd_TCL_DECLARED ++/* 99 */ ++TCL_EXTERN(int) Itcl_DefaultInfoCmd _ANSI_ARGS_((ClientData dummy, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_EnsembleInit_TCL_DECLARED ++#define Itcl_EnsembleInit_TCL_DECLARED ++/* 100 */ ++TCL_EXTERN(int) Itcl_EnsembleInit _ANSI_ARGS_((Tcl_Interp * interp)); ++#endif ++#ifndef Itcl_CreateEnsemble_TCL_DECLARED ++#define Itcl_CreateEnsemble_TCL_DECLARED ++/* 101 */ ++TCL_EXTERN(int) Itcl_CreateEnsemble _ANSI_ARGS_((Tcl_Interp * interp, ++ CONST char* ensName)); ++#endif ++#ifndef Itcl_AddEnsemblePart_TCL_DECLARED ++#define Itcl_AddEnsemblePart_TCL_DECLARED ++/* 102 */ ++TCL_EXTERN(int) Itcl_AddEnsemblePart _ANSI_ARGS_(( ++ Tcl_Interp * interp, CONST char* ensName, ++ CONST char* partName, CONST char* usageInfo, ++ Tcl_ObjCmdProc * objProc, ++ ClientData clientData, ++ Tcl_CmdDeleteProc * deleteProc)); ++#endif ++#ifndef Itcl_GetEnsemblePart_TCL_DECLARED ++#define Itcl_GetEnsemblePart_TCL_DECLARED ++/* 103 */ ++TCL_EXTERN(int) Itcl_GetEnsemblePart _ANSI_ARGS_(( ++ Tcl_Interp * interp, CONST char * ensName, ++ CONST char * partName, Tcl_CmdInfo * infoPtr)); ++#endif ++#ifndef Itcl_IsEnsemble_TCL_DECLARED ++#define Itcl_IsEnsemble_TCL_DECLARED ++/* 104 */ ++TCL_EXTERN(int) Itcl_IsEnsemble _ANSI_ARGS_((Tcl_CmdInfo* infoPtr)); ++#endif ++#ifndef Itcl_GetEnsembleUsage_TCL_DECLARED ++#define Itcl_GetEnsembleUsage_TCL_DECLARED ++/* 105 */ ++TCL_EXTERN(int) Itcl_GetEnsembleUsage _ANSI_ARGS_(( ++ Tcl_Interp * interp, CONST char * ensName, ++ Tcl_Obj * objPtr)); ++#endif ++#ifndef Itcl_GetEnsembleUsageForObj_TCL_DECLARED ++#define Itcl_GetEnsembleUsageForObj_TCL_DECLARED ++/* 106 */ ++TCL_EXTERN(int) Itcl_GetEnsembleUsageForObj _ANSI_ARGS_(( ++ Tcl_Interp * interp, Tcl_Obj * ensObjPtr, ++ Tcl_Obj * objPtr)); ++#endif ++#ifndef Itcl_EnsembleCmd_TCL_DECLARED ++#define Itcl_EnsembleCmd_TCL_DECLARED ++/* 107 */ ++TCL_EXTERN(int) Itcl_EnsembleCmd _ANSI_ARGS_((ClientData clientData, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_EnsPartCmd_TCL_DECLARED ++#define Itcl_EnsPartCmd_TCL_DECLARED ++/* 108 */ ++TCL_EXTERN(int) Itcl_EnsPartCmd _ANSI_ARGS_((ClientData clientData, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_EnsembleErrorCmd_TCL_DECLARED ++#define Itcl_EnsembleErrorCmd_TCL_DECLARED ++/* 109 */ ++TCL_EXTERN(int) Itcl_EnsembleErrorCmd _ANSI_ARGS_(( ++ ClientData clientData, Tcl_Interp * interp, ++ int objc, Tcl_Obj *CONST objv[])); ++#endif ++/* Slot 110 is reserved */ ++/* Slot 111 is reserved */ ++#ifndef _Tcl_GetCallFrame_TCL_DECLARED ++#define _Tcl_GetCallFrame_TCL_DECLARED ++/* 112 */ ++TCL_EXTERN(Itcl_CallFrame*) _Tcl_GetCallFrame _ANSI_ARGS_(( ++ Tcl_Interp * interp, int level)); ++#endif ++#ifndef _Tcl_ActivateCallFrame_TCL_DECLARED ++#define _Tcl_ActivateCallFrame_TCL_DECLARED ++/* 113 */ ++TCL_EXTERN(Itcl_CallFrame*) _Tcl_ActivateCallFrame _ANSI_ARGS_(( ++ Tcl_Interp * interp, ++ Itcl_CallFrame * framePtr)); ++#endif ++#ifndef _TclNewVar_TCL_DECLARED ++#define _TclNewVar_TCL_DECLARED ++/* 114 */ ++TCL_EXTERN(Var*) _TclNewVar _ANSI_ARGS_((void)); ++#endif ++#ifndef Itcl_Assert_TCL_DECLARED ++#define Itcl_Assert_TCL_DECLARED ++/* 115 */ ++TCL_EXTERN(void) Itcl_Assert _ANSI_ARGS_((CONST char * testExpr, ++ CONST char * fileName, int lineNum)); ++#endif ++#ifndef Itcl_IsObjectCmd_TCL_DECLARED ++#define Itcl_IsObjectCmd_TCL_DECLARED ++/* 116 */ ++TCL_EXTERN(int) Itcl_IsObjectCmd _ANSI_ARGS_((ClientData clientData, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++#ifndef Itcl_IsClassCmd_TCL_DECLARED ++#define Itcl_IsClassCmd_TCL_DECLARED ++/* 117 */ ++TCL_EXTERN(int) Itcl_IsClassCmd _ANSI_ARGS_((ClientData clientData, ++ Tcl_Interp * interp, int objc, ++ Tcl_Obj *CONST objv[])); ++#endif ++ ++typedef struct ItclIntStubs { ++ int magic; ++ struct ItclIntStubHooks *hooks; ++ ++ int (*itcl_IsClassNamespace) _ANSI_ARGS_((Tcl_Namespace * namesp)); /* 0 */ ++ int (*itcl_IsClass) _ANSI_ARGS_((Tcl_Command cmd)); /* 1 */ ++ ItclClass* (*itcl_FindClass) _ANSI_ARGS_((Tcl_Interp* interp, CONST char* path, int autoload)); /* 2 */ ++ int (*itcl_FindObject) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, ItclObject ** roPtr)); /* 3 */ ++ int (*itcl_IsObject) _ANSI_ARGS_((Tcl_Command cmd)); /* 4 */ ++ int (*itcl_ObjectIsa) _ANSI_ARGS_((ItclObject * contextObj, ItclClass * cdefn)); /* 5 */ ++ int (*itcl_Protection) _ANSI_ARGS_((Tcl_Interp * interp, int newLevel)); /* 6 */ ++ char* (*itcl_ProtectionStr) _ANSI_ARGS_((int pLevel)); /* 7 */ ++ int (*itcl_CanAccess) _ANSI_ARGS_((ItclMember* memberPtr, Tcl_Namespace* fromNsPtr)); /* 8 */ ++ int (*itcl_CanAccessFunc) _ANSI_ARGS_((ItclMemberFunc* mfunc, Tcl_Namespace* fromNsPtr)); /* 9 */ ++ Tcl_Namespace* (*itcl_GetTrueNamespace) _ANSI_ARGS_((Tcl_Interp * interp, ItclObjectInfo * info)); /* 10 */ ++ void (*itcl_ParseNamespPath) _ANSI_ARGS_((CONST char * name, Tcl_DString * buffer, char ** head, char ** tail)); /* 11 */ ++ int (*itcl_DecodeScopedCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_Namespace ** rNsPtr, char ** rCmdPtr)); /* 12 */ ++ int (*itcl_EvalArgs) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 13 */ ++ Tcl_Obj* (*itcl_CreateArgs) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * string, int objc, Tcl_Obj *CONST objv[])); /* 14 */ ++ int (*itcl_PushContext) _ANSI_ARGS_((Tcl_Interp * interp, ItclMember * member, ItclClass * contextClass, ItclObject * contextObj, ItclContext * contextPtr)); /* 15 */ ++ void (*itcl_PopContext) _ANSI_ARGS_((Tcl_Interp * interp, ItclContext * contextPtr)); /* 16 */ ++ int (*itcl_GetContext) _ANSI_ARGS_((Tcl_Interp * interp, ItclClass ** cdefnPtr, ItclObject ** odefnPtr)); /* 17 */ ++ void (*itcl_InitHierIter) _ANSI_ARGS_((ItclHierIter * iter, ItclClass * cdefn)); /* 18 */ ++ void (*itcl_DeleteHierIter) _ANSI_ARGS_((ItclHierIter * iter)); /* 19 */ ++ ItclClass* (*itcl_AdvanceHierIter) _ANSI_ARGS_((ItclHierIter * iter)); /* 20 */ ++ int (*itcl_FindClassesCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 21 */ ++ int (*itcl_FindObjectsCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 22 */ ++ int (*itcl_ProtectionCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 23 */ ++ int (*itcl_DelClassCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 24 */ ++ int (*itcl_DelObjectCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 25 */ ++ int (*itcl_ScopeCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 26 */ ++ int (*itcl_CodeCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 27 */ ++ int (*itcl_StubCreateCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 28 */ ++ int (*itcl_StubExistsCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 29 */ ++ int (*itcl_IsStub) _ANSI_ARGS_((Tcl_Command cmd)); /* 30 */ ++ int (*itcl_CreateClass) _ANSI_ARGS_((Tcl_Interp* interp, CONST char* path, ItclObjectInfo * info, ItclClass ** rPtr)); /* 31 */ ++ int (*itcl_DeleteClass) _ANSI_ARGS_((Tcl_Interp * interp, ItclClass * cdefnPtr)); /* 32 */ ++ Tcl_Namespace* (*itcl_FindClassNamespace) _ANSI_ARGS_((Tcl_Interp* interp, CONST char* path)); /* 33 */ ++ int (*itcl_HandleClass) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 34 */ ++ int (*itcl_ClassCmdResolver) _ANSI_ARGS_((Tcl_Interp * interp, CONST char* name, Tcl_Namespace * context, int flags, Tcl_Command * rPtr)); /* 35 */ ++ int (*itcl_ClassVarResolver) _ANSI_ARGS_((Tcl_Interp * interp, CONST char* name, Tcl_Namespace * context, int flags, Tcl_Var * rPtr)); /* 36 */ ++ int (*itcl_ClassCompiledVarResolver) _ANSI_ARGS_((Tcl_Interp * interp, CONST char* name, int length, Tcl_Namespace * context, Tcl_ResolvedVarInfo ** rPtr)); /* 37 */ ++ void (*itcl_BuildVirtualTables) _ANSI_ARGS_((ItclClass* cdefnPtr)); /* 38 */ ++ int (*itcl_CreateVarDefn) _ANSI_ARGS_((Tcl_Interp * interp, ItclClass* cdefn, char* name, char* init, char* config, ItclVarDefn** vdefnPtr)); /* 39 */ ++ void (*itcl_DeleteVarDefn) _ANSI_ARGS_((ItclVarDefn * vdefn)); /* 40 */ ++ CONST char* (*itcl_GetCommonVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, ItclClass * contextClass)); /* 41 */ ++ ItclMember* (*itcl_CreateMember) _ANSI_ARGS_((Tcl_Interp* interp, ItclClass * cdefn, CONST char* name)); /* 42 */ ++ void (*itcl_DeleteMember) _ANSI_ARGS_((ItclMember * memPtr)); /* 43 */ ++ int (*itcl_CreateObject) _ANSI_ARGS_((Tcl_Interp * interp, CONST char* name, ItclClass * cdefn, int objc, Tcl_Obj *CONST objv[], ItclObject ** roPtr)); /* 44 */ ++ int (*itcl_DeleteObject) _ANSI_ARGS_((Tcl_Interp * interp, ItclObject * contextObj)); /* 45 */ ++ int (*itcl_DestructObject) _ANSI_ARGS_((Tcl_Interp * interp, ItclObject * contextObj, int flags)); /* 46 */ ++ int (*itcl_HandleInstance) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 47 */ ++ CONST char* (*itcl_GetInstanceVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, ItclObject * contextObj, ItclClass * contextClass)); /* 48 */ ++ int (*itcl_ScopedVarResolver) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_Namespace * contextNs, int flags, Tcl_Var * rPtr)); /* 49 */ ++ int (*itcl_BodyCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 50 */ ++ int (*itcl_ConfigBodyCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 51 */ ++ int (*itcl_CreateMethod) _ANSI_ARGS_((Tcl_Interp* interp, ItclClass * cdefn, CONST char* name, CONST char* arglist, CONST char* body)); /* 52 */ ++ int (*itcl_CreateProc) _ANSI_ARGS_((Tcl_Interp* interp, ItclClass * cdefn, CONST char* name, CONST char* arglist, CONST char* body)); /* 53 */ ++ int (*itcl_CreateMemberFunc) _ANSI_ARGS_((Tcl_Interp* interp, ItclClass * cdefn, CONST char* name, CONST char* arglist, CONST char* body, ItclMemberFunc** mfuncPtr)); /* 54 */ ++ int (*itcl_ChangeMemberFunc) _ANSI_ARGS_((Tcl_Interp* interp, ItclMemberFunc* mfunc, CONST char* arglist, CONST char* body)); /* 55 */ ++ void (*itcl_DeleteMemberFunc) _ANSI_ARGS_((CONST char* cdata)); /* 56 */ ++ int (*itcl_CreateMemberCode) _ANSI_ARGS_((Tcl_Interp* interp, ItclClass * cdefn, CONST char* arglist, CONST char* body, ItclMemberCode** mcodePtr)); /* 57 */ ++ void (*itcl_DeleteMemberCode) _ANSI_ARGS_((char* cdata)); /* 58 */ ++ int (*itcl_GetMemberCode) _ANSI_ARGS_((Tcl_Interp* interp, ItclMember* member)); /* 59 */ ++ void *reserved60; ++ int (*itcl_EvalMemberCode) _ANSI_ARGS_((Tcl_Interp * interp, ItclMemberFunc * mfunc, ItclMember * member, ItclObject * contextObj, int objc, Tcl_Obj *CONST objv[])); /* 61 */ ++ int (*itcl_CreateArgList) _ANSI_ARGS_((Tcl_Interp* interp, CONST char* decl, int* argcPtr, CompiledLocal** argPtr)); /* 62 */ ++ CompiledLocal* (*itcl_CreateArg) _ANSI_ARGS_((CONST char* name, CONST char* init)); /* 63 */ ++ void (*itcl_DeleteArgList) _ANSI_ARGS_((CompiledLocal * arglist)); /* 64 */ ++ Tcl_Obj* (*itcl_ArgList) _ANSI_ARGS_((int argc, CompiledLocal* arglist)); /* 65 */ ++ int (*itcl_EquivArgLists) _ANSI_ARGS_((CompiledLocal* arg1, int arg1c, CompiledLocal* arg2, int arg2c)); /* 66 */ ++ void (*itcl_GetMemberFuncUsage) _ANSI_ARGS_((ItclMemberFunc * mfunc, ItclObject * contextObj, Tcl_Obj * objPtr)); /* 67 */ ++ int (*itcl_ExecMethod) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 68 */ ++ int (*itcl_ExecProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 69 */ ++ int (*itcl_AssignArgs) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], ItclMemberFunc * mfunc)); /* 70 */ ++ int (*itcl_ConstructBase) _ANSI_ARGS_((Tcl_Interp * interp, ItclObject * contextObj, ItclClass * contextClass)); /* 71 */ ++ int (*itcl_InvokeMethodIfExists) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, ItclClass * contextClass, ItclObject * contextObj, int objc, Tcl_Obj *CONST objv[])); /* 72 */ ++ void *reserved73; ++ int (*itcl_ReportFuncErrors) _ANSI_ARGS_((Tcl_Interp* interp, ItclMemberFunc * mfunc, ItclObject * contextObj, int result)); /* 74 */ ++ int (*itcl_ParseInit) _ANSI_ARGS_((Tcl_Interp * interp, ItclObjectInfo * info)); /* 75 */ ++ int (*itcl_ClassCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 76 */ ++ int (*itcl_ClassInheritCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 77 */ ++ int (*itcl_ClassProtectionCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 78 */ ++ int (*itcl_ClassConstructorCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 79 */ ++ int (*itcl_ClassDestructorCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 80 */ ++ int (*itcl_ClassMethodCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 81 */ ++ int (*itcl_ClassProcCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 82 */ ++ int (*itcl_ClassVariableCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 83 */ ++ int (*itcl_ClassCommonCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 84 */ ++ int (*itcl_ParseVarResolver) _ANSI_ARGS_((Tcl_Interp * interp, CONST char* name, Tcl_Namespace * contextNs, int flags, Tcl_Var* rPtr)); /* 85 */ ++ int (*itcl_BiInit) _ANSI_ARGS_((Tcl_Interp * interp)); /* 86 */ ++ int (*itcl_InstallBiMethods) _ANSI_ARGS_((Tcl_Interp * interp, ItclClass * cdefn)); /* 87 */ ++ int (*itcl_BiIsaCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 88 */ ++ int (*itcl_BiConfigureCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 89 */ ++ int (*itcl_BiCgetCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 90 */ ++ int (*itcl_BiChainCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 91 */ ++ int (*itcl_BiInfoClassCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 92 */ ++ int (*itcl_BiInfoInheritCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 93 */ ++ int (*itcl_BiInfoHeritageCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 94 */ ++ int (*itcl_BiInfoFunctionCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 95 */ ++ int (*itcl_BiInfoVariableCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 96 */ ++ int (*itcl_BiInfoBodyCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 97 */ ++ int (*itcl_BiInfoArgsCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 98 */ ++ int (*itcl_DefaultInfoCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 99 */ ++ int (*itcl_EnsembleInit) _ANSI_ARGS_((Tcl_Interp * interp)); /* 100 */ ++ int (*itcl_CreateEnsemble) _ANSI_ARGS_((Tcl_Interp * interp, CONST char* ensName)); /* 101 */ ++ int (*itcl_AddEnsemblePart) _ANSI_ARGS_((Tcl_Interp * interp, CONST char* ensName, CONST char* partName, CONST char* usageInfo, Tcl_ObjCmdProc * objProc, ClientData clientData, Tcl_CmdDeleteProc * deleteProc)); /* 102 */ ++ int (*itcl_GetEnsemblePart) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * ensName, CONST char * partName, Tcl_CmdInfo * infoPtr)); /* 103 */ ++ int (*itcl_IsEnsemble) _ANSI_ARGS_((Tcl_CmdInfo* infoPtr)); /* 104 */ ++ int (*itcl_GetEnsembleUsage) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * ensName, Tcl_Obj * objPtr)); /* 105 */ ++ int (*itcl_GetEnsembleUsageForObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * ensObjPtr, Tcl_Obj * objPtr)); /* 106 */ ++ int (*itcl_EnsembleCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 107 */ ++ int (*itcl_EnsPartCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 108 */ ++ int (*itcl_EnsembleErrorCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 109 */ ++ void *reserved110; ++ void *reserved111; ++ Itcl_CallFrame* (*_Tcl_GetCallFrame) _ANSI_ARGS_((Tcl_Interp * interp, int level)); /* 112 */ ++ Itcl_CallFrame* (*_Tcl_ActivateCallFrame) _ANSI_ARGS_((Tcl_Interp * interp, Itcl_CallFrame * framePtr)); /* 113 */ ++ Var* (*_TclNewVar) _ANSI_ARGS_((void)); /* 114 */ ++ void (*itcl_Assert) _ANSI_ARGS_((CONST char * testExpr, CONST char * fileName, int lineNum)); /* 115 */ ++ int (*itcl_IsObjectCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 116 */ ++ int (*itcl_IsClassCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 117 */ ++} ItclIntStubs; ++ ++TCL_EXTERNC ItclIntStubs *itclIntStubsPtr; ++ ++#if defined(USE_ITCL_STUBS) && !defined(USE_ITCL_STUB_PROCS) ++ ++/* ++ * Inline function declarations: ++ */ ++ ++#ifndef Itcl_IsClassNamespace ++#define Itcl_IsClassNamespace \ ++ (itclIntStubsPtr->itcl_IsClassNamespace) /* 0 */ ++#endif ++#ifndef Itcl_IsClass ++#define Itcl_IsClass \ ++ (itclIntStubsPtr->itcl_IsClass) /* 1 */ ++#endif ++#ifndef Itcl_FindClass ++#define Itcl_FindClass \ ++ (itclIntStubsPtr->itcl_FindClass) /* 2 */ ++#endif ++#ifndef Itcl_FindObject ++#define Itcl_FindObject \ ++ (itclIntStubsPtr->itcl_FindObject) /* 3 */ ++#endif ++#ifndef Itcl_IsObject ++#define Itcl_IsObject \ ++ (itclIntStubsPtr->itcl_IsObject) /* 4 */ ++#endif ++#ifndef Itcl_ObjectIsa ++#define Itcl_ObjectIsa \ ++ (itclIntStubsPtr->itcl_ObjectIsa) /* 5 */ ++#endif ++#ifndef Itcl_Protection ++#define Itcl_Protection \ ++ (itclIntStubsPtr->itcl_Protection) /* 6 */ ++#endif ++#ifndef Itcl_ProtectionStr ++#define Itcl_ProtectionStr \ ++ (itclIntStubsPtr->itcl_ProtectionStr) /* 7 */ ++#endif ++#ifndef Itcl_CanAccess ++#define Itcl_CanAccess \ ++ (itclIntStubsPtr->itcl_CanAccess) /* 8 */ ++#endif ++#ifndef Itcl_CanAccessFunc ++#define Itcl_CanAccessFunc \ ++ (itclIntStubsPtr->itcl_CanAccessFunc) /* 9 */ ++#endif ++#ifndef Itcl_GetTrueNamespace ++#define Itcl_GetTrueNamespace \ ++ (itclIntStubsPtr->itcl_GetTrueNamespace) /* 10 */ ++#endif ++#ifndef Itcl_ParseNamespPath ++#define Itcl_ParseNamespPath \ ++ (itclIntStubsPtr->itcl_ParseNamespPath) /* 11 */ ++#endif ++#ifndef Itcl_DecodeScopedCommand ++#define Itcl_DecodeScopedCommand \ ++ (itclIntStubsPtr->itcl_DecodeScopedCommand) /* 12 */ ++#endif ++#ifndef Itcl_EvalArgs ++#define Itcl_EvalArgs \ ++ (itclIntStubsPtr->itcl_EvalArgs) /* 13 */ ++#endif ++#ifndef Itcl_CreateArgs ++#define Itcl_CreateArgs \ ++ (itclIntStubsPtr->itcl_CreateArgs) /* 14 */ ++#endif ++#ifndef Itcl_PushContext ++#define Itcl_PushContext \ ++ (itclIntStubsPtr->itcl_PushContext) /* 15 */ ++#endif ++#ifndef Itcl_PopContext ++#define Itcl_PopContext \ ++ (itclIntStubsPtr->itcl_PopContext) /* 16 */ ++#endif ++#ifndef Itcl_GetContext ++#define Itcl_GetContext \ ++ (itclIntStubsPtr->itcl_GetContext) /* 17 */ ++#endif ++#ifndef Itcl_InitHierIter ++#define Itcl_InitHierIter \ ++ (itclIntStubsPtr->itcl_InitHierIter) /* 18 */ ++#endif ++#ifndef Itcl_DeleteHierIter ++#define Itcl_DeleteHierIter \ ++ (itclIntStubsPtr->itcl_DeleteHierIter) /* 19 */ ++#endif ++#ifndef Itcl_AdvanceHierIter ++#define Itcl_AdvanceHierIter \ ++ (itclIntStubsPtr->itcl_AdvanceHierIter) /* 20 */ ++#endif ++#ifndef Itcl_FindClassesCmd ++#define Itcl_FindClassesCmd \ ++ (itclIntStubsPtr->itcl_FindClassesCmd) /* 21 */ ++#endif ++#ifndef Itcl_FindObjectsCmd ++#define Itcl_FindObjectsCmd \ ++ (itclIntStubsPtr->itcl_FindObjectsCmd) /* 22 */ ++#endif ++#ifndef Itcl_ProtectionCmd ++#define Itcl_ProtectionCmd \ ++ (itclIntStubsPtr->itcl_ProtectionCmd) /* 23 */ ++#endif ++#ifndef Itcl_DelClassCmd ++#define Itcl_DelClassCmd \ ++ (itclIntStubsPtr->itcl_DelClassCmd) /* 24 */ ++#endif ++#ifndef Itcl_DelObjectCmd ++#define Itcl_DelObjectCmd \ ++ (itclIntStubsPtr->itcl_DelObjectCmd) /* 25 */ ++#endif ++#ifndef Itcl_ScopeCmd ++#define Itcl_ScopeCmd \ ++ (itclIntStubsPtr->itcl_ScopeCmd) /* 26 */ ++#endif ++#ifndef Itcl_CodeCmd ++#define Itcl_CodeCmd \ ++ (itclIntStubsPtr->itcl_CodeCmd) /* 27 */ ++#endif ++#ifndef Itcl_StubCreateCmd ++#define Itcl_StubCreateCmd \ ++ (itclIntStubsPtr->itcl_StubCreateCmd) /* 28 */ ++#endif ++#ifndef Itcl_StubExistsCmd ++#define Itcl_StubExistsCmd \ ++ (itclIntStubsPtr->itcl_StubExistsCmd) /* 29 */ ++#endif ++#ifndef Itcl_IsStub ++#define Itcl_IsStub \ ++ (itclIntStubsPtr->itcl_IsStub) /* 30 */ ++#endif ++#ifndef Itcl_CreateClass ++#define Itcl_CreateClass \ ++ (itclIntStubsPtr->itcl_CreateClass) /* 31 */ ++#endif ++#ifndef Itcl_DeleteClass ++#define Itcl_DeleteClass \ ++ (itclIntStubsPtr->itcl_DeleteClass) /* 32 */ ++#endif ++#ifndef Itcl_FindClassNamespace ++#define Itcl_FindClassNamespace \ ++ (itclIntStubsPtr->itcl_FindClassNamespace) /* 33 */ ++#endif ++#ifndef Itcl_HandleClass ++#define Itcl_HandleClass \ ++ (itclIntStubsPtr->itcl_HandleClass) /* 34 */ ++#endif ++#ifndef Itcl_ClassCmdResolver ++#define Itcl_ClassCmdResolver \ ++ (itclIntStubsPtr->itcl_ClassCmdResolver) /* 35 */ ++#endif ++#ifndef Itcl_ClassVarResolver ++#define Itcl_ClassVarResolver \ ++ (itclIntStubsPtr->itcl_ClassVarResolver) /* 36 */ ++#endif ++#ifndef Itcl_ClassCompiledVarResolver ++#define Itcl_ClassCompiledVarResolver \ ++ (itclIntStubsPtr->itcl_ClassCompiledVarResolver) /* 37 */ ++#endif ++#ifndef Itcl_BuildVirtualTables ++#define Itcl_BuildVirtualTables \ ++ (itclIntStubsPtr->itcl_BuildVirtualTables) /* 38 */ ++#endif ++#ifndef Itcl_CreateVarDefn ++#define Itcl_CreateVarDefn \ ++ (itclIntStubsPtr->itcl_CreateVarDefn) /* 39 */ ++#endif ++#ifndef Itcl_DeleteVarDefn ++#define Itcl_DeleteVarDefn \ ++ (itclIntStubsPtr->itcl_DeleteVarDefn) /* 40 */ ++#endif ++#ifndef Itcl_GetCommonVar ++#define Itcl_GetCommonVar \ ++ (itclIntStubsPtr->itcl_GetCommonVar) /* 41 */ ++#endif ++#ifndef Itcl_CreateMember ++#define Itcl_CreateMember \ ++ (itclIntStubsPtr->itcl_CreateMember) /* 42 */ ++#endif ++#ifndef Itcl_DeleteMember ++#define Itcl_DeleteMember \ ++ (itclIntStubsPtr->itcl_DeleteMember) /* 43 */ ++#endif ++#ifndef Itcl_CreateObject ++#define Itcl_CreateObject \ ++ (itclIntStubsPtr->itcl_CreateObject) /* 44 */ ++#endif ++#ifndef Itcl_DeleteObject ++#define Itcl_DeleteObject \ ++ (itclIntStubsPtr->itcl_DeleteObject) /* 45 */ ++#endif ++#ifndef Itcl_DestructObject ++#define Itcl_DestructObject \ ++ (itclIntStubsPtr->itcl_DestructObject) /* 46 */ ++#endif ++#ifndef Itcl_HandleInstance ++#define Itcl_HandleInstance \ ++ (itclIntStubsPtr->itcl_HandleInstance) /* 47 */ ++#endif ++#ifndef Itcl_GetInstanceVar ++#define Itcl_GetInstanceVar \ ++ (itclIntStubsPtr->itcl_GetInstanceVar) /* 48 */ ++#endif ++#ifndef Itcl_ScopedVarResolver ++#define Itcl_ScopedVarResolver \ ++ (itclIntStubsPtr->itcl_ScopedVarResolver) /* 49 */ ++#endif ++#ifndef Itcl_BodyCmd ++#define Itcl_BodyCmd \ ++ (itclIntStubsPtr->itcl_BodyCmd) /* 50 */ ++#endif ++#ifndef Itcl_ConfigBodyCmd ++#define Itcl_ConfigBodyCmd \ ++ (itclIntStubsPtr->itcl_ConfigBodyCmd) /* 51 */ ++#endif ++#ifndef Itcl_CreateMethod ++#define Itcl_CreateMethod \ ++ (itclIntStubsPtr->itcl_CreateMethod) /* 52 */ ++#endif ++#ifndef Itcl_CreateProc ++#define Itcl_CreateProc \ ++ (itclIntStubsPtr->itcl_CreateProc) /* 53 */ ++#endif ++#ifndef Itcl_CreateMemberFunc ++#define Itcl_CreateMemberFunc \ ++ (itclIntStubsPtr->itcl_CreateMemberFunc) /* 54 */ ++#endif ++#ifndef Itcl_ChangeMemberFunc ++#define Itcl_ChangeMemberFunc \ ++ (itclIntStubsPtr->itcl_ChangeMemberFunc) /* 55 */ ++#endif ++#ifndef Itcl_DeleteMemberFunc ++#define Itcl_DeleteMemberFunc \ ++ (itclIntStubsPtr->itcl_DeleteMemberFunc) /* 56 */ ++#endif ++#ifndef Itcl_CreateMemberCode ++#define Itcl_CreateMemberCode \ ++ (itclIntStubsPtr->itcl_CreateMemberCode) /* 57 */ ++#endif ++#ifndef Itcl_DeleteMemberCode ++#define Itcl_DeleteMemberCode \ ++ (itclIntStubsPtr->itcl_DeleteMemberCode) /* 58 */ ++#endif ++#ifndef Itcl_GetMemberCode ++#define Itcl_GetMemberCode \ ++ (itclIntStubsPtr->itcl_GetMemberCode) /* 59 */ ++#endif ++/* Slot 60 is reserved */ ++#ifndef Itcl_EvalMemberCode ++#define Itcl_EvalMemberCode \ ++ (itclIntStubsPtr->itcl_EvalMemberCode) /* 61 */ ++#endif ++#ifndef Itcl_CreateArgList ++#define Itcl_CreateArgList \ ++ (itclIntStubsPtr->itcl_CreateArgList) /* 62 */ ++#endif ++#ifndef Itcl_CreateArg ++#define Itcl_CreateArg \ ++ (itclIntStubsPtr->itcl_CreateArg) /* 63 */ ++#endif ++#ifndef Itcl_DeleteArgList ++#define Itcl_DeleteArgList \ ++ (itclIntStubsPtr->itcl_DeleteArgList) /* 64 */ ++#endif ++#ifndef Itcl_ArgList ++#define Itcl_ArgList \ ++ (itclIntStubsPtr->itcl_ArgList) /* 65 */ ++#endif ++#ifndef Itcl_EquivArgLists ++#define Itcl_EquivArgLists \ ++ (itclIntStubsPtr->itcl_EquivArgLists) /* 66 */ ++#endif ++#ifndef Itcl_GetMemberFuncUsage ++#define Itcl_GetMemberFuncUsage \ ++ (itclIntStubsPtr->itcl_GetMemberFuncUsage) /* 67 */ ++#endif ++#ifndef Itcl_ExecMethod ++#define Itcl_ExecMethod \ ++ (itclIntStubsPtr->itcl_ExecMethod) /* 68 */ ++#endif ++#ifndef Itcl_ExecProc ++#define Itcl_ExecProc \ ++ (itclIntStubsPtr->itcl_ExecProc) /* 69 */ ++#endif ++#ifndef Itcl_AssignArgs ++#define Itcl_AssignArgs \ ++ (itclIntStubsPtr->itcl_AssignArgs) /* 70 */ ++#endif ++#ifndef Itcl_ConstructBase ++#define Itcl_ConstructBase \ ++ (itclIntStubsPtr->itcl_ConstructBase) /* 71 */ ++#endif ++#ifndef Itcl_InvokeMethodIfExists ++#define Itcl_InvokeMethodIfExists \ ++ (itclIntStubsPtr->itcl_InvokeMethodIfExists) /* 72 */ ++#endif ++/* Slot 73 is reserved */ ++#ifndef Itcl_ReportFuncErrors ++#define Itcl_ReportFuncErrors \ ++ (itclIntStubsPtr->itcl_ReportFuncErrors) /* 74 */ ++#endif ++#ifndef Itcl_ParseInit ++#define Itcl_ParseInit \ ++ (itclIntStubsPtr->itcl_ParseInit) /* 75 */ ++#endif ++#ifndef Itcl_ClassCmd ++#define Itcl_ClassCmd \ ++ (itclIntStubsPtr->itcl_ClassCmd) /* 76 */ ++#endif ++#ifndef Itcl_ClassInheritCmd ++#define Itcl_ClassInheritCmd \ ++ (itclIntStubsPtr->itcl_ClassInheritCmd) /* 77 */ ++#endif ++#ifndef Itcl_ClassProtectionCmd ++#define Itcl_ClassProtectionCmd \ ++ (itclIntStubsPtr->itcl_ClassProtectionCmd) /* 78 */ ++#endif ++#ifndef Itcl_ClassConstructorCmd ++#define Itcl_ClassConstructorCmd \ ++ (itclIntStubsPtr->itcl_ClassConstructorCmd) /* 79 */ ++#endif ++#ifndef Itcl_ClassDestructorCmd ++#define Itcl_ClassDestructorCmd \ ++ (itclIntStubsPtr->itcl_ClassDestructorCmd) /* 80 */ ++#endif ++#ifndef Itcl_ClassMethodCmd ++#define Itcl_ClassMethodCmd \ ++ (itclIntStubsPtr->itcl_ClassMethodCmd) /* 81 */ ++#endif ++#ifndef Itcl_ClassProcCmd ++#define Itcl_ClassProcCmd \ ++ (itclIntStubsPtr->itcl_ClassProcCmd) /* 82 */ ++#endif ++#ifndef Itcl_ClassVariableCmd ++#define Itcl_ClassVariableCmd \ ++ (itclIntStubsPtr->itcl_ClassVariableCmd) /* 83 */ ++#endif ++#ifndef Itcl_ClassCommonCmd ++#define Itcl_ClassCommonCmd \ ++ (itclIntStubsPtr->itcl_ClassCommonCmd) /* 84 */ ++#endif ++#ifndef Itcl_ParseVarResolver ++#define Itcl_ParseVarResolver \ ++ (itclIntStubsPtr->itcl_ParseVarResolver) /* 85 */ ++#endif ++#ifndef Itcl_BiInit ++#define Itcl_BiInit \ ++ (itclIntStubsPtr->itcl_BiInit) /* 86 */ ++#endif ++#ifndef Itcl_InstallBiMethods ++#define Itcl_InstallBiMethods \ ++ (itclIntStubsPtr->itcl_InstallBiMethods) /* 87 */ ++#endif ++#ifndef Itcl_BiIsaCmd ++#define Itcl_BiIsaCmd \ ++ (itclIntStubsPtr->itcl_BiIsaCmd) /* 88 */ ++#endif ++#ifndef Itcl_BiConfigureCmd ++#define Itcl_BiConfigureCmd \ ++ (itclIntStubsPtr->itcl_BiConfigureCmd) /* 89 */ ++#endif ++#ifndef Itcl_BiCgetCmd ++#define Itcl_BiCgetCmd \ ++ (itclIntStubsPtr->itcl_BiCgetCmd) /* 90 */ ++#endif ++#ifndef Itcl_BiChainCmd ++#define Itcl_BiChainCmd \ ++ (itclIntStubsPtr->itcl_BiChainCmd) /* 91 */ ++#endif ++#ifndef Itcl_BiInfoClassCmd ++#define Itcl_BiInfoClassCmd \ ++ (itclIntStubsPtr->itcl_BiInfoClassCmd) /* 92 */ ++#endif ++#ifndef Itcl_BiInfoInheritCmd ++#define Itcl_BiInfoInheritCmd \ ++ (itclIntStubsPtr->itcl_BiInfoInheritCmd) /* 93 */ ++#endif ++#ifndef Itcl_BiInfoHeritageCmd ++#define Itcl_BiInfoHeritageCmd \ ++ (itclIntStubsPtr->itcl_BiInfoHeritageCmd) /* 94 */ ++#endif ++#ifndef Itcl_BiInfoFunctionCmd ++#define Itcl_BiInfoFunctionCmd \ ++ (itclIntStubsPtr->itcl_BiInfoFunctionCmd) /* 95 */ ++#endif ++#ifndef Itcl_BiInfoVariableCmd ++#define Itcl_BiInfoVariableCmd \ ++ (itclIntStubsPtr->itcl_BiInfoVariableCmd) /* 96 */ ++#endif ++#ifndef Itcl_BiInfoBodyCmd ++#define Itcl_BiInfoBodyCmd \ ++ (itclIntStubsPtr->itcl_BiInfoBodyCmd) /* 97 */ ++#endif ++#ifndef Itcl_BiInfoArgsCmd ++#define Itcl_BiInfoArgsCmd \ ++ (itclIntStubsPtr->itcl_BiInfoArgsCmd) /* 98 */ ++#endif ++#ifndef Itcl_DefaultInfoCmd ++#define Itcl_DefaultInfoCmd \ ++ (itclIntStubsPtr->itcl_DefaultInfoCmd) /* 99 */ ++#endif ++#ifndef Itcl_EnsembleInit ++#define Itcl_EnsembleInit \ ++ (itclIntStubsPtr->itcl_EnsembleInit) /* 100 */ ++#endif ++#ifndef Itcl_CreateEnsemble ++#define Itcl_CreateEnsemble \ ++ (itclIntStubsPtr->itcl_CreateEnsemble) /* 101 */ ++#endif ++#ifndef Itcl_AddEnsemblePart ++#define Itcl_AddEnsemblePart \ ++ (itclIntStubsPtr->itcl_AddEnsemblePart) /* 102 */ ++#endif ++#ifndef Itcl_GetEnsemblePart ++#define Itcl_GetEnsemblePart \ ++ (itclIntStubsPtr->itcl_GetEnsemblePart) /* 103 */ ++#endif ++#ifndef Itcl_IsEnsemble ++#define Itcl_IsEnsemble \ ++ (itclIntStubsPtr->itcl_IsEnsemble) /* 104 */ ++#endif ++#ifndef Itcl_GetEnsembleUsage ++#define Itcl_GetEnsembleUsage \ ++ (itclIntStubsPtr->itcl_GetEnsembleUsage) /* 105 */ ++#endif ++#ifndef Itcl_GetEnsembleUsageForObj ++#define Itcl_GetEnsembleUsageForObj \ ++ (itclIntStubsPtr->itcl_GetEnsembleUsageForObj) /* 106 */ ++#endif ++#ifndef Itcl_EnsembleCmd ++#define Itcl_EnsembleCmd \ ++ (itclIntStubsPtr->itcl_EnsembleCmd) /* 107 */ ++#endif ++#ifndef Itcl_EnsPartCmd ++#define Itcl_EnsPartCmd \ ++ (itclIntStubsPtr->itcl_EnsPartCmd) /* 108 */ ++#endif ++#ifndef Itcl_EnsembleErrorCmd ++#define Itcl_EnsembleErrorCmd \ ++ (itclIntStubsPtr->itcl_EnsembleErrorCmd) /* 109 */ ++#endif ++/* Slot 110 is reserved */ ++/* Slot 111 is reserved */ ++#ifndef _Tcl_GetCallFrame ++#define _Tcl_GetCallFrame \ ++ (itclIntStubsPtr->_Tcl_GetCallFrame) /* 112 */ ++#endif ++#ifndef _Tcl_ActivateCallFrame ++#define _Tcl_ActivateCallFrame \ ++ (itclIntStubsPtr->_Tcl_ActivateCallFrame) /* 113 */ ++#endif ++#ifndef _TclNewVar ++#define _TclNewVar \ ++ (itclIntStubsPtr->_TclNewVar) /* 114 */ ++#endif ++#ifndef Itcl_Assert ++#define Itcl_Assert \ ++ (itclIntStubsPtr->itcl_Assert) /* 115 */ ++#endif ++#ifndef Itcl_IsObjectCmd ++#define Itcl_IsObjectCmd \ ++ (itclIntStubsPtr->itcl_IsObjectCmd) /* 116 */ ++#endif ++#ifndef Itcl_IsClassCmd ++#define Itcl_IsClassCmd \ ++ (itclIntStubsPtr->itcl_IsClassCmd) /* 117 */ ++#endif ++ ++#endif /* defined(USE_ITCL_STUBS) && !defined(USE_ITCL_STUB_PROCS) */ ++ ++/* !END!: Do not edit above this line. */ ++ ++#endif /* _ITCLINTDECLS */ +diff -Naur itk/generic/itcl3/itclInt.h ITK_BLD/generic/itcl3/itclInt.h +--- itk/generic/itcl3/itclInt.h 1969-12-31 19:00:00.000000000 -0500 ++++ ITK_BLD/generic/itcl3/itclInt.h 2024-07-10 10:40:21.279659891 -0400 +@@ -0,0 +1,468 @@ ++/* ++ * ------------------------------------------------------------------------ ++ * PACKAGE: [incr Tcl] ++ * DESCRIPTION: Object-Oriented Extensions to Tcl ++ * ++ * [incr Tcl] provides object-oriented extensions to Tcl, much as ++ * C++ provides object-oriented extensions to C. It provides a means ++ * of encapsulating related procedures together with their shared data ++ * in a local namespace that is hidden from the outside world. It ++ * promotes code re-use through inheritance. More than anything else, ++ * it encourages better organization of Tcl applications through the ++ * object-oriented paradigm, leading to code that is easier to ++ * understand and maintain. ++ * ++ * ADDING [incr Tcl] TO A Tcl-BASED APPLICATION: ++ * ++ * To add [incr Tcl] facilities to a Tcl application, modify the ++ * Tcl_AppInit() routine as follows: ++ * ++ * 1) Include this header file near the top of the file containing ++ * Tcl_AppInit(): ++ * ++ * #include "itcl.h" ++ * ++ * 2) Within the body of Tcl_AppInit(), add the following lines: ++ * ++ * if (Itcl_Init(interp) == TCL_ERROR) { ++ * return TCL_ERROR; ++ * } ++ * ++ * 3) Link your application with libitcl.a ++ * ++ * NOTE: An example file "tclAppInit.c" containing the changes shown ++ * above is included in this distribution. ++ * ++ * ======================================================================== ++ * AUTHOR: Michael J. McLennan ++ * Bell Labs Innovations for Lucent Technologies ++ * mmclennan@lucent.com ++ * http://www.tcltk.com/itcl ++ * ======================================================================== ++ * Copyright (c) 1993-1998 Lucent Technologies, Inc. ++ * ------------------------------------------------------------------------ ++ * See the file "license.terms" for information on usage and redistribution ++ * of this file, and for a DISCLAIMER OF ALL WARRANTIES. ++ */ ++#ifndef ITCLINT_H ++#define ITCLINT_H ++ ++#include "tclInt.h" ++#include "itcl.h" ++ ++#ifdef BUILD_itcl ++# undef TCL_STORAGE_CLASS ++# define TCL_STORAGE_CLASS DLLEXPORT ++#endif ++ ++/* ++ * Handle hiding of errorLine in 8.6 ++ */ ++#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6) ++#define Tcl_GetErrorLine(interp) ((interp)->errorLine) ++#endif ++ ++#define ITCL_TCL_PRE_8_5 (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 5) ++ ++#define ItclCallFrame CallFrame ++ ++#if !ITCL_TCL_PRE_8_5 ++ ++#define Itcl_CallFrame Tcl_CallFrame ++ ++#if defined(USE_TCL_STUBS) ++ ++/* ++ * Fix Tcl bug #803489 the right way. We need to always use the old Stub ++ * slot positions, not the new broken ones part of TIP 127. I do like ++ * that these functions have moved to the public space (about time), but ++ * the slot change is the killer and is the painful side affect. ++ */ ++ ++# undef Tcl_CreateNamespace ++# define Tcl_CreateNamespace \ ++ (tclIntStubsPtr->tcl_CreateNamespace) ++# undef Tcl_DeleteNamespace ++# define Tcl_DeleteNamespace \ ++ (tclIntStubsPtr->tcl_DeleteNamespace) ++# undef Tcl_AppendExportList ++# define Tcl_AppendExportList \ ++ (tclIntStubsPtr->tcl_AppendExportList) ++# undef Tcl_Export ++# define Tcl_Export \ ++ (tclIntStubsPtr->tcl_Export) ++# undef Tcl_Import ++# define Tcl_Import \ ++ (tclIntStubsPtr->tcl_Import) ++# undef Tcl_ForgetImport ++# define Tcl_ForgetImport \ ++ (tclIntStubsPtr->tcl_ForgetImport) ++# undef Tcl_GetCurrentNamespace ++# define Tcl_GetCurrentNamespace \ ++ (tclIntStubsPtr->tcl_GetCurrentNamespace) ++# undef Tcl_GetGlobalNamespace ++# define Tcl_GetGlobalNamespace \ ++ (tclIntStubsPtr->tcl_GetGlobalNamespace) ++# undef Tcl_FindNamespace ++# define Tcl_FindNamespace \ ++ (tclIntStubsPtr->tcl_FindNamespace) ++# undef Tcl_FindCommand ++# define Tcl_FindCommand \ ++ (tclIntStubsPtr->tcl_FindCommand) ++# undef Tcl_GetCommandFromObj ++# define Tcl_GetCommandFromObj \ ++ (tclIntStubsPtr->tcl_GetCommandFromObj) ++# undef Tcl_GetCommandFullName ++# define Tcl_GetCommandFullName \ ++ (tclIntStubsPtr->tcl_GetCommandFullName) ++#endif /* use stubs */ ++ ++#define ItclInitVarFlags(varPtr) \ ++ (varPtr)->flags = 0 ++ ++#define ItclInitVarArgument(varPtr) \ ++ (varPtr)->flags = VAR_ARGUMENT ++ ++#define ItclVarHashCreateVar(tablePtr, key, newPtr) \ ++ TclVarHashCreateVar((tablePtr), (key), (newPtr)) ++ ++#define ItclVarRefCount(varPtr) VarHashRefCount(varPtr) ++ ++#define ItclClearVarUndefined(varPtr) ++ ++#define ItclNextLocal(varPtr) ((varPtr)++) ++ ++#define ItclVarObjValue(varPtr) ((varPtr)->value.objPtr) ++ ++#define itclVarInHashSize sizeof(VarInHash) ++#define itclVarLocalSize sizeof(Var) ++ ++#else /* Compiling on Tcl8.x, x<5 */ ++ ++typedef struct Itcl_CallFrame { ++ Tcl_Namespace *nsPtr; ++ int dummy1; ++ int dummy2; ++ void *dummy3; ++ void *dummy4; ++ void *dummy5; ++ int dummy6; ++ void *dummy7; ++ void *dummy8; ++ int dummy9; ++ void *dummy10; ++ void *dummy11; ++ void *dummy12; ++ void *dummy13; ++} Itcl_CallFrame; ++ ++/* ++ * Definition of runtime behaviour to be able to run irrespective of the Tcl ++ * version. ++ */ ++ ++#define VarInHash Var ++ ++#define TclVarHashTable Tcl_HashTable ++ ++typedef struct ItclShortVar { ++ int flags; ++ union { ++ Tcl_Obj *objPtr; ++ TclVarHashTable *tablePtr; ++ struct Var *linkPtr; ++ } value; ++} ItclShortVar; ++ ++typedef struct ItclVarInHash { ++ ItclShortVar var; ++ int refCount; ++ Tcl_HashEntry entry; ++} ItclVarInHash; ++ ++#define ItclOffset(type, field) ((int) ((char *) &((type *) 0)->field)) ++ ++#define itclOldRuntime (itclVarFlagOffset!=0) ++ ++extern int itclVarFlagOffset; ++extern int itclVarRefCountOffset; ++extern int itclVarInHashSize; ++extern int itclVarLocalSize; ++extern int itclVarValueOffset; ++ ++/* ++ * VarReform related macros: provide access to the Var fields with offsets ++ * determined at load time, so that the same code copes with the different ++ * structs in Tcl8.5 and previous Tcl. ++ */ ++ ++#define ItclNextLocal(varPtr) \ ++ ((varPtr) = (Var *) (((char *)(varPtr))+itclVarLocalSize)) ++ ++#define ItclVarObjValue(varPtr) \ ++ (*((Tcl_Obj **) (((char *)(varPtr))+itclVarValueOffset))) ++ ++#define ItclVarRefCount(varPtr) \ ++ (*((int *) (((char *)(varPtr))+itclVarRefCountOffset))) ++ ++#define ItclVarFlags(varPtr) \ ++ (*((int *)(((char *)(varPtr))+itclVarFlagOffset))) ++ ++/* Note that itclVarFlagOffset==0 exactly when we are running in Tcl8.5 */ ++#define ItclInitVarFlags(varPtr) \ ++ if (itclOldRuntime) { \ ++ (varPtr)->flags = (VAR_SCALAR | VAR_UNDEFINED | VAR_IN_HASHTABLE);\ ++ } else { \ ++ ((ItclShortVar *)(varPtr))->flags = 0;\ ++ } ++ ++/* This is used for CompiledLocal, not for Var & Co. That struct did not ++ * change, but the correct flag init did! The flags bits themselves are ++ * unchanged */ ++ ++#define ItclInitVarArgument(varPtr) \ ++ if (itclOldRuntime) { \ ++ (varPtr)->flags = (VAR_SCALAR | VAR_ARGUMENT);\ ++ } else { \ ++ (varPtr)->flags = VAR_ARGUMENT;\ ++ } ++ ++#define TclIsVarNamespaceVar(varPtr) \ ++ (ItclVarFlags(varPtr) & VAR_NAMESPACE_VAR) ++ ++#define TclSetVarNamespaceVar(varPtr) \ ++ if (!TclIsVarNamespaceVar(varPtr)) {\ ++ ItclVarFlags(varPtr) |= VAR_NAMESPACE_VAR;\ ++ ItclVarRefCount(varPtr)++;\ ++ } ++ ++#define ItclClearVarUndefined(varPtr) \ ++ if (itclOldRuntime) { \ ++ ItclVarFlags(varPtr) &= ~VAR_UNDEFINED;\ ++ } ++ ++#ifndef MODULE_SCOPE ++#define MODULE_SCOPE ++#endif ++ ++MODULE_SCOPE Var * ItclVarHashCreateVar (TclVarHashTable * tablePtr, ++ const char * key, int * newPtr); ++ ++#endif /* Version dependent defs and macros */ ++ ++ ++#define ItclVarHashFindVar(tablePtr, key) \ ++ ItclVarHashCreateVar((tablePtr), (key), NULL) ++ ++ ++/* ++ * Common info for managing all known objects. ++ * Each interpreter has one of these data structures stored as ++ * clientData in the "itcl" namespace. It is also accessible ++ * as associated data via the key ITCL_INTERP_DATA. ++ */ ++struct ItclObject; ++typedef struct ItclObjectInfo { ++ Tcl_Interp *interp; /* interpreter that manages this info */ ++ Tcl_HashTable objects; /* list of all known objects */ ++ ++ Itcl_Stack transparentFrames; /* stack of call frames that should be ++ * treated transparently. When ++ * Itcl_EvalMemberCode is invoked in ++ * one of these contexts, it does an ++ * "uplevel" to get past the transparent ++ * frame and back to the calling context. */ ++ Tcl_HashTable contextFrames; /* object contexts for active call frames */ ++ ++ int protection; /* protection level currently in effect */ ++ ++ Itcl_Stack cdefnStack; /* stack of class definitions currently ++ * being parsed */ ++} ItclObjectInfo; ++ ++#define ITCL_INTERP_DATA "itcl_data" ++ ++/* ++ * Representation for each [incr Tcl] class. ++ */ ++typedef struct ItclClass { ++ char *name; /* class name */ ++ char *fullname; /* fully qualified class name */ ++ Tcl_Interp *interp; /* interpreter that manages this info */ ++ Tcl_Namespace *namesp; /* namespace representing class scope */ ++ Tcl_Command accessCmd; /* access command for creating instances */ ++ ++ struct ItclObjectInfo *info; /* info about all known objects */ ++ Itcl_List bases; /* list of base classes */ ++ Itcl_List derived; /* list of all derived classes */ ++ Tcl_HashTable heritage; /* table of all base classes. Look up ++ * by pointer to class definition. This ++ * provides fast lookup for inheritance ++ * tests. */ ++ Tcl_Obj *initCode; /* initialization code for new objs */ ++ Tcl_HashTable variables; /* definitions for all data members ++ in this class. Look up simple string ++ names and get back ItclVarDefn* ptrs */ ++ Tcl_HashTable functions; /* definitions for all member functions ++ in this class. Look up simple string ++ names and get back ItclMemberFunc* ptrs */ ++ int numInstanceVars; /* number of instance vars in variables ++ table */ ++ Tcl_HashTable resolveVars; /* all possible names for variables in ++ * this class (e.g., x, foo::x, etc.) */ ++ Tcl_HashTable resolveCmds; /* all possible names for functions in ++ * this class (e.g., x, foo::x, etc.) */ ++ int unique; /* unique number for #auto generation */ ++ int flags; /* maintains class status */ ++} ItclClass; ++ ++typedef struct ItclHierIter { ++ ItclClass *current; /* current position in hierarchy */ ++ Itcl_Stack stack; /* stack used for traversal */ ++} ItclHierIter; ++ ++/* ++ * Representation for each [incr Tcl] object. ++ */ ++typedef struct ItclObject { ++ ItclClass *classDefn; /* most-specific class */ ++ Tcl_Command accessCmd; /* object access command */ ++ ++ int dataSize; /* number of elements in data array */ ++ Var** data; /* all object-specific data members */ ++ Tcl_HashTable* constructed; /* temp storage used during construction */ ++ Tcl_HashTable* destructed; /* temp storage used during destruction */ ++} ItclObject; ++ ++#define ITCL_IGNORE_ERRS 0x002 /* useful for construction/destruction */ ++ ++/* ++ * Implementation for any code body in an [incr Tcl] class. ++ */ ++typedef struct ItclMemberCode { ++ int flags; /* flags describing implementation */ ++ CompiledLocal *arglist; /* list of arg names and initial values */ ++ int argcount; /* number of args in arglist */ ++ Proc *procPtr; /* Tcl proc representation (needed to ++ * handle compiled locals) */ ++ union { ++ Tcl_CmdProc *argCmd; /* (argc,argv) C implementation */ ++ Tcl_ObjCmdProc *objCmd; /* (objc,objv) C implementation */ ++ } cfunc; ++ ++ ClientData clientData; /* client data for C implementations */ ++ ++} ItclMemberCode; ++ ++#define Itcl_IsMemberCodeImplemented(mcode) \ ++ (((mcode)->flags & ITCL_IMPLEMENT_NONE) == 0) ++ ++/* ++ * Basic representation for class members (commands/variables) ++ */ ++typedef struct ItclMember { ++ Tcl_Interp* interp; /* interpreter containing the class */ ++ ItclClass* classDefn; /* class containing this member */ ++ char* name; /* member name */ ++ char* fullname; /* member name with "class::" qualifier */ ++ int protection; /* protection level */ ++ int flags; /* flags describing member (see below) */ ++ ItclMemberCode *code; /* code associated with member */ ++} ItclMember; ++ ++/* ++ * Flag bits for ItclMemberCode and ItclMember: ++ */ ++#define ITCL_IMPLEMENT_NONE 0x001 /* no implementation */ ++#define ITCL_IMPLEMENT_TCL 0x002 /* Tcl implementation */ ++#define ITCL_IMPLEMENT_ARGCMD 0x004 /* (argc,argv) C implementation */ ++#define ITCL_IMPLEMENT_OBJCMD 0x008 /* (objc,objv) C implementation */ ++#define ITCL_IMPLEMENT_C 0x00c /* either kind of C implementation */ ++#define ITCL_CONSTRUCTOR 0x010 /* non-zero => is a constructor */ ++#define ITCL_DESTRUCTOR 0x020 /* non-zero => is a destructor */ ++#define ITCL_COMMON 0x040 /* non-zero => is a "proc" */ ++#define ITCL_ARG_SPEC 0x080 /* non-zero => has an argument spec */ ++ ++#define ITCL_OLD_STYLE 0x100 /* non-zero => old-style method ++ * (process "config" argument) */ ++ ++#define ITCL_THIS_VAR 0x200 /* non-zero => built-in "this" variable */ ++ ++/* ++ * Representation of member functions in an [incr Tcl] class. ++ */ ++typedef struct ItclMemberFunc { ++ ItclMember *member; /* basic member info */ ++ Tcl_Command accessCmd; /* Tcl command installed for this function */ ++ CompiledLocal *arglist; /* list of arg names and initial values */ ++ int argcount; /* number of args in arglist */ ++} ItclMemberFunc; ++ ++/* ++ * Instance variables. ++ */ ++typedef struct ItclVarDefn { ++ ItclMember *member; /* basic member info */ ++ char* init; /* initial value */ ++} ItclVarDefn; ++ ++/* ++ * Instance variable lookup entry. ++ */ ++typedef struct ItclVarLookup { ++ ItclVarDefn* vdefn; /* variable definition */ ++ int usage; /* number of uses for this record */ ++ int accessible; /* non-zero => accessible from class with ++ * this lookup record in its resolveVars */ ++ char *leastQualName; /* simplist name for this variable, with ++ * the fewest qualifiers. This string is ++ * taken from the resolveVars table, so ++ * it shouldn't be freed. */ ++ union { ++ int index; /* index into virtual table (instance data) */ ++ Tcl_Var common; /* variable (common data) */ ++ } var; ++} ItclVarLookup; ++ ++/* ++ * Representation for the context in which a body of [incr Tcl] ++ * code executes. In ordinary Tcl, this is a CallFrame. But for ++ * [incr Tcl] code bodies, we must be careful to set up the ++ * CallFrame properly, to plug in instance variables before ++ * executing the code body. ++ */ ++typedef struct ItclContext { ++ ItclClass *classDefn; /* class definition */ ++ Itcl_CallFrame frame; /* call frame for object context */ ++ Var *compiledLocals; /* points to storage for compiled locals */ ++ Var localStorage[20]; /* default storage for compiled locals */ ++} ItclContext; ++ ++/* ++ * Compatibility flags. Used to support small "hacks". These are stored ++ * in the global variable named itclCompatFlags. ++ */ ++ ++extern int itclCompatFlags; ++ ++#define ITCL_COMPAT_USE_ISTATE_API 0x2 /* Tcl 8.5a2 added interp state APIs */ ++ ++#include "itclIntDecls.h" ++ ++/* ++ * Since the Tcl/Tk distribution doesn't perform any asserts, ++ * dynamic loading can fail to find the __assert function. ++ * As a workaround, we'll include our own. ++ */ ++ ++#undef assert ++#ifndef DEBUG ++#define assert(EX) ((void)0) ++#else ++#define assert(EX) (void)((EX) || (Itcl_Assert(STRINGIFY(EX), __FILE__, __LINE__), 0)) ++#endif /* DEBUG */ ++ ++#undef TCL_STORAGE_CLASS ++#define TCL_STORAGE_CLASS DLLIMPORT ++ ++#endif /* ITCLINT_H */ diff -Naur itk/generic/itk_cmds.c ITK_BLD/generic/itk_cmds.c ---- itk/generic/itk_cmds.c 2024-02-16 19:10:50.507073124 -0500 -+++ ITK_BLD/generic/itk_cmds.c 2024-02-16 19:10:33.623363134 -0500 +--- itk/generic/itk_cmds.c 2024-07-10 10:44:13.330651607 -0400 ++++ ITK_BLD/generic/itk_cmds.c 2024-07-10 10:32:07.734264686 -0400 @@ -111,8 +111,7 @@ * ------------------------------------------------------------------------ */ @@ -951,8 +3375,8 @@ diff -Naur itk/generic/itk_cmds.c ITK_BLD/generic/itk_cmds.c int result = TCL_OK; diff -Naur itk/win/rc/itk.rc ITK_BLD/win/rc/itk.rc ---- itk/win/rc/itk.rc 2024-02-16 19:10:50.507073124 -0500 -+++ ITK_BLD/win/rc/itk.rc 2024-02-16 19:10:33.623363134 -0500 +--- itk/win/rc/itk.rc 2024-07-10 10:44:13.334651538 -0400 ++++ ITK_BLD/win/rc/itk.rc 2024-07-10 10:32:07.734264686 -0400 @@ -1,59 +1,59 @@ -// -// Version resource script. From 561eab15a7d3c8d91bbb74dab17fee4e50b153d4 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:48:37 -0400 Subject: [PATCH 68/71] Hmm. Simplify to try and get the tmate session to trigger --- .github/workflows/linux_interactive.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/linux_interactive.yml b/.github/workflows/linux_interactive.yml index 76fd6e78..c145db55 100644 --- a/.github/workflows/linux_interactive.yml +++ b/.github/workflows/linux_interactive.yml @@ -14,14 +14,7 @@ name: BRL-CAD Linux Interactive Debugging -on: - workflow_dispatch: - inputs: - debug_enabled: - type: boolean - description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' - required: false - default: false +on: [workflow_dispatch] jobs: @@ -58,14 +51,6 @@ jobs: export PATH=$ENV{GITHUB_WORKSPACE}:$PATH cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Debug - - name: Build - run: | - export PATH=$ENV{GITHUB_WORKSPACE}:$PATH - cd build && ninja -j2 -v - - name: Debugging - tmate session - if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} uses: mxschmitt/action-tmate@v3 - with: - limit-access-to-actor: true From c0435ce1f4ae7642ca357f5842c810a624189f42 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Wed, 10 Jul 2024 11:19:40 -0400 Subject: [PATCH 69/71] Put local itcl3 dir first --- itk/itk.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/itk/itk.patch b/itk/itk.patch index e97c7e66..6c50f979 100644 --- a/itk/itk.patch +++ b/itk/itk.patch @@ -622,7 +622,7 @@ diff -Naur itk/CMake/FindTCL.cmake ITK_BLD/CMake/FindTCL.cmake +# ex: shiftwidth=2 tabstop=8 diff -Naur itk/CMakeLists.txt ITK_BLD/CMakeLists.txt --- itk/CMakeLists.txt 1969-12-31 19:00:00.000000000 -0500 -+++ ITK_BLD/CMakeLists.txt 2024-07-10 10:41:52.225087088 -0400 ++++ ITK_BLD/CMakeLists.txt 2024-07-10 11:14:36.054324121 -0400 @@ -0,0 +1,280 @@ +# C M A K E L I S T S . T X T +# ITK @@ -843,14 +843,14 @@ diff -Naur itk/CMakeLists.txt ITK_BLD/CMakeLists.txt +endif (NOT TCL_PRIVATE_HDRS) + +include_directories( ++ # Itcl3 is iffy as a system install - just reference the local copy ++ ${CMAKE_SOURCE_DIR}/generic/itcl3 + ${TCL_INCLUDE_PATH} + ${TK_INCLUDE_PATH} + ${ITCL_INCLUDE_PATH} + ${ITK_INCLUDE_DIRS} + ${X11_INCLUDE_DIR} + ${TCL_PRIVATE_HDRS} -+ # Itcl3 is iffy as a system install - just reference the local copy -+ ${CMAKE_SOURCE_DIR}/generic/itcl3 + ) + +add_library(itk${ITK_VERSION} SHARED ${ITK_SRCS}) From a7c15d14df5eae24e18f8d779db5cae3984227ba Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Wed, 10 Jul 2024 14:51:26 -0400 Subject: [PATCH 70/71] Back up Manifold to last successful CI build version See https://stackoverflow.com/a/8813266/2037687 for how this is done. Upstream has been notified of a problem when building with Debug config on Windows, so until then stick with the older version. --- manifold/CMakeLists.txt | 2 +- manifold/manifold | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifold/CMakeLists.txt b/manifold/CMakeLists.txt index b1012a7e..9dae1d01 100644 --- a/manifold/CMakeLists.txt +++ b/manifold/CMakeLists.txt @@ -14,7 +14,7 @@ if (ENABLE_MANIFOLD) ExternalProject_Add(MANIFOLD_BLD URL "${CMAKE_CURRENT_SOURCE_DIR}/manifold" BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS} - PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/manifold.patch + #PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/manifold.patch CMAKE_ARGS ${BUILD_TYPE_SPECIFIER} $<$:-DZ_PREFIX=ON> diff --git a/manifold/manifold b/manifold/manifold index ce5d758f..edb4b25f 160000 --- a/manifold/manifold +++ b/manifold/manifold @@ -1 +1 @@ -Subproject commit ce5d758f325a2de4f5ba5fbdfb64efd722cfc4aa +Subproject commit edb4b25f647e23312d823c8bd6eb662ce9b1c9a8 From 675de3d66e08035a3f616af2f7fced7f2392a154 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:40:08 -0400 Subject: [PATCH 71/71] Remove --single-branch to support older Git versions --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ec083e0..a76336ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -292,7 +292,7 @@ function(git_submodule_init path checkfile) ) else (NOT GIT_SHALLOW_CLONE) execute_process( - COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive --recommend-shallow --single-branch ${path} + COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive --recommend-shallow ${path} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) endif (NOT GIT_SHALLOW_CLONE)