diff --git a/CMakeLists.txt b/CMakeLists.txt index 307b9ee5..63bb9a38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,7 @@ include(cmake/geogram.cmake) set(VORPALINE_VERSION_MAJOR 1) set(VORPALINE_VERSION_MINOR 6) -set(VORPALINE_VERSION_PATCH 5) +set(VORPALINE_VERSION_PATCH 6) set(VORPALINE_VERSION ${VORPALINE_VERSION_MAJOR}.${VORPALINE_VERSION_MINOR}.${VORPALINE_VERSION_PATCH}) set(VORPALINE_INCLUDE_SUBPATH geogram${VORPALINE_VERSION_MAJOR}) diff --git a/CMakeOptions.txt b/CMakeOptions.txt new file mode 100644 index 00000000..a44f87ee --- /dev/null +++ b/CMakeOptions.txt @@ -0,0 +1 @@ +set(CPACK_GENERATOR RPM) diff --git a/cmake/platforms/Android-aarch64-gcc.cmake b/cmake/platforms/Android-aarch64-gcc.cmake index 66a0e14d..d663e17b 100755 --- a/cmake/platforms/Android-aarch64-gcc.cmake +++ b/cmake/platforms/Android-aarch64-gcc.cmake @@ -5,8 +5,8 @@ include(${GEOGRAM_SOURCE_DIR}/cmake/platforms/Linux.cmake) # Set the Android compilers -set(CMAKE_CXX_COMPILER aarch64-linux-android-g++) -set(CMAKE_C_COMPILER aarch64-linux-android-gcc) +set(CMAKE_CXX_COMPILER aarch64-linux-android-clang++) +set(CMAKE_C_COMPILER aarch64-linux-android-clang) set(VORPALINE_ARCH_64 true) @@ -31,15 +31,21 @@ add_definitions(${FULL_WARNINGS}) # Warn about missing virtual destructor (C++ only) add_flags(CMAKE_CXX_FLAGS -Wnon-virtual-dtor) +add_flags(CMAKE_CXX_FLAGS -Wno-unknown-warning-option) +add_flags(CMAKE_C_FLAGS -Wno-unknown-warning-option) + +# Activate c++ 2011 +add_flags(CMAKE_CXX_FLAGS -std=c++11) + # Add static and dynamic bounds checks (optimization required) # add_flags(CMAKE_CXX_FLAGS_RELEASE -D_FORTIFY_SOURCE=2) # add_flags(CMAKE_C_FLAGS_RELEASE -D_FORTIFY_SOURCE=2) -set(ARCH_FLAGS -ffp-contract=off) +set(ARCH_FLAGS -ffp-contract=off -fPIE -fPIC) add_flags(CMAKE_CXX_FLAGS ${ARCH_FLAGS}) add_flags(CMAKE_C_FLAGS ${ARCH_FLAGS}) -add_flags(CMAKE_EXE_LINKER_FLAGS ${ARCH_FLAGS}) +add_flags(CMAKE_EXE_LINKER_FLAGS ${ARCH_FLAGS} -pie) # Additional debug flags # deactivated for now: I added bound checking in VOR::vector<>. diff --git a/doc/devkit/compiling.dox b/doc/devkit/compiling.dox index 34eb3be1..10a88190 100755 --- a/doc/devkit/compiling.dox +++ b/doc/devkit/compiling.dox @@ -51,8 +51,7 @@ namespace GEO { Geogram is tested under Linux (32 and 64 bits), Windows (32 and 64 bits) and MacOS/X. You will need CMake (version >= 2.8.11). There is no other dependancy (everything -that you need is shipped with Geogram). It also works with Android (ARMv7 processors). -Follow the Linux, MacOS/X, Windows or Android instructions below. In addition, Emscripten (C++ to +that you need is shipped with Geogram). Follow the Linux, MacOS/X or Windows instructions below. In addition, Emscripten (C++ to Javascript transpiler) is also supported. Specific instructions for each platform are detailed below. Contributors / Maintainers @@ -196,81 +195,6 @@ CMakeOptions.txt, modifying it and re-running CMake: - CMAKE_INSTALL_PREFIX: where to install Geogram (when building the INSTALL target) - CPACK_GENERATOR: can be used to generate a Debian package -Android -======= - -What follow are the instructions for installing the NDK on a Linux box, cross-compiling Geogram -and testing the binaries on the target Android platform. - -Preparing the NDK ------------------ - -- Download the [Android NDK](https://developer.android.com/ndk/downloads/index.html) - -- Unpack the archive: -\code -chmod 755 android-ndk-rxxy-linux-x86_64.bin -./android-ndk-rxxy-linux-x86_64.bin -\endcode -where 'rxxy' denotes the NDK version and release (e.g., r10e) - -- Create a standalone toolchain (cross-compiler) -\code -mkdir toolchain -./android-ndk-rxxy/build/tools/make-standalone-toolchain.sh - --platform=android-zz --toolchain=arm-linux-androideabi-4.9 - --system=linux-x86_64 --install-dir=`pwd`/toolchain - --stl=libc++ -\endcode -where 'zz' denotes the target Android version (e.g., 19 for KitKat, 20 for Lollipop etc...) - -- Add the binaries directory of the toolchain in the path -\code -export PATH=`pwd`/toolchain/bin/:$PATH -\endcode -(the line above can be added to your .bashrc) -\endcode - -Cross-compiling Geogram ------------------------ - -\code -cd geogram -./configure.sh Android-armv7-gcc -cd build/Android-armv7-gcc-Release/ -make -\endcode - -Note: for now, only 32 bits ARM with FPU is supported. ARM64 can be quite easily -supported (but this requires implementing a couple of ASM functions in basic/atomics.h), -will be implemented when I'll update my phone. - -Using the generated binaries on the phone ------------------------------------------ - -You can install [TerminalIDE](https://play.google.com/store/apps/details?id=com.spartacusrex.spartacuside&hl=fr) -on the phone, then copy the binaries and some data files in TerminalIDE's working directory -(/data/data/com.spartacusrex.spartacuside/files). It can be also used through -[ADB](http://developer.android.com/tools/help/adb.html). - -What about performances ? -------------------------- - -On my PC (Intel Core i7-4900MQ, 2.8 GHz), compute_delaunay with 850,000 points -takes 1.4 seconds in parallel mode (and 4.3 seconds in sequential mode). - -On my phone (HTC One M7, Snapdragon 600, 4 cores, 1.7 GHz), compute_delaunay with 850,000 points -takes 15 seconds in parallel mode (and 35 seconds in sequential mode). - -The phone has approximately 1/10th of the horsepower of the computer. - -What is the point ? -------------------- - -A portable, small, easy to compile and efficient geometry processing library can be useful -for many projects, including 3D reconstruction with a mobile phone [here](http://cvg.ethz.ch/mobile/), -reconstructions of buildings using drones, ... - Emscripten ========== diff --git a/src/examples/contrib/topopt/CMakeCache.txt b/src/examples/contrib/topopt/CMakeCache.txt deleted file mode 100644 index 73961871..00000000 --- a/src/examples/contrib/topopt/CMakeCache.txt +++ /dev/null @@ -1,345 +0,0 @@ -# This is the CMakeCache file. -# For build in directory: /home/levy/Programming/GraphiteThree/geogram/src/examples/contrib/topopt -# It was generated by CMake: /usr/bin/cmake -# You can edit this file to change values found and used by cmake. -# If you do not want to change any of the values, simply exit the editor. -# If you do want to change a value, simply edit, save, and exit the editor. -# The syntax for the file is as follows: -# KEY:TYPE=VALUE -# KEY is the name of a variable in the cache. -# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. -# VALUE is the current value for the KEY. - -######################## -# EXTERNAL cache entries -######################## - -//Path to a program. -CMAKE_AR:FILEPATH=/usr/bin/ar - -//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or -// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel. -CMAKE_BUILD_TYPE:STRING= - -//Enable/Disable color output during build. -CMAKE_COLOR_MAKEFILE:BOOL=ON - -//CXX compiler -CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++ - -//A wrapper around 'ar' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-7 - -//A wrapper around 'ranlib' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-7 - -//Flags used by the compiler during all build types. -CMAKE_CXX_FLAGS:STRING= - -//Flags used by the compiler during debug builds. -CMAKE_CXX_FLAGS_DEBUG:STRING=-g - -//Flags used by the compiler during release builds for minimum -// size. -CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the compiler during release builds. -CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the compiler during release builds with debug info. -CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//C compiler -CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc - -//A wrapper around 'ar' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_C_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-7 - -//A wrapper around 'ranlib' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-7 - -//Flags used by the compiler during all build types. -CMAKE_C_FLAGS:STRING= - -//Flags used by the compiler during debug builds. -CMAKE_C_FLAGS_DEBUG:STRING=-g - -//Flags used by the compiler during release builds for minimum -// size. -CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the compiler during release builds. -CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the compiler during release builds with debug info. -CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//Flags used by the linker. -CMAKE_EXE_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Enable/Disable output of compile commands during generation. -CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF - -//Install path prefix, prepended onto install directories. -CMAKE_INSTALL_PREFIX:PATH=/usr/local - -//Path to a program. -CMAKE_LINKER:FILEPATH=/usr/bin/ld - -//Path to a program. -CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make - -//Flags used by the linker during the creation of modules. -CMAKE_MODULE_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_NM:FILEPATH=/usr/bin/nm - -//Path to a program. -CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy - -//Path to a program. -CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump - -//Value Computed by CMake -CMAKE_PROJECT_NAME:STATIC=topopt_demo - -//Path to a program. -CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib - -//Flags used by the linker during the creation of dll's. -CMAKE_SHARED_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//If set, runtime paths are not added when installing shared libraries, -// but are added when building. -CMAKE_SKIP_INSTALL_RPATH:BOOL=NO - -//If set, runtime paths are not added when using shared libraries. -CMAKE_SKIP_RPATH:BOOL=NO - -//Flags used by the linker during the creation of static libraries. -CMAKE_STATIC_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_STRIP:FILEPATH=/usr/bin/strip - -//If this value is on, makefiles will be generated without the -// .SILENT directive, and all commands will be echoed to the console -// during the make. This is useful for debugging only. With Visual -// Studio IDE projects all commands are done without /nologo. -CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE - -//Directories containing the Eigen3 header files -EIGEN3_INCLUDE_DIR:PATH=EIGEN3_INCLUDE_DIR-NOTFOUND - -//Value Computed by CMake -topopt_demo_BINARY_DIR:STATIC=/home/levy/Programming/GraphiteThree/geogram/src/examples/contrib/topopt - -//Value Computed by CMake -topopt_demo_SOURCE_DIR:STATIC=/home/levy/Programming/GraphiteThree/geogram/src/examples/contrib/topopt - - -######################## -# INTERNAL cache entries -######################## - -//ADVANCED property for variable: CMAKE_AR -CMAKE_AR-ADVANCED:INTERNAL=1 -//This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/home/levy/Programming/GraphiteThree/geogram/src/examples/contrib/topopt -//Major version of cmake used to create the current loaded cache -CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 -//Minor version of cmake used to create the current loaded cache -CMAKE_CACHE_MINOR_VERSION:INTERNAL=10 -//Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=2 -//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE -CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 -//Path to CMake executable. -CMAKE_COMMAND:INTERNAL=/usr/bin/cmake -//Path to cpack program executable. -CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack -//Path to ctest program executable. -CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest -//ADVANCED property for variable: CMAKE_CXX_COMPILER -CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR -CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB -CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS -CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG -CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL -CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE -CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO -CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER -CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER_AR -CMAKE_C_COMPILER_AR-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER_RANLIB -CMAKE_C_COMPILER_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS -CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG -CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL -CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE -CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO -CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//Executable file format -CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS -CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG -CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE -CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS -CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 -//Name of external makefile project generator. -CMAKE_EXTRA_GENERATOR:INTERNAL= -//Name of generator. -CMAKE_GENERATOR:INTERNAL=Unix Makefiles -//Name of generator platform. -CMAKE_GENERATOR_PLATFORM:INTERNAL= -//Name of generator toolset. -CMAKE_GENERATOR_TOOLSET:INTERNAL= -//Have symbol pthread_create -CMAKE_HAVE_LIBC_CREATE:INTERNAL= -//Have library pthreads -CMAKE_HAVE_PTHREADS_CREATE:INTERNAL= -//Have library pthread -CMAKE_HAVE_PTHREAD_CREATE:INTERNAL=1 -//Have include pthread.h -CMAKE_HAVE_PTHREAD_H:INTERNAL=1 -//Source directory with the top level CMakeLists.txt file for this -// project -CMAKE_HOME_DIRECTORY:INTERNAL=/home/levy/Programming/GraphiteThree/geogram/src/examples/contrib/topopt -//Install .so files without execute permission. -CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 -//ADVANCED property for variable: CMAKE_LINKER -CMAKE_LINKER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MAKE_PROGRAM -CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS -CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG -CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE -CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_NM -CMAKE_NM-ADVANCED:INTERNAL=1 -//number of local generators -CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJCOPY -CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJDUMP -CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 -//Platform information initialized -CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RANLIB -CMAKE_RANLIB-ADVANCED:INTERNAL=1 -//Path to CMake installation. -CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.10 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS -CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG -CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE -CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH -CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_RPATH -CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS -CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG -CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE -CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STRIP -CMAKE_STRIP-ADVANCED:INTERNAL=1 -//uname command -CMAKE_UNAME:INTERNAL=/bin/uname -//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE -CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: EIGEN3_INCLUDE_DIR -EIGEN3_INCLUDE_DIR-ADVANCED:INTERNAL=1 -//Details about finding Threads -FIND_PACKAGE_MESSAGE_DETAILS_Threads:INTERNAL=[TRUE][v()] - diff --git a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CMakeCCompiler.cmake b/src/examples/contrib/topopt/CMakeFiles/3.10.2/CMakeCCompiler.cmake deleted file mode 100644 index 9a941e54..00000000 --- a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CMakeCCompiler.cmake +++ /dev/null @@ -1,73 +0,0 @@ -set(CMAKE_C_COMPILER "/usr/bin/cc") -set(CMAKE_C_COMPILER_ARG1 "") -set(CMAKE_C_COMPILER_ID "GNU") -set(CMAKE_C_COMPILER_VERSION "7.3.0") -set(CMAKE_C_COMPILER_VERSION_INTERNAL "") -set(CMAKE_C_COMPILER_WRAPPER "") -set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") -set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") -set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") -set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") -set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") - -set(CMAKE_C_PLATFORM_ID "Linux") -set(CMAKE_C_SIMULATE_ID "") -set(CMAKE_C_SIMULATE_VERSION "") - - - -set(CMAKE_AR "/usr/bin/ar") -set(CMAKE_C_COMPILER_AR "/usr/bin/gcc-ar-7") -set(CMAKE_RANLIB "/usr/bin/ranlib") -set(CMAKE_C_COMPILER_RANLIB "/usr/bin/gcc-ranlib-7") -set(CMAKE_LINKER "/usr/bin/ld") -set(CMAKE_COMPILER_IS_GNUCC 1) -set(CMAKE_C_COMPILER_LOADED 1) -set(CMAKE_C_COMPILER_WORKS TRUE) -set(CMAKE_C_ABI_COMPILED TRUE) -set(CMAKE_COMPILER_IS_MINGW ) -set(CMAKE_COMPILER_IS_CYGWIN ) -if(CMAKE_COMPILER_IS_CYGWIN) - set(CYGWIN 1) - set(UNIX 1) -endif() - -set(CMAKE_C_COMPILER_ENV_VAR "CC") - -if(CMAKE_COMPILER_IS_MINGW) - set(MINGW 1) -endif() -set(CMAKE_C_COMPILER_ID_RUN 1) -set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) -set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) -set(CMAKE_C_LINKER_PREFERENCE 10) - -# Save compiler ABI information. -set(CMAKE_C_SIZEOF_DATA_PTR "8") -set(CMAKE_C_COMPILER_ABI "ELF") -set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") - -if(CMAKE_C_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_C_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") -endif() - -if(CMAKE_C_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") -endif() - -set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") -if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;gcc_s;c;gcc;gcc_s") -set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/7;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") -set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CMakeCXXCompiler.cmake b/src/examples/contrib/topopt/CMakeFiles/3.10.2/CMakeCXXCompiler.cmake deleted file mode 100644 index 1404958c..00000000 --- a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CMakeCXXCompiler.cmake +++ /dev/null @@ -1,75 +0,0 @@ -set(CMAKE_CXX_COMPILER "/usr/bin/c++") -set(CMAKE_CXX_COMPILER_ARG1 "") -set(CMAKE_CXX_COMPILER_ID "GNU") -set(CMAKE_CXX_COMPILER_VERSION "7.3.0") -set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") -set(CMAKE_CXX_COMPILER_WRAPPER "") -set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") -set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17") -set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") -set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") -set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") -set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") - -set(CMAKE_CXX_PLATFORM_ID "Linux") -set(CMAKE_CXX_SIMULATE_ID "") -set(CMAKE_CXX_SIMULATE_VERSION "") - - - -set(CMAKE_AR "/usr/bin/ar") -set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar-7") -set(CMAKE_RANLIB "/usr/bin/ranlib") -set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib-7") -set(CMAKE_LINKER "/usr/bin/ld") -set(CMAKE_COMPILER_IS_GNUCXX 1) -set(CMAKE_CXX_COMPILER_LOADED 1) -set(CMAKE_CXX_COMPILER_WORKS TRUE) -set(CMAKE_CXX_ABI_COMPILED TRUE) -set(CMAKE_COMPILER_IS_MINGW ) -set(CMAKE_COMPILER_IS_CYGWIN ) -if(CMAKE_COMPILER_IS_CYGWIN) - set(CYGWIN 1) - set(UNIX 1) -endif() - -set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") - -if(CMAKE_COMPILER_IS_MINGW) - set(MINGW 1) -endif() -set(CMAKE_CXX_COMPILER_ID_RUN 1) -set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) -set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP) -set(CMAKE_CXX_LINKER_PREFERENCE 30) -set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) - -# Save compiler ABI information. -set(CMAKE_CXX_SIZEOF_DATA_PTR "8") -set(CMAKE_CXX_COMPILER_ABI "ELF") -set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") - -if(CMAKE_CXX_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_CXX_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") -endif() - -if(CMAKE_CXX_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") -endif() - -set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") -if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc") -set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/7;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") -set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CMakeDetermineCompilerABI_C.bin b/src/examples/contrib/topopt/CMakeFiles/3.10.2/CMakeDetermineCompilerABI_C.bin deleted file mode 100755 index 1d916702..00000000 Binary files a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CMakeDetermineCompilerABI_C.bin and /dev/null differ diff --git a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CMakeDetermineCompilerABI_CXX.bin b/src/examples/contrib/topopt/CMakeFiles/3.10.2/CMakeDetermineCompilerABI_CXX.bin deleted file mode 100755 index f481fd68..00000000 Binary files a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CMakeDetermineCompilerABI_CXX.bin and /dev/null differ diff --git a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CMakeSystem.cmake b/src/examples/contrib/topopt/CMakeFiles/3.10.2/CMakeSystem.cmake deleted file mode 100644 index 7719544f..00000000 --- a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CMakeSystem.cmake +++ /dev/null @@ -1,15 +0,0 @@ -set(CMAKE_HOST_SYSTEM "Linux-4.15.0-2-amd64") -set(CMAKE_HOST_SYSTEM_NAME "Linux") -set(CMAKE_HOST_SYSTEM_VERSION "4.15.0-2-amd64") -set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") - - - -set(CMAKE_SYSTEM "Linux-4.15.0-2-amd64") -set(CMAKE_SYSTEM_NAME "Linux") -set(CMAKE_SYSTEM_VERSION "4.15.0-2-amd64") -set(CMAKE_SYSTEM_PROCESSOR "x86_64") - -set(CMAKE_CROSSCOMPILING "FALSE") - -set(CMAKE_SYSTEM_LOADED 1) diff --git a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CompilerIdC/CMakeCCompilerId.c b/src/examples/contrib/topopt/CMakeFiles/3.10.2/CompilerIdC/CMakeCCompilerId.c deleted file mode 100644 index 722faa80..00000000 --- a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CompilerIdC/CMakeCCompilerId.c +++ /dev/null @@ -1,598 +0,0 @@ -#ifdef __cplusplus -# error "A C++ compiler has been selected for C." -#endif - -#if defined(__18CXX) -# define ID_VOID_MAIN -#endif -#if defined(__CLASSIC_C__) -/* cv-qualifiers did not exist in K&R C */ -# define const -# define volatile -#endif - - -/* Version number components: V=Version, R=Revision, P=Patch - Version date components: YYYY=Year, MM=Month, DD=Day */ - -#if defined(__INTEL_COMPILER) || defined(__ICC) -# define COMPILER_ID "Intel" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif - /* __INTEL_COMPILER = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) -# if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) -# else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) -# endif -# if defined(__INTEL_COMPILER_BUILD_DATE) - /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) -# endif -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__PATHCC__) -# define COMPILER_ID "PathScale" -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) -# if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) -# endif - -#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) -# define COMPILER_ID "Embarcadero" -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_C) -# define COMPILER_ID "SunPro" -# if __SUNPRO_C >= 0x5100 - /* __SUNPRO_C = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# endif - -#elif defined(__HP_cc) -# define COMPILER_ID "HP" - /* __HP_cc = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) - -#elif defined(__DECC) -# define COMPILER_ID "Compaq" - /* __DECC_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) - -#elif defined(__IBMC__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 -# define COMPILER_ID "XL" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) -# define COMPILER_ID "Fujitsu" - -#elif defined(__TINYC__) -# define COMPILER_ID "TinyCC" - -#elif defined(__BCC__) -# define COMPILER_ID "Bruce" - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__GNUC__) -# define COMPILER_ID "GNU" -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) -# define COMPILER_ID "ADSP" -#if defined(__VISUALDSPVERSION__) - /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ -# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) -# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - -#elif defined(__ARMCC_VERSION) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) -# define COMPILER_ID "SDCC" -# if defined(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) -# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) -# else - /* SDCC = VRP */ -# define COMPILER_VERSION_MAJOR DEC(SDCC/100) -# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) -# define COMPILER_VERSION_PATCH DEC(SDCC % 10) -# endif - -#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) -# define COMPILER_ID "MIPSpro" -# if defined(_SGI_COMPILER_VERSION) - /* _SGI_COMPILER_VERSION = VRP */ -# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) -# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) -# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) -# else - /* _COMPILER_VERSION = VRP */ -# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) -# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) -# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__sgi) -# define COMPILER_ID "MIPSpro" - -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXE) || defined(__CRAYXC) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) -# define PLATFORM_ID "IRIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number components. */ -#ifdef COMPILER_VERSION_MAJOR -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - - -#if !defined(__STDC__) -# if defined(_MSC_VER) && !defined(__clang__) -# define C_DIALECT "90" -# else -# define C_DIALECT -# endif -#elif __STDC_VERSION__ >= 201000L -# define C_DIALECT "11" -#elif __STDC_VERSION__ >= 199901L -# define C_DIALECT "99" -#else -# define C_DIALECT "90" -#endif -const char* info_language_dialect_default = - "INFO" ":" "dialect_default[" C_DIALECT "]"; - -/*--------------------------------------------------------------------------*/ - -#ifdef ID_VOID_MAIN -void main() {} -#else -# if defined(__CLASSIC_C__) -int main(argc, argv) int argc; char *argv[]; -# else -int main(int argc, char* argv[]) -# endif -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; - require += info_arch[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXE) || defined(__CRAYXC) - require += info_cray[argc]; -#endif - require += info_language_dialect_default[argc]; - (void)argv; - return require; -} -#endif diff --git a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CompilerIdC/a.out b/src/examples/contrib/topopt/CMakeFiles/3.10.2/CompilerIdC/a.out deleted file mode 100755 index db2504a5..00000000 Binary files a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CompilerIdC/a.out and /dev/null differ diff --git a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.cpp b/src/examples/contrib/topopt/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.cpp deleted file mode 100644 index 2d662985..00000000 --- a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.cpp +++ /dev/null @@ -1,576 +0,0 @@ -/* This source file must have a .cpp extension so that all C++ compilers - recognize the extension without flags. Borland does not know .cxx for - example. */ -#ifndef __cplusplus -# error "A C compiler has been selected for C++." -#endif - - -/* Version number components: V=Version, R=Revision, P=Patch - Version date components: YYYY=Year, MM=Month, DD=Day */ - -#if defined(__COMO__) -# define COMPILER_ID "Comeau" - /* __COMO_VERSION__ = VRR */ -# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) -# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) - -#elif defined(__INTEL_COMPILER) || defined(__ICC) -# define COMPILER_ID "Intel" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif - /* __INTEL_COMPILER = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) -# if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) -# else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) -# endif -# if defined(__INTEL_COMPILER_BUILD_DATE) - /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) -# endif -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__PATHCC__) -# define COMPILER_ID "PathScale" -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) -# if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) -# endif - -#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) -# define COMPILER_ID "Embarcadero" -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_CC) -# define COMPILER_ID "SunPro" -# if __SUNPRO_CC >= 0x5100 - /* __SUNPRO_CC = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# endif - -#elif defined(__HP_aCC) -# define COMPILER_ID "HP" - /* __HP_aCC = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) - -#elif defined(__DECCXX) -# define COMPILER_ID "Compaq" - /* __DECCXX_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) - -#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 -# define COMPILER_ID "XL" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) -# define COMPILER_ID "Fujitsu" - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__GNUC__) || defined(__GNUG__) -# define COMPILER_ID "GNU" -# if defined(__GNUC__) -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# else -# define COMPILER_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) -# define COMPILER_ID "ADSP" -#if defined(__VISUALDSPVERSION__) - /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ -# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) -# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - -#elif defined(__ARMCC_VERSION) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) -# define COMPILER_ID "MIPSpro" -# if defined(_SGI_COMPILER_VERSION) - /* _SGI_COMPILER_VERSION = VRP */ -# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) -# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) -# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) -# else - /* _COMPILER_VERSION = VRP */ -# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) -# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) -# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__sgi) -# define COMPILER_ID "MIPSpro" - -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXE) || defined(__CRAYXC) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) -# define PLATFORM_ID "IRIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number components. */ -#ifdef COMPILER_VERSION_MAJOR -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - - -#if defined(_MSC_VER) && defined(_MSVC_LANG) -#define CXX_STD _MSVC_LANG -#else -#define CXX_STD __cplusplus -#endif - -const char* info_language_dialect_default = "INFO" ":" "dialect_default[" -#if CXX_STD > 201402L - "17" -#elif CXX_STD >= 201402L - "14" -#elif CXX_STD >= 201103L - "11" -#else - "98" -#endif -"]"; - -/*--------------------------------------------------------------------------*/ - -int main(int argc, char* argv[]) -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXE) || defined(__CRAYXC) - require += info_cray[argc]; -#endif - require += info_language_dialect_default[argc]; - (void)argv; - return require; -} diff --git a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CompilerIdCXX/a.out b/src/examples/contrib/topopt/CMakeFiles/3.10.2/CompilerIdCXX/a.out deleted file mode 100755 index 2ac616e1..00000000 Binary files a/src/examples/contrib/topopt/CMakeFiles/3.10.2/CompilerIdCXX/a.out and /dev/null differ diff --git a/src/examples/contrib/topopt/CMakeFiles/cmake.check_cache b/src/examples/contrib/topopt/CMakeFiles/cmake.check_cache deleted file mode 100644 index 3dccd731..00000000 --- a/src/examples/contrib/topopt/CMakeFiles/cmake.check_cache +++ /dev/null @@ -1 +0,0 @@ -# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/src/examples/contrib/topopt/CMakeFiles/feature_tests.bin b/src/examples/contrib/topopt/CMakeFiles/feature_tests.bin deleted file mode 100755 index 5361ae52..00000000 Binary files a/src/examples/contrib/topopt/CMakeFiles/feature_tests.bin and /dev/null differ diff --git a/src/examples/contrib/topopt/CMakeFiles/feature_tests.c b/src/examples/contrib/topopt/CMakeFiles/feature_tests.c deleted file mode 100644 index 83e86dd8..00000000 --- a/src/examples/contrib/topopt/CMakeFiles/feature_tests.c +++ /dev/null @@ -1,34 +0,0 @@ - - const char features[] = {"\n" -"C_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 -"1" -#else -"0" -#endif -"c_function_prototypes\n" -"C_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -"1" -#else -"0" -#endif -"c_restrict\n" -"C_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L -"1" -#else -"0" -#endif -"c_static_assert\n" -"C_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -"1" -#else -"0" -#endif -"c_variadic_macros\n" - -}; - -int main(int argc, char** argv) { (void)argv; return features[argc]; } diff --git a/src/examples/contrib/topopt/CMakeFiles/feature_tests.cxx b/src/examples/contrib/topopt/CMakeFiles/feature_tests.cxx deleted file mode 100644 index b93418c6..00000000 --- a/src/examples/contrib/topopt/CMakeFiles/feature_tests.cxx +++ /dev/null @@ -1,405 +0,0 @@ - - const char features[] = {"\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L -"1" -#else -"0" -#endif -"cxx_aggregate_default_initializers\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_alias_templates\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_alignas\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_alignof\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_attributes\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L -"1" -#else -"0" -#endif -"cxx_attribute_deprecated\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_auto_type\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L -"1" -#else -"0" -#endif -"cxx_binary_literals\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_constexpr\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L -"1" -#else -"0" -#endif -"cxx_contextual_conversions\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_decltype\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L -"1" -#else -"0" -#endif -"cxx_decltype_auto\n" -"CXX_FEATURE:" -#if ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40801) && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_decltype_incomplete_return_types\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_default_function_template_args\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_defaulted_functions\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_defaulted_move_initializers\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_delegating_constructors\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_deleted_functions\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L -"1" -#else -"0" -#endif -"cxx_digit_separators\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_enum_forward_declarations\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_explicit_conversions\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_extended_friend_declarations\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_extern_templates\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_final\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_func_identifier\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_generalized_initializers\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L -"1" -#else -"0" -#endif -"cxx_generic_lambdas\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_inheriting_constructors\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_inline_namespaces\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_lambdas\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L -"1" -#else -"0" -#endif -"cxx_lambda_init_captures\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_local_type_template_args\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_long_long_type\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_noexcept\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_nonstatic_member_init\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_nullptr\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_override\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_range_for\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_raw_string_literals\n" -"CXX_FEATURE:" -#if ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40801) && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_reference_qualified_functions\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L -"1" -#else -"0" -#endif -"cxx_relaxed_constexpr\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L -"1" -#else -"0" -#endif -"cxx_return_type_deduction\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_right_angle_brackets\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_rvalue_references\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_sizeof_member\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_static_assert\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_strong_enums\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && __cplusplus -"1" -#else -"0" -#endif -"cxx_template_template_parameters\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_thread_local\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_trailing_return_types\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_unicode_literals\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_uniform_initialization\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_unrestricted_unions\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_user_literals\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L -"1" -#else -"0" -#endif -"cxx_variable_templates\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_variadic_macros\n" -"CXX_FEATURE:" -#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) -"1" -#else -"0" -#endif -"cxx_variadic_templates\n" - -}; - -int main(int argc, char** argv) { (void)argv; return features[argc]; } diff --git a/src/lib/exploragram/hexdom/FF_visu.cpp b/src/lib/exploragram/hexdom/FF_visu.cpp index 57f7fbea..28ff9568 100644 --- a/src/lib/exploragram/hexdom/FF_visu.cpp +++ b/src/lib/exploragram/hexdom/FF_visu.cpp @@ -97,8 +97,6 @@ namespace GEO { index_t off_v = render->vertices.create_vertices(SPHERE_MODEL_NB_PTS); FOR(vs, SPHERE_MODEL_NB_PTS) { vec3 q = SPHERE_MODEL_PTS[vs]; - //val[off_v + vs] = geo_min(1., geo_max(.5 + (sh[v].value(q) - .5) / .64, 0.)); - //X(render)[off_v + vs] = X(m)[v] + scale * (2. * (val[off_v + vs]))*q; val[off_v + vs] = .5 + (sh[v].value(q) - .5) / .64; X(render)[off_v + vs] = X(m)[v] + scale * (3.+2. * (val[off_v + vs]))*q; } diff --git a/src/lib/exploragram/hexdom/mesh_utils.h b/src/lib/exploragram/hexdom/mesh_utils.h index 44cf0a9d..3d47fa32 100644 --- a/src/lib/exploragram/hexdom/mesh_utils.h +++ b/src/lib/exploragram/hexdom/mesh_utils.h @@ -147,8 +147,8 @@ namespace GEO { v_min = 1e20; v_max = -1e20; FOR(i, attr.nb_elements()) { - v_min = geo_min(v_min, attr[i]); - v_max = geo_max(v_max, attr[i]); + v_min = std::min(v_min, attr[i]); + v_max = std::max(v_max, attr[i]); } } diff --git a/src/lib/exploragram/optimal_transport/optimal_transport.cpp b/src/lib/exploragram/optimal_transport/optimal_transport.cpp index 30faf0df..d65c9615 100644 --- a/src/lib/exploragram/optimal_transport/optimal_transport.cpp +++ b/src/lib/exploragram/optimal_transport/optimal_transport.cpp @@ -360,13 +360,17 @@ namespace GEO { FOR(i,n) { total_nu += nu(i); } - std::cerr << "total nu=" << total_nu << std::endl; - std::cerr << "total mass=" << total_mass_ << std::endl; + if(verbose_) { + std::cerr << "total nu=" << total_nu << std::endl; + std::cerr << "total mass=" << total_mass_ << std::endl; + } if(::fabs(total_nu - total_mass_)/total_mass_ > 0.01) { - Logger::warn("OTM") << "Specified nu do not sum to domain measure" - << std::endl; - Logger::warn("OTM") << "rescaling..." - << std::endl; + Logger::warn("OTM") + << "Specified nu do not sum to domain measure" + << std::endl; + Logger::warn("OTM") + << "rescaling..." + << std::endl; } FOR(i,n) { set_nu(i, nu(i) * total_mass_ / total_nu); diff --git a/src/lib/geogram/NL/nl_api.c b/src/lib/geogram/NL/nl_api.c index 476f0ed8..9ee584ef 100644 --- a/src/lib/geogram/NL/nl_api.c +++ b/src/lib/geogram/NL/nl_api.c @@ -826,14 +826,17 @@ void nlCoefficient(NLuint index, NLdouble value) { } void nlAddIJCoefficient(NLuint i, NLuint j, NLdouble value) { - nlCheckState(NL_STATE_MATRIX); - nl_debug_range_assert(i, 0, nlCurrentContext->nb_variables - 1); - nl_debug_range_assert(j, 0, nlCurrentContext->nb_variables - 1); #ifdef NL_DEBUG - for(NLuint i=0; inb_variables; ++i) { - nl_debug_assert(!nlCurrentContext->variable_is_locked[i]); + NLuint kk; + if(nlCurrentContext->variable_is_locked != NULL) { + for(kk=0; kknb_variables; ++kk) { + nl_debug_assert(!nlCurrentContext->variable_is_locked[kk]); + } } #endif + nlCheckState(NL_STATE_MATRIX); + nl_debug_range_assert(i, 0, nlCurrentContext->nb_variables - 1); + nl_debug_range_assert(j, 0, nlCurrentContext->nb_variables - 1); if(nlCurrentContext->has_matrix_pattern) { nlCRSMatrixAdd( nlGetCurrentCRSMatrix(), i, j, value @@ -847,27 +850,33 @@ void nlAddIJCoefficient(NLuint i, NLuint j, NLdouble value) { } void nlAddIRightHandSide(NLuint i, NLdouble value) { - nlCheckState(NL_STATE_MATRIX); - nl_debug_range_assert(i, 0, nlCurrentContext->nb_variables - 1); #ifdef NL_DEBUG - for(NLuint i=0; inb_variables; ++i) { - nl_debug_assert(!nlCurrentContext->variable_is_locked[i]); + NLuint kk; + if(nlCurrentContext->variable_is_locked != NULL) { + for(kk=0; kknb_variables; ++kk) { + nl_debug_assert(!nlCurrentContext->variable_is_locked[kk]); + } } #endif + nlCheckState(NL_STATE_MATRIX); + nl_debug_range_assert(i, 0, nlCurrentContext->nb_variables - 1); nlCurrentContext->b[i] += value; nlCurrentContext->ij_coefficient_called = NL_TRUE; } void nlMultiAddIRightHandSide(NLuint i, NLuint k, NLdouble value) { NLuint n = nlCurrentContext->n; - nlCheckState(NL_STATE_MATRIX); - nl_debug_range_assert(i, 0, nlCurrentContext->nb_variables - 1); - nl_debug_range_assert(k, 0, nlCurrentContext->nb_systems - 1); #ifdef NL_DEBUG - for(NLuint i=0; inb_variables; ++i) { - nl_debug_assert(!nlCurrentContext->variable_is_locked[i]); + NLuint kk; + if(nlCurrentContext->variable_is_locked != NULL) { + for(kk=0; kknb_variables; ++kk) { + nl_debug_assert(!nlCurrentContext->variable_is_locked[kk]); + } } #endif + nlCheckState(NL_STATE_MATRIX); + nl_debug_range_assert(i, 0, nlCurrentContext->nb_variables - 1); + nl_debug_range_assert(k, 0, nlCurrentContext->nb_systems - 1); nlCurrentContext->b[i + k*n] += value; nlCurrentContext->ij_coefficient_called = NL_TRUE; } diff --git a/src/lib/geogram/NL/nl_private.h b/src/lib/geogram/NL/nl_private.h old mode 100755 new mode 100644 index b4cb45bb..de77988c --- a/src/lib/geogram/NL/nl_private.h +++ b/src/lib/geogram/NL/nl_private.h @@ -51,6 +51,10 @@ #include #include +#ifndef NDEBUG +#define NL_DEBUG +#endif + /** * \file geogram/NL/nl_private.h * \brief Some macros and functions used internally by OpenNL. @@ -157,12 +161,12 @@ NL_NORETURN_DECL void nl_should_not_have_reached( * \param[in] min_val the minimum admissible value for the variable * \param[in] max_val the maximum admissible value for the variable */ -#define nl_range_assert(x,min_val,max_val) { \ - if(((x) < (min_val)) || ((x) > (max_val))) { \ - nl_range_assertion_failed(x, min_val, max_val, \ - __FILE__, __LINE__ \ - ) ; \ - } \ +#define nl_range_assert(x,min_val,max_val) { \ + if(((int)(x) < (int)(min_val)) || ((int)(x) > (int)(max_val))) { \ + nl_range_assertion_failed(x, min_val, max_val, \ + __FILE__, __LINE__ \ + ) ; \ + } \ } /** diff --git a/src/lib/geogram/basic/attributes.cpp b/src/lib/geogram/basic/attributes.cpp index 9689a05f..d682a043 100644 --- a/src/lib/geogram/basic/attributes.cpp +++ b/src/lib/geogram/basic/attributes.cpp @@ -83,6 +83,7 @@ namespace GEO { dimension_(dim), cached_base_addr_(nullptr), cached_size_(0), + cached_capacity_(0), lock_(GEOGRAM_SPINLOCK_INIT) { } @@ -166,7 +167,7 @@ namespace GEO { /*************************************************************************/ - AttributesManager::AttributesManager() : size_(0) { + AttributesManager::AttributesManager() : size_(0), capacity_(0) { } AttributesManager::~AttributesManager() { @@ -183,6 +184,16 @@ namespace GEO { size_ = new_size; } + void AttributesManager::reserve(index_t new_capacity) { + if(new_capacity <= capacity_) { + return; + } + for(auto& cur : attributes_) { + cur.second->reserve(new_capacity); + } + capacity_ = new_capacity; + } + void AttributesManager::apply_permutation( const vector& permutation ) { @@ -205,6 +216,7 @@ namespace GEO { ) { geo_assert(find_attribute_store(name) == nullptr); attributes_[name] = as; + as->reserve(capacity_); as->resize(size_); } @@ -280,6 +292,7 @@ namespace GEO { void AttributesManager::copy(const AttributesManager& rhs) { clear(false, false); + reserve(rhs.capacity()); resize(rhs.size()); for(auto& cur : rhs.attributes_) { bind_attribute_store(cur.first, cur.second->clone()); diff --git a/src/lib/geogram/basic/attributes.h b/src/lib/geogram/basic/attributes.h index de9335ac..74e2ced5 100644 --- a/src/lib/geogram/basic/attributes.h +++ b/src/lib/geogram/basic/attributes.h @@ -244,12 +244,28 @@ namespace GEO { return cached_size_; } + /** + * \brief Gets the capacity. + * \return the number of items that can be stored without + * a reallocation. + */ + index_t capacity() const { + return cached_capacity_; + } + /** * \brief Resizes this AttributeStore * \param[in] new_size new number of items */ virtual void resize(index_t new_size) = 0; + /** + * \brief Reserves memory. + * \param[in] new_capacity total number of items to + * be stored. + */ + virtual void reserve(index_t new_capacity) = 0; + /** * \brief Resizes this AttributeStore to 0. * \param[in] keep_memory if true, then memory @@ -532,6 +548,7 @@ namespace GEO { index_t dimension_; Memory::pointer cached_base_addr_; index_t cached_size_; + index_t cached_capacity_; std::set observers_; Process::spinlock lock_; @@ -576,7 +593,19 @@ namespace GEO { ); } - virtual void clear(bool keep_memory=false) { + virtual void reserve(index_t new_capacity) { + if(new_capacity > capacity()) { + store_.reserve(new_capacity*dimension_); + cached_capacity_ = new_capacity; + notify( + store_.empty() ? nullptr : Memory::pointer(store_.data()), + size(), + dimension_ + ); + } + } + + virtual void clear(bool keep_memory=false) { if(keep_memory) { store_.resize(0); } else { @@ -591,6 +620,7 @@ namespace GEO { return; } vector new_store(size()*dim); + new_store.reserve(capacity()*dim); index_t copy_dim = std::min(dim, dimension()); for(index_t i = 0; i < size(); ++i) { for(index_t c = 0; c < copy_dim; ++c) { @@ -735,7 +765,16 @@ namespace GEO { index_t size() const { return size_; } - + + /** + * \brief Gets the capacity. + * \return the number of items that can be stored without doing + * a reallocation. + */ + index_t capacity() const { + return capacity_; + } + /** * \brief Resizes all the attributes managed by this * AttributesManager. @@ -744,6 +783,14 @@ namespace GEO { */ void resize(index_t new_size); + /** + * \brief Pre-allocates memory for a number of items. + * \details Has effect only if new_capacity is larger + * than current capacity. + * \param[in] new_capacity the number of items. + */ + void reserve(index_t new_capacity); + /** * \brief Clears this AttributesManager * \param[in] keep_attributes if true, then all @@ -884,6 +931,7 @@ namespace GEO { private: index_t size_; + index_t capacity_; std::map attributes_; } ; diff --git a/src/lib/geogram/basic/file_system.cpp b/src/lib/geogram/basic/file_system.cpp index c999b94f..9d0a9722 100755 --- a/src/lib/geogram/basic/file_system.cpp +++ b/src/lib/geogram/basic/file_system.cpp @@ -578,7 +578,7 @@ namespace GEO { std::string home; #if defined GEO_OS_WINDOWS wchar_t folder[MAX_PATH+1]; - HRESULT hr = SHGetFolderPathW(0, CSIDL_MYDOCUMENTS, 0, 0, folder); + HRESULT hr = SHGetFolderPathW(0, CSIDL_PROFILE, 0, 0, folder); if (SUCCEEDED(hr)) { char result[MAX_PATH+1]; wcstombs(result, folder, MAX_PATH); @@ -596,6 +596,27 @@ namespace GEO { return home; } + std::string documents_directory() { + std::string home; +#if defined GEO_OS_WINDOWS + wchar_t folder[MAX_PATH+1]; + HRESULT hr = SHGetFolderPathW(0, CSIDL_MYDOCUMENTS, 0, 0, folder); + if (SUCCEEDED(hr)) { + char result[MAX_PATH+1]; + wcstombs(result, folder, MAX_PATH); + home=std::string(result); + flip_slashes(home); + } +#elif defined GEO_OS_EMSCRIPTEN + home="/"; +#else + char* result = getenv("HOME"); + if(result != nullptr) { + home=result; + } +#endif + return home; + } } diff --git a/src/lib/geogram/basic/file_system.h b/src/lib/geogram/basic/file_system.h index 86a3fb16..8fa12b26 100755 --- a/src/lib/geogram/basic/file_system.h +++ b/src/lib/geogram/basic/file_system.h @@ -317,13 +317,19 @@ namespace GEO { std::string GEOGRAM_API normalized_path(const std::string& path); + /** + * \brief Gets the current user's home directory. + * \return The path to the current user's home directory as a string. + */ + std::string GEOGRAM_API home_directory(); + /** * \brief Gets the current user's home directory. * \details Under unix, it returns the content of the HOME environment * variable. Under Windows, it returns the "My Documents" directory. * \return The path to the current user's home directory as a string. */ - std::string GEOGRAM_API home_directory(); + std::string GEOGRAM_API documents_directory(); } } diff --git a/src/lib/geogram/basic/logger.cpp b/src/lib/geogram/basic/logger.cpp index a59159f1..943103f0 100644 --- a/src/lib/geogram/basic/logger.cpp +++ b/src/lib/geogram/basic/logger.cpp @@ -86,7 +86,7 @@ namespace GEO { } void LoggerStream::notify(const std::string& str) { - logger_->notify(this, str); + logger_->notify(this, str); } /************************************************************************/ @@ -336,6 +336,7 @@ namespace GEO { pretty_ = flag; } + Logger::Logger() : out_(this), warn_(this), @@ -345,7 +346,8 @@ namespace GEO { current_feature_changed_(false), quiet_(true), pretty_(true), - minimal_(false) + minimal_(false), + notifying_error_(false) { // Add a default client printing stuff to std::cout register_client(new ConsoleLogger()); @@ -358,7 +360,8 @@ namespace GEO { } Logger* Logger::instance() { - // Do not use geo_assert here: if the instance is nullptr, geo_assert will + // Do not use geo_assert here: + // if the instance is nullptr, geo_assert will // call the Logger to print the assertion failure, thus ending in a // infinite loop. if(instance_ == nullptr) { @@ -371,33 +374,42 @@ namespace GEO { } std::ostream& Logger::div(const std::string& title) { - return is_initialized() ? + std::ostream& result = is_initialized() ? instance()->div_stream(title) : (std::cerr << "=====" << title << std::endl); + return result; } std::ostream& Logger::out(const std::string& feature) { - return is_initialized() ? + std::ostream& result = + (is_initialized() && !Process::is_running_threads()) ? instance()->out_stream(feature) : (std::cerr << " [" << feature << "] "); + return result; } std::ostream& Logger::err(const std::string& feature) { - return is_initialized() ? + std::ostream& result = + (is_initialized() && !Process::is_running_threads()) ? instance()->err_stream(feature) : (std::cerr << "(E)-[" << feature << "] "); + return result; } std::ostream& Logger::warn(const std::string& feature) { - return is_initialized() ? + std::ostream& result = + (is_initialized() && !Process::is_running_threads()) ? instance()->warn_stream(feature) : (std::cerr << "(W)-[" << feature << "] "); + return result; } std::ostream& Logger::status() { - return is_initialized() ? + std::ostream& result = + (is_initialized() && !Process::is_running_threads()) ? instance()->status_stream() : (std::cerr << "[status] "); + return result; } std::ostream& Logger::div_stream(const std::string& title) { @@ -478,10 +490,17 @@ namespace GEO { CmdLine::ui_feature(current_feature_, current_feature_changed_) + msg; - for(auto it : clients_) { - it->err(feat_msg); - it->status(msg); - } + if(notifying_error_) { + std::cerr << "Error while displaying error (!):" + << feat_msg << std::endl; + } else { + notifying_error_ = true; + for(auto it : clients_) { + it->err(feat_msg); + it->status(msg); + } + notifying_error_ = false; + } current_feature_changed_ = false; } diff --git a/src/lib/geogram/basic/logger.h b/src/lib/geogram/basic/logger.h index ea65e810..f0ddb557 100644 --- a/src/lib/geogram/basic/logger.h +++ b/src/lib/geogram/basic/logger.h @@ -50,6 +50,7 @@ #include #include +#include #include #include #include @@ -84,7 +85,7 @@ namespace GEO { * \param[in] loggerStream the LoggerStream that owns this buffer */ LoggerStreamBuf(LoggerStream* loggerStream) : - loggerStream_(loggerStream) { + loggerStream_(loggerStream) { } private: @@ -710,8 +711,10 @@ namespace GEO { bool quiet_; bool pretty_; bool minimal_; + bool notifying_error_; friend class LoggerStream; + friend class LoggerStreamBuf; }; /************************************************************************/ diff --git a/src/lib/geogram/basic/process.cpp b/src/lib/geogram/basic/process.cpp index 09bae653..e514ea58 100644 --- a/src/lib/geogram/basic/process.cpp +++ b/src/lib/geogram/basic/process.cpp @@ -449,7 +449,14 @@ namespace GEO { } bool is_running_threads() { +#ifdef GEO_OPENMP + return ( + omp_in_parallel() || + (running_threads_invocations_ > 0) + ); +#else return running_threads_invocations_ > 0; +#endif } bool multithreading_enabled() { diff --git a/src/lib/geogram/delaunay/parallel_delaunay_3d.cpp b/src/lib/geogram/delaunay/parallel_delaunay_3d.cpp index 7fb310de..1878a3db 100644 --- a/src/lib/geogram/delaunay/parallel_delaunay_3d.cpp +++ b/src/lib/geogram/delaunay/parallel_delaunay_3d.cpp @@ -2723,6 +2723,11 @@ namespace GEO { */ static char halfedge_facet_[4][4]; + /** + * \brief Stores the triangles on the boundary + * of the cavity, for faster generation of the + * new tetrahedra. + */ Cavity cavity_; }; @@ -3022,9 +3027,6 @@ namespace GEO { delete W; if(debug_mode_) { -// Delaunay3dThread* thread0 = -// static_cast(threads_[0].get()); - for(index_t i=0; i(threads_[i].get()) diff --git a/src/lib/geogram/lua/lua_io.cpp b/src/lib/geogram/lua/lua_io.cpp index 2d93d272..e4abf760 100644 --- a/src/lib/geogram/lua/lua_io.cpp +++ b/src/lib/geogram/lua/lua_io.cpp @@ -87,10 +87,14 @@ namespace { L, "'require()' invalid number of arguments" ); } - - std::string k = - std::string("lib/") + std::string(lua_tostring(L,1)) + ".lua"; - auto it = embedded_files.find(k); + if(!lua_isstring(L,1)) { + return luaL_error( + L, "'require()' argument is not a string" + ); + } + auto it = embedded_files.find( + std::string("lib/") + std::string(lua_tostring(L,1)) + ".lua" + ); if(it == embedded_files.end()) { return call_lua_require(L); } @@ -303,7 +307,8 @@ void init_lua_io(lua_State* L) { lua_bindwrapper(L, FileSystem::set_executable_flag); lua_bindwrapper(L, FileSystem::touch); lua_bindwrapper(L, FileSystem::normalized_path); - lua_bindwrapper(L, FileSystem::home_directory); + lua_bindwrapper(L, FileSystem::home_directory); + lua_bindwrapper(L, FileSystem::documents_directory); lua_bindwrapper(L, LUAFileSystemImpl::get_directory_entries); lua_bindwrapper(L, LUAFileSystemImpl::get_files); diff --git a/src/lib/geogram/mesh/mesh.cpp b/src/lib/geogram/mesh/mesh.cpp index 8951e5e2..4b66440a 100644 --- a/src/lib/geogram/mesh/mesh.cpp +++ b/src/lib/geogram/mesh/mesh.cpp @@ -831,7 +831,7 @@ namespace GEO { namespace MeshCellDescriptors { - CellDescriptor tet_descriptor = { + GEOGRAM_API CellDescriptor tet_descriptor = { 4, // nb_vertices 4, // nb_facets {3,3,3,3}, // nb_vertices in facet @@ -851,7 +851,7 @@ namespace GEO { }; - CellDescriptor hex_descriptor = { + GEOGRAM_API CellDescriptor hex_descriptor = { 8, // nb_vertices 6, // nb_facets {4,4,4,4,4,4}, // nb_vertices in facet @@ -874,7 +874,7 @@ namespace GEO { } }; - CellDescriptor prism_descriptor = { + GEOGRAM_API CellDescriptor prism_descriptor = { 6, // nb_vertices 5, // nb_facets {3,3,4,4,4}, // nb_vertices in facet @@ -895,7 +895,7 @@ namespace GEO { }; - CellDescriptor pyramid_descriptor = { + GEOGRAM_API CellDescriptor pyramid_descriptor = { 5, // nb_vertices 5, // nb_facets {4,3,3,3,3}, // nb_vertices in facet @@ -915,7 +915,7 @@ namespace GEO { } }; - CellDescriptor connector_descriptor = { + GEOGRAM_API CellDescriptor connector_descriptor = { 4, // nb_vertices 3, // nb_facets {4,3,3}, // nb_vertices in facet @@ -933,7 +933,7 @@ namespace GEO { } }; - CellDescriptor* cell_type_to_cell_descriptor[5] = { + GEOGRAM_API CellDescriptor* cell_type_to_cell_descriptor[5] = { &tet_descriptor, &hex_descriptor, &prism_descriptor, diff --git a/src/lib/geogram/mesh/mesh.h b/src/lib/geogram/mesh/mesh.h index 31c55fee..9a80e8d7 100644 --- a/src/lib/geogram/mesh/mesh.h +++ b/src/lib/geogram/mesh/mesh.h @@ -137,16 +137,17 @@ namespace GEO { index_t create_sub_elements(index_t nb) { index_t result = nb_; if(nb_ + nb > attributes_.size()) { - index_t new_size=nb_ + nb; + index_t new_capacity=nb_ + nb; if(nb < 128) { - new_size = std::max(index_t(16),attributes_.size()); - while(new_size < nb_ + nb) { - new_size *= 2; + new_capacity = std::max(index_t(16),attributes_.size()); + while(new_capacity < nb_ + nb) { + new_capacity *= 2; } } - attributes_.resize(new_size); + attributes_.reserve(new_capacity); } nb_ += nb; + attributes_.resize(nb_); return result; } @@ -157,10 +158,12 @@ namespace GEO { index_t create_sub_element() { index_t result = nb_; ++nb_; - if(attributes_.size() < nb_) { - index_t new_size = std::max(index_t(16),attributes_.size()*2); - attributes_.resize(new_size); + if(attributes_.capacity() < nb_) { + index_t new_capacity = + std::max(index_t(16),attributes_.capacity()*2); + attributes_.reserve(new_capacity); } + attributes_.resize(nb_); return result; } @@ -1324,7 +1327,9 @@ namespace GEO { MeshFacetCornersStore& facet_corners_; friend class Mesh; friend class GeogramIOHandler; - friend void GEOGRAM_API tessellate_facets(Mesh& M, index_t max_nb_vertices); + friend void GEOGRAM_API tessellate_facets( + Mesh& M, index_t max_nb_vertices + ); }; /*************************************************************************/ diff --git a/src/lib/geogram/mesh/mesh_io.cpp b/src/lib/geogram/mesh/mesh_io.cpp index d34dfd37..838f6fcf 100644 --- a/src/lib/geogram/mesh/mesh_io.cpp +++ b/src/lib/geogram/mesh/mesh_io.cpp @@ -1797,12 +1797,29 @@ namespace GEO { return false; } + Attribute vertex_color; + vertex_color.bind_if_is_defined( + M.vertices.attributes(), "color" + ); + if(vertex_color.is_bound() && vertex_color.dimension() != 3) { + Logger::warn("IO") + << "Mesh has vertex colors but attribut dim is not 3 (ignoring them)" + << std::endl; + vertex_color.unbind(); + } + // Create element and properties for vertices e_ply_type coord_type = PLY_FLOAT; + e_ply_type color_type = PLY_UINT8; ply_add_element(oply, "vertex", long(M.vertices.nb())); ply_add_property(oply, "x", coord_type, coord_type, coord_type); ply_add_property(oply, "y", coord_type, coord_type, coord_type); ply_add_property(oply, "z", coord_type, coord_type, coord_type); + if(vertex_color.is_bound()) { + ply_add_property(oply, "red", color_type, color_type, color_type); + ply_add_property(oply, "green", color_type, color_type, color_type); + ply_add_property(oply, "blue", color_type, color_type, color_type); + } if(ioflags.has_element(MESH_FACETS)) { // Create element and properties for facets @@ -1846,6 +1863,12 @@ namespace GEO { for(index_t coord = 0; coord < 3; coord++) { ply_write(oply, xyz[coord]); } + if(vertex_color.is_bound()) { + const double* rgb = &vertex_color[v*3]; + for(index_t coord = 0; coord < 3; coord++) { + ply_write(oply, Numeric::uint8(255.0*rgb[coord])); + } + } } if(ioflags.has_element(MESH_FACETS)) { @@ -4168,6 +4191,370 @@ namespace GEO { } }; + +/****************************************************************************/ + + const index_t id_offset_msh = 1; + const index_t msh2geo_hex[8] = {1, 3, 7, 5, 0, 2, 6, 4 }; + const index_t msh2geo_def[8] = {0, 1, 2, 3, 4, 5, 6, 7 }; + const index_t celltype_geo2msh[5] = {4, 5, 6, 7}; + + /** + * \brief Support for GMSH file format. + * \details By Maxence Reberol. + */ + class GEOGRAM_API MSHIOHandler : public MeshIOHandler { + public: + MSHIOHandler() { + } + + bool verify_file_format(const std::string& filename) { + LineInput in(filename); + if (!in.OK()) return false; + in.get_line(); + in.get_fields(); + if (in.field_matches(0, "$MeshFormat")) { + in.get_line(); + in.get_fields(); + if (in.field_as_double(0) == 2.2 + && in.field_as_uint(1) == 0 + && in.field_as_uint(2) == 8 + ) return true; + } + return false; + } + + bool read_vertices(const std::string& filename, Mesh& M) { + LineInput in(filename); + while (in.get_line()) { + in.get_fields(); + if (in.field_matches(0, "$Nodes")) { + in.get_line(); + in.get_fields(); + geo_assert(in.nb_fields() == 1); + M.vertices.create_vertices(in.field_as_uint(0)); + for (index_t v = 0; v < M.vertices.nb(); ++v){ + in.get_line(); + in.get_fields(); + geo_assert(in.nb_fields() == 4); + double pt[4] = { + in.field_as_double(1), + in.field_as_double(2), + in.field_as_double(3) + }; + set_mesh_point(M, v, pt, 3); + } + } else if (in.field_matches(0, "$EndNodes")) { + return true; + } + } + return false; + } + bool read_elements(const std::string& filename, Mesh& M) { + index_t nb_elements = 0; + index_t nb_edges = 0; + index_t nb_tri = 0; + index_t nb_quad = 0; + index_t nb_tet = 0; + index_t nb_hex = 0; + index_t nb_pyr = 0; + index_t nb_pri = 0; + index_t nb_oth = 0; + { /* First pass to get the number of each element type */ + LineInput in(filename); + while (in.get_line()) { + in.get_fields(); + if (in.field_matches(0, "$Elements")) { + in.get_line(); + in.get_fields(); + geo_assert(in.nb_fields() == 1); + nb_elements = in.field_as_uint(0); + for (index_t e = 0; e < nb_elements; ++e){ + in.get_line(); + in.get_fields(); + if (in.field_as_uint(1) == 1) nb_edges += 1; + else if (in.field_as_uint(1) == 2) nb_tri += 1; + else if (in.field_as_uint(1) == 3) nb_quad += 1; + else if (in.field_as_uint(1) == 4) nb_tet += 1; + else if (in.field_as_uint(1) == 5) nb_hex += 1; + else if (in.field_as_uint(1) == 6) nb_pri += 1; + else if (in.field_as_uint(1) == 7) nb_pyr += 1; + else { nb_oth += 1; } + } + if (nb_oth > 0) { + Logger::warn("I/O") + << nb_oth + << " elements with type unsupported" + << std::endl; + } + } + } + M.edges.create_edges(nb_edges); + M.facets.create_triangles(nb_tri); + M.facets.create_quads(nb_quad); + M.cells.create_tets(nb_tet); + M.cells.create_hexes(nb_hex); + M.cells.create_pyramids(nb_pyr); + M.cells.create_prisms(nb_pri); + } + { /* Second pass to fill the content of the mesh */ + /* Re-use the number of elts as counters */ + nb_edges = 0; + index_t nb_facets = 0; + index_t nb_cells = 0; + LineInput in(filename); + while (in.get_line()) { + in.get_fields(); + if (in.field_matches(0, "$Elements")) { + in.get_line(); + in.get_fields(); + geo_assert(in.field_as_uint(0) == nb_elements); + for (index_t e = 0; e < nb_elements; ++e){ + in.get_line(); + in.get_fields(); + index_t nb_tags = in.field_as_uint(2); + index_t offset = 3 + nb_tags; + if (in.field_as_uint(1) == 1) { + index_t nbv = 2; + geo_debug_assert( + in.nb_fields() == offset + nbv + ); + for (index_t j = 0; j < nbv; ++j) { + M.edges.set_vertex( + nb_edges, j, + in.field_as_uint(offset + j) - 1 + ); + } + nb_edges += 1; + } else if (in.field_as_uint(1) == 2) { + index_t nbv = 3; + geo_debug_assert( + in.nb_fields() == offset + nbv + ); + for (index_t j = 0; j < nbv; ++j) { + M.facets.set_vertex( + nb_facets, j, + in.field_as_uint(offset + j) - 1 + ); + } + nb_facets += 1; + } else if (in.field_as_uint(1) == 3) { + index_t nbv = 4; + geo_debug_assert( + in.nb_fields() == offset + nbv + ); + for (index_t j = 0; j < nbv; ++j) { + M.facets.set_vertex( + nb_facets, j, + in.field_as_uint(offset + j) - 1 + ); + } + nb_facets += 1; + } else if (in.field_as_uint(1) == 4) { + index_t nbv = 4; + geo_debug_assert( + in.nb_fields() == offset + nbv + ); + for (index_t j = 0; j < nbv; ++j) { + M.cells.set_vertex( + nb_cells, j, + in.field_as_uint(offset + j) - 1 + ); + } + nb_cells += 1; + } else if (in.field_as_uint(1) == 5) { + index_t nbv = 8; + geo_debug_assert( + in.nb_fields() == offset + nbv + ); + for (index_t j = 0; j < nbv; ++j) { + M.cells.set_vertex( + nb_cells, msh2geo_hex[j], + in.field_as_uint(offset + j) - 1 + ); + } + nb_cells += 1; + } else if (in.field_as_uint(1) == 6) { + index_t nbv = 6; + geo_debug_assert( + in.nb_fields() == offset + nbv + ); + for (index_t j = 0; j < nbv; ++j) { + M.cells.set_vertex( + nb_cells, j, + in.field_as_uint(offset + j) - 1 + ); + } + nb_cells += 1; + } else if (in.field_as_uint(1) == 7) { + index_t nbv = 5; + geo_debug_assert( + in.nb_fields() == offset + nbv + ); + for (index_t j = 0; j < nbv; ++j) { + M.cells.set_vertex( + nb_cells, j, + in.field_as_uint(offset + j) - 1 + ); + } + nb_cells += 1; + } + } + } + } + } + return true; + } + + virtual bool load( + const std::string& filename, Mesh& M, + const MeshIOFlags& ioflags + ) { + geo_argused(ioflags); + M.clear(); + M.vertices.set_dimension(3); + try { + if (!verify_file_format(filename)) { + Logger::err("I/O") + << "$MeshFormat not supported" << std::endl; + return false; + } + if (!read_vertices(filename, M)) { + Logger::err("I/O") + << "failed to read vertices" << std::endl; + return false; + } + if (!read_elements(filename, M)) { + Logger::err("I/O") + << "failed to read elements" << std::endl; + return false; + } + } catch(const std::string& what) { + Logger::err("I/O") << what << std::endl; + return false; + } catch(const std::exception& ex) { + Logger::err("I/O") << ex.what() << std::endl; + return false; + } catch(...) { + Logger::err("I/O") << "Caught exception" << std::endl; + return false; + } + return true; + } + + virtual bool save( + const Mesh& M_in, const std::string& filename, + const MeshIOFlags& ioflags + ) { + + Mesh M(M_in.vertices.dimension()); + M.copy(M_in, true); + + M.vertices.remove_isolated(); + + Attribute region; + Attribute bdr_region; + if (M.cells.attributes().is_defined("region")) { + region.bind(M.cells.attributes(), "region"); + } + if (M.facets.attributes().is_defined("bdr_region")) { + bdr_region.bind(M.facets.attributes(), "bdr_region"); + } + + std::ofstream out( filename.c_str() ) ; + out.precision( 16 ) ; + + /* Header */ + out << "$MeshFormat\n"; + out << "2.2 0 " << sizeof(double) << std::endl; + out << "$EndMeshFormat\n"; + + /* Vertices */ + out << "$Nodes" << std::endl ; + out << M.vertices.nb() << std::endl ; + for( index_t v = 0; v < M.vertices.nb(); v++ ) { + out << v + id_offset_msh << " " + << M.vertices.point_ptr(v)[0] << " " + << M.vertices.point_ptr(v)[1] << " " + << M.vertices.point_ptr(v)[2] << '\n' ; + } + out << "$EndNodes" << std::endl ; + + /* Elements */ + index_t nb_tet = 0; + index_t nb_hex = 0; + index_t nb_pyr = 0; + index_t nb_pri = 0; + for(index_t c = 0; c != M.cells.nb(); ++c){ + if(M.cells.type(c) == GEO::MESH_TET){ + ++nb_tet; + } else if(M.cells.type(c) == GEO::MESH_HEX){ + ++nb_hex; + } else if(M.cells.type(c) == GEO::MESH_PYRAMID){ + ++nb_pyr; + } else if(M.cells.type(c) == GEO::MESH_PRISM){ + ++nb_pri; + } + } + index_t nb_elt = nb_tet + nb_hex + nb_pyr + nb_pri; + if (ioflags.has_element(MESH_FACETS)) nb_elt += M.facets.nb(); + + out << "$Elements" << std::endl ; + out << nb_elt << std::endl ; + index_t elt_id = 0; /* starts at 1, common for faces and cells */ + if (ioflags.has_element(MESH_FACETS)) { + for (index_t f = 0; f < M.facets.nb(); ++f) { + int attr_value = 0; + if (bdr_region.is_bound()){ + attr_value = bdr_region[f]; + } + int type = -1; + if (M.facets.nb_vertices(f) == 3) { + type = 2; + } else if (M.facets.nb_vertices(f) == 4) { + type = 3; + } else { + geo_assert_not_reached + } + elt_id += 1; + out << elt_id << " " << type << " " << "2" << " " + << attr_value << " " << attr_value << " "; + for (index_t li = 0; li < M.facets.nb_vertices(f); ++li) { + out << M.facets.vertex(f, li) + id_offset_msh << " "; + } + out << std::endl; + } + } + for (index_t c = 0; c < M.cells.nb(); ++c) { + if (M.cells.type(c) == GEO::MESH_CONNECTOR) { + continue; + } + int attr_value = 0; + if (region.is_bound()) attr_value = region[c]; + const index_t* msh2geo = + (M.cells.type(c) == GEO::MESH_HEX) ? + msh2geo_hex : msh2geo_def; + elt_id += 1; + + /* Write to file, format is: + * elm-number elm-type number-of-tags < tag > ... + * node-number-list + */ + out << elt_id << " " << celltype_geo2msh[M.cells.type(c)] + << " " << "1" << " " << attr_value << " "; + for (index_t li = 0; li < M.cells.nb_vertices(c); ++li) { + out << M.cells.vertex(c, msh2geo[li]) + id_offset_msh + << " "; + } + out << std::endl; + } + out << "$EndElements" << std::endl; + + out.close(); + return true; + } + }; + } /****************************************************************************/ @@ -4356,6 +4743,7 @@ namespace GEO { geo_register_MeshIOHandler_creator(PDBIOHandler, "pdb"); geo_register_MeshIOHandler_creator(PDBIOHandler, "pdb1"); geo_register_MeshIOHandler_creator(OVMIOHandler, "ovm"); + geo_register_MeshIOHandler_creator(MSHIOHandler, "msh"); } diff --git a/src/lib/geogram/mesh/mesh_manifold_harmonics.cpp b/src/lib/geogram/mesh/mesh_manifold_harmonics.cpp old mode 100755 new mode 100644 index 113df2c1..380c5fbb --- a/src/lib/geogram/mesh/mesh_manifold_harmonics.cpp +++ b/src/lib/geogram/mesh/mesh_manifold_harmonics.cpp @@ -205,7 +205,8 @@ namespace GEO { Mesh& M, index_t nb_eigens, LaplaceBeltramiDiscretization discretization, const std::string& attribute_name, - double shift + double shift, + bool print_spectrum ) { geo_cite("DBLP:conf/smi/Levy06"); @@ -270,8 +271,10 @@ namespace GEO { nlEigenSolve(); - for(index_t i=0; i +#include +#include +#include +#include + + +/* +** This file uses only the official API of Lua. +** Any function declared here could be written as an application function. +*/ + +#include "lua.h" + +#include "lauxlib.h" + + +/* +** {====================================================== +** Traceback +** ======================================================= +*/ + + +#define LEVELS1 10 /* size of the first part of the stack */ +#define LEVELS2 11 /* size of the second part of the stack */ + + + +/* +** search for 'objidx' in table at index -1. +** return 1 + string at top if find a good name. +*/ +static int findfield (lua_State *L, int objidx, int level) { + if (level == 0 || !lua_istable(L, -1)) + return 0; /* not found */ + lua_pushnil(L); /* start 'next' loop */ + while (lua_next(L, -2)) { /* for each pair in table */ + if (lua_type(L, -2) == LUA_TSTRING) { /* ignore non-string keys */ + if (lua_rawequal(L, objidx, -1)) { /* found object? */ + lua_pop(L, 1); /* remove value (but keep name) */ + return 1; + } + else if (findfield(L, objidx, level - 1)) { /* try recursively */ + lua_remove(L, -2); /* remove table (but keep name) */ + lua_pushliteral(L, "."); + lua_insert(L, -2); /* place '.' between the two names */ + lua_concat(L, 3); + return 1; + } + } + lua_pop(L, 1); /* remove value */ + } + return 0; /* not found */ +} + + +/* +** Search for a name for a function in all loaded modules +** (registry._LOADED). +*/ +static int pushglobalfuncname (lua_State *L, lua_Debug *ar) { + int top = lua_gettop(L); + lua_getinfo(L, "f", ar); /* push function */ + lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); + if (findfield(L, top + 1, 2)) { + const char *name = lua_tostring(L, -1); + if (strncmp(name, "_G.", 3) == 0) { /* name start with '_G.'? */ + lua_pushstring(L, name + 3); /* push name without prefix */ + lua_remove(L, -2); /* remove original name */ + } + lua_copy(L, -1, top + 1); /* move name to proper place */ + lua_pop(L, 2); /* remove pushed values */ + return 1; + } + else { + lua_settop(L, top); /* remove function and global table */ + return 0; + } +} + + +static void pushfuncname (lua_State *L, lua_Debug *ar) { + if (pushglobalfuncname(L, ar)) { /* try first a global name */ + lua_pushfstring(L, "function '%s'", lua_tostring(L, -1)); + lua_remove(L, -2); /* remove name */ + } + else if (*ar->namewhat != '\0') /* is there a name from code? */ + lua_pushfstring(L, "%s '%s'", ar->namewhat, ar->name); /* use it */ + else if (*ar->what == 'm') /* main? */ + lua_pushliteral(L, "main chunk"); + else if (*ar->what != 'C') /* for Lua functions, use */ + lua_pushfstring(L, "function <%s:%d>", ar->short_src, ar->linedefined); + else /* nothing left... */ + lua_pushliteral(L, "?"); +} + + +static int lastlevel (lua_State *L) { + lua_Debug ar; + int li = 1, le = 1; + /* find an upper bound */ + while (lua_getstack(L, le, &ar)) { li = le; le *= 2; } + /* do a binary search */ + while (li < le) { + int m = (li + le)/2; + if (lua_getstack(L, m, &ar)) li = m + 1; + else le = m; + } + return le - 1; +} + + +LUALIB_API void luaL_traceback (lua_State *L, lua_State *L1, + const char *msg, int level) { + lua_Debug ar; + int top = lua_gettop(L); + int last = lastlevel(L1); + int n1 = (last - level > LEVELS1 + LEVELS2) ? LEVELS1 : -1; + if (msg) + lua_pushfstring(L, "%s\n", msg); + luaL_checkstack(L, 10, NULL); + lua_pushliteral(L, "stack traceback:"); + while (lua_getstack(L1, level++, &ar)) { + if (n1-- == 0) { /* too many levels? */ + lua_pushliteral(L, "\n\t..."); /* add a '...' */ + level = last - LEVELS2 + 1; /* and skip to last ones */ + } + else { + lua_getinfo(L1, "Slnt", &ar); + lua_pushfstring(L, "\n\t%s:", ar.short_src); + if (ar.currentline > 0) + lua_pushfstring(L, "%d:", ar.currentline); + lua_pushliteral(L, " in "); + pushfuncname(L, &ar); + if (ar.istailcall) + lua_pushliteral(L, "\n\t(...tail calls...)"); + lua_concat(L, lua_gettop(L) - top); + } + } + lua_concat(L, lua_gettop(L) - top); +} + +/* }====================================================== */ + + +/* +** {====================================================== +** Error-report functions +** ======================================================= +*/ + +LUALIB_API int luaL_argerror (lua_State *L, int arg, const char *extramsg) { + lua_Debug ar; + if (!lua_getstack(L, 0, &ar)) /* no stack frame? */ + return luaL_error(L, "bad argument #%d (%s)", arg, extramsg); + lua_getinfo(L, "n", &ar); + if (strcmp(ar.namewhat, "method") == 0) { + arg--; /* do not count 'self' */ + if (arg == 0) /* error is in the self argument itself? */ + return luaL_error(L, "calling '%s' on bad self (%s)", + ar.name, extramsg); + } + if (ar.name == NULL) + ar.name = (pushglobalfuncname(L, &ar)) ? lua_tostring(L, -1) : "?"; + return luaL_error(L, "bad argument #%d to '%s' (%s)", + arg, ar.name, extramsg); +} + + +static int typeerror (lua_State *L, int arg, const char *tname) { + const char *msg; + const char *typearg; /* name for the type of the actual argument */ + if (luaL_getmetafield(L, arg, "__name") == LUA_TSTRING) + typearg = lua_tostring(L, -1); /* use the given type name */ + else if (lua_type(L, arg) == LUA_TLIGHTUSERDATA) + typearg = "light userdata"; /* special name for messages */ + else + typearg = luaL_typename(L, arg); /* standard name */ + msg = lua_pushfstring(L, "%s expected, got %s", tname, typearg); + return luaL_argerror(L, arg, msg); +} + + +static void tag_error (lua_State *L, int arg, int tag) { + typeerror(L, arg, lua_typename(L, tag)); +} + + +/* +** The use of 'lua_pushfstring' ensures this function does not +** need reserved stack space when called. +*/ +LUALIB_API void luaL_where (lua_State *L, int level) { + lua_Debug ar; + if (lua_getstack(L, level, &ar)) { /* check function at level */ + lua_getinfo(L, "Sl", &ar); /* get info about it */ + if (ar.currentline > 0) { /* is there info? */ + lua_pushfstring(L, "%s:%d: ", ar.short_src, ar.currentline); + return; + } + } + lua_pushfstring(L, ""); /* else, no information available... */ +} + + +static void stackDump (lua_State *L) { + int i=lua_gettop(L); + printf(" ---------------- Stack Dump ----------------" ); + while( i ) + { + int t = lua_type(L, i); + switch (t) + { + + case LUA_TSTRING: + printf("%d:%s'", i, lua_tostring(L, i)); + break; + case LUA_TBOOLEAN: + printf("%d: %s",i,lua_toboolean(L, i) ? "true" : "false"); + break; + case LUA_TNUMBER: + printf("%d: %g", i, lua_tonumber(L, i)); + break; + default: printf("%d: %s", i, lua_typename(L, t)); break; + } + + i--; + } + + printf("--------------- Stack Dump Finished ---------------" ); +} + + +/* +** Again, the use of 'lua_pushvfstring' ensures this function does +** not need reserved stack space when called. (At worst, it generates +** an error with "stack overflow" instead of the given message.) +*/ +LUALIB_API int luaL_error (lua_State *L, const char *fmt, ...) { + stackDump(L); + va_list argp; + va_start(argp, fmt); + luaL_where(L, 1); + lua_pushvfstring(L, fmt, argp); + va_end(argp); + lua_concat(L, 2); + return lua_error(L); +} + + +LUALIB_API int luaL_fileresult (lua_State *L, int stat, const char *fname) { + int en = errno; /* calls to Lua API may change this value */ + if (stat) { + lua_pushboolean(L, 1); + return 1; + } + else { + lua_pushnil(L); + if (fname) + lua_pushfstring(L, "%s: %s", fname, strerror(en)); + else + lua_pushstring(L, strerror(en)); + lua_pushinteger(L, en); + return 3; + } +} + + +#if !defined(l_inspectstat) /* { */ + +#if defined(LUA_USE_POSIX) + +#include + +/* +** use appropriate macros to interpret 'pclose' return status +*/ +#define l_inspectstat(stat,what) \ + if (WIFEXITED(stat)) { stat = WEXITSTATUS(stat); } \ + else if (WIFSIGNALED(stat)) { stat = WTERMSIG(stat); what = "signal"; } + +#else + +#define l_inspectstat(stat,what) /* no op */ + +#endif + +#endif /* } */ + + +LUALIB_API int luaL_execresult (lua_State *L, int stat) { + const char *what = "exit"; /* type of termination */ + if (stat == -1) /* error? */ + return luaL_fileresult(L, 0, NULL); + else { + l_inspectstat(stat, what); /* interpret result */ + if (*what == 'e' && stat == 0) /* successful termination? */ + lua_pushboolean(L, 1); + else + lua_pushnil(L); + lua_pushstring(L, what); + lua_pushinteger(L, stat); + return 3; /* return true/nil,what,code */ + } +} + +/* }====================================================== */ + + +/* +** {====================================================== +** Userdata's metatable manipulation +** ======================================================= +*/ + +LUALIB_API int luaL_newmetatable (lua_State *L, const char *tname) { + if (luaL_getmetatable(L, tname) != LUA_TNIL) /* name already in use? */ + return 0; /* leave previous value on top, but return 0 */ + lua_pop(L, 1); + lua_createtable(L, 0, 2); /* create metatable */ + lua_pushstring(L, tname); + lua_setfield(L, -2, "__name"); /* metatable.__name = tname */ + lua_pushvalue(L, -1); + lua_setfield(L, LUA_REGISTRYINDEX, tname); /* registry.name = metatable */ + return 1; +} + + +LUALIB_API void luaL_setmetatable (lua_State *L, const char *tname) { + luaL_getmetatable(L, tname); + lua_setmetatable(L, -2); +} + + +LUALIB_API void *luaL_testudata (lua_State *L, int ud, const char *tname) { + void *p = lua_touserdata(L, ud); + if (p != NULL) { /* value is a userdata? */ + if (lua_getmetatable(L, ud)) { /* does it have a metatable? */ + luaL_getmetatable(L, tname); /* get correct metatable */ + if (!lua_rawequal(L, -1, -2)) /* not the same? */ + p = NULL; /* value is a userdata with wrong metatable */ + lua_pop(L, 2); /* remove both metatables */ + return p; + } + } + return NULL; /* value is not a userdata with a metatable */ +} + + +LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) { + void *p = luaL_testudata(L, ud, tname); + if (p == NULL) typeerror(L, ud, tname); + return p; +} + +/* }====================================================== */ + + +/* +** {====================================================== +** Argument check functions +** ======================================================= +*/ + +LUALIB_API int luaL_checkoption (lua_State *L, int arg, const char *def, + const char *const lst[]) { + const char *name = (def) ? luaL_optstring(L, arg, def) : + luaL_checkstring(L, arg); + int i; + for (i=0; lst[i]; i++) + if (strcmp(lst[i], name) == 0) + return i; + return luaL_argerror(L, arg, + lua_pushfstring(L, "invalid option '%s'", name)); +} + + +/* +** Ensures the stack has at least 'space' extra slots, raising an error +** if it cannot fulfill the request. (The error handling needs a few +** extra slots to format the error message. In case of an error without +** this extra space, Lua will generate the same 'stack overflow' error, +** but without 'msg'.) +*/ +LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *msg) { + if (!lua_checkstack(L, space)) { + if (msg) + luaL_error(L, "stack overflow (%s)", msg); + else + luaL_error(L, "stack overflow"); + } +} + + +LUALIB_API void luaL_checktype (lua_State *L, int arg, int t) { + if (lua_type(L, arg) != t) + tag_error(L, arg, t); +} + + +LUALIB_API void luaL_checkany (lua_State *L, int arg) { + if (lua_type(L, arg) == LUA_TNONE) + luaL_argerror(L, arg, "value expected"); +} + + +LUALIB_API const char *luaL_checklstring (lua_State *L, int arg, size_t *len) { + const char *s = lua_tolstring(L, arg, len); + if (!s) tag_error(L, arg, LUA_TSTRING); + return s; +} + + +LUALIB_API const char *luaL_optlstring (lua_State *L, int arg, + const char *def, size_t *len) { + if (lua_isnoneornil(L, arg)) { + if (len) + *len = (def ? strlen(def) : 0); + return def; + } + else return luaL_checklstring(L, arg, len); +} + + +LUALIB_API lua_Number luaL_checknumber (lua_State *L, int arg) { + int isnum; + lua_Number d = lua_tonumberx(L, arg, &isnum); + if (!isnum) + tag_error(L, arg, LUA_TNUMBER); + return d; +} + + +LUALIB_API lua_Number luaL_optnumber (lua_State *L, int arg, lua_Number def) { + return luaL_opt(L, luaL_checknumber, arg, def); +} + + +static void interror (lua_State *L, int arg) { + if (lua_isnumber(L, arg)) + luaL_argerror(L, arg, "number has no integer representation"); + else + tag_error(L, arg, LUA_TNUMBER); +} + + +LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int arg) { + int isnum; + lua_Integer d = lua_tointegerx(L, arg, &isnum); + if (!isnum) { + interror(L, arg); + } + return d; +} + + +LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int arg, + lua_Integer def) { + return luaL_opt(L, luaL_checkinteger, arg, def); +} + +/* }====================================================== */ + + +/* +** {====================================================== +** Generic Buffer manipulation +** ======================================================= +*/ + +/* userdata to box arbitrary data */ +typedef struct UBox { + void *box; + size_t bsize; +} UBox; + + +static void *resizebox (lua_State *L, int idx, size_t newsize) { + void *ud; + lua_Alloc allocf = lua_getallocf(L, &ud); + UBox *box = (UBox *)lua_touserdata(L, idx); + void *temp = allocf(ud, box->box, box->bsize, newsize); + if (temp == NULL && newsize > 0) { /* allocation error? */ + resizebox(L, idx, 0); /* free buffer */ + luaL_error(L, "not enough memory for buffer allocation"); + } + box->box = temp; + box->bsize = newsize; + return temp; +} + + +static int boxgc (lua_State *L) { + resizebox(L, 1, 0); + return 0; +} + + +static void *newbox (lua_State *L, size_t newsize) { + UBox *box = (UBox *)lua_newuserdata(L, sizeof(UBox)); + box->box = NULL; + box->bsize = 0; + if (luaL_newmetatable(L, "LUABOX")) { /* creating metatable? */ + lua_pushcfunction(L, boxgc); + lua_setfield(L, -2, "__gc"); /* metatable.__gc = boxgc */ + } + lua_setmetatable(L, -2); + return resizebox(L, -1, newsize); +} + + +/* +** check whether buffer is using a userdata on the stack as a temporary +** buffer +*/ +#define buffonstack(B) ((B)->b != (B)->initb) + + +/* +** returns a pointer to a free area with at least 'sz' bytes +*/ +LUALIB_API char *luaL_prepbuffsize (luaL_Buffer *B, size_t sz) { + lua_State *L = B->L; + if (B->size - B->n < sz) { /* not enough space? */ + char *newbuff; + size_t newsize = B->size * 2; /* double buffer size */ + if (newsize - B->n < sz) /* not big enough? */ + newsize = B->n + sz; + if (newsize < B->n || newsize - B->n < sz) + luaL_error(L, "buffer too large"); + /* create larger buffer */ + if (buffonstack(B)) + newbuff = (char *)resizebox(L, -1, newsize); + else { /* no buffer yet */ + newbuff = (char *)newbox(L, newsize); + memcpy(newbuff, B->b, B->n * sizeof(char)); /* copy original content */ + } + B->b = newbuff; + B->size = newsize; + } + return &B->b[B->n]; +} + + +LUALIB_API void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l) { + if (l > 0) { /* avoid 'memcpy' when 's' can be NULL */ + char *b = luaL_prepbuffsize(B, l); + memcpy(b, s, l * sizeof(char)); + luaL_addsize(B, l); + } +} + + +LUALIB_API void luaL_addstring (luaL_Buffer *B, const char *s) { + luaL_addlstring(B, s, strlen(s)); +} + + +LUALIB_API void luaL_pushresult (luaL_Buffer *B) { + lua_State *L = B->L; + lua_pushlstring(L, B->b, B->n); + if (buffonstack(B)) { + resizebox(L, -2, 0); /* delete old buffer */ + lua_remove(L, -2); /* remove its header from the stack */ + } +} + + +LUALIB_API void luaL_pushresultsize (luaL_Buffer *B, size_t sz) { + luaL_addsize(B, sz); + luaL_pushresult(B); +} + + +LUALIB_API void luaL_addvalue (luaL_Buffer *B) { + lua_State *L = B->L; + size_t l; + const char *s = lua_tolstring(L, -1, &l); + if (buffonstack(B)) + lua_insert(L, -2); /* put value below buffer */ + luaL_addlstring(B, s, l); + lua_remove(L, (buffonstack(B)) ? -2 : -1); /* remove value */ +} + + +LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B) { + B->L = L; + B->b = B->initb; + B->n = 0; + B->size = LUAL_BUFFERSIZE; +} + + +LUALIB_API char *luaL_buffinitsize (lua_State *L, luaL_Buffer *B, size_t sz) { + luaL_buffinit(L, B); + return luaL_prepbuffsize(B, sz); +} + +/* }====================================================== */ + + +/* +** {====================================================== +** Reference system +** ======================================================= +*/ + +/* index of free-list header */ +#define freelist 0 + + +LUALIB_API int luaL_ref (lua_State *L, int t) { + int ref; + if (lua_isnil(L, -1)) { + lua_pop(L, 1); /* remove from stack */ + return LUA_REFNIL; /* 'nil' has a unique fixed reference */ + } + t = lua_absindex(L, t); + lua_rawgeti(L, t, freelist); /* get first free element */ + ref = (int)lua_tointeger(L, -1); /* ref = t[freelist] */ + lua_pop(L, 1); /* remove it from stack */ + if (ref != 0) { /* any free element? */ + lua_rawgeti(L, t, ref); /* remove it from list */ + lua_rawseti(L, t, freelist); /* (t[freelist] = t[ref]) */ + } + else /* no free elements */ + ref = (int)lua_rawlen(L, t) + 1; /* get a new reference */ + lua_rawseti(L, t, ref); + return ref; +} + + +LUALIB_API void luaL_unref (lua_State *L, int t, int ref) { + if (ref >= 0) { + t = lua_absindex(L, t); + lua_rawgeti(L, t, freelist); + lua_rawseti(L, t, ref); /* t[ref] = t[freelist] */ + lua_pushinteger(L, ref); + lua_rawseti(L, t, freelist); /* t[freelist] = ref */ + } +} + +/* }====================================================== */ + + +/* +** {====================================================== +** Load functions +** ======================================================= +*/ + +typedef struct LoadF { + int n; /* number of pre-read characters */ + FILE *f; /* file being read */ + char buff[BUFSIZ]; /* area for reading file */ +} LoadF; + + +static const char *getF (lua_State *L, void *ud, size_t *size) { + LoadF *lf = (LoadF *)ud; + (void)L; /* not used */ + if (lf->n > 0) { /* are there pre-read characters to be read? */ + *size = lf->n; /* return them (chars already in buffer) */ + lf->n = 0; /* no more pre-read characters */ + } + else { /* read a block from file */ + /* 'fread' can return > 0 *and* set the EOF flag. If next call to + 'getF' called 'fread', it might still wait for user input. + The next check avoids this problem. */ + if (feof(lf->f)) return NULL; + *size = fread(lf->buff, 1, sizeof(lf->buff), lf->f); /* read block */ + } + return lf->buff; +} + + +static int errfile (lua_State *L, const char *what, int fnameindex) { + const char *serr = strerror(errno); + const char *filename = lua_tostring(L, fnameindex) + 1; + lua_pushfstring(L, "cannot %s %s: %s", what, filename, serr); + lua_remove(L, fnameindex); + return LUA_ERRFILE; +} + + +static int skipBOM (LoadF *lf) { + const char *p = "\xEF\xBB\xBF"; /* UTF-8 BOM mark */ + int c; + lf->n = 0; + do { + c = getc(lf->f); + if (c == EOF || c != *(const unsigned char *)p++) return c; + lf->buff[lf->n++] = c; /* to be read by the parser */ + } while (*p != '\0'); + lf->n = 0; /* prefix matched; discard it */ + return getc(lf->f); /* return next character */ +} + + +/* +** reads the first character of file 'f' and skips an optional BOM mark +** in its beginning plus its first line if it starts with '#'. Returns +** true if it skipped the first line. In any case, '*cp' has the +** first "valid" character of the file (after the optional BOM and +** a first-line comment). +*/ +static int skipcomment (LoadF *lf, int *cp) { + int c = *cp = skipBOM(lf); + if (c == '#') { /* first line is a comment (Unix exec. file)? */ + do { /* skip first line */ + c = getc(lf->f); + } while (c != EOF && c != '\n'); + *cp = getc(lf->f); /* skip end-of-line, if present */ + return 1; /* there was a comment */ + } + else return 0; /* no comment */ +} + + +LUALIB_API int luaL_loadfilex (lua_State *L, const char *filename, + const char *mode) { + LoadF lf; + int status, readstatus; + int c; + int fnameindex = lua_gettop(L) + 1; /* index of filename on the stack */ + if (filename == NULL) { + lua_pushliteral(L, "=stdin"); + lf.f = stdin; + } + else { + lua_pushfstring(L, "@%s", filename); + lf.f = fopen(filename, "r"); + if (lf.f == NULL) return errfile(L, "open", fnameindex); + } + if (skipcomment(&lf, &c)) /* read initial portion */ + lf.buff[lf.n++] = '\n'; /* add line to correct line numbers */ + if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */ + lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */ + if (lf.f == NULL) return errfile(L, "reopen", fnameindex); + skipcomment(&lf, &c); /* re-read initial portion */ + } + if (c != EOF) + lf.buff[lf.n++] = c; /* 'c' is the first character of the stream */ + status = lua_load(L, getF, &lf, lua_tostring(L, -1), mode); + readstatus = ferror(lf.f); + if (filename) fclose(lf.f); /* close file (even in case of errors) */ + if (readstatus) { + lua_settop(L, fnameindex); /* ignore results from 'lua_load' */ + return errfile(L, "read", fnameindex); + } + lua_remove(L, fnameindex); + return status; +} + + +typedef struct LoadS { + const char *s; + size_t size; +} LoadS; + + +static const char *getS (lua_State *L, void *ud, size_t *size) { + LoadS *ls = (LoadS *)ud; + (void)L; /* not used */ + if (ls->size == 0) return NULL; + *size = ls->size; + ls->size = 0; + return ls->s; +} + + +LUALIB_API int luaL_loadbufferx (lua_State *L, const char *buff, size_t size, + const char *name, const char *mode) { + LoadS ls; + ls.s = buff; + ls.size = size; + return lua_load(L, getS, &ls, name, mode); +} + + +LUALIB_API int luaL_loadstring (lua_State *L, const char *s) { + return luaL_loadbuffer(L, s, strlen(s), s); +} + +/* }====================================================== */ + + + +LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) { + if (!lua_getmetatable(L, obj)) /* no metatable? */ + return LUA_TNIL; + else { + int tt; + lua_pushstring(L, event); + tt = lua_rawget(L, -2); + if (tt == LUA_TNIL) /* is metafield nil? */ + lua_pop(L, 2); /* remove metatable and metafield */ + else + lua_remove(L, -2); /* remove only metatable */ + return tt; /* return metafield type */ + } +} + + +LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) { + obj = lua_absindex(L, obj); + if (luaL_getmetafield(L, obj, event) == LUA_TNIL) /* no metafield? */ + return 0; + lua_pushvalue(L, obj); + lua_call(L, 1, 1); + return 1; +} + + +LUALIB_API lua_Integer luaL_len (lua_State *L, int idx) { + lua_Integer l; + int isnum; + lua_len(L, idx); + l = lua_tointegerx(L, -1, &isnum); + if (!isnum) + luaL_error(L, "object length is not an integer"); + lua_pop(L, 1); /* remove object */ + return l; +} + + +LUALIB_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len) { + if (!luaL_callmeta(L, idx, "__tostring")) { /* no metafield? */ + switch (lua_type(L, idx)) { + case LUA_TNUMBER: { + if (lua_isinteger(L, idx)) + lua_pushfstring(L, "%I", lua_tointeger(L, idx)); + else + lua_pushfstring(L, "%f", lua_tonumber(L, idx)); + break; + } + case LUA_TSTRING: + lua_pushvalue(L, idx); + break; + case LUA_TBOOLEAN: + lua_pushstring(L, (lua_toboolean(L, idx) ? "true" : "false")); + break; + case LUA_TNIL: + lua_pushliteral(L, "nil"); + break; + default: + lua_pushfstring(L, "%s: %p", luaL_typename(L, idx), + lua_topointer(L, idx)); + break; + } + } + return lua_tolstring(L, -1, len); +} + + +/* +** {====================================================== +** Compatibility with 5.1 module functions +** ======================================================= +*/ +#if defined(LUA_COMPAT_MODULE) + +static const char *luaL_findtable (lua_State *L, int idx, + const char *fname, int szhint) { + const char *e; + if (idx) lua_pushvalue(L, idx); + do { + e = strchr(fname, '.'); + if (e == NULL) e = fname + strlen(fname); + lua_pushlstring(L, fname, e - fname); + if (lua_rawget(L, -2) == LUA_TNIL) { /* no such field? */ + lua_pop(L, 1); /* remove this nil */ + lua_createtable(L, 0, (*e == '.' ? 1 : szhint)); /* new table for field */ + lua_pushlstring(L, fname, e - fname); + lua_pushvalue(L, -2); + lua_settable(L, -4); /* set new table into field */ + } + else if (!lua_istable(L, -1)) { /* field has a non-table value? */ + lua_pop(L, 2); /* remove table and value */ + return fname; /* return problematic part of the name */ + } + lua_remove(L, -2); /* remove previous table */ + fname = e + 1; + } while (*e == '.'); + return NULL; +} + + +/* +** Count number of elements in a luaL_Reg list. +*/ +static int libsize (const luaL_Reg *l) { + int size = 0; + for (; l && l->name; l++) size++; + return size; +} + + +/* +** Find or create a module table with a given name. The function +** first looks at the _LOADED table and, if that fails, try a +** global variable with that name. In any case, leaves on the stack +** the module table. +*/ +LUALIB_API void luaL_pushmodule (lua_State *L, const char *modname, + int sizehint) { + luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 1); /* get _LOADED table */ + if (lua_getfield(L, -1, modname) != LUA_TTABLE) { /* no _LOADED[modname]? */ + lua_pop(L, 1); /* remove previous result */ + /* try global variable (and create one if it does not exist) */ + lua_pushglobaltable(L); + if (luaL_findtable(L, 0, modname, sizehint) != NULL) + luaL_error(L, "name conflict for module '%s'", modname); + lua_pushvalue(L, -1); + lua_setfield(L, -3, modname); /* _LOADED[modname] = new table */ + } + lua_remove(L, -2); /* remove _LOADED table */ +} + + +LUALIB_API void luaL_openlib (lua_State *L, const char *libname, + const luaL_Reg *l, int nup) { + luaL_checkversion(L); + if (libname) { + luaL_pushmodule(L, libname, libsize(l)); /* get/create library table */ + lua_insert(L, -(nup + 1)); /* move library table to below upvalues */ + } + if (l) + luaL_setfuncs(L, l, nup); + else + lua_pop(L, nup); /* remove upvalues */ +} + +#endif +/* }====================================================== */ + +/* +** set functions from list 'l' into table at top - 'nup'; each +** function gets the 'nup' elements at the top as upvalues. +** Returns with only the table at the stack. +*/ +LUALIB_API void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { + luaL_checkstack(L, nup, "too many upvalues"); + for (; l->name != NULL; l++) { /* fill the table with given functions */ + int i; + for (i = 0; i < nup; i++) /* copy upvalues to the top */ + lua_pushvalue(L, -nup); + lua_pushcclosure(L, l->func, nup); /* closure with those upvalues */ + lua_setfield(L, -(nup + 2), l->name); + } + lua_pop(L, nup); /* remove upvalues */ +} + + +/* +** ensure that stack[idx][fname] has a table and push that table +** into the stack +*/ +LUALIB_API int luaL_getsubtable (lua_State *L, int idx, const char *fname) { + if (lua_getfield(L, idx, fname) == LUA_TTABLE) + return 1; /* table already there */ + else { + lua_pop(L, 1); /* remove previous result */ + idx = lua_absindex(L, idx); + lua_newtable(L); + lua_pushvalue(L, -1); /* copy to be left at top */ + lua_setfield(L, idx, fname); /* assign new table to field */ + return 0; /* false, because did not find table there */ + } +} + + +/* +** Stripped-down 'require': After checking "loaded" table, calls 'openf' +** to open a module, registers the result in 'package.loaded' table and, +** if 'glb' is true, also registers the result in the global table. +** Leaves resulting module on the top. +*/ +LUALIB_API void luaL_requiref (lua_State *L, const char *modname, + lua_CFunction openf, int glb) { + luaL_getsubtable(L, LUA_REGISTRYINDEX, "_LOADED"); + lua_getfield(L, -1, modname); /* _LOADED[modname] */ + if (!lua_toboolean(L, -1)) { /* package not already loaded? */ + lua_pop(L, 1); /* remove field */ + lua_pushcfunction(L, openf); + lua_pushstring(L, modname); /* argument to open function */ + lua_call(L, 1, 1); /* call 'openf' to open module */ + lua_pushvalue(L, -1); /* make copy of module (call result) */ + lua_setfield(L, -3, modname); /* _LOADED[modname] = module */ + } + lua_remove(L, -2); /* remove _LOADED table */ + if (glb) { + lua_pushvalue(L, -1); /* copy of module */ + lua_setglobal(L, modname); /* _G[modname] = module */ + } +} + + +LUALIB_API const char *luaL_gsub (lua_State *L, const char *s, const char *p, + const char *r) { + const char *wild; + size_t l = strlen(p); + luaL_Buffer b; + luaL_buffinit(L, &b); + while ((wild = strstr(s, p)) != NULL) { + luaL_addlstring(&b, s, wild - s); /* push prefix */ + luaL_addstring(&b, r); /* push replacement in place of pattern */ + s = wild + l; /* continue after 'p' */ + } + luaL_addstring(&b, s); /* push last suffix */ + luaL_pushresult(&b); + return lua_tostring(L, -1); +} + + +static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { + (void)ud; (void)osize; /* not used */ + if (nsize == 0) { + free(ptr); + return NULL; + } + else + return realloc(ptr, nsize); +} + + +static int panic (lua_State *L) { + lua_writestringerror("PANIC: unprotected error in call to Lua API (%s)\n", + lua_tostring(L, -1)); + return 0; /* return to Lua to abort */ +} + + +LUALIB_API lua_State *luaL_newstate (void) { + lua_State *L = lua_newstate(l_alloc, NULL); + if (L) lua_atpanic(L, &panic); + return L; +} + + +LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver, size_t sz) { + const lua_Number *v = lua_version(L); + if (sz != LUAL_NUMSIZES) /* check numeric types */ + luaL_error(L, "core and library have incompatible numeric types"); + if (v != lua_version(NULL)) + luaL_error(L, "multiple Lua VMs detected"); + else if (*v != ver) + luaL_error(L, "version mismatch: app. needs %f, Lua core provides %f", + ver, *v); +} + diff --git a/src/lib/geogram_gfx/ImGui_ext/file_dialog.cpp b/src/lib/geogram_gfx/ImGui_ext/file_dialog.cpp index 0a62a886..60ef4b59 100644 --- a/src/lib/geogram_gfx/ImGui_ext/file_dialog.cpp +++ b/src/lib/geogram_gfx/ImGui_ext/file_dialog.cpp @@ -107,7 +107,7 @@ namespace GEO { are_you_sure_(false) { #ifdef GEO_OS_WINDOWS - directory_ = FileSystem::home_directory() + "/"; + directory_ = FileSystem::documents_directory() + "/"; #else directory_ = FileSystem::get_current_working_directory() + "/"; #endif @@ -336,7 +336,7 @@ namespace GEO { } ImGui::SameLine(); if(ImGui::Button("home")) { - set_directory(FileSystem::home_directory()); + set_directory(FileSystem::documents_directory()); update_files(); } ImGui::SameLine(); @@ -354,8 +354,9 @@ namespace GEO { } } - + draw_disk_drives(); ImGui::Separator(); + { std::vector path; String::split_string(directory_, '/', path); @@ -565,6 +566,23 @@ namespace GEO { extensions_.clear(); GEO::String::split_string(extensions, ';', extensions_); } + + void FileDialog::draw_disk_drives() { +#ifdef GEO_OS_WINDOWS + DWORD drives = GetLogicalDrives(); + for(DWORD b=0; b<16; ++b) { + if((drives & (1u << b)) != 0) { + std::string drive; + drive += char('A' + char(b)); + drive += ":"; + if(ImGui::Button(drive.c_str())) { + set_directory(drive); + } + ImGui::SameLine(); + } + } +#endif + } } diff --git a/src/lib/geogram_gfx/ImGui_ext/file_dialog.h b/src/lib/geogram_gfx/ImGui_ext/file_dialog.h old mode 100755 new mode 100644 index dceb384c..9483df83 --- a/src/lib/geogram_gfx/ImGui_ext/file_dialog.h +++ b/src/lib/geogram_gfx/ImGui_ext/file_dialog.h @@ -213,8 +213,18 @@ namespace GEO { */ void file_selected(bool force=false); + /** + * \brief Handles the "are you sure ?" dialog + * when a file is about to be overwritten. + */ void draw_are_you_sure(); - + + /** + * \brief Under Windows, add buttons to change + * disk drive. + */ + void draw_disk_drives(); + private: Application* application_; bool visible_; diff --git a/src/lib/geogram_gfx/glup_viewer/glup_viewer_gui.cpp b/src/lib/geogram_gfx/glup_viewer/glup_viewer_gui.cpp index 89af7964..23e2c26c 100644 --- a/src/lib/geogram_gfx/glup_viewer/glup_viewer_gui.cpp +++ b/src/lib/geogram_gfx/glup_viewer/glup_viewer_gui.cpp @@ -1263,7 +1263,7 @@ namespace GEO { path_ = FileSystem::dir_name(filenames[filenames.size()-1]); } } else { - path_ = FileSystem::home_directory(); + path_ = FileSystem::documents_directory(); } glup_viewer_set_window_title(name_.c_str()); diff --git a/src/lib/geogram_gfx/third_party/CMakeLists.txt b/src/lib/geogram_gfx/third_party/CMakeLists.txt index 4ac38258..1aae979e 100644 --- a/src/lib/geogram_gfx/third_party/CMakeLists.txt +++ b/src/lib/geogram_gfx/third_party/CMakeLists.txt @@ -1,6 +1,6 @@ vor_reset_warning_level() -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") +if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") add_definitions(-Wno-unknown-warning-option -Wno-zero-as-null-pointer-constant) endif() diff --git a/src/lib/geogram_gfx/third_party/ImGui/imgui_impl_glfw_gl3.h b/src/lib/geogram_gfx/third_party/ImGui/imgui_impl_glfw_gl3.h index 2ce55b7e..de5b337c 100644 --- a/src/lib/geogram_gfx/third_party/ImGui/imgui_impl_glfw_gl3.h +++ b/src/lib/geogram_gfx/third_party/ImGui/imgui_impl_glfw_gl3.h @@ -24,7 +24,16 @@ extern "C" { struct GLFWwindow; -IMGUI_API bool ImGui_ImplGlfwGL3_Init(GLFWwindow* window, bool install_callbacks, const char* glsl_version = NULL); +IMGUI_API bool ImGui_ImplGlfwGL3_Init( + GLFWwindow* window, bool install_callbacks, + const char* glsl_version = +#ifdef __cplusplus + nullptr +#else + NULL +#endif +); + IMGUI_API void ImGui_ImplGlfwGL3_Shutdown(); IMGUI_API void ImGui_ImplGlfwGL3_NewFrame(); IMGUI_API void ImGui_ImplGlfwGL3_RenderDrawData(ImDrawData* draw_data); diff --git a/src/lib/geogram_gfx/third_party/imgui_lua_bindings/imgui_iterator.h.000 b/src/lib/geogram_gfx/third_party/imgui_lua_bindings/imgui_iterator.h.000 deleted file mode 100644 index 42dce151..00000000 --- a/src/lib/geogram_gfx/third_party/imgui_lua_bindings/imgui_iterator.h.000 +++ /dev/null @@ -1,1640 +0,0 @@ -//struct ImVec2 - -//struct ImVec4 - -//namespace ImGui - -// IMGUI_API ImGuiIO& GetIO(); -// Unsupported return type ImGuiIO& -// IMGUI_API ImGuiStyle& GetStyle(); -// Unsupported return type ImGuiStyle& -// IMGUI_API ImDrawData* GetDrawData(); // same value as passed to your io.RenderDrawListsFn() function. valid after Render() and until the next call to NewFrame() -// Unsupported return type ImDrawData* -// IMGUI_API void NewFrame(); // start a new ImGui frame, you can submit any command from this point until Render()/EndFrame(). -//Not allowed to use this function -// IMGUI_API void Render(); // ends the ImGui frame, finalize the draw data, then call your io.RenderDrawListsFn() function if set. -//Not allowed to use this function -// IMGUI_API void EndFrame(); // ends the ImGui frame. automatically called by Render(), so most likely don't need to ever call that yourself directly. If you don't need to render you may call EndFrame() but you'll have wasted CPU already. If you don't need to render, better to not create any imgui windows instead! -IMGUI_FUNCTION(EndFrame) -CALL_FUNCTION_NO_RET(EndFrame) -POP_END_STACK(0) -END_IMGUI_FUNC -// IMGUI_API void Shutdown(); -//Not allowed to use this function -// IMGUI_API void ShowDemoWindow(bool* p_open = NULL); // create demo/test window (previously called ShowTestWindow). demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application! -IMGUI_FUNCTION(ShowDemoWindow) -OPTIONAL_BOOL_POINTER_ARG(p_open) -CALL_FUNCTION_NO_RET(ShowDemoWindow, p_open) -END_BOOL_POINTER(p_open) -END_IMGUI_FUNC -// IMGUI_API void ShowMetricsWindow(bool* p_open = NULL); // create metrics window. display ImGui internals: draw commands (with individual draw calls and vertices), window list, basic internal state, etc. -IMGUI_FUNCTION(ShowMetricsWindow) -OPTIONAL_BOOL_POINTER_ARG(p_open) -CALL_FUNCTION_NO_RET(ShowMetricsWindow, p_open) -END_BOOL_POINTER(p_open) -END_IMGUI_FUNC -// IMGUI_API void ShowStyleEditor(ImGuiStyle* ref = NULL); // add style editor block (not a window). you can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style) -// Unsupported arg type ImGuiStyle* ref = NULL -// IMGUI_API bool ShowStyleSelector(const char* label); -IMGUI_FUNCTION(ShowStyleSelector) -LABEL_ARG(label) -CALL_FUNCTION(ShowStyleSelector, bool, label) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API void ShowFontSelector(const char* label); -IMGUI_FUNCTION(ShowFontSelector) -LABEL_ARG(label) -CALL_FUNCTION_NO_RET(ShowFontSelector, label) -END_IMGUI_FUNC -// IMGUI_API void ShowUserGuide(); // add basic help/info block (not a window): how to manipulate ImGui as a end-user (mouse/keyboard controls). -IMGUI_FUNCTION(ShowUserGuide) -CALL_FUNCTION_NO_RET(ShowUserGuide) -END_IMGUI_FUNC -// IMGUI_API bool Begin(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0); // push window to the stack and start appending to it. see .cpp for details. return false when window is collapsed, so you can early out in your code. 'bool* p_open' creates a widget on the upper-right to close the window (which sets your bool to false). -IMGUI_FUNCTION(Begin) -LABEL_ARG(name) -OPTIONAL_BOOL_POINTER_ARG(p_open) -OPTIONAL_INT_ARG(flags, 0) -CALL_FUNCTION(Begin, bool, name, p_open, flags) -IF_RET_ADD_END_STACK(1) -PUSH_BOOL(ret) -END_BOOL_POINTER(p_open) -END_IMGUI_FUNC -// IMGUI_API void End(); // finish appending to current window, pop it off the window stack. -IMGUI_FUNCTION(End) -CALL_FUNCTION_NO_RET(End) -POP_END_STACK(1) -END_IMGUI_FUNC -// IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2 0 0, bool border = false, ImGuiWindowFlags extra_flags = 0); // begin a scrolling region. size==0.0f: use remaining window size, size<0.0f: use remaining window size minus abs(size). size>0.0f: fixed size. each axis can use a different mode, e.g. ImVec2 0 400. -IMGUI_FUNCTION(BeginChild) -LABEL_ARG(str_id) -OPTIONAL_IM_VEC_2_ARG(size, 0, 0) -OPTIONAL_BOOL_ARG(border, false) -OPTIONAL_INT_ARG(extra_flags, 0) -CALL_FUNCTION(BeginChild, bool, str_id, size, border, extra_flags) -IF_RET_ADD_END_STACK(2) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2 0 0, bool border = false, ImGuiWindowFlags extra_flags = 0); // " -IMGUI_FUNCTION(BeginChild_4) -UINT_ARG(id) -OPTIONAL_IM_VEC_2_ARG(size, 0, 0) -OPTIONAL_BOOL_ARG(border, false) -OPTIONAL_INT_ARG(extra_flags, 0) -CALL_FUNCTION(BeginChild, bool, id, size, border, extra_flags) -IF_RET_ADD_END_STACK(2) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API void EndChild(); -IMGUI_FUNCTION(EndChild) -CALL_FUNCTION_NO_RET(EndChild) -POP_END_STACK(2) -END_IMGUI_FUNC -// IMGUI_API ImVec2 GetContentRegionMax(); // current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates -IMGUI_FUNCTION(GetContentRegionMax) -CALL_FUNCTION(GetContentRegionMax, ImVec2) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API ImVec2 GetContentRegionAvail(); // == GetContentRegionMax() - GetCursorPos() -IMGUI_FUNCTION(GetContentRegionAvail) -CALL_FUNCTION(GetContentRegionAvail, ImVec2) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API float GetContentRegionAvailWidth(); // -IMGUI_FUNCTION(GetContentRegionAvailWidth) -CALL_FUNCTION(GetContentRegionAvailWidth, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API ImVec2 GetWindowContentRegionMin(); // content boundaries min (roughly (0,0)-Scroll), in window coordinates -IMGUI_FUNCTION(GetWindowContentRegionMin) -CALL_FUNCTION(GetWindowContentRegionMin, ImVec2) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API ImVec2 GetWindowContentRegionMax(); // content boundaries max (roughly (0,0)+Size-Scroll) where Size can be override with SetNextWindowContentSize(), in window coordinates -IMGUI_FUNCTION(GetWindowContentRegionMax) -CALL_FUNCTION(GetWindowContentRegionMax, ImVec2) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API float GetWindowContentRegionWidth(); // -IMGUI_FUNCTION(GetWindowContentRegionWidth) -CALL_FUNCTION(GetWindowContentRegionWidth, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API ImDrawList* GetWindowDrawList(); // get rendering command-list if you want to append your own draw primitives -// Unsupported return type ImDrawList* -// IMGUI_API ImVec2 GetWindowPos(); // get current window position in screen space (useful if you want to do your own drawing via the DrawList api) -IMGUI_FUNCTION(GetWindowPos) -CALL_FUNCTION(GetWindowPos, ImVec2) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API ImVec2 GetWindowSize(); // get current window size -IMGUI_FUNCTION(GetWindowSize) -CALL_FUNCTION(GetWindowSize, ImVec2) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API float GetWindowWidth(); -IMGUI_FUNCTION(GetWindowWidth) -CALL_FUNCTION(GetWindowWidth, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API float GetWindowHeight(); -IMGUI_FUNCTION(GetWindowHeight) -CALL_FUNCTION(GetWindowHeight, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API bool IsWindowCollapsed(); -IMGUI_FUNCTION(IsWindowCollapsed) -CALL_FUNCTION(IsWindowCollapsed, bool) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool IsWindowAppearing(); -IMGUI_FUNCTION(IsWindowAppearing) -CALL_FUNCTION(IsWindowAppearing, bool) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API void SetWindowFontScale(float scale); // per-window font scale. Adjust IO.FontGlobalScale if you want to scale all windows -IMGUI_FUNCTION(SetWindowFontScale) -NUMBER_ARG(scale) -CALL_FUNCTION_NO_RET(SetWindowFontScale, scale) -END_IMGUI_FUNC -// IMGUI_API void SetNextWindowPos(const ImVec2& pos, ImGuiCond cond = 0, const ImVec2& pivot = ImVec2 0 0); // set next window position. call before Begin(). use pivot=(0.5f,0.5f) to center on given point, etc. -// Unsupported arg type ImGuiCond cond = 0 -// IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiCond cond = 0); // set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin() -// Unsupported arg type ImGuiCond cond = 0 -// IMGUI_API void SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeConstraintCallback custom_callback = NULL, void* custom_callback_data = NULL); // set next window size limits. use -1,-1 on either X/Y axis to preserve the current size. Use callback to apply non-trivial programmatic constraints. -// Unsupported arg type ImGuiSizeConstraintCallback custom_callback = NULL -// Unsupported arg type void* custom_callback_data = NULL -// IMGUI_API void SetNextWindowContentSize(const ImVec2& size); // set next window content size (~ enforce the range of scrollbars). not including window decorations (title bar, menu bar, etc.). set an axis to 0.0f to leave it automatic. call before Begin() -IMGUI_FUNCTION(SetNextWindowContentSize) -IM_VEC_2_ARG(size) -CALL_FUNCTION_NO_RET(SetNextWindowContentSize, size) -END_IMGUI_FUNC -// IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiCond cond = 0); // set next window collapsed state. call before Begin() -// Unsupported arg type ImGuiCond cond = 0 -// IMGUI_API void SetNextWindowFocus(); // set next window to be focused / front-most. call before Begin() -IMGUI_FUNCTION(SetNextWindowFocus) -CALL_FUNCTION_NO_RET(SetNextWindowFocus) -END_IMGUI_FUNC -// IMGUI_API void SetWindowPos(const ImVec2& pos, ImGuiCond cond = 0); // (not recommended) set current window position - call within Begin()/End(). prefer using SetNextWindowPos(), as this may incur tearing and side-effects. -// Unsupported arg type ImGuiCond cond = 0 -// IMGUI_API void SetWindowSize(const ImVec2& size, ImGuiCond cond = 0); // (not recommended) set current window size - call within Begin()/End(). set to ImVec2 0 0 to force an auto-fit. prefer using SetNextWindowSize(), as this may incur tearing and minor side-effects. -// Unsupported arg type ImGuiCond cond = 0 -// IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiCond cond = 0); // (not recommended) set current window collapsed state. prefer using SetNextWindowCollapsed(). -// Unsupported arg type ImGuiCond cond = 0 -// IMGUI_API void SetWindowFocus(); // (not recommended) set current window to be focused / front-most. prefer using SetNextWindowFocus(). -IMGUI_FUNCTION(SetWindowFocus) -CALL_FUNCTION_NO_RET(SetWindowFocus) -END_IMGUI_FUNC -// IMGUI_API void SetWindowPos(const char* name, const ImVec2& pos, ImGuiCond cond = 0); // set named window position. -// Unsupported arg type ImGuiCond cond = 0 -// IMGUI_API void SetWindowSize(const char* name, const ImVec2& size, ImGuiCond cond = 0); // set named window size. set axis to 0.0f to force an auto-fit on this axis. -// Unsupported arg type ImGuiCond cond = 0 -// IMGUI_API void SetWindowCollapsed(const char* name, bool collapsed, ImGuiCond cond = 0); // set named window collapsed state -// Unsupported arg type ImGuiCond cond = 0 -// IMGUI_API void SetWindowFocus(const char* name); // set named window to be focused / front-most. use NULL to remove focus. -IMGUI_FUNCTION(SetWindowFocus_1) -LABEL_ARG(name) -CALL_FUNCTION_NO_RET(SetWindowFocus, name) -END_IMGUI_FUNC -// IMGUI_API float GetScrollX(); // get scrolling amount [0..GetScrollMaxX()] -IMGUI_FUNCTION(GetScrollX) -CALL_FUNCTION(GetScrollX, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API float GetScrollY(); // get scrolling amount [0..GetScrollMaxY()] -IMGUI_FUNCTION(GetScrollY) -CALL_FUNCTION(GetScrollY, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API float GetScrollMaxX(); // get maximum scrolling amount ~~ ContentSize.X - WindowSize.X -IMGUI_FUNCTION(GetScrollMaxX) -CALL_FUNCTION(GetScrollMaxX, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API float GetScrollMaxY(); // get maximum scrolling amount ~~ ContentSize.Y - WindowSize.Y -IMGUI_FUNCTION(GetScrollMaxY) -CALL_FUNCTION(GetScrollMaxY, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API void SetScrollX(float scroll_x); // set scrolling amount [0..GetScrollMaxX()] -IMGUI_FUNCTION(SetScrollX) -NUMBER_ARG(scroll_x) -CALL_FUNCTION_NO_RET(SetScrollX, scroll_x) -END_IMGUI_FUNC -// IMGUI_API void SetScrollY(float scroll_y); // set scrolling amount [0..GetScrollMaxY()] -IMGUI_FUNCTION(SetScrollY) -NUMBER_ARG(scroll_y) -CALL_FUNCTION_NO_RET(SetScrollY, scroll_y) -END_IMGUI_FUNC -// IMGUI_API void SetScrollHere(float center_y_ratio = 0.5f); // adjust scrolling amount to make current cursor position visible. center_y_ratio=0.0: top, 0.5: center, 1.0: bottom. When using to make a "default/current item" visible, consider using SetItemDefaultFocus() instead. -IMGUI_FUNCTION(SetScrollHere) -OPTIONAL_NUMBER_ARG(center_y_ratio, 0.5f) -CALL_FUNCTION_NO_RET(SetScrollHere, center_y_ratio) -END_IMGUI_FUNC -// IMGUI_API void SetScrollFromPosY(float pos_y, float center_y_ratio = 0.5f); // adjust scrolling amount to make given position valid. use GetCursorPos() or GetCursorStartPos()+offset to get valid positions. -IMGUI_FUNCTION(SetScrollFromPosY) -NUMBER_ARG(pos_y) -OPTIONAL_NUMBER_ARG(center_y_ratio, 0.5f) -CALL_FUNCTION_NO_RET(SetScrollFromPosY, pos_y, center_y_ratio) -END_IMGUI_FUNC -// IMGUI_API void SetStateStorage(ImGuiStorage* tree); // replace tree state storage with our own (if you want to manipulate it yourself, typically clear subsection of it) -// Unsupported arg type ImGuiStorage* tree -// IMGUI_API ImGuiStorage* GetStateStorage(); -// Unsupported return type ImGuiStorage* -// IMGUI_API void PushFont(ImFont* font); // use NULL as a shortcut to push default font -// Unsupported arg type ImFont* font -// IMGUI_API void PopFont(); -IMGUI_FUNCTION(PopFont) -CALL_FUNCTION_NO_RET(PopFont) -END_IMGUI_FUNC -// IMGUI_API void PushStyleColor(ImGuiCol idx, ImU32 col); -IMGUI_FUNCTION(PushStyleColor) -INT_ARG(idx) -UINT_ARG(col) -CALL_FUNCTION_NO_RET(PushStyleColor, idx, col) -END_IMGUI_FUNC -// IMGUI_API void PushStyleColor(ImGuiCol idx, const ImVec4& col); -IMGUI_FUNCTION(PushStyleColor_2) -INT_ARG(idx) -IM_VEC_4_ARG(col) -CALL_FUNCTION_NO_RET(PushStyleColor, idx, col) -END_IMGUI_FUNC -// IMGUI_API void PopStyleColor(int count = 1); -IMGUI_FUNCTION(PopStyleColor) -OPTIONAL_INT_ARG(count, 1) -CALL_FUNCTION_NO_RET(PopStyleColor, count) -END_IMGUI_FUNC -// IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val); -IMGUI_FUNCTION(PushStyleVar) -INT_ARG(idx) -NUMBER_ARG(val) -CALL_FUNCTION_NO_RET(PushStyleVar, idx, val) -ADD_END_STACK(3) -END_IMGUI_FUNC -// IMGUI_API void PushStyleVar(ImGuiStyleVar idx, const ImVec2& val); -IMGUI_FUNCTION(PushStyleVar_2) -INT_ARG(idx) -IM_VEC_2_ARG(val) -CALL_FUNCTION_NO_RET(PushStyleVar, idx, val) -ADD_END_STACK(3) -END_IMGUI_FUNC -// IMGUI_API void PopStyleVar(int count = 1); -IMGUI_FUNCTION(PopStyleVar) -OPTIONAL_INT_ARG(count, 1) -CALL_FUNCTION_NO_RET(PopStyleVar, count) -POP_END_STACK(3) -END_IMGUI_FUNC -// IMGUI_API const ImVec4& GetStyleColorVec4(ImGuiCol idx); // retrieve style color as stored in ImGuiStyle structure. use to feed back into PushStyleColor(), otherwhise use GetColorU32() to get style color + style alpha. -// Unsupported return type const -// IMGUI_API ImFont* GetFont(); // get current font -// Unsupported return type ImFont* -// IMGUI_API float GetFontSize(); // get current font size (= height in pixels) of current font with current scale applied -IMGUI_FUNCTION(GetFontSize) -CALL_FUNCTION(GetFontSize, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API ImVec2 GetFontTexUvWhitePixel(); // get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API -IMGUI_FUNCTION(GetFontTexUvWhitePixel) -CALL_FUNCTION(GetFontTexUvWhitePixel, ImVec2) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API ImU32 GetColorU32(ImGuiCol idx, float alpha_mul = 1.0f); // retrieve given style color with style alpha applied and optional extra alpha multiplier -IMGUI_FUNCTION(GetColorU32) -INT_ARG(idx) -OPTIONAL_NUMBER_ARG(alpha_mul, 1.0f) -CALL_FUNCTION(GetColorU32, unsigned int, idx, alpha_mul) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API ImU32 GetColorU32(const ImVec4& col); // retrieve given color with style alpha applied -IMGUI_FUNCTION(GetColorU32_1) -IM_VEC_4_ARG(col) -CALL_FUNCTION(GetColorU32, unsigned int, col) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API ImU32 GetColorU32(ImU32 col); // retrieve given color with style alpha applied -IMGUI_FUNCTION(GetColorU32_1_1) -UINT_ARG(col) -CALL_FUNCTION(GetColorU32, unsigned int, col) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API void PushItemWidth(float item_width); // width of items for the common item+label case, pixels. 0.0f = default to ~2/3 of windows width, >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -1.0f always align width to the right side) -IMGUI_FUNCTION(PushItemWidth) -NUMBER_ARG(item_width) -CALL_FUNCTION_NO_RET(PushItemWidth, item_width) -END_IMGUI_FUNC -// IMGUI_API void PopItemWidth(); -IMGUI_FUNCTION(PopItemWidth) -CALL_FUNCTION_NO_RET(PopItemWidth) -END_IMGUI_FUNC -// IMGUI_API float CalcItemWidth(); // width of item given pushed settings and current cursor position -IMGUI_FUNCTION(CalcItemWidth) -CALL_FUNCTION(CalcItemWidth, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API void PushTextWrapPos(float wrap_pos_x = 0.0f); // word-wrapping for Text*() commands. < 0.0f: no wrapping; 0.0f: wrap to end of window (or column); > 0.0f: wrap at 'wrap_pos_x' position in window local space -IMGUI_FUNCTION(PushTextWrapPos) -OPTIONAL_NUMBER_ARG(wrap_pos_x, 0.0f) -CALL_FUNCTION_NO_RET(PushTextWrapPos, wrap_pos_x) -END_IMGUI_FUNC -// IMGUI_API void PopTextWrapPos(); -IMGUI_FUNCTION(PopTextWrapPos) -CALL_FUNCTION_NO_RET(PopTextWrapPos) -END_IMGUI_FUNC -// IMGUI_API void PushAllowKeyboardFocus(bool allow_keyboard_focus); // allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets -IMGUI_FUNCTION(PushAllowKeyboardFocus) -BOOL_ARG(allow_keyboard_focus) -CALL_FUNCTION_NO_RET(PushAllowKeyboardFocus, allow_keyboard_focus) -END_IMGUI_FUNC -// IMGUI_API void PopAllowKeyboardFocus(); -IMGUI_FUNCTION(PopAllowKeyboardFocus) -CALL_FUNCTION_NO_RET(PopAllowKeyboardFocus) -END_IMGUI_FUNC -// IMGUI_API void PushButtonRepeat(bool repeat); // in 'repeat' mode, Button*() functions return repeated true in a typematic manner (using io.KeyRepeatDelay/io.KeyRepeatRate setting). Note that you can call IsItemActive() after any Button() to tell if the button is held in the current frame. -IMGUI_FUNCTION(PushButtonRepeat) -BOOL_ARG(repeat) -CALL_FUNCTION_NO_RET(PushButtonRepeat, repeat) -END_IMGUI_FUNC -// IMGUI_API void PopButtonRepeat(); -IMGUI_FUNCTION(PopButtonRepeat) -CALL_FUNCTION_NO_RET(PopButtonRepeat) -END_IMGUI_FUNC -// IMGUI_API void Separator(); // separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator. -IMGUI_FUNCTION(Separator) -CALL_FUNCTION_NO_RET(Separator) -END_IMGUI_FUNC -// IMGUI_API void SameLine(float pos_x = 0.0f, float spacing_w = -1.0f); // call between widgets or groups to layout them horizontally -IMGUI_FUNCTION(SameLine) -OPTIONAL_NUMBER_ARG(pos_x, 0.0f) -OPTIONAL_NUMBER_ARG(spacing_w, -1.0f) -CALL_FUNCTION_NO_RET(SameLine, pos_x, spacing_w) -END_IMGUI_FUNC -// IMGUI_API void NewLine(); // undo a SameLine() -IMGUI_FUNCTION(NewLine) -CALL_FUNCTION_NO_RET(NewLine) -END_IMGUI_FUNC -// IMGUI_API void Spacing(); // add vertical spacing -IMGUI_FUNCTION(Spacing) -CALL_FUNCTION_NO_RET(Spacing) -END_IMGUI_FUNC -// IMGUI_API void Dummy(const ImVec2& size); // add a dummy item of given size -IMGUI_FUNCTION(Dummy) -IM_VEC_2_ARG(size) -CALL_FUNCTION_NO_RET(Dummy, size) -END_IMGUI_FUNC -// IMGUI_API void Indent(float indent_w = 0.0f); // move content position toward the right, by style.IndentSpacing or indent_w if != 0 -IMGUI_FUNCTION(Indent) -OPTIONAL_NUMBER_ARG(indent_w, 0.0f) -CALL_FUNCTION_NO_RET(Indent, indent_w) -END_IMGUI_FUNC -// IMGUI_API void Unindent(float indent_w = 0.0f); // move content position back to the left, by style.IndentSpacing or indent_w if != 0 -IMGUI_FUNCTION(Unindent) -OPTIONAL_NUMBER_ARG(indent_w, 0.0f) -CALL_FUNCTION_NO_RET(Unindent, indent_w) -END_IMGUI_FUNC -// IMGUI_API void BeginGroup(); // lock horizontal starting position + capture group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.) -IMGUI_FUNCTION(BeginGroup) -CALL_FUNCTION_NO_RET(BeginGroup) -ADD_END_STACK(4) -END_IMGUI_FUNC -// IMGUI_API void EndGroup(); -IMGUI_FUNCTION(EndGroup) -CALL_FUNCTION_NO_RET(EndGroup) -POP_END_STACK(4) -END_IMGUI_FUNC -// IMGUI_API ImVec2 GetCursorPos(); // cursor position is relative to window position -IMGUI_FUNCTION(GetCursorPos) -CALL_FUNCTION(GetCursorPos, ImVec2) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API float GetCursorPosX(); // " -IMGUI_FUNCTION(GetCursorPosX) -CALL_FUNCTION(GetCursorPosX, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API float GetCursorPosY(); // " -IMGUI_FUNCTION(GetCursorPosY) -CALL_FUNCTION(GetCursorPosY, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API void SetCursorPos(const ImVec2& local_pos); // " -IMGUI_FUNCTION(SetCursorPos) -IM_VEC_2_ARG(local_pos) -CALL_FUNCTION_NO_RET(SetCursorPos, local_pos) -END_IMGUI_FUNC -// IMGUI_API void SetCursorPosX(float x); // " -IMGUI_FUNCTION(SetCursorPosX) -NUMBER_ARG(x) -CALL_FUNCTION_NO_RET(SetCursorPosX, x) -END_IMGUI_FUNC -// IMGUI_API void SetCursorPosY(float y); // " -IMGUI_FUNCTION(SetCursorPosY) -NUMBER_ARG(y) -CALL_FUNCTION_NO_RET(SetCursorPosY, y) -END_IMGUI_FUNC -// IMGUI_API ImVec2 GetCursorStartPos(); // initial cursor position -IMGUI_FUNCTION(GetCursorStartPos) -CALL_FUNCTION(GetCursorStartPos, ImVec2) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API ImVec2 GetCursorScreenPos(); // cursor position in absolute screen coordinates [0..io.DisplaySize] (useful to work with ImDrawList API) -IMGUI_FUNCTION(GetCursorScreenPos) -CALL_FUNCTION(GetCursorScreenPos, ImVec2) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API void SetCursorScreenPos(const ImVec2& pos); // cursor position in absolute screen coordinates [0..io.DisplaySize] -IMGUI_FUNCTION(SetCursorScreenPos) -IM_VEC_2_ARG(pos) -CALL_FUNCTION_NO_RET(SetCursorScreenPos, pos) -END_IMGUI_FUNC -// IMGUI_API void AlignTextToFramePadding(); // vertically align/lower upcoming text to FramePadding.y so that it will aligns to upcoming widgets (call if you have text on a line before regular widgets) -IMGUI_FUNCTION(AlignTextToFramePadding) -CALL_FUNCTION_NO_RET(AlignTextToFramePadding) -END_IMGUI_FUNC -// IMGUI_API float GetTextLineHeight(); // ~ FontSize -IMGUI_FUNCTION(GetTextLineHeight) -CALL_FUNCTION(GetTextLineHeight, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API float GetTextLineHeightWithSpacing(); // ~ FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text) -IMGUI_FUNCTION(GetTextLineHeightWithSpacing) -CALL_FUNCTION(GetTextLineHeightWithSpacing, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API float GetFrameHeight(); // ~ FontSize + style.FramePadding.y * 2 -IMGUI_FUNCTION(GetFrameHeight) -CALL_FUNCTION(GetFrameHeight, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API float GetFrameHeightWithSpacing(); // ~ FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets) -IMGUI_FUNCTION(GetFrameHeightWithSpacing) -CALL_FUNCTION(GetFrameHeightWithSpacing, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API void Columns(int count = 1, const char* id = NULL, bool border = true); -IMGUI_FUNCTION(Columns) -OPTIONAL_INT_ARG(count, 1) -OPTIONAL_LABEL_ARG(id) -OPTIONAL_BOOL_ARG(border, true) -CALL_FUNCTION_NO_RET(Columns, count, id, border) -END_IMGUI_FUNC -// IMGUI_API void NextColumn(); // next column, defaults to current row or next row if the current row is finished -IMGUI_FUNCTION(NextColumn) -CALL_FUNCTION_NO_RET(NextColumn) -END_IMGUI_FUNC -// IMGUI_API int GetColumnIndex(); // get current column index -// Unsupported return type int -// IMGUI_API float GetColumnWidth(int column_index = -1); // get column width (in pixels). pass -1 to use current column -IMGUI_FUNCTION(GetColumnWidth) -OPTIONAL_INT_ARG(column_index, -1) -CALL_FUNCTION(GetColumnWidth, float, column_index) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API void SetColumnWidth(int column_index, float width); // set column width (in pixels). pass -1 to use current column -IMGUI_FUNCTION(SetColumnWidth) -INT_ARG(column_index) -NUMBER_ARG(width) -CALL_FUNCTION_NO_RET(SetColumnWidth, column_index, width) -END_IMGUI_FUNC -// IMGUI_API float GetColumnOffset(int column_index = -1); // get position of column line (in pixels, from the left side of the contents region). pass -1 to use current column, otherwise 0..GetColumnsCount() inclusive. column 0 is typically 0.0f -IMGUI_FUNCTION(GetColumnOffset) -OPTIONAL_INT_ARG(column_index, -1) -CALL_FUNCTION(GetColumnOffset, float, column_index) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API void SetColumnOffset(int column_index, float offset_x); // set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column -IMGUI_FUNCTION(SetColumnOffset) -INT_ARG(column_index) -NUMBER_ARG(offset_x) -CALL_FUNCTION_NO_RET(SetColumnOffset, column_index, offset_x) -END_IMGUI_FUNC -// IMGUI_API int GetColumnsCount(); -// Unsupported return type int -// IMGUI_API void PushID(const char* str_id); // push identifier into the ID stack. IDs are hash of the entire stack! -IMGUI_FUNCTION(PushID) -LABEL_ARG(str_id) -CALL_FUNCTION_NO_RET(PushID, str_id) -END_IMGUI_FUNC -// IMGUI_API void PushID(const char* str_id_begin, const char* str_id_end); -IMGUI_FUNCTION(PushID_2) -LABEL_ARG(str_id_begin) -LABEL_ARG(str_id_end) -CALL_FUNCTION_NO_RET(PushID, str_id_begin, str_id_end) -END_IMGUI_FUNC -// IMGUI_API void PushID(const void* ptr_id); -// Unsupported arg type const void* ptr_id -// IMGUI_API void PushID(int int_id); -IMGUI_FUNCTION(PushID_1) -INT_ARG(int_id) -CALL_FUNCTION_NO_RET(PushID, int_id) -END_IMGUI_FUNC -// IMGUI_API void PopID(); -IMGUI_FUNCTION(PopID) -CALL_FUNCTION_NO_RET(PopID) -END_IMGUI_FUNC -// IMGUI_API ImGuiID GetID(const char* str_id); // calculate unique ID (hash of whole ID stack + given parameter). e.g. if you want to query into ImGuiStorage yourself -IMGUI_FUNCTION(GetID) -LABEL_ARG(str_id) -CALL_FUNCTION(GetID, unsigned int, str_id) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API ImGuiID GetID(const char* str_id_begin, const char* str_id_end); -IMGUI_FUNCTION(GetID_2) -LABEL_ARG(str_id_begin) -LABEL_ARG(str_id_end) -CALL_FUNCTION(GetID, unsigned int, str_id_begin, str_id_end) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API ImGuiID GetID(const void* ptr_id); -// Unsupported arg type const void* ptr_id -// IMGUI_API void TextUnformatted(const char* text, const char* text_end = NULL); // raw text without formatting. Roughly equivalent to Text("%s", text) but: A) doesn't require null terminated string if 'text_end' is specified, B) it's faster, no memory copy is done, no buffer size limits, recommended for long chunks of text. -IMGUI_FUNCTION(TextUnformatted) -LABEL_ARG(text) -OPTIONAL_LABEL_ARG(text_end) -CALL_FUNCTION_NO_RET(TextUnformatted, text, text_end) -END_IMGUI_FUNC -// IMGUI_API void Text(const char* fmt, ...) IM_FMTARGS(1); // simple formatted text -// Unsupported arg type ...) IM_FMTARGS(1 -// IMGUI_API void TextV(const char* fmt, va_list args) IM_FMTLIST(1); -// Unsupported arg type va_list args) IM_FMTLIST(1 -// IMGUI_API void TextColored(const ImVec4& col, const char* fmt, ...) IM_FMTARGS(2); // shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor(); -// Unsupported arg type ...) IM_FMTARGS(2 -// IMGUI_API void TextColoredV(const ImVec4& col, const char* fmt, va_list args) IM_FMTLIST(2); -// Unsupported arg type va_list args) IM_FMTLIST(2 -// IMGUI_API void TextDisabled(const char* fmt, ...) IM_FMTARGS(1); // shortcut for PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]); Text(fmt, ...); PopStyleColor(); -// Unsupported arg type ...) IM_FMTARGS(1 -// IMGUI_API void TextDisabledV(const char* fmt, va_list args) IM_FMTLIST(1); -// Unsupported arg type va_list args) IM_FMTLIST(1 -// IMGUI_API void TextWrapped(const char* fmt, ...) IM_FMTARGS(1); // shortcut for PushTextWrapPos(0.0f); Text(fmt, ...); PopTextWrapPos();. Note that this won't work on an auto-resizing window if there's no other widgets to extend the window width, yoy may need to set a size using SetNextWindowSize(). -// Unsupported arg type ...) IM_FMTARGS(1 -// IMGUI_API void TextWrappedV(const char* fmt, va_list args) IM_FMTLIST(1); -// Unsupported arg type va_list args) IM_FMTLIST(1 -// IMGUI_API void LabelText(const char* label, const char* fmt, ...) IM_FMTARGS(2); // display text+label aligned the same way as value+label widgets -// Unsupported arg type ...) IM_FMTARGS(2 -// IMGUI_API void LabelTextV(const char* label, const char* fmt, va_list args) IM_FMTLIST(2); -// Unsupported arg type va_list args) IM_FMTLIST(2 -// IMGUI_API void BulletText(const char* fmt, ...) IM_FMTARGS(1); // shortcut for Bullet()+Text() -// Unsupported arg type ...) IM_FMTARGS(1 -// IMGUI_API void BulletTextV(const char* fmt, va_list args) IM_FMTLIST(1); -// Unsupported arg type va_list args) IM_FMTLIST(1 -// IMGUI_API void Bullet(); // draw a small circle and keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses -IMGUI_FUNCTION(Bullet) -CALL_FUNCTION_NO_RET(Bullet) -END_IMGUI_FUNC -// IMGUI_API bool Button(const char* label, const ImVec2& size = ImVec2 0 0); // button -IMGUI_FUNCTION(Button) -LABEL_ARG(label) -OPTIONAL_IM_VEC_2_ARG(size, 0, 0) -CALL_FUNCTION(Button, bool, label, size) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool SmallButton(const char* label); // button with FramePadding=(0,0) to easily embed within text -IMGUI_FUNCTION(SmallButton) -LABEL_ARG(label) -CALL_FUNCTION(SmallButton, bool, label) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool InvisibleButton(const char* str_id, const ImVec2& size); // button behavior without the visuals, useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.) -IMGUI_FUNCTION(InvisibleButton) -LABEL_ARG(str_id) -IM_VEC_2_ARG(size) -CALL_FUNCTION(InvisibleButton, bool, str_id, size) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2 0 0, const ImVec2& uv1 = ImVec2 1 1, const ImVec4& tint_col = ImVec4 1 1 1 1, const ImVec4& border_col = ImVec4 0 0 0 0); -IMGUI_FUNCTION(Image) -IM_TEXTURE_ID_ARG(user_texture_id) -IM_VEC_2_ARG(size) -OPTIONAL_IM_VEC_2_ARG(uv0, 0, 0) -OPTIONAL_IM_VEC_2_ARG(uv1, 1, 1) -OPTIONAL_IM_VEC_4_ARG(tint_col, 1, 1, 1, 1) -OPTIONAL_IM_VEC_4_ARG(border_col, 0, 0, 0, 0) -CALL_FUNCTION_NO_RET(Image, user_texture_id, size, uv0, uv1, tint_col, border_col) -END_IMGUI_FUNC -// IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2 0 0, const ImVec2& uv1 = ImVec2 1 1, int frame_padding = -1, const ImVec4& bg_col = ImVec4 0 0 0 0, const ImVec4& tint_col = ImVec4 1 1 1 1); // <0 frame_padding uses default frame padding settings. 0 for no padding -IMGUI_FUNCTION(ImageButton) -IM_TEXTURE_ID_ARG(user_texture_id) -IM_VEC_2_ARG(size) -OPTIONAL_IM_VEC_2_ARG(uv0, 0, 0) -OPTIONAL_IM_VEC_2_ARG(uv1, 1, 1) -OPTIONAL_INT_ARG(frame_padding, -1) -OPTIONAL_IM_VEC_4_ARG(bg_col, 0, 0, 0, 0) -OPTIONAL_IM_VEC_4_ARG(tint_col, 1, 1, 1, 1) -CALL_FUNCTION(ImageButton, bool, user_texture_id, size, uv0, uv1, frame_padding, bg_col, tint_col) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool Checkbox(const char* label, bool* v); -IMGUI_FUNCTION(Checkbox) -LABEL_ARG(label) -BOOL_POINTER_ARG(v) -CALL_FUNCTION(Checkbox, bool, label, v) -PUSH_BOOL(ret) -END_BOOL_POINTER(v) -END_IMGUI_FUNC -// IMGUI_API bool CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value); -IMGUI_FUNCTION(CheckboxFlags) -LABEL_ARG(label) -UINT_POINTER_ARG(flags) -UINT_ARG(flags_value) -CALL_FUNCTION(CheckboxFlags, bool, label, flags, flags_value) -PUSH_BOOL(ret) -END_UINT_POINTER(flags) -END_IMGUI_FUNC -// IMGUI_API bool RadioButton(const char* label, bool active); -IMGUI_FUNCTION(RadioButton) -LABEL_ARG(label) -BOOL_ARG(active) -CALL_FUNCTION(RadioButton, bool, label, active) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool RadioButton(const char* label, int* v, int v_button); -IMGUI_FUNCTION(RadioButton_3) -LABEL_ARG(label) -INT_POINTER_ARG(v) -INT_ARG(v_button) -CALL_FUNCTION(RadioButton, bool, label, v, v_button) -PUSH_BOOL(ret) -END_INT_POINTER(v) -END_IMGUI_FUNC -// IMGUI_API void PlotLines(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2 0 0, int stride = sizeof(float)); -// Unsupported arg type const float* values -// Unsupported arg type ImVec2 graph_size = ImVec2 0 0 -// IMGUI_API void PlotLines(const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2 0 0); -// Unsupported arg type float (*values_getter)(void* data -// Unsupported arg type void* data -// Unsupported arg type ImVec2 graph_size = ImVec2 0 0 -// IMGUI_API void PlotHistogram(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2 0 0, int stride = sizeof(float)); -// Unsupported arg type const float* values -// Unsupported arg type ImVec2 graph_size = ImVec2 0 0 -// IMGUI_API void PlotHistogram(const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2 0 0); -// Unsupported arg type float (*values_getter)(void* data -// Unsupported arg type void* data -// Unsupported arg type ImVec2 graph_size = ImVec2 0 0 -// IMGUI_API void ProgressBar(float fraction, const ImVec2& size_arg = ImVec2 -1 0, const char* overlay = NULL); -IMGUI_FUNCTION(ProgressBar) -NUMBER_ARG(fraction) -OPTIONAL_IM_VEC_2_ARG(size_arg, -1, 0) -OPTIONAL_LABEL_ARG(overlay) -CALL_FUNCTION_NO_RET(ProgressBar, fraction, size_arg, overlay) -END_IMGUI_FUNC -// IMGUI_API bool BeginCombo(const char* label, const char* preview_value, ImGuiComboFlags flags = 0); -// Unsupported arg type ImGuiComboFlags flags = 0 -// IMGUI_API void EndCombo(); -IMGUI_FUNCTION(EndCombo) -CALL_FUNCTION_NO_RET(EndCombo) -POP_END_STACK(5) -END_IMGUI_FUNC -// IMGUI_API bool Combo(const char* label, int* current_item, const char* const items[], int items_count, int popup_max_height_in_items = -1); -// Unsupported arg type const char* const items[] -// IMGUI_API bool Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int popup_max_height_in_items = -1); // Separate items with \0 within a string, end item-list with \0\0. e.g. "One\0Two\0Three\0" -IMGUI_FUNCTION(Combo) -LABEL_ARG(label) -INT_POINTER_ARG(current_item) -LABEL_ARG(items_separated_by_zeros) -OPTIONAL_INT_ARG(popup_max_height_in_items, -1) -CALL_FUNCTION(Combo, bool, label, current_item, items_separated_by_zeros, popup_max_height_in_items) -PUSH_BOOL(ret) -END_INT_POINTER(current_item) -END_IMGUI_FUNC -// IMGUI_API bool Combo(const char* label, int* current_item, bool(*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int popup_max_height_in_items = -1); -// Unsupported arg type bool(*items_getter)(void* data -// Unsupported arg type const char** out_text) -// Unsupported arg type void* data -// IMGUI_API bool DragFloat(const char* label, float* v, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f); // If v_min >= v_max we have no bound -IMGUI_FUNCTION(DragFloat) -LABEL_ARG(label) -FLOAT_POINTER_ARG(v) -OPTIONAL_NUMBER_ARG(v_speed, 1.0f) -OPTIONAL_NUMBER_ARG(v_min, 0.0f) -OPTIONAL_NUMBER_ARG(v_max, 0.0f) -LABEL_ARG(display_format) -OPTIONAL_NUMBER_ARG(power, 1.0f) -CALL_FUNCTION(DragFloat, bool, label, v, v_speed, v_min, v_max, display_format, power) -PUSH_BOOL(ret) -END_FLOAT_POINTER(v) -END_IMGUI_FUNC -// IMGUI_API bool DragFloat2(const char* label, float v[2], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f); -// Unsupported arg type float v[2] -// IMGUI_API bool DragFloat3(const char* label, float v[3], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f); -// Unsupported arg type float v[3] -// IMGUI_API bool DragFloat4(const char* label, float v[4], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f); -// Unsupported arg type float v[4] -// IMGUI_API bool DragFloatRange2(const char* label, float* v_current_min, float* v_current_max, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", const char* display_format_max = NULL, float power = 1.0f); -IMGUI_FUNCTION(DragFloatRange2) -LABEL_ARG(label) -FLOAT_POINTER_ARG(v_current_min) -FLOAT_POINTER_ARG(v_current_max) -OPTIONAL_NUMBER_ARG(v_speed, 1.0f) -OPTIONAL_NUMBER_ARG(v_min, 0.0f) -OPTIONAL_NUMBER_ARG(v_max, 0.0f) -LABEL_ARG(display_format) -OPTIONAL_LABEL_ARG(display_format_max) -OPTIONAL_NUMBER_ARG(power, 1.0f) -CALL_FUNCTION(DragFloatRange2, bool, label, v_current_min, v_current_max, v_speed, v_min, v_max, display_format, display_format_max, power) -PUSH_BOOL(ret) -END_FLOAT_POINTER(v_current_min) -END_FLOAT_POINTER(v_current_max) -END_IMGUI_FUNC -// IMGUI_API bool DragInt(const char* label, int* v, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f"); // If v_min >= v_max we have no bound -IMGUI_FUNCTION(DragInt) -LABEL_ARG(label) -INT_POINTER_ARG(v) -OPTIONAL_NUMBER_ARG(v_speed, 1.0f) -OPTIONAL_INT_ARG(v_min, 0) -OPTIONAL_INT_ARG(v_max, 0) -LABEL_ARG(display_format) -CALL_FUNCTION(DragInt, bool, label, v, v_speed, v_min, v_max, display_format) -PUSH_BOOL(ret) -END_INT_POINTER(v) -END_IMGUI_FUNC -// IMGUI_API bool DragInt2(const char* label, int v[2], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f"); -// Unsupported arg type int v[2] -// IMGUI_API bool DragInt3(const char* label, int v[3], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f"); -// Unsupported arg type int v[3] -// IMGUI_API bool DragInt4(const char* label, int v[4], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f"); -// Unsupported arg type int v[4] -// IMGUI_API bool DragIntRange2(const char* label, int* v_current_min, int* v_current_max, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f", const char* display_format_max = NULL); -IMGUI_FUNCTION(DragIntRange2) -LABEL_ARG(label) -INT_POINTER_ARG(v_current_min) -INT_POINTER_ARG(v_current_max) -OPTIONAL_NUMBER_ARG(v_speed, 1.0f) -OPTIONAL_INT_ARG(v_min, 0) -OPTIONAL_INT_ARG(v_max, 0) -LABEL_ARG(display_format) -OPTIONAL_LABEL_ARG(display_format_max) -CALL_FUNCTION(DragIntRange2, bool, label, v_current_min, v_current_max, v_speed, v_min, v_max, display_format, display_format_max) -PUSH_BOOL(ret) -END_INT_POINTER(v_current_min) -END_INT_POINTER(v_current_max) -END_IMGUI_FUNC -// IMGUI_API bool InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags = 0, ImGuiTextEditCallback callback = NULL, void* user_data = NULL); -// Unsupported arg type char* buf -// Unsupported arg type size_t buf_size -// Unsupported arg type ImGuiTextEditCallback callback = NULL -// Unsupported arg type void* user_data = NULL -// IMGUI_API bool InputTextMultiline(const char* label, char* buf, size_t buf_size, const ImVec2& size = ImVec2 0 0, ImGuiInputTextFlags flags = 0, ImGuiTextEditCallback callback = NULL, void* user_data = NULL); -// Unsupported arg type char* buf -// Unsupported arg type size_t buf_size -// Unsupported arg type ImGuiTextEditCallback callback = NULL -// Unsupported arg type void* user_data = NULL -// IMGUI_API bool InputFloat(const char* label, float* v, float step = 0.0f, float step_fast = 0.0f, int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0); -IMGUI_FUNCTION(InputFloat) -LABEL_ARG(label) -FLOAT_POINTER_ARG(v) -OPTIONAL_NUMBER_ARG(step, 0.0f) -OPTIONAL_NUMBER_ARG(step_fast, 0.0f) -OPTIONAL_INT_ARG(decimal_precision, -1) -OPTIONAL_INT_ARG(extra_flags, 0) -CALL_FUNCTION(InputFloat, bool, label, v, step, step_fast, decimal_precision, extra_flags) -PUSH_BOOL(ret) -END_FLOAT_POINTER(v) -END_IMGUI_FUNC -// IMGUI_API bool InputFloat2(const char* label, float v[2], int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0); -// Unsupported arg type float v[2] -// IMGUI_API bool InputFloat3(const char* label, float v[3], int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0); -// Unsupported arg type float v[3] -// IMGUI_API bool InputFloat4(const char* label, float v[4], int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0); -// Unsupported arg type float v[4] -// IMGUI_API bool InputInt(const char* label, int* v, int step = 1, int step_fast = 100, ImGuiInputTextFlags extra_flags = 0); -IMGUI_FUNCTION(InputInt) -LABEL_ARG(label) -INT_POINTER_ARG(v) -OPTIONAL_INT_ARG(step, 1) -OPTIONAL_INT_ARG(step_fast, 100) -OPTIONAL_INT_ARG(extra_flags, 0) -CALL_FUNCTION(InputInt, bool, label, v, step, step_fast, extra_flags) -PUSH_BOOL(ret) -END_INT_POINTER(v) -END_IMGUI_FUNC -// IMGUI_API bool InputInt2(const char* label, int v[2], ImGuiInputTextFlags extra_flags = 0); -// Unsupported arg type int v[2] -// IMGUI_API bool InputInt3(const char* label, int v[3], ImGuiInputTextFlags extra_flags = 0); -// Unsupported arg type int v[3] -// IMGUI_API bool InputInt4(const char* label, int v[4], ImGuiInputTextFlags extra_flags = 0); -// Unsupported arg type int v[4] -// IMGUI_API bool SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f); // adjust display_format to decorate the value with a prefix or a suffix for in-slider labels or unit display. Use power!=1.0 for logarithmic sliders -IMGUI_FUNCTION(SliderFloat) -LABEL_ARG(label) -FLOAT_POINTER_ARG(v) -NUMBER_ARG(v_min) -NUMBER_ARG(v_max) -LABEL_ARG(display_format) -OPTIONAL_NUMBER_ARG(power, 1.0f) -CALL_FUNCTION(SliderFloat, bool, label, v, v_min, v_max, display_format, power) -PUSH_BOOL(ret) -END_FLOAT_POINTER(v) -END_IMGUI_FUNC -// IMGUI_API bool SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f); -// Unsupported arg type float v[2] -// IMGUI_API bool SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f); -// Unsupported arg type float v[3] -// IMGUI_API bool SliderFloat4(const char* label, float v[4], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f); -// Unsupported arg type float v[4] -// IMGUI_API bool SliderAngle(const char* label, float* v_rad, float v_degrees_min = -360.0f, float v_degrees_max = +360.0f); -IMGUI_FUNCTION(SliderAngle) -LABEL_ARG(label) -FLOAT_POINTER_ARG(v_rad) -OPTIONAL_NUMBER_ARG(v_degrees_min, -360.0f) -OPTIONAL_NUMBER_ARG(v_degrees_max, +360.0f) -CALL_FUNCTION(SliderAngle, bool, label, v_rad, v_degrees_min, v_degrees_max) -PUSH_BOOL(ret) -END_FLOAT_POINTER(v_rad) -END_IMGUI_FUNC -// IMGUI_API bool SliderInt(const char* label, int* v, int v_min, int v_max, const char* display_format = "%.0f"); -IMGUI_FUNCTION(SliderInt) -LABEL_ARG(label) -INT_POINTER_ARG(v) -INT_ARG(v_min) -INT_ARG(v_max) -LABEL_ARG(display_format) -CALL_FUNCTION(SliderInt, bool, label, v, v_min, v_max, display_format) -PUSH_BOOL(ret) -END_INT_POINTER(v) -END_IMGUI_FUNC -// IMGUI_API bool SliderInt2(const char* label, int v[2], int v_min, int v_max, const char* display_format = "%.0f"); -// Unsupported arg type int v[2] -// IMGUI_API bool SliderInt3(const char* label, int v[3], int v_min, int v_max, const char* display_format = "%.0f"); -// Unsupported arg type int v[3] -// IMGUI_API bool SliderInt4(const char* label, int v[4], int v_min, int v_max, const char* display_format = "%.0f"); -// Unsupported arg type int v[4] -// IMGUI_API bool VSliderFloat(const char* label, const ImVec2& size, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f); -IMGUI_FUNCTION(VSliderFloat) -LABEL_ARG(label) -IM_VEC_2_ARG(size) -FLOAT_POINTER_ARG(v) -NUMBER_ARG(v_min) -NUMBER_ARG(v_max) -LABEL_ARG(display_format) -OPTIONAL_NUMBER_ARG(power, 1.0f) -CALL_FUNCTION(VSliderFloat, bool, label, size, v, v_min, v_max, display_format, power) -PUSH_BOOL(ret) -END_FLOAT_POINTER(v) -END_IMGUI_FUNC -// IMGUI_API bool VSliderInt(const char* label, const ImVec2& size, int* v, int v_min, int v_max, const char* display_format = "%.0f"); -IMGUI_FUNCTION(VSliderInt) -LABEL_ARG(label) -IM_VEC_2_ARG(size) -INT_POINTER_ARG(v) -INT_ARG(v_min) -INT_ARG(v_max) -LABEL_ARG(display_format) -CALL_FUNCTION(VSliderInt, bool, label, size, v, v_min, v_max, display_format) -PUSH_BOOL(ret) -END_INT_POINTER(v) -END_IMGUI_FUNC -// IMGUI_API bool ColorEdit3(const char* label, float col[3], ImGuiColorEditFlags flags = 0); -// Unsupported arg type float col[3] -// Unsupported arg type ImGuiColorEditFlags flags = 0 -// IMGUI_API bool ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flags = 0); -// Unsupported arg type float col[4] -// Unsupported arg type ImGuiColorEditFlags flags = 0 -// IMGUI_API bool ColorPicker3(const char* label, float col[3], ImGuiColorEditFlags flags = 0); -// Unsupported arg type float col[3] -// Unsupported arg type ImGuiColorEditFlags flags = 0 -// IMGUI_API bool ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags flags = 0, const float* ref_col = NULL); -// Unsupported arg type float col[4] -// Unsupported arg type ImGuiColorEditFlags flags = 0 -// Unsupported arg type const float* ref_col = NULL -// IMGUI_API bool ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFlags flags = 0, ImVec2 size = ImVec2 0 0); // display a colored square/button, hover for details, return true when pressed. -// Unsupported arg type ImGuiColorEditFlags flags = 0 -// Unsupported arg type ImVec2 size = ImVec2 0 0 -// IMGUI_API void SetColorEditOptions(ImGuiColorEditFlags flags); // initialize current options (generally on application startup) if you want to select a default format, picker type, etc. User will be able to change many settings, unless you pass the _NoOptions flag to your calls. -// Unsupported arg type ImGuiColorEditFlags flags -// IMGUI_API bool TreeNode(const char* label); // if returning 'true' the node is open and the tree id is pushed into the id stack. user is responsible for calling TreePop(). -IMGUI_FUNCTION(TreeNode) -LABEL_ARG(label) -CALL_FUNCTION(TreeNode, bool, label) -IF_RET_ADD_END_STACK(6) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool TreeNode(const char* str_id, const char* fmt, ...) IM_FMTARGS(2); // read the FAQ about why and how to use ID. to align arbitrary text at the same level as a TreeNode() you can use Bullet(). -// Unsupported arg type ...) IM_FMTARGS(2 -// IMGUI_API bool TreeNode(const void* ptr_id, const char* fmt, ...) IM_FMTARGS(2); // " -// Unsupported arg type const void* ptr_id -// Unsupported arg type ...) IM_FMTARGS(2 -// IMGUI_API bool TreeNodeV(const char* str_id, const char* fmt, va_list args) IM_FMTLIST(2); -// Unsupported arg type va_list args) IM_FMTLIST(2 -// IMGUI_API bool TreeNodeV(const void* ptr_id, const char* fmt, va_list args) IM_FMTLIST(2); -// Unsupported arg type const void* ptr_id -// Unsupported arg type va_list args) IM_FMTLIST(2 -// IMGUI_API bool TreeNodeEx(const char* label, ImGuiTreeNodeFlags flags = 0); -// Unsupported arg type ImGuiTreeNodeFlags flags = 0 -// IMGUI_API bool TreeNodeEx(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, ...) IM_FMTARGS(3); -// Unsupported arg type ImGuiTreeNodeFlags flags -// Unsupported arg type ...) IM_FMTARGS(3 -// IMGUI_API bool TreeNodeEx(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, ...) IM_FMTARGS(3); -// Unsupported arg type const void* ptr_id -// Unsupported arg type ImGuiTreeNodeFlags flags -// Unsupported arg type ...) IM_FMTARGS(3 -// IMGUI_API bool TreeNodeExV(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) IM_FMTLIST(3); -// Unsupported arg type ImGuiTreeNodeFlags flags -// Unsupported arg type va_list args) IM_FMTLIST(3 -// IMGUI_API bool TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) IM_FMTLIST(3); -// Unsupported arg type const void* ptr_id -// Unsupported arg type ImGuiTreeNodeFlags flags -// Unsupported arg type va_list args) IM_FMTLIST(3 -// IMGUI_API void TreePush(const char* str_id); // ~ Indent()+PushId(). Already called by TreeNode() when returning true, but you can call Push/Pop yourself for layout purpose -IMGUI_FUNCTION(TreePush) -LABEL_ARG(str_id) -CALL_FUNCTION_NO_RET(TreePush, str_id) -ADD_END_STACK(6) -END_IMGUI_FUNC -// IMGUI_API void TreePush(const void* ptr_id = NULL); // " -// Unsupported arg type const void* ptr_id = NULL -// IMGUI_API void TreePop(); // ~ Unindent()+PopId() -IMGUI_FUNCTION(TreePop) -CALL_FUNCTION_NO_RET(TreePop) -POP_END_STACK(6) -END_IMGUI_FUNC -// IMGUI_API void TreeAdvanceToLabelPos(); // advance cursor x position by GetTreeNodeToLabelSpacing() -IMGUI_FUNCTION(TreeAdvanceToLabelPos) -CALL_FUNCTION_NO_RET(TreeAdvanceToLabelPos) -END_IMGUI_FUNC -// IMGUI_API float GetTreeNodeToLabelSpacing(); // horizontal distance preceding label when using TreeNode*() or Bullet() == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode -IMGUI_FUNCTION(GetTreeNodeToLabelSpacing) -CALL_FUNCTION(GetTreeNodeToLabelSpacing, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API void SetNextTreeNodeOpen(bool is_open, ImGuiCond cond = 0); // set next TreeNode/CollapsingHeader open state. -// Unsupported arg type ImGuiCond cond = 0 -// IMGUI_API bool CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags = 0); // if returning 'true' the header is open. doesn't indent nor push on ID stack. user doesn't have to call TreePop(). -// Unsupported arg type ImGuiTreeNodeFlags flags = 0 -// IMGUI_API bool CollapsingHeader(const char* label, bool* p_open, ImGuiTreeNodeFlags flags = 0); // when 'p_open' isn't NULL, display an additional small close button on upper right of the header -// Unsupported arg type ImGuiTreeNodeFlags flags = 0 -// IMGUI_API bool Selectable(const char* label, bool selected = false, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2 0 0); // size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height -IMGUI_FUNCTION(Selectable) -LABEL_ARG(label) -OPTIONAL_BOOL_ARG(selected, false) -OPTIONAL_INT_ARG(flags, 0) -OPTIONAL_IM_VEC_2_ARG(size, 0, 0) -CALL_FUNCTION(Selectable, bool, label, selected, flags, size) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2 0 0); -IMGUI_FUNCTION(Selectable_4) -LABEL_ARG(label) -BOOL_POINTER_ARG(p_selected) -OPTIONAL_INT_ARG(flags, 0) -OPTIONAL_IM_VEC_2_ARG(size, 0, 0) -CALL_FUNCTION(Selectable, bool, label, p_selected, flags, size) -PUSH_BOOL(ret) -END_BOOL_POINTER(p_selected) -END_IMGUI_FUNC -// IMGUI_API bool ListBox(const char* label, int* current_item, const char* const* items, int items_count, int height_in_items = -1); -// Unsupported arg type const char* const* items -// IMGUI_API bool ListBox(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int height_in_items = -1); -// Unsupported arg type bool (*items_getter)(void* data -// Unsupported arg type const char** out_text) -// Unsupported arg type void* data -// IMGUI_API bool ListBoxHeader(const char* label, const ImVec2& size = ImVec2 0 0); // use if you want to reimplement ListBox() will custom data or interactions. make sure to call ListBoxFooter() afterwards. -IMGUI_FUNCTION(ListBoxHeader) -LABEL_ARG(label) -OPTIONAL_IM_VEC_2_ARG(size, 0, 0) -CALL_FUNCTION(ListBoxHeader, bool, label, size) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool ListBoxHeader(const char* label, int items_count, int height_in_items = -1); // " -IMGUI_FUNCTION(ListBoxHeader_3) -LABEL_ARG(label) -INT_ARG(items_count) -OPTIONAL_INT_ARG(height_in_items, -1) -CALL_FUNCTION(ListBoxHeader, bool, label, items_count, height_in_items) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API void ListBoxFooter(); // terminate the scrolling region -IMGUI_FUNCTION(ListBoxFooter) -CALL_FUNCTION_NO_RET(ListBoxFooter) -END_IMGUI_FUNC -// IMGUI_API void Value(const char* prefix, bool b); -IMGUI_FUNCTION(Value) -LABEL_ARG(prefix) -BOOL_ARG(b) -CALL_FUNCTION_NO_RET(Value, prefix, b) -END_IMGUI_FUNC -// IMGUI_API void Value(const char* prefix, int v); -IMGUI_FUNCTION(Value_2) -LABEL_ARG(prefix) -INT_ARG(v) -CALL_FUNCTION_NO_RET(Value, prefix, v) -END_IMGUI_FUNC -// IMGUI_API void Value(const char* prefix, unsigned int v); -IMGUI_FUNCTION(Value_2_2) -LABEL_ARG(prefix) -UINT_ARG(v) -CALL_FUNCTION_NO_RET(Value, prefix, v) -END_IMGUI_FUNC -// IMGUI_API void Value(const char* prefix, float v, const char* float_format = NULL); -IMGUI_FUNCTION(Value_3) -LABEL_ARG(prefix) -NUMBER_ARG(v) -OPTIONAL_LABEL_ARG(float_format) -CALL_FUNCTION_NO_RET(Value, prefix, v, float_format) -END_IMGUI_FUNC -// IMGUI_API void SetTooltip(const char* fmt, ...) IM_FMTARGS(1); // set text tooltip under mouse-cursor, typically use with ImGui::IsItemHovered(). overidde any previous call to SetTooltip(). -// Unsupported arg type ...) IM_FMTARGS(1 -// IMGUI_API void SetTooltipV(const char* fmt, va_list args) IM_FMTLIST(1); -// Unsupported arg type va_list args) IM_FMTLIST(1 -// IMGUI_API void BeginTooltip(); // begin/append a tooltip window. to create full-featured tooltip (with any kind of contents). -IMGUI_FUNCTION(BeginTooltip) -CALL_FUNCTION_NO_RET(BeginTooltip) -ADD_END_STACK(7) -END_IMGUI_FUNC -// IMGUI_API void EndTooltip(); -IMGUI_FUNCTION(EndTooltip) -CALL_FUNCTION_NO_RET(EndTooltip) -POP_END_STACK(7) -END_IMGUI_FUNC -// IMGUI_API bool BeginMainMenuBar(); // create and append to a full screen menu-bar. only call EndMainMenuBar() if this returns true! -IMGUI_FUNCTION(BeginMainMenuBar) -CALL_FUNCTION(BeginMainMenuBar, bool) -IF_RET_ADD_END_STACK(8) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API void EndMainMenuBar(); -IMGUI_FUNCTION(EndMainMenuBar) -CALL_FUNCTION_NO_RET(EndMainMenuBar) -POP_END_STACK(8) -END_IMGUI_FUNC -// IMGUI_API bool BeginMenuBar(); // append to menu-bar of current window (requires ImGuiWindowFlags_MenuBar flag set on parent window). only call EndMenuBar() if this returns true! -IMGUI_FUNCTION(BeginMenuBar) -CALL_FUNCTION(BeginMenuBar, bool) -IF_RET_ADD_END_STACK(9) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API void EndMenuBar(); -IMGUI_FUNCTION(EndMenuBar) -CALL_FUNCTION_NO_RET(EndMenuBar) -POP_END_STACK(9) -END_IMGUI_FUNC -// IMGUI_API bool BeginMenu(const char* label, bool enabled = true); // create a sub-menu entry. only call EndMenu() if this returns true! -IMGUI_FUNCTION(BeginMenu) -LABEL_ARG(label) -OPTIONAL_BOOL_ARG(enabled, true) -CALL_FUNCTION(BeginMenu, bool, label, enabled) -IF_RET_ADD_END_STACK(10) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API void EndMenu(); -IMGUI_FUNCTION(EndMenu) -CALL_FUNCTION_NO_RET(EndMenu) -POP_END_STACK(10) -END_IMGUI_FUNC -// IMGUI_API bool MenuItem(const char* label, const char* shortcut = NULL, bool selected = false, bool enabled = true); // return true when activated. shortcuts are displayed for convenience but not processed by ImGui at the moment -IMGUI_FUNCTION(MenuItem) -LABEL_ARG(label) -OPTIONAL_LABEL_ARG(shortcut) -OPTIONAL_BOOL_ARG(selected, false) -OPTIONAL_BOOL_ARG(enabled, true) -CALL_FUNCTION(MenuItem, bool, label, shortcut, selected, enabled) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool MenuItem(const char* label, const char* shortcut, bool* p_selected, bool enabled = true); // return true when activated + toggle (*p_selected) if p_selected != NULL -IMGUI_FUNCTION(MenuItem_4) -LABEL_ARG(label) -LABEL_ARG(shortcut) -BOOL_POINTER_ARG(p_selected) -OPTIONAL_BOOL_ARG(enabled, true) -CALL_FUNCTION(MenuItem, bool, label, shortcut, p_selected, enabled) -PUSH_BOOL(ret) -END_BOOL_POINTER(p_selected) -END_IMGUI_FUNC -// IMGUI_API void OpenPopup(const char* str_id); // call to mark popup as open (don't call every frame!). popups are closed when user click outside, or if CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. By default, Selectable()/MenuItem() are calling CloseCurrentPopup(). Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level). -IMGUI_FUNCTION(OpenPopup) -LABEL_ARG(str_id) -CALL_FUNCTION_NO_RET(OpenPopup, str_id) -END_IMGUI_FUNC -// IMGUI_API bool OpenPopupOnItemClick(const char* str_id = NULL, int mouse_button = 1); // helper to open popup when clicked on last item. return true when just opened. -IMGUI_FUNCTION(OpenPopupOnItemClick) -OPTIONAL_LABEL_ARG(str_id) -OPTIONAL_INT_ARG(mouse_button, 1) -CALL_FUNCTION(OpenPopupOnItemClick, bool, str_id, mouse_button) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool BeginPopup(const char* str_id); // return true if the popup is open, and you can start outputting to it. only call EndPopup() if BeginPopup() returned true! -IMGUI_FUNCTION(BeginPopup) -LABEL_ARG(str_id) -CALL_FUNCTION(BeginPopup, bool, str_id) -IF_RET_ADD_END_STACK(11) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool BeginPopupModal(const char* name, bool* p_open = NULL, ImGuiWindowFlags extra_flags = 0); // modal dialog (block interactions behind the modal window, can't close the modal window by clicking outside) -IMGUI_FUNCTION(BeginPopupModal) -LABEL_ARG(name) -OPTIONAL_BOOL_POINTER_ARG(p_open) -OPTIONAL_INT_ARG(extra_flags, 0) -CALL_FUNCTION(BeginPopupModal, bool, name, p_open, extra_flags) -IF_RET_ADD_END_STACK(11) -PUSH_BOOL(ret) -END_BOOL_POINTER(p_open) -END_IMGUI_FUNC -// IMGUI_API bool BeginPopupContextItem(const char* str_id = NULL, int mouse_button = 1); // helper to open and begin popup when clicked on last item. if you can pass a NULL str_id only if the previous item had an id. If you want to use that on a non-interactive item such as Text() you need to pass in an explicit ID here. read comments in .cpp! -IMGUI_FUNCTION(BeginPopupContextItem) -OPTIONAL_LABEL_ARG(str_id) -OPTIONAL_INT_ARG(mouse_button, 1) -CALL_FUNCTION(BeginPopupContextItem, bool, str_id, mouse_button) -IF_RET_ADD_END_STACK(11) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool BeginPopupContextWindow(const char* str_id = NULL, int mouse_button = 1, bool also_over_items = true); // helper to open and begin popup when clicked on current window. -IMGUI_FUNCTION(BeginPopupContextWindow) -OPTIONAL_LABEL_ARG(str_id) -OPTIONAL_INT_ARG(mouse_button, 1) -OPTIONAL_BOOL_ARG(also_over_items, true) -CALL_FUNCTION(BeginPopupContextWindow, bool, str_id, mouse_button, also_over_items) -IF_RET_ADD_END_STACK(11) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool BeginPopupContextVoid(const char* str_id = NULL, int mouse_button = 1); // helper to open and begin popup when clicked in void (where there are no imgui windows). -IMGUI_FUNCTION(BeginPopupContextVoid) -OPTIONAL_LABEL_ARG(str_id) -OPTIONAL_INT_ARG(mouse_button, 1) -CALL_FUNCTION(BeginPopupContextVoid, bool, str_id, mouse_button) -IF_RET_ADD_END_STACK(11) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API void EndPopup(); -IMGUI_FUNCTION(EndPopup) -CALL_FUNCTION_NO_RET(EndPopup) -POP_END_STACK(11) -END_IMGUI_FUNC -// IMGUI_API bool IsPopupOpen(const char* str_id); // return true if the popup is open -IMGUI_FUNCTION(IsPopupOpen) -LABEL_ARG(str_id) -CALL_FUNCTION(IsPopupOpen, bool, str_id) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API void CloseCurrentPopup(); // close the popup we have begin-ed into. clicking on a MenuItem or Selectable automatically close the current popup. -IMGUI_FUNCTION(CloseCurrentPopup) -CALL_FUNCTION_NO_RET(CloseCurrentPopup) -END_IMGUI_FUNC -// IMGUI_API void LogToTTY(int max_depth = -1); // start logging to tty -IMGUI_FUNCTION(LogToTTY) -OPTIONAL_INT_ARG(max_depth, -1) -CALL_FUNCTION_NO_RET(LogToTTY, max_depth) -END_IMGUI_FUNC -// IMGUI_API void LogToFile(int max_depth = -1, const char* filename = NULL); // start logging to file -IMGUI_FUNCTION(LogToFile) -OPTIONAL_INT_ARG(max_depth, -1) -OPTIONAL_LABEL_ARG(filename) -CALL_FUNCTION_NO_RET(LogToFile, max_depth, filename) -END_IMGUI_FUNC -// IMGUI_API void LogToClipboard(int max_depth = -1); // start logging to OS clipboard -IMGUI_FUNCTION(LogToClipboard) -OPTIONAL_INT_ARG(max_depth, -1) -CALL_FUNCTION_NO_RET(LogToClipboard, max_depth) -END_IMGUI_FUNC -// IMGUI_API void LogFinish(); // stop logging (close file, etc.) -IMGUI_FUNCTION(LogFinish) -CALL_FUNCTION_NO_RET(LogFinish) -END_IMGUI_FUNC -// IMGUI_API void LogButtons(); // helper to display buttons for logging to tty/file/clipboard -IMGUI_FUNCTION(LogButtons) -CALL_FUNCTION_NO_RET(LogButtons) -END_IMGUI_FUNC -// IMGUI_API void LogText(const char* fmt, ...) IM_FMTARGS(1); // pass text data straight to log (without being displayed) -// Unsupported arg type ...) IM_FMTARGS(1 -// IMGUI_API bool BeginDragDropSource(ImGuiDragDropFlags flags = 0, int mouse_button = 0); // call when the current item is active. If this return true, you can call SetDragDropPayload() + EndDragDropSource() -// Unsupported arg type ImGuiDragDropFlags flags = 0 -// IMGUI_API bool SetDragDropPayload(const char* type, const void* data, size_t size, ImGuiCond cond = 0);// type is a user defined string of maximum 8 characters. Strings starting with '_' are reserved for dear imgui internal types. Data is copied and held by imgui. -// Unsupported arg type const void* data -// Unsupported arg type size_t size -// Unsupported arg type ImGuiCond cond = 0 -// IMGUI_API void EndDragDropSource(); -IMGUI_FUNCTION(EndDragDropSource) -CALL_FUNCTION_NO_RET(EndDragDropSource) -POP_END_STACK(12) -END_IMGUI_FUNC -// IMGUI_API bool BeginDragDropTarget(); // call after submitting an item that may receive an item. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget() -IMGUI_FUNCTION(BeginDragDropTarget) -CALL_FUNCTION(BeginDragDropTarget, bool) -IF_RET_ADD_END_STACK(13) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API const ImGuiPayload* AcceptDragDropPayload(const char* type, ImGuiDragDropFlags flags = 0); // accept contents of a given type. If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released. -// Unsupported return type const -// Unsupported arg type ImGuiDragDropFlags flags = 0 -// IMGUI_API void EndDragDropTarget(); -IMGUI_FUNCTION(EndDragDropTarget) -CALL_FUNCTION_NO_RET(EndDragDropTarget) -POP_END_STACK(13) -END_IMGUI_FUNC -// IMGUI_API void PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect); -IMGUI_FUNCTION(PushClipRect) -IM_VEC_2_ARG(clip_rect_min) -IM_VEC_2_ARG(clip_rect_max) -BOOL_ARG(intersect_with_current_clip_rect) -CALL_FUNCTION_NO_RET(PushClipRect, clip_rect_min, clip_rect_max, intersect_with_current_clip_rect) -END_IMGUI_FUNC -// IMGUI_API void PopClipRect(); -IMGUI_FUNCTION(PopClipRect) -CALL_FUNCTION_NO_RET(PopClipRect) -END_IMGUI_FUNC -// IMGUI_API void StyleColorsClassic(ImGuiStyle* dst = NULL); -// Unsupported arg type ImGuiStyle* dst = NULL -// IMGUI_API void StyleColorsDark(ImGuiStyle* dst = NULL); -// Unsupported arg type ImGuiStyle* dst = NULL -// IMGUI_API void StyleColorsLight(ImGuiStyle* dst = NULL); -// Unsupported arg type ImGuiStyle* dst = NULL -// IMGUI_API void SetItemDefaultFocus(); // make last item the default focused item of a window (WIP navigation branch only). Pleaase use instead of SetScrollHere(). -IMGUI_FUNCTION(SetItemDefaultFocus) -CALL_FUNCTION_NO_RET(SetItemDefaultFocus) -END_IMGUI_FUNC -// IMGUI_API void SetKeyboardFocusHere(int offset = 0); // focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget. Use -1 to access previous widget. -IMGUI_FUNCTION(SetKeyboardFocusHere) -OPTIONAL_INT_ARG(offset, 0) -CALL_FUNCTION_NO_RET(SetKeyboardFocusHere, offset) -END_IMGUI_FUNC -// IMGUI_API bool IsItemHovered(ImGuiHoveredFlags flags = 0); // is the last item hovered? (and usable, aka not blocked by a popup, etc.). See ImGuiHoveredFlags for more options. -// Unsupported arg type ImGuiHoveredFlags flags = 0 -// IMGUI_API bool IsItemActive(); // is the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false) -IMGUI_FUNCTION(IsItemActive) -CALL_FUNCTION(IsItemActive, bool) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool IsItemClicked(int mouse_button = 0); // is the last item clicked? (e.g. button/node just clicked on) -IMGUI_FUNCTION(IsItemClicked) -OPTIONAL_INT_ARG(mouse_button, 0) -CALL_FUNCTION(IsItemClicked, bool, mouse_button) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool IsItemVisible(); // is the last item visible? (aka not out of sight due to clipping/scrolling.) -IMGUI_FUNCTION(IsItemVisible) -CALL_FUNCTION(IsItemVisible, bool) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool IsAnyItemHovered(); -IMGUI_FUNCTION(IsAnyItemHovered) -CALL_FUNCTION(IsAnyItemHovered, bool) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool IsAnyItemActive(); -IMGUI_FUNCTION(IsAnyItemActive) -CALL_FUNCTION(IsAnyItemActive, bool) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API ImVec2 GetItemRectMin(); // get bounding rectangle of last item, in screen space -IMGUI_FUNCTION(GetItemRectMin) -CALL_FUNCTION(GetItemRectMin, ImVec2) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API ImVec2 GetItemRectMax(); // " -IMGUI_FUNCTION(GetItemRectMax) -CALL_FUNCTION(GetItemRectMax, ImVec2) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API ImVec2 GetItemRectSize(); // get size of last item, in screen space -IMGUI_FUNCTION(GetItemRectSize) -CALL_FUNCTION(GetItemRectSize, ImVec2) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API void SetItemAllowOverlap(); // allow last item to be overlapped by a subsequent item. sometimes useful with invisible buttons, selectables, etc. to catch unused area. -IMGUI_FUNCTION(SetItemAllowOverlap) -CALL_FUNCTION_NO_RET(SetItemAllowOverlap) -END_IMGUI_FUNC -// IMGUI_API bool IsWindowFocused(ImGuiFocusedFlags flags = 0); // is current window focused? or its root/child, depending on flags. see flags for options. -// Unsupported arg type ImGuiFocusedFlags flags = 0 -// IMGUI_API bool IsWindowHovered(ImGuiHoveredFlags flags = 0); // is current window hovered (and typically: not blocked by a popup/modal)? see flags for options. -// Unsupported arg type ImGuiHoveredFlags flags = 0 -// IMGUI_API bool IsAnyWindowFocused(); -IMGUI_FUNCTION(IsAnyWindowFocused) -CALL_FUNCTION(IsAnyWindowFocused, bool) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool IsAnyWindowHovered(); // is mouse hovering any visible window -IMGUI_FUNCTION(IsAnyWindowHovered) -CALL_FUNCTION(IsAnyWindowHovered, bool) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool IsRectVisible(const ImVec2& size); // test if rectangle (of given size, starting from cursor position) is visible / not clipped. -IMGUI_FUNCTION(IsRectVisible) -IM_VEC_2_ARG(size) -CALL_FUNCTION(IsRectVisible, bool, size) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max); // test if rectangle (in screen space) is visible / not clipped. to perform coarse clipping on user's side. -IMGUI_FUNCTION(IsRectVisible_2) -IM_VEC_2_ARG(rect_min) -IM_VEC_2_ARG(rect_max) -CALL_FUNCTION(IsRectVisible, bool, rect_min, rect_max) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API float GetTime(); -IMGUI_FUNCTION(GetTime) -CALL_FUNCTION(GetTime, float) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API int GetFrameCount(); -// Unsupported return type int -// IMGUI_API ImDrawList* GetOverlayDrawList(); // this draw list will be the last rendered one, useful to quickly draw overlays shapes/text -// Unsupported return type ImDrawList* -// IMGUI_API ImDrawListSharedData* GetDrawListSharedData(); -// Unsupported return type ImDrawListSharedData* -// IMGUI_API const char* GetStyleColorName(ImGuiCol idx); -// Unsupported return type const -// IMGUI_API ImVec2 CalcItemRectClosestPoint(const ImVec2& pos, bool on_edge = false, float outward = +0.0f); // utility to find the closest point the last item bounding rectangle edge. useful to visually link items -IMGUI_FUNCTION(CalcItemRectClosestPoint) -IM_VEC_2_ARG(pos) -OPTIONAL_BOOL_ARG(on_edge, false) -OPTIONAL_NUMBER_ARG(outward, +0.0f) -CALL_FUNCTION(CalcItemRectClosestPoint, ImVec2, pos, on_edge, outward) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API ImVec2 CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f); -IMGUI_FUNCTION(CalcTextSize) -LABEL_ARG(text) -OPTIONAL_LABEL_ARG(text_end) -OPTIONAL_BOOL_ARG(hide_text_after_double_hash, false) -OPTIONAL_NUMBER_ARG(wrap_width, -1.0f) -CALL_FUNCTION(CalcTextSize, ImVec2, text, text_end, hide_text_after_double_hash, wrap_width) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // calculate coarse clipping for large list of evenly sized items. Prefer using the ImGuiListClipper higher-level helper if you can. -IMGUI_FUNCTION(CalcListClipping) -INT_ARG(items_count) -NUMBER_ARG(items_height) -INT_POINTER_ARG(out_items_display_start) -INT_POINTER_ARG(out_items_display_end) -CALL_FUNCTION_NO_RET(CalcListClipping, items_count, items_height, out_items_display_start, out_items_display_end) -END_INT_POINTER(out_items_display_start) -END_INT_POINTER(out_items_display_end) -END_IMGUI_FUNC -// IMGUI_API bool BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags extra_flags = 0); // helper to create a child window / scrolling region that looks like a normal widget frame -IMGUI_FUNCTION(BeginChildFrame) -UINT_ARG(id) -IM_VEC_2_ARG(size) -OPTIONAL_INT_ARG(extra_flags, 0) -CALL_FUNCTION(BeginChildFrame, bool, id, size, extra_flags) -IF_RET_ADD_END_STACK(14) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API void EndChildFrame(); -IMGUI_FUNCTION(EndChildFrame) -CALL_FUNCTION_NO_RET(EndChildFrame) -POP_END_STACK(14) -END_IMGUI_FUNC -// IMGUI_API ImVec4 ColorConvertU32ToFloat4(ImU32 in); -// Unsupported return type ImVec4 -// IMGUI_API ImU32 ColorConvertFloat4ToU32(const ImVec4& in); -IMGUI_FUNCTION(ColorConvertFloat4ToU32) -IM_VEC_4_ARG(in) -CALL_FUNCTION(ColorConvertFloat4ToU32, unsigned int, in) -PUSH_NUMBER(ret) -END_IMGUI_FUNC -// IMGUI_API void ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float& out_s, float& out_v); -// Unsupported arg type float& out_h -// Unsupported arg type float& out_s -// Unsupported arg type float& out_v -// IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b); -// Unsupported arg type float& out_r -// Unsupported arg type float& out_g -// Unsupported arg type float& out_b -// IMGUI_API int GetKeyIndex(ImGuiKey imgui_key); // map ImGuiKey_* values into user's key index. == io.KeyMap[key] -// Unsupported return type int -// IMGUI_API bool IsKeyDown(int user_key_index); // is key being held. == io.KeysDown[user_key_index]. note that imgui doesn't know the semantic of each entry of io.KeyDown[]. Use your own indices/enums according to how your backend/engine stored them into KeyDown[]! -IMGUI_FUNCTION(IsKeyDown) -INT_ARG(user_key_index) -CALL_FUNCTION(IsKeyDown, bool, user_key_index) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool IsKeyPressed(int user_key_index, bool repeat = true); // was key pressed (went from !Down to Down). if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate -IMGUI_FUNCTION(IsKeyPressed) -INT_ARG(user_key_index) -OPTIONAL_BOOL_ARG(repeat, true) -CALL_FUNCTION(IsKeyPressed, bool, user_key_index, repeat) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool IsKeyReleased(int user_key_index); // was key released (went from Down to !Down).. -IMGUI_FUNCTION(IsKeyReleased) -INT_ARG(user_key_index) -CALL_FUNCTION(IsKeyReleased, bool, user_key_index) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API int GetKeyPressedAmount(int key_index, float repeat_delay, float rate); // uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate -// Unsupported return type int -// IMGUI_API bool IsMouseDown(int button); // is mouse button held -IMGUI_FUNCTION(IsMouseDown) -INT_ARG(button) -CALL_FUNCTION(IsMouseDown, bool, button) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool IsMouseClicked(int button, bool repeat = false); // did mouse button clicked (went from !Down to Down) -IMGUI_FUNCTION(IsMouseClicked) -INT_ARG(button) -OPTIONAL_BOOL_ARG(repeat, false) -CALL_FUNCTION(IsMouseClicked, bool, button, repeat) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool IsMouseDoubleClicked(int button); // did mouse button double-clicked. a double-click returns false in IsMouseClicked(). uses io.MouseDoubleClickTime. -IMGUI_FUNCTION(IsMouseDoubleClicked) -INT_ARG(button) -CALL_FUNCTION(IsMouseDoubleClicked, bool, button) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool IsMouseReleased(int button); // did mouse button released (went from Down to !Down) -IMGUI_FUNCTION(IsMouseReleased) -INT_ARG(button) -CALL_FUNCTION(IsMouseReleased, bool, button) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool IsMouseDragging(int button = 0, float lock_threshold = -1.0f); // is mouse dragging. if lock_threshold < -1.0f uses io.MouseDraggingThreshold -IMGUI_FUNCTION(IsMouseDragging) -OPTIONAL_INT_ARG(button, 0) -OPTIONAL_NUMBER_ARG(lock_threshold, -1.0f) -CALL_FUNCTION(IsMouseDragging, bool, button, lock_threshold) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip = true); // is mouse hovering given bounding rect (in screen space). clipped by current clipping settings. disregarding of consideration of focus/window ordering/blocked by a popup. -IMGUI_FUNCTION(IsMouseHoveringRect) -IM_VEC_2_ARG(r_min) -IM_VEC_2_ARG(r_max) -OPTIONAL_BOOL_ARG(clip, true) -CALL_FUNCTION(IsMouseHoveringRect, bool, r_min, r_max, clip) -PUSH_BOOL(ret) -END_IMGUI_FUNC -// IMGUI_API bool IsMousePosValid(const ImVec2* mouse_pos = NULL); // -// Unsupported arg type const ImVec2* mouse_pos = NULL -// IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls -IMGUI_FUNCTION(GetMousePos) -CALL_FUNCTION(GetMousePos, ImVec2) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API ImVec2 GetMousePosOnOpeningCurrentPopup(); // retrieve backup of mouse positioning at the time of opening popup we have BeginPopup() into -IMGUI_FUNCTION(GetMousePosOnOpeningCurrentPopup) -CALL_FUNCTION(GetMousePosOnOpeningCurrentPopup, ImVec2) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API ImVec2 GetMouseDragDelta(int button = 0, float lock_threshold = -1.0f); // dragging amount since clicking. if lock_threshold < -1.0f uses io.MouseDraggingThreshold -IMGUI_FUNCTION(GetMouseDragDelta) -OPTIONAL_INT_ARG(button, 0) -OPTIONAL_NUMBER_ARG(lock_threshold, -1.0f) -CALL_FUNCTION(GetMouseDragDelta, ImVec2, button, lock_threshold) -PUSH_NUMBER(ret.x) -PUSH_NUMBER(ret.y) -END_IMGUI_FUNC -// IMGUI_API void ResetMouseDragDelta(int button = 0); // -IMGUI_FUNCTION(ResetMouseDragDelta) -OPTIONAL_INT_ARG(button, 0) -CALL_FUNCTION_NO_RET(ResetMouseDragDelta, button) -END_IMGUI_FUNC -// IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired cursor type, reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you -// Unsupported return type ImGuiMouseCursor -// IMGUI_API void SetMouseCursor(ImGuiMouseCursor type); // set desired cursor type -IMGUI_FUNCTION(SetMouseCursor) -INT_ARG(type) -CALL_FUNCTION_NO_RET(SetMouseCursor, type) -END_IMGUI_FUNC -// IMGUI_API void CaptureKeyboardFromApp(bool capture = true); // manually override io.WantCaptureKeyboard flag next frame (said flag is entirely left for your application handle). e.g. force capture keyboard when your widget is being hovered. -IMGUI_FUNCTION(CaptureKeyboardFromApp) -OPTIONAL_BOOL_ARG(capture, true) -CALL_FUNCTION_NO_RET(CaptureKeyboardFromApp, capture) -END_IMGUI_FUNC -// IMGUI_API void CaptureMouseFromApp(bool capture = true); // manually override io.WantCaptureMouse flag next frame (said flag is entirely left for your application handle). -IMGUI_FUNCTION(CaptureMouseFromApp) -OPTIONAL_BOOL_ARG(capture, true) -CALL_FUNCTION_NO_RET(CaptureMouseFromApp, capture) -END_IMGUI_FUNC -// IMGUI_API void* MemAlloc(size_t sz); -// Unsupported return type void* -// Unsupported arg type size_t sz -// IMGUI_API void MemFree(void* ptr); -// Unsupported arg type void* ptr -// IMGUI_API const char* GetClipboardText(); -// Unsupported return type const -// IMGUI_API void SetClipboardText(const char* text); -IMGUI_FUNCTION(SetClipboardText) -LABEL_ARG(text) -CALL_FUNCTION_NO_RET(SetClipboardText, text) -END_IMGUI_FUNC -// IMGUI_API const char* GetVersion(); -// Unsupported return type const -// IMGUI_API ImGuiContext* CreateContext(void* (*malloc_fn)(size_t) = NULL, void (*free_fn)(void*) = NULL); -// Unsupported return type ImGuiContext* -// Unsupported arg type void* (*malloc_fn)(size_t) = NULL -// Unsupported arg type void (*free_fn)(void*) = NULL -// IMGUI_API void DestroyContext(ImGuiContext* ctx); -// Unsupported arg type ImGuiContext* ctx -// IMGUI_API ImGuiContext* GetCurrentContext(); -// Unsupported return type ImGuiContext* -// IMGUI_API void SetCurrentContext(ImGuiContext* ctx); -// Unsupported arg type ImGuiContext* ctx -END_STACK_START -END_STACK_OPTION(0, EndFrame) -END_STACK_OPTION(1, End) -END_STACK_OPTION(2, EndChild) -END_STACK_OPTION(3, PopStyleVar) -END_STACK_OPTION(4, EndGroup) -END_STACK_OPTION(5, EndCombo) -END_STACK_OPTION(6, TreePop) -END_STACK_OPTION(7, EndTooltip) -END_STACK_OPTION(8, EndMainMenuBar) -END_STACK_OPTION(9, EndMenuBar) -END_STACK_OPTION(10, EndMenu) -END_STACK_OPTION(11, EndPopup) -END_STACK_OPTION(12, EndDragDropSource) -END_STACK_OPTION(13, EndDragDropTarget) -END_STACK_OPTION(14, EndChildFrame) -END_STACK_END -//enum ImGuiWindowFlags_ - -//enum ImGuiInputTextFlags_ - -//enum ImGuiTreeNodeFlags_ - -//enum ImGuiSelectableFlags_ - -//enum ImGuiComboFlags_ - -//enum ImGuiFocusedFlags_ - -//enum ImGuiHoveredFlags_ - -//enum ImGuiDragDropFlags_ - -//enum ImGuiKey_ - -//enum ImGuiCol_ - -//enum ImGuiStyleVar_ - -//enum ImGuiColorEditFlags_ - -//enum ImGuiMouseCursor_ - -//enum ImGuiCond_ - -//struct ImGuiStyle - -//struct ImGuiIO - -//namespace ImGui - -END_STACK_START -END_STACK_END -//class ImVector - -//struct ImGuiOnceUponAFrame - -//struct ImGuiTextFilter - -//struct ImGuiTextBuffer - -//struct ImGuiStorage - -//struct ImGuiTextEditCallbackData - -//struct ImGuiSizeConstraintCallbackData - -//struct ImGuiPayload - -//struct ImColor - -//struct ImGuiListClipper - -//struct ImDrawCmd - -//struct ImDrawVert - -//struct ImDrawChannel - -//enum ImDrawCornerFlags_ - -//enum ImDrawListFlags_ - -//struct ImDrawList - -// IMGUI_API void DeIndexAllBuffers(); // For backward compatibility or convenience: convert all buffers from indexed to de-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering! -/* -IMGUI_FUNCTION_DRAW_LIST(DeIndexAllBuffers) -DRAW_LIST_CALL_FUNCTION_NO_RET(DeIndexAllBuffers) -END_IMGUI_FUNC -// IMGUI_API void ScaleClipRects(const ImVec2& sc); // Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than ImGui expects, or if there is a difference between your window resolution and framebuffer resolution. -IMGUI_FUNCTION_DRAW_LIST(ScaleClipRects) -IM_VEC_2_ARG(sc) -DRAW_LIST_CALL_FUNCTION_NO_RET(ScaleClipRects, sc) -END_IMGUI_FUNC -*/ -//struct ImDrawData - -//struct ImFontConfig - -//struct ImFontGlyph - -//struct ImFontAtlas - diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt old mode 100755 new mode 100644 index 1475461e..29d6a37c --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -5,3 +5,4 @@ add_subdirectory(test_locks) add_subdirectory(test_expansion_nt) add_subdirectory(test_HLBFGS) add_subdirectory(test_RVC) +add_subdirectory(test_logger) diff --git a/src/tests/test_logger/CMakeLists.txt b/src/tests/test_logger/CMakeLists.txt new file mode 100755 index 00000000..eb52d114 --- /dev/null +++ b/src/tests/test_logger/CMakeLists.txt @@ -0,0 +1,5 @@ +aux_source_directories(SOURCES "" .) +vor_add_executable(test_logger ${SOURCES}) +target_link_libraries(test_logger geogram) + +set_target_properties(test_logger PROPERTIES FOLDER "GEOGRAM") diff --git a/src/tests/test_logger/main.cpp b/src/tests/test_logger/main.cpp new file mode 100755 index 00000000..91cd524a --- /dev/null +++ b/src/tests/test_logger/main.cpp @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2012-2014, Bruno Levy + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the ALICE Project-Team nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * If you modify this software, you should include a notice giving the + * name of the person performing the modification, the date of modification, + * and the reason for such modification. + * + * Contact: Bruno Levy + * + * Bruno.Levy@inria.fr + * http://www.loria.fr/~levy + * + * ALICE Project + * LORIA, INRIA Lorraine, + * Campus Scientifique, BP 239 + * 54506 VANDOEUVRE LES NANCY CEDEX + * FRANCE + * + */ + + +#include +#include +#include +#include +#include +#include + + +namespace { + using namespace GEO; + class DoIt { + public: + void operator()(index_t i) { + index_t tid = + (Thread::current() == nullptr) ? 0 : Thread::current()->id(); + Logger::out( + "Thread" + String::to_string(tid) + ) << "counter=" << i << std::endl; + } + }; +} + +// Tests the logger when multiple threads are running. +// Current implementation displays a bit of garbage (mixed +// outputs between threads), but at least it does not crash. + +int main(int argc, char** argv) { + using namespace GEO; + + GEO::initialize(); + CmdLine::import_arg_group("standard"); + if(!CmdLine::parse(argc, argv)) { + return 1; + } + try { + DoIt doit; + parallel_for(doit, 0, 10000); + } + catch(const std::exception& e) { + std::cerr << "Received an exception: " << e.what() << std::endl; + return 1; + } + + return 0; +} +